Author Topic: Solenoid driver design  (Read 6445 times)

0 Members and 1 Guest are viewing this topic.

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Solenoid driver design
« on: November 23, 2019, 10:38:03 pm »
I have an old peak-and-hold PWM driver for injector solenoids that died on me. For those that don’t know, the peak-and-hold method uses an initially greater current (100% duty cycle) to actuate the solenoid faster and then a smaller current (lower duty cycle) to hold the solenoid open and reduce power and heat generation.

I opened it up to see if anything let out the magic smoke. I expected to see a low-side N-channel mosfet to switch the solenoid on and off, but instead it uses a high- and low-side N-channel. The attached "high and low-side driver.png" schematic shows the driver design. Note the high-side mosfet requires a bootstrap driver to function properly.

I’ve never seen this design before, so doing a search on it I found little information. The only article I found with info is https://www.edn.com/. In it is Figure 5 showing a high- and low-side N-channel mosfet. The article didn’t address the design, but user Howman said there are three states:
1.   Drive mode: both FETs on
2.   Coast mode: one FET on and one FET off. Coil current freewheels through the other FET and diode.
3.   Brake mode: both FETs off. Clamps coil voltage to bus and is higher, thus current decays more rapidly yielding faster turn off.

So my questions for EEVBlog are:
1.   Is there merit to this design and what Howman explained for the three states?
2.   Is this quantifiably better (faster turn off) than a single low-side mosfet? I tried simulating this in LTspice. The attached current trace image shows the solenoid current using single low-side mosfet (green curve) and the high- and low-side mosfet (blue curve) are right on top of each other. I see a difference in the low-side mosfet drain voltage, where the single FET design (green) has significantly more ringing. I do have my doubts that this can be simulated accurately given LTspice doesn’t capture armature movement effects on the solenoid current.
3.   Is there an even better solenoid driver design than either one of these?

 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4857
  • Country: dk
Re: Solenoid driver design
« Reply #1 on: November 23, 2019, 11:11:25 pm »
with a single lowside mosfet you have the choice between using a flyback diode resulting in a slow turn off,or not using flyback diode and then every pwm cycle dumps energy into the mosfet
 

Offline chuckb

  • Frequent Contributor
  • **
  • Posts: 345
  • Country: us
Re: Solenoid driver design
« Reply #2 on: November 24, 2019, 02:19:37 pm »
I don't know what it will do to the simulation but, D1 and D3 are 150 ma diodes used to pass or clamp 2 amps of circulating current.

How quickly current changes in the inductor is based on the voltage across it. With just a MOSFET or D3 clamping the inductive energy there will be 1-2 V across the inductor so the current decays slowly. With the clamp MOSFET turned off (and diode isolated) the Transorb at 30 V will allow the current to decay 10-20 times quicker. A speedup of 10-20 time is about the limit I have seen. Winding capacitance may play a part in limiting this also.

Another way to look at it is, the 0.11 Joules of energy in the inductor is dissipated quicker in the transorb (60W peak) verses the diode and the MOSFET (4 watts peak).

In 28 V 1 amp solenoid power relays I have seen core movement generate back EMF that causes a 10% change in the current rise waveform. 
 

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #3 on: November 24, 2019, 09:53:27 pm »
I don't know what it will do to the simulation but, D1 and D3 are 150 ma diodes used to pass or clamp 2 amps of circulating current.

Good catch. I forgot to change it back to 1N5624 (3A) that's used in the driver. It doesn't affect the voltage or current traces, unfortunately.

How quickly current changes in the inductor is based on the voltage across it. With just a MOSFET or D3 clamping the inductive energy there will be 1-2 V across the inductor so the current decays slowly. With the clamp MOSFET turned off (and diode isolated) the Transorb at 30 V will allow the current to decay 10-20 times quicker. A speedup of 10-20 time is about the limit I have seen. Winding capacitance may play a part in limiting this also.

That makes sense, thanks for the info. I wonder how M1 is driven that would makes D3 useful then.
 

Offline chuckb

  • Frequent Contributor
  • **
  • Posts: 345
  • Country: us
Re: Solenoid driver design
« Reply #4 on: November 24, 2019, 10:38:49 pm »
When M1 is turned on it connects R2 to D3 allowing the inductor current to flow through D3. Otherwise the M1 internal diode would block the current flow.

What is the rise and fall time of the pulse source in the simulation? If it's to fast it may excite parasitic oscillations.
 

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #5 on: November 24, 2019, 11:56:27 pm »
What is the rise and fall time of the pulse source in the simulation? If it's to fast it may excite parasitic oscillations.

I have it set to 1us step change from 0-10V and vice versa.
 

Offline chuckb

  • Frequent Contributor
  • **
  • Posts: 345
  • Country: us
Re: Solenoid driver design
« Reply #6 on: November 25, 2019, 05:11:56 am »
Give it a try at 10us or 100us edge rates.
 

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #7 on: November 26, 2019, 12:16:25 am »
I don't see a difference with 10 us. I can't do 100 us since the PWM is at 5 kHz. At this point I'm just going to whip up a board and experiment with it to see what gives the fastest turn off. Thanks for the suggestions.
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4857
  • Country: dk
Re: Solenoid driver design
« Reply #8 on: November 26, 2019, 12:58:48 am »
 

Offline chuckb

  • Frequent Contributor
  • **
  • Posts: 345
  • Country: us
Re: Solenoid driver design
« Reply #9 on: November 26, 2019, 01:32:59 am »
With 14V? injectors you will need 19V on the gate. Luckily these MOSFETs have a very rare and good 30V Gate-Source rating. So the components look like they will work in the actual circuit.

When laying out the circuit, the Transorb, M1, D1 and D3 should be the first things the solenoid wires see when they get to your circuitry. Minimize this wiring length. This will keep voltage spikes under control. Then M1 can connect to the solenoid wiring. The control/Drive electronics and power return needs to be referenced to the source of M1. When the electronics transitions from 100% on to PWM the sudden reduction in input current will cause a positive voltage spike on your input power line. This is from the power wiring inductance. This can also be very different between your bench with a power supply and the final installation. I would make sure you have several hundred uF of cap and maybe a 30V Transorb on the power line supplying the control electronics to keep this voltage surge under control.

Good Luck!
 
The following users thanked this post: mbless

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Solenoid driver design
« Reply #10 on: November 26, 2019, 02:18:55 am »
Yeah, that circuit is roughly the right idea.

A current mode hysteretic control is a good and cheap way to implement this; consider for example the classic L297/L298 stepper driver system.  These sense ground-return current and PWM the load (which is basically a solenoid) to control current.  When turning on or off, the load gets a large voltage (i.e., full supply), for high [current] slew rates.  When idling in a state, the load's average voltage is chopped down.

Those two chips are... terribly dated, but there are newer options, or you can make your own.

I think there are solenoid controller ICs out there that can do everything in a few parts, but a discrete version could be done in, hmm, a dozen or so parts, if carefully optimized and you don't mind a few missing features (like wide supply range, super high efficiency, and various kinds of protections).

The power stage isn't very interesting; the one- or two-switch version (e.g., compare the EDN example to the injector example above) can be used, with the downside that the one-switch version has to dump the excess coil energy (which, it can be dumped into an auxiliary power rail and converted back into the supply to avoid burning it), while the other circulates the energy by itself (a pretty clear winner, unless some kind of economy-of-scale should apply).

The two-switch does have the downside that you can't use a common-ground (or +V) load.

The EDN circuit I think uses a design intent from a handy philosophy: keep everything consistent if possible.  Namely, all you really need is a current mode converter for the power stage, and then you can vary the current setpoint to get the leading step.  It's always in control, making your circuit immune to destruction due to a shorted load.  You don't need a bunch of arbitrary junk -- state machine and timers -- to run it.  (Granted, in this case, the state machine approach may well be simpler.)

Other gotchas include switching waveforms on a wiring harness, and general automotive concerns (e.g., reversed battery, load dump, smoking high temps in the engine bay).  You would at least want those cables to be shielded up to the injector/solenoid, or to put the circuit right on top of the device.  The former adds expense, the latter adds complexity (high operating temp).

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

Offline max_torque

  • Super Contributor
  • ***
  • Posts: 1327
  • Country: gb
    • bitdynamics
Re: Solenoid driver design
« Reply #11 on: November 26, 2019, 03:35:54 pm »
As a bit of an asside to this particular circuit, i found it interesting to note that most automotive direct injection drivers, that use a peak and hold architecture, actually also use the injectors themselves as the boost inductance!   DI injectors need around 100V to actuate, so the vehicle 12v (nominal) system must be boosted, and to avoid having to have expensive and large inductors in the driver, they cleverly pulse the injectors with very short pulses, too short to actually open them (~250uS) during the "off time" for each injector.  That allows the system to use the non firing injectors as the boost inductors, generating the higher voltage that is then switched to the firing injector!  (and unlike port injection, DI injectors are necessarily limited to a maximum of around 25% duty,meaning there is always plenty of time and hence boosting current avaliable!   :-+
 

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #12 on: November 26, 2019, 09:16:27 pm »
With 14V? injectors you will need 19V on the gate. Luckily these MOSFETs have a very rare and good 30V Gate-Source rating. So the components look like they will work in the actual circuit.

I was able to get more information on it. This particular injector is 24V, and the high-side mosfet's gate is driven with 40V to have a Vgs of 16V. I'm planning on using p-channel for the upper mosfet to avoid using a bootstrap driver. The high-side gate also gets the peak-and-hold PWM where as the low-side mosfet is full on for the injection duration.

When laying out the circuit, the Transorb, M1, D1 and D3 should be the first things the solenoid wires see when they get to your circuitry. Minimize this wiring length. This will keep voltage spikes under control. Then M1 can connect to the solenoid wiring. The control/Drive electronics and power return needs to be referenced to the source of M1. When the electronics transitions from 100% on to PWM the sudden reduction in input current will cause a positive voltage spike on your input power line. This is from the power wiring inductance. This can also be very different between your bench with a power supply and the final installation. I would make sure you have several hundred uF of cap and maybe a 30V Transorb on the power line supplying the control electronics to keep this voltage surge under control.

Thanks for the tips. I'll give more thought to the input protection.
 

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #13 on: November 26, 2019, 09:28:06 pm »
Other gotchas include switching waveforms on a wiring harness, and general automotive concerns (e.g., reversed battery, load dump, smoking high temps in the engine bay).  You would at least want those cables to be shielded up to the injector/solenoid, or to put the circuit right on top of the device.  The former adds expense, the latter adds complexity (high operating temp).

Thank you for the input. Fortunately this is all for lab work, so I won't have high temperatures or alternator noise to deal with. I will have long leads, so I'll try a shielded cable.

Speaking of noise, do you have any suggestions for a noise-free low-side current sense circuit? The driver discussed above uses a chassis mount resistor. The green curve in the attached image is the voltage drop across the resistor and is extremely noisy.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Solenoid driver design
« Reply #14 on: November 26, 2019, 09:45:29 pm »
Put an RC lowpass after the resistor, such that R*C of the filter = L/R of the shunt.

Mind ground loop voltages and currents.  Keep loops local.  You may also be observing noise that's simply between ground and oscilloscope, and not actually between nodes in the circuit.

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

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: Solenoid driver design
« Reply #15 on: November 27, 2019, 11:00:12 am »
...
Speaking of noise, do you have any suggestions for a noise-free low-side current sense circuit?

As Tim mentioned, you can compensate the L/R time constant of the shunt with an RC filter, but at risk of pointing out the obvious, note that this slows down the response speed/reduces the bandwidth. Wirewound resistors - even the non-inductive kind - are a poor choice here, as a result.

The attached LTSpice circuit is one I whipped up for another post here awhile ago showing how to do RC compensation of a shunt's inductance (and get a bit of voltage gain to boot) with a standard differential amplifier circuit.

 
The following users thanked this post: mbless

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Solenoid driver design
« Reply #16 on: November 27, 2019, 08:38:31 pm »
Well that's the point, the shunt has excess bandwidth, in fact rising steadily above Fc = R / (2*pi*L).  The RC, as given, exactly compensates this to give flat bandwidth. :)

You can also make a bit of a transformer to null the EMF, which is kinda sorta practical for metal-link style shunts.  Hard to know exactly how much to couple, though.

Edit: your circuit left off the other leg -- the output is still peaked; this should be compensated like so.  Ideally, R5*C2 is the same time constant, but it's actually less (and there's some other funny business, hence R7) due to the particular characteristics of the amp used.  So, in general it would be 100pF and no ESR, but you can tweak for a given amp.

Tim
« Last Edit: November 27, 2019, 08:45:24 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: MagicSmoker, mbless

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: Solenoid driver design
« Reply #17 on: November 28, 2019, 01:19:52 pm »
...
You can also make a bit of a transformer to null the EMF, which is kinda sorta practical for metal-link style shunts.  Hard to know exactly how much to couple, though.

 ???

Edit: your circuit left off the other leg -- the output is still peaked; this should be compensated like so.  Ideally, R5*C2 is the same time constant, but it's actually less (and there's some other funny business, hence R7) due to the particular characteristics of the amp used.  So, in general it would be 100pF and no ESR, but you can tweak for a given amp.

You added a pole, basically, to complement the RC integrator. Blindingly obvious in retrospect, but not something I had thought of before so yet another thanks to you. Don't spend them all in one place!

EDIT - wrong terminology.
« Last Edit: November 28, 2019, 02:36:25 pm by MagicSmoker »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Solenoid driver design
« Reply #18 on: November 29, 2019, 02:24:28 am »
You're welcome.  Yeah, the key to a differential amp is to do everything on both sides, which again, seems obvious in retrospect.  Also check the CMRR of the two arrangements. :-+




The transformer thing looks like this -- notice the shunt is more or less a single turn, so the field/EMF that it drops (its ESL) appears in the same space.  Say we tapped some of that EMF with a turn or two, and put it in series with the sense line (blue)...

The flux linkage is imperfect, so a single turn cannot be enough.  The key is knowing how much of a second turn is needed.  Would be doable with a planar transformer -- assuming you could get nichrome foil on your PCB. :-DD  Not very manufacturable otherwise, but neat for testing and one-offs.  (Adjustment is simple: apply a square wave and bend the loop until the peaking/rounding goes away.)

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

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #19 on: December 26, 2019, 03:29:01 am »
As an update, I made three driver versions: low-side, high-side, and combination low- and high-side driver previously shown. Here's a brief schematic of them.
896628-0

Upon testing them, I found that all three drivers are capable of producing the same solenoid current decay. This image shows the current vs. time after falling edge of the on signal.
896624-1
The reference is the broken equipment I spoke of earlier in the thread. The reference and three driver versions lie on top of each other when I soldered in the bi-directional TVS diode (D3). Without the TVS diode, the current decay is much longer, i.e. takes longer for the solenoid to close. (D1 appears to do nothing despite being in the reference equipment.)

Given they are all the same, I will continue with the low-side driver since the n-channel mosfet is easier to drive and has lower resistance. I will post an update when I get around to testing the suggested current shunt filters.
« Last Edit: December 26, 2019, 03:31:19 am by mbless »
 

Offline viperidae

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: nz
Re: Solenoid driver design
« Reply #20 on: December 26, 2019, 10:13:17 am »
Weird, wouldn't D1 bypass the tvs and other diode in the high-side configuration?
 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: Solenoid driver design
« Reply #21 on: December 26, 2019, 03:23:31 pm »
As an update, I made three driver versions: low-side, high-side, and combination low- and high-side driver previously shown. Here's a brief schematic of them.
...

D1 and D2 should be removed from the first two circuits if you want current to decay quickly. The same could be applied to the 3rd circuit, or just remove D2 and add another flyback connected from lower drain to +BATT to automatically recycle energy stored in the solenoid inductance back to the supply (this would be the traditional two-switch configuration).

 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4857
  • Country: dk
Re: Solenoid driver design
« Reply #22 on: December 27, 2019, 12:00:20 pm »
As an update, I made three driver versions: low-side, high-side, and combination low- and high-side driver previously shown. Here's a brief schematic of them.
...

D1 and D2 should be removed from the first two circuits if you want current to decay quickly. The same could be applied to the 3rd circuit, or just remove D2 and add another flyback connected from lower drain to +BATT to automatically recycle energy stored in the solenoid inductance back to the supply (this would be the traditional two-switch configuration).

sure?  afaikt the first circuit has fast decay via D2/D3, D1 doesn't do anything, second circuit has slow decay via D1, D2/D3 doesn't do anything. Third circuit has fast decay when switching lowside, slow decay when switching highside





 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: Solenoid driver design
« Reply #23 on: December 27, 2019, 12:25:10 pm »
D1 and D2 should be removed from the first two circuits if you want current to decay quickly. The same could be applied to the 3rd circuit, or just remove D2 and add another flyback connected from lower drain to +BATT to automatically recycle energy stored in the solenoid inductance back to the supply (this would be the traditional two-switch configuration).

sure?  afaikt the first circuit has fast decay via D2/D3, D1 doesn't do anything, second circuit has slow decay via D1, D2/D3 doesn't do anything. Third circuit has fast decay when switching lowside, slow decay when switching highside

Sure, I'm sure: your explanation on circuits 1 and 2 is correct, but that doesn't make what I wrote incorrect. As you noted, D1 does nothing in the first circuit, but also note that D2 is redundant, so it doesn't do anything, either, as long as the TVS breakdown voltage is higher than the supply voltage (which it should be), and it is, indeed, a bidirectional type as shown.

In the second circuit, D1 renders D2 and D3 redundant and once removed the same applies to D2 as above, so it can also be removed.

The 3rd circuit is halfway to being a proper two-switch driver but needs the corollary flyback diode to D1 to work properly, and note that both switches must be driven simultaneously for current to flow through the solenoid, so there is no option of just doing high side or low side switching. Finally, D2 is redundant as per usual and should be removed.

 

Offline mblessTopic starter

  • Regular Contributor
  • *
  • Posts: 227
  • Country: 00
Re: Solenoid driver design
« Reply #24 on: December 27, 2019, 07:15:23 pm »
Sure, I'm sure: your explanation on circuits 1 and 2 is correct, but that doesn't make what I wrote incorrect. As you noted, D1 does nothing in the first circuit, but also note that D2 is redundant, so it doesn't do anything, either, as long as the TVS breakdown voltage is higher than the supply voltage (which it should be), and it is, indeed, a bidirectional type as shown.

Yes, the TVS is bi-directional and rated for 27V, and the supply voltage is 24V. I tested your suggestion see here.
897652-0
Removing D1 and D2 decreased the current turn-off by ~5%. Incidentally, I did a test without any of the diodes installed, and the turn-off time was reduced from 1.75ms to 0.3ms! I'm surprised the solenoid current can decay so fast without any diodes. Any thoughts on why that would happen, and is then better to leave it without diodes or keep them for protection? (I do have a 470uF electrolytic on the supply rail.)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf