504 MP Final Report Draft5
504 MP Final Report Draft5
ABSTRACT
Page 2 of 35
Table of Contents
ABSTRACT ...................................................................................................................................................... 2
Table of Contents .......................................................................................................................................... 3
OBJECTIVES AND PURPOSE ........................................................................................................................... 4
INTRODUCTION ............................................................................................................................................. 5
THEORY ......................................................................................................................................................... 6
The comparator ........................................................................................................................................ 6
The histerisis bistable ................................................................................................................................ 7
The inverting integrator ............................................................................................................................ 9
Inverting integrator and bistable combined ........................................................................................... 11
Derivation of the equation of frequency ................................................................................................ 13
DESIGN ANALYSIS ........................................................................................................................................ 15
Input voltage control .............................................................................................................................. 16
Selecting the Op-Amps............................................................................................................................ 23
Amplitude Control................................................................................................................................... 24
Frequency Range Select .......................................................................................................................... 24
EXPERIMENTAL PROCEDURE ...................................................................................................................... 27
Testing the integrator-bistable-attenuator configuration ...................................................................... 27
Testing the switch with the voltage control circuit ................................................................................ 27
Testing the final design ........................................................................................................................... 28
RESULTS and OBSERVATIONS ..................................................................................................................... 29
CONCLUSION AND RECOMMENDATIONS................................................................................................... 33
REFERENCES ................................................................................................................................................ 34
APPENDIX .................................................................................................................................................... 34
Page 3 of 35
OBJECTIVES AND PURPOSE
The main challenge of the study was to design a circuit that would produce
the triangular and square waveforms without any input signal. The purpose
of such an electronic device is to provide variable frequency for control and
measurement. In many applications the frequency is required to be linearly
dependant on the control voltage with a constant of proportionality K [1].
Page 4 of 35
INTRODUCTION
Page 5 of 35
THEORY
The comparator
To understand the hysteresis bistable consider the simple
comparator shown in Figure 1. The principle of its operation in is
straightforward: in the case of Figure 1. when the input voltage is
greater than zero (i.e. greater than the voltage applied at the
negative terminal) the output of the comparator will saturate at the
L+, positive power supply level. It will remain saturated until the
Input voltage goes below zero, the comparator then will saturate at
the negative power supply value, L- [2]. In this example the
threshold or the critical point for state change of the comparator is
the zero volts. Also notice that that as the input goes above zero the
comparator saturates at L+ level, and as the input goes below zero
the comparator saturates at L- level. The circuit with this behavior is
known as the non-inverting comparator.
Page 6 of 35
Figure 2. An inverting comparator with zero volts threshold point.
Here the threshold or the critical point is also zero volts (the
grounded positive terminal). The difference is that as the input
reaches a value greater than zero the difference between the two
terminals becomes negative, amplifying this negative value the Op-
Amp saturates at the negative power supply level, L-. Similarly,
when the input reaches a negative value the output saturates at the
positive power supply level, L+. The circuit with this behavior is
knows as an inverting comparator.
Figure 3. An inverting bistable with threshold levels controlled by the values of R1 and R2.
Page 7 of 35
state change then, the threshold point is now the voltage at the V+
node which can be determined using the voltage divider rule.
𝑅1
[𝑉 +] = 𝑉𝑜𝐵 ∗ (𝑒𝑞 1)
𝑅1 + 𝑅2
𝑅1
[𝑉 +] = [𝐿 −] ∗ (𝑒𝑞 2)
𝑅1 + 𝑅2
Now the fact that the Op-Amp is at the negative saturation state
tells us that [Vin] > [V+] and the state will switch to the positive
state as soon as Vin becomes less than V+. Thus the threshold
voltage is not zero anymore as was the case for a simple
comparator but is at a point controlled by the two resistors in the
input and in the positive feedback loop [2]. To determine the
threshold point that [Vin] must reach for the Op-Amp to switch to
the positive state we substitute [Vtl](V Threshold Low) for [V+].
Thus, for the circuit to switch state to L+, [Vin] must reach the
point:
𝑅1
[𝑉𝑡𝑙 ] = [𝐿 −] ∗ (𝑒𝑞 3)
𝑅1 + 𝑅2
In a similar manner, the threshold high point can be found, i.e. the
point when the bistable switches to its negative state. Since the
Bistable is an inverting one, this point will have a positive value.
𝑅1
[𝑉𝑡ℎ ] = [𝐿 +] ∗ (𝑒𝑞4)
𝑅1 + 𝑅2
Page 8 of 35
Figure 4. The transfer characteristic of the inverting bistable
When Vin>Vtl, i.e Vin starts from the positive side the state is at L-.
As soon as Vin reaches the negative threshold-low value the state
switches to L+. Similarly, when the input starts at some negative
point the output is saturated at L+ and as soon as the threshold-
high value is reached by the input the state changes to L-.
It is clear from the presented theory that the Bistable configuration
is capable of generating a square waveform. What is needed in
conjunction with the Bistable is an external event that would trigger
the state of the Bistable.
Figure 5. A typical integrator shows the current that charges the capacitor.
Page 9 of 35
The analysis of this circuit for a pulse input can be broken down into
two cases
1. Vin > 0
2. Vin < 0
In the first case Vin > 0 and a node equation at node Vx gives
𝑉𝑖𝑛 – 𝑉𝑥 𝑑𝑉𝑐
= 𝐶∗ (𝑒𝑞5)
𝑅 𝑑𝑡
𝑉𝑖𝑛 𝑑𝑉𝑐
= 𝐶∗ (𝑒𝑞 6)
𝑅 𝑑𝑡
𝑡
𝑉𝑖𝑛 𝑉𝑖𝑛
𝑉0 = � − 𝑑𝑡 = − ∗ 𝑡 + 𝑉𝑐 (0) (𝑒𝑞 7)
0 𝑅𝐶 𝑅𝐶
Now, as the circuit is just powered up, the capacitor initial voltage
will be zero, therefore the final result is:
𝑉𝑖𝑛
𝑉0 = − ∗𝑡 (𝑒𝑞 8)
𝑅𝐶
Page 10 of 35
for the negative side of the pulse. The second observation is that the
slope of this line is 𝑉𝑖𝑛 ⁄𝑅𝐶
For the second case, when 𝑉𝑖𝑛 < 0 the result is identical except now
the slope of the integrator output is positive (𝑉𝑖𝑛 < 0 therefore
−𝑉𝑖𝑛 > 0). The input and output relationship plot of the integrator is
shown in Figure 6.
Figure 7. Integrator with a non-inverting Bistable. Draft design demonstration and frequency equation derivation.
Page 11 of 35
system to be stable. This diagram is the first step towards the final
design and this circuit can be used to verify theoretical results. In
this configuration the output at 𝑉𝑜𝑢𝑡 is a triangular wave with
amplitude V[threshold high] and V[threshold low] and the output
taken at the VoB node is a square wave with amplitude L+ and L-.
The functionality of this circuit is completely based on the discussion
of the operation of the Bistable circuit and of the integrator. Recall
that the Bistable changes its state when the input reaches particular
values [V threshold high] and [V threshold low]. A non-inverting
Bistable switches to saturation at L+ when the input reaches the
high threshold point and it switches its state to L- when the input
reaches the low threshold point. To analyze the circuit in Figure 7
suppose the power supply was just turned on and thus the bistable
was in one of its states, say [L+]. Now [L+] is also the input to the
integrator, therefore the integrator will start producing a straight
line with a negative slope of [-L+/RC]. Keep in mind that the
integrator output is connected directly to the input of the Bistable.
Thus, as the integrator output decreases linearly (negative slope)
this output is being fed directly into the bistable. At some point the
integrator output will reach the threshold low value of the Bistable.
This will force the Bistable to switch its state to L-, which in turn will
be fed back to the integrator. This new input will force the integrator
to switch the slope of its output from negative to positive and thus
the integrator output will now be an increasing line with positive
slope [-L-/RC]. This will continue until the integrator output (which
is the input of the Bistable) reaches the threshold high value of the
Bistable and the cycle will repeat again indefinitely. Figure 8 is a
visual aid for the above explanation.
Figure 8. The output of the Integrator-Bistable feedback loop showing the threshold voltage values
and their effect on the resulting waveform.
Page 12 of 35
The final design is based precisely on the described behaviour of the two
circuits.
Within the time period between times T1 and T2 the slope of the
increasing line of the triangular waveform is known to be [-L-/RC].
But also the slope can be determined by the equation of the line
within T1 and T2. Therefore:
𝑉𝑡ℎ − 𝑉𝑡𝑙
𝑠𝑙𝑜𝑝𝑒 = (𝑒𝑞 9)
𝑇2 − 𝑇1
−𝐿−
𝑠𝑙𝑜𝑝𝑒 = (𝑒𝑞 10)
𝑅𝐶
Page 13 of 35
𝑉𝑡ℎ − 𝑉𝑡𝑙 −𝐿−
= (𝑒𝑞 10)
𝑇/2 𝑅𝐶
(𝑉𝑡ℎ − 𝑉𝑡𝑙 ) ∗ 2 ∗ 𝑅𝐶
𝑇 = (𝑒𝑞 11)
−𝐿−
Now since [-L-] = [L+] and [f = 1/T] the final result can be written
as:
−𝐿−
𝑓 = (𝑒𝑞 12)
(𝑉𝑡ℎ − 𝑉𝑡𝑙 ) ∗ 2 ∗ 𝑅𝐶
Page 14 of 35
DESIGN ANALYSIS
Observe that the high and low levels of the power supply (L+ and L-
) are fed back directly into the input to the integrator. Keep in mind
that our goal is to design a circuit to implement linear frequency
control with input voltage with a relationship:
Where
1
𝐾 = (𝑒𝑞 14)
2 ∗ (𝑉𝑡ℎ − 𝑉𝑡𝑙 )𝑅𝐶
Page 15 of 35
Figure 10. The required frequency-voltage relationship of the final design.
1. A fixed slope
2. Variable pulse supply to the integrator to produce the
frequency in the desired range.
Figure 11. The circuit used to provide control over the input voltage to
Integrator and thus linear control of frequency.
The analysis of the circuit in Figure 11 should be broken down into two
parts:
1. Switch is Open
2. Switch is closed
Page 16 of 35
Figure 12 shows the analysis for the first case.
In this case, current into the positive terminal of the Op-Amp is negligibly
small (as long as the resistor Rx values are significantly lower than the input
resistance of the op-Amp); therefore the voltage at the positive terminal is
Vc. Now since there is negative feedback, the negative terminal will track the
positive terminal and therefore the voltage at the negative terminal is also
Vc. It follows that there is no current through the input resistor at the
negative terminal (since there is no voltage difference across it). This in turn
means that there cannot be any current through the feedback resistor. This
leads to the conclusion that the output is equal to Vc. What the analysis
shows is that when the switch is closed the output follows the input.
For the second case Figure 12 shows the analysis.
Figure 13. The analysis of the integrator input voltage control circuit
for the case of the closed switch.
Page 17 of 35
In this case the switch forms a short circuit with the ground and therefore
the positive terminal of the Op-Amp is grounded. Also, since there is
negative feedback the positive and the negative terminals track, therefore
the negative terminal is also at zero volts. This means that current exists
through both the input resistances and the current is the same in both
branches. Now since there is no current into the negative terminal, this
current, I, also passes through the feedback resistor and thus forms a
voltage difference across that resistor. From the analysis shown in the figure
the output voltage equals [–Vc]. What this tells us is that when the switch is
closed, the output is the negative of the input, and this is a very useful and
important conclusion.
The circuit in Figure 11 then permits us to have complete control over the
input to the integrator. This input voltage is completely independent of the
power supply or any other internal properties of the circuit. By Equation 13,
since the proportionality coefficient, K, is fixed at the required value, Vc
allows the user to control linearly the frequency of the generated
waveforms. One thing to note is that the resistor values Rx must be selected
such that their values are much lower than the specified input resistance of
the utilized op-amp. This is necessary in order for the Op-Amp to be
considered ideal in this particular application. This means that the current
into the Op-Amp’s terminals can be neglected to simplify the analysis and
implementation.
The circuit blocks discussed so far can now be put together in the diagram
shown in Figure 14.
Page 18 of 35
Things to notice are the voltage limiter and the switch components. The
limiter is necessary to isolate the switch from the power supply and to
simplify the design and maintainability of the switch. The limiter consists of a
zener diode and a small signal diode to provide constant voltage (~7.5v) to
the input of the switch. This way it is easier to adjust all the components for
the constant voltage coming out of the limiter. Then as long as the Bistable
output stays above the limiter cut-off point the switch will always have the
required voltage to operate. The components of the limiter are shown in
Figure 15.
The value of the resistor 𝑅𝑙𝑖𝑚 was chosen such that the current through the
diodes would be satisfied for the specified voltage drop. The output of the
limiter was then directed to a voltage divider as shown in Figure 16. The
divider was necessary for the protection of the switch from overload by a too
large voltage at the input. The diode was necessary to protect the MOSFET
from too large negative gate-source voltage.
The procedure for the analysis of the full circuit was as follows. The
integrator-bistable configuration was analyzed separately from the voltage
control, the switch and the limiter circuits. These components are
independent and therefore it makes little sense to analyze them together.
Instead, an inverting attenuator was used in the integrator-bistable feedback
Page 19 of 35
loop in order to test the circuit’s response to a changing input voltage. The
input voltage was changed simply by varying the value of the attenuator
feedback resistor. This is shown in Figure 17.
Figure 17. The waveform generator circuit at the testing stage. The attenuator is used to adjust the input to the integrator by
varying its feedback resistance. This allows for debugging of the operating parameters.
Page 20 of 35
Page 21 of 35
Using the equations and principles derived in the Theory section for the
operation of the inverting Bistable and inverting integrator, the necessary
component values for the circuit were determined.
1 1
𝐾 = 800 = = (𝑒𝑞 15)
2 ∗ (𝑉𝑡ℎ − 𝑉𝑡𝑙 )𝑅𝐶 2 ∗ �4 − (−4)� ∗ RC
Now this is the only equation for the analysis but there are two unknowns, R
and C. Due to a much wider choice of resistances than capacitances, the
capacitor was selected and fixed. The value used was 0.01uF. Based on this
value the integrator resistance was calculated from Equation 15 to be:
𝑅1 𝑅1
[𝑉𝑡ℎ] = 4 = [𝐿 +] ∗ = 15 ∗ (𝑒𝑞 16)
𝑅1 + 𝑅2 𝑅1 + 𝑅2
From this equation the relationship between R1 and R2 was derived and the
resistors were picked based on the availability of the components in the
design kit. This calculation however is imprecise because the real Op-Amp
will not saturate exactly at the power supply level. For this reason the circuit
was first simulated with the resistor values for the ideal case, the saturation
limits of the op-amp were observed and the resistor values were
recalculated. Based on the simulation results the chosen values were:
Page 22 of 35
𝑅1 = 10𝑘Ω, 𝑅2 = 22𝑘Ω
For the limiter circuit three components were needed, a current limiting
resistor, two zener diodes and two small signal diodes. The selected zener
diodes were 1N4734A (6.2v at 40mA) and the selected small signal ones
were 1N4148 (1.0V at 10mA). These would give a combined clamping at
approximately 7.5V (since the current through small signal diode was
expected to be higher than 10mA).
A 180Ω current limiting resistor was chosen from the ones available to
provide current of approximately 30mA.
For the switch protection voltage divider and diode, the chosen diode was a
small signal 1N4148 and the resistors were chosen to provide approximately
3V gate-source voltage to fully close the transistor. The utilized transistor
had 0.7V threshold gate-source voltage. The voltage division resistors were
selected to be equal, thus to supply ~3.5 volts to the transistor for proper
operation.
Page 23 of 35
5[𝑉] 0.641[𝑉 ] 0.5[𝑉 ]
𝑠𝑙𝑜𝑝𝑒𝑚𝑎𝑥 = = < (𝑒𝑞 17)
𝑅𝐶 µ𝑠 µ𝑠
The result means that it was safe to use the 741 Op-Amp for the integrator
configuration because the output waveform would not be limited by the slew
rate at the maximum required frequency. Therefore, it will not be limited at
the lower frequencies.
Amplitude Control
To implement the amplitude control of the triangular and the square
waveforms a simple voltage divider circuit with a potentiometer was used.
The output was taken from this circuit as shown in the next figure.
Figure 18. The voltage dividers used for amplitude control. The user can adjust the
potentiometer value for amplitude range 0 – 4 volts.
4000
𝑠𝑙𝑜𝑝𝑒2 = 𝐻𝑧/𝑣𝑜𝑙𝑡 = 160 𝐻𝑧/𝑣𝑜𝑙𝑡 = 𝐾 (𝑒𝑞 18)
25
Page 24 of 35
The only practical way to change the slope of operation from 800Hz/volt to
160Hz/volt is to calculate the value of the RC network resistor which would
provide this slope. From the derived theory, this resistor value is 200kΩ,
however tests have shown that the resistor must be selected to be of twice
lower value to achieve the required slope in reality. Therefore, a 100kΩ
resistor was the final choice. The final design is shown in the next figure.
Figure 19. The Final Design with frequency range select and amplitude control.
The simulation results for the final design for frequency range 1 and no
amplitude control are shown in the next two figures.
Page 25 of 35
Figure 20. The waveform obtained through simulation of the final design.
Page 26 of 35
EXPERIMENTAL PROCEDURE
Page 27 of 35
Testing the final design
After verification of the discrete circuit blocks, the final design was
assembled as shown in the following figure.
Figure 22. The Final Design with frequency range select and amplitude control.
From the final design test the frequency data was gathered at
various values of the input voltage. This data is plotted in the next
section and the results are discussed.
Page 28 of 35
RESULTS and OBSERVATIONS
First, the circuit was tested with the LM318 Op-Amp model before
the LM318 Op-Amp was made unavailable. The oscilloscope image
of that test is shown below. Note that this test was performed on
the circuit with a feedback attenuator (Figure 16).
Figure 23. The oscilloscope reading for the initial test of the final design with LM318 Op-Amps at the
Bistable and voltage control stages
Page 29 of 35
The test result of the final circuit with user voltage (and therefore
frequency) control (with amplitude control) is shown in the next
figure. Note that the final design consisted of LM741 op-amps and
not LM318s. Therefore a Slew-Rate distorted square wave is
expected. Due to this distortion a mismatch is also expected in the
switching points of the bistable and the points where the integrator
reaches the threshold levels. The final result is shown below:
Figure 24. The oscilloscope reading of the final design. The slew rate distortion of the 741 Op-Amps can be observed. Due to
this distortion the triangular wave peaks do not coincide with the square wave’s rise and fall points.
Page 30 of 35
Frequency-Voltage relationship in the 1st range of
operation [f/5 Hz/volt]
5
4.4
4 4.1
3.7
3.3
3
f [Hz] 2.7
2 2
1 1
0
0 1 2 3 4 5 6
Vin
Figure 25. The plot of the final data obtained for range 1 of operation
Page 31 of 35
Frequency-Voltage relationship in the 2nd range of operation
[f/25 Hz/volt]
250
200 206
177
150 151
f [Hz] 123
100 93
63
50
29
0
0 1 2 3 4 5 6
Vin [volts]
Figure 26. The frequency-input voltage relationship for the second range of operation of the design.
First thing to note from the graph is that the resulting slope significantly
deviates from the required one. The graph, however, shows an ideal linear
relationship between the input voltage and frequency. As was the case in
Figure 23, here also a cut-off point is present for the circuit to commence
operation. The reason for this discrepancy is as discussed above. The reason
for the improper slope lies entirely in the practical limitations of the design
because the theoretical analysis was done correctly and was tested through
simulations. It is needed to test several resistor values for the integrator
input to determine the one that insures the required slope.
Page 32 of 35
CONCLUSION AND RECOMMENDATIONS
• With the above point, it will also be possible to eliminate the two
separate amplitude control circuits and combine the amplitude control
into one separate block thus adding maintainability to the circuit.
Page 33 of 35
REFERENCES
1. M. Kassam ELE 504 Major Design Project, Department of Electrical and
Computer Engineering, Ryerson University, 2011.
2. A. Sedra, K. Smith Microelectronic Circuits, Oxford University Press;
Sixth Edition (Dec 15 2009).
Page 34 of 35
APPENDIX
Components Used
ALD1106 PBL 0863
LM741CN EA26 2
LM741CN K6D009
LM318N HARRIS 8318
PH4148 DIODE
1N4734A ZENER
H8F4734A ZENER
1mF 85 C Polarized Coupling Capacitor
o
RESISTORS
H0 E0T 10k Potentiometer 2
1M 3
100k 2
10k 2
15k 1
2.2k 2
6.8k 2
8.1k 1
Page 35 of 35