Calibration fails, width encoder pulses vary

This is what I have:

Encoder CUI AMT 102. 2000 cpr, but as encoder is mounted on gearbox axis 1:20, it is 100 counts per motor rotation.
Motor: BLDC, 2 pole pairs, 24V, rated current 10A
Power supply 24VDC

Test1:
I turn the encoder hole about 1 rotation by hand with a screwdriver. odrv0.axis0.encoder.shadow_count = 2008 OK.

Test2:
I now mount the encoder onto the gearbox axis on which also the wheel is mounted.
In my settings I have: odrv0.axis0.encoder.config.cpr = 100

Command: odrv0.axis0.requested_state = AXIS_STATE_FULL_CALIBRATION_SEQUENCE
Wheel turns in one direction and then stops. Error encoder = 2
odrive pulls 1.2A during calibration cycle.
Scope: Both signals clean blocks, no noise, but encoder pulses vary in width, the widest is almost twice as wide as the narrowest.

Test3:
I turn the wheel with my hand as constant as I can.
Scope: now shows constant pulse widths.

Anyone can tell me what is wrong here? Maybe vibrations of the motor but maybe there is a parameter to compensate that?
Thanks a lot!

  1. The ODrive knows how many poles does your motor have, and tries to run the entire rotation of the motor. However, it will not see the entire rotation of the encoder, hence an error. Maybe you can set the “effective count of poles” (actual poles * gearbox ratio) in the settings so that ODrive attempts to rotate the field at least that many times.

  2. The gearbox is not perfect, and adds vibration to the input. THat’s a normal consequence of having teeth that are somewhat less than perfect. Depending on the quality of manufacture of your gearbox, the effect magnitude might be from unnoticeable up to unacceptable. Hence, I am not surprised that the output shaft will vibrate->produce encoder pulses of varied width.

The CPR of the encoder should have been accurate.
In my case, errors due to free play such as gears were not allowed.

Thanks, Grey and Hjoungjoo.
I think the lesson learned is to mount a CUI encoder directly onto the motor.
I have now bought an ODrive D5065 with an axis at both sides, allowing me to place the encoder at the back of the motor. I now got successfully through the calibration.
With the previous motor, it was not possible as the front axis was too thick for a CUI and there was no back axis to mount something on.

1 Like