I'm using a Grove AS5600 12-bit magnetic sensor to provide positioning for a model railroad turntable on my layout. Right now, it's getting into summer here in Australia, and the garage in which I have my model railroad heats up during the day.
I've noticed that the turntable has started behaving erratically with regards to positioning. If I turn it off and on again, it will settle on different positions as its initial alignment. Sometimes it will even go in two or three full circles before stopping.
I'm aware that heat can affect magnetism, and I'm wondering if that may be the case here? If so, what is a way for me to get around it? I've considered a different sensor, but I'll need 12-bit precision, and all the 12-bit rotary sensors I can find seem to be magnetic ones.
I wouldn't think so. At the most the sensor might loose some sensitivity. I don't know the AU temperature range but I would guess it won't get much above 40 °C, not very hot for a semiconductor.
Magnets will loose magnetism with temperature but its a permanent effect and again 40°C is not very hot.
How long are your I2C wires to the sensor? I wouldn't think they are effected by temperature but maybe they don't have a lot of design margin.
Is you power supply solid? Sometimes regulators are asked to dissipate more power than they like increasing ambient could matter.
It is only permanent if the temperature is above the Curie point. Curie Temperature
My soldering iron has a magnet in the tip and achieves temperature control by turning the heater off when the magnet looses its ability to hold a reed switch. You get different tips for soldering at different temperatures.
As to the problem. The data sheet for this sensor can be downloaded by clicking this link. AS5600 Datasheet pdf
It quotes the temperature range of the sensor as:-
So are you using the programming facility in your code for controlling the turntable?
However, I suspect this is just a parameter that can be set in one of the registers and not the range that programming will work.
Also there is this information:-
AGC Register
The AS5600 uses Automatic Gain Control in a closed loop to compensate for variations of the magnetic field strength due to changes of temperature, airgap between IC and magnet, and magnet degradation. The AGC register indicates the gain. For the most robust performance, the gain value should be in the center of its range. The airgap of the physical system can be adjusted to achieve this value.
My guess would be that what is happening is that there is some expansion of something that is affecting the size of the air gap. So this problem might be solved by trying to reduce the air gap on your physical interface between the sensor and the turntable.
That sounds like a more likely possibility. The magnet is on the drive shaft of a stepper motor, and the sensor on a bracket below it. Originally the bracket was wood, but then I replaced it with a plastic one. This one seems to be less affected by heat.
I spent a couple of hours since I first posted this thread installing a manual override, to allow me to align the turntable via an SPDT momentary switch on the panel. Of course, as soon as I did that, it started working again.
Do you need the magnetic sensor at all? The stepper will already give accurate positioning once it has a known home position, and a simple opto could provide that. My CNC mill uses steppers and though best practice is to re-reference the machine each time it's turned on, in practice both the machine and controller (Mach3) come up very close to the last position at shut down (within 0.1mm or so). So while ideally you might re-home your turntable on switch on, in practice if the controller remembers the position in flash there should be minimal movement of the stepper on switch off and you could just home "on the fly" in normal use.
Yes, 2:1 reduction plus ball screws. I also have a clock that uses 2 steppers with drv8834 drivers driving direct though the torque demand is very small. But I've never had any issues with losing steps on the mill, a lathe, or the clocks. Obviously the gears improve the resolution and reduce the torque you need from the stepper. Presumably your stepper drives the turntable direct?
It wasn't lost steps - the turntable wasn't picking up where it was supposed to stop. It was even doing full revolutions, and stopping at different points each time I rebooted it.
As for the stepper, it does drive the turntable directly. It's a double-ended stepper, with one shaft going up into the turntable bridge. The other end of the driveshaft has the magnet on it.
I wonder if that was caused by searching at a stepping motor speed that was too fast. That would cause an overshoot to occur because the motor would not be able to stop dead. Especially if you were accelerating the speed the longer the motor was running. Then the overshoot and the error would depend on how long the motor had to run to reach the index point.
The other thing that could cause this error is if the index detector was indicating it was already at the index mark. If that is the case you need to back up until it is uncovered before starting the search again.
What was the index detector? An optical slot detector is normally used for things like this.
The magnet sensor is the position detector. There's no acceleration or deceleration, and no 'index detector'. This has worked for 2 years, except for when it heats up in summer.
If my memory serves me the thermal sensitive component is not the magnet but a temperature sensitive magnetic shunt. I don't recall the alloy. As you stated, once the curie temperature is reached the magnetic flux is lost and the magnet must be re-magnetized.
How far is your magnetic from the sensor (or vice versa)? Can you simulate the failure mode by moving the sensor away from the magnet?
Is the magnet attached to the stepper shaft in such a way the flux is being shunted through the shaft? I realize this is unlikely to be your temperature issue but it could move the operating point to a marginal condition where other movement could cause an issure.
Not sure what you mean here. There is a magnet on the base of the tip which will pick up paper clips and the like.
But a general property of a permanent magnet is that at a certain temperature it will loose its ability to be a magnet. This is only a temporary loss if the temperature is below the curie point, above it and it becomes permanent.