All the driver designs I’ve looked at use shunt resisters for current sensing. Shunts are certainly easy to use for low side sensing but harder to use for in-line sensing.
Is there any reason not to use Hall Effect sensors for in-line current sensing? Yes, they cost more than shunts but they provide perfect isolation from the high voltage motor supply. They eliminate the need for isolated differential amplifiers.
I did see they have a typical “fewuSecond” response time, but for reasonable motor speeds is this an issue?
Here is a part I think might work for motors driven by a SimplFOC mini-sheild. Very low cost too.
For more money toy canbuy chips like this rated to 100 amps.
I was thinking this too, that we should be using Hall effect sensors. But then I look and no one seems to use them, all the driver boards are using shunts. I’m new to this, so I figured there might be something I don’t know.
What I might do is make a breakt board with three of these $1 hall devces and ty to use them with my “mini sheild” on small gimbal motors. This would let me use the RP2040
Later plans… Thank you again for pointing out that JLCPCB has the drv8320 chip. But that chip lacks current sense amps. I figure I can design a 8320 based PCB that uses 30 amp Halls for inline sensing, AFTER I gain experience with the small size motors.
Here is my take on this. If you look at these hall-effect current sensors from Monolithic, they are sweet, no doubt, but all are in the 100kHz range. The MAX40056 is 300kHz with good PWM immunity. TI are launching the INA241 which has 1100kHz (un-obtanium / non-stocked) also with good PWM immunity.
I would love to se some real life comparisons between the two types PWM immune amplifiers and the Hall-effect type. With the NEMA23 design I’m currently working on for the STSPIN32G4 it would be quite easy to do some qualitative data acquisition. Ok maybe not easy, possibly.
Edit: INA241 are available … Hmmm… 1100 kHz should work with the STSpin32G4. Unfortunately its only the B5 model they have in stock (200V/V gain). For extreme high amp controllers those would make sense to use while limiting the heat, using a low resistance shunt. Low resistance, low voltage drop, low heat, high gain.
I’m trying to understand the need PWM rejection for inline current sensing. It would seem to me that you would want to average over several cycles, A low-pass filter before the ADC should do that. Then you can sample the filtered voltage at any time.
What time constant is needed for the low pass filter? I assume that if the control loop runs at 1Kz and about 1/1000 second is about right?
What I am thinking of doing is making a hall effect breakout board that is good for a few amps.
When you step back and look at the overall system design, in-line sensing is attractive because it allows you to use a wider range of microcontrollers. The RP2040 is nice because it is physically tiny and costs $1 each. Size and cost matters in a robot, where I might need to rack 12 or 16 driver boards in the smallest possible space.
It really is very aplicación specific. The Stepper sure is an atypical scenario with FOC since its many electrical “steps” makes it a bitch to control. I believe 50kHz switching frequencies are a good baseline for achieving top performance maybe even higher.
The PWM immunity basically means resistant to the noice from fast switching MOSFETs being almost part of the “inline” circuit (sense resistor), so it should output a clean and very responsive analog result
Just ordered the INA241B1 for the stepper scenario. It’s only 10V/V gain, so I’m hoping it won’t get too hot. Really the 20V/V is ideal, but it’s out of stock. If of course the heat is not an issue then it will have a larger voltage-range.
I think the shunt resistor will dissipate around 0.5W @around 5 amp, which should be within reason.
No, I just made up a round number. 1Khz is the rate at which the loop in the microcontroler runs. Not the PWM frequency.
So if the ADC samples the current N times per second, that is one time per loop, we need to low pass filter the signal such that Nyquist–Shannon sampling theorem holds.
The time constant of the filter depends on how fast is our microcontroller and what we place inside the loop. No one wants to be swapping out resisters on a board after every software change, so I have to choose a compromise value.
The PWM frequency adds some other problems that I admit to not understanding. Especially because the motor is an inductive load and I’d guess blocks anything in the pwm frequency range.
BTW, does anyone know where I could buy TODAY a driver for a 5010 size outrunner drone motor (0.9 ohms,between any two leads) As you can see, I’m guessing and not measuring. I need to take actually measurement on my scope t understand this, But it sees I need to build a driver board first. Chicken and egg problem. Got a link to something that can be FedEx shipped.
I promise to contribute back after I become more educated.
For inline sensing the required sampling frequency is related to the fidelity with which you want to sample the current waveform. This waveform’s frequency depends on the commutation frequency, which in turn depends on the speed you’re going and the pole pairs of your motor.
On the other hand, current sensing is also often used to implement over-current protection. Here the required bandwidth is determined by the dI/dt you want to be able to detect and protect against. Basically for the protection function the sensor should have infinite bandwidth…
Sampling the waveform isn’t such a challenge in inline sensing. For example, the commutation frequency for a 11PP motor at 1000rad/s is around 1.75kHz if I calculated that right. So sampling this with high fidelity is well within the capability of most ADCs.
Low-side sensing is another story, as the sampling has to happen in a very short time window…
Overcurrent protection is more difficult, and is generally implemented with hardware comparators in the designs I’ve seen (or built into the driver), as the reaction time of the MCU via the ADC is too slow.
AFAICT the only drivers you can get are either expensive ones from ODrive or Texas Instruments etc, or cheap ones on AliExpress. Things like this: