CCS with no load - op amp warms up - Page 1
Forum section: electronics / projects

author: atferrari
author_rank: Frequent Contributor
timestamp: May 20, 2015, 06:26:47 pm
content: I've just completed the smoke test of these two CCS. They work as expected until I leave them unloaded and the voltage control is in any position other than fully turned OFF; in few seconds the respective op amp starts to warm up.After some thinking I understand that by not having load, the opamp sinks / sources current from / to its corresponding Darlington trying to balance both inputs what never happens.What could be the solution? For a moment I thought to use kind of a bleeding load similar as in voltage regulators but I discarded th idea. If the resistor is too high I will be in a situation similar to what I describe and, if too low, too much of my current wil be going through there.For a moment I considered a base resistor but it seems useless as well. Or tell the user (me) to keep them fully turned OFF when not loaded? This last seems typical of a bad design.Suggestions or comments appreciated.

author: Kalvin
author_rank: Super Contributor
timestamp: May 20, 2015, 06:54:02 pm
content: Base resistor would certainly help.For example, the combined gain of TIP30 and 2N3906 >> 100, so you might try a base resistance of 2Kohm ... 1Kohm.

author: atferrari
author_rank: Frequent Contributor
timestamp: May 20, 2015, 10:15:32 pm
content: Quote from: Kalvin on May 20, 2015, 06:54:02 pmHola Kalvin,Thanks for replying. Honestly I do not know how I discarded precisely the limitation at the base.Could you please elaborate? I tried to calculate the value myself and for that I measured the voltages as shown in the attachment for five conditions including the "no load" with the pot at full throtle. Anyway I am stumped on where to start.It seems that the op amp is sucking around 27 mA. Is that possible?Gracias for any further help.

author: Kalvin
author_rank: Super Contributor
timestamp: May 21, 2015, 07:56:40 am
content: From the data sheets, TIP30 has typically a minimum current gain of 15 and 2N3906 has typically a minimum current gain of 50. The current gain of the darlington stage is the product of the current gains of the transistor ie. 15 * 50 = 750, which is >> 100.When there is no load in your circuit, the base current will equal to the emitter current on the TIP30. The base voltage of 2N3906 is approx. 1.5V less than the emitter voltage of TIP30 (darlington transistor Vbe is approx. 1.5V). So, when there is no load (or the load current is too low) the op amp tries to pull the base of 2N3906 as low as possible in order to increase the emitter voltage of TIP30 to match the voltage set by the potentiometer. The output impedance of TL072 is 192 ohms (see the data sheet), so the maximum base current is (5V - 1.5V - -9V) / (192 + 24 ohm) = 58mA ~ 60mA.The worst case is when there is no load and potentiometer is at 10k, the op amp output will be at -9V and the 60mA base current will be flowing through the op amp, thus the op amp is dissipating ~ 0.5W which makes it hot. When the potentiometer is set to halfway, the base current will still be 40mA. Even when the potentiometer is set to 1k, the base current will be 20mA.Adding a 2Kohm resistor between op amp output and the 2N3906's base is a cure.

author: codeboy2k
author_rank: Super Contributor
timestamp: May 21, 2015, 09:01:59 am
content: I was writing my reply when Kalvin posted his. Some of our thoughts overlap but I'll continue to post mine anyways.Quote from: atferrariYes, certainly.Let's look at your current source startup conditions:With no load resistor attached, the collector is open-circuit, and so no current flows in the circuit, and so there is no current in your sense resistor. With no current in the sense resistor, there is no voltage dropped across it, and so the voltage at the inverting input of the op-amp is 5V.If your pot is set at half-way, then it's going to put 2.5V at the non-inverting input of the op-amp. As you've already realized, the op-amp will do whatever it can to make the inverting and non-inverting inputs equal. This means it will try to lower the voltage at the inverting input to 2.5V, and it can do that by sinking or sourcing current at it's output, what ever is necessary, to make the inputs equal. So in this case, the op-ampsinkscurrent through the darlington emitters, and this causes a current to flow begin to flow in the sense resistor. It will do this until it succeeds in making the inputs equal, or until it reaches a voltage or current limit of the opamp.In your case, you've probably reached a current limit of 27 mA, because your measurements show that it did not hit a voltage rail yet.You see that the current being sunk into the opamp (all 27mA of it) is coming from the +5V rail, through your sense resistor, then the 2 emitters, out the base and into the opamp to the negative rail.What Kalvin was saying is that the darlington pair 2N3906 + TIP30 has such a high gain that you don't need much current in the base, certainly not 27mA, so you can limit that current, and Kalvin suggested 1K or 2K ohm. This will also stop the opamp from sinking so much current when the circuit is unloaded, and heating up.If you wanted to calculate a real value for the base resistor then you will have to work backwards from the maximum current you want to source or sink, and use the combined beta's of the two transistors to figure out the maximum current you need to pull from or supply to the base to get what you want from it.Taking only the minimum betas, 2N3906 beta = 100, TIP30 beta = 15 (@1A Ic), so the combined beta is 100 x 15 = 1500.Because you are driving the non-inverting input with 0-5V, that means the inverting input (the sense voltage) must also be 0-5V, so that means the maximum voltage drop across the sense resistor will be 5V, and so the maximum current through the sense resistor will be I=E/R = 5/24 =~ 200mA( EDIT: I just saw that there's an extra 10k resistor at the input, so it's 2.5 V to 5V. The range is 100 mA to 200mA. The max is still 200mA so the calculations below are still correct. )So when you want the load to sink/source 200mA, you need a minimum base current on your darlington pair to be 200 mA / 1500 =~ 133uAThat's a tiny current to get 200mA. So you see what Kalvin is saying when he says you can put a 1k or 2k current limit resistor in the base. This helps limit the current so the opamp doesn't heat up, and yet it's not too big that it stops working completely.But what is the maximum resistor value you can use there? Let's find out. I'm looking at the current source circuit:If the sourced current is at max 200 mA, then the point at the sense resistor is going to be 0V, the 2 emitters drop 0.7 * 2 = 1.4V, so the base is at -1.4V.According to the TL072 datasheet graph (MAXIMUM PEAK OUTPUT VOLTAGE vs SUPPLY VOLTAGE) the output can only swing to +/- 7.5V with +/-9V supply. So if the lowest possible opamp output is going to be -7.5V, and you need -1.4V at the base, and 133uA of base current, we can use ohms law to figure out the maximum resistor value : R=E/I = (7.5 - 1.4)/133uA = 46 K ohms. That's going to be the upper limit for the base resistor. Any higher than this and the opamp can't swing the voltage low enough to get the needed 133uA of base current anymore. But as engineers, we never like to swing so close to the rails if we can avoid it, and so close to any limits. Since the opamp output has to reach at least +3.6V and down to -1.4V, let's allow the op-amp to swing +/- 4V for the full range. Now, if the opamp output is at -4V, and we want -1.4@133uA at the base, then we can use R=E/I = (4-1.4)/133uA =~ 19K ohms. So that's a new upper limit, with a smaller voltage swing at the opamp output. Again, we can choose an even lower value to be safe(r) and give enough "headroom" to allow the opamp to reach the voltage and current that we need. But in this case it seems anywhere between 10k and 20K will work nicely too.The larger the resistor, the larger the voltage swing will be at the opamp output. So for 133uA, and 10K resistor, the opamp output will swing 1.33 V between max and minimum output. With a 1K resistor, it will swing 133 mV between max and min output values.finally, here's some no-load currents:with a 20k resistor, the no-load current in the opamp will be (5 - 1.4 - -7.5)/(192 + 24 + 20k ) =~ 550 uAwith a 10K resistor, the no-load current in the opamp will be (5 - 1.4 - -7.5)/(192 + 24 + 10k ) =~ 1 mAwith a 1K resistor, the no-load current in the opamp will be (5 - 1.4 - -7.5)/(192 + 24 + 1k ) =~ 9 mAI'd probably put a standard 22k 5% resistor in the base.

author: codeboy2k
author_rank: Super Contributor
timestamp: May 21, 2015, 09:44:30 am
content: --- PART 2 ---You need a loop filter to stabilize the feedback loop, which is especially ugly with the high-gain and slow speed of darlingtons.To stabilize the feedback loop you really need a proper stability analysis to determine your gain and phase margins.However you can often get by with a simple 60khz loop filter as a starting point. You can try to do gain and phase margin plots in LTSpice but I would not trust it completely.So use an RC filter in the feedback loop, say 1K resistor and a 2.7nF capacitor.

author: atferrari
author_rank: Frequent Contributor
timestamp: May 21, 2015, 03:32:15 pm
content: Quote from: Kalvin on May 21, 2015, 07:56:40 amGracias Kalvin for taking the time to reply. I finally understood how to.

author: Kalvin
author_rank: Super Contributor
timestamp: May 21, 2015, 03:40:09 pm
content: No problemo. My calculations are based on quite conservative values. Codeboy2k has provided more elaborated calculations, although I would have settled for 10Kohm base resistor instead of 22Kohm. His observation about the loop stability is very valuable, too.

author: atferrari
author_rank: Frequent Contributor
timestamp: May 21, 2015, 03:46:46 pm
content: Quote from: codeboy2k on May 21, 2015, 09:01:59 amNow I realize what was impeding me to calculate that: I was reasoning this trying to decide myself the voltage to get a current in the extreme case of no load and the pot full throttle. I was wrong.The key wordswork backwardsmade me understand this properly. I fix the maximum current by deciding what resistor and then the opamp will change the output to fit. As usual, now that I understand it, is so simple...!BTW:Actually measured the current one of the op amps was taking: 38 mA.Later, I modified the PCB, rather tight in that part of the circuit and soldered a 10K base resistor to each.Warming is over and in extreme conditions one takes less than 1.2 mA and the other around 890 uA.Today I learnt something,and my circuit works!.Gracias for your help CB

author: atferrari
author_rank: Frequent Contributor
timestamp: May 21, 2015, 03:52:00 pm
content: Quote from: codeboy2k on May 21, 2015, 09:44:30 amHola again CBI admit understanding very little of the above unless explained to me.In my case, both are CCS just for constant current controlled to adjust values from 0 to 100 mA manually. No signal, just a simple pot. Is the proposed filter, even then necessary or only when some "dynamic" changes are expected?Pity is that learning about loops and controls is so hard when you lack basic knowledge.Thanks for your time.

author: codeboy2k
author_rank: Super Contributor
timestamp: May 22, 2015, 05:46:06 am
content: You should always put a loop filter in the feedback loop. It will dampen oscillations (by rolling off the high frequencies that can cause resonance) and prevent it from running away and turning into an oscillator.Even your single pot has some dynamics. That's evident when you move it. If you move it fast enough, you could make a rising edge fast enough that it would cause the system to oscillate if you didn't have a loop filter.So the simple addition of a single pole RC loop filter can help here.Just as Kalvin picked a conservative 1K or 2K ball park resistor for the base, I similarly picked a conservative ballpark loop bandwidth of 60 KHz to stabilize the loop enough that it doesn't want to oscillate, but not too low of a bandwidth that it slows down too much and takes too long to settle after a change.The addition of the RC filter in the feedback loop is called first-order loop compensation.The RC filter cutoff frequency is at Fc= 1/(2*pi*R*C) = 1/(2*3.14*1000*2.7e-09) =~ 60 KHz60 KHz is probably OK.. most systems will want to oscillate much, much higher than this, into the MHz regions even.But just as in my base resistor example, what if you didn't want to go with a ballpark, and wanted to know for sure? The best way is a proper stability analysis with a loop analyzer and from there you can figure out your gain and phase margins. However, if you don't have the equipment to do a full loop analysis, then one simple way to empirically discover what a reasonable compensation should be for your system is to firstbuild it without the RC filter installed, and use a signal generator at the input to provide a full scale step input, i.e. from 0-5V and from 5-0V andlet it oscillate. Look at the oscillation frequency with a scope, and make your RC filter roll off (cutoff frequency, Fc) much lower than the system's resonant frequency that you see on the scope.Note that the resonant frequency will vary with load resistance, load capacitance, load inductance and load current. So for a fully stable system at all possible loads, you might want to apply this technique using various different loads, and even adding some small capacitance in parallel with the loads, and some small inductances (i.e. wire leads) in series with the load. Then step the input, let it oscillate and see what the lowest frequency is for your different loads. You will want to make the RC loop filter have it's cutoff frequency Fcat a frequency well below the lowest resonant frequency of your system.So, as an example, after doing all that, you find out that the lowest frequency of oscillation is 150 KHz, then my estimated 60 KHz filter is just fine. If, however, you find it can oscillate at 50 KHz (due to your types of loads), then my choice of a 60 KHz loop filter is not good enough, and you should increase the R or the C to bring it lower, i.e. halve the filter cutoff frequency by doubling the R or the C: if we make R = 2.2K ohm, and leave the C at 2.7nF, then Fc= 1/(2*pi*R*C) = 1/(2*3.14*2200*2.7e-09) =~ 27 KHz, which would be fine now (but it may still have overshoot and ringing oscillations that eventually dampen out - lowering the cutoff frequency even more can help with this, but be careful not to make it too low).Want to learn more? google for RC filters, low-pass filters, step response, impulse response, feedback loop compensation, resonance, feedback loops, gain and phase margins, bode plots, and control theory.

author: Kalvin
author_rank: Super Contributor
timestamp: May 22, 2015, 07:35:28 am
content: About the loop stability: Turning the potentiometer is only half of the story. Any change in the load will also create dynamic change in the loop, which may also cause oscillation. That's why is always a good engineering practice to compensate the loop - or at least have space for the compensation components on the PCB should you run into a trouble. If the load characteristics are well known, one can adjust the loop for (at least near) optimal response. If the load characteristics are not known or they vary a lot, one should make a conservative guesses and possibly try to evaluate / calculate the worst case load conditions and/or run the simulations for different loads and make the loop stable.

author: atferrari
author_rank: Frequent Contributor
timestamp: May 22, 2015, 09:53:24 am
content: Quote from: Kalvin on May 22, 2015, 07:35:28 amThe more I dig, the more this becomes complex. Now I understand that ignorants and simpletons maybe have a better life.Not only the source but the load as well. Did not think of that before!Gracias Kalvin

author: atferrari
author_rank: Frequent Contributor
timestamp: May 22, 2015, 10:02:08 am
content: Quote from: codeboy2k on May 22, 2015, 05:46:06 amOh, I did not know they even existed.Quote from: codeboy2k on May 22, 2015, 05:46:06 amSo there is a way to do some testing. I like that suggestion!Quote from: codeboy2k on May 22, 2015, 05:46:06 amDaunting task but more and more appealing to me.Gracias for the detailed post CB!