Protecting LM317 from voltage spikes - Page 1
Forum section: electronics / projects

author: peter123
author_rank: Newbie
timestamp: October 03, 2017, 09:00:14 pm
content: Hi,I'm working on a BLDC motor driver with three half-bridges controlled by an MCU (see attached schematic). At the moment the circuit is powered with a bench supply set to 24V/1.5A, and to power the MOSFET drivers, which need a lower supply voltage, I'm using an LM317 voltage regulator. The problem is that sometimes when turning the motor on, a large current is drawn from the bench supply and it toggles between voltage and current regulation, and in this process the LM317 is destroyed.I suspect it is because there are spikes in the supply voltage when this happens. I've measured the bench supply with an oscilloscope when shorting its output and managed to capture spikes of about 60V.What is the best way to protect the LM317? A zener diode? Or do you think it's a bad idea to use an LM317 in this kind of circuit? In that case suggestions of alternatives would be much appreciated!

author: strawberry
author_rank: Super Contributor
timestamp: October 03, 2017, 10:51:03 pm
content: I have no idea for what you are using soft start capacitor for LM317, interesting when that capacitor discharged LM317 reminds current source circuitCould help Low ESR capacitors or shorter/twisted power source wires..

author: floobydust
author_rank: Super Contributor
timestamp: October 03, 2017, 11:11:57 pm
content: There is nothing to protect the LM317 input against the +ve overvoltage spikes that will come in from the motor, through Q1 diode, to Vcc_bat.C1 is too small, you could upsize it and see if it absorbs enough of the spike, or add a TVS at Vcc_bat to keep it under 37V.I would add to C1 a 100-220uF electrolytic cap.

author: Ian.M
author_rank: Super Contributor
timestamp: October 03, 2017, 11:20:55 pm
content: Unless you put some series resistance upstream of it, all a Zener will do is clamp it ONCE, failing shorted then blowing open as it attempts to pass all the current the supply can give it.Try a 3.9R 10W series resistor (or a greater resistance and lower wattage if the max load on the 317 is less than 1.5A - the aim being to keep the input voltage to the 317 above 17V at full load to give the 317 enough headroom to regulate - make sure you allow for transient peaks in the load current), a 10uF electrolytic across C1 to damp any ringing there, a TVS diode to clamp the surge - a nominal 28V is probably about right, but you'll need to go up to 30V or even 33V if the nominally 24V rail is eventually going to be from a battery supply that may rise significantly at full charge, or if its going into an automotive application (and uprate the series resistor + use a x10 pulse rated one to handle an : ISO-16750-2 load dump with the TVS clamping). You'll also need to swap out the LM317 for a LM317HV to get enough margin for the clamping to be effective - although the LM317 can withstand up to 40V across it so can tolerate a surge to 53V when its output is at the nominal voltage, it wont tolerate that at powerup when its output is still at 0V, and 40V is *FAR* too close to the max clamping voltage of a typical 500W 28V TVS diode. The 60V rating of a LM317HV will vastly enhance reliability.It should be noted that a lower ESR capacitor at C1 can make the problem worse as it can resonate with the wiring inductance and double the voltage. The use of low ESR ceramic input caps is *NOTORIOUS* for causing regulator failure at powerup in circuits where a regulator is supplied with an input voltage of more than half its max input voltage rating. Adding an electrolytic >10 times the value of the ceramic supplies enough damping to 'defang' a typical wiring inductance resonance spike - if the wiring loop area is minimised.

author: Zero999
author_rank: Super Contributor
timestamp: October 04, 2017, 10:04:04 am
content: How long does the over voltage last for?The resistor/zener will probably do but it's also possible to boost the input voltage range of the LM317 by adding a couple of transistors, see below. You might want to use a lower voltage zener than 39V though. I'd go with 33V.

author: strawberry
author_rank: Super Contributor
timestamp: October 04, 2017, 02:06:24 pm
content: LM317HV high voltage version

author: peter123
author_rank: Newbie
timestamp: October 04, 2017, 08:22:18 pm
content: Thanks for your input!@strawberryAre you referring to Cadj? I was following the Typical application in TI's datasheet and I realize now that I didn't read it carefully enough. It says: "CADJ is recommended to improve ripple rejection. It prevents amplification of the ripple as the output voltage is adjusted higher." So I think it's only useful when R8 (in my schematic) is adjustable. I doubt it does any harm though.@floobydustGood point! In the final circuit there should be a large capacitance between Vcc_bat and ground, as per my understanding to compensate for the large inductive load of the motor. I plan to use 12x220uF electrolytic caps. There's no calculation behind that; just that I've found a previous implementation of a similar circuit that uses this number. I have temporarily removed them because having a large capacitance like that proved treacherous when experimenting. The current limit of the bench supply is very useful if there's accidental short! I should probably reintroduce a few of them.@IanThanks for the clarification about the Zener! I have attached a circuit diagram based on your explanation. Did I get it right? The motor driver is for an electric bicycle and will be powered with a battery with nominal voltage of 36V so I guess I need a TVS with a bit higher voltage rating. Would you say it's a big difference between using a TVS and using a Zener? Very interesting note on the low ESR input capacitor. I have not heard that before.@HeroI wasn't actually able to reproduce it now (maybe it has to do with inductance and how the cables from the bench supply are arranged) but I think the spikes were in the order of microseconds. Thanks for the schematic!

author: floobydust
author_rank: Super Contributor
timestamp: October 04, 2017, 09:26:55 pm
content: It's just that on the bench, you have no batteries which normally act as a zener and clamp the bus voltage to say 38V.LM317HVrated for 60V so TVS can be higher V.Depending on your controller, regen will also have nowhere for the energy to dump when no batteries connected, so be careful there.

author: Ian.M
author_rank: Super Contributor
timestamp: October 04, 2017, 10:10:51 pm
content: I'd put a 0.1uF ceramic in parallel with the input capacitor as the wound foil construction of an electrolytic can have quite a high self-inductance so it needs some help to suppress high frequency noise. You may also want to keep the cap you had on the Adj pin (also with 0.1 uF ceramic in parallel) and its discharge diode, if you have anything sensitive running off your 13.75V rail, as the 36V DC bus will probably have a lot of ripple at your BLDC drive frequency. Otherwise it looks good.A Zener is designed to regulate at its nominal voltage when passing the specified current, and can pass more current up to its wattage rating. Its surge rating wont be that impressive and often isn't well specified. It certainly wont have a well specified clamping voltage when passing a pulse of an order of magnitude more than its continuous current rating.. A TVS diode is designed to pass negligible current at its working voltage and clamp at a moderately higher voltage when passing a *LOT* of current during a reasonably short surge pulse aqnd are specified for that mode of operation. They are far more readily available with high pulse current ratings - e.g the 15KPA36A has a 36V standoff voltage and clamps at under 60V while passing over 250A.If you are using a 10S LiPO pack, you can expect 42V fully charged, and the TVS diode shoud be appropriately rated. You *MAY* have to go with Hero999's transistor preregulator circuit if you cant find a TVS diode that will handle the surge duration, clamp at under 60V and standoff 43V.Be aware that if you *DON'T* have some sort of clamping, and expect the batteries to hold down the voltage during regenerative braking, a loose or dirty connection to the batteries that disconnects them for even a few microseconds due to vibration could cause a massive spike on your DC bus. You need enough clamping to give your controller time to react to an excessive DC bus voltage and either put the motor in a safe low current fault mode, or if braking, switch in a resistor to dump power to.

author: danadak
author_rank: Super Contributor
timestamp: October 04, 2017, 10:49:37 pm
content: @Ian.MQuoteI am prone to looking for low esr caps at input side so am quite curious. I looked at severalLM317 Datasheets and see no cautions expressed about not using low ESR on input side.Could you clarify your experience here, I may have some bad designs that need to beaddressed.Regards, Dana.

author: Ian.M
author_rank: Super Contributor
timestamp: October 04, 2017, 11:35:32 pm
content: Seehttp://www.linear.com/docs/24956- its not just switching regulators that are affected. You wont have a problem if the input is less than half the regulator's max rating because the LC circuit of the lead inductance + the input capacitance can only ring to double the supply voltage. You also wont have a problem if the regulator is drawing sufficient current to remove enough energy from the cap in 1/4 cycle of the ringing to prevent it peaking above the max input voltage rating.Here's some sims of the switch-on transient assuming 2m of 2.5mm flex with 5mm conductor spacing fed from a source with negligible impedance e.g. a SLA or LiPO pack:24V peak from a 12V supply with a 1uF low ESR ceramic input capacitor.Increasing the ceramic to 10uF doesn't help much.Adding an ordinary 10uF electrolytic in parallel with the 1uF damps it to under 15V

author: danadak
author_rank: Super Contributor
timestamp: October 05, 2017, 12:48:27 am
content: Thanks Ian, thats an eye opener.Regards, Dana.

author: Ian.M
author_rank: Super Contributor
timestamp: October 05, 2017, 01:20:55 am
content: Errr.... I goofed and forgot the resistance of the ground return wire. Change all the inductors to haveRser=27.2mHowever it only drops the first peak by a fraction of a volt, 23.4V isn't much better than 24V for your poor regulator.If the supply was 24V it could peak at nearly 47V, well outside the abs. max. limit of a LM317 with a discharged output cap.

author: Zero999
author_rank: Super Contributor
timestamp: October 05, 2017, 07:48:19 am
content: If the transient is only brief and it occurs when the output voltage is zero, simply connect a zener between the input and output of the LM317. It will divert the extra energy around it to the output capacitor, which won't reach too higher voltage.

author: peter123
author_rank: Newbie
timestamp: October 05, 2017, 07:54:30 pm
content: Thanks again everyone for your replies!Quote from: floobydust on October 04, 2017, 09:26:55 pmI have one of those freewheeling hub motors so regenerative breaking is not on the table. I guess the rotor will keep moving a little bit due to its intertia, but it should be minimal.Quote from: Ian.M on October 04, 2017, 10:10:51 pmThanks for the explaination about TVS and Zeners. I've ordered a 51V TVS and a 33V TVS to experiment with. I will use a 10S LiPO battery pack indeed, so the 51V TVS should work in that scenario. The regulator is used to power the MOSFET drivers and the average current shouldn't be very high (even though each driver can source 1.5 A) so I chose a 5W resistor.Quote from: Hero999 on October 05, 2017, 07:48:19 amHm.. so you mean the resistor in front of the TVS should not be necessary for such short transients?

author: Siwastaja
author_rank: Super Contributor
timestamp: October 05, 2017, 08:02:11 pm
content: Possibly the classical parasitic inductance LC ringing happening with low-ESR ceramic input cap. In these cases, the answer is often the simple rule-of-thumb: add an extra damping RC network, where C is considerably larger than the sum of low-ESR ceramic C, R being something around 1-2 ohms.Often a simple, cheap electrolytic cap provides the 1-2 ohm R and high C in the same package. For example, this circuit would most likely benefit from a 22 uF to 470 uF cheap elcap. Usually, little (almost no) ripple current goes through this cap, and the exact values are not critical, which is why the lifetime of this cap is typically not an issue.Active clamping may be requiredin addition.

author: Zero999
author_rank: Super Contributor
timestamp: October 06, 2017, 08:23:16 am
content: Quote from: peter123 on October 05, 2017, 07:54:30 pmThe second schematic you posted is fine.