Electronic – Generating a constant-amplitude triangle wave from a square wave

amplifieraudiocircuit analysisoperational-amplifier

I have designed a circuit that can generate sawtooth and arbitrary duty cycle pulse waves controlled by some variable DC current source \$I_0\$, giving a frequency proportional to this current.

The sawtooth is generated by charging a capacitor with \$I_0\$ and discharging it rapidly when it reaches some voltage \$V_0\$, controlled through a 555 timer.

I can then use that to generate a square wave by putting the sawtooth output through a comparator. The duty cycle can be adjusted by adjusting the reference voltage of the comparator. (I know this is not the most efficient way to generate pulse waves, but it's how I designed it to have frequency proportional to \$I_0\$ in the same way as the sawtooth.)

I now want to use this same circuit to generate a triangle wave with the same frequency as the other two oscillators. The obvious way to do that would be using an integrator on the square output, but that will give me an ever decreasing amplitude with frequency, and that's not something I want. I need amplitude independent of frequency.

If the text is too confusing, I can draw a schematic once I get home.

Best Answer

One solution is to turn the circuit around. Rather than generate a square wave and then try to convert it to a triangle wave, generate the triangle wave with an integrator and comparator. As you vary the integrator time constant, the square and triangle outputs track and both amplitudes are constant. The R and C for the integrator set the frequency, and adjusting the trip point for the comparator changes the symmetry of the square wave. The comparator hysteresis sets the amplitude of the triangle wave.

A quick search for 'triangle generator circuit' found this:

schematic diagram

(Image source: Bill Bowden)

For a given frequency, the slope of the ramp in a saw wave is 1/2 that of the slopes in a triangle wave. If you want all three waveforms available simultaneously and have them track with a single adjustment, there is no simple circuit.