Simple Error Amplifier - Page 1
Forum section: electronics / projects

author: eujean
author_rank: Contributor
timestamp: March 24, 2017, 07:18:23 pm
content: Hi there,As I understand it is hardly ever a good idea to use an op-amp as a comparator, since there are much beter comparators available to complete such a task.I intend on building a power supply at some point in the future, and was wondering specifically about the error amplifier. Most examples I came across, such as in the good old HP e3610 design, they seem to use an LF411 JFET op-amp to compare the measured voltage to a set voltage(which they achieve by changing the resistor divider). For a dual rail setup, the output voltage should vary between 12V and -12V to turn on a driver transistor which drives the series pass transistor. They also have a resistor and capacitor from the inverting input to the output of the op-amp. I can only presume that this is for some form of frequency compensation or something, but I can't see how there will really be any frequency component when measuring the output voltage? Or am I missing something obvious?Basically the question is, why use an op-amp as the error amplifier when a comparator is supposedly much faster?

author: retrolefty
author_rank: Super Contributor
timestamp: March 24, 2017, 07:24:47 pm
content: QuoteBecause an op-amp will provide any linear output voltage from rail to rail to drive the output stage(s). A comparator only provides a digital output, either one rail voltage or the other. Different components aimed for different applications. An op-amp can be made a decent comparator with proper external components, but a comparator cannot replace a linear op-amp.

author: eujean
author_rank: Contributor
timestamp: March 24, 2017, 07:43:41 pm
content: Quote from: retrolefty on March 24, 2017, 07:24:47 pmSince its a closed loop, you would not need a linear output voltage if you have a driver that either turns the pass element on or off. This is assuming the loop is fast enough.

author: Benta
author_rank: Super Contributor
timestamp: March 24, 2017, 08:16:42 pm
content: Seems you are mixing linear regulators and switched regulators into one thing. They're not.Linear regulators contain no switching elements and a comparator makes no sense.

author: eujean
author_rank: Contributor
timestamp: March 24, 2017, 08:36:11 pm
content: Maybe I didn't explain entirely, consider this the example circuit I was talking about. This comes directly from the old HP e3610 design with a modification not to adjust the voltage divider, but just the reference voltage and the substitution of the LF411 for the OP07.Assume the measured voltage is 12 V, then if the set voltage is greater than 1.2 V, the output Vout is the saturated output of the op-amp, i.e 12 V. When the set voltage is less than 1.2V, the output of the op-amp saturates negatively, i.e. -12 V.Vout is connected to their driving circuit which drives the pass element.The point I'm trying to make is that, in that setup, the op-amp is essentially operating as a comparator. Why not use a much faster comparator instead?

author: Seekonk
author_rank: Super Contributor
timestamp: March 24, 2017, 08:54:50 pm
content: Looks linear to me.

author: Benta
author_rank: Super Contributor
timestamp: March 24, 2017, 09:22:58 pm
content: QuoteNo, it's operating as an amplifier with an AC gain of ~1500, an integrator term and infinite DC gain. I'd say the 1.5M and cap are just for stability, total loop gain is set somewhere else not visible on your schematic.

author: eujean
author_rank: Contributor
timestamp: March 24, 2017, 09:50:39 pm
content: Quote from: Benta on March 24, 2017, 09:22:58 pmI agree that it is in fact an integrator with infinite DC gain.There should not really be an AC component there(theoretically at least) which is why I said comparator.Which is why I'm asking, because it seems to perform the same task if I swap out the op-amp for a comparator and remove the feedback part.

author: Benta
author_rank: Super Contributor
timestamp: March 24, 2017, 10:07:37 pm
content: QuoteWhich begs the question: "what on earth are you trying to achieve?" An OP07 is not a cheap amp, and I'm sure it's in the design for a reason...

author: Zero999
author_rank: Super Contributor
timestamp: March 25, 2017, 12:26:07 am
content: Quote from: retrolefty on March 24, 2017, 07:24:47 pmActually, with the correct compensation/filtering network, most comparator ICs can be used as op-amps.There's even an example of the LM339 being used as an op-amp to make the integrator in a VCO.http://www.ti.com/lit/ds/symlink/lm339-n.pdfThis isn't ideal but neither is using an op-amp IC as a comparator. If I were to build the circuit shown above, I'd probably use the LM393 and NE5532, for the comparators and op-amp, respectively.

author: eujean
author_rank: Contributor
timestamp: March 25, 2017, 12:15:11 pm
content: Quote from: Benta on March 24, 2017, 10:07:37 pmThe original schematic calls for a LF411 Low offset Low Drift op-amp. I simply chose the OP07 because it was something I had on hand and was easy enough to simulate quickly. The specific op-amp is not as relevant.I'm just curious why use an op-amp which is not as suited for the task it is ultimately performing?Thanks for all your advice so far! Much appreciated!

author: Benta
author_rank: Super Contributor
timestamp: March 25, 2017, 12:31:31 pm
content: QuoteYou're still not understanding the circuit. It isnotoperating as a comparator, it is operating as an amplifier in its linear region.You need to include the rest of the circuit to fully see this.

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 25, 2017, 12:39:17 pm
content: Quote from: eujean on March 25, 2017, 12:15:11 pmI know it's hard to imagine, but the error amplifier in a linear regulator really is operating in the linear region most of the time. This is because during steady state conditions the error-amp output will be at the voltage necessary to ensure the pass element delivers the desired output voltage. The extremely high DC gain (effectively the open-loop gain of the op-amp) ensures that the two inputs will be at nearly the same voltage during steady state operation.It might help with your understanding if you lowered the DC gain of the error amp to, say, x10, and simulated it in LTSpice or the like. Note how the performance of the regulator changes, both in the steady state output voltage error and in response to abrupt changes in load (both small and large changes).

author: eujean
author_rank: Contributor
timestamp: March 25, 2017, 02:04:35 pm
content: The circuit below illustrates the loop for constant voltage.The LT1037 is much faster/more accurate than the OP07 according to simulation, and thus was used instead.If the op-amp is replaced with a comparator, such as the LT1018 for example, and the feedback capacitor removed, the output is exactly the same (even for node Vea), hence the question.

author: Benta
author_rank: Super Contributor
timestamp: March 25, 2017, 03:35:36 pm
content: QuoteI'm not surprised. As you've drawn it, the opamp is not doing anything, your regulator is open loop.I see a 100/900 kohm combination at the output. Shouldn't that go to the opamp?

author: eujean
author_rank: Contributor
timestamp: March 25, 2017, 04:38:49 pm
content: Quote from: Benta on March 25, 2017, 03:35:36 pmNot sure I understand, since the final output is fed to the op-amp through the 20k/2k combination?QuoteThis was only intended to be used for later measurement, i.e. something that can be sent to an ADC or something.

author: Benta
author_rank: Super Contributor
timestamp: March 25, 2017, 04:52:26 pm
content: Vset seems to be a voltage reference with no relation to the output.

author: BravoV
author_rank: Super Contributor
timestamp: March 25, 2017, 04:57:23 pm
content: You're feeding the non-inverting input with a "FIXED" voltage.

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2017, 05:03:18 pm
content: There is feedback through R4 and R5. V_set is relative to the output. The circuit with GND at the positive output can be a little confusing.Still the error amplifier works in linear mode so usually with something like 1 V at the output. So it absolutely makes sense to use an OP and not a comparator.For a comparator linear operation might work in some cases, but is usually not guarantied. Also the LT1037 might be a problem, as this OP is not unity gain stable - this can be a problem in some cases.With the compensation circuit as shown, the choice of OP could be important as the GBW of the OP might set the loop speed in the critical frequency range. So a faster or not unity gain stable OP might need a modified compensation.For stability of the loop also parasitic properties like the ESR of C2 and inductance of the 0.1 Ohms resistor can play a role. Usually it is a good idea to have a combination of low ESR and high ESR capacitance for C2.

author: eujean
author_rank: Contributor
timestamp: March 25, 2017, 05:17:12 pm
content: Quote from: Kleinstein on March 25, 2017, 05:03:18 pmYes I must apologize for this. I did it this way to relate to the original e3610 schematic.QuoteThis makes sense as Benta mentioned as well that the amplifier is operating in linear mode. With some more simulation, the comparator seemed to oscillate even though it did seem to make the loop a bit faster prior to oscillation.Does this mean that the compensation circuit is of much more importance than the OP? How would one go about deciding what to trade off?

author: Kleinstein
author_rank: Super Contributor
timestamp: March 25, 2017, 05:53:10 pm
content: Usually the compensation circuit is more important than the OP. If the OP is fast enough it is the external circuit that sets the speed and not the OP anymore. The shown circuit is a little unusual in this respect.Usually an OP with something like 1-3 MHz GBW is considered fast enough. In some circuits even the slow OP07 or LM358 might be fast enough. The feedback divider also has an influence on how fast the OP needs to be. Quite some circuit have more feedback for the AC part and this way can operate with an OP that is slower.The more important parameters for the choice of OP can be noise, DC drift and in some high impedance circuits also input bias. For a simple lab supply something like an TL07x / LF411 / RC4558 can be good enough. If one wants a really fast regulating supply it needs fast output transistors and care with the parasitic properties - using as faster OP alone does not help. Looking at parasitic inductance in the 10's of nH range is what makes this difficult. Another point to consider is that transistors / MOSFETs get slower at low current and thus 2 quadrant operation might be a good idea if a high speed is needed.

author: Benta
author_rank: Super Contributor
timestamp: March 25, 2017, 06:04:23 pm
content: The compensation of the opamp has values that are so large, that you can be certain that it is compensating the whole loop, not just the opamp.Hint for readable schematics: always draw siganls as signals. Do not rely on implication through a couple of ground symbols.

author: diyaudio
author_rank: Frequent Contributor
timestamp: March 25, 2017, 08:48:29 pm
content: Some op-amps configured with high gain will function pretty fine as a comparator (in slow applications), selection will depend on a few factors not limited to.* Speed* Slew Rate* High noise as a result of gain feedback path at the summing points.* Cost

author: Lee Leduc
author_rank: Regular Contributor
timestamp: March 25, 2017, 11:26:50 pm
content: Here's an Analog Devices app note AN-849 discussing the pros and cons of using opamps as comparators.

author: Efe_114
author_rank: Contributor
timestamp: December 23, 2018, 07:41:44 pm
content: Sorry for replying to this old topic but i wanted to clear the fog about E3610a schematicsfull schematic at the attachment.

author: David Hess
author_rank: Super Contributor
timestamp: December 25, 2018, 02:31:15 am
content: Quote from: eujean on March 24, 2017, 07:18:23 pmOperational amplifiers are sometimes used as comparators when speed is not required or when precision or some other characteristic unique to an operational amplifier is required.QuoteThe LF411 is being used as an operational amplifier.QuoteThat is exactly the reason a comparator cannot be used.The trick when negative feedback is used is that the gain needs to drop below unity before 360 degrees of phase lag is reached or the circuit becomes an oscillator. Operational amplifiers have frequency compensation to do exactly this while comparators often have the opposite in the form of hysteresis which provides positive feedback to increase gain at high frequencies.The external negative feedback connection is 180 degrees. The frequency compensation for a typical operational amplifier adds another 90 degrees but reduces the gain at high frequencies so stability is maintained. If the power circuits add too much phase lag, then the control loop will oscillate but this can be solved by adding phase lead in the feedback network or lowering high frequency gain further.