Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Creating an inverted signal of three volts from 30 volts..

Status
Not open for further replies.

si2030

Member
Hi there,

I have an adjustable input voltage that swings from 0 to 30 volts DC. It can be at any value between these points.

I am trying to construct a simple inverter attenuator circuit using an op - amp.

I have had some success but its only by trial and error and its been suggested in the literature that your standard inverting amplifier working to attenuate instead can be unstable.

I would have also liked to run the op-amp from 30v-0 rather than +15/-15. My only success (in LT Spice came via the "unstable" option where I had rf being 30k ohms and rIn being 3k giving an amplification of 0.1.

I did try (from try a circuit this site https://www.eng.yale.edu/ee-labs/morse/compo/sloa058.pdf however its designed for AC and not DC.

How can I get a signal out of an opamp where if Vin=30 Vout=0 and when Vin=0 Vout =~3v.?

Is it possible to use an opamp in this regard using just a single rail?


Using a very slow sine wave (to approximate slow adjustment of the input signal) the wave form I am attempting is:

View attachment 61912

But it has to work as a DC attenuator - not AC. So I cannot use a cap and create virtual ground.

Kind regards

Simon
 
Hi,

That is correct in that gains less than 1 could be unstable.
What you could do is attenuate first, then use the op amp second. It would take two more resistors and a little math.
A 10 to 1 resistive divider would work to attenuate, but you'd have to consider the input resistance of the following stage, which would effectively put 100k across the lower divider resistor if you use two 100k resistors for the op amp for a gain of -1. That means you need a slightly lower value upper divider resistor. You should be able to calculate the value right?
 
Last edited:
Hi MrAl, others,

Yes I didnt think of the obvious - that is just using a simple resistive divider to attenuate first.

I calculate the top resistor to be 90.9k.

I still have a problem though.. as can be seen from the sim and trace below:

View attachment 61913

The blue trace is the signal attenuated using the resistive divider. The red trace is the output from the op-amp. Yes its inverted however its swinging from 0 to negative 2.7volts.

Also I am using a -15volts as the negative input for the op-amp...

How do I move the output so it touches ground or 0 at its lowest point and..... is it possible to do this without resorting to a negative rail... rather use ground as the negative pin for the op-amp?

Cheers

Simon
 
Hi MrAl, others,

Yes I didnt think of the obvious - that is just using a simple resistive divider to attenuate first.

I calculate the top resistor to be 90.9k.

I still have a problem though.. as can be seen from the sim and trace below:

View attachment 61913

The blue trace is the signal attenuated using the resistive divider. The red trace is the output from the op-amp. Yes its inverted however its swinging from 0 to negative 2.7volts.

Also I am using a -15volts as the negative input for the op-amp...

How do I move the output so it touches ground or 0 at its lowest point and..... is it possible to do this without resorting to a negative rail... rather use ground as the negative pin for the op-amp?

Cheers

Simon
Stability is not a problem. There are many, many op amps that are unity gain stable.
If y0u can tolerate a few millivolts, or tens of millivolts, error when your output should be at zero, there are lots of unity-gain stable op amps whose output will get very close to the negative rail (ground, in your case).
 
Hi again,

Ron:
Yes they are compensated for unity gain, but the issue came up when we were discussing gains less that 1.

Simon:
If you calculate the upper resistor of your input divider it comes out to 81818.18 ohms, with an offset for the non inverting input. The offset gets you down to 0 and up to +3v instead of going negative.
The non inverting terminal also needs a resistor divider then, with lower resistor RL=10k and upper resistor:
RH=(Vcc-vp)*RL/vp=85909.09 ohms.
vp is the offset voltage and is calculated simultaneously with the input divider upper resistor: 1.563981 volts. And that's the voltage you'll get at the non inverting terminal with a supply voltage of Vcc=15 volts.

This assumes 100k resistors for the op amp, and 10k for the lower input resistor divider.
So you need to change the input divider upper resistor and add another voltage divider for the non inverting terminal. For this new divider the upper resistor is 85909.09 ohms and the lower resistor is 10k. If you change the supply voltage however you'll have to calculate a new value for the upper resistor using the above equation for RH.

Using the above suggestions you'll get the following results:
For 00v input, 3v output.
For 10v input, 2v output.
For 20v input, 1v output.
For 30v input, 0v output (or as low as the op amp can go).
 
Last edited:
Hi again,

Ron:
Yes they are compensated for unity gain, but the issue came up when we were discussing gains less that 1.
Unity gain compensation means the amplifier will be stable with a feedback factor of 1, as in a voltage follower. An inverting attenuator has a feedback factor of less than 1, so it will be stable if the op amp is unity gain stable.


In the original circuit in post #1, the voltage on the noninverting pin is 2.77V. It needs to be 2.73V to get the desired performance.
 
Ron is correct. Unity gain stable is defined for a non-inverting configuration when the output is connected directly to the negative input. That is the worst-case for stability of an op amp. An inverting amp approaches that condition as the feedback resistor gets smaller, but its non-inverting gain is always >1 (from the op amp's point of view it makes no difference which input has the signal as both are at AC ground) and it never achieves a configuration that is less stable then the unity-gain connection.
 
Hello again,


I cant help but agree that the small instability here would only amount to a small overshoot or undershoot, which is probably negligible for this app.

Thus, we might go back to the original circuit with the 100k input resistor and 10k feedback resistor, in which case we only need to bias the non inverting input terminal with a voltage of 2.72727273v, which means a voltage divider made up of a 45k resistor in series with a 10k resistor connected between +15v and ground.
We end up with the following input and output values:
0v in, 3v out
10v in, 2v out
20v in, 1v out
30v in, 0v out (or close to it)
 
Hello again,


I cant help but agree that the small instability here would only amount to a small overshoot or undershoot, which is probably negligible for this app.
It will have better phase margin than a voltage follower.:)
 
Hi,

But that theory is based on a perfect op amp, which isnt the end of it.
In the real life circuit there is probably some overshoot while with gains more than 1 it would be smoother. How much overshoot remains to be seen. Do a simulation and see what turns up. The transient analysis is the key here, not the overall frequency response.

There are still op amps that can only work at certain gains too.
 
Last edited:
The equivalent non-inverting gain (which is the gain of interest for stability considerations) is 1.1 for a 100k input resistor and a 10k feedback resistor. Thus the gain is slightly more than 1.
 
Hello Carl,

Well, there's no stability issue from the point of view of the non inverting terminal anyway because there's no change on that input, it's constant.
There's really two inputs and thus two different responses. If the non inverting terminal were to change, the output would have to not only do what it does when the inverting input changes, but it would also have to raise the voltage at the inverting terminal. When the inverting input changes, the output only has to adjust for the slight change in current but not for any major voltage difference. Thus, the response for an inverting input change can be different than for a non inverting input change. In other words, y=F(V1,V2) and the y response is different for V1 and V2.
Since we have a constant voltage on the non inverting terminal that should be ok, but if we did have change there too then yes the gain would be more than 1. For the non inverting input however, the gain is less than 1 and so the output only has to adjust with a small change rather than a large change, and small changes can slew faster than large changes, hence a small overshoot could occur. When the non inverting input causes the change, it takes longer to get back to steady state so it tends to look sort of like a form of compensation.

Some systems require adhering to a rule where the gain can not go above a maximum or else the system becomes unstable, but there are also systems where the gain can not go below a minimum either. I think this particular circuit will be ok though as everyone else does too.
We could always sim it and see what we get :)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top