Date: Thu, 9 Sep 1999 17:08:00 +0200 From: Martin Nilsson Subject: [OT] Some tips and tricks when thinking about H-bridge design To: PICLIST@MITVMA.MIT.EDU Sean, > PWMing a DC motor is one of those things (at > least,in my newbie level of experience with it) which at first seems > trivial,but you quickly reealize that there are many design choices to make I absolutely agree. > Ben Wirz was able to share his wisdom about motor driver protection with > me,and I got the general hang of it after doing a few simulations using a Be grateful for that advice - I'd say protection is 95% of driver design, if not more. Graham wrote: > Martin replied: > > This is really very important, and I wonder why it is so rare to find > > such a shunt included in published circuits! A not too exceptional > > case is where the motor runs full speed one way, and the driver then > > reverses to full speed the other direction. The motor will then act > > as a generator, and pull twice its stall current. > > > A case in point: > Portable battery powered electric drills. It is interesting you chose this example! Some portable drills, in particular those that also work as screw drivers, contain a clever mechanism that prevents backdriving (and allows manual screw driving). In this very special case, a shunt would not be necessary. Below, I have written a few tips and tricks that may be useful when working with PWM/MOSFETs/DC-motors. In my opinion, they deserve a little more attention than they usually get in the (at least the popular) literature. I hope you find them helpful. 1. Compute max drain current from thermal analysis. Sometimes I see a note from someone saying "I have built a MOSFET H-bridge which handles 100A without heatsinks and even without getting warm". There is reason to be sceptic about such statements. I think such high current ratings are taken from the datasheet's announced max current rating for the MOSFET. This rating is usually specified for a case temperature of 25 deg C, a value very different from the real world situation. For instance, take BUZ10, an inexpensive N-channel MOSFET from SGS-Thomson. It is announced as a 0.06 ohm (typical), 23A MOSFET in TO-220 package. According to the datasheets, it has the following data: rDS(on)max 0.07 ohm @ ID=14 A and Tj = 25 deg C, rDS(on)typ 0.105 ohm @ ID=14 A and Tj = 125 deg C, rDS(on)max 0.16 ohm @ ID=14 A and Tj = 175 deg C, Max operating junction temp. Tj = 175 deg C, Thermal resistance junction/case Rthjc = 2 deg C/W, Thermal resistance junction/ambient Rthja = 62.5 deg C/W. With good heatsinking, we can possibly cool Tcase down to 90 deg C. For a Tj of 175 deg C, we have Pmax(cont) = (175-90)/2 W = 42.5 W and IDmax(cont) = sqrt(Pmax(cont)/rDS(on)max) < sqrt(42.5/0.14) A = 17 A, but this is with *no* margin at all for extra heating by transients. Assuming we don't use any heatsink, and running the circuit at 40 deg C ambient temperature, IDmax = sqrt((175-40)/62.5/0.14) A = 3.9 A. A more typical example would perhaps be Tj = 125 deg C to leave room for transient heating, operating at 30 deg C ambient temperature. Then IDmax = sqrt((125-30)/62.5/0.105) A = 3.8 A. With a heatsink at 100 deg C, we get IDmax = sqrt((125-100)/2/0.105) A = 10.9 A. Far from 23 A! As another example, suppose we have a MOSFET with the relatively low rDS(on) = 0.001 ohm. Running 100 A through such a transistor produces 10 W heat. Without heatsink, and 60 deg C/W thermal resistance junction/ambient, the junction temperature would be over 600 deg C, which is of course impossible. 2. Two periodic processes of different time scale in a PWM-controlled DC-motor. It is useful to keep in mind that the are *two* periodic processes of different time scale in a PWM-driven DC-motor. One is rotor motion, on the order of 100 Hz, and another is the PWM frequency, typically at least 10 kHz. For a PWM-analysis, one can more or less assume that the rotor is at a standstill. 3. A DC-motor with inertial load can be thought of as a huge capacitor. Friction load is the driver designer's friend. It dissipates energy without coming back at you. Inertial load such as flywheels, on the other hand, can strike back in nasty ways by back driving the DC-motor as a generator. Inertial loads thus represent a kind of worst case scenario for the designer. However, a nice property about a DC-motor with inertial load is that it can be thought of as simple LCR series. Usually, the literature considers the motor's Emf a black box. You can go further though, and include the mechanical system, as described below. I'm sorry about the formulas for those of you who don't like such, but I insist the gain is well worth the price. (1) Model of the DC-motor u = R i + e where u = voltage over the motor, R = winding resistance, i = current, e = motor's back Emf. In particular for stall, (2) u0 = R is where u0 = nominal voltage, is = stall current at nominal voltage. (3) Speed is proportional to back Emf e/u0 = w/w0 where w = angular speed, w0 = no-load angular speed at nominal voltage. (4) Current is proportional to torque M/Ms = i/is M = torque, Ms = stall torque at nominal voltage. (5) Newton's law about inertia J dw/dt = M where J = inertia so Ms/J i/is = (use 4) = M/J = (use 5) = dw/dt = (use 3) = w0/u0 de/dt simplified, i = de/dt * (w0/Ms is/u0 J) = (use 2) = de/dt * (w0/Ms J/R) Now compare this expression with that of a capacitor: i = de/dt * C The conclusion is that the DC-motor with inertial load J behaves just like a capacitor with the capacitance C = w0/R J/Ms. Thinking of the motor as this equivalent capacitor makes it a lot easier to understand how the motor behaves in a circuit, and to simulate it in a program like SPICE. The motor is represented by R, C, and L (the winding inductance) in a series. Friction load corresponds to leakage in the capacitor. The voltage over the capacitor is the back Emf. The kinetic energy of the flywheel corresponds to electrical energy stored in the capacitor. 4. The Nilsson testing procedure for an H-bridge motor driver: 1. Run full speed clockwise direction, with a flywheel inertial load. 2. Suddenly reverse driver direction to full speed counter-clockwise. 3. When the motor has slowed down about 10%, hit the flywheel with a sledge hammer in clockwise direction. 4. Hit the flywheel again, but switch off all the power supplies in the middle of impact. 5. If the driver is dead, it definitely didn't pass the test. Otherwise, it might pass (maybe). [6. (optional) 6.a) (US mainland, Canada, and Hawaii version) Take your .44 from the closet and give the driver a round. 6.b) (International version) Use above sledge hammer, on the driver board this time. 6.c) (Swedish version) Contact social security and explain there is a driver here who probably had a difficult childhood. 7. If the driver isn't firmly gone by now, you may have a problem of a different kind. Call Arnold Schwarzenegger for further advice.] Regards, -- Martin Martin Nilsson http://www.sics.se/~mn/ Swedish Institute of Computer Science E-mail: mn@sics.se (current) Box 1263, SE-164 29 Kista, Sweden Dr.Nil@bigfoot.com (permanent) Tel: +46-8-633-1574 Fax: +46-8-751-7230