AS5600 Magnetic Rotary Position Sensor - Setup

I’ve been trying to get this sensor working for quite a while.

In theory, its a great sensor with huge potential but I’ve failed to get it up and running.





So maybe, somebody can give some advice.



Hardware Setup:

Motordriveshaft with magnet propped on

AS5600 fixed next to it



Software:

is up and running.

I get a reading of the “raw angle” and “get AGC” is working too



But now the problem starts, because till now, I’ve not been able to get a linear reading from raw angle, obviously I have problems with:
[list][/list]my magnet is not centred on the axis
[list][/list]the distance of my as5600 to the magnet is not ok
[list][/list]my as5600 is not centred on the magnet
[list][/list]the as5600 is not parallel to the magnet



you see, in theory quite a good sensor but practically not easy to set up.



[size=150]Big question here, is how to physical set up the as5600 with the magnet to get linear readings?[/size]



the data sheet says:

“The typical airgap is between 0.5 mm and 3 mm. Using the AGC value as a guide, the optimal airgap can be found by adjusting the distance between the magnet and the AS5600 so that the AGC value is in the center of its range.”



so as I’m running the AS5600 on 3.3v, I’m expected to get a reading of between 0 and 128 counts. Which I do.



When I turn on the motor, the AGC value fluctuates somewhere between 0 and 128.

so in which N / S position of the magnet must my reading be 64? How do I now what the position of my magnet is (where is N where is)?





Anybody out there, who can give advice on how to physically set up the as5600 and a magnet?

With what readings did you set up the as5600 in reference to the magnet?