High performance motor control
View the Project on GitHub odriverobotics/ODrive
Help improve these docs: submit edits using the link in the top right.
If you need help, please search or ask the ODrive Community.
GPIO | primary | step/dir | other |
---|---|---|---|
GPIO1 | UART TX | Axis0 Step | Analog input, PWM input |
GPIO2 | UART RX | Axis0 Dir | Analog input, PWM input |
GPIO3 | Axis1 Step (+) | Analog input, PWM input | |
GPIO4 | Axis1 Dir (+) | Analog input, PWM input | |
GPIO5 | Analog input (*) | ||
GPIO6 (*) | |||
GPIO7 (*) | Axis1 Step (*) | ||
GPIO8 (*) | Axis1 Dir (*) |
(+) on ODrive v3.4 and earlier
(*) ODrive v3.5 and later
Notes:
axis.config.<step/dir>_gpio_pin
.For predictable results, try to have only one feature enabled for any one pin. When changing pin assignments you must:
odrv0.save_configuration()
odrv0.reboot()
Analog inputs can be used to measure voltages between 0 and 3.3V. Odrive uses a 12 bit ADC (4096 steps) and so has a maximum resolution of 0.8 mV. Some GPIO pins require the appropriate pin priority (see above) to be set before they can be used as an analog input. To read the voltage on GPIO1 in odrive tool the following would be entered: odrv0.get_adc_voltage(1)