# Generating a constant-amplitude triangle wave from a square wave

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.

• There's a schematic in the ICL8038 datasheet mit.edu/~6.331/icl8038data.pdf which may help. – Indraneel Feb 9 '19 at 17:10
• What is the reference current Ii, personally I think it would be much easier to base your design on a 2 opamp audio VCO, which inheritly produces a triangle waveform. – sstobbe Feb 9 '19 at 18:38