The “red” range (see Q29:At which magnetic field levels do I get a MagInc/-Dec, LIN- and COF-Alarm?) does not distinguish between too weak and too strong magnet. However, there are several ways to tell the difference:
1) check fluctuations of the SPI interface:
If the magnetic field is weak, there will be more noise, resulting in a fluctuating angle information at the SPI interface without magnet, the fluctuation will be highest. If the magnetic field is strong, the SPI angle information will be stable within +-1/2 digit.
2) chose a magnet that is not too strong or far enough away so it never reaches the “too high” alarm.
It must be verified by the customer that with this setup also does not generate a “too low” alarm in normal operation, only in a failure case.
3) switch to alignment mode:
Without a magnet, the alignment mode reading will be close to zero (only noise). However, the reading must be near zero over a full turn of the magnet, as there may be situations where a misaligned magnet also reads close to zero at certain angles.
5) Check the incremental outputs in step/direction mode
Similarly to 1) above, a method can be used that does not require the SPI interface at all. Furthermore this method can be used also while the motor is spinning:
I) put the AS5040 in “Step / Direction” incremental mode, either permanently by user OTP programming or temporarily
II) Monitor the incremental output signal B_Dir_V.
In “Step/Dir” mode, this signal indicates the direction of rotation. For clockwise operation, it is constantly high, for counterclockwise operation, is is constantly low. When the magnet is not rotating, it remains at the last setting before it stopped.
In normal operation, with a magnet properly attached, the signal only changes state when the direction of rotation is reversed.
Without a magnet however, the encoder will pick up only noise and the incremental outputs will be fluctuating.
Consequently, when the incremental output signal B_Dir_V changes state repeatedly over a short period of time (e .g within a few milliseconds), this is a clear indication that no magnet is present or the magnetic field is very weak.
This test can also be used while the rotor is rotating, as the signal B_Dir_V will always be constantly high or low, depending on rotation direction. if the motor shaft holding the magnet is rotating in one direction and the signal B_Dir_V is fluctuating, this is a clear signal that the magnet is broken or has fallen off.