Yet another triangle wave generator

Thread Starter

cmartinez

Joined Jan 17, 2007
7,826
I'm trying to build a triangle wave generator with the following characteristics:
  • Single 5V supply
  • Variable 120 Hz to 10 kHz output
  • Fixed 0 - 5V range output, or as close as possible
After some googling around (yes, I can google on my own), I found the following promising circuit:


I toyed with it for a while by tweaking the values of R5, R3 and R4, and while it does comply more or less with the frequency output that I want, its voltage output (minimum and maximum) never actually reaches zero, nor 5V. What's more, that range actually varies with frequency in both limits.

upload_2017-9-26_18-43-14.png

Is there a simple way to adjust this circuit for that purpose? Or would you recommend an entirely different approach?
 

Attachments

crutschow

Joined Mar 14, 2008
30,803
@crutschow, can you please link me to a place where I could download the LTspice model for OP747? I've been googling it with no success.
It's located in the library in the updated LTspice XVII which you can download from the Linear Technology website.
If not, just look for an LTspice op amp that has RR output such as an LT1498.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,826
Here's the circuit, adjusted with more commercially available values for the resistors, and using the LT1498, per your suggestion. The circuit does indeed deliver between 95 Hz and 4.5 kHz using a value of 5.1k and 100 ohms for R5, respectively, which makes it perfect for a 5k pot in series with a 100 ohm resistor.

Capture.PNG

One thing I noticed, is that the capacitor type used for C1 significantly affects the waveform's shape at its tips. I'm guessing it's because of its equivalent series resistance.

Using X7R for C1:

X7R.PNG



Using electrolytic:

Electrolytic.PNG



Using tantalum:

Tantalum.PNG
 

Attachments

Thread Starter

cmartinez

Joined Jan 17, 2007
7,826
Another thing is that when I used the LT1498 model, the waveform's range was between 0.5 and 4.4V, even when using the exact values for the resistors that you specified.
 

crutschow

Joined Mar 14, 2008
30,803
One thing I noticed, is that the capacitor type used for C1 significantly affects the waveform's shape at its tips. I'm guessing it's because of its equivalent series resistance.
No.
You can't used polarized capacitors, such as aluminum/tantalum electrolytics for C1 (tantalums are electrolytic).
Another thing is that when I used the LT1498 model, the waveform's range was between 0.5 and 4.4V, even when using the exact values for the resistors that you specified.
Try changing R3 to 98KΩ
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,826
98K for R3 distorted the waveform horribly at its top.

98k for R3.PNG



But 96.5K worked significantly better.

96.5k for R3.PNG



Perhaps I should use a trimpot for R3?

It's too bad that the OP747 is only available in SMT ...
 

RichardO

Joined May 4, 2013
2,271
Perhaps I should use a trimpot for R3?
No, value of R3 is not causing your distortion. If the value is wrong the triange amplitude will not be 5 volts peak to peak. Adjusting R3 using a trim pot _will_ let you set the triangle amplitude to be close to 5v p-p without any clipping.

Your problem is the value of R5. It is overloading the "comparator" output. Increase its value to more like 10K (minimum) and decrease the timing cap to more like 0.01uF. This requires that your frequency adjust pot must now be 1 Meg ohm.

The op-amp being used as a comparator may not work well at 10KHz. Either use a _really_ fast op-amp or a real voltage comparator.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,826
Ok, here's my latest take. It uses parts that I have readily available, and complies with the minimum resistor values that you've been suggesting.

  • Highest freq = 3.7 KHz (exactly what I want)
  • Lowest = 165 Hz (almost 120 Hz, but it's acceptable)
  • output range at highest freq = 0.085 to 4.9V
  • output range at lowest freq = 0.220 to 4.8V

upload_2017-9-27_18-20-32.png

I'd really like to see this circuit simmed with the OP747 that you initially suggested, curtschow.
 

crutschow

Joined Mar 14, 2008
30,803
I tried it with the OP747 but it poops out (technical term) at the high frequency.
Why did you like that op amp?

If you remove R7 you can get to below 100Hz.
 
Top