# Triangle Wave Circuit

#### JasonL

Joined Jul 1, 2011
47
Hi All,

I need help understanding how to analyze this schematic that is attached or at least where to begin. I want to create a voltage controlled PWM circuit. I learned this can be done by inputing a dc voltage and a triangle wave into a comparator. The duty cycle is changed by varying the dc voltage.

I need help understanding the triangle wave generator. I understand how an integrator and a comparator works by themselves. I know integrating a square wave will give a triangle wave.

The feedback and no external input is making this circuit difficult for me to understand. Where and what are the initial conditions? When I look at the circuit on Spice, it looks like having the voltage at vref = 0.5vpp of the triangle wave is critical for the circuit to work. But I don't know how vref becomes 2.5V. I can simulate this on Spice fine and see it working, but I want a deeper understanding of this circuit and learn how to analyze it.

Any help is welcome! Thanks!

#### Attachments

• 77.8 KB Views: 33

#### Veracohr

Joined Jan 3, 2011
772
Vref won't become .5Vpp, you have to enforce that to get it to oscillate. Create a voltage divider from the 5V source and connect Vref to the midpoint.

R3 provides positive feedback for U1, forcing whatever the present conditions are (including initial conditions) to change and tend toward oscillation.

#### JasonL

Joined Jul 1, 2011
47
If your response is true, then it would make it easier to understand how to analyze the circuit, but I'm not quite convinced that's the case because the Spice simulation shows the circuit works without having to set vref to 0.5vpp with a voltage divider.

I attached the simulation.

#### Attachments

• 47.8 KB Views: 12

#### GopherT

Joined Nov 23, 2012
8,009
If your response is true, then it would make it easier to understand how to analyze the circuit, but I'm not quite convinced that's the case because the Spice simulation shows the circuit works without having to set vref to 0.5vpp with a voltage divider.

I attached the simulation.
Here is an explanation from a very old book. It looks at the integrator then the comparator with hysteresis. Check page numbers, pictures are out of order.

#### Attachments

• 407.7 KB Views: 38
• 431.9 KB Views: 38
• 367.2 KB Views: 38
• 333.7 KB Views: 37
Last edited:

#### JasonL

Joined Jul 1, 2011
47
Thanks Gopher! This is helpful. May I ask what book is this? I'm interested in knowing how the equations are derived, especially 6-10a and 6-10b.

#### GopherT

Joined Nov 23, 2012
8,009
Thanks Gopher! This is helpful. May I ask what book is this? I'm interested in knowing how the equations are derived, especially 6-10a and 6-10b.
This was From the second edition (1982) but I think they published seven or eight editions of it (1998?). Not sure if all of them have the same content over the years.

http://www.ebay.com/itm/Operational...1934775859?hash=item33ac57ee33:i:221934775859

http://www.ebay.com/itm/Operational...2072767833?hash=item2810561159:i:172072767833

#### Veracohr

Joined Jan 3, 2011
772
If your response is true, then it would make it easier to understand how to analyze the circuit, but I'm not quite convinced that's the case because the Spice simulation shows the circuit works without having to set vref to 0.5vpp with a voltage divider.

I attached the simulation.
You used the Universal Opamp model right? Replace that with a real opamp model and you may find the simulation results are different.

#### JasonL

Joined Jul 1, 2011
47
You used the Universal Opamp model right? Replace that with a real opamp model and you may find the simulation results are different.
You're right Veracohr. Thanks for catching this!

#### crutschow

Joined Mar 14, 2008
34,844
If your response is true, then it would make it easier to understand how to analyze the circuit, but I'm not quite convinced that's the case because the Spice simulation shows the circuit works without having to set vref to 0.5vpp with a voltage divider.

I attached the simulation.
That may work in the simulator, perhaps due to it being an ideal op amp model, but in real life you will need a source to establish Vref.
Try the simulation with a real op amp model and you'll likely see the problem.