Hello ODrive community,
I am currently building an Inverted Pendulum using a Raspberry pi4 and the odriveboard.
Since my application is running on c++ i would like avoid having to write driver for the odriveboard (for the moment) and send the actuation signal to the odrive through pwm.
I want to utilize torque control, and have succesfully used the odrive without pwm input.
However when I try to set the target torque through PWM, the duty cycle outputtet by raspberry pi does not map correctly to the range defined in the odrive.
Let me explain better:
Raspberrypi output:
pwm frequenzy = ca 50 Hz
pwm range = 640
Odrive PWM config:
odrv0.config.gpio4_pwm_mapping.min = -5
odrv0.config.gpio4_pwm_mapping.max = 5
When the raspberry pi outputs a pwm signal with dutycycle ~0 I would expect a target torque of around -5 and for pwm dutycycle ~100% i would expect a target torque of 5.
However the target torque visualized by the odrivetool starts moving above -5 only at around 25% and and plateus at -5 when utilizing a pwm dutycycle of around 75%.
When changing the frequency the ODrive shifts the mapping from pwm to output torque unpredictably.
Does the Odrive expect a specific pwm frequency ?
Or why is it behaving this strange ?
Thanks in advance for any help or hints that I might get !!