Tweaking a solenoid driver

Hi all,

I’m building a driver for a linear solenoid – the intention is basically to make it possible to use a slightly over-spec supply voltage to make it knock as hard as possible, then have the voltage drop off to a reasonable holding voltage as quickly as possible. I’m almost there, I’ve just got some questions related to tweaking it.

I’ve based my circuit off the information found in this excellent write-up. I’ve built “version 1” of the circuit, which works as expected (it’s just a cap and a resistor in parallel after the solenoid), and I’m now building “version 2”, which uses a PNP to short out the cap when voltage is removed, so that it’s empty and immediately ready for another cycle, without having to wait for it to discharge. My circuit is just like the schematic on the above page, which is this:

With the following differences:

  • For testing, I’m using a pushbutton instead of Q1
  • R2 is 7,5R
  • Diodes are 1N5400
  • The solenoid is this one (7R resistance)
  • Q2 is TIP42A

My issue is that when power is disconnected, the Base-Emitter voltage of Q2 doesn’t go low enough to turn it on and short the cap. Of course, part of the problem is that I’m using a transistor with a too high VBE(on) compared to the one in the original schematic – but looking at the Base-Emitter voltage on the scope, it doesn’t really seem to go much below -0.5V, which wouldn’t be enough even if I had the suggested transistor, which needs -1V.

I’ve adjusted the R4 and R5 values, but it doesn’t make much of a difference. If I just use jumpers instead of R4 and R5, I do in fact (sometimes) get a low enough voltage to turn Q2 on, but this makes the whole circuit unreliable and is clearly not a good idea. Other resistor values (5R-33R) don’t seem to make much of a difference, I still can’t quite reach -1V, I just get more noise. Best I could do was -779mV, as per the attached scope shot.

So – I’ll get the proper transistors, but apparently I need to do something else as well to make it work reliably. Any clues on what to adjust?

I am no expert, but putting a resister in series with a solenoid means it takes more time to create the magnetic field and more time to discharge the magnetic field. Seems to be just the opposite of what you described.
Paul

Paul_KD7HB:
I am no expert, but putting a resister in series with a solenoid means it takes more time to create the magnetic field and more time to discharge the magnetic field. Seems to be just the opposite of what you described.
Paul

The idea is that as C1 charges, the solenoid gets the full spply voltage – when C2 is charged after a few ms, it blocks DC, and the current flows through R2 instead, which is sized so that the voltage will be significantly lower (a reasonable holding voltage). That bit works fine – here’s the voltage at the solenoid vs the voltage in the cap (basically the same as the other scope shot really).

(For clarity, R1 is just to illustrate the resistance of the solenoid itself.)

Do you mean that R2 causes the solenoid to discharge slowly? I may well be completely wrong, but as far as I can tell it’s not really a problem of charge/discharge rate, but it seems there’s not enough energy stored in the solenoid to get the flyback to trigger Q2. Come to think of it, maybe a higher holding voltage would help? I don’t really deal much with inductance though, so it’s possible that I’m fundamentally way off

Solenoids are CURRENT operating devices. They could care less about voltages. If you want rapid actuation, you want the minimum resistance and maximum current to flow for both the charging of the magnet and the discharging of the magnetism.
I once had a machine that had many 24 volt rotary solenoids that had to rotate quickly and release quickly. They were actuated by 120 volt DC from a charged capacitor and shorted electronically some way, I don't recall just how. Similar to what you are trying.
Paul

My first though is the 2N2222 is not going to survive this circuit. You should check its ratings.

You might try one of these fuel injector driver

What kind of over voltages, frequency and duty cycle are you dealing with?

The two diodes will limit the emitter from going much above the base. They also slow down the release of the solenoid. I would replace one of the diodes with a 12V zener (cathode to the collector of Q1). This will bring Q2 emitter up to ~ 24 Volts for a very short time, but enough to turn on Q2 hard. You may have to reduce R5.

Your hand drawn schematic (that should work) does not match the simulation schematic. Maybe this is the problem?

Thanks all!

Paul_KD7HB:
If you want rapid actuation, you want the minimum resistance and maximum current to flow for both the charging of the magnet and the discharging of the magnetism.

That’s reasonable. Because of C1, R2 doesn’t really come into play for the first few ms, so the resistance is as low as possible when activating the solenoid – but would it cause any problems during the discharging, resulting in the unexpectedly small voltage B-E voltage I’m getting? If so, the design I’m basing this circuit off is inherently flawed – which is of course not impossible, it’s just something I found online, after all :slight_smile:

JohnRob:
My first though is the 2N2222 is not going to survive this circuit. You should check its ratings.

You might try one of these fuel injector driver

Ah, I forgot to mention, when I do put in Q1 instead of just the pushbutton I’m using now, it will be in form of a nice big beefy MOSFET! I have quite a few on hand that I normally use for LED strip PWM dimmers and that sort of thing.

JohnRob:
You might try one of these fuel injector driver

I’ll read up on the LM1949 – it looks like a very neat part, possibly better suited for what I’m doing. Seems I could get by without the huge 4700µ cap if I use that driver instead. Will look into it.

JohnRob:
What kind of over voltages, frequency and duty cycle are you dealing with?

With this circuit, I’m testing at 18V, which settles to about 9V. If I can get by with less than that in the final application (15V perhaps) I’ll do so. I’ll be sending pulses of fixed duration, 100-150ms, and the highest frequency will be … as high as possible. Frequency will vary between “max” and 0.25Hz.

JohnRob:

JohnRob:
The two diodes will limit the emitter from going much above the base. They also slow down the release of the solenoid. I would replace one of the diodes with a 12V zener (cathode to the collector of Q1). This will bring Q2 emitter up to ~ 24 Volts for a very short time, but enough to turn on Q2 hard. You may have to reduce R5.

For some reason, the “version 2” schematic that adds the cap-shorting transistor has an extra flyback diode which the simpler “version 1” does not. I must admit I don’t understand why. I tried with one instead, but it didn’t make any difference.
Am I getting your suggested changes right in the attached modified schematic? (EDIT: or did you just mean replace D1 with a zener and put it the other way around?)

Smajdalf:
Your hand drawn schematic (that should work) does not match the simulation schematic. Maybe this is the problem?

I’ve played “spot the difference” for a good while now but I can’t see it. Any hints?

solenoiddriver justert.png

GardG:
I've played "spot the difference" for a good while now but I can't see it. Any hints?

I am very sorry for that! They match. But now I don't see why the original circuit does not work. It is only simulation, right? Are you sure it is valid? Maybe try to add a resistor (like 100 Ohm) with series with D1 and D2 to force more current into the capacitor branch.

In real life this circuit won't work: when the solenoid is ON there will be 12 V reverse bias on the BE junction of Q2 which is too much. Quick fix is to add a diode in series with R5.
I am not sure why D3. I think it may be removed.

I have downloaded a LTSpice to do own simulations. It is the first time I have used it so the schematic is ugly but I hope it is readable. I have also improved it a bit. Using notation from my schematic:

C1 is much smaller - now I think it is too small but I don’t know your exact requirements so you need to adjust all passives to get reasonable result.
D4 protects BE junction of Q1 from breakdown.
D2 is Zener diode and speeds up turn off of the solenoid.
Components used are just some random components, use those you have available.
There are traces from the simulation: solenoid current (blue) and capacitor voltage (red).

Included is also the simulation schematic, I don’t know if it is usable for someone with other spice version. It’s name was “Solenoid.asc” but I had to change it to “Solenoid.txt” to be able to post it.

Solenoid.txt (2.12 KB)

Wow, thanks a lot for taking the time to do this so thoroughly! The way the cap-shorting transistor base is connected in this version makes a whole lot more sense. I'll try these modifications first thing when I'm back at the office.

I am playing a bit more with the LTSpice. It is nice tool/toy. You need a super large cap for this! Are you sure the solenoid is 4H? That needs a lot of energy that will be dissipated in all the involved components. From your traces it seems there is less inductance.

I have an alternative circuit for you:

The idea is simple: Q1 and Q3 form a Darlington pair that shorts R2 for a short time after the pulse goes HIGH. The timing relies on R1 and C1 and is probably a bit tricky. Also transistors Q2 and Q3 will dissipate considerable power. (But the Zener does not dissipate much power here and it reduces current spikes on the power source).
Another option is to use second output of Arduino (or 555 or some other way) to generate the short pulse to open Q3 briefly.

I am sorry for spamming this topic but this is probably the last, ultimate schematic:

Q2 and Q3 form a constant current sink limiting the current to about 0.6V/R2. When they turn off the collector voltage of Q2 rises turning Q1 also off. The energy stored in the solenoid coil will be dumped into C1 via diodes D1 and D4. There will be stored most of the energy needed to energize the solenoid again for next turn on.
In theory the LOWER is the capacitance of C1 the more energy is stored here and the faster the solenoid turns off and on. There is one drawback: the voltage on C1 will be very large and so all the elements must be able to survive this voltage - and dangerous voltage may be generated in this otherwise low voltage circuit!
There are traces (C1 voltage red, solenoid current green) from my new toy:

The first and second current peak is lower and is rising slowly because the capacitor is not charged enough yet - it charges after the turn off of the solenoid. The following peaks have very fast increase of the current until the capacitor voltage is depleted. After it the current is rising only slowly. Also note the peak capactior voltage is nearly 150V!