[SPARKFUN IOT BRUSHLESS MOTOR DRIVER] TMAG5273 ENCODER JUMPING

Hello, at this point in my project I’m just trying to get angle data from the TMAG5273 hall effect sensor built in to the IOT motor driver board.

What I’m experiencing is that the data ‘jumps’ around, however this is not due to sensor noise. When working with the angle conversions from the sensor it specifically jumps by 16° in the positive/negative direction depending on the rotation. This seems to be tied to desync in the LSB and MSB registers being read as a rollover in the LSB equates to 16°. If the ‘encoder’ happens to be resting at one of these 16° intervals, the data fluctuates by an unacceptable amount. When working with the per-axis data directly this desync doesn’t seem to be an issues, the data is however read very incorrectly (see attached).

I’ve currently tried digging into all manner of settings that the TMAG5273 has with no success. I’ve messes with the provided Sparkfun library for the sensor but I’m way in over my head and didn’t see anything wrong. Trying to filter the data has been a challenge as some kind of LPF that can handle the ‘noise’ is going to create far to much delay when I go to implement FOC with the motor. (though I could be wrong there, I’ve not yet gotten to closed loop FOC).

Anyone seen an issue like this before? At the moment I don’t know if it’s something with the Sparkfun TMAG5273 library or the sensor itself. Any input is appretiated.

Best Regards, Jason

I don’t have a lot to offer, but I think your best bet might be to apply a weighing average filter or similar…I asked 2 AI models and they both think it could be a timing issue and have a few suggestions, see below

https://poe.com/s/Xnzg9OUud2xcE7KKV5fl

https://www.perplexity.ai/search/Hello- … 7yut8UXA#0