Hello,
I have noticed that my encoder’s raw output (odrv0.inc_encoder0.raw) does not align with the CPR that I have configured. Reading the raw data outputs values higher than 48,000 (up to 65,000) even though my encoder only has 48,000 counts per revolution. I turned the motor shaft by one full revolution and the counts do not line up - one revolution I saw a count of 3512, and on the next I saw a count of 48372 on nearly the exact same position.
During my encoder offset calibration, about half of the time it fails with the error: ProcedureResult.POLE_PAIR_CPR_MISMATCH
But the other half of the time I have success and there are no issues.
I have confirmed that the encoder does have a CPR of 48,000 - so I am not sure why the value that I have written to the encoder config is not limiting the raw output of the encoder. Snippet of code below to show what is happening. Any thoughts on why this is happening? Is there a CPR configuration that I missed somewhere?
Edit 1: This is on an Odrive Pro V4.4
Edit 2: It seems the raw encoder values are wrapping from 65,444 to 0. So it is counting up to 65,444 instead of 48,000.
In [47]: odrv0.inc_encoder0.config.cpr
Out[47]: 48000
In [48]: odrv0.inc_encoder0
Out[48]:
config:
cpr: 48000 (uint32)
enabled: True (bool)
pos_max: 0.8344270586967468 (float)
pos_min: 0.8344062566757202 (float)
pos_residual: 0.0 (float)
raw: 48372 (uint16)
status: 0 (uint8)