Current sensing in BLDC motor driver - Page 1
Forum section: electronics / projects

author: anvoice
author_rank: Frequent Contributor
timestamp: March 16, 2018, 03:05:55 am
content: I'm designing a brushless motor controller, and one of the sticking points at the moment is whether to use current sensing. I realize that would be useful for logging performance data, but I'm not sure that's necessary, and it complicates the design. An online search didn't yield much informative data on the cases where current sensing is desirable. If I can do without it, I would simplify my schematic a little by doing away with the shunt resistors, simplify my code, as well as be able to use a smaller (and cheaper) IC for driving the FETs (DRV8320 instead of the larger DRV8323). Could someone outline some basic advantages of using current sensing for a BLDC, or direct me to a good source of information on the topic? Thank you.

author: jbb
author_rank: Super Contributor
timestamp: March 16, 2018, 07:06:56 am
content: Current sense is quite important. If you don’t have a set of Hall effect sensors, current is the only feedback you get.If you do have a Hall effect sensor then you could perhaps try without current sense. But you would also not have protection for the motor, so it could cook itself with over current.

author: Glenn0010
author_rank: Regular Contributor
timestamp: March 16, 2018, 09:29:39 am
content: I am also designing a BLDC motor controller. If you are not going with isolation like me I'd recommend you'd use the DRV it is compact and has everything you need.I'd recommend you'd use current sensing as it ca protect your circuit from destroying itself. (I'm still to include it in mine)You can take a look at my progress so far here:https://www.eevblog.com/forum/projects/bldc-motor-controller-rc-snubber-design-waveforms/

author: Benta
author_rank: Super Contributor
timestamp: March 16, 2018, 02:06:32 pm
content: Current sense is mainly there for preventing damage to the power stage or the motor in case of a rotor stall or a cable fault/short. It also limits current during startup.A secondary purpose is for torque control if you need it.For pure safety limiting, it's also possible simply to limit the supply current to the power stage, provided your gate drivers have their own supply.Sensorless commutation of the motor is not done through current sensing, but by measuring back EMF in each phase when it is off. PMDC control only powers two phases at any time, thus making this possible.

author: anvoice
author_rank: Frequent Contributor
timestamp: March 16, 2018, 09:14:54 pm
content: Quote from: jbb on March 16, 2018, 07:06:56 amI think you mean BEMF here, as that's what's used for commutation. I get that the motor might overheat with too much current, that's definitely a valid point.Quote from: Glenn0010 on March 16, 2018, 09:29:39 amThanks, I'm going to read that now! Circuit protection makes sense. Guess I'd have to go with the DRV8323 then.Quote from: Benta on March 16, 2018, 02:06:32 pmI see, that's what I suspected. Safety is definitely important for me, so I think I'll want to go with current sensing then, that sounds simpler than limiting current to the power stage.

author: anvoice
author_rank: Frequent Contributor
timestamp: March 17, 2018, 08:41:46 am
content: The datasheet gives equations for calculating the current through the shunt resistor, wouldn't that basically be the motor current, since the shunt resistor is in series with the motor current path?Also a bit confused by unidirectional vs bidirectional current sensing operation: if I understand correctly, current should always flow to ground, so what's the point of bidirectional sensing?I'm clearly missing something obvious on both of these points.

author: David Hess
author_rank: Super Contributor
timestamp: March 17, 2018, 02:27:24 pm
content: Quote from: anvoice on March 16, 2018, 09:14:54 pmI think he means sensing current to all output stages from the power supply which is sufficient for protection instead of individually which is more complicated. A lot of ancient brushless DC motors drivers including discrete ones do this.

author: anvoice
author_rank: Frequent Contributor
timestamp: March 17, 2018, 08:10:28 pm
content: Quote from: David Hess on March 17, 2018, 02:27:24 pmGot it. Since I can get a DRV8323 with 3 low-side amplifiers included for a small bit more than the DRV8320 which lacks them, I think I might as well go with the option of sensing individual currents.

author: anvoice
author_rank: Frequent Contributor
timestamp: March 18, 2018, 04:01:26 am
content: If possible, I'd like a little help with choosing my current sense resistors. From what I understand, the current through that will just be the motor current, so I can use just use P = I2R to get my max power dissipation through said resistor. Is this correct, or is there some complication I'm missing?Since I don't want to lose much more than a percent or so of my total power through this resistor, and my stall current should be around 30A, I'm getting something like a couple of mOhms of resistance that I want tops, which would dissipate several Watts of power but enable me to get slighter higher sensing accuracy vs say uOhms. Also thinking of going with 4 termination style resistor for more accurate sensing.

author: jbb
author_rank: Super Contributor
timestamp: March 28, 2018, 05:19:00 am
content: Quote from: anvoice on March 18, 2018, 04:01:26 amIf you're putting them in series with the low side MOSFET, you'll only put current through them part of the time. But sizing them to handle the whole motor current rating is probably reasonable (you don't want them to get too hot, after all).Quote from: anvoice on March 18, 2018, 04:01:26 amAt the very least you need to be careful with layout. You can make a resistor footprint where the main currents connect to the outside of the pads and the sense connections tap off the inside of the component pads. However, you may have 1mOhm or more of resistance in each solder joint (depends on package size), so a 4-wire shut would be more accurate.An important consideration is offset drift. A basic offset can be calibrated out (e.g. at room temperature), but the drift is unpredictable. Smaller shunt resistor values dissipate less heat but also produce less output voltage and a more susceptible to drift.Assuming a 5 mOhm shunt (or maybe a bit less - 4.5W is a lot of heat!), you get 5uV/mA into the sense amps. The sense amps are rated for an offset voltagedriftof 10uV/K, which corresponds to 2mA/K. Assuming a 60 Kelvin temperature rise (from 25 deg C to 85 deg C), that's a drift of 120mA. For basic current protection that might be just fine, but for fancy torque control applications that could be a problem.

author: anvoice
author_rank: Frequent Contributor
timestamp: March 28, 2018, 06:28:07 am
content: Thanks! Does Kelvin sensing (using 4 terminal sense resistors) improve the situation in any way? Or is that essentially what you're suggesting? I'm still reading about that so not sure how much of an improvement that will give.It would be nice to have a bit of torque control. Although if I do go for a 30A stall current motor, I'd have to switch to a higher power dissipation resistor to handle the higher resistance values. Not out of the question of course, Mouser has some higher power rated resistors with what looks like 4 terminals:https://www.mouser.com/ProductDetail/Bourns/CSS4J-4026R-L500F?qs=sGAEpiMZZMtlleCFQhR%2fze%252bwwzj9NwmYay4NatDfQtBTHNHGTdcLEw%3d%3dActually, the above turns out to be a 0.5mOhm resistor, which doesn't work for me. Another error on Mouser website. So if anyone has a good source for 4-terminal, 5mOhm, 5W (at least) current sense resistors, I'd really appreciate hearing about it.

author: jbb
author_rank: Super Contributor
timestamp: April 07, 2018, 03:47:49 am
content: Sorry for slow response!Quote from: anvoice on March 28, 2018, 06:28:07 amYeah, I did mean Kelvin sensing. It will improve gain accuracy by reducing gain drift over temperature. I don't think it does a lot for offset drift.Quote from: anvoice on March 28, 2018, 06:28:07 amYeah, tradeoffs are a thing. Bigger resistor values give better sense accuracy (to a point!) but dissipate more power... If you're willing to experiment, it might be possible to read the current valuewhile the corresponding MOSFET is offto calibrate & null out some of the offset drift, which could save you some trouble.Are you set up to simulate your driver and motor?

author: anvoice
author_rank: Frequent Contributor
timestamp: April 08, 2018, 04:20:45 am
content: Yep, I already started another thread about Kelvin sensing in particular. Seems that a 4-terminal resistor may be the way to go, they appear to provide advantages over Kelvin sensing done with a 2-terminal resistor.What do you mean by simulation? Software or hardware? I will have the actual motors in about 3 weeks, while the driver is essentially designed in Kicad (was going to put up the designs for criticism in a short while).

author: jbb
author_rank: Super Contributor
timestamp: April 08, 2018, 05:52:07 am
content: I meant simulation of control SW + driver + motor. It does require software that is normally quite expensive (e.g. Matlab + Simulink, PLECS etc.) but can be very helpful. I was going to suggest you could simulate your control software with different amounts of DC offset error in the current sense signals and see what happens.You can of course do this experimentally by deliberately adding some DC offset to the relevant signals in the firmware. It could be quite informative. I think that, up to a point, adding DC offset will just result in torque ripple which may not be a big deal for you.

author: anvoice
author_rank: Frequent Contributor
timestamp: April 09, 2018, 01:32:25 am
content: I don't have that software package yet, and it's a bit of a leap to get it considering the price... I'm sure it might be more useful than what it costs though.I can try that. I'm in the process of writing the firmware (studying the ATSAMD21 reference manual and refreshing my C skills at the same time) but once it's ready that's definitely an experiment I'd be willing to do. Torque ripple might be acceptable as long as it's within reasonable levels.

author: jbb
author_rank: Super Contributor
timestamp: April 09, 2018, 08:26:53 pm
content: Quote from: anvoice on April 09, 2018, 01:32:25 amAnd by 'a bit of a leap' we typically mean "I could buy a nice new car for that."