basic question about integrators in a loop (circle test)

Jul 19, 2025 Last reply: 11 months ago 43 Replies

Hi, I'm continuing my exploration of electrical analog computing. I built one analog computer and have also been studying schematics for some historical analog computers. An integrator is modeled with an inverting op amp with a feedback capacitor.



In the circle test, a simple loop is constructed modeling the differential equation y'' = -y. This is implemented with



Integrator A -> Integrator B -> inverter -> loop back to input of Integrator A.



In ideal integration, the function y — which is the output of Integrator B — would be a steady sinusoidal wave that does not increase or decrease in amplitude. However, in practice the wave will either grow or decay in amplitude, once the integrators are started. I've found that, with smaller capacity feedback capacitors, the wave tends to grow, and with larger ones, it tends to decay. One can see this as a growing or shrinking circle on an oscilloscope, by feeding the outputs from both integrators into an XY scope display.



Could somebody please explain why this happens? I'm not grasping the basic cause of this. I've been trying to read up about op amp (in)stability, like in amplifiers and voltage followers, but I'm not seeing if/how there is a connection between that and what is going on here.


Don't blame the poor opamps. They can't do y'' = -y perfectly. A little extra phase shift always sneaks in.

At the peak frequency, if the loop gain is 1.001, the oscillation will grow exponentially. If gain is 0.9999, it will decay exponentially.

A stable oscillator needs to be managed to keep amplitude constant. That requires a nonlinear limiter of some sort.

There was a big (and fairly silly) thread here about that, a couple months agot.

For which I was originally responsible for (before BS and Edward took it to a whole new level).

You need to managed the gain actively to compensate for the effect John mentioned. It might be instructive to look into the Wein Bridge oscillator's principle of operation and how they overcame this problem to stabilise the loop in the most simple and elegant way.

Cursitor Doom has delusions of competence.

There are a variety of ways of stabilising a Wein Bridge, and none of them are all that elegant. What the thread did manage to establish was that there were a couple of ways of getting the harmonic content of the nominally sinewave output close to 150dB below the fundamental nanovolts in a notionally 1V peak-to-peak signal.

John May was the most influential contributor, mostly because he has actually built examples of that kind of circuit. Edward Rawde was the most persistent.

An simple opamp double-integrator oscilllator can be made to run very close to 1.000 loop gain, so needs very little nonlinear gain tweaking to be amplitude stable. A Wein bridge needs much more tweaking hence inherits a lot of distortion from the gain control mechanism.

The thing that (d)evolved in that other thread became hilarious.

I'm still persisting but I don't currently have time to find out why a circuit which stabilizes and produces low distortion in LTSpice just hits the power rail when the same circuit is run in QSpice.

Or so John Larkin thinks. He won't be able to explain why he thinks that the Wein Bridge needs more tweaking, or a least not in terms that make much sense. The problem with both is passive component tolerances and drifts. Precision resistors are available with much tighter tolerances and lower drifts than capacitors, but either sort of oscillator always needs both.

John Larkin doesn't seem to have been able to follow the discussion, so

- to preserve his self-esteem - he decided it was hilarious.

[Snip!...]

Wien! The guy's name was Wien, Max Wien.

Let's stamp out this Wein misspelling.

Jeroen Belleman

Be careful what you wonder about in this forum, Edward. Our troll-in-chief Bill Sloman will use anything to inveigle you into yet another of his pointless pissing contests.

In ideal world your circuit is marginally stable, just at the border between dumping and infinitely growing ones. In real world, due to non-ideal nature of components and due to tolerances you get circuit that behaves slightly differently.

If you want useful result take circuit that is asymptotically stable (that is damping) and provide it with some excitation, you should see result close to theoretical one. Or, if you insist on sinusoidal test add nonlinear amplitude limiter (as other suggest).

Cursitor Doom doesn't know enough to see the point in many of our discussions. He's an anonymous troll, so having him complain that one of his critics - who actually posts under his real name - is a troll is a bit rich.

A non-linear amplitude limiter is a clipper, and that adds a predictable, if small harmonic components. The Wien Bridge (thanks to Jeroen Belleman) is usually built with a more subtle form of amplitude control which adds (or subtracts) a controllable amount of tolerably linear gain to the circuit.

The classic version relied on a temperature dependent resistor, whose resistance changed as it carried more current. It had to have enough thermal mass that the resistance didn't change much over a single sinusoidal cycle. Modern versions rectify or demodulate the signal to get an amplitude-dependent control signal that electronically controls the gain in a way that leads to a stable output amplitude.

I was recently talking to my design center kids about diferential equations and circuits. All three are CE/EE grads or students. I mentioned "initial conditions" and one of them recalled hearing the term. [1]

Your equation has an infinite number of solutions. One is Y=0, cold and dead. One is a 1-volt sine wave. Another is a megavolt sine wave. Which it does depends on the initial condition, what it's already doing when you walk into the room. It will keep doing that. You can Spice that.

In real life, there are no ideal integrators, so the loop has additional phase shifts so there are different solutions to the equation; specifically decaying or increasing sine waves.

To make a decent oscillator, you need an increasing amplitude circuit and some sort of active amplitude limiter. Opamp clipping is the cheapest limiter.

[1] Computer Engineering is a kinda oxymoron.

I’ll take Riesling over schnitzel or torte any day. ;)

Cheers

Phil Hobbs

BTW Jeroen, seems like you’ve been getting out of bed on the wrong side lately.

I got it drummed into my head during Pure Math 2, which was one of my second year undergraduate courses, It was entirely about integral and differential calculus, and remarkably tedious, but useful.

Since Spice is designed to evaluate the sort of differential equations which described electronic circuit, this is a remarkably obvious assertion.

The phase shifts control the frequency, not the amplitude, which is determined by component ratios which drift as the ambient temperature changes, or the components age.

But it introduces harmonics of the sine wave being clipped.

Why? Computers are engineered devices, and designing them is definitely a branch of engineering. It strikes me as a sub-branch of electrical engineering, or perhaps of just electronic engineering (which is itself a sub-branch of electrical engineering).

An oxymoron embodies a contradiction. "Military intelligence" is the classic example.

"According to the Oxford Learner's Dictionary, oxymoron is defined as “a phrase that combines two words that seem to be the opposite of each other.” The Cambridge Dictionary defines an oxymoron as “two words or phrases used together that have, or seem to have, opposite meanings.”

Could you clarify: where is the phase shift happening and why? Is it in the op amp, or the feedback capacitor, or...?

As mentioned, if I switch the integrator capacitor to a lower value — which in turn increases the frequency of the y'' = -y model — then the oscillation amplitude grows quickly. But at the higher values (and lower frequency), it dampens instead.

The point of the circle test (y'' = -y), from what I've read and been told, was to test how good an integrator was by seeing how fast it deviated from the ideal circle. Each integrator output could be used for X and Y, respectively, to generate the circle. But I haven't been able to find an explanation on how you make the integrator good/better. The schematics I look at for various electronic analog integrator — in historical analog computers — are all pretty much the same, except sometimes different models of op amps are used.

I accept that, to have the perfectly stable wave, you must have some kind of regulator. But it bothers me that, in my analog computer, the deviation is very rapid. When using the high value capacitor, it damps from IC to quarter wave in about four seconds. When using the low value capacitor, the wave stays reasonably stable for only about 50 milliseconds. I'm wondering how such dampening or growth is affecting the accuracy of models where there is a lot of rapid oscillation going on. E.g., spring-mass system like x'' = -(dx' + kx) / m. How do you know how much deviation is going on? Or how do you minimize the impact of it by building a better integrator?

On 7/21/25 15:11, Phil Hobbs wrote: > Jeroen Belleman snipped-for-privacy@nospam.please wrote: >> On 7/20/25 09:58, Cursitor Doom wrote: >>> On Sat, 19 Jul 2025 15:29:53 -0700, john larkin snipped-for-privacy@glen--canyon.com >>> wrote: >>>

You are right. I should work on contributing something useful, or keep quiet. Sorry.

Max Wien invented the bridge that bears his name 'just' to measure complex impedances. I believe it was Hewlett who first used it to make an oscillator.

As has been amply stated in this thread, sine wave oscillators need some mechanism to stabilize their amplitude, and that inevitably introduces some distortion. There's a trade-off to be made between the speed of the amplitude regulation and the distorion. We've had a near-endless discussion about that in this group last year, but as far as I recall, nobody actually built something to test the theory and everyone is tired of the subject.

Jeroen Belleman

I wouldn't worry too much. Stable oscillation is really an edge case. Your capacitors aren't likely to be better than +/- 5% or so, so inevitably you are going to see the amplitude shrink or grow pretty fast, a few percent per cycle.

I get the impression that you are mathematically inclined, and not acquainted with the variability of real-life electronics.

In practical applications of analog computing, the amplitude would probably grow or dampen *much* faster. As long as you aren't getting near the conditions where the rate of change due to component tolerances comes into play, your results should be near enough correct to be useful.

Are you familiar with Laplace transforms and root-locus analysis?

Jeroen Belleman

[...]

I always thought it meant a Stupid Cow.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required