Rail-to-rail input and output (RRIO) op amps, both FET and BJT, have been around for a long time, but the possibilities they provide for versatile waveshape generation with simple circuits can still surprise. Figure 1 is an example, outputting a variety of precision waveshapes while using just one dual RRIO op amp as the only active device.
Figure 1. | Buffered triangles, sawtooth waves, and square waves from two op amps. |
Here’s how it works.
Amplifier A2 integrates the difference between A1’s rail-to-rail output and waveshape control R2 to produce triangle output TOUT. The time constant of the integration is set by R1C1 which combines with R2 to produce positive and negative ramp rates of:
and
As shown in Figure 2, a symmetrical triangular waveshape results if VR2 = VDD/2, a positive ramp sawtooth if VR2 < VDD/2, and a negative sawtooth if VR2 > VSS/2.
Figure 2. | TOUT waveshape versus R2 where a symmetrical triangular waveshape, a positive ramp sawtooth, and a negative ramp sawtooth can be realized. |
As will be noted later, square wave POUT’s duty factor is also controlled by R2.
The TOUT waveshape is symmetrical around VDD/2 and its peak-to-peak amplitude is set by R3 over a range extending from 0 (fully CCW) to VDD (fully CW) as shown in Figure 3.
Figure 3. | TOUT amplitude versus R3 where the TOUT waveshape’s peak-to-peak amplitude is set by R3 over a range from 0 to VDD. |
A1 acts as a comparator triggered by the difference between TOUT (as scaled by R3’s setting) and the VDD/2 reference voltage provided by R5/R6. Positive feedback looped through R4 makes A1 periodically flip-flop and reverse the direction of the TOUT triangle ramp. The ratio of R4 to R3 determines the peak excursions of TOUT required to make A2 switch states and thereby sets TOUT’s VP-P amplitude.
A1’s rectangular 0 V to VDD signal is provided as the POUT output, with a duty factor that goes from 0% to 100% as R2 is varied from 0 to VDD (fully CW).
Oscillation frequency is affected by all three pots, but TOUT waveshape, amplitude, and POUT duty factor are all mutually independent. Therefore, the quickest and easiest method of setting the various parameters (the method that results in the least “tail-chasing”), is to set R2 and R3 first to obtain the desired waveshape and amplitude, then adjust R1 to the desired frequency.
Depending somewhat on the choice of VDD, total current draw is ~2 mA exclusive of output loading. The maximum oscillation frequency using the TLV2372 is ca:10 kHz but faster amplifiers are available if more speed is needed, as are op amps capable of handling more voltage. And of course, a bipolar supply would accommodate bipolar outputs. Chef’s choice!