# Comparator with linear output to equalize inputs [closed]

I am a ME dabbling in some EE projects so forgive me if this sounds clueless! I am developing a current feedback system for a power supply.

I am looking for an analog device that will adjust the output to keep the difference between the inputs at zero.

In other words, if V_measured is lower than V_setpoint the output will go up in a linear fashion until the inputs equalize or it reaches +3.6V.

If V_measured is higher than V_setpoint the output will go down in a linear fashion until the inputs equalize or it reaches +1.1V.

Does such a device exist? Or is there a simple way of implementing this using analog parts?

• Can you elaborate on "linear fashion"? Do you mean that it should slew the output voltage with a slow linear ramp until the inputs equalize? Or that it's simply approximately linear as far as transfer function/control characteristics? Commented Dec 14, 2022 at 23:12
• It sounds like you are looking for an op amp.
– Null
Commented Dec 14, 2022 at 23:13
• The first one. I understand that there would need to be some hysteresis or latency otherwise the thing would oscillate.
– MW5
Commented Dec 14, 2022 at 23:14
• @MW5 Actually, external latency and hysteresis can make it more prone to oscillation or other odd instabilities. I have an explanation on how an op amp stays stable without outside latency here. Making it slew linearly actually makes the whole thing harder. Anyway, what does v_measured actually measure? Some kind of mechanical position or similar? Commented Dec 14, 2022 at 23:15
• @MW5 you can't design a job without specs nor design an servo HV controller without better specs either. You need input span , output given 1.1 to 3.6 load impedance, sweep or slew rate and response time in dV/dt in order to get what you aren't telling us. Max temp rise, max current, avoid shutdown etc. The Op AMp must be capable of driving the outout range (not all do) but you might be able to use a single supply +5, 0V not +3.6, 1.1 Read a link in my profile A compendium of blog posts on op amp design topics to learn more, close your question the income back with a better question Commented Dec 14, 2022 at 23:37

I am looking for an analog device that will adjust the output to keep the difference between the inputs at zero.

This is, almost to the letter, an op-amp. However, there are some caveats to be followed. In particular, an op amp should meet your goals in your current schematic as long as:

• It is connected in negative feedback - i.e. as the setpoint increases, either the voltage to the inverting input increases, or the input to the non-inverting input decreases. With the way it's wired, V_setpoint would need to increase as V_feedback increases.
• The load on it is within the limit of the output drivers, i.e. an op amp will gladly drive a 100k resistor network, but probably not a motor or large lamp.
• V_measured and V_setpoint are both within its valid common-mode range (i.e. between +1.1V and +3.6V if it's a rail-to-rail input op amp)
• It has rail-to-rail output so it can achieve the output range you're asking for
• The system between V_setpoint and V_feedback does not include delays/lags that cause overshoot and oscillations, or you add sufficient compensation for them to keep it stable.
• The op amp is a low-voltage model that will operate on a supply of +2.5V.
• You're willing to relax the criterion of "linear fashion".
• The 1.1V and 3.6V rails are actually power rails with low impedance sources and can provide the op amp's necessary supply current without sagging or jumping.

The opamp applications that I know output zero or an offset voltage when the 2 inputs are equal.

Right, this is one simplistic way to model an op amp in open-loop configuration, but the op amp still meets your goals.

Suppose you had an op amp with no offset and an open-loop gain of 1 million. If you input 1.00000 V into both inputs, you'll get 0 V out. However, if you configure it as a unity-gain buffer and apply 1.00000 V to the non-inverting input, the output and the inverting input will end up at 0.999999, for a difference of 1 uV, which is pretty darn close to the goal of finding an output so "inputs are equal", and well within your ability to measure error.

• Hi Nano, thanks for the detailed answer!!
– MW5
Commented Dec 14, 2022 at 23:34
• my application abides by all the requirement you listed above, however...
– MW5
Commented Dec 14, 2022 at 23:35
• When my 2 inputs are equal
– MW5
Commented Dec 14, 2022 at 23:36
• In my application I dont know what the load is so I need to adjust the voltage that drives the high voltage system until the current meets the setpoint. When I measure the voltage across a shunt resistor, I compare it to a setpoint voltage that is proportional to the desired current. When they are equal I know that I am applying the right driving voltage.
– MW5
Commented Dec 14, 2022 at 23:43
• @MW5 Yes, I'm not talking about the system load. I'm talking about the one load impedance that the op amp is driving. Don't conflate the two. Commented Dec 14, 2022 at 23:44