I'm looking for a magnetic encoder solution that works from 0 speed and is robust to EMI for a combat robot. I think the PWM signal from an AS5047U will work for this. I'm interested in implementing the code for this and contributing it. I'm looking for some feedback on how to implement that.
Reasons I'm doing something new: With ABI you have to spin the motor open-loop after power-on or reset, which interacts poorly with drivetrains (jerkiness at the start) and flywheels (hard to make it move open loop). I'm also seeing a lot of noise (usually not enough to have trouble spinning up enough to switch to sensorless, but it's still concerning). This is with shielded sensor cables; unshielded ones don't work at all. I've seen enough reports of noise problems with SPI I'm ruling that out. My VESCs end up fairly far from the encoders for space reasons, and the EMI inside these robots is terrible.
TIM3 (the one used for ABI when that's enabled) supports measuring the on time and period of a PWM signal. I'm planning to use that on the A encoder input pin.
The PWM signal from this encoder is effectively a duty cycle, which is capped at under 100% (so you can always find the beginning), and has a lower bound for error detection. It has a nominal period of around 1.8 ms. How should the encoder code handle receiving a pulse length indicating an error, or not receiving any pulses for some timeout?
Any interest in adding parameters for nominal period, minimum duty cycle, and maximum duty cycle to make this configurable for other absolute PWM encoders? For example, the US Digital M3K could be used with different values for those numbers.