# Discrete Linear Triangle Wave Generator - LTSpice vs Real World

Thread Starter

#### iimagine

Joined Dec 20, 2010
501
Nothing to do, testing out my various triangle generator designs
Real world non linearity ?!?!

***Edit: I forgot to buffer the output when probing

Last edited:
Thread Starter

#### iimagine

Joined Dec 20, 2010
501
This is more like it!

#### sparky 1

Joined Nov 3, 2018
653
The transistor circuit above is also quite good when compared to what some triangle function generators produce.
Below picture shows a typical two 741 op amp triangle wave it is for comparison it is only a simulation, and without buffer.
We observe the oscilloscope, the line not perfect. On a real scope there is more to improve on.
The measurement for voltage on the vertical axis gives 10.832/2=5.416 5.434-5.416=.018 so there is a 18mV offset
on the horizontal axis 14.502-13.934=0.568ms and the 2nd half (not shown in picture) also measures 15.070-14.502=0.568ms
the horizontal is relative, the vertical symmetry measured on the bench did ok, the line not the smoothest.

Last edited:
Thread Starter

#### iimagine

Joined Dec 20, 2010
501
Below picture shows a typical two 741 op amp triangle wave it is for comparison
Here is a discrete version of 2 opamps that I created but have not tested until now.

#### sparky 1

Joined Nov 3, 2018
653
It's a nice triangle it is not a ramp. Trying for symetrical this modification draws 2.3mA and duty cycle is 50.13 %
18nF gives 15.8 kHz 30uF gives 10Hz good enough for entry level audio. It differs from original iimagine discrete triangle
comparing measurements on rise time and fall time. The changes made where for modifying wave shape.
The buffer used was a 2N5484 jfet direct coupled. The source to Vcc and drain to 10K to ground, output taken from drain.

Last edited:

#### atferrari

Joined Jan 6, 2004
4,517
Are you confined to transistors?
Op amps perform quite well. Just two of them is enough.

/Edit to add

Edit/

Last edited:
Thread Starter

#### iimagine

Joined Dec 20, 2010
501
Are you confined to transistors?
Yes
I agree, using opamp is nice, clean and simple. I dont know if you've notice, post #4 is practically 2 discrete opamps
But...
I'm trying to think outside the box, design exercise if you will.
I'm interested in alternative to opamps

#### atferrari

Joined Jan 6, 2004
4,517
Yes
I agree, using opamp is nice, clean and simple. I dont know if you've notice, post #4 is practically 2 discrete opamps
But...
I'm trying to think outside the box, design exercise if you will.
I'm interested in alternative to opamps
The famous function generator, ICL8038, generated triangle waves using something like two constant current sources, one sourcing current 2i all the time and one sinking current i for half of the period. The resulting current to charge a capacitor.

I recall implementing that and worked quite well. Not sure about the switching quality when increasing the frequency.

Thread Starter

#### iimagine

Joined Dec 20, 2010
501
The famous function generator, ICL8038, generated triangle waves using something like two constant current sources, one sourcing current 2i all the time and one sinking current i for half of the period. The resulting current to charge a capacitor.
I have thought about it too, but then quickly abandoned it because, i hate wasting power.

#### atferrari

Joined Jan 6, 2004
4,517
Could you show some credible data to support this claim?

I have thought about it too, but then quickly abandoned it because, i hate wasting power.

Thread Starter

#### iimagine

Joined Dec 20, 2010
501
Could you show some credible data to support this claim?
one sourcing current 2i all the time
Sourcing 2x current all the time, is wasting power...

#### sparky 1

Joined Nov 3, 2018
653
The XR2206 has lower %THDistortion than the piecewise ICL8038 https://www.renesas.com/us/en/www/doc/datasheet/icl8038.pdf
which is 0.5%THD is easy to impliment. Output improvement has been done by careful filtering.
A website that list Function Generator chips overview category and history.
http://www.timstinchcombe.co.uk/index.php?pge=trisin

For Triangle and more the AD639. Function Generator manufacturers built commercial equipment. They were committed to their patents all different sorts. It was when RCA, Harris others dropped out. It was about that time I think that the race to supply computer boards and transnational growth
went to smaller surface mount for automation leaving factories where some very useful ICs were being made, mostly corporations needing inventory.
Modules of that type are harder to find on the search engine the results requires sifting many pages. The right keywords are necessary.
It uses cascaded differential amplifiers. In my modification of iimagine discrete triangle I did yesterday. I believe it would benefit from a sub-circuit replacing the RC section I raised uA level to facilitate a transition, could later reduce. An experimenter board can be purchased inexpensively from here.
http://wiki.openmusiclabs.com/wiki/SineCore

Last edited:

#### atferrari

Joined Jan 6, 2004
4,517
Sourcing 2x current all the time, is wasting power...
As much as using gasoline with a car to go somewhere.

Thread Starter

#### iimagine

Joined Dec 20, 2010
501
Back to the circuit in post #1
I'm confused. Linearity looks real good at extremely low frequency, below 100Hz. But started to distort and gets ugly beyond that. What in the world!?!

#### MrAl

Joined Jun 17, 2014
8,622
Slew rate or bandwidth?

Thread Starter

#### iimagine

Joined Dec 20, 2010
501
Slew rate or bandwidth?
Right on! Thanks.
Apparently, too much gain. Slew rate was fine.