0% found this document useful (0 votes)
356 views16 pages

Signal Generator Project Statement

The document describes building a function generator circuit using op-amps that can generate square, triangle, and sine waves. It involves simulating and building three stages - a square wave generator, integrator to create a triangle wave, and low-pass filter to generate a sine wave. Simulation and hardware experiments are used to analyze the frequency and amplitude characteristics of each stage and how decreasing resistance values lower the overall amplitude as predicted by Bode plots.

Uploaded by

Hussain Bin Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
356 views16 pages

Signal Generator Project Statement

The document describes building a function generator circuit using op-amps that can generate square, triangle, and sine waves. It involves simulating and building three stages - a square wave generator, integrator to create a triangle wave, and low-pass filter to generate a sine wave. Simulation and hardware experiments are used to analyze the frequency and amplitude characteristics of each stage and how decreasing resistance values lower the overall amplitude as predicted by Bode plots.

Uploaded by

Hussain Bin Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Building a Function Generator

Objectives
The objective is to build a function generator capable of generating square, triangle, and
sine waves. The frequency and amplitude of these waves will be controlled through
potentiometers. There will be some frequency analysis to aid in the understanding of Laplace
transforms, Bode plots, and Fourier series.

Simulation Part

Part One: Square Wave Generator


1. Simulate the unstable multivibrator shown in Figure 1. The voltage source in the diagram is a
voltage pulse needed to start the circuit oscillating. Note that when you actually build the circuit
in lab, noise in the circuit will be enough to start oscillations.

Figure 1: Unstable Multivibrator

1
2. The period of the output square wave can be calculated as:

where
β= R1/(R1 + R2).

Examine the frequency of the output voltage for the following component values:

Frequency
R3 C1 Frequency (Calculated)
(Simulated)
10K 1µF

9K 1µF

7K 1µF

10K 2µF

10K 3µF

Table 1: Frequency Comparisons for Varying Resistances and Capacitances

To measure the frequency of the output waveform, measure the time it takes for the square wave
to complete one full cycle, then take the reciprocal of this time.

Part Two: Integrator


1. Simulate the circuit shown in Figure 2.

Figure 2: Integrator

2. Find the transfer function by hand, i.e., Vout(s)/Vin(s). The input of the integrator is going to
be the output of the square-wave generator, either +15V or –15V, DC. For the sake of analysis,
2
we can say that vin(t) = –15u(t) or vin(t) = 15u(t), depending on if the square wave is at its
minimum or maximum value.

If we take the input as –15u(t), what will the output of the integrator be in both the frequency and
time domains (hint: the integral of a constant)? What will the output be in both the frequency
and time domains if the input is +15u(t)?

Vout(s)/Vin(s)

Vout(s) (vin(t) = –15u(t))

vout(t) (vin(t) = –15u(t))

Vout(s) (vin(t) = +15u(t))

vout(t) (vin(t) = +15u(t))

3. Sketch the asymptotic Bode plot of the transfer function of the integrator:

3. In the simulation, make a Bode plot of the transfer function by conducting an AC sweep on
the input voltage. In the simulation profile for AC Sweep, set the start frequency to 1Hz, the end
frequency to 100,000Hz, and the points per decade to 100.
3
How much does the gain (value plotted on the y-axis) change per decade (a factor of 10, e.g.,
between 100rad/s and 1000rad/s)?

dB/decade

Part Three: Low-Pass Filter


1. Simulate the circuit shown in Figure 3.

Figure 3: Low-Pass Filter

2. Find the transfer function by hand, i.e., Vout(s)/Vin(s).

Vout(s)/Vin(s)

3. Sketch the asymptotic Bode Plot of the transfer function of the low-pass filter:

4
4. The theory behind Fourier series is that any periodic function, f(t), with period T, can be
written as the sum of weighted sinusoids. The frequency of each sinusoid is a positive integer
multiple of ω0, the frequency in rad/s of f(t) (ω0=2π/T). Each sinusoid also has a coefficient
multiplying it, determining how strongly that sine (or cosine) wave contributes to the function
f(t). Derive the coefficients (a0, an, and bn) of the Fourier series representation of the following
signal:

Figure 4: Triangle-Wave Input (to the Low-Pass Filter)

5
Here is a hint to aid you in finding the coefficients: Is this function even or odd? For even
functions, the function is comprised entirely of cosine waves. For odd functions, the function is
comprised entirely of sine waves. Find ao, an and bn.

a0
an
bn

4. For M = 15V and T = 3ms, write down the first three terms in the Fourier series
expansion of the triangle wave shown in Figure 4.

5. Make a Bode plot of the transfer function by conducting an AC sweep on the input voltage. In
the simulation profile for AC Sweep, set the start frequency to 1Hz, the end frequency to
100,000Hz and the points per decade to 100.

At what frequency (rad/s) does the Bode plot drop by 3dB from its constant value? This
frequency is known as the “3dB point.” After the 3dB point, what is the rolloff (i.e., how much
does the gain decrease per decade, say from 10kHz to 100kHz)?

3dB point (rad/s)

Rolloff (dB/decade)

Part Four: Function Generator


1. Cascade the three previous op-amp circuits to simulate the circuit shown in Figure 5.

Figure 5: Function Generator

2. Plot the output of each op-amp (on the same plot). Change R3 to 7K and print the three
waveforms again (on another plot).

6
2. Using the results from the previous sections, explain in a paragraph or two how this function
generator works. Discuss how the triangle and sine waves are generated (sketching graphs of the
outputs may be useful). Be sure to mention the role of the integrator, as well as the low-pass
filter in relation to the Fourier series representation of the triangle wave.

Also comment on the following: Bode plots are useful in showing how the gain of a transfer
function changes with the frequency of the input. Using this knowledge, respond to the question
of why the amplitude of the triangle wave and the sine wave decrease in amplitude as R3 is
decreased from 10K to 7K (hint: look at the equation on the top of page 2, and also the bode
plots of each op-amp stage).

7
Hardware Part

Part One: Build the Function Generator


1. Using either three 741 op-amp chips (shown in Figure 6), or one 324 op-amp chip (shown in
Figure 7), wire the three stage op-amp circuit shown in Figure 8. The first op-amp stage
generates a square wave. The second op-amp stage integrates the square wave to produce a
triangle wave. The final op-amp stage is a low-pass filter, removing the higher frequency
components of the triangle wave so that it closely resembles a sine wave with the same
fundamental frequency. It is recommended to wire one stage at a time (starting with the square
wave) and ensure the proper functionality of that stage before wiring subsequent stages. The
output of each op-amp is sent to one of the switches on the 4-switch dual in-line package (DIP),
which selects the output function when one turns on the appropriate switch.

Figure 6: Pin Layout of the LM741 Op-Amp


VEE = –15V
VCC = 15V

Figure 7: Pin Layout of the LM324 Op-Amp


V+ = 15V
GND = –15V
8
Figure 8: Circuit Diagram of the Function Generator

Part Two: Analyzing the Function Generator

1. Connect an oscilloscope probe to the point labeled “Function Out” in Figure 8. Select the
output from the first op-amp (the square wave). You will now analyze the duty cycle of this
square wave. Make sure that R8, the amplitude knob, is adjusted such that there is no resistance
between the DIP-switch output and the oscilloscope probe (i.e. such that the amplitude of the
output is at a maximum). The potentiometer R7 does not need to be turned to a specific
resistance. The duty cycle of a square wave is defined as:
Duty Cycle = 100% × (amount of time waveform is positive during one period / duration of one period)

For example, if a square wave has a period of 200ms and is positive for 50ms during each period,
then the duty cycle is 25%. Record what happens to the duty cycle as you adjust VCC, the
positive voltage supply to the op-amp.

VEE VCC Time Positive per Period Period Duty Cycle

–15V 15V

–15V 10V

–15V 5V
Table 2: Effect of VCC on Duty Cycle

9
What happens to the positive voltage level of the square wave as VCC is decreased? What
happens to the negative voltage level?

What do you think would happen if VEE were changed from –15V to –10V? Record the duty
cycle and the negative voltage level of the square wave to see if you are correct.

VEE VCC Time Positive per Period Period Duty Cycle

–10V 15V

Table 3: Effect of VEE on Duty Cycle


2. Return VCC and VEE to their respective maximum absolute values. Select the triangle wave
output to be displayed on the oscilloscope. This waveform may not look quite like a triangle
wave at its peaks, so adjust VCC and VEE until it looks as close to a triangle wave as you can get
it. Change the switch to display the square wave and then the sine wave to convince yourself
that the function generator is working properly. Record the values of VCC and VEE that are
needed.
VCC

VEE

3. The potentiometer labeled R7 in Figure 8 controls the frequency of the square wave. Because
the triangle and sine waves will have the same frequency as the square wave, this potentiometer
is the frequency knob for the function generator. Fill in the following table for the maximum
and minimum values of the resistance of the potentiometer, R7, between pins 1 and 2.

Square Wave Triangle Wave Sine Wave

R7 = 0K 2K 0K 2K 0K 2K

Voltage (p-p)

Voltage (RMS)

Frequency
Table 4: Effect of R7 on Frequency and Output Voltage

It is studied before that the frequency of the generated square wave is governed by the following
equation:

10
where
β= R1/(R1 + R2).

As R7 increases in the above equation, what should happen to the frequency? Do your results in
the table above support your claim? Explain.

Part Three: Connecting the Function Generator to a Speaker


1. Using the maximum peak-to-peak voltage of the sine wave (from Table 2), design a voltage
divider to reduce this voltage to 10mV peak-to-peak. Label the resistor values you choose in the
figure below:

Figure 9: Voltage Divider to Reduce Function Generator Output to 2mV peak-to-peak

2. Connect the point labeled “Vout” in Figure 9 to one of the inputs of the stereo amplifier.
Attach a speaker to the corresponding output channel, and play all three generated waveforms
through the amplifier, varying the frequency (R7) and amplitude (R8) knobs to see how they
affect the output signal you hear.

11
Take Home Task

Using TL494 for the Generation of Different Duty Cycles at Different Frequencies

Figure below shows the circuit diagram for TLP494 for generation of different duty cycles at
different frequencies. The circuit has been taken from its datasheet which should be read to
understand the operation of the IC.

Consult the data sheet of TLP494 and design the circuit to generate 1 kHz, 4 kHz, 10 kHz and 20
kHz frequencies with 50% duty cycle. There are two variable resistances used in the circuit
shown in the figure, one is to adjust the frequency and other one is to adjust the duty cycle. The
required variation of duty cycle is from 5% to 95% with all the selected frequencies.

Tasks
1. Observe the saw tooth waveform on the scope, measure feed-back voltage and verify the
generation of duty cycle.

2. Observe the variation of frequency by changing the resistance in your oscillator circuit.

3. Observe the variation of duty cycle by varying feed-back voltage.

4. Explain how to adjust the frequency? How to calculate R and C for required frequency? Show
the waveforms observed for selected frequencies with selected value of R and C.

12
5. Observe the voltage across the oscillator capacitor and include the snapshot of waveform in your
lab report.

6. Show waveforms for 20%, 40%, 60%, 80% and 90% duty cycles at all selected frequencies.

7. What is the function of dead time pin? How we can adjust the dead time? What is the dead time
if that pin is grounded? Observe the dead time on the scope and include the snapshot in the lab
report.

8. What is the function of output control pin? Configure it for push pull operation and observe the
output waveforms then configure it for single ended operation and observe the output waveforms.
Include the results in your lab report.

9. We have used variable voltage at the feedback pin using the potential divider. Configure error
amplifiers to vary the duty cycle at the output terminals. Discuss all of your design in your lab
report.

10. Use TL494 as a square wave generator in the above mentioned signal generator.

13
Appendix A Fourier Analysis

14
15
16

You might also like