Limiting op-amp output - Page 1
Forum section: electronics / projects

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 08, 2014, 04:41:21 pm
content: 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

author: SArepairman
author_rank: Frequent Contributor
timestamp: May 08, 2014, 06:14:51 pm
content: I thought that type of circuit was called a clipperhttp://en.wikipedia.org/wiki/Clipper_%28electronics%29a 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

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 08, 2014, 08:11:52 pm
content: 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

author: dannyf
author_rank: Super Contributor
timestamp: May 08, 2014, 08:28:40 pm
content: QuotePrecision rectifier + low gain / output clamp.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 08, 2014, 09:20:00 pm
content: Any way to eliminate integrator windup / slewing?

author: Marco
author_rank: Super Contributor
timestamp: May 08, 2014, 09:28:06 pm
content: Google image search for op amp clipping external transistors (which my intuition told me would be how it would be implemented) gave a link tothisas the first result.Variable would have to work differently obviously.

author: dannyf
author_rank: Super Contributor
timestamp: May 08, 2014, 10:24:45 pm
content: R1/R2/R3 determine the kick-in point for the diodes / transistors.Fundamentally, it is no different from using two back-to-back diodes.

author: krivx
author_rank: Frequent Contributor
timestamp: May 08, 2014, 10:31:14 pm
content: Quote from: dannyf on May 08, 2014, 10:24:45 pmIt'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?

author: SArepairman
author_rank: Frequent Contributor
timestamp: May 08, 2014, 10:47:16 pm
content: 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

author: dannyf
author_rank: Super Contributor
timestamp: May 08, 2014, 11:01:59 pm
content: QuoteOne 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.QuoteTrue.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 08, 2014, 11:40:56 pm
content: 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

author: dannyf
author_rank: Super Contributor
timestamp: May 09, 2014, 12:08:03 am
content: QuoteIs 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 09, 2014, 12:09:04 am
content: The amp is still slewing and saturating.

author: dannyf
author_rank: Super Contributor
timestamp: May 09, 2014, 12:11:22 am
content: QuoteThat's easy to solve: don't drive it to saturation if you don't want your amp to saturate.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 09, 2014, 02:35:28 am
content: How do I do that?

author: SArepairman
author_rank: Frequent Contributor
timestamp: May 09, 2014, 04:01:21 am
content: 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

author: nickm
author_rank: Regular Contributor
timestamp: May 09, 2014, 04:06:18 am
content: 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.

author: SArepairman
author_rank: Frequent Contributor
timestamp: May 09, 2014, 04:12:29 am
content: i really think the op is sick of diodes

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 09, 2014, 05:20:57 am
content: 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

author: BravoV
author_rank: Super Contributor
timestamp: May 09, 2014, 08:12:27 am
content: Jay_Diddy_B, thank you !

author: dannyf
author_rank: Super Contributor
timestamp: May 09, 2014, 01:17:35 pm
content: QuoteDon'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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 09, 2014, 01:19:00 pm
content: Quote from: SArepairman on May 09, 2014, 04:01:21 amIt 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.Quote from: nickm on May 09, 2014, 04:06:18 amBut 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.Quote from: Jay_Diddy_B on May 09, 2014, 05:20:57 amWhat about the recovery time of U1's output? That's what I'm most concerned about.Tim

author: dannyf
author_rank: Super Contributor
timestamp: May 09, 2014, 01:32:49 pm
content: QuoteMany 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....

author: nickm
author_rank: Regular Contributor
timestamp: May 09, 2014, 02:16:00 pm
content: 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.

author: SArepairman
author_rank: Frequent Contributor
timestamp: May 09, 2014, 06:52:42 pm
content: 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.

author: bobwidlar
author_rank: Contributor
timestamp: May 09, 2014, 07:20:43 pm
content: Well, I really didn't get the point of saturation and slewing. How is it related to the clipping diodes?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 10, 2014, 12:06:29 am
content: Quote from: nickm on May 09, 2014, 02:16:00 pmYes -- doesn't matter which type, that's just the impedances connected around it. The purpose is still the same.Tim

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 10, 2014, 12:20:05 am
content: Quote from: bobwidlar on May 09, 2014, 07:20:43 pmBecause they don't prevent those things from happening. In the circuit above, the 1k series resistor from U1 guarantees that U1's output can swing all the way up to +15V (or whatever V_OH it is able to reach). When the input signal changes direction, it takes a relatively long time for that voltage to fall (slew) back into the linear range.If U1 had a compensation network across it -- making it an integrator, or some variation on one -- it would take time, not only for the amp to change its own output, but orders of magnitude longer for the integrating capacitor to gradually discharge from 15V down to the linear range. During that time, the process being controlled -- a power supply's output current, for example -- is left completely unconstrained! At best, the dynamics just stink (maybe it takes some miliseconds for the current limit to kick in); at worst, the circuit explodes because what you thought was current limited, wasn't!Saturation is doubly relevant because, how much the integrator charges during this nonlinear excursion is proportional to the duration, until the op-amp saturates and it gets as bad as it can.This "windup" behavior is often seen in supplies where, for example, the turn-on startup transient looks like this: nice speedy ramp over a few ms, oops we overshot the output voltage, better turn it off, ho hum waiting for voltage to fall, oh wait there it went, better go full throttle again!...and so on. It bounces around excessively, through a strongly nonlinear range (it goes into saturation and cutoff alternately), even though the quiescent, linear condition may be critically damped (so that, once it's operating with a little load, it behaves itself, and the 50-100% load step looks just peachy).Tim

author: nickm
author_rank: Regular Contributor
timestamp: May 10, 2014, 01:39:14 am
content: Ok then I really don't see why a zener and a schottkey won't meet your needs. When the output of the opamp exceeds the zener voltage (+5V) the zener conducts and the small signal gain of the opamp goes to zero so your output won't rise above +5V. Since the forward drop of the zener is bad you add the schottky so that when the opamp starts to swing negative (-0.3V) the schottkey conducts and the small signal gain of the opamp goes to zero and the output won't go below -0.3V. You've clamped your output and the opamp itself isn't saturating.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 10, 2014, 02:43:15 am
content: Quote from: T3sl4co1l on May 09, 2014, 01:19:00 pmTim,How fast do you need this circuit to be?What is the sampling rate of the data converter?What is the BW of the data converter?If I replace U1 in my schematic with an LT1224, 45 MHz of GBW and 400 V/us Slew rate I get this model:The results in about 40ns delay in the risetime:And a 40 ns delay in the falltime:Using higher GBW op-amps in the U2 and U3 locations may improve the clamping. The output stages of these amplifier is subjected to a step load change.By the way using an 0-5V powered rail-rail op-amp will not be so good close to the rail. You will see over-drive recovery issues. These may not be modelled accurately. But here is a circuit:And the simulation results:You need to try this circuit in hardware.Regards,Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 10, 2014, 01:25:23 pm
content: Hi,Here is another circuit:This circuit is remarkably simple. The diodes do most of the work. The op-amp is needed because the circuit is sensitive to loads in parallel with R1.It does introduce some small gain and offset errors which can be corrected.This plot shows the error versus Vin:Jay_Diddy_B

author: bobwidlar
author_rank: Contributor
timestamp: May 10, 2014, 05:05:40 pm
content: Quote from: T3sl4co1l on May 10, 2014, 12:20:05 amHi Tim,It seems to me that, slewing is not a feature of the clamping circuits. It is because of the OPAMP you use. If you use any kind of feedback, especially unity gain, and a large input then of course it will slew at some point. The solution might be to use clamping before any kind of OPAMP and then buffer the clamped output like the last circuit proposed by Jay_Diddy_B. Another option ofcourse is to choose an OPAMP which will not slew for your expected input signals. This might be an expensive solution though.BTW, what is your signal swing and max frequency? Will it needs to handle some step inputs, if so what kind of rise time of a step?

author: Dinsdale
author_rank: Regular Contributor
timestamp: May 10, 2014, 07:34:29 pm
content: An AGC circuit? Maybe modified by absolute input levels instead of feedback?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 10, 2014, 11:10:00 pm
content: Quote from: nickm on May 10, 2014, 01:39:14 amDo you have, or can you make, a voltage-controlled zener?(Hint: TL431 doesn't count -- even if its ground reference were correct (that's more a matter of semantics anyway; there are other styles), it's not actually a zener, it's an op-amp with precision offset. So it won't play well in a loop.)But yes, for the fixed limit case, a zener will work. Not exactly, for more subtle reasons, but the idea is right.Tim

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 10, 2014, 11:21:57 pm
content: Tim,Can you share a little more about the application?What is the input?What is useful signal range that you need to measure?Regards,Jay_Diddy_B

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 10, 2014, 11:23:11 pm
content: Quote from: Jay_Diddy_B on May 10, 2014, 02:43:15 amGBW under 2MHz is generally fine. Rarely would a control application require more. Often, that isn't even required, it's just the most common (e.g., switching controllers usually have error amps in the 0.5-4MHz range, or Gm amps with effectively similar performance).QuoteThis is not an ADC buffer or something. This is using op-amps for op-ampy stuff. Linear analog stuff....Does no one work with analog stuff anymore? Is it really all ADCs now?...QuoteI don't need 45MHz GBW. If I did, I would just as well move the goalposts proportionally. What to do about the 100ns windup? Or 1ns? It's ugly no matter what scale you do it on.And anyway, I could do that, and be no smarter than any other technician. You are telling me to resign myself to stay within my existing range of knowledge. That's depressing!QuoteModel? The breadboard tells all.And yes, another good reason, besides inaccuracy near the rails.Tim

author: G0HZU
author_rank: Super Contributor
timestamp: May 10, 2014, 11:25:21 pm
content: I've only skimmed the thread but I can offer some real world experience here...Normally when you have a problem like the one in the first post, it's time to step back and look at the bigger picture rather than trying to perfect a 'band aid' solution.eg I'd question the system design if you end up facing the problem in post #1.Maybe it's better to redesign the system so you don't have such an extreme interface/level problem in the first place...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 10, 2014, 11:46:07 pm
content: Quote from: Dinsdale on May 10, 2014, 07:34:29 pmNow that's interesting.Obviously, no way to do it with conventional op-amps, but it relates back to my earlier mention of "this is easy with a transconductance amp". You could hang a clamp transistor over to the bias input, so it chokes itself off. The limit need not entail excessive gain/phase shift (you can compensate the whole thing however you like). I would be concerned about frequency response varying along the way (since bias, and gain, are changing in the process), which may make for slow recovery coming out of the limit. But even so, it's probably a pretty good way, and need not have any peaking at all.AGC amps proper I think are going to have similar behavior, depending of course on how the control response acts.Tim

author: dannyf
author_rank: Super Contributor
timestamp: May 11, 2014, 12:01:14 am
content: QuoteFairly simple with a conventional opamp: led + photo resistors for example.A conventional approach is to use a VGA like AD603. 20db in single stage.A simpler but less conventional approach is to use a dual gate mosfet: 30-40db per stage.

author: Marco
author_rank: Super Contributor
timestamp: May 11, 2014, 12:10:52 am
content: Quote from: dannyf on May 08, 2014, 10:24:45 pmZeners you mean? The advantage of the transistors is that you can use variable clipping voltages, just use two parallel pots for the feedback and put the bases of the transistors on the whipers. Only problem is that you can't go close to zero.How about something like this (only positive clipping shown, cause Im lazy) :

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 11, 2014, 02:09:43 am
content: This looks interesting. The (from the op-amp's point of view) grounded base feedback loop has plenty of voltage gain, but the compensation appears to rein it in (the small signal step response is shown). Accuracy is limited by Vbe gain, so it has kind of an exponential toe-in as it tops off. No peaking/overshoot/recovery.Op-amp example is just a gain of five so I don't have to do a whole loop and everything. The circuit will certainly work the same with any loop, so long as it is configured for inverting operation.Low accuracy version: just drive the PNP base from the limit reference. Single transistor solution. You lose a Vbe and get full tempco.Medium version (within, say, 50mV): as shown. Tempco mostly cancels, but exact amount varies with current through each transistor (namely, the ratio of emitter currents). Depending on manufacturing and temp matching of course.Precision: will take more thought, and certainly a couple more transistors.A general purpose solution (not restricting +in = GND) would be cool, too.Hmm..Tim

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 11, 2014, 03:28:41 am
content: Hi,Here is an all transistor design:This relatively simple circuit has wide bandwidth and introduces only 2 degrees of phase shift at 1 MHz. The gain flat at -0.19 dB at 1 MHzHere is the gain phase plot:The time domain model:This the performance at 100kHz no clipping:And at 100 kHz with clipping:The performance at 1 MHz no clipping is:I thinking that this circuit worth trying on the bench.Jay_Diddy_B

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 11, 2014, 04:23:43 am
content: Hi,Here is an additional model, the positive and negative limits are being varied:The result is:Jay_Diddy_B

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 11, 2014, 04:33:17 am
content: I'm not so concerned about the fully discrete approach; like I said, if I had to, I could roll my own everything, and make an op-amp with built in voltage controlled limits. It would just take 20 transistors, at least as many resistors, and still need offset trimming.As for discrete limiter blocks not including the amp, I already have a pretty good one of those (which is why I started this thread -- to do it with the op-amp included, this time). See attached. This one uses six transistors (one optional), offers a +/-20mV (or so) offset trim (referred to one input only, it seems), can be expanded to nearly unlimited inputs, has a buffered emitter follower output, and (as shown) also has a indicator output to show which input is active. For example, you could put this circuit into a lab power supply and use the indicator output for the current/voltage regulation indicator.The transistor models are as shown, except for the starred parts, which have different IS parameters, to demonstrate the offset trim and matching over variations. I don't have those data offhand (the temp/sweep plots), but I think I had ran them.Again, this type of limiter is best suited to use with an op-amp, not necessarily with high GBW, but high slew rate at least, so that the recovery can be relatively short; and especially when used with external compensation, because the feedback can be drawn after the limiter with no need for a second op-amp as a follower, and the slew rate will be a much smaller fraction of the overall time constant. It's worth noting, B-E avalanche will screw things up if the op-amp output goes more than +/-7V from the limit voltage, which is dubious for +/-15V applications, but *might* be acceptable on a +12/0V system.So to reiterate, my "holy grail" here would be a circuit that does this (the voltage controlled, low offset, precision limit), with the buffered output (equivalent to an op-amp output), indicator output (optional but desirable), and with high (open loop, DC) gain and uncommitted differential inputs (equivalent to an op-amp input) for the signal input, without incurring more than transistors and jellybean op-amps in construction, and minimizing or eliminating slewing or windup type recovery effects.Tim

author: nickm
author_rank: Regular Contributor
timestamp: May 11, 2014, 05:18:31 am
content: If you want programmable clip settings and more accurate references I would put a jfet across the feedback cap which can short it out when clipping is detected. Then use a window comparator to detect the clipping which would turn on the jfet. The references on the window would be easy to control and be accurate.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 11, 2014, 05:55:26 am
content: Tim,It was very interesting to see your transistor schematic. I have attached a pdf which shows how you can get from the transistor schematic that I posted to your circuit.It turns out the circuits are quite similar.I have also attached a zip file with the LTspice model. With this LTspice model you can see the effect of the modifications.Interesting project.Regards,Jay_Diddy_B

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 11, 2014, 02:19:27 pm
content: Quote from: nickm on May 11, 2014, 05:18:31 amThis would chatter incessantly, popping to zero each time it hits a limit! Yuck!This is a perfect example of the subtlety of analog design. Very often people think in terms of "if, then", and propose some digital (or high gain analog) approach with no knowledge or understanding of the impact of that gain, or the inevitable phase shift. Around an op-amp, these are factors which are in very short supply, as the op-amp has a limited phase margin (in and of itself, it is an excellent integrator, nevermind any external compensation networks used), and it takes very little gain in the feedback path to destroy that margin.Now, as a tech, or engineer, or just an amateur, this is easy for you: you stick it on the breadboard, see that it doesn't work, and either address the parts that don't work (can you stabilize the comparator so it doesn't oscillate?) or move on to something different which does work. And then you're done, it works, cool. What's hard is... when a manager has some silly pet idea like this, that they want implemented, and trying to explain, in as simple terms as possible (which is hard since that rules out root locus, and stability criterion, and information theory, and...), time and time again until, after months of prodding, they finally drop it!Tim

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 11, 2014, 05:29:14 pm
content: Hi,I have another idea which illustrate some of the subtle points Tim talks about.A 100 kHz sine wave is used as the test signal in all these tests.Start with a simple circuit:This has the desired output:But it is impractical, you cannot buy the ideal diodes used in the model.The next move might be to try and idealize a diode by applying feedback with an op-amp:The results from this circuit illustrate one of the problems, the feedback loop around the op-amps is broken during part of the cycle causing the op-amp output to go to the positive rail. It then takes time for the output to slew back to the operating.This is actually a mistake.By modifying the circuit to this:You get the following desirable result:This works well for two reasons1) The feedback loops around the op-amps is never broken, so there are no artifacts from having to slew or recover from an over -drive situation.2) The diodes are all conducting the same current, 1mA, when they are active. This makes matching of the forward drops possible.The current sources can be implemented like this:The results from this implementation are:Although these current sources are not perfect, the key is they are matched.One last refinement is to add an output buffer.The buffer is need to prevent output current causing an imbalance in the diode currents:The result of this circuit is:If you need to know when the circuit is clipping add a fast comparator to compare the clamp input and output.I have attached a zip file containing the LTspice model.Regards,Jay_Diddy_B

author: G0HZU
author_rank: Super Contributor
timestamp: May 11, 2014, 09:19:54 pm
content: Sorry to be so negative on this but I still think it's worth taking a step back and trying to lessen the problem by changing the system slightly if that is allowable.If (at my place of work) I proposed a similar system that had an op amp with a +/-15V power rail interfacing its output to a stage that must stay inside a 0-5V range then I'd have a lot of trouble getting this past a preliminary design review even before anyone considered reviewing any of the addon 'limiter' solutions.This odd interface requirement would either get killed at the design document review stage, or the preliminary system design review and I seriously doubt it would survive to a critical design review.So although it's kind of interesting to think up clever 'sticking plaster' solutions to this issue using limiter circuits I think the real answer may lie in a rethink elsewhere in the overall system.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 11, 2014, 09:34:56 pm
content: An example from some of my present work is this: +12/-5V rails are used so that accurate output voltages can be provided over a 0-5 or 0-10V range, with a 10 or 20mA load requirement on those lines. You can use R2R amps for this, but then the 0 and 5 (or 10) ends will be load dependent. That's too complicated to write out in the user manual and expect the end user to understand (say, connecting it to some shitty PLCs and other industrial sorts of peripherals that may draw current from the signal line), so extended rails are required.Of course, an output buffer isn't an error amplifier. The signals are limited internally before then, so unless a feedback resistor manages to pop open, the outputs are fine. But the same principle applies to internal signals, where the limit must be calibrated and accurate (i.e., a diode drop won't suffice; balanced diode drops, or emitter follower offsets, are probably okay though). Probably, one signal will be external (a current limit, for example), the other internal (from an error amp -- limited at the amp itself if possible, to save on hardware, windup and so on). But other examples range from controllers to amplifiers (signal, audio, lab or otherwise) to analog computer sorts of things.Tim

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: May 11, 2014, 10:52:29 pm
content: Quote from: G0HZU on May 11, 2014, 09:19:54 pmThis is an approach that is much more likely to survive the design review process. I have used this technique many times for protecting ADC inputs from over-range inputs. It certainly works and it is robust.The clipping level is set by the rail to rail op-amp.Here is the circuit working at 10 kHz. The circuit does introduce artifacts in the waveform from over-drive conditions. If the over drive conditions only exist during fault conditions this techniques is probably o.k.The circuit required to produce high-speed clipping without introducing artifacts are of interest (to me) from analog design perspective. Accurate clipping circuits can be used in waveform generation circuits.Regards,Jay_Diddy_B

author: T3sl4co1l
author_rank: Super Contributor
timestamp: May 25, 2014, 12:24:53 am
content: Another idea,Universal inputs, but up to four transistors now, and R1-R2 have to be matched pairs. The dividers can be removed if a negative current sink is available, or if the full range on the Max input is not required (with no dividers, Max has a "min" of about 2*Vbe, where the current sink saturates and the feedback stays off, so you can't get "max" action below that). Does not include the positive supply; add another resistor from each diff base to GND to extend operation to both supplies.Sharpness should be on the order of 50mV. For better precision, it should work with a current mirror diff load, and a matched pair (to get Vos ~ mV). Voltage gain will be very high, so compensation will be important to get right.It could be done with a single transistor too (instead of the diff pair and CCS), but you'd have to get compensation feedback into an emitter, which isn't going to work very well. Not that you'd care about performance with a whole Vbe offset in the first place.Tim

author: G0HZU
author_rank: Super Contributor
timestamp: May 25, 2014, 12:07:06 pm
content: QuoteYes, if it's allowed then a simple resistive attenuator would make more sense. I'd probably choose lower value resistors than 30k and 10k if high speed operation is required but I don't know what all the spec requirements are

author: Chris Jones
author_rank: Regular Contributor
timestamp: August 15, 2015, 12:50:14 pm
content: At the risk of disturbing a stale thread, is this what was wanted?http://www.analog.com/media/en/technical-documentation/data-sheets/AD8036_8037.pdf

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 15, 2015, 01:02:56 pm
content: Quote from: Chris Jones on August 15, 2015, 12:50:14 pmAh yes, that was the one -- I've ran across it before, thanks for adding it.Cons:- Low supply voltage (won't interface, at least easily, with 0/12V or +/-15V systems)- Way more bandwidth than needed (VFB at 240MHz+ is starting to get squirrelly, and will only be burned off in actual application)- Poor stock- Almost $12 each in singles.http://www.digikey.com/product-detail/en/AD8036AR/AD8036AR-ND/611444Even if it takes me $0.10 to hand-place the transistors and resistors, the above circuit comes out cheaper (though not really smaller unless using 0402s, which I wouldn't for most purposes).So yeah, I'd love to have exactly the functionality of that part, with performance, cost and availability being comparable to TL071, TLV2371, OPA171, or etc. Even if the cost were several times more, I'd be fine with that ($3 starts to look annoying but tolerable; a $6 LT/ADI part is on the prohibitive side).So, yeah. That's the right idea, but all things considered, it's just not good enough (ortoo good).Tim

author: Chris Jones
author_rank: Regular Contributor
timestamp: August 15, 2015, 01:49:30 pm
content: Quote from: T3sl4co1l on August 15, 2015, 01:02:56 pmMaybe someone should start a chip company that is more open to requests and petitions for parts. I think the existing ones only know how to sell (or even approve the development of) the types of parts they already sell, and maybe next year a slightly better version of the same part, but nothing too different!Barrie Gilbert wrote a good piece about this in this book:https://books.google.com.au/books?id=SPwqg7qpFWUC&pg=PA296

author: dom0
author_rank: Super Contributor
timestamp: August 15, 2015, 06:05:38 pm
content: Quote from: T3sl4co1l on May 08, 2014, 11:40:56 pmTek SG505 schematic sheet 1, Q1410, Q1411 and associated bias circuit. Note connection to negative input of U1401 (whose output is limited).This is a brilliant circuit. It is simple and achieves it's goal with just a minuscule modification to a normal transistor/diode clamper: instead of returning the clamped current to ground, they are returned to the virtual ground of the op-to-be-limited. This way, the op will reduce it's output so as to nullify the added current.edit: Attached imagePage 59 in this PDF scan:http://exodus.poly.edu/~kurt/manuals/manuals/Tektronix/TEK%20SG%20505%20Instruction.pdf

author: TerminalJack505
author_rank: Super Contributor
timestamp: August 16, 2015, 03:49:17 am
content: Nice circuit, dom0!That should do for most of the situations where clipping is needed.The one drawback it seems to have--at least as compared to Jay_Diddy_B's post #47 circuit--is that it isn't particularly precise. So if you need precision clipping then Jay's circuit is better in that regard.Jay's circuit, however, will allow the "control" op amp to go into saturation--which is something the OP is wanting to avoid.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 16, 2015, 06:17:09 am
content: Ah, good ref.Yes, that has two drawbacks: the threshold isn't precise (two diode drops -- about 0.2-0.4V "slop") and the input-to-clamp has to be within the clamp band. Which it always will be, for an inverting stage (+in = GND), but not for general applications.The voltage range restriction could be lifted if there were such a thing as a universal current mirror (one which communicates the current flow from the clamping transistors' collectors, over to the input pin that might be at a very different voltage), but alas, that would be difficult. It would, of course, be easier to simply mirror each transistor to the opposite rail, then back, and then connect them in parallel; or mirror them just once and deal with the inversion (i.e., returning the clamp current to +in). But these are rather tedious, bordering on inelegant.When these aren't problems, it's a fine way to do it. I'm sure they didn't need anything like speed (a 5532 isn't very impressive), and if it's just to constrain the output within, say, a vertical deflection band (maybe +/-6 div normal, or +/-2 div for a BEAM FINDER kind of function), it will do just fine; the "slop" might rather be considered a feature, as it compresses the waveform as it hits the limits, rather than hard cutting it off.Tim

author: dom0
author_rank: Super Contributor
timestamp: August 16, 2015, 07:37:24 am
content: Yes, the somewhat "soft limiting" is good in their application ; it limits the output of an oscillator during amplitude settling without introducing too extreme distortion. For some other applications it should be good/precise enough, too (driving ADCs for example).If high precision and no saturation of the amp is required then I can only think of something like two fast comparators and a fast mux at the input of the amp.

author: Kalvin
author_rank: Super Contributor
timestamp: August 16, 2015, 09:38:06 am
content: How about using a unity gain, fast recovery RRIO op amp as a limiting buffer? Set the power supply to the limits. The output should swing within few tens millivolts from the power supply.

author: Kalvin
author_rank: Super Contributor
timestamp: August 16, 2015, 10:26:06 am
content: Or, use a fast recovery op amp driving a push-pull output creating unity gain buffer:https://upload.wikimedia.org/wikipedia/en/thumb/1/1e/Pushpull.PNG/330px-Pushpull.PNGUse MOSFETs instead of bipolar transistors. Set the MOSFET output stage voltages V+ and V- to the desired limits.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 16, 2015, 12:18:10 pm
content: Quote from: Kalvin on August 16, 2015, 09:38:06 amThis was presented earlier (see #50). It works if fixed limits are fine, but it's not practical to make it adjustable, and the inputs need to be within that band as well.Quote from: Kalvin on August 16, 2015, 10:26:06 amAh, but that's the trick, isn't it?If we always had "fast recovery" amps, like transconductance amps, we could just clamp the output directly -- this is what the AD8036 does internally. There's a transconductance gain stage, which provides a constant current output and extremely high voltage gain from the main input; precision clamps (wired in a similar manner) set the max and min ranges. The limits are freely adjustable, independent of both supply and input voltages, and recovery is rapid (with no overshoot or windup). Finally, a buffer follows the gain node, so the output has a low impedance and high current drive capability.If you use MOSFETs, you not only have the problem of windup (as the limiting follower clamps the output, the op-amp goes on to the rail, so it takes time for it to come back down, driving the gates hard to get there, too), but crossover distortion and biasing, too. If done as shown, with enhancement mode FETs, there's a huge (>2V?) deadband where the op-amp output has no effect on the output. Normally a class B or C bipolar output stage (e.g., LM324) will have a < 0.3V step at this point, but now you're talking huge slop, and no matter how fast your amp is, it will impact performance!And if you add the bias components, now you have the issue of bias current drawn from the clamp supplies, which will cause a nonzero error, due to current drawn from the buffers setting those voltages, as well as the Rds(on) limitation of the FETs. So they might not pull within mV anymore, and how much it's off by is dependent on supply voltages.On a more subtle note, there's also feed-through from the op-amp output, via G-S capacitance. So the class C biasing will "anticipate" the op-amp recovery before it finally happens, causing a pre-shoot effect.It's a good building block, but it needs quite a bit of elaboration to polish into a precision circuit. The foundation comes from RF mixer designs -- I suppose all of these do, ultimately: the basic idea is to use diodes and current steering, or saturated switches (usually FETs), to toggle an RF signal between "on" and "off" (two devices in series, single balanced mixer), or "plus" and "minus" (double balanced mixer, four devices in an H-bridge configuration). The overshoot and preshoot issues, in RF terms, manifest as excess reactance and poor LO/RF isolation.Tim

author: Kalvin
author_rank: Super Contributor
timestamp: August 16, 2015, 12:43:28 pm
content: Quote from: T3sl4co1l on August 16, 2015, 12:18:10 pmOops, I missed that one as I browsed through the messages. It was so close to the other messages with the simulation figures that I sort of skipped that by accident.The limits can be made adjustable if the positive and the negative power supply rails are driven by a dual op amp. And if the RRIO op amp input has a 10k - 100k series resistor, the RRIO op amp should be fine although the input level is outside the power supply. However, I haven't tested or simulated this so this is just an educated guess.Quote from: T3sl4co1l on August 16, 2015, 12:18:10 pmThis is very true. The idea of suggesting the MOSFETs instead of the bipolar transistors came from the fact that bipolar transistor saturation voltage is around 200mV and the base drive current (voltage) will leak to the output.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 16, 2015, 02:25:54 pm
content: Hi group,I think that you will find it hard to beat the performance of this circuit, proposed in reply 47 of this thread.The feedback loops around the op-amps remain closed at all times. This can be observed by looking at the differential voltage between the inverting and non-inverting inputs on the op-amps.The feedback loops only open if Vin is greater than the supply voltage to the op-amps.Because the loops remain closed, the circuit does not have to deal with wind-up or overdrive recovery.LT1224 op-amps will give even better high frequency performance.Regards,Jay_Diddy_B

author: Kalvin
author_rank: Super Contributor
timestamp: August 16, 2015, 04:14:14 pm
content: Here is something I got using a fast a RRIO op amp as a clamp. The clamping voltage is fully adjustable within the op amp power supply minimum and maximum limits. The performance is good up to 100kHz and beyond. At 1MHz the performance is still good, although the op amp's delay is more obvious. Pretty simple if it works outside LTSpice

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: August 16, 2015, 04:59:31 pm
content: Hi Kalvin and the group,That circuit can be simplified to:The diodes are not required.The results of simulation are:The key feature of the op-amp that makes this possible is the FAST OUTPUT RECOVERYThe main limitation is that circuit is restricted to the operating supply range of the op-amp:Jay_Diddy_B

author: Kalvin
author_rank: Super Contributor
timestamp: August 16, 2015, 05:16:50 pm
content: Hi Jay_Diddy_B,Thank you for taking some time duplicating my simulation.Diodes at the input: Originally I thought that it might be a good thing to pre-clamp the signal with the diodes so that the overloading input signal will not turn on the op amp's on-chip protection diodes. However, as you have observed, the diodes can be removed from the circuit.The RRIO op amp can be selected according to the needs of the application. The LTC6247 is usable if the desired clamped peak-to-peak amplitude is between 2.5V ... 5V. The lower limit of 2.5V might be a bit of gambling for fast signals. I haven't taken a look whether there are other similar RRIO op amps with the higher maximum power supply.Anyway, this was just a proof of concept of using a RRIO op amp with fast recovery as a signal clamp.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 16, 2015, 05:26:36 pm
content: Quote from: Kalvin on August 16, 2015, 12:43:28 pmOf course, it invites still more questions: what if it needs to work down to 0V (an LV op-amp might go down to 2.7V or 1.8V, but not zero)? Does the amp still need bypass caps, or what supply impedance does it require? How fast can this method be -- ultimately, what's PSRR like (it should be exactly 100% in saturation, but it might not be as good at inbetween levels, especially at high frequency)? Also, op-amps have bias circuitry and stuff inside, which might not appreciate relatively high dV/dt (if you're driving the max/min hard -- an unlikely scenario, but the circuit ought to be symmetrical -- think not so much of X limited by Y, but min(X, Y)).QuoteBipolar are actually quite a bit better than that -- you'll get ~200mV (and up) for Ic near ratings, but more typically 10-50mV for smaller currents (like 2N3904 at ~1mA). The residual is mainly due to built-in potential, a side effect of the collector being more lightly doped than the emitter (a situation which gives better hFE and voltage handing).You can't get something for nothing, of course, so operating a transistor in reverse will, yes, reverse that built-in potential, but other things cancel out the negative excess. That said, an inverted transistor (swapping C for E) typically has Vce(sat) in the single mV -- assuming you drive hFE low enough to compensate (e.g., the inverted hFE of a 2N3904 is < 5 or so).Way back, in the days before cheap CMOS, they would build precision DACs this way: when you need 12+ bits, you went to the trouble of using inverted BJTs, switching them with precision matched currents (a pull-up for the base and a pull-down for the emitter, to keep it in that near-zero-Vce(sat) region).Tim

author: Kleinstein
author_rank: Super Contributor
timestamp: August 16, 2015, 07:25:13 pm
content: The ICL7650 OP offers internal clamping - though only to fixed output values, but in a way that can prevent an interator to wind up. The trick is to provide an extra feedback path from the output to the neg. input, once the output reaches certain limits.Adjustung to different Levels is possible with a variable offset/amplification stage afterwords. Hower Bandwidth is limited to 2 MHz only.

author: Kalvin
author_rank: Super Contributor
timestamp: August 17, 2015, 09:33:53 am
content: I played a bit with the clamping stuff. Here I use op amps as ideal diodes and use them as voltage clamps. Jay_Diddy_B had similar idea in post #18 but I tweaked the circuit a bit. I selected the same op amps Jay_Diddy_B used in his simulation so the results are comparable. At 10khz sine signal the circuit behaves very nicely. At 100kHz the op amps' slew rate limit the performance but it is still quite good. The positive and the negative clamping voltages are freely adjustable.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 17, 2015, 10:33:07 am
content: If you need extremely sharp and accurate breakpoints, that's the way to do it!Tim