EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: analogo on June 19, 2017, 08:08:28 am

Title: Are power supplies based on opamp+transistor linear or switching?
Post by: analogo on June 19, 2017, 08:08:28 am
Many teaching examples of linear regulators show current being regulated by an opamp that drives a transistor. One such example is at https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf (https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf), page 11.

Why is such a circuit considered linear? The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Zero999 on June 19, 2017, 08:19:16 am
Many teaching examples of linear regulators show current being regulated by an opamp that drives a transistor. One such example is at https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf (https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf), page 11.

Why is such a circuit considered linear? The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?
If it's improperly designed, yes that's what will happen: the transistor will oscillate at an unknown high frequency.

In a properly designed circuit, the transistor will only turn on enough to pass enough current to keep the output voltage at the set level. Imagine plastic cup with a hole in the bottom it placed under a running tap: it the tap is carefully adjusted, the water level in the cup and therefore the water pressure can be made to remain constant.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Vtile on June 19, 2017, 08:30:24 am
Well I'm not electronics expert, but I try tell what I know.

In PSUs that are told to be linear the voltage difference between input transformer (if any) and PSU output is created with adding resistance to the current loop (transistor) which then turn that voltage difference to heat.

Switching supplies use different approach. They do not have big input transformer at all, but chop the input voltage (at ie.200kHz rate) and then feed it trough a small transformer and then use capacitors and inductors etc. To average the chopped output to good enough DC.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: newbrain on June 19, 2017, 08:53:08 am
The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?
It won't* in the circuit on page 11.

Don't get distracted by the presence of the transistor: it's only there to provide higher output current (as explained), but the circuit is essentially equivalent to the one on page 10, that is, a non inverting amplifier multiplying V+ (Vz) by (1+Rf/Ri).

Heed the advice on page 10, close to the formula, if you are not too familiar with opamps.

* Qualified statement: let's forget about phase and gain margins etc.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: tszaboo on June 19, 2017, 09:02:07 am
You should think about it as an ideal opamp. It has no mod: infinite gain, and the two inputs are identical. All you know is, is this:
1.) The voltage difference between the two inputs is zero.
2.) The output voltage can be anything, which satisfies statement 1.)
Now, solve the circuit, using only these, knowing nothing about how transistors work, and Kirchoff.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: coppice on June 19, 2017, 09:23:31 am
I assume you are referring to the schematic on page 11, and I can see why this might confuse you. A real world design would generally have a reasonably large capacitor across the load. Would the design look more linear to you like that, with the rate of change of the load voltage reduced?
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Zero999 on June 19, 2017, 09:54:31 am
You should think about it as an ideal opamp. It has no infinite gain, and the two inputs are identical. All you know is, is this:
1.) The voltage difference between the two inputs is zero.
2.) The output voltage can be anything, which satisfies statement 1.)
Now, solve the circuit, using only these, knowing nothing about how transistors work, and Kirchoff.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Vtile on June 19, 2017, 10:32:13 am
The method of doing output regulation differs. In so called linear system the flow of energy is continuous through the system when it works as intented. In switcmode psu/regulator the flow of energy is not continuous, but have on-off-on-off nature (PWM of sort) which when averaged (TRMS) in capacitor and inductor network produce steady DC for output.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Mechatrommer on June 19, 2017, 10:56:03 am
Why is such a circuit considered linear? The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?
linear PSU is "switching" at uV or smaller deviation from the set value. in switching PSU, the power drive element is switching at 0-Vss range (PWM). both are "switching" this is what a closed loop feedback contorl is for.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: 3db on June 19, 2017, 11:01:23 am
You should think about it as an ideal opamp. It has no gain, and the two inputs are identical. All you know is, is this:
1.) The voltage difference between the two inputs is zero.
2.) The output voltage can be anything, which satisfies statement 1.)
Now, solve the circuit, using only these, knowing nothing about how transistors work, and Kirchoff.

I thought an ideal opamp had infinite gain.

3DB
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: MrAl on June 19, 2017, 11:22:20 am
Many teaching examples of linear regulators show current being regulated by an opamp that drives a transistor. One such example is at https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf (https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf), page 11.

Why is such a circuit considered linear? The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?

Hi,

The op amp often works as an error amplifier and integrator.  It calculates the time average of the error and uses that to adjust the output.  That is true of both linear and switchers.  The difference with a switcher is that the output is controlled through the duty cycle while with the linear it's controlled with an analog voltage.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: tszaboo on June 19, 2017, 11:24:27 am
You should think about it as an ideal opamp. It has no gain, and the two inputs are identical. All you know is, is this:
1.) The voltage difference between the two inputs is zero.
2.) The output voltage can be anything, which satisfies statement 1.)
Now, solve the circuit, using only these, knowing nothing about how transistors work, and Kirchoff.

I thought an ideal opamp had infinite gain.

3DB
Right. Not that it matters, you just solve the circuit for 1.) and 2.).
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: MosherIV on June 19, 2017, 01:10:53 pm
Quote
Many teaching examples of linear regulators show current being regulated by an opamp that drives a transistor.
This is not the easiest current control example I have seen.
It works by measuring the voltage across the load and using that as a feedback to the op-amp.  ???

The best examples of current regulation control I have seen is this one :
http://www.microsyl.com/projects/powersupply/powersupplysch.pdf (http://www.microsyl.com/projects/powersupply/powersupplysch.pdf)
taken from
http://www.microsyl.com/index.php/2010/03/31/bench-power-supply-0-25v-0-5amp/ (http://www.microsyl.com/index.php/2010/03/31/bench-power-supply-0-25v-0-5amp/)

R4 is used to measure the current (high side) and U3 is a special device that converts current back to volts so that U1B can be used to limit the current.

Quote
Why is such a circuit considered linear?
A linear PSU is a simple one where a transformer converts from a higher voltage down to a lower voltage, diodes rectify and capacitors smooth the output. There may be addition voltage regulation and even current limit control.

Quote
The transistor will furiously switch on and off as the opamp tries to adjust.
No, as some of the others have tried to explain, the transistor will not switch. It will act act as a voltage follower (or emitter follower).
The op-amp does the 'clever' work - it compares the volts across the load with the desired volts and generates the voltage difference. This feeds the transistor as a voltage follower.
The transistor will be biased by the op-amp to work in the linear region.
Think of it like this : the transistor and op-amp act together to turn the transistor into an electronically controlled variable resistor.

I am a software engineer now a days, and I find I have to break electronic circuits down into simplistic examples like this to understand them.
Hope this helps.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Zero999 on June 19, 2017, 03:43:23 pm
Many teaching examples of linear regulators show current being regulated by an opamp that drives a transistor. One such example is at https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf (https://people.eecs.ku.edu/~callen/501/LinearRegulators.pdf), page 11.
There's no current regulation there. The example shown on page 11 of that PDF is one of voltage regulation only.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: MosherIV on June 19, 2017, 04:11:24 pm
I thought it did not look right but even the text is talking about current limited by the op-amp output and how the bypass transistor can increase the current.  ???
Technically true BUT horribly misleading !
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Zero999 on June 19, 2017, 05:10:26 pm
I thought it did not look right but even the text is talking about current limited by the op-amp output and how the bypass transistor can increase the current.  ???
Technically true BUT horribly misleading !
The trouble is, the limited current output of the op-amp is unlikely to be enough to protect the transistor from overheating because the Hfe has a positive temperature coefficient.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: T3sl4co1l on June 20, 2017, 12:24:29 am
Why is such a circuit considered linear? The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?

Transistors do not switch on and off.

Ever.

They are a continuously variable device, under all conditions.

That is where your error lies. :)

A circuit is linear if the linearity property applies, over a useful range, and neglecting noise:

Vout is a function of Vin.  Vout is a linear function, i.e.:

Vout(Vin) = gain * Vin + offset

Let Vin be the sum of two signals, Vin = Vin1 + Vin2.  Then,

Vout(Vin1 + Vin2) = gain * Vin1 + gain * Vin2 + offset

That is, that the additive, associative and distributive properties hold.

A real amplifier will have some distortion, so that the output is not exactly as above, but there are additional terms involving both Vin1 and Vin2 (their products, and higher powers).  A real amplifier will also have noise, which looks like a small random variation in the offset, and/or in the gain.  A real amplifier also cannot amplify forever, so that at some point, Vout "saturates" (it cannot go higher or lower than some physical bound, such as supply voltage).

And of course, change Vin or Vout to Iin or Iout for current type (transresistance, transconductance, current) amplifiers.

Finally, for a constant input, the change in output shall tend towards zero (again, ignoring noise), over time.  That is, it is an asymptotically stable system.

A switching circuit does not have all of these properties.  A class D audio amplifier may exhibit linearity in its bandwidth, but no matter how well filtered it is, there will be a small residue of the switching frequency on its output: therefore, it is not asymptotically stable, but constantly moving around, however small the movement may be.

A comparator is the fundamental concept of a switching device: for an input strictly above threshold, the output is high; below, it's low.  An ideal comparator switches instantly, but we can only approximate this behavior with real transistors (which are continuous).  A real comparator must take some time to transition between high and low.  Similarly, this is true of all logic circuits.

A more practical description of a switching circuit, is one which spends a large amount of time near the on and off states, with little time spent inbetween (but not zero time inbetween, which would be impossible).  This is typical of switching power supplies, amplifiers, digital logic and so on.

This is a rather heavy weight description for a beginner, but I hope that these keywords will inspire you to read more on the topic, and to come to a fuller understanding of why these things are as they are. :)

Tim
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: analogo on June 20, 2017, 09:17:14 am
Why is such a circuit considered linear? The transistor will furiously switch on and off as the opamp tries to adjust. Isn't this the basic mechanism of switching power supplies?

Transistors do not switch on and off.

Ever.

They are a continuously variable device, under all conditions.

That is where your error lies. :)

Is this also true of MOSFETs? IIUC, MOSFETs can be damaged if the gate stays too long in the region between 0 and Vgs(th).
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: MosherIV on June 20, 2017, 10:06:15 am
Quote
Transistors do not switch on and off.

Ever.

They are a continuously variable device, under all conditions.
That is a BOLD statement to make :P

What is the state of a BJT transistor with no bias current ?

What is the state of a BJT transistor with the base current pushed beyond saturation ?


FYI original poster - this has nothing to do with your original question(s)
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: T3sl4co1l on June 20, 2017, 10:21:17 am
Is this also true of MOSFETs? IIUC, MOSFETs can be damaged if the gate stays too long in the region between 0 and Vgs(th).

All transistors, yes.

This also includes some IGBTs that exhibit very slight negative resistance in some portions of their operation; but not SCRs, which exhibit hysteresis in their active range (and also aren't called "transistors", so that's that :) ).

In a switching application (to be precise: one that satisfies my latter "practical" definition), too much time in the linear range (where collector or drain current is easily variable with respect to base/gate voltage) does indeed cause problems -- for the very reason that it's violating the first definition, in other words, that it's not spending a [sufficient] majority of time in an "on" or "off" state!

An amplifier must be designed to handle this power continuously, in the first place, so it's not a problem there.

Tim
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: T3sl4co1l on June 20, 2017, 10:44:58 am
That is a BOLD statement to make :P

What is the state of a BJT transistor with no bias current ?

What is the state of a BJT transistor with the base current pushed beyond saturation ?


FYI original poster - this has nothing to do with your original question(s)

Yes, theoretical asides here :)

A BJT with "no" bias current still exhibits leakage current, and that leakage is still related to the applied voltages.  Continuity is unbroken. :)

For MOSFETs, this is subthreshold operation; for BJTs, they just keep on doing the same thing they always do, even for surprisingly small B-E voltages: Vbe might be 0.2V at Ic ~ nA, but the relation still holds!  The one caveat is that, at some point, the gain drops considerably and output current levels off to the saturation current (which is due to thermally excited electrons leaking across the junction).

But going to zero, or saturating to "max", is fine as long as it's continuous.  The tanh(x) function is continuous, even though, say, tanh(20) is pretty freaking close to 1, it's still not exactly equal.  Likewise, the derivatives are not precisely zero, but remain finite and nonzero.

Likewise, in saturation, the saturation voltage (Vce(sat) or Rds(on) * Id) still varies with input voltage or current, though it slows down sharply in that region, in a similar way.  The relationship may even turn over and invert (i.e., Vce(sat) rising because of base current * emitter resistance, and B-C junction forward bias), but the fact remains: it's continuous, never getting stuck into a region where the output is fully independent of the input (as you would expect for an ideal comparator, for example, where the output voltage should be independent except exactly at the threshold).

Indeed, saturation will never be perfectly solid, but the parameters (voltage or current, say) will cluster around local regions.  When you have a bimodal distribution: where much time is spent within, say, a 5% range of voltages while "on", and a 5% range of currents while "off", with <5% of the time spent between regions, you probably have a switching circuit on your hands, and you'll probably see some sort of square (or at least flat-sided) waveform on the oscilloscope.

Continuity is a very powerful tool in the analysis of circuits, particularly transient analysis (SPICE modeling).  You almost always have faster and more stable results, with continuous functions, and (existing and) finite derivatives: transistors are often better to use than switches or (some) nonlinear dependent sources, and it often helps to include realistic parasitics (resistance, capacitance and inductance). :)

There are some analyses where continuity is broken intentionally: when analyzing a switching circuit by hand, it is useful to break up the switching transient into discrete steps, crudely paving over the actual integrals (that might not even exist!) with straight line approximations.  As long as the volts, amps, charge, energy, etc. matches up at the start and end of each step, you're okay.  This is a conservation type argument: such an argument is only reasonable when the system is continuous, when it is known that it must pass, from one state to the next, in a well defined manner.  This is just thermodynamics on a very short time scale (nanoseconds rather than eternity), and as with the study of gasses, for example: the results are correct, and can be only correct, when conditions change continuously. :)

Tim
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: analogo on June 20, 2017, 02:13:49 pm
Thank you a lot for the theoretical asides. These asides are exactly what I need to understand new topics.  :-+

I think I finally understood it. In practice, in a linear circuit the equation Vout = f(Vin, time) is continuous, while a switching one it has discontinuities. Right?
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: MosherIV on June 20, 2017, 02:25:35 pm
Quote
In practice, in a linear circuit the equation Vout = f(Vin, time) is continuous
Yes

Quote
while a switching one it has discontinuities. Right?
I would not think of SMPS  in the same way as a linear - certainly not the equations.
A linear always uses the same amount of power, it dissipates any power not delivered.

A SMPS on the other hand is more efficient and the only power loss is due to switching inefficiencies.

I think you are confused with the example - we have tried to tell you that the transistor in the example is NOT switching.
The transistor in the example is in linear mode (ie part on and part off).

Tim is right that Transistors are never truly on or off (due to physics) - the example that you are looking at is truly a LINEAR type PSU.
The whole paper is talking ONLY about linear PSU and V regulators.

Forget Switching (SMPS) altogether. The paper does not mention switching PSUs at all.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: T3sl4co1l on June 20, 2017, 02:25:59 pm
Close :)

More aptly, an analog circuit is continuous, if not linear as well.  A linear circuit also satisfies the linearity (associative and distributive) property.

A digital or switching circuit is still analog, because everything in reality is analog (continuous).  The classification of digital or switching (as a subset of analog) is made on a different basis.  (More like: "is it possible, and practical, to model this circuit as a discontinuous digital circuit?")

A digital circuit can be made to approximate an analog circuit, too.  For example, an ADC or DAC with 8 bits of range looks visibly steppy, but at, say, >16 bits, the quantization noise is hard to distinguish from the analog noise floor.  Or it can approximate a stable linear circuit, like a class D amplifier.  In other words, the approximation can be good enough that it's difficult or impossible to tell whether a black box circuit is purely linear, or part digital.

Tim
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: coppice on June 21, 2017, 11:05:45 am
I would not think of SMPS  in the same way as a linear - certainly not the equations.
As long as a switching regulator (or PFC for that matter) operates in continuous conduction it obeys roughly the same rules as a linear circuit. You just need to allow for the Shandon criterion (it's a sampled system) and the endless variation betwren near Dirac sampling and near ZOH sampling  (it's a rather funky sampled system). As soon as you let your switcher enter discontinuous conduction things get more problematic to analyse, rather like a non-switching design hitting saturation.
Quote
A linear always uses the same amount of power, it dissipates any power not delivered.
That is true of many shunt type linear regulators, but those aren't very common. Most other forms of linear regulation vary their consumption with the load.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: bson on June 22, 2017, 08:27:34 pm
The circuit on page 11 has a problem in that at low voltages, below the B-E threshold of the power BJT, the op amp is in open loop.  The fix is to put a resistor across B-E, e.g. 2.2k, so the loop is always closed.  This would also allow it to regulate outputs less than a diode drop.

I quickly hooked this up, with the LF411C being pin compatible with the LM741; the MJE15030 is just what I happened to have a bunch of.

(http://www.rockgarden.net/download/eevblog/simple_pass_reg.png)

It happily regulates 3.3V or 5.1V off a zener to the point of overheating of the BJT.  (Tested with a B&K 8600 DC load.)
I replaced the resistor-zener with a pot and it happily regulates down to 0.1V 3A (for a few seconds, before the heat sink got very hot).
This was off a 12V transformer seconday.

D1-C1 improves ripple rejection by not having it dip into the zener or opamp supply as sharply if the secondary is overloaded/underfiltered.

RV1 isn't needed; the output can't exceed the rail anyway, so positive gain is pointless.  Just make it a buffer and set the voltage on the positive input; skip this adjustable gain hack.  But a trimmer is okay in case a zener is used for reference, but in that case the zener needs to be less and the desired voltage and the trimmer used to adjust it upwards.  It can't ever adjust it downwards, obviously.

The voltage could be controlled by a DAC very easily, just replace D2 with it and make R1 bigger (for pull-up pull-down to COM).  This will also greatly improve PSRR since there's no zener current to drain C1.

Size C1 for ripple rejection.

Remove the GND reference to float off the transformer secondary.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Zero999 on June 23, 2017, 08:47:31 am
The circuit on page 11 has a problem in that at low voltages, below the B-E threshold of the power BJT, the op amp is in open loop.  The fix is to put a resistor across B-E, e.g. 2.2k, so the loop is always closed.  This would also allow it to regulate outputs less than a diode drop.
I don't see how that makes any difference. The op-amp you've chosen common mode range doesn't extent to 0V and even if it did, the B E resistor isn't required. Try it with the LM358 and you'll see it works all the way down to 0V, with no B E resistor.

Quote
D1-C1 improves ripple rejection by not having it dip into the zener or opamp supply as sharply if the secondary is overloaded/underfiltered.
Note that it will also increase the drop-out voltage by another diode drop.
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: T3sl4co1l on June 23, 2017, 08:57:44 am
I don't see how that makes any difference. The op-amp you've chosen common mode range doesn't extent to 0V and even if it did, the B E resistor isn't required. Try it with the LM358 and you'll see it works all the way down to 0V, with no B E resistor.

Rbe helps maintain a linear condition (setting minimum gain and bandwidth, over more of the operating range, both static and dynamic).  It's a good idea in many situations.

It can also make things worse, by increasing the bias current, and therefore Gm and fT, of the driving stage, or reducing turn-off time of the driven stage (see, for example, Darlington-wired transistors and using Rbe's around them).  But that's a system compensation problem (it's "too good", so merely needs RLC values adjusted), not a linearity problem.

This is especially relevant to the LM358, which sucks so bad, it's marginal even for control applications.  Biasing the output (with a load resistor to GND or +V) helps alleviate this.

Tim
Title: Re: Are power supplies based on opamp+transistor linear or switching?
Post by: Zero999 on June 23, 2017, 09:33:22 am
I don't see how that makes any difference. The op-amp you've chosen common mode range doesn't extent to 0V and even if it did, the B E resistor isn't required. Try it with the LM358 and you'll see it works all the way down to 0V, with no B E resistor.

Rbe helps maintain a linear condition (setting minimum gain and bandwidth, over more of the operating range, both static and dynamic).  It's a good idea in many situations.

It can also make things worse, by increasing the bias current, and therefore Gm and fT, of the driving stage, or reducing turn-off time of the driven stage (see, for example, Darlington-wired transistors and using Rbe's around them).  But that's a system compensation problem (it's "too good", so merely needs RLC values adjusted), not a linearity problem.

This is especially relevant to the LM358, which sucks so bad, it's marginal even for control applications.  Biasing the output (with a load resistor to GND or +V) helps alleviate this.

Tim
Oh I didn't mean do not use a base-emitter resistor, just that it isn't needed to close the loop. If the output voltage is set below 0.6V, then the op-amp's input will just sit at VOUT+VBE, assuming the common mode range isn't exceeded.

Another reason for adding a base-emitter resistor is to help the op-amp's output stage discharge the base, when the output voltage is low.