Author Topic: Solenoid switching and induction spikes  (Read 1899 times)

0 Members and 1 Guest are viewing this topic.

Offline backesTopic starter

  • Newbie
  • Posts: 2
  • Country: ch
Solenoid switching and induction spikes
« on: April 19, 2021, 08:04:25 am »
Hello,

I'm planning to switch solenoid valves (12V) and read about fly-back diodes. In "practical electronics for inventors" I found a schematic which uses two diodes and a capacitor to protect my circuit against transient voltage. I attached the schematic from the book. I do not understand why an additional capacitor is required, as the two diodes already limit the magnitude of the spikes. In addition, most schematics I find on the internet use only one flyback diode. Now I'm wondering how much of this "protection" is required for a simple application like mine.
How do I find the correct values for the diodes, capacitor, and MOSFET? Is there anything special that I have to pay attention to? I guess the diodes protect the MOSFET, so I don't need to care about a high VDSS rating. As I plan to switch the valves relatively quick, I guess that a Schottky diode would be a good fit. And lastly, why do we switch the inductor on the low side, and not high side?

Thank you!
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: Solenoid switching and induction spikes
« Reply #1 on: April 19, 2021, 08:49:27 am »
Simple rule for the diodes is that the breakdown voltage should be at least double the supply voltage for regular diodes, and the current handling capacity should at a minimum be the same as the coil current. D1 can also be a zener diode or transient suppressor diode, rated for power at least equal to the coil power use, and the voltage to a value less than the absolute maximum voltage for the transistor collector emitter breakdown.

With the zener or transorb you can also omit D2, as the purpose of D2 is to clamp the voltage on turn off to the supply voltage, plus the diode voltage drop, so as to protect the transistor. In general only done to reduce turn off time of the relay, as the clamping action of the diode D2 increases the time the relay takes to release, and in some applications you can reduce the turn off time by a few milliseconds, by keeping the voltage spike on turn off to just below the transistor ratings, and thus collapse the magnetic field in the coil faster.

In most cases generally only D2 is there, and works well enough.

Low side switching is generally used because NPN transistors and N channel MOSFETS are both a lot cheaper, and a lot more robust, than the P type equivalent, so they tend to be used. As well your drive is often 5V or lower, referenced to ground, and for high side switching you need to have a level translator to interface this logic to the typically non 5V or 3V3 power rail, which adds in extra complexity, or you have to use much more expensive high side driver IC's to do it. More board space, more expensive components over a cheap jellybean transistor and a resistor.

The capacitor, generally an electrolytic capacitor, with traces that allow as short a loop area between the relay positive connection and the transistor emitter, is there for spike suppression,  so the large current spikes on the relay turn on and turn off are supplied or absorbed by the capacitor, and the energy is in a short low resistance loop, so the rest of the board is not going to have issues with transients from long wiring or large area loops of conductors around the board.
« Last Edit: April 19, 2021, 08:52:48 am by SeanB »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: Solenoid switching and induction spikes
« Reply #2 on: April 19, 2021, 04:56:42 pm »
The capacitor is needed to shunt the wiring inductance of the power connections.  At high frequencies, it minimizes the loop area between the load and transistor switch.  It serves the same function as a decoupling capacitor.  Note that it may be desirable to have a relatively high ESR and capacitance.  The low ESR of a ceramic capacitor may cause excessive ringing if there is considerable wiring inductance.  I would tend to use an aluminum electrolytic capacitor of 10 to 47 microfarads per amp but it is not critical.

Diode D1 is only required in bridge applications where the flyback can be generated in both directions, and in any event, a power MOSFET will include it.  During turn-on, the transistor clamps itself so I am not sure what the author was getting at.

 

Online Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Solenoid switching and induction spikes
« Reply #3 on: April 19, 2021, 05:12:26 pm »
D1 is to protect the transistor that being a BJT does not have a built in diode. If the pulse is powerfull enough it can briefly put hundreds of negative volts across the power rail. It's hard to conceive but I have observed this.

Once at work they omitted a back emf diode on a motor supplied by 24V and switch by a thermostat. Despite the 24V lead acid batteries I could measure -400V spikes on the power which would fry the thermostat. I was actually getting shocks off the thing.

Fast diodes are not about a high speed pulse but the ability to recover at high speed from an inversion in polarity. So if a diode is conducting and the supply suddenly reverses it can actually conduct in reverse very briefly. If you are putting alternate polarity cross a diode at frequency you need a fast diode. But if you are turning a solenoid on and off you will be fine with silicone which is easier to get at a higher voltage than Schottky for the same money. To need a Schottky you would be running at a frequency that would defy the mechanical speed of your solenoid unless it's something really special...
 

Offline AlexanderB

  • Newbie
  • Posts: 4
  • Country: nl
Re: Solenoid switching and induction spikes
« Reply #4 on: April 19, 2021, 05:34:56 pm »
Most has already been said. :)

The schematic recommends 1N4001 diodes, which are 40V and 1A rated, and cheap. The 1000V 1A (1N4007) variant is also very common, maybe even more so, and totally fine as a substitution.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Solenoid switching and induction spikes
« Reply #5 on: April 19, 2021, 07:16:03 pm »
Note that, if using a zener or TVS for D1, then D2 and the capacitor aren't necessary.  Handy if you don't have the power rail on board!

BTW, the diode only needs to handle what current the transistor sinks.  1A rectifiers may be overkill -- no, it doesn't hurt anything to use them, and maybe you're using them elsewhere in the design so it's just adjusting quantities, not adding more BOM items -- that's always nice.

But just to say -- if the relay coil or solenoid is only like 50mA, then a 2N3904 and 1N914 will more than suffice.

BJTs are a bit old school, though still relevant in some applications.  I wouldn't hesitate to reach for a '3904 for loads under 100mA.  At power, MOSFETs are more common.  (Incidentally, MOSFETs have an internal body diode that serves as D1, though you shouldn't rely on it for voltage clamping -- an external TVS/zener is better.)

These days, you'll be shopping for SMT parts; and PCBs are cheap and plentiful, and PCB design tools, easy to use (well, relatively speaking).  Typical parts are S1B, ES1B (faster), B1100 or PMEG10010 (schottky), etc.  Or for TVS, something like SMAJ24A is a good choice.

And, most classic parts are available in SMTs, like MMBT3904 or NDT3055L (not like a 2N3055, but the relative of an old MOSFET with a coincidental '3055' number :) ).

MOSFETs you don't need the series base resistor, though a series gate resistor may still be helpful to control switching speed or quench parasitic oscillation.  Value depends on gate charge and drive voltage; typically you'll use something relatively large like ~1k to really slow it down, or values in the 1-100 ohm range where speed is required.

And there are protected switches, MOSFETs with protection circuitry integrated onboard, to handle over-voltage, current and temperature.  (These CAN be relied on for voltage clamping!)  They're very popular in automotive systems, safe enough not to need the TVS or clamp diode in most cases.  Example,
https://www.digikey.com/en/products/detail/infineon-technologies/BTS3110NHUMA1/1281745

Tim
« Last Edit: April 19, 2021, 07:20:04 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online Simon

  • Global Moderator
  • *****
  • Posts: 17814
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Solenoid switching and induction spikes
« Reply #6 on: April 19, 2021, 07:40:32 pm »
Yea infineon make some good rugged smart switches. You just have to pray they don't make them obsolete, we have been a victim of ao couple of obsolesces
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: Solenoid switching and induction spikes
« Reply #7 on: April 19, 2021, 11:11:59 pm »
D1 is to protect the transistor that being a BJT does not have a built in diode. If the pulse is powerfull enough it can briefly put hundreds of negative volts across the power rail. It's hard to conceive but I have observed this.

Once at work they omitted a back emf diode on a motor supplied by 24V and switch by a thermostat. Despite the 24V lead acid batteries I could measure -400V spikes on the power which would fry the thermostat. I was actually getting shocks off the thing.

D2 is the back EMF diode.  D1 would be the back EMF diode for the second switch if this was a half-bridge.

D1 does nothing in this case because when the transistor turns on, there is no negative spike and if there was, the transistor would clamp it anyway.

Could there be a negative spike from the wiring inductance interacting with the distributed capacitance of the inductor?

As T3sl4co1l points out, D1 could be a TVS diode to clamp the positive spike at a higher voltage without D2 for faster recovery but with D2 in place, this cannot happen.

Quote
Fast diodes are not about a high speed pulse but the ability to recover at high speed from an inversion in polarity. So if a diode is conducting and the supply suddenly reverses it can actually conduct in reverse very briefly. If you are putting alternate polarity cross a diode at frequency you need a fast diode. But if you are turning a solenoid on and off you will be fine with silicone which is easier to get at a higher voltage than Schottky for the same money. To need a Schottky you would be running at a frequency that would defy the mechanical speed of your solenoid unless it's something really special...

Just to expand on this, diodes do have a forward recovery time but it is typically unspecified because they turn-on fast, so there is no need to use a fast diode in this application.

Sometimes diodes get produced which have a slow turn-on time, even fast ones, but this is a defect and not a feature.
« Last Edit: April 19, 2021, 11:15:17 pm by David Hess »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Solenoid switching and induction spikes
« Reply #8 on: April 19, 2021, 11:28:50 pm »
In practice, you can usually get by with just something like a 1N4007 diode across the solenoid. Unless this is some kind of life safety critical thing (in which case I would hope the person designing it would not need to ask) I would not worry too much about it.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Solenoid switching and induction spikes
« Reply #9 on: April 20, 2021, 12:09:28 am »
D1 does nothing in this case because when the transistor turns on, there is no negative spike and if there was, the transistor would clamp it anyway.

Could there be a negative spike from the wiring inductance interacting with the distributed capacitance of the inductor?

As T3sl4co1l points out, D1 could be a TVS diode to clamp the positive spike at a higher voltage without D2 for faster recovery but with D2 in place, this cannot happen.

Yeah, for the single switch you'll most likely use either D1 (as TVS) or D2 (with the cap nearby).

Negative spikes shouldn't be significant -- not that would affect a BJT anyway, I think?  That's pretty high frequency stuff, best avoided by slowing switching -- a few microseconds will be fine for a typical application, and as mentioned, this can be done by increasing series resistance to a MOSFET.  (A little more awkward to do with a BJT, maybe a C-B capacitor?)

The next most likely thing is the EMF generated when the armature hits an end-stop; but this mostly manifests as a variation in forward current, and would have to be dramatic indeed to cause current reversal.  At least, I'm not aware of examples where it's that bad.

BJTs can handle some reverse voltage and current, too.  Even if it does reverse, it's not a show stopper; but it would warrant further investigation.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline ferdieCX

  • Regular Contributor
  • *
  • Posts: 212
  • Country: uy
« Last Edit: April 20, 2021, 02:00:32 am by ferdieCX »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: Solenoid switching and induction spikes
« Reply #11 on: April 20, 2021, 06:02:51 pm »
Negative spikes shouldn't be significant -- not that would affect a BJT anyway, I think?  That's pretty high frequency stuff, best avoided by slowing switching -- a few microseconds will be fine for a typical application, and as mentioned, this can be done by increasing series resistance to a MOSFET.  (A little more awkward to do with a BJT, maybe a C-B capacitor?)

I was thinking that there might be a negative spike from the wiring inductance.

Bipolar transistors are not commonly used this way now, but when the base-emitter junction is forward biased, the collector-emitter connection conducts in both directions so the inverted collector voltage would be clamped while the transistor is on.  Before JFETs, bipolar transistors were used this way to switch AC signals.  It is still sometimes done in RF switching applications.

Quote
BJTs can handle some reverse voltage and current, too.  Even if it does reverse, it's not a show stopper; but it would warrant further investigation.

Base-emitter breakdown would lower hfe if it did not destroy the transistor, but this effect is minimal at the likely operating point where hfe droop is present.  Failure when switching inductive loads is usually caused by the flyback pulse causing avalanche with excessive collector voltage.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf