Electronic – Current regulation – oscillation problems

currentoperational-amplifierpower supply

I'm playing around with opamps trying to build power supply for lead acid battery charger, but in general I want to learn a bit about opamp based design. I'm stuck with constant current mode.

enter image description here

I'm trying out various current sense amplifiers to sense current on the high side. I'm not using OA2 and M3 per se – they are packaged into current sense amplifier IC such as LTC6101, LTC6102, MAX9938. I've tried differently designed voltage output current sense amplifiers like AD8218 too.

So, OA2 and M3 are here to designate current sense amplifier IC that outputs voltage proportional to voltage drop on R1.

I've tried LM358, LM8272, LM8262 as OA1.

My problem is that whatever I do, it either oscillates or does not limit current from some point.

I've tried slowing down OA1 by adding a capacitor on negative feedback path or a low pass filter after current sense amp output, but then, either oscillations become worse, or, when I increase the load, OA1 stops decreasing its output at some point, voltage at output of M1 becomes fixed and I have no regulation.

The best I could achieve was by using high speed opamp such as LM8262 as OA1 and small (1nF) cap across the current sense amp output. On the maximum load, the system was oscillating a bit, but average current was somewhat right.

When I've tried doing low side current sensing using the same type of opamp for current sensing and for regulation, it just worked.

My suspicion is that mentioned current sense amplifiers are not designed to work in linear regulation, but rather as current feedback for some ADC to read (at least, all of them have such application as typical in their datasheets). What I suspect is that phase shift from them is too big. Am I right?

Can anyone recommend a better option for high side current sensing/limiting or some procedure for stabilizing the circuit?

Best Answer

For reference here and because it may change, the circuit you are currently asking about is:

This is supposed to regulate output current, but the complaint is that it is unstable. R1 is meant to be a high side current sense resistor. You say this is for charging 12 V lead acid batteries. You don't say what current, but probably a few amps. In that case 100 mΩ seems rather large. Note that at 5 A it will dissipate 2.5 W.

However, the large current sense resistor should only make measuring the current easier. It looks like your intent is that OA2 provide a ground-referenced voltage proportional to the current thru R1. That concept is good, but the implementation is flawed.

What you need is a "diff amp" that has some finite gain. The differential part eliminates the common mode voltage on R1, but the finite gain part is also important. As it is now, OA2 is being used open loop as a comparator. It's output will quickly switch between full high and full low as the current goes slightly above and below the regulation threshold.

Another problem is that the top of M3 is not connected anywhere, so it can't source any current onto R7. I don't know what that dashed line is supposed to show. Usually if things are connected to it like that it means a conductive case, but you show nothing else connected to it. A case is usually grounded, which is certainly not what you want the source of M3 (strange designator for a FET) connected to. It also makes no sense that you need to buffer the output of OA2 amplifier. I didn't look up a LM358, but if that does not have a push pull output stage, get one that does.

All in all, I'd lose the wierd current sense amp circuit as it is now. There are diff amp chips that do what you want directly. Sometimes they are called instrumentation amplifiers. These have a truly differential input, finite and sometimes adjustable gain, and the output can be referenced to some other voltage like ground.

Once you have a reasonable ground-referenced voltage proportional to the output current, you can feed it into the negative input of OA1 as shown. However, you have to make sure that the controller (OA1 in this case) is slower than everything else in the system. I mentioned this already in another one of your questions. Put a cap between the output and the negative input of OA1 to slow it down. This may require a resistor between the current sense amplifier output and the negative input of OA1 so that the cap has some impedance to work against. Do not under any circumstances attempt to slow down the current sense circuit. That will only make things worse.