Digital GPIO mapping to do start/stop function

I am trying to find a way to map one of the GPIO pins to start the motor when it receives a 5V signal and stop when it doesn’t. Additionally, I could map another GPIO pin to send a stop signal.

I am currently using firmware version 0.5.6. I have programmed the Odrive to operate in the AXIS_STATE_CLOSED_LOOP_CONTROL state using the hall encoder in CONTROL_MODE_VELOCITY_CONTROL.

Despite its simplicity, I can’t seem to find any related topics or solutions to this problem.

Hi there,

Enable pin isn’t supported on v3.6, just S1/Pro. You could modify the firmware to add support, or add a small external microcontroller to control the ODrive over UART from its own GPIO pins.

Alternatively, if it’s okay for the motor to always be enabled (e.g. holding zero speed when the motor’s stopped, versus just idling/freewheeling) you could use analog inputs as a mapping to velocity setpoints.

1 Like

I was considering sending a 0% or 100% PWM signal to the controller, but mapping an analog input could also achieve the desired outcome.

As I’m new to the DIY world, I’m not yet confident in my ability to program a UART to control the Odrive. While I could learn, it might be best to keep the control solely within the Odrive.

I’ll explore this further. Thank you for your assistance.

Sure, that should work. PWM is definitely more robust than analog, though the UART should also be pretty straightforward with an Arduino.