Hoverboard AntiCogging/Manual Cogging Reduction?

I’ve a replacement ODrive (v3.6 54v) for the one I fried and I’m back up and running, I’ve run through the procedure to tune the motors in velocity control mode and while running they’re smooth. Sadly when I come to a stop the motors just oscillate as if they’re trying to find their set point and failing. I’m guessing this is due to the witchcraft involved inside the PID loop which I’ve never been able to get my head around.

I’m using velocity ramping on the input, this is all controlled over USB using the Python library.

After following the tuning procedure my vel_gain is ~11 and vel_integration_gain ~16 for each motor, pos_gain is set to 0 as I’m only ever in velocity control mode. If I reduce vel_int_gain and increase vel_gain (as per other topics) it doesn’t seem to help. If I reduce both it settles down but I have considerably reduced torque and as this is for a cargo bot it’s crucial I have that available.

Does anyone have any suggestions on how to reduce the cogging at low speed and vibrations at 0 please? Is anticogging an option with hall sensors as I’ve not had any success trying that procedure. The motor either spins like crazy for a while then just vibrates or, just vibrates. I’m not sure if it’s supposed to do that until it can figure out what it needs to know or not? I’ve left it for five minutes or so and nothing seems to change but I can hear the motor controller whine changing pitch so it seems like something is going on?

I’ve managed some improvement by increasing the encoder bandwidth to 300 on each motor and retuning. Still a bit jittery but a big improvement. Any other tips would still be welcomed

I’m glad you’ve managed some improvements! Unfortunately there will always be noticeable cogging with HALL encoders, especially at lower speeds. If you need smooth, slow rotation then I would suggest something like our BotWheels that have an integrated incremental encoder, the higher resolution between the HALL phases makes a huge difference.

You could also try enabling gain scheduling, this should help with the vibrations at 0rps.

Thanks, I’ll give gain scheduling a go. Is there any more documentation on it please as I’d like to understand what it’s doing in case I see odd behaviour and need to track down the cause?

Also, what do hoverboard controllers do differently than the ODrive? They’re designed to work smoothly at 0 rpm to keep people upright after all. Is it just that they’re optimised for it whereas the ODrive is designed around having a higher resolution encoder?

Things end up being a bit easier to control when you have a human standing on them - smooths out the torque ripple :wink:

Ha! Well that certainly helps but I’ve seen the hacked hoverboard controllers run slowly without ripple, I know there’s a lot of witchcraft involved in brushless motors. I’ve one I’ve not hacked yet which I’ll be trying out before long but just trying to find any things I can on the ODrive before I go that route.

Hi Nicholas,

Just to clarify, does gain scheduling have an effect in velocity mode or is it only active for position mode? I’m using the former and it doesn’t seem to have an effect, I’m wondering if there are other values I need to change to make this work.

Otherwise, I can try changing the gain values myself while the bot is running to get the same effect. If something is already built in that I’m not using properly though I’d rather figure it out. :slight_smile: