Controlling Odrive velocity using STM32 Bluepill

Hello all,

I am trying to interface a STM32 Bluepill with a my odrive to control the velocity of the motor. After reading through the docs it seemed the easiest way would be to mimic a RC pwm receiver as demonstrated here. However, I seem to be running into an issue getting the pwm_mapping_endpoint to actually write to the axis.controller.input_vel .

I tried swapping the line
odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis0.controller._input_pos_property
to odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis0.controller._input_vel_property
however that throws a non-meaningful error (perhaps the docs are outdated for the firmware?).

I found a similar thread here, however I believe this is also outdated for the firmware.

Any help would be appreciated!

EDIT: Got a friend to help me set up UART communication. Works so much more seamlessly!

2 Likes

@Samuel will have to give some info here to help.

odrv0.config.gpio4_pwm_mapping.endpoint = odrv0.axis0.controller._input_vel_property works fine for me. I tried on odrivetool v0.5.3.dev (sudo pip3 install --pre --no-cache-dir --upgrade odrive).