Moving the motor in counts (not Turns)


I’m now playing with the motor and the odrive board and I don’t found the way to make the motor movements in counts. It is moving by turns.

odrv0.axis1.controller.config.control_mode = CONTROL_MODE_POSITION_CONTROL
odrv0.axis1.controller.input_pos = 120 // This code make 120 Turns

odrv0.axis1.controller.move_incremental(15,True) // This code makes 15 Turns in relative position

Can I enter the information in encoder conuts instead of turns?


Hi RaulG,

You can just divide your input_pos by your encoder’s CPR.

1 Like

Thanks Solomond,

But I don’t like the idea to work with Floats with a 8 bits microcontroller controlling the ODRIVE… It’s easier work with long INT.

Really the Odrive cannot work with encoder conuts?


Hey Raul,

We definitely assume an external microcontroller is able to send position in floating point turns. What microcontroller are you using? There may be an optimized softfp library you could use to quickly convert from ints (or fixed point numbers) to scaled floats.