ODrive PRO encoder CPR problem

I have a 20000 cpr incremental encoder. i verified it by checking the “raw” in “odrv0.inc_encoder0” and it shows a 20000 difference when i make a full revolution by hand.

when i try “odrv0.axis0.requested_state = AxisState.ENCODER_OFFSET_CALIBRATION”, it says “ProcedureResult.POLE_PAIR_CPR_MISMATCH”.

I also know the motor has 9 pole pairs because i counted by hand.

Strangely, when i try to put cpr to 15000, it calibrates correctly. I can do position control but it only moves 3/4 of the way (the same with speed), but it often does spin out. I can not do torque control because it instantly does spin out.

just figured it out. I was counting the coils and not the magnets, so i got 3/4 of the correct number (the reason why 15000 cpr worked).

Now its working properly

Great to hear!