Lopsided wheel: Constant wheel speed with varying RPM


First time post, I’d like to say the odrive controller is great and is my go to motor controller. This my 4th project with it.

I don’t know if this can be done but figured odrive is a good start.

For my project I am trying to maintain a constant wheel speed with a wheel spinning off its center (lopsided). To do this I’ll need to vary the RPM through every rotation. Increase torque to get to the higher RPM then brake to drop to the lower RPM, repeat each rotation. I know I’m going to need to tweak the source code but wanted to see if anyone could give me a head start. If it works then eventually I’ll need to virtually move the wheel center externally via asic, PWM, etc.

Probably something like, if the encoder position is between 0-180 degree, set vel limit to 1500 RPM (or something proportional). Else (180-360 degree) set vel limit to 2000RPM.


Look into sensor less mode.

This is like the reverse of electronic camming. You have a cam, and you need to make it not cam. Really the only way to do this is going to be to calculate the position/velocity externally and stream those setpoints to ODrive. Let ODrive handle the torque required.

If you really want to do it in ODrive, then you want to intercept the command, figure out where you are in cpr (ODrive’s wrapping mode), then multiply the desired velocity by the ratio you need at that moment.