0% found this document useful (0 votes)
62 views27 pages

Sigsys Exp1 p2 Shrestha G

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)
62 views27 pages

Sigsys Exp1 p2 Shrestha G

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/ 27

Report 1 : 100%

Prelab 2 : 100%

Constructor University

Signals and Systems

Lab Experiment 1 - RLC Circuit - Transient


Response

Author: Shreesal Shrestha

Experiment Done by: Shreesal Shrestha, Pablo Vasquez Pocasangre

Place of Execution: Teaching Lab EE


Date of Execution: September 25th , 2024
1 Introduction
The Objective of the experiment is to investigate the transient response of a second
order system, specifically, a RLC circuit (Resistor-Inductor-Capacitor).

1.1 Differential Equations describing second-order systems


A RLC circuit can be described by a second-order ordinary differential equation,

d2 y(t) dy(t)
a2 − a 1 + a0 y(t) = x(t) (1.1)
dx2 dx
where, x(t) is the input to the system, y(t) is the response of the system to the
input, and a2 , a1 , a0 are system parameters.
However, for better analysis of second order systems, it is better to write Equation
(1.1) in the form of linear constant coefficient non-homogeneous differential equation,

d2 y(t) dy(t)
2
− 2ζωn + ωn2 y(t) = Kωn2 x(t) (1.2)
dx dx
where,
q
• ωn = a0
a2
is the Natural frequency

• ζ= √a1
2 a0 a2
is the damping ratio

• K= 1
a0
is the gain of the system.

1.2 The complete solution for a Second-Order D.E.


The solution of the second-order non-homogeneous differential equation consists of two
parts, the homogeneous solution, (yh ), and the forced solution, (yf ). It is given as
follows,

y = yh + yf (1.3)
The homogeneous solution of a second order non-homogeneous differential equation
describes the transient response of the system. Here we assume that the input to the
system, x(t) = 0. Similarly, the forced solution describes the steady-state response of
a system, as we assume that the input to the system, x(t) ̸= 0.

1.2.1 The homogeneous solution


As stated above, to find the homogeneous solution x(t) = 0, hence the (1.2) becomes,

d2 y(t) dy(t)
− 2ζω n + ωn2 y(t) = 0 (1.4)
dx2 dx
The solution of the equation is,

y(t) = Ceλt (1.5)

1
Substituting eqn. (1.5) into eqn, (1.4), we get,
Ceλt (λ2 + 2ζωn λ + λ2n ) = 0 (1.6)
From eqn. (1.6) we get,
λ2 + 2ζωn λ + λ2n = 0 (1.7)
Which is called the characteristic equation. The solution of the said equation helps
in finding the homogeneous solution. The solutions of the equation (roots) are,
p
λ1 = −ζωn + ωn ζ2 − 1 (1.7a)
p
λ2 = −ζωn − ωn ζ 2 − 1 (1.7b)
By substituting these into (1.5), we realize that each root has a contribution to the
homogeneous solution. Thus the homogeneous solution is,

yh = C1 eλ1 t + C2 eλ2 t (1.8)


Where, C1 and C2 are unknown coefficients determined by the initial conditions
and λ1 and λ2 are unknown coefficients determined by the coefficients of the differen-
tial equation.

Using the roots and our parameters, namely the damping ration ζ and the un-
damped natural frequency ωn (radian/s), we can classify our transient response into
the damping case it follows,
1. Under-damped case : 0 < ζ < 1, λ1 , λ2 ∈ C
2. Critically-damped case : ζ = 1, λ1 = λ2 ∈ R
3. Over-damped case : ζ > 1, λ1 , λ2 ∈ R where λ1 ̸= λ2
Under-damped Case: 0 < ζ < 1 - The homogeneous solution of the second-order
homogeneous differential equation exhibits a damped oscillatory behavior. The solution
can re written as,

y(t) = exp −ζωn t(C1 cos(ωd t) + C2 sin(ωd t)) (1.9)


where, ωd is the damped natural frequency,
p
ωd = ωn 1 − ζ 2 (1.9a)

Figure 1.1: Under-damped 2nd order homogeneous D.E

2
The under-damped response is an exponentially damped sinusoidal whose rate of
decay depends upon ζ. Likewise, the terms ± exp −ζωn t is the envelope of the response.

Critically-damped Case: ζ = 1 - The homogeneous solution of the second-order


homogeneous differential equation for this case is,

y(t) = C1 exp (−ζωn t) + C2 t exp (−ζωn t) (1.10)


For a critically damped solution, the response is not oscillatory. It approaches equi-
librium as quickly as possible.

Over-damped Case: ζ > 1 - The homogeneous solution of the second-order homo-


geneous differential equation for this case is,

p p
y(t) = C1 exp ((−ζ + ζ 2 − 1)ωn t) + C2 exp ((−ζ − ζ 2 − 1)ωn t) (1.11)

For an over damped solution, the response approaches slower than for critically
damped. The solution is also not oscillatory.

For all three cases C1 and C2 can be found using the initial conditions.

All the solutions can be summarized as in the following figure, fig.1.2, the ζ values
were taken to be 0.1, 0.3, 1, 2, and 3.

Figure 1.2: Solution for second-order homogeneous system with ζ = 0.1, 0.3, 1, 2, 3

1.2.2 The forced solution


The forced solution of a non-homogeneous second-order differential equation is usually
give by the sum of the input signal x(t) and its first and second derivatives. It is to be
noted that the response of a forcing function will be of the same form as the forcing
function. Meaning, if the input was a linear function, the forced response will be a
linear function. If the input was a sinusoidal the forced response will be a sinusoidal.

3
1.3 Some key Definitions and the Initial conditions of switched
circuits
• Step Response - is the response of a system upon an applied input signal in
the form of a step function.

• The steady-state value - is the magnitude of the voltage, or current, after the
system has reached stability.

• Ringing - is the Oscillation phenomenon which occurs is the system is under-


damped. It can be viewed in fig.1.2 when ζ = 0.3.

• Overshoot - It is observed if the transient signal exceeds the final steady state
value. It is represented by percentage and is given by,
Vmax − Vsteady−state
Overshoot = ∗ 100% (1.12)
Vsteady−state

It is also to be noted that,

1. The current through an inductor cannot change instantaneously, whereas the


voltage drop across an inductor can change instantaneously.

2. The voltage drop across a capacitor cannot change instantaneously, whereas the
current flow through a capacitor can change instantaneously.

3. In the steady state, an inductor is shorted.

4. In the steady state, a capacitor is opened.

4
2 Experimental Set-up and Results - Transient re-
sponse of RLC-Circuits
Tools and Equipment

• Resistor Decade

• 10mH Inductor

• 6n8F Capacitor

• Breadboard, wires and probes

• Oscilloscope

• Function generator

2.1 Set-up : Design of an RLC circuit


The RLC circuit, as shown in Figure (2.1), was constructed in the breadboard. Simi-
larly, the function generator was set to produce a 100Hz square wave with an amplitude
of 0.5V and an offset of 0.5V. After the setup, the oscilloscope was used to check if the
signal modulated between 0V to 1V.

Figure 2.1: RLC circuit for experiment 1

2.2 Results : Design of an RLC circuit


After the circuit was built, the oscilloscope was connected in parallel to the capacitor.
The damped frequency (fd ) was then measured. The frequency was measured using
the period function in the oscilloscope. The frequency was also measured using the
cursor function of the oscilloscope, where the time distance between two amplitudes
was measured. Since both methods gave similar values, the frequency measured from
the period function was taken and the other was discarded. The period was measured
to be 51.6µs. The frequency was then measured as,
1 1
fd = = −6
= 19379.84 = 19.37 × 103 Hz
T 51.6 × 10
Similarly, using the measured damped frequency the damped radian frequency ωd
was measured,

ωd = 2πf = 2π × 19379.84 = 121767.2 = 1.22 × 105 rad/s

5
The hard copies of the oscilloscope was taken which shows the period of the expo-
nentially damped sinusoidal and ringing phenomenon. They are shown in Figure (2.2)
and (2.3) respectively,

Figure 2.2: Period of exponentially damped sinusoidal

Figure 2.3: Ringing phenomenon of an under-damped system

To calculate the expected value of the damped radian frequency (ωd ), eqn.(1.9a)
was used. However for that we required to know the value of ζ and ωn . For a series
RLC circuit the ζ and ωn are given by,
1
ωn = √ (2.1)
LC
r
R C
ζ= (2.2)
2 L
However it is to be noted that for the resistance the internal resistance of 50Ω
should also be considered. Likewise, they were calculated to be,

1 1
ωn = √ =√ = 121267.8Hz
LC 10 × 10−3 6.8 × 10−9

6
r r
R C 100 + 50 6.8 × 10−9
ζ= = = 0.061846584
2 L 2 10 × 10−3
Therefore the damped radian frequency was calculated as,
p √
ωd = ωn 1 − ζ 2 = 121267.8 1 − 0.0618465842 = 121035.7 = 1.21 × 105 rad/s

Which is consistent with the measured damped radian frequency (1.22 × 105 rad/s).
The slight deviation from each other could be due to the error in the oscilloscope while
measuring the period. where do I see the measured frequency??
For a system to be critically damped, its damping ratio, (ζ) should be equal to 1
(ζ = 1). Using eqn.(2.2), the required resistance to make the circuit critically damped
was calculated to be,
r r
L 10 × 10−3
Rtotal = 2ζ × =2×1× = 2425.36Ω
C 6.8 × 10−9
Which is the resistance with the internal resistance of 50Ω included. Hence the
resistance of the R-Decade should be,

R = 2425.36 − 50 = 2375.36Ω

The resistance in the R-Decade was then set to the calculated value and the following
signal was observed in the oscilloscope, see Figure(2.4)

Figure 2.4: Critically damped signal when Resistance = 2375Ω

However, it was realized that varying the resistance of the R-Decade caused the
critical damping to be worse and better. The signal in fig(2.5) shows the critical
damping for R = 4000Ω, which was worse than for the original resistance.

7
Figure 2.5: Critically damped signal when Resistance = 4000Ω

Hence, it can inferred that the resistance should be decreased to get a better critical
damping. Fig(2.6)1 shows a better critical damping for R = 1900Ω.

Figure 2.6: Critically damped signal when Resistance = 1900Ω

For the final task the R-Decade was set to 30kΩ to make the circuit over-damped.
The transient voltage signal over the capacitor was the observed using the oscilloscope.
See, fig(2.7),

Figure 2.7: Over damped signal when Resistance = 30000Ω

1
We lost our picture for the better critically damped case, so this a borrowed picture.

8
3 Evaluation
For the first part of the evaluation, the circuit from fig(2.1) was used and the differential
equation for the voltage vc (t) across the capacitor when R = 100Ω was obtained. It
is to be noted that the internal resistance (50Ω) from the function generator was also
taken into consideration.

Figure 3.1: RLC circuit for experiment 1

Using Kirchhoff’s voltage law we get,

Vin = vr + vc + vl

Also,
dvc
i = il = ic = C
dt
dvc
vr = ic × R = RC
dt
dil d2 vc
vl = L = LC 2
dt dt
Therefore,

d2 v c dvc
Vin = LC 2
+ RC + vc
dt dt
d2 vc R 1 Vin
+ dvc dt + vc =
dt2 L LC LC
Now comparing with equations from eqn.(1.2),

d2 y(t) dy(t)
2
− 2ζωn + ωn2 y(t) = Kωn2 x(t)
dx dx
Where,
r
1
ωn = = 1.213 × 105 rad/s
LC
r
R + 50 C
ζ= = 0.06184.7
2 L
K=1

9
The damped frequency was also calculated using eqn.(1.9a),
p
ωd = ωn 1 − ζ 2 = 1.21 × 105 rad/s

All of the above values have also been calculated in section (2.2). Since the damping
constant ζ = 0.0618, which is 0 < ζ < 1, the homogeneous solution of the differential
equation will be like eqn.(1.9) and is an underdamped circuit. Therefore, for the
homogeneous solution we have,

Vc (t)h = e−ζωn t (C1 cos ωd t + C2 sin ωd t)

For the forced solution, since the forcing function is a constant the response will
also be a constant. So, assuming vc (t) = a, taking the first and second derivative and
plugging into the differential equation we obtained, we get,

vc (t) = a
dvc (t)
=0
dt
d2 vc (t)
=0
dt2
Plugging the given values in the differential equation,
d2 vc R 1 Vin
2
+ dvc dt + vc =
dt L LC LC
1 Vin
0+0+ ×a=
LC LC
a = Vin = 1

Therefore,

vc (t)f orced = 1

The forced solution can also be calculated using the circuit. At the steady state,
since the capacitor becomes an open circuit the voltage across the capacitor is equal
to the input voltage. Hence, the total solution is,

vc (t) = vc (t)h + vc (t)f orced


vc (t) = e−ζωn t (C1 cos ωd t + C2 sin ωd t) + 1

Finally, to determine the constants C1 and C2 we use the initial conditions of the
circuit. Since there is no source before t = 0s, the capacitor is initial uncharged. The
voltage drop across a capacitor cannot change instantaneously, and since the initial
voltage at t = 0 is zero, the dvdt
c (t)
= 0.

vc (0) = 0
−ζωn ×0
0=e (C1 cos ωd × 0 + C2 sin ωd × 0) + 1
C1 = −1

10
dvc (t)
= e−ζωn t (C2 ωd cos ωd t − C1 ωd sin ωd t) + e−ζωn t (−C1 ωd cos ωd t − C2 ωd sin ωd t)
dt
dvc (t)
= e−ζωn t (C2 ωd cos ωd t − C1 ωd sin ωd t − C1 ωd cos ωd t − C2 ωd sin ωd t)
dt
dvc (0)
Since, =0
dt
0 = e−ζωn ×0 (C2 ωd cos ωd × 0 − C1 ωd sin ωd × 0 − C1 ωd cos ωd × 0 − C2 ωd sin ωd × 0)
0 = 1(ωd × C2 − 0 − ζωn C1 − 0)
−ζωn
C2 =
ωd
C2 = −0.0620

Hence, for the under damped circuit, the final solution is,

vc (t) = e−7500.t (− cos(1.21 × 105 .t) − 0.0620 sin(1.21 × 105 .t)) + 1

The plot of vc (t) against time was then plotted into MATLAB1 . The plot is shown
in fig(3.2)

Figure 3.2: Plot of voltage against time for an underdamped case of an RLC circuit

For a critically damped signal, the ζ = 1, by using this fact and the eqn.(1.2), we
can find the required resistance to be,
r
R C
ζ= =1
2
r L
L
RT = 2 × = 2425.356Ω
C
1
All MATLAB codes are given in the appendix

11
However, taking the internal resistance into account, the actual resistance required
will be,
R = RT − 50 = 2375.356Ω
For, a critically damped system, the homogeneous solution is given by eqn.(1.10),

y(t) = C1 exp (−ζωn t) + C2 exp (−ζωn t)


Where, ωn is the same as the one calculated for the underdamped case. Similarly, the
forced solution will also be the same, making the final solution as,
vc (t) = C1 exp (−ζωn t) + C2 exp (−ζωn t) + 1
Using the similar method as in the underdamped case C1 and C2 are also calculated,
vc (0) = 0
vc (0) = C1 exp (−ζωn × 0) + C2 t exp (−ζωn × 0) + 1 = 0
0 = C1 + 1
C1 = −1
And,
dvc (t)
= −ζωn C1 exp (−ζωn t) − ζωn C2 t exp (−ζωn t) + C2 exp (−ζωn t)
dt
dvc (0)
=0
dt
−ζωn C1 − 0 + C2 = 0
C2 = −ωn
Therefore, the final solution for voltage vc (t) is,
vc (t) = − exp (−ωn t) − ωn exp (−ωn t) + 1
Where, ωn = 1.213 × 105 rad/s
The plot of vc (t) against time was then plotted into MATLAB. The plot is shown
in fig(3.3)

Figure 3.3: Plot of voltage against time for a critically damped case of an RLC circuit

12
Summarizing all the values we have both calculated and measured, in the first task
we had measured the damped frequency as well as calculated it,
measured, f requency = 19379.84[Hz] = 121767.2[rad/s]
calculated, f requency = 19263.42[Hz] = 121035.7[rad/s]
Similarly, in the second task we had calculated the required resistance for critical
damping as well as had observed the actual required resistance in a practical circuit,
calculated, resistance = 2425.256 − 50[Ω] = 2375.356[Ω]
observed, resistance = 1900[Ω]
Analyzing the measured and calculated values, it can be easily inferred that the
values are consistent and close with each other. However the slight difference between
them could be caused by various factors. One potential source of error might be that
the probe may not have been compensated well. The probe compensating for the ripple
effect could have caused an error in the measured value of the frequency. Similarly, to
get the correct critical damping resistance, the probe compensation should have been
done well, if not, it may require more or less resistance that the true value. Which
explains the discrepancy for the resistor value. For the frequency, since the cursor
function was used to measure it, the measured value could have also not been accu-
rate. Some other potential sources of error is the instrumental error originating from
the internal resistances of the R-Decade, breadboard, the passive elements and the
connecting wires.

For the final problem, the following circuit was used, see fig(3.4).

Figure 3.4: RLC circuit, (switch is open for t ¡ 0)

To obtain the differential equation, Kirchhoff’s Voltage law was applied into the
two meshes,
In the first mesh,
Z
1
R1 i1 + (i1 − il ) dt = Vin
C
In the second mesh,
Z
1 dil
(il − i1 ) dt + L + R2 il = 0
c dt
Z Z
1 dil 1
(il ) dt + L + R2 il = (i1 ) dt
c dt c
d2 il dil
i1 = il + LC 2 + R2 C
dt dt

13
Using i1 in the first mesh equation,

d2 il d2 il
Z
dil 1 dil
R1 il + R1 LC 2 + R1 R2 C + (il + LC 2 + R2 C − il ) dt = Vin
dt dt C dt dt
d2 i l dil dil
R1 il + R1 LC 2 + R1 R2 C +L + R2 il = Vin
dt dt dt
d2 il dil
R1 LC 2 + (R1 R2 C + L) + (R1 + R2 )il = Vin
dt dt
d2 il (R1 R2 C + L) dil (R1 + R2 ) Vin
2
+ + il =
dt R1 LC dt R1 LC R1 LC
Comparing with eqn.(1.2), we get,


r
R1 + R2
ωn = = 9 × 103 rad/s
R1 LC


R1 R2 C + L 19
ζ= p = = 1.2667
2 (R1 LC).(R1 + R2 ) 15


1
K= = 0.0123
R1 + R2

Where, R1 = 25Ω, R2 = 56Ω, C = 2 × 10−6 F , and I = 20 × 10−3 H


Here, since ζ = 1.2667 > 1, the system is an overdamped system. Thus, the homoge-
neous solution is given by eqn.(1.11),
p p
il (t)h = C1 exp ((−ζ + ζ 2 − 1)ωn t) + C2 exp ((−ζ − ζ 2 − 1)ωn t)

For the forced solution, as done in the previous problems, since the forcing function
is a constant the response will also be a constant. So, assuming il (t) = a, taking the
first and second derivative and plugging into the differential equation we obtained, we
get,

il (t) = a
dil (t)
=0
dt
d2 il (t)
=0
dt2
Plugging the given values in the differential equation,

(R1 R2 C + L) (R1 + R2 ) Vin


0+ ×0+ ×a=
R1 LC R1 LC R1 LC

14
Vin 16.2
a= = = 0.2A
(R1 + R2 ) (25 + 56)
il (t)f orced = 0.2

The forced solution can also be calculated using the circuit. At the steady state,
since the inductor becomes a short circuit the current across it is equal to the current
across the resistors in series.
Hence, the total solution is,

il (t) = il (t)h + il (t)f orced


p p
il (t) = C1 exp ((−ζ + ζ 2 − 1)ωn t) + C2 exp ((−ζ − ζ 2 − 1)ωn t) + 0.2

To find C1 and C2 the initial conditions are required. They can be found assuming
that since the switch in the circuit closes at t = 0s, there is no charge flowing through
the inductor and since the current across the inductor cannot change instantaneously,
il (0) = 0A. Similarly, since, il (0) = 0, didtl = 0 as well. Hence, using the initial
conditions,

il (0) = 0
p p
C1 exp ((−ζ + ζ 2 − 1)ωn × 0) + C2 exp ((−ζ − ζ 2 − 1)ωn × 0) + 0.2 = 0
C1 + C2 + 0.2 = 0
C1 = −0.2 − C2

Similarly,

dil (t) p √ p √
2 ((−ζ+ ζ 2 −1)ωn t) 2 ((−ζ− ζ 2 −1)ωn t)
= (−ζ + ζ − 1)ωn C1 e + (−ζ − ζ − 1)ωn C2 e
dt
dil (t)
=0
√ dt √
p p
2 ((−ζ+ ζ 2 −1)ωn ×0) 2 ((−ζ− ζ 2 −1)ωn ×0)
(−ζ + ζ − 1)ωn C1 e + (−ζ − ζ − 1)ωn C2 e =0
p p
(−ζ + ζ 2 − 1)ωn C1 + (−ζ − ζ 2 − 1)ωn C2 = 0
p p p
−0.2(−ζ + ζ 2 − 1) = C2 ((−ζ + ζ 2 − 1)) − C2 (−ζ − ζ 2 − 1)
p
−0.2(−ζ + ζ 2 − 1)
C2 = p p
−ζ + ζ 2 − 1 + ζ + ζ 2 − 1
p
−0.2(−ζ + ζ 2 − 1)
C2 = p = 0.0629
2 ζ2 − 1
Hence, C1 = −0.2 − 0.0629 = −0.2629

Finally,
p p
il (t) = −0.2629 exp ((−ζ + ζ 2 − 1)ωn t) + 0.0629 exp ((−ζ − ζ 2 − 1)ωn t) + 0.2

Where, ζ = 1.2667 and ωn = 9 × 103 rad/s.

15
Therefore, the complete solution of the system is,
p
il (t) = −0.2629 exp −4402.86t) + 0.0629 exp ((−ζ − −18397.1t) + 0.2

The plot of il (t) was then plotted against time in MATLAB3 , see fig(3.5),

Figure 3.5: Plot of voltage against time for an over damped case of an RLC circuit

3
See apendix for code

16
4 Conclusion
The main objective of this experiment was to observe the transient response of a RLC
circuit. Different damping cases were studied, and it was realized that the nature of
damping depends upon the damping ratio (ζ). If 0 < (ζ) < 1 the system was under
damped, if ζ = 1 the system was critically damped and if ζ > 1 the system was over
damped. For an under damped circuit the output voltage followed an oscillatory be-
haviour which decreased exponentially. In the first part of the experiment the damped
frequency was measured and it was then compared to its theoretical calculated value.
Both the values were pretty close with each other. However the slight difference was
caused by various errors, namely the probe of the oscilloscope not being well compen-
sated and the cursor function being used to measure the time difference, which could
have been not accurate. For the second part, the resistance required to make the sys-
tem critically damped was calculated. However, it was observed that in a practical
circuit, the theoretical calculated resistance value would not generate a good critically
damped output. This error was again from the lack of proper probe compensation,
which required the resistance to be less than the true value to get a better critically
damped system. There could have also been further errors caused by the internal resis-
tances of the R-Decade, breadboard and the passive elements used in the circuit. For
the final task, the resistance in the circuit was set extremely high to observe an over
damped output signal. For the evaluation part, differential equations were obtained
and solved for different circuits and damping cases and their corresponding complete
responses were calculated. For each response, its corresponding plot against time was
also plotted in MATLAB and shown. Overall, the experiment was a success in showing
and learning about the transient response of an RLC circuit.

17
5 References
1. 20240829-co-520-b manual - U.Pagel, Page(11-22)
http://uwp-cu-lab.my-board.org/02.0.adveelab/02.1.signalsys/20240829-co-520-b manual.pdf

2. Alexander, C. K. and Sadiku, M. Fundamentals of Electric Circuits, 7th edition.

3. Oppenheim, A. V. and Willsky, A. S. (1996). Signals and Systems, 2nd edition.

18
6 Appendix
6.1 MATLAB code for the under damped case
1 clc ; clear ;
2 %%
3 t = linspace (0 , 0.001 , 1000) ;
4

5 C = 6.8*10^ -9;
6 L = 10*10^( -3) ;
7 R = 150;
8

9 wn = sqrt (1/( L * C ) ) ;
10 zeta = ( R / L ) /(2* sqrt (1/( L * C ) ) ) ;
11 K = 1;
12 wd = wn * sqrt (1 - zeta ^2) ;
13

14 C1 = -1;
15 C2 = ( zeta * wn * C1 ) / wd ;
16

17 vc_t = exp ( - zeta * wn * t ) .* ( C1 * cos ( wd * t ) + C2 * sin ( wd * t ) ) +


1;
18

19 figure ;
20 plot (t , vc_t ) ;
21 xlabel ( ’ Time ␣ [ s ] ’) ;
22 ylabel ( ’ V_c ( t ) ␣ [ V ] ’) ;

6.2 MATLAB code for the critically damped case


1 clc ; clear ;
2 %%
3 t = linspace (0 , 0.001 , 1000) ;
4

5 C = 6.8*10^ -9;
6 L = 10*10^( -3) ;
7 zeta = 1;
8

9 R = 2* sqrt ( L / C ) ;
10 wn = sqrt (1/( L * C ) ) ;
11 K = 1;
12

13 C1 = -1;
14 C2 = ( - wn ) ;
15

16 vc_t = C1 .* exp ( - zeta * wn * t ) + ( C2 * t .* exp ( - zeta * wn * t ) ) + 1;

19
17

18 figure ;
19 plot (t , vc_t ) ;
20 xlabel ( ’ Time ␣ [ s ] ’) ;
21 ylabel ( ’ V_c ( t ) ␣ [ V ] ’) ;
22 ylim ([0 ,1.5]) ;

6.3 MATLAB code for the Over damped case


1 clc ; clear ;
2 %%
3 t = linspace (0 , 0.001 , 1000) ;
4

5 R1 = 25;
6 C = 2*10^ -6;
7 L = 20*10^( -3) ;
8 R2 = 56;
9

10 zeta = ( R1 * R2 * C + L ) /(2* sqrt (( R1 * L * C ) *( R1 + R2 ) ) ) ;


11 wn = sqrt (( R1 + R2 ) /( R1 * L * C ) ) ;
12 K = 1/( R1 + R2 ) ;
13

14 C2 = 0.0629;
15 C1 = -C2 -0.2;
16

17 il_t = C1 .* exp (( - zeta + sqrt ( zeta ^2 -1) ) * wn * t ) + ( C2 .* exp (( -


zeta + sqrt ( zeta ^2 -1) ) * wn * t ) ) + 0.2;
18

19 figure ;
20 plot (t , il_t ) ;
21 xlabel ( ’ Time ␣ [ s ] ’) ;
22 ylabel ( ’ I_l ( t ) ␣ [ A ] ’) ;
23 ylim ([0 ,0.25]) ;

20
6.4 Prelab: RLC Circuits - Frequency Response
1. Name the filter characteristic measured over the different components, component
combinations.
The different filters generated by measuring over different components and com-
ponent combinations were,

• Output taken over resistor - Band pass filter


• Output taken over capacitor - Low pass filter
• Output taken over inductor - High pass filter
• Output taken over capacitor and inductor - Band stop filter

2. Show the Bode magnitude plot across the resistor, the capacitor, the inductor
and across the capacitor and the inductor together. Use a 5 V amplitude and
vary the frequency starting at 100 Hz up to 100 KHz. Develop a Matlab script
to plot the four characteristic in one graph. Attach the script to the prelab!
The following magnitude Bode plot was plotted in MATLAB,

Figure 6.1: Magnitude Bode plot for different filter characteristics

1 clc ; clear ;
2 % % Magnitude Bode Plot
3 w = logspace (2 ,6 ,1000) ;
4 R = 390;
5 C = 270*10^ -9;
6 L = 10*10^ -3;
7

8 H_R = (1 j * w * R * C ) ./(1 -( w ) .^2* L * C +1 j * w * C * R ) ; % Bandpass


filter
9 H_L = ( -( w ) .^2* L * C ) ./(1 -( w ) .^2* L * C +1 j * w * C * R ) ; % Highpass
filter
10 H_C = 1./(1 -( w ) .^2* L * C +1 j * w * C * R ) ; % Lowpass filter

21
11 H_LC = ( -( w ) .^2* L * C + 1) ./(1 -( w ) .^2* L * C +1 j * w * C * R ) ; %
Bandstop filter
12

13 semilogx (w ,20* log10 ( abs ( H_R ) ) , ’r ’) ;


14 hold on ;
15 semilogx (w ,20* log10 ( abs ( H_L ) ) , ’b ’) ;
16 semilogx (w ,20* log10 ( abs ( H_C ) ) , ’g ’) ;
17 semilogx (w ,20* log10 ( abs ( H_LC ) ) , ’k ’) ;
18

19 title ( ’ Magnitude ␣ Bode ␣ Plot ’) ;


20 xlabel ( ’ Frequency ␣ ( rad / s ) ’) ;
21 ylabel ( ’ Magnitude ␣ ( dB ) ’) ;
22 ylim ([ -50 ,10]) ;
23 grid on ;
24

25

26 % % Bandwidth and Q factor


27

28 mag_H_R = 20* log10 ( abs ( H_R ) ) ;


29

30 max_gain = max ( mag_H_R ) ; % Maximum gain


31 threshold = max_gain - 3; % because 20 log10 (1/ sqrt (2) ) =
-3
32

33 indices = find ( mag_H_R >= threshold ) ;


34 f_low = w ( indices (1) ) ; % Lower cutoff frequency
35 f_high = w ( indices ( end ) ) ; % Upper cutoff frequency
36

37 bandwidth = f_high - f_low ; % rad / s


38 bandwidth_f = bandwidth /(2* pi ) ;
39

40 % Display results
41 fprintf ( ’ Lower ␣ cutoff ␣ frequency : ␣ %.2 f ␣ Hz \ n ’ , f_low ) ;
42 fprintf ( ’ Upper ␣ cutoff ␣ frequency : ␣ %.2 f ␣ Hz \ n ’ , f_high ) ;
43 fprintf ( ’ Bandwidth : ␣ %.2 f ␣ rad / s \ n ’ , bandwidth ) ;
44 fprintf ( ’ Bandwidth_f : ␣ %.2 f ␣ Hz \ n ’ , bandwidth_f ) ;
45

46 xline ( f_low , ’k - - ’) ;
47 xline ( f_high , ’k - - ’) ;
48 legend ( ’ Bandpass ’ , ’ Highpass ’ , ’ Lowpass ’ , ’ Bandstop ’ , ’Cut -
off ’ , ’Cut - off ’ , ’ Location ’ , ’ southwest ’) ;
49 hold off ;

3. Taking the magnitude across the resistance represents a band-pass filter. Calcu-
late the bandwidth and the Q factor of the circuit. Extract the bandwidth from
the Matlab plot and compare.

22
The bandwidth and the quality factor were measured using,
Rs 390
B = ω2 − ω1 = = = 39000[rad/s] = 6207.04[Hz]
L 10 × 10−3
ωo 1
Q= = √ = 0.4935
ω2 − ω1 B LC
From the MATLAB code the bandwidth was measured to be,

Bandwidth = 6120[Hz]

Which is consistent with the calculated value. The slight difference could have
occurred due to a inaccuracy of the MATLAB code. The code for extracting the
bandwidth is also given in the code above.

23
6.5 Experiment data: RLC Circuits - Frequency Response
For the first an RLC circuit was built and the output was taken at different components,
and component combinations. The hardcopies for each output was taken and are shown
below,

Figure 6.2: Band pass filter, output taken over resistor

Figure 6.3: Low pass filter, output taken over capacitor

Figure 6.4: High pass filter, output taken over inductor

24
Figure 6.5: High pass filter, output taken over inductor and capacitor

The second part of the experiment, the resonance frequency was measured using
the X-Y mode in the oscilloscope and the Lissajou figure. The frequency was changed
until a linear figure was obtained, as for resonance frequency the phase shift is 0◦ . After
the linear figure was obtained, the plot was reverted back to X-t mode. The resonance
frequency was found to be,

Resonance, f requency = 3.1 × 103 [Hz]

The X-t plot is shown below,

Figure 6.6: X-t plot of signals with 0 phase difference and resonance frequency

For the final task, the cutoff frequencies were also measured. The known fact that
at the cutoff frequencies the phase difference is ±45◦ was used. The phase difference
was measured using the measure function of the oscilloscope and the frequencies were
varied until we obtained the desired phase difference. The X-t plot for both cutoff
frequencies are shown below,

25
Figure 6.7: X-t plot of signals with 45◦ phase difference

Figure 6.8: X-t plot of signals with −45◦ phase difference

The cutoff frequencies were measured as,

low − cutof f, f requency = 1.25 × 103 [Hz]


high − cutof f, f requency = 7.4 × 103 [Hz]

And the bandwidth was measured to be,

Bandwidth = 6.15 × 103 [Hz]

26

You might also like