Tuesday 9 June 2015

Lab Power Supply - Current Sensing/Limiting (Testing)

In this update I continue with the Lab Power supply project. The parts required for the current sensing/limiting circuit finally arrived and I test out my design. Yet again I got caught out with ground placement and I found a flaw in the circuit I planned to use. I find a couple of performance gotchas that aren't easy to fix and may require some compromises to be made.

Current Sense Resistor

I installed the 10m ohm current sense resistor in the negative supply rail close to the output. My plan was just to install the resistor and measure the voltage across it using a multimeter to see how it goes. I left the earth point for the grid supply and the control circuitry to be at the negative side of the sense resistor.

I tested the circuit to make sure it was still working and found it was oscillating wildly. I tried moving the earth point to be nearer to the output terminal (i.e. the other side of the sense resistor) but this didn't change anything.

After some head scratching it occurred to me that as the output voltage sensing is after the sense resistor and the output capacitor is before it, the sense resistor and output capacitor form a pole. I moved the output capacitor to be literally on the output terminals and the oscillation stopped. Crisis averted.

So then I started looking at the voltage across the sense resistor while loading the supply using the dummy load. The first problem is my shiny new scope only has 10x probes and the lowest settings is 10mV per division. So a 1A signal just makes it to 1 division and the scope would't trigger. I think the problem is that even if you clean up the signal with the high-resolution acquire mode, its too noisy for the triggering to work correctly. I measured the voltage using a multimeter and it seemed to match what I expected however (11mV which is within tolerance). More on measuring the sense resistor voltage below.

Current Sense Amplifier

I put together a 5V rail using a LM317 and cascaded it off the 40V rail I already have. I added the LT2050 current sense amplifier and configured it to amplify the current sense resistor voltage so that 1V at the output is 1A. This is actually a bit of a problem as the common mode range on this component is only up to 1.3V below the positive rail. I might have to run this off 6V to get the full current range.

The output was a bit disappointing in that there was a regular spike that seemed to correspond with the 100Hz bulk capacitor charge cycle. In the image below the yellow trace is one of the AC signals and the green is the output of the current sense amplifier with no load on the supply.


I thought that perhaps this could be noise induced in the wires. I am running a 15cm wire from a vero-board where all the high current circuits are back to a breadboard where the control circuits are setup. The voltages are pretty small so I thought it wouldn't take much to induce this amount of noise. 

I twisted the wires together to minimize inductance but this had no effect. I found an old USB cable that had a clip-on ferrite bead and decided to try using the bead as a sort of common-mode choke. I wrapped the wires through this a couple of times but this too didn't really help.


I tried fiddling with the bypassing and even tried adding capacitance but none of this changed anything. At this point I was trying to decide if the problem was in the amplifier or if there was some sort of noise current occurring.

I remember that my old Tektronix 475 can go down to 2mV/division when the probes are in x1 mode. I remembered an old EEVBlog video where Dave Jones measures the ripple and noise on the output of a supply using a pair of probes. The basic idea is to use two probes as a sort of differential probe.

Unfortunately my old scope has drifted a bit so it took a little bit of fiddling to get the traces right. I configured each probe for the minimum setting, grounded each channel in turn and adjusted the trace to be on the zero line. Then I inverted the second channel and added them together. Unfortunately if you ground both and hit add the trace moves. I figured out how much and compensated by adjust each trace half this amount. 

When I adjusted the scope correctly I got a relatively noise free measurement of the voltage over the sense resistor and I could see the same weird bump occurring in the voltage. This means the sense amplifier is working and the error is somewhere else!


I went back to LTSPICE and remembered that I hadn't updated it with the changes I made to the circuit after adding the sense resistor. I moved the output capacitor to be closer to the output terminals but this didn't change anything. I remembered I had moved the ground point to be near the output terminals (after the sense resistor) and I tried changing this in the simulation. Oddly this was the cause of the fault - I was able to reproduce the behaviour in spice. 


I moved the earth point back to the other side of the sense resistor and the problem went away. The voltage control/pre-regulator etc was still functioning correctly too.

Current Control Circuit

I constructed the current control circuit that I designed in the previous log entry:

For the current set point I just used a 5.6V Zener diode and a pot (so I could vary it).

I discovered there is an obvious hole in my plan - because of the diodes, the minimum that the current control circuit can pull the voltage down to is 0.6V. If the load is low impedance (in my case it was my dummy load) then often this isn't enough to get the current down to the desired level. This pretty much kills this approach.

I re-configured the circuit so that the driver transistor is diode-ored between the current and voltage control amplifier outputs (as I had before). When I simulated this I found that the voltage would overshoot  when it came out of current limiting and I wanted to see how bad this is in reality.

Here is a scope trace demonstrating the effect: The output voltage is set for 25V (roughly), the output current is set for around 600mA and the dummy load is configured to draw 1.3A in 1KHz pulses. The green trace is the current (1V == 1A), the blue trace is the output voltage. You can see the current shoot up to the dummy load maximum until the current control takes over and brings it back. This takes around 100us to get in range but 200us to be stable. When the current drops off the voltage control takes over and gets the output voltage back up to the set output. The problem is that it overshoots by approximately 3V. It's back under control in around 200us however. I'm not sure about the ringing in the current but it is likely that because the dummy load is actively trying to drive the current up to the set level that there is a tug-of-war happening between the control loops. I don't think this matters too much in any event.


Right now I am really not sure how to fix this. The reason this occurs is pretty clearly due to the slew rate of the op amps. As the current control amplifier output increases, the voltage control is decreasing  and the overshoot is where the current control overtakes the current control. If I make the voltage control slower then this will work but clearly I don't want to compromise on speed.

Pre-regulator

I presently have the pre-regulator set to the voltage set point but this has a big downside when the current control kicks in. The problem is that the pre-regulator is holding the capacitor at 30V even when the output drops to close to zero because the supply is in current limiting. The heat dissipation is quite considerable even with just 600mA being drawn.

I tried setting the pre-regulator off the output voltage and while this works quite well for a relatively static load, the pulsed load above completely stuffs this up. The problem is that often the pre-regulator is caught with its pants down when the load drops and the voltage control goes back up to the set level. The result is that the output voltage is quite unregulated when the load drops out.

Again, I am not sure what I can do about this as the voltage is swinging between the extremes. Either the output will be low or the transistor will dissipate a lot of heat. This will require some thought.



No comments:

Post a Comment