Encoder counts with hoverboard motor using pos estimate

I got a high torque hoverboard style hub motor and configured it according to the hoverboard guide. The motor has 30 magnets, a 6:1 gear ratio and the standard hall sensor wires. Therefore I set the cpr to 90.

Having configured everything following the guide, it seems to work correctly. When I turn the robot one revolution using my hand or vel_setpoint and check the position using axis.encoder.pos_estimate after spinning once I get 455. I understand this is counts? Should this value not be 90 after one revolution? or does my motor have a higher CPR?

Are you sure it’s not a 5:1 gearbox? 455 would be correct if so.

If you turn the output gear by one revolution, you are turning the motor by five revolutions. 90*5=450.

On the website we got it from it says 6:1 but I’ll check with the manufacturer cause they changed the motor for us to work with 24V so maybe the gear ratio now is 5:1?

This would be in line with what I’ve been experiencing with my speed and distance measurements, which I was multiplying by 0.2 (without knowing the reason behind it) to get accurate data.

So do I simply recalibrate my motors using CPR = 455?

450, not 455. But yes. :slight_smile:

Oops yeah! Thanks I’ll try that!

When changing to 450 I’m getting an “ERROR_CPR_OUT_OF_RANGE”. I tried increasing the calib range but that didn’t change anything.

Oh sorry I wasn’t thinking straight.

No, you recalibrate with CPR=90. But you will expect to move by 450 counts per actual rev of the wheel.

Aaah ok! I’ll just take it into account in my code then (dividing the counts by 450 to get revs)! Thanks!

1 Like