The ERROR and ENABLE GPIOs on the ODrive provide a very simple interface to change and monitor the axis state with two digital signals. They are useful to complement other basic interfaces such as Step/Direction or PWM Input.
ODrive Pro and S1 have a designated ERROR and ENABLE pins. If you need to use different GPIOs, or on ODrive Micro, you can manually assign any input GPIO to
The ERROR output, when enabled, is high whenever there is any error condition or
error status on the ODrive, that is, if any flags in
disarm_reason are set.
It can be cleared by removing the error condition and calling
clear_errors() through any interface
or pulsing the ENABLE pin logic low (see below).
To use the ERROR output:
Enable the GPIO:
config.gpioX_mode = GpioMode.STATUS, where X is the ERROR GPIO number (see pinout). Needs a reboot to take effect.
When enabled, the ODrive’s ENABLE input allows to switch between IDLE and CLOSED_LOOP_CONTROL states.
The ENABLE input is not intended as an E-Stop. In particular, it can’t be used to abort calibration states, even the ones that move the motor.
To use the ENABLE input:
Enable the GPIO:
config.gpioX_mode = GpioMode.DIGITAL_PULL_DOWNor
DIGITAL, where X is the ENABLE GPIO number (see pinout). Needs a reboot to take effect.
If the ODrive is in IDLE, a logical rising edge on ENABLE clears the errors and puts it into CLOSED_LOOP_CONTROL. This is equivalent to calling
clear_errors()and then setting
This has the following implications:
When the ODrive boots or reboots while the ENABLE pin is already asserted, it will not immediately go into CLOSED_LOOP_CONTROL. In this case the ENABLE pin must be pulsed logic low first.
When the ODrive disarms the motor due to an error, the ENABLE pin must be pulsed logic low to clear the error and go back into CLOSED_LOOP_CONTROL.
In calibration states, the ENABLE input is ignored.
While the ENABLE input is held logic low, other interfaces (USB, CAN, UART, Web GUI) cannot be used to put the ODrive into CLOSED_LOOP_CONTROL.
If other interfaces are used to fetch more detailed error information, this must be done before deasserting ENABLE.