Arduino-FOC-drivers icon indicating copy to clipboard operation
Arduino-FOC-drivers copied to clipboard

Added CPR configuration option to SC60228 Encoder

Open josephduchesne opened this issue 3 years ago • 3 comments

The SC60228 encoders that I have are reporting 2048 ticks rather than the expected 4096. This is probably an SPI register setting, but I can't find documentation on the chip's register map.

As a solution (interim maybe?) I'm proposing making the encoder ticks a parameter, placing it 2nd in the list since I suspect it's more likely to be overridden than the SPI settings.

josephduchesne avatar Sep 09 '22 19:09 josephduchesne

May I ask which MCU you are using? Could you try changing the SPI mode to see if it makes a difference? I recently noted a similar thing for the MT6701 sensor, where some MCU types read an extra bit at the start, and others do not...

runger1101001 avatar Sep 09 '22 20:09 runger1101001

If we can figure out what's causing the problem and fix it, or at least figure out the MCU types that have it one way vs the ones that have it the other, we can fix it in the code and not make it up to the user... users will find it difficult otherwise.

runger1101001 avatar Sep 09 '22 20:09 runger1101001

That's a good point. I'm using a STM32G031F8. I'll see if there's an SPI configuration option that helps.

josephduchesne avatar Sep 09 '22 20:09 josephduchesne