# Op amp question

Hello,

Does anyone know how this circuit work? I am having some dificulties understanding it. It looks like an integrator. The Vref is fixed at 2.5V and Vchange can be anything from 0-5V.

For example,

Case 1: When Vchange = 1.5V, what is Vout and how long does the op amp take to reach Vo.

Case 2: Now Vchange now goes from 1.5V to 2V. What is Vo and how long does the op amp take to reach Vo.

I am trying to use this as a timing circuit for a personal hobby project.

Thanks,

#### Attachments

• opamp.JPG
10.8 KB · Views: 552

negitron
Depends on the supply voltage. For any voltage at or below Vref, the output will be zero volts; for any input greater than Vref, the output will be approximately .3 V below the supply voltage. It's essentially a comparator.

This is appears to be an integrator so the output will be proportional to the integral of the input

$$V_{out} = K \cdot \int_0^T V_{in}(t) dt$$

Thank you Negitron. I was thinking that it may be a comparator or an integrator. But it appears to have both function. If I am not being incorrect, when Vrange is less that Vref, the output of the op amp will ramp down to zero (the comparator portion) from Vrange at a certain rate determined by the R1 and CI.

When Vrange > Vref, the output will ramp up to Vcc at a rate of R1, C1.

Thanks for helping me to clear this us. I think i got it now...

Depends on the supply voltage. For any voltage at or below Vref, the output will be zero volts; for any input greater than Vref, the output will be approximately .3 V below the supply voltage. It's essentially a comparator.

negitron
I'm not so sure it's an integrator; at least it's not like any integrator I'm familiar with. These usually have the non-inverting input tied to ground with the signal input on the inverting input. But this circuit has the inverting input tied to a reference voltage and the signal input on the inverting input with what appears at first glance to be a low-pass filter.

If I feel motivated later on, I'll try to SPICE this circuit for you, if you can supply the missing circuit values.

Thank you. You are right, it is not an integtator in the classical sense. The voltage across the capacitor cannot change instantaneously. So it must have a ramp time. However, it wouldnt matter if the input is a square wave or a flat line because of the voltage difference at the op amp input...I think you are right because the voltage diference would turn it into a comparator with its output slewing at a certain rate (caused by the cap).

Thanks for the SPICE offer, but I think I now know enough to crunch the numbers in excel.

I'm not so sure it's an integrator; at least it's not like any integrator I'm familiar with. These usually have the non-inverting input tied to ground with the signal input on the inverting input. But this circuit has the inverting input tied to a reference voltage and the signal input on the inverting input with what appears at first glance to be a low-pass filter.

If I feel motivated later on, I'll try to SPICE this circuit for you, if you can supply the missing circuit values.

uart
The output is :

$$v_o = v_i + \frac{1}{R_1 C_1} \int v_i \, dt$$

EDIT : Forgot to mention that this is the response due to $v_i$ but there is also a response due to $V_{ref}$, being that of a simple integrator also, giving the overall response of :

$$v_o = v_i + \frac{1}{R_1 C_1} \int (v_i - V_{ref}) \, dt$$

and for a fixed $V_{ref}$ the transfer function from $v_i$ to $v_o$ is :

$$H(s) = 1 + \frac{1}{R_1 C_1 s}$$

For the circuit as shown R2 and C2 have no effect on the transfer characteristics because they are in parallel and the input is voltage driven. If however the driving source has a series resistance of Rs and an open circuit voltage of $v_s[/tex] then the overall transfer function (from [itex]v_s$ to $v_o$ for a fixed $V_{ref}$) would become :

$$V_o(s) / V_s(s) = \frac{R_2}{R_2 + R_s} \cdot \frac{1 + R_1 C_1 s} {R_1 C_1 s (1 + R_p C_2 s)}$$

where $R_p = R_s R_2 / (R_s + R_2)$

Last edited:
I have attached a thumbnail of an amplifier and simulation essentially matching your circuit. Your circuit is a pure integrator.
2) I put your R2 in series with the V_range input to make the amplifier a balanced differential.
3) I had to put a 1 meg resistor in feedback to get initial condition of 2.5 volts out.
4) I used a 3-step 2.5V -> 1.5V- > 2.0V ->2.5V pulse
5) The integrator faithfully followed the input.
Bob S

#### Attachments

negitron
Feed it a square wave. A pure integrator should output a clean triangle wave, the latter being the integral of the former. I SPICEd the same circuit, using the values you just posted, but did not get that result. However, I can't figure out how to post the output (Orcad PSPICE 9.2) or the schematic.

uart
It (the original circuit) is definitely not just an integrator. It does integrate the difference between Vin and Vref but it also has a direct feed through term as well. It's precisely as I posted above :

$$v_o = v_i + \frac{1}{R_1 C_1} \int (v_i - V_{ref}) \, dt$$

BTW. Bob's circuit has and extra R4 C2 time constant that the original circuit didn't have, this may change things somewhat. Note that in the original circuit the R2 and C2 at the op-amp v+ input where in parallel with the input voltage and so have no effect. Spice wont like having a voltage source in parallel with a capacitor like that so you're best to just leave those components out of the simulation, or alternatively add just a very small series resistance to Vin to satisfy to convergence in spice.

Last edited:
uart
BTW. I've been taking the voltage named "V_range = {0 to 5V}" as the time varying input voltage in my analysis. I've only just noticed that the original poster also label that same point as VCC. If that's the same as the OP-AMP Vcc (which would be pretty silly) then I take back everything I said about this circuit. I think the OP should clarify this point.

Feed it a square wave. A pure integrator should output a clean triangle wave, the latter being the integral of the former. I SPICEd the same circuit, using the values you just posted, but did not get that result. However, I can't figure out how to post the output (Orcad PSPICE 9.2) or the schematic.
Err, no. The correct integrator output is a step function, with the length of the ramp in the front being the width of the square wave input. The final output voltage is the volt-sec of the square qave input divided by the RC time of the integrator.

It (the original circuit) is definitely not just an integrator. It does integrate the difference between Vin and Vref but it also has a direct feed through term as well. It's precisely as I posted above :

$$v_o = v_i + \frac{1}{R_1 C_1} \int (v_i - V_{ref}) \, dt$$

BTW. Bob's circuit has and extra R4 C2 time constant that the original circuit didn't have, this may change things somewhat. Note that in the original circuit the R2 and C2 at the op-amp v+ input where in parallel with the input voltage and so have no effect. Spice wont like having a voltage source in parallel with a capacitor like that so you're best to just leave those components out of the simulation, or alternatively add just a very small series resistance to Vin to satisfy to convergence in spice.
uart-

I believe your post #7 is completely correct as shown, including the need for the series resistance Rs. Now if you let R2 -> infinity in your last equation, you will have a perfect differential integrator. with a time constant RsC1 in the denominator. The output voltage will then be the input volt-seconds (relative to the input Vref) of the area, divided by RsC1. I believe the OP took an ideal differential integrator with Vref being ground, and with the input being what he calls V2.5volts.
At this point the OP should tell us what is the area he intends to integrate, in volt-seconds (relative to his Vref), so we can determine the RsC1 in your last equation in post #7. If the OP really intends to use the circuit he showed. I will re-run my SPICE analysis, after he assigns values to all components.
Bob S

negitron
Err, no. The correct integrator output is a step function, with the length of the ramp in the front being the width of the square wave input. The final output voltage is the volt-sec of the square qave input divided by the RC time of the integrator.

All of which means if you feed it a square wave, you'll get a triangle wave like I said, because a triangle wave is the integral of a square wave.

http://archive.chipcenter.com/eexpert/dashby/dashby014.html [Broken]

Basically what you are doing is putting the square wave into an integration circuit. And the integral of a square wave is a triangle wave.

It's nquick-and-dirty way to tell if your integrater is, well, integrating. Also, an easy source of triangle waves.

Last edited by a moderator:
All of which means if you feed it a square wave, you'll get a triangle wave like I said, because a triangle wave is the integral of a square wave.
http://archive.chipcenter.com/eexpert/dashby/dashby014.html [Broken]
It's nquick-and-dirty way to tell if your integrater is, well, integrating. Also, an easy source of triangle waves.
The integral of a bipolar square wave is a triangle wave. The integral of a unipolar square wave is a step function.

 The thumbnail shows the integration of a unipolar square pulse. The pulse is 0.5 volts high and 150 milliseconds wide, so the volt-sec is 0.075 volt sec. The integrator RC = 10k x 10 uF = 0.1 sec, so the integrator output should be, and is, 0.75 volts (+2.5 volts = 3.25 volts).

#### Attachments

Last edited by a moderator:
vk6kro
I built the original circuit and got the waveform as shown.

Using a LED as a stable voltage reference (at 1.9 volts) the circuit functions pretty much like a comparator but with a strange slope on the trailing edge when fed with a 250 Hz pulsed square wave signal.

#### Attachments

uart
Hi vk6kro. The LM234 will not operate properly when vin+ or vin- goes to close to Vcc, that's why you're not getting "integration" but instead getting "latch-up" when your input signal goes high.

Try running the input pulse somewhere about 0 ot 4 or 0 to 5 volts and you'll see it operates exactly as I have said. Being an integrator it will of course saturate in an open loop configuration without reset like that though.

BTW. If you set the period short enough so that it doesn't saturate in both half cycles then it should look much like the image in the attachment. Note that the upward integration slope is slightly larger than the downward integration slope so it will saturate near the Vcc rail at the end of each +ive half cycle as shown. Here I'm assuming (Vhigh - V_ref) > (V_ref - 0) to get the slope asymmetry, for example (4 - 1.9) > (1.9 - 0). I'm also assumming that the op-amp doesn't misbehave too badly when coming out of +ive saturation.

#### Attachments

Last edited:
vk6kro
Yes, that's exactly right.

If I juggle the input very carefully, I can get it symmetrical as in your drawing. See attachment.

Otherwise it either has a slope on the leading or trailing edge.

At no time does it go high and stay high like the simulation predicted.

From the poster's point of view, this is just a wave shaper and it will not generate time delays like he was hoping for.

#### Attachments

negitron
Which brings up a point: if the OP wants time delays, why not a delay line? Cheap, reliable and easy to implement.

vk6kro
Yes.

Also, if he wants longer ones, there are dedicated monostable chips (like the 74C221) or programmable ones like the Picaxes for delays from 1 mS to years.

vk6kro
Negitron, I should have asked what kind of delay lines you mean. Like in TV sets?

This circuit behaves just like a comparator if you just vary the DC input levels. You hardly notice the poor rise and fall times caused by the capacitor.

So, whether you call it a comparator or an integrator depends on the input frequency.
It is a little of both.

negitron