Will this triangle generator work with an LM339 as an integrator?

Thread Starter

crutschow

Joined Mar 14, 2008
38,409
For high speed triangle-wave generation it would be convenient to use a comparator for both the comparator and the integrator in the common triangle-wave generator circuit, but there's obviously a stability concern about using a comparator as an integrator.
So -- can someone breadboard and test the circuit on the bench to see if it works as the LTspice sim below shows?
(I unfortunately no longer have a bench setup to do this.) :oops:

The sim works fine, but the LM339 model may be too ideal, so using the uncompensated comparator as an integrator may not show the oscillations that could occur in practice.
Appreciate if anyone could do that test (exact circuit values are not critical).


1770781529908.png
 
Last edited:

eetech00

Joined Jun 8, 2013
4,704
For high speed triangle-wave generation it would be convenient to use a comparator for both the comparator and the integrator in the common triangle-wave generator circuit, but there's obviously a stability concern about using a comparator as an integrator.
So -- can someone breadboard and test the circuit on the bench to see if it works as the LTspice sim below shows?
(I unfortunately no longer have a bench setup to do this.) :oops:

The sim works fine, but the LM339 model may be too ideal, so using the uncompensated comparator as an integrator may not show the oscillations that could occur in practice.
Appreciate if anyone could do that test (exact circuit values are not critical).


View attachment 363334
I can test it for you tomorrow. I'll use the exact components except for R6 (22K instead).
 

Thread Starter

crutschow

Joined Mar 14, 2008
38,409
I can test it for you tomorrow. I'll use the exact components except for R6 (22K instead).
Thanks.
I appreciate that. :)
I've had that circuit in my bag for some time, but never have determined if it will actually work.

P.S. I assume you will add a 100nF power decoupling capacitor at the IC I didn't show (?).
 

Ian0

Joined Aug 7, 2020
13,112
It ought to work: the integrator introduces a pole at zero, and the compensation capacitor in an op-amp does much the same thing.

I can just imagine that someone will one day look at the spec, and replace it by a more modern comparator with built-in hysteresis because it is better and then wonder why it doesn't work.

On a similar note, if you use a comparator with built-in hysteresis as an op-amp, will it turn into a Class-D amplifier?
 

eetech00

Joined Jun 8, 2013
4,704
The sim shows 20.7kHz.
The time for each side of the triangle wave is close to one R6C1 time-constant, which would give 23.8kHz.
So...my sim is almost exactly as you've calculated, but I had to do a few mods.
1. Changed R2 to 10k (sets hysteresis to 5.56%)
2. Changed C1 to 10nf.
3. added pull down cap, 0.01uf, from output pin of integrator to ground.
4. added small compensation network between input pins of integrator (10 ohm, 0.1uf).

Looks like about 20-25khz on the bench but have a lot of noise. Still testing.

Update:
Scope is showing a nice 27.6 Khz square wave, 48.6 Duty cycle, 8.7v Pk.
(this is with the mods mentioned above)
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,087
I've had that circuit in my bag for some time, but never have determined if it will actually work.
Yes, it actually works. The circuit has been around since the early 70's, and built by many (including me). Back in another life I maintained both vacuum tube and "transistorized" analog computers. This circuit was used to produce a triangle wave that drove a Tektronix 604 X-Y display for a visual tracking study.

I do wonder why you went with an open-collector comparator instead of a rail-to-rail opamp for the integrator. Integrator capacitor C1 might see an asymmetrical source impedance at the output of U4, and this should affect the waveform purity; the up slope should be slower than the down slope.

I suppose it doesn't matter if the required circuit slope is many times slower than the comparator slew rate required to close the loop, but still ...

ak
 
Last edited:

Thread Starter

crutschow

Joined Mar 14, 2008
38,409
I do wonder why you went with an open-collector comparator instead of a rail-to-rail opamp for the integrator.
So that you only have need one cheap IC instead of two, or a high-frequency op amp as the comparator, for a high-frequency triangle-wave generator.
Integrator capacitor C1 might see an asymmetrical source impedance at the output of U4, and this should affect the waveform purity; the up slope should be slower than the down slope.
Only if the capacitor charge current, as determined by the input R and feedback C, is larger than can be supplied by output pullup resistor.
 
Top