Electronics > Projects, Designs, and Technical Stuff
Opamp based current limiter oscillates with inductive load
(1/5) > >>
brumbarchris:
Hi all,
I have to design a circuit that will limit the current through a solenoid to about 130mA. The solenoid has about 2mH inductance and a DC resistance that will vary between 5 and 15Ohm (depending mostly on temperature). The goal is to always charge the inductor to the same current, without worrying about timing or temperature. Hence, the need for a current limiter.

I have put together the attached circuit in LTSpice, using an opamp based current limiter circuit, in combination with a specific P channel MOSFET (the DMP10H400SE) selected so as to withstand the negative voltage pulse which appears when turning off the inductor).

Unfortunately, it oscillates. Quite ugly. The current limiting works when the load is purely resistive (with L_load removed), but it oscillates as in the attached plot when the inductor is in the circuit. Just to explain the V3 and M1 function: this has nothing to do with regulating the current, I just use that to turn OFF the main MOSFET very fast, as this is another requirement that I have.

I suppose the oscillating appears due to the horrible phase margin (or lack of, rather), but I must acknowledge my limits and ask for help with regards to how to fix/compensate and make it work. I have attached both screenshots and the actual LTSpice files, for whoever would be kind enough to spare some time, the subject is not trivial (at least for me, I know there are many thick and heavy books written on the subject). All files need to be kept in the same folder for the simulation to run.

In the attached simulation, the current is supposed to flow through the load for 2ms, between timestamps 5ms and 7ms.

Best regards,
Cristian
MagicSmoker:
That wouldn't be my first choice of a constant current source to drive a solenoid*, but regardless, if you are seeing the current oscillate then the first thing I'd try is adding a series diode-resistor damping network across the solenoid (with the anode to ground). The resistor value isn't terribly critical as long as it is somewhere between 0.5x and 2x the characteristic Z of the solenoid and its oscillation frequency. Just eyeballing the circuit I'd say a resistance somewhere between 100 and 400 ohms should work, and a bonus of this modification is that the kickback from the solenoid will be reduced as well.



* - I'd likely go with a simple bjt current source with an LED for bias.
brumbarchris:
We cannot damp the kickback for the solenoid, as that is the actual part we are interested in: we need to measure the big pulse which appears when turning off the current through the solenoid. Although, for the record, placing a 100Ohm resistor in parallel to the solenoid does indeed remove the oscillations.

Also, using a BJT based current source is a bit difficult, as we only have 5V available as a supply and the BJT takes a bit too much voltage drop to operate correctly.

These things aside, I would still like to understand why the current circuit does not operate with an inductive load. As I wrote above, removing the inductor completely (and leaving just the DC resistance of the solenoid) allows the constant current to correctly regulate to 130mA without oscillating. Bringing the inductor in the equation, for me would indicate that current through the load would vary slower, giving the opamp even more time to act. Unfortunately, I see quite the oposite in simulation, with the opamp not being capable of correctly regulating the gate of the MOSFET when I add the inductance. This is why I suspect is a "phase margin" kind of problem.
MagicSmoker:

--- Quote from: brumbarchris on May 03, 2019, 01:17:41 pm ---We cannot damp the kickback for the solenoid, as that is the actual part we are interested in: we need to measure the big pulse which appears when turning off the current through the solenoid.
--- End quote ---

Hmm. Should have made that more clear in the first place.


--- Quote from: brumbarchris on May 03, 2019, 01:17:41 pm ---Also, using a BJT based current source is a bit difficult, as we only have 5V available as a supply and the BJT takes a bit too much voltage drop to operate correctly.
--- End quote ---

Try a PNP instead of a p-ch MOSFET as the output device in the same circuit, then. BJTs make vastly better current sources which reduces the amount of work the op-amp will have to do.


--- Quote from: brumbarchris on May 03, 2019, 01:17:41 pm ---These things aside, I would still like to understand why the current circuit does not operate with an inductive load.
--- End quote ---

Probably Miller capacitance resonating with the load inductance. That is, Cgd of the MOSFET multiplied by the loop gain. Another plus for BJTs is they have lower parasitic capacitance in general.

Attempting to slug the response by throwing more capacitance between various nodes is likely to cause more or worse problems. I'd try adding a resistor from gate to source next. In fact, I just tried a few values and 390R improves behavior quite a bit. Also, I changed the maximum timestep to 100n which vastly speeds up the simulation without compromising the results (this isn't always the case).

bostonman:
Try installing a 1M and capacitor (pF???) in series to ground between U3 and R2.

The problem is probably the time constant. The op-amp is trying to compensate too quickly and oscillating. This should pull these oscillations to ground and change the time constant.
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod