Author Topic: Limiting op-amp output  (Read 27031 times)

0 Members and 1 Guest are viewing this topic.

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Limiting op-amp output
« on: May 09, 2014, 02:41:21 am »
What's the best way to do this?

Suppose you have a +/-15V supply to an op-amp, but you want the output constrained to +5/0V.  Say for a 0-5V analog output, or the input to a 5V supply section, or so on.  Or, suppose you want to limit it to a variable, like a current limit.

The naive method would simply be to clamp the output after a current-limiting resistor.  But this suffers one diode Vf (soft threshold, temp sensitive), and the op-amp is free to saturate, at say +13V, a full 8V above where it needs to be.  So when it drops again, it has to slew all that way.  Even a TL072 will take microseconds to recover.  And if it's got compensation wrapped around it (as you would normally have on an error amplifier), that network has to discharge first, which means recovery takes on the order of the loop time constant (examples: maybe ~10us for an audio amp, ~2ms for a switching supply, 100ms+ for an active PFC supply, 10s+ for a temp controller, etc...).  In any case, the dynamics are ruined in this case!

Recovery can be saved somewhat by moving feedback to after the clamp circuit, but then the clamp requires a buffer, potentially doubling the op-amp count.  Add another if you opt for an active rectifier (to address the regular diode clamp's flaws).  The GBW or propagation time through this chain starts to suffer, too.

It would be nice to use the op-amp for its own benefit, but trying to wrap additional feedback around it just makes an oscillator.  What to do?

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Limiting op-amp output
« Reply #1 on: May 09, 2014, 04:14:51 am »
I thought that type of circuit was called a clipper

http://en.wikipedia.org/wiki/Clipper_%28electronics%29

a clamper I thought is to shift the DC bias level.

I don't think there is a better solution then an active clipper made from a op amp and a diode.

i recently became interested in precision clipper circuits.. do you know the non-idealities of a active clipper?
i think i found a interesting use for one  >:D
« Last Edit: May 09, 2014, 04:21:07 am by SArepairman »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Limiting op-amp output
« Reply #2 on: May 09, 2014, 06:11:52 am »
Well, clip, clamp, limit, min(x,y), whatever you want to call it...

Also the opposite function, max(x,y), which is usually just a matter of turning around all the diodes.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #3 on: May 09, 2014, 06:28:40 am »
Quote
What to do?

Precision rectifier + low gain / output clamp.
================================
https://dannyelectronics.wordpress.com/
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Limiting op-amp output
« Reply #4 on: May 09, 2014, 07:20:00 am »
Any way to eliminate integrator windup / slewing?
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 4215
  • Country: nl
Re: Limiting op-amp output
« Reply #5 on: May 09, 2014, 07:28:06 am »
Google image search for op amp clipping external transistors (which my intuition told me would be how it would be implemented) gave a link to this as the first result.

Variable would have to work differently obviously.
« Last Edit: May 09, 2014, 07:44:20 am by Marco »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #6 on: May 09, 2014, 08:24:45 am »
R1/R2/R3 determine the kick-in point for the diodes / transistors.

Fundamentally, it is no different from using two back-to-back diodes.
================================
https://dannyelectronics.wordpress.com/
 

Offline krivx

  • Frequent Contributor
  • **
  • Posts: 763
  • Country: ie
Re: Limiting op-amp output
« Reply #7 on: May 09, 2014, 08:31:14 am »
Fundamentally, it is no different from using two back-to-back diodes.

It's just exchanging one type of distortion for another, we have no idea what's desirable in this application. Why can the opamp exceed a 0-5V output at all? Can you decrease it's gain? Can you attenuate afterwards?
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Limiting op-amp output
« Reply #8 on: May 09, 2014, 08:47:16 am »
so, even if the threshold for clipping does not exceede the threshold these clippers will introduce additional significant distortion?

if there are two signals, one big and one small, so that the clipper is constantly clipping, what happens?

 is there additional distortion (to the small signal) when it is activated (big signal present) vs when it is just sitting there while the small signal under the clipper threshold (big signal is not present)?

lets say you digitally filter out the unclipped signal from the clipped+unclipped signal.

* i am also interested in any other side effects that may happen other then distortion.

should i make my own thread T3sl4co1l? i might be derailing yours
« Last Edit: May 09, 2014, 08:56:52 am by SArepairman »
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #9 on: May 09, 2014, 09:01:59 am »
Quote
It's just exchanging one type of distortion for another,

One possible application would be some kind of some clip - quite desirable in high crest factor amplifiers (audio amplifiers for example). They are more like input-dependent log-amplifiers.

Quote
we have no idea what's desirable in this application.

True.
================================
https://dannyelectronics.wordpress.com/
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Limiting op-amp output
« Reply #10 on: May 09, 2014, 09:40:56 am »
Thought I gave a reasonable background, limiting error amp outputs for instance.  The error amp has high DC gain.  It is desirable not to require additional amps, and to prevent any amp from saturating (to prevent excessive slewing and the attendant recovery time penalty).

In general, the error amp will have +in = reference, -in = feedback.  An inverting amp is sometimes possible, when the reference is available inverted or when the process* is inverting.

*Process, "plant", the thing under control.

If you'd like something even more concrete, suppose you have this:
- 0-5V triangle wave, 100kHz
- PWM comparator, gate drive, switcher -- buck converter let's say, and current sense.  Let's say the current sense uses a Kelvin connected shunt and a differential sense amp.
- Inner error amp: output to PWM comp; -in to ISENSE, +in to IREF
- Outer error amp: output to IREF (sets inner loop variable), -in to VOUT, +in to VREF (maybe we've got a potentiometer hanging off a TL431 so it's an adjustable regulated DC output)

And the amps are running from +/-15V supplies.

There are two things wrong with this:
1. The inner error amp can slew outside the range of the triangle wave.  So for -15 to 0V, it's saturated, 0% PWM.  Only the 0-5V range is linear.  Then 5-15V it does 100%, saturated again.  The inner current loop needs to be as fast as possible, in order to allow the outer voltage loop to be as fast as possible.  Letting it span excess range wastes time slewing.
2. The outer error amp has wasted range -15 to 0V, since the output current can never be negative (assuming transistor + diode type buck converter; a synchronous buck could actually go bidirectional, as long as the current sense amp supports it).  And it will saturate at +15V, whereas it would be desirable (or required even) to have an adjustable limit.  That limit must be accurate if a repeatable current limit is required (say for a lab supply with square SOA -- tight voltage and current regulation).

Leaving the outer voltage amp alone is especially awful, as going from -15V to 0V will take an extremely long time (tens of miliseconds?).  And don't say it won't happen, because it will, each and every time the load current drops suddenly.  And then the load starts back up and the voltage drops out (potentially followed by extreme overshoot as it attempts to recover).  So some sort of limiting is required there, and the output of that limiter has to be able to drive the compensation network (let's say it's 10kohms + 0.01uF).

By the way, this is a known and familiar failing of many power supplies, and a primary reason they are often rated for regulation, and transients if at all, at two relatively linear points, like 10 and 100%, or even 50 and 100% load.  Well what happens at 0%-100%, or even 0%-10%?  You probably don't want to know.

Both loops illustrate the problem, and each suggests different options.

For the inner loop, a fixed limit is fine.  The simplest is a voltage divider (to +V and -V or GND, as needed), so that the guaranteed output range (V_OH to V_OL, at the same or higher load resistance) gets reduced to the desired range.  A couple oddball resistor values are sometimes required, and you'll still end up with dead zones (because the real amp will saturate better than the guaranteed limits), but it's a far sight better than nothing.

You could also use an R2R amp on a restricted supply, but then you need another chip, and you need (in this case) a 5V power rail, and the inputs are no longer +/-15V compatible.  (If the entire circuit operated on +5/0V rails, this satisfies the fixed limits for both amps, at the expense of some 10s of mV saturation -- if accuracy down to low levels is required, rails just beyond +5/0V are required.  +/-15V would be a far sight from there, but illustrates the need better.)

Certainly, neither is acceptable for the voltage amp, if an adjustable current limit is required.

...Is "dur, use a diode" really the extent of original thought here?  Come on guys, let's see some brain storming!

Tim
« Last Edit: May 09, 2014, 09:45:55 am by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #11 on: May 09, 2014, 10:08:03 am »
Quote
Is "dur, use a diode" really the extent of original thought here?

Is the diode solution not working for you? Or you don't want it to work?

Maybe put a schematic of what you are trying to do will help you help others help you.
================================
https://dannyelectronics.wordpress.com/
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Limiting op-amp output
« Reply #12 on: May 09, 2014, 10:09:04 am »
The amp is still slewing and saturating.
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #13 on: May 09, 2014, 10:11:22 am »
Quote
The amp is still slewing and saturating.

That's easy to solve: don't drive it to saturation if you don't want your amp to saturate.
================================
https://dannyelectronics.wordpress.com/
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Limiting op-amp output
« Reply #14 on: May 09, 2014, 12:35:28 pm »
How do I do that?
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Limiting op-amp output
« Reply #15 on: May 09, 2014, 02:01:21 pm »
well, you can detect a near over voltage condition using a very fast comparator, like the lt1016. i don't know what it would do but i think thats the next phase in outside of box thinking for this problem, some kind of detector and a response. or a dedicated very fast sampling ADC.

what if a comparator detected a "near over voltage condition" and then increased the value of some kind of synthetic voltage controlled resistor (jfet?) to attenuate the signal without switching
« Last Edit: May 09, 2014, 02:12:00 pm by SArepairman »
 

Offline nickm

  • Regular Contributor
  • *
  • Posts: 79
Re: Limiting op-amp output
« Reply #16 on: May 09, 2014, 02:06:18 pm »
Put diodes across the integrator cap to limit the voltage across the cap to keep it from charging up too far.  A 5V zener in parallel with a schottkey would limit the output to about +5V, -0.3V without saturating the opamp.

Another way is power your error amp off +5V, 0V.
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Limiting op-amp output
« Reply #17 on: May 09, 2014, 02:12:29 pm »
i really think the op is sick of diodes  >:D
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 1784
  • Country: ca
Re: Limiting op-amp output
« Reply #18 on: May 09, 2014, 03:20:57 pm »
Hi,

Here is a couple of techniques that you can use.

I have set the lower level to -1V just to illustrate the circuit behaviour.

This the circuit I have the main op-amp with a 1K resistor to limit the current when the clamping happens. Feedback is closed around the 1K resistor to prevent loading errors.



Here is the result:



If I zoom in on the positive clamping, I can see a little overshoot, the op-amp U2 has to slew from the positive rail to one diode drop below the clamping voltage. This takes about 4us with the op-amp shown.




If you give up a small amount of precision you can make a faster circuit like this:



Op-amps U2 and U3 do not have to slew at all. The circuit relies on the matching of the diodes, so I suggest using dual-diodes in the clamping circuit. Resistors R3 and R4 are chosen to so the currents in the diodes are equal when clamping.

This is the positive clamp zoomed in:



I have attached a zip file with the LTspice file.

Regards,

Jay_Diddy_B


« Last Edit: May 09, 2014, 03:22:40 pm by Jay_Diddy_B »
 
The following users thanked this post: mycroft

Online BravoV

  • Super Contributor
  • ***
  • Posts: 5852
  • Country: 00
Re: Limiting op-amp output
« Reply #19 on: May 09, 2014, 06:12:27 pm »
Jay_Diddy_B, thank you !  :-+

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #20 on: May 09, 2014, 11:17:35 pm »
Quote
How do I do that?

Don't over-drive it?

There always exists a threshold beyond which any (real) amplifier will clip, regradless of design, etc.

If your goal is to design an amplifier that doesn't saturate, you will fail for sure.

Instead, I would focus on the particular application and see how much saturation / clipping you can tolerate and design to that.
================================
https://dannyelectronics.wordpress.com/
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13097
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Limiting op-amp output
« Reply #21 on: May 09, 2014, 11:19:00 pm »
well, you can detect a near over voltage condition using a very fast comparator, like the lt1016. i don't know what it would do but i think thats the next phase in outside of box thinking for this problem, some kind of detector and a response. or a dedicated very fast sampling ADC.

what if a comparator detected a "near over voltage condition" and then increased the value of some kind of synthetic voltage controlled resistor (jfet?) to attenuate the signal without switching

It would be nice to minimize parts count (semantically and practically).  I can solve the problem at hand with all of eight transistors (perhaps even my namesake of seven), but no one makes a general-purpose IC with that functionality, so...

A comparator won't work, because its response is on or off, not proportional.  And it's certainly much too fast to wrap around an op-amp; even if the comparator itself were unity gain stable (as an op-amp alone is), the pair is absolutely guaranteed to oscillate, because both exhibit a phase shift of 90 degrees over most of the frequency range.

If I were going to use an ADC, I would take in all the signals (in the example, the ISENSE, VOUT, VREF and ILIMIT voltages) and do the entire thing digitally, in an FPGA (not in an MCU, software can crash).  But that's a metric shitton of circuitry and programming, when the problem can be solved in just a few op-amps.  One would hope.

Put diodes across the integrator cap to limit the voltage across the cap to keep it from charging up too far.  A 5V zener in parallel with a schottkey would limit the output to about +5V, -0.3V without saturating the opamp.

Another way is power your error amp off +5V, 0V.

But how can I put diodes across the integrator cap when it's internal to the op-amp (Miller / dominant pole compensation)? :)

If I built my own, either discrete or using the guts of an op-amp (an OTA like LM13700), I could limit the voltage gain node directly.  (It's also easier to compensate, as the compensation network can be an R+C to ground, rather than from output to -in.)  But this isn't a general purpose amp: it would work, and it's hardly unavailable, but it's definitely old fashioned.

FWIW: a monolithic solution does actually exist, but it's expensive and special-purpose.  Limiting amps are most common in video applications, with weird voltages and high bandwidths.  I don't want that.

This the circuit I have the main op-amp with a 1K resistor to limit the current when the clamping happens. Feedback is closed around the 1K resistor to prevent loading errors.

Here is the result:

...


What about the recovery time of U1's output?  That's what I'm most concerned about.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Limiting op-amp output
« Reply #22 on: May 09, 2014, 11:32:49 pm »
Quote
But how can I put diodes across the integrator cap when it's internal to the op-amp (Miller / dominant pole compensation)?

Many alternatives:

1) you certain can put it there  - at low voltage, the diversion from a diode is small - r0 for most diodes are into the Mohms or higher.
2) you can do it in stages;
3) you can put the limiter before the integrator;
4) you can build a discrete amp and implement anti-saturation there.
...
================================
https://dannyelectronics.wordpress.com/
 

Offline nickm

  • Regular Contributor
  • *
  • Posts: 79
Re: Limiting op-amp output
« Reply #23 on: May 10, 2014, 12:16:00 am »
I thought when you were talking error amps it was an integrator either classic, type II or III with a discrete cap across output and in-.  Whats the configuration of the opamp you're trying to limit.  Sorry I only briefly read through the other posts so I might have missed it.
 

Offline SArepairman

  • Frequent Contributor
  • **
  • Posts: 885
  • Country: 00
  • wannabee bit hunter
Re: Limiting op-amp output
« Reply #24 on: May 10, 2014, 04:52:42 am »
well, I was sort of thinking in my head that the comparator would connect some kind of circuit that reads the voltage and tries to maintain the voltage @ or bellow a certain set point by messing with the voltage controlled resistor (could be some kind of V-F converter controlling a switched capacitor resistor maybe, I really don't know much about jfets). I know its not what you are looking for but I figured I would clarify, the comparator is just the activator for a circuit that might cause problems if it is running normally.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf