In my previous designs I have always used an AS5048A as a magnetic sensor. I’ve never had any problem with that. They work very well but the price at which they can be found today is somewhat excessive since it is around €15 and there is a certain shortage.
Any recommendations for a magnetic sensor with similar features, that has an SPI interface, PWM output, and a more reasonable price? If it’s available at LCSC that would be perfect.
Greetings and thanks in advance for your recommendations
After looking at your suggestion: MT6835 looks pretty good in terms of functionality, although it’s a bit more expensive and seems to require a TVS diode to work. On the other hand, the SC60228 is cheaper, does not require any TVS diode but has more limited functionality.
I want to use the selected sensor with a stepper motor using SimpleFOC is a closed loop angle. I’m not sure if this has any effect on which sensor is best suited for my application.
For stepper motors, they usually have very high pole pair numbers like 50PP, sometimes even more.
So if the PP are high, then a precise sensor (many bits) is a good idea, since the electrical revolution is 1/50 x the mechanical revolution as measured by the sensor.
Hi @JorgeMaker, when you get around to making this can you report back on how the sensor works for your stepper motor? I am using the 12-bit AS5600 and it seems to work fine, but maybe it will be smoother or better in some way with a higher resolution? I’m only running at 500 RPM so I’m not sure how much resolution matters at this lower speed.
Yes, the MT6835, I have high hopes for it. One thing to consider though, since it is 21 bit, we have to ping/read it more then say 14bit. My end game is getting the hardware encoder interface up and running, that will drastically cut latency. I’ll try to time the SPI readout.
From what I can read in the datasheet, the clock period it can manage is 60ns, so it should be good for 15Mhz ~ SPI
I assume that STM32G4 is an exception that breaks the rule and for example it will work fine without any extra coding for STM32F1 or STM32F4 families. It is not like this?
I think @husky made it work, but im not sure on which MCU? Also @nikolaewich1988 has used the driver. I just ran a test with and without SPI.beginTransaction(); and using that does slow down the read times significantly. This is what the driver uses currently, so there is definitely room to optimize it. In my opinion it is best to set the SPI setting once, and then role with that. Not each time a read is done.
I wonder how fast the hardware encoder interface will be?
From what I can tell this is just to protect the chip from any sort of spiking on Vcc maybe from nearby inductive load. If you are on 3v3 supply voltage instead of 5V you might be able to skip this. If on 5V you are already very close to the max operating condition so I would not skip it in case you have any ripple developed on that rail. Datasheet spec 6V TVS and max operating is 6.5V IIRC.
I linked to a TVS part in the link above. They come insanely small (0402). I think they actually protect against ESD (Electrostatic discharge) as well, but not entirely sure. Maybe if it is grounded ?
yes, I have MT6835 running with SPI on a Nucleo board with STM32KC432 MCU.
Reading the 21bit raw angle works out of the box. But writing to the sensor to e.g. change ABZ resolution from 1PPR (factory setting!) to 14bit =16384 and/or persisting that entry via sensor.writeEEPROM is failing with the current version of the driver. I filed bug reports on this and @runger is working on that. I have patched the driver to bitbang the values over SPI to the sensor.