Lab04 03
Lab04 03
NA KIMHOIR
ID: e20190643
April 2022
1 Problem
2 Lab Assignment
2.1 I. Inverting Operational Amplifier Circuit
For figure 3 and the following:
c) Construct a Simulink model and calculate step and impulse responses of the above systems.
1
(a) DC Motor structure
The voltage across the inductor is proportional to the change of current through the coil with
respect to time. DC-motor mechanical equation could be written as follow:
dωm
J = Te − bv ωm − TL
dt
Where J moment of inertia of a rotor, and bv is motor shaft viscous friction constant. Electrical part
of system could be model by equation:
dia
Va = Ra ia + La + ea
dt
Assume that negligible field dynamic, constant ea = k1 ωm and Te = k2 ia , where k1 and k2 are assumed
motor constants. Assume that we know all parameters:
a) Find the differential equation of the motor, transfer function ans state space equations.
b) Make the block diagram of the transfer function and implement it in MATLAB SIMULINK. You
can reduce the block diagram according to your understanding and you are required to explain
each step of reduction in detail.
c) Write detailed analysis on the step responses of the DC motor. State the assumptions in your
report.
2
3 Solution
3.1 Part I: Mechanical System: Mass-Spring
a) Derive the second order differential equation Lagrange’s Equation:
d ∂L ∂L ∂D
− + = Fa (t)
dt ∂ ẋ ∂x ∂ ẋ
We have L = T − V , T = 12 M v 2 = 21 M ẋ2 , V = 21 kx2 and D = 12 Bv 2 = 12 B ẋ2
then,
d
(M ẋ) − (−Kx) + B ẋ = Fa (t)
dt
M ẍ + B ẋ + Kx = Fa (t)
B K Fa (t)
ẍ + ẋ + x=
M M M
b) Write the transfer function of the System X(s)/F (s). By using Laplace’s transform
Assume that x(0) = 0 and ẋ(0) = 0.
B K 1
X(s)s2 + sX(s) + X(s) = Fa (s)
M M M
2 B K 1
X(s) s + s+ = Fa (s)
M M M
1
M F (s)
⇒ X(s) = B K
s2 + Ms + M
c) Write the state space of the above system. We know that ẋ(t) = Ax(t) + Bu(t) Let
x1 (t) = x(t)
x2 (t) = x˙1 (t) = ẋ(t)
By putting back in the differential equations, we get
B K 1
x˙2 (t) + x2 (t) + x1 (t) = Fa (t)
M M M
B K 1
⇒ x˙2 (t) = − x2 (t) − x1 (t) + Fa (t)
M M M
We obtain
0 1 1 1
A= ,B = F (t)
−MK
−MB
0 M a
x1 (t)
y(t) = [1 0]
x2 (t)
3
b) By using Laplace’s Transform, assume that VC (0) = 0, V̇C = 0
R 1 Vin (s)
s2 Vout (s) + sVout (s) + Vout (s) =
L LC LC
2 R 1 Vin (s)
Vout (s) s + s + =
L LC LC
1
Vout (s) LC
⇒ = 2 R 1
Vin (s) s + L s + LC
d2 VC dVC
V = LC2
+ RC + VC
dt dt
di
or V = L + Ri(t) + VC (t)
dt
Rewrite the above equation
di(t) q(t)
V =L + Ri(t) +
dt C
2
d q(t) dq(t) q(t)
V =L +R +
dt2 dt C
V 2
d q(t) R dq q(t)
= + +
L dt2 L dt LC
Let x1 (t) = q(t), then x2 (t) = q̇(t) and then
dx2 (t) R 1 1
= − x2 (t) − x1 (t) + V
dt L LC L
We obtain
− C1
1
0
C , C = 1, , u(t) = 0
A= 1 R ,B =
L −L 0
Therefore
− C1
1
0 x1 (t)
ẋ(t) = A = 1 + C u(t)
L −RL x2 (t) 0
and
x1 (t)
y(t) = 0, −1
x2 (t)
d) Construct a SIMULINK diagram to calculate step and impulse responese of the above systems.
We have R = 3, L = 4, C = 2
1/8
⇒ H(s) =
1+ 0.75s−1 + 0.125s−2
4
3.3 Part II: Electrical System: RLC circuit
a) Derive the differential equation of the above system.
We have
diL
V = VL + VC + VR = L + Ri + VC
dt
dq
but iL = iC = iR = i = dt = C dVdtC
d2 VC dVC
V = LC 2
+ RC + VC
dt dt
d2 VC R dVC 1 V
= + + VC =
dt2 L dt LC LC
R 1 V
= V̈C + V̇C + VC =
L LC LC
5
Hence, we get the transfer function
1
Vout (s) LC
= 2 R 1
Vin (s) s + L s + LC
d2 VC dVC
V = LC + RC + VC
dt2 dt
di
or V = L + Ri(t) + VC (t)
dt
Rewrite the above equation
di(t) q(t)
V =L + Ri(t) +
dt C
d2 q(t) dq(t) q(t)
V =L +R +
dt2 dt C
V d2 q(t) R dq q(t)
= + +
L dt2 L dt LC
Let x1 (t) = q(t), then x2 (t) = q̇(t) and then
dx2 (t) R 1 1
= − x2 (t) − x1 (t) + V
dt L LC L
We obtain
− C1
1
0
A= 1 , B = C , C = 1, , u(t) = 0
L −RL 0
Therefore
− C1
1
0 x1 (t)
ẋ(t) = A = 1 + C u(t)
L −RL x2 (t) 0
and
x1 (t)
y(t) = 0, −1
x2 (t)
d) Construct a SIMULINK diagram to calculate step and impulse responese of the above systems.
We have R = 3, L = 4, C = 2
1/8
⇒ H(s) =
1+ 0.75s−1 + 0.125s−2
6
4 Solution
4.1 I. Inverting Operational Amplifier Circuit
a. Find the transfer function Vo (s)/Vi (s).
For inverting amplifier circuit, =⇒ vo (t) = −Av1 (t)
Vi (s) Vo (s)
By using Kirchoff’s Law: Ia (s) = 0, I1 (s) = −I2 (s), =⇒ I1 (s) = Z1 (s) and I2 (s) = Z2 (s) Since A
gain is too large, thus v1 (t) ≈ 0
Z2 (s)
Vo (s)/Vi (s) = −
Z1 (s)
Which
1 1 360 × 103
Z1 (s) = 1 = 1 =
C1 (s) + R1 5.6 + 10−6 (s) + 360×103
2.016s + 1
1 107
Z2 (s) = R2 + = 220 × 103 +
C2 (s) s
Vo (s) 2
s + 45.95s + 22.25
=⇒ = −1.232
Vi (s) s
7
By defining the intermediate variable Z(s), we take
0 1 0 x1 (t) 0
ẋ(t) = 0 0 0
x2 (t) + 0 Vi (t)
0 0 0 x3 (t) 1
x1 (t)
y(t) = −27.41 −56.61 −1.232 x2 (t)
x3 (t)
c. Construct a Simulink model can calculate step and impulse response of the above system.
8
4.2 II. DC Motor
a) Find the differential equation of motor, transfer function and state space equations.
For the circuit , we have
Va = VR + VL + e(t)
dia
Va = Ra ia + L + e(t)
dt
9
Since ia = iR + iL + ie , VR = Ra ia , VL = L didta . By using Laplace Transform, assuming ia (0) = 0,
we get
Since Te = k2 ia ⇒ L [Te ] = K2 Ia (s), ⇒ Ia = Te /K2 and Td (s) = 0 Put Ia (s) into equation (3), we
get
Te (Ra + Ls)
Va (s) = + K1 sθm (s) (16)
K2
Ra + La s
θm (s)(Js2 + bv s) + K1 sθm (s)
Va (s) = (17)
K2
θm (s) 1
=⇒ = Ra +La s (18)
Va (s) K2
2
(Js + bv s) + K1 s
θm (s) 1
= 1+0.1s 2
(19)
Va (s) 0.001 (0.01s
+ 0.1s) + 0.01s
θm (s) 1 1
= = 3 (20)
Va (s) (1 + 0.1s)(10s2 + 100s) + 0.01s s + 20s2 + 100.01s
Again, we have
θm (s) 1
= 3
Va (s) s + 20s2 + 100.01s
⇔ Va (t) = (s3 + 20s2 + 100.1s)θm (t)
By using Inverse Laplace Transform and assuming all initialize condition is zero, we then get
...
θ m + 20θ̈m + 100.01θ̇m = Va (t) (21)
Let x1 (t) = θm , x2 (t) = θ˙m = ẋ1 (t), x3 (t) = θ̈m = ẋ2 (t)
10
0 1 0 0
A = 0 0 1 ,B = 0 (22)
0 −100.01 −20 1
C = 1 0 0 ,D = 0 (23)
ẋ(t) = Ax(t) + Bu(t) (24)
0 1 0 x1 (t) 0
ẋ(t) = 0 0 1 x2 (t) + 0 Va (t) (25)
0 −100.01 −20 x3 (t) 1
x1 (t)
y(t) = 1 0 0 x2 (t) (26)
x3 (t)
b) Make the block diagram of the transfer function and implement it in MATLAB SIMULINK. We
have
θm (s) 1 s−3
= 3 =
Va (s) s + 20s2 + 100.01s 1 + 20s−1 + 100.01s−2
11
Figure 4: Step response by State-space
12