datasheets.com EBN.com EDN.com EETimes.com Embedded.com PlanetAnalog.com TechOnline.com
Events
UBM Tech
UBM Tech

Design Article

#### Comment

wagnerlip

1/13/2013 7:01 PM EST

30 months late.

The configuration of using an operational amplifier ...

More...

anonymous user

6/8/2010 1:47 AM EDT

Hai,

More...

# Single IC forms precision triangular-wave generator

## 4/8/2010 10:00 AM EDT

The linearity of triangular waveforms makes the triangular-wave generator useful in sweep circuits and test equipment. For example, switched-mode power supplies and induction motor-control circuits often include a triangular-wave oscillator as part of their PWM (pulse-width-modulation) circuit.

The basic triangular-wave generator includes an integrator for generating the triangular-wave output and a comparator with external hysteresis, such as a Schmitt trigger, for setting the output amplitude (). You can implement these components with a Maxim MAX9000 IC, which includes a high-speed operational amplifier, a 185-nsec comparator, and a precision 1.23V bandgap reference.

 See all of EDN'sDesign Ideas

The integration of a constant current, which you obtain by applying constant voltage across a resistor, produces a linear ramp at the op amp’s output. This output feeds a Schmitt trigger whose output feeds back to the integrator resistor. Abrupt state changes in the Schmitt trigger’s output determine the peak voltages for the triangular-wave output. These changes in turn depend on the input threshold voltages you set for the Schmitt trigger.

Unfortunately for this circuit, the triangular-wave peaks must be symmetrical about the reference voltage you apply to the comparator’s inverting input. To generate a triangular wave from 0.5 to 4.5V, for example, you must provide a reference voltage of (0.5V+4.5V)/2=2.5V.

It would be preferable to set this voltage range independently of the standard bandgap-reference voltage available, 1.23V. You can achieve this flexibility by adding resistor R3 to the hysteresis network in a single-IC version of the circuit (). R3 lets you set the triangular-wave peaks independently of the reference voltage.

To build the Schmitt-trigger comparator, you first select R2. The comparator’s input-bias current at CIN+ is less than 80 nA. To minimize the error this current causes, the current through R2, [(VREF–VOUT)/R2], should be at least 8 µA. R2 requires two equations, corresponding to the two possible comparator-output states: R2=VREF/IR2, and R2=(VDD–VREF)/IR2.

Use the smaller of the two resulting resistor values. For example, if the supply voltage is 5V, the reference voltage is 1.23V, and the reference current is 8 µA, the two R2 values are 471.25 and 153.75 kΩ, so this circuit uses the standard value of 154 kΩ.

Next, select R1 and R3. During a rising ramp, the comparator output is logic low (VSS). Similarly, the comparator output is at logic high (VDD) during a falling ramp. Thus, the comparator must change state according to the required peak and valley points of the triangular wave.

Two simultaneous equations result when you apply nodal analysis at the noninverting input of the comparator and solve for these two thresholds:

and

In this example, the voltage range of the triangular wave is 0.5 to 4.5V. You therefore substitute a value for VIH of 4.5V, VIL of 0.5V, VDD of 5V, and VREF of 1.23V into the above equations to obtain a value of 124 kΩ for R1 and 66.5 kΩ for R3.

You can now design the integrator. Considering the comparator’s two possible output states, the magnitude of current flowing through R4 is: IR4=(VDD–VREF)/R4, or IR4=VREF/R4. The op amp’s maximum input-bias current is 2 nA. To minimize error, therefore, the current through R4 must always be greater than 0.2 µA. This constraint implies that R4’s value is less than 6.12 MΩ.

The triangular-waveform frequency is:

For this example, the frequency is 25 kHz, the output voltage is 4V p-p, or 0.5 to 4.5V for a triangular wave, and the reference voltage is 1.23V. Solving for the resulting time constant, R4C=9.27 µsec. Select a capacitance of 220 pF and a value of 42.2 kΩ for R4.

The resulting output should match the desired frequency, provided that the op amp is not slew-limited. Because the feedback capacitor charges or discharges with a constant current, the output signal’s maximum rate of change is:

To provide a margin against process variations, the op amp’s typical slew rate should be 40% higher than the maximum rate of change of the output signal—0.56V/µsec or greater in this case. The op amp’s slew rate is 0.85V/µsec, which is therefore adequate for this 25-kHz waveform ().

 Reference Terrell, David L, Op Amps: Design, Application and Troubleshooting, Butterworth-Heinemann, 1996.

dieherd

4/9/2010 3:07 PM EDT

I'm sorry, a constant voltage through a resistor across a capacitor does NOT create a linear ramp; Far from it. A constant CURRENT across a capacitor creates a linear ramp. It wouldn't affect a closed loop switching regulator all that much but it's still completely incorrect. I still remember the textbook I read at AGE 12 ! that showed the 5 time periods to a charged capacitor.I'm 52 now. The capacitor truly never achieves the same voltage as the supplied voltage its like 99.7 percent at time period 5. It's a logarithmic function. As the capacitor gets charged the voltage (therefore the current) across the resistor drops.
I do remember also that if the voltage across the resistor is very high (>10*) compared to the desired maximum charge voltage the graph will appear nearly linear although it still is not truly a linear ramp.
I'm a technician and technicians are here to remember what engineers forget.

Abduln

4/22/2010 7:52 PM EDT

Well written, useful, article.

One comment: R3 does not make Schmitt trigger trip points (VIH and VIL) independent of the reference voltage. Instead, R3 makes VIH and VIL configurable over a wider range for any specific reference voltage.

Not a huge deal, but confused me for some time.

Regards,
Abdul

Tim.Rushlow

6/2/2010 10:41 AM EDT

Good article. I've been using a very similar circuit for a few years to generate a bipolar 2MHz triangle with a DC offset.

While Mr. Lecher is correct in his statement that “a constant voltage through a resistor across a capacitor does not create a linear ramp”, he misinterprets the operation of the circuit. Op-amps react to the difference between the two inputs. In an op-amp circuit with feedback the op-amp reacts in a way to keep the two inputs at the same voltage.

In this circuit the op-amp works to keep its two input voltages equal by adjusting its output voltage to the level necessary to keep the current flowing into its inverting input, Ain-, flowing back out of the same pin through its feedback element, C. The non-inverting input to the op-amp, Ain+, is held at a constant voltage equal to the reference voltage, Vref. As long the op-amp is working normally we can say the inverting input, Ain-, is also equal to Vref. Therefore the current into the inverting pin is (Cout-Vref)/R4, which is a constant current. The op-amp adjusts its output to draw the same current through C. Because the current being drawn through C is constant, the voltage at the output of the op-amp is a linear ramp.

wagnerlip

1/13/2013 7:01 PM EST

30 months late.

The configuration of using an operational amplifier with a capacitor connected between the output and the inverting input, while the non-inverting input is tied to a solid reference intermediary voltage, and applying a FIXED voltage through a resistor to the inverting pin, causes a constant current charge in the capacitor. That is definite true statement and should have no discussion about it.

This is a common misinterpretation and confusion.

When you connect a resistor in series with a capacitor to a fixed voltage supply, the charging current is non linear, since the voltage in the capacitor increases, reducing remaining voltage over the resistor, so, reducing the current accordingly.

But, when using the op-amp in the middle, the other side of the capacitor is not connected to a fixed voltage, is connected to the output of the op-amp, and that is able to vary the voltage to the capacitor, keeping the voltage across the resistor fixed, thus, constant current on the capacitor. This happens since the op-amp try to equalize its inputs, will swing the output to make the inverting input with the same voltage as the non-inverting one.

Electronics is very interesting, only reading a lot for many years one could start to grasp the surface of such science.

Wagner Lipnharski
Orlando Florida.

anonymous user

6/8/2010 1:47 AM EDT

Hai,

I just want to ask you about your circuit.I construct your circuit and do the simulation by using proteus software. But,i did not get the triangular wave.I get the straight line. Why?. I hope you can give feedback to me.