Skip to main content

Practical Integrator Circuit - A Triangle Waveform Generator

Below is a basic op amp configuration of converting a square wave input to triangular waveform.

Figure 1


The concept is pretty simple. The square wave input produces a current that is translated to a voltage ramp across the capacitor. The positive cycle of the input produces a negative ramp output, while the negative input produces a positive ramp. The ramp is governed by the following basic equation:

Equation 1

where Ic  is produced by the input voltage divided by Rin, since the same current flows in the resistor and in the capacitor. Note that the input has to be centered and symmetrical about the positive input terminal which is connected to ground, in order to produce a symmetrical output. But this basic configuration has some serious problems. Even if the output starts at zero, it will not be centered at zero, and will not stay at the same center or common mode value due to the inherent offsets of the amplifier.

Figure 2
A technique in order to hold the output at a fixed common mode is by using another integrator in the feedback. The role of the integrator in the feedback is to force the output to be centered at a voltage that is set by the positive input terminal of the second integrator, with an error that is only due to its input offset voltage . It follows that the second integrator's  output also forces the positive input terminal of the first integrator to be the center of the square wave input signal. The output common mode, or the center of the output is set by the voltage applied at the positive terminal of A2, which can be replaced by an adjustable voltage. The input square wave doesn't have to be centered at the common mode set by A2, since the feedback will correct itself to produce a symmetrical output around the applied common mode. In order to minimize the errors at the output, the amplifier needs to be low offset and low bias, because the bias and offsets of the op amp create an unintended current that charges the capacitor.Figure 2 is a circuit that exactly does that, using OP42 low bias and low offset amplifier.



Figure 3 Triangular Waveform Output

The circuit can be a little tricky though. The output of A2 will try to adjust in order to be the average of the input signal, the second amplifier circuit has to be slower than the first integrator in order to achieve closer to ideal triangle waveform. A sawtooth waveform will be produced instead if A2 circuit if not slow enough, although it can be useful as well in other applications. Being very slow on the other hand will take longer for the output to settle.

How do you choose the value of resistors and capacitors? The frequency and the level of the desired output would be a good place to start. We can calculate the amount of time needed for the output to reach the desired level or amplitude for each ramp using the formula we have above (Equation 1) for the change in capacitor voltage in time. For example as in the circuit above, desired amplitude is 200mV at 10 KHz. A 10 KHz signal has 50us half cycle. Picking a capacitor of 0.01uF, the amount current and resistor needed for a 0.4Vp (0.8 Vp-p) square wave signal will be:


The time we determined for the capacitor ramp sets the half cycle of the input signal we will be feeding into the input. The circuit in figure uses 0.8 Vp-p 10KHz input, and 10 kohm Rin. So each half-cycle creates 40uA current to produce a positive and negative ramp of 4 mV per micro second.  For each half period, there will be either a positive or negative ramp of 200mV. The output then is 200mVp-p at 10KHz, with a common mode set by the (+) input of A2. Setting the resistor to lower value will increase the current and thus the output amplitude. The circuit above uses a time constant for the second integrator of 500us (R2 x C2), five times larger the the time constant of the first integrator at 100us (R1 x C1).

If you liked this article, please recommend this to your friends who might be interested and click on the recommend button.


Comments

Popular posts from this blog

Arduino Transistor DC Motor Control

Arduino boards have PWM (Pulse Width Modulation) outputs that can be used to control like the speed of a DC motor. On a Pro Micro, those outputs are encircled white on the board. You can program it such that it outputs on a scale of 1-255, 1 being the slowest and 255 being the fastest. PWM gives out pulses whose width is varied (modulated) while the period is constant. The longer it is high, the higher power it delivers to the circuit. PWM can be used to drive a transistor (switch) which in turn drives the motor ON and OFF. The longer the switch is ON, the higher the power delivered to the motor, and thus faster. The circuit consists of a transistor Q1 (TIP31) NPN transistor, driven by the PWM from Arduino. The resistor is to limit the current to the base, but enough to operate the transistor in saturation when the input is high. The diode is to protect the motor from any back emf that might come from the motor when the current is cut off. The circuit is supplied by a 9V battery.

What Can You Do With Two Transistors (BJT)? Part 2 - Transistor Regulator

In the first installment of this series, we talked about what exciting things we can do with just two transistors, in particular BJT transistors. Some of us might probably think that we don't talk a lot about BJT transistors nowadays, not with the thrill, excitement, and trend brought about by high advancements in the technology in the Internet of Things, Machine Learning, Machine Intelligence, Advanced Algorithm, etc.. But we argue that these little circuits and components are constantly in the background of the advancements we see around us and we should not ignore them, as much we will not ignore what we currently enjoy and what the future holds for us. Let's continue to look at the Two-Transistor Series Regulator we talked about in Part 1 . The circuit below is a different version, now using the transistor to provide feedback from the output. This makes the output voltage higher. The output is still derived from the zener voltage. The output voltage is now a s

How Does The Howland Current Source Work?

Current source programs an output current as defined by the user, regardless of the load resistance. We know that when load resistance is larger, the voltage across it also increases. An ideal source would maintain a constant amount of current even if the load resistance changes, or in other words even if the output voltage changes. Such behavior describes a very good current source that has high output impedance. Remember, the output voltage changes, but very little or no change in output current. That means high output resistance or impedance. We use the term impedance when dealing with changes. Howland circuit in the figure is a classic current source circuit.   When R 1 is made equal to R 2 , R F equal to R 3,  the output current is given by V IN /R 1 where V IN is V 1 minus V 2 . A simple implementation is grounding V 2 and taking V 1 as the V IN . Figure 1 Basic Howland Current Source This circuit is such a clever manipulation of the op amp, such