Any suggestions to replace AS5048A?

Hello everyone,

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 :slight_smile:

MT6701
MT6835
MA702
MA330
SC60228

These are a few models that cost less than the AMS ones and work with SimpleFOC…

2 Likes

Hi @runger , thank you for your suggestion :slight_smile:

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.

Greetings and many thanks for your suggestions

Hey @JorgeMaker ,

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.

1 Like

I’ll try the MT6835. From what I’ve seen it’s half the cost of the AS5048A with more resolution and a lot of versatility in terms of available outputs :slight_smile:

Thank you very much for the suggestions

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.

1 Like

@dfrenkel you can also look at the thread for “Field Stack STSPING4” which is using the MT6835 for stepper driver.

1 Like

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

In my understanding MT6835 is fully supported by SimpleFOC library using an SPI interface without having to do any extra coding. It isn’t it?

Reading the datasheet is seems that a TVS diode is recommend . Do you know if there is any special requirement for such component ?

Regards!!!

Nope, not on STM32G4 anyways. I was up all night trying to make the driver work.

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.

1 Like

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 ?

I always work with MCUs with Vcc of 3.3v so my understanding is that I do not need to use the TVS diode :slight_smile:

Thanks for the clarification.

I’m not sure you can even get 5v TVS diodes that clamp to 6v?

I agree, it’s a weird spec.
Maybe something like this? 3v3 clamp to 5v5

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.

2 Likes

Thank you! That project has been very helpful to learn about