Tuesday, February 3, 2015

Make Your Own Function Generator

We’re back to discuss another circuit. This week we will see an interesting circuit which most design engineers, test engineers, hobbyists, lab technicians and students can relate to. Yes, let’s build a simple function generator. It won’t be a very high-end design but easy enough to be constructed by you in the lab – real or virtual!
Function Generator Block Diagram
Function Generator Block Diagram
So what is the principle behind this function generator ? It is made up of various parts which are all op-amp circuits. The first part of the circuit is an astable multivibrator. This will generate a square wave which will oscillate between positive and negative saturation. This square wave is passed on to an integrator. The integral of a constant say ‘c’ will be c*t where ‘t’ is time across which the integration is taken place. This means that a positive constant will give a positive ramp and a negative constant will integrate to a negative ramp. Adding them together we get a triangular wave. We got our square wave and triangular wave – if only there were a way to obtain a sine wave too from this setup. Well there is. What will happen if you integrate the above triangular wave? A triangle wave consists of positive and negative going ramps. A ramp is a function that increases linearly with time. If you integrate a ramp, you get a function that increases as the square of time which has the shape of a parabola. So the integral of a triangle wave is a series of positive and negative going parabolic shapes. In other words, yes you guessed it right you will get a pretty accurate sine wave. Alternatively I can approach this mathematically. We have to integrate the ramp c*t – which would result in c*t2/2. As you can see integration reduces the amplitude of the result. This can be adjusted by inserting an amplifier at the end.
Let’s take a look at the circuit:
Function Generator Circuit
Function Generator Circuit
Starting from the left hand side, the first portion is an astable multivibrator, the output of which is a square wave. R0 is the feedback resistor and C0 is the timing capacitor. The frequency of this square wave can be varied by varying the RC values namely the R0 and C0 values. Note the initial value of capacitor C0. It is set to 1 V. In real life the oscillations will be started by the offset voltage inherent to op-amps which would charge the capacitor and in turn push the output to positive and negative saturation. But since we are using an ideal opamp this ‘irregularity’ is introduced by giving an initial voltage to the capacitor.
This square wave is applied to an integrator as shown which in turn converts the square wave to a triangle wave.
Further the triangular wave is integrated again through another integrator resulting in a sine wave. The output of this integrator is connected to an inverting amplifier with gain given by -R10/R9. Varying this gain you can control the amplitude of the sine wave.
Let’s see the output when you simulate the given circuit:
Function Generator Output
Function Generator Output
So without the help of any external input source using only the op-amp and the supply provided to it we have generated three standard waveforms. This is the principle of working of the basic function generator you find in your lab.

No comments:

Post a Comment