Low cost magnetic angular sensor with analog sine and cosine outputs

I noticed this relative new angular sensor from Allegro Microsystems:
https://www.allegromicro.com/-/media/files/datasheets/a33230-datasheet.pdf?sc_lang=en

The price level is about 1 euro. They come in a 1000 Gauss and 300 Gauss version.

When you already use powerful MPUs with two ADCs and a FPU, then it is easy to measure two analog values from this sensor as well. The normal sensors with a digital interface got the problem, that you cannot exactly put a time stamp on the measured value, because they use an internal free running clock to measure and calculate the measured fields. I think the software gets less complicated too, because you do not have to consider a fast serial protocol or fast interrupt signals for AB inputs, that can have problems at high speeds of motors. So from my perspective I recommend to use such sensors.

Thanks for the heads-up! Sounds like more or less the same thing as the usual magnetic encoders, but with analog interface rather than digital. I think we would want the XY version to measure rotation of a magnet on the end of the motor shaft. It should be usable with the LinearHall class in the drivers repository, set to 1 pole pair.

I do prefer analog in general, but it’s troublesome on STM32 due to the abysmally slow implementation of analogRead. It’s fine if you can just write your own ADC code from scratch, but if you need to combine it with lowside current sense then you’d have to work with the HAL library and that’s torture.

Yes. It is like a simpler version of the normal XY sensors used with a magnet on the end of the motor shaft.

Thanks for the comment. I got no idea about the actual possible software implementations, that seems to be more difficult to realize. I like it only from a hardware and low level software perspective.

When you use lowside current sense, I guess that you like to be able to use the ADCs for other purposes as well with SimpleFOC. Is it a general challenge to do that? Should you then look for MPUs with more than two ADCs?

It seems that some more difficult low level software needs to be created specific for this purpose to use such kind of a sensor. It could be, that after every time you have measured the two currents, you make a measurement of these two magnetic field signals as well.