I've Found an interesting thing about AS5047P with ODRV

Hey,Guys.
Now when I’m doing my project, I found a strange and interesting thing.
My device is Odrive_V3.5_24V,and my encoder is AS5047P.
The CPR of that encoder should be 4000,while when I’m debugging, it is always wrong.
And I use the function,(<ordv.axis>.encoder.config.cpr ),I found that the number is under 3000, so I input 3000 as my CPR of the encoder. Thanksfully, it works. But it makes me wondering.
Can someone tells me what happend?



Here is the Screenshoots.
Thanks ALL!

The AS5047P has a different CPR when connected over SPI than when on A/B/I, and I think it is always a power of 2.

On SPI it should be 16384. If you’re using A/B/I then maybe it should be 4096 or 2048, but certainly not 4000.

Hey @AlbertDT!

As towen mentioned, the AS5047P has a couple interfaces you can use. From the datasheet (page 19), the default settings for the incremental interface is binary mode with 4096 CPR.
There is also a decimal mode available and that supports a CPR of 4000 (but is not the default).

How are you checking the CPR you’re getting? I would mark your starting position, then rotate the motor by hand as close to one perfect revolution as you can.

Also in your screenshots you seem to be using axis1 but set the cpr value of axis0?

Hope that helps