As5600 magnetic encoder problem reading with i2c

Hi I bought 3 as5600 and i'm having problems when reading the magnetic encoder, i'm using i2c to read but it's jumping the angle, for example it starts reading from 300 goes up to 400 and back to 300 again (it's just an example it's not the real numbers), I tried all 3 encoder and they have the same problem, only one of them worked a day more when I tried to connect again gave the same problem (sorry if i'm using the wrong forum it's my first time)

1 Like

Please show your code and a link to the datasheet.
What's your angle range you want to detect?
How do you position the magnet?

The magnet is positioned behind a stepper motor shaft (it's centered I already checked) i'm turning the motor shaft by hand just to see if the encoder works, the code i'm using is the readAngle example from this library GitHub - kanestoboi/AS5600: An Arduino library for the AS5600 magnetic encoder it should read 0-4095 just that and I tried another code from curious scientist, this code actually show me that's reading like the 1st quadrant and then goes back to the fourth and back to 1st again and again (sometimes changes but always just 2 quadrants are been reading) and here's the datasheet https://ams.com/documents/20143/36005/AS5600_DS000365_5-00.pdf

here's the curious scientist code AS5600 magnetic position encoder — Curious Scientist

Perhaps you mounted the magnet in the wrong orientation?
Magnet too strong?

I don't think it's too strong because the example from curious scientist actually show a lot of information like the quadrant and if the magnet is strong or not, and it's showing it's normal not too strong or weak, and sorry what you mean by wrong orientation I think the magnet are equal on both sides like half south/north

Hi unknownrobots,

Just wondering have you already solved this problem? I met this same problem couple days ago and couldn't figure it out. Can you share some experience? Thanks alot

G

I had issues with the ams5600 too. Tried multiple libraries, non reliable data. Until I tied DIR to gnd (or vcc). If left floating you get weird data. Is your DIR line floating?

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.