0% found this document useful (0 votes)
35 views10 pages

SD Lab Report

The document summarizes the results of two lab experiments on an open-loop and closed-loop control system. In lab 1, the open-loop system is modeled and its parameters identified. This includes determining the viscous friction coefficient, motor speed constant, system gain, and time constant. In lab 2, a closed-loop controller is implemented and shown to improve the system's settling time and ability to reject disturbances compared to the open-loop configuration.

Uploaded by

Yuvraj Tyagi
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)
35 views10 pages

SD Lab Report

The document summarizes the results of two lab experiments on an open-loop and closed-loop control system. In lab 1, the open-loop system is modeled and its parameters identified. This includes determining the viscous friction coefficient, motor speed constant, system gain, and time constant. In lab 2, a closed-loop controller is implemented and shown to improve the system's settling time and ability to reject disturbances compared to the open-loop configuration.

Uploaded by

Yuvraj Tyagi
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/ 10

AMME 3500 Lab Report

SID:500449488 Ziwei Gong


SID:500490745 Matthew Hearn
SID:510661010 Sahil Siddiqui

I. L AB 1 O PEN L OOP R ESPONSE B. Identifying the physical properties of the system


The objective is to find the values of the Viscous friction
A. Physical System Description
coefficient D and Motor speed constant km .
The following ODE has been provided: It’s been given that the combined moment of inertia of
the disk, shaft, and motor rotor (J) is approximately 2.09 ×
J ẋ(t) + Dx(t) = km u(t) (1) 10−5 kgm2 .
To find these values, the motor model is simulated in
Where J represents the moment of inertia, D is the viscous Simulink. The block diagram of the model is shown in Fig.
friction, x is the angular velocity of the disk, u is the motor 1. Through this, the angular speed response for the simulated
torque and km is the motor constant. plant can be obtained, which is shown in Fig. 2.
It’s given that x(0) = 0 and u(t) = u0 (Constant). So, (1)
can written as:

J ẋ(t) + Dx(t) = km u0 (2)

By rearranging, (2) can be written as:

D km
ẋ(t) + x(t) = u0 (3)
J J
It is possible to solve (3) with a trial solution shown in (4). Fig. 1. Simulink block diagram for the simulated plant

−D
x(t) = c1 e J t + c2 (4)

By substituting the trial solution and matching the initial


conditions, c1 and c2 can be obtained.
km km
c1 = − u0 c2 = u0
D D
The solution can be therefore written as:
km −D
x(t) = u0 (1 − e J t ) (5)
D
The solution of the first order ODE is shown as (5).
This solution can also be expressed in the form of the
steady-state gain (K) and the time constant (τ ).
Fig. 2. Graph of angular speed vs time for the simulated plant
−t
x(t) = Ku0 (1 − e τ ) (6) The final value obtained for the angular velocity (output)
was 45.84 rad/s and the final value of the voltage (input)
By equating (5) and (6), the value of K and τ can be obtained. was 2V . Thus, the value of the System Gain (K) for this
km J model came out to be 22.92 rad/V s.
K= τ= (7) Here, the time constant (τ ) is the time taken by the system
D D
to reach (1−1/e) or 63% of the final value. For this system, τ
The expressions for the K and τ in terms of the original was calculated to be equal to 0.1160 s. So, K = 22.92 rad/V s,
variables J, D and km have been obtained. τ = 0.1160 s and J = 2.09 × 10−5 kgm2 . Since the equations
for K and τ is known in (7), the values of km , D can be II. L AB 2 C LOSED L OOP C ONTROL
calculated: A. Closing the Loop
D = 1.801 × 10−4 kgm2 /s
Implementing closed-loop control to the system described
km = 4.127 × 10−3 kgm2 rad/V s2 by (1), we select r0 = 45.85 as it was the steady-state output
observed in the open-loop control illustrated by fig 3.
C. Additional Discussion & Follow-ups
The closed-loop controller is connected in Simulink as
The equation for the model is shown in (8). shown in fig 4.
−t
x(t) = 22.92u0 (1 − e 0.1160 ) (8)
With this equation, the required control input (u) for any
desired state of x can be determined. If the final angular
velocity is x = 20 rad/s as t → ∞, (8) becomes:
x(∞)
x(∞) = 22.92u → u = (9)
22.92
With x(∞) in this case being 20 rad/s, the control input u can
be calculated as: Fig. 4. Closed-loop controller connection in Simulink.
u = 0.872V
Fig 5 and 6 show the trajectories of the input u(t) and the
Using MATLAB, the output of the model is plotted and output x(t) respectively.
compared to the actual plant output, as shown in Fig. 3.

Fig. 5. Trajectory of input u(t)


Fig. 3. Comparison between the actual plant output and the MATLAB model
output

In Fig. 3, the actual plant output is represented by the red


line, and the MATLAB model output is represented by the blue
line. From Fig. 3, it can see that the raw sensor readings of the
actual output have a lot of noise, resulting from the frequent
changes in the angular velocity of the disk. The output from
our model, on the other hand, is very stable and gives precise
values of the angular velocity at each point. Thus, due to these
reasons, it is much preferable to use our model rather than the
raw sensor readings.

Fig. 6. Trajectory of output x(t)

A steady state gain of K = 23.24 was obtained by


evaluating (10):
x̄ss
K= (10)
ūss

A time constant of τ = 0.0040 was obtained by computing


the difference between the time taken for the output to achieve
63% of the reference value, and the time at which the step
instigated.
Consequently, the equation for the closed-loop system out-
put is given by (11):

(t−1)
x(t) = Ku(1 − e− τ ) (11)

A settling time of 1.05s was observed utilizing the closed-


Fig. 9. Trajectory of output x(t) for open-loop and closed-loop controllers.
loop controller. Compared to the settling time of 1.46s ob-
served utilizing the open-loop controller, it can be concluded
that the closed-loop controller provides a lower settling time Comparing the open-loop and closed-loop response for the
and is thus preferred. input u(t) as shown in fig 8, it can be observed that the closed-
loop input shows significantly more variation than the open-
B. Disturbance Rejection loop input. This is attributed to the closed-loop input being
continuously altered by the feedback loop.
The disturbance signal is connected in Simulink as shown
in fig 7. However, as shown in fig 9, this allows the closed-loop
system to better handle the disturbance than the open-loop
system; keeping it consistently more closer to the reference
value.
The reason why the closed loop control can handle the
disturbance can be analytically explained by writing out the
responses of the system with a closed loop and an open loop.
The open loop system response has already been calculated in
Lab 1 and is shown in (5). It can be seen that the steady state
value would be KmDU0 and this value is affected by the change
in u0 . The disturbance basically change u0 into u0 + d and
that’s why the difference in value is observed in Fig. 9 for the
Fig. 7. Closed-loop controller connection in Simulink with an additional
external disturbance signal.
open loop system. For the closed loop system, the input is no
longer u0 but Kp (u0 − x(t)). Therefore, the response of the
system can be rewritten into (12) with x0 = 0.
Fig 8 and 9 show the trajectories of the input u(t) and
the output x(t) respectively, for open-loop and closed-loop
Km Kp u0 −( D+Km Kp t) Km Kp u0
controllers. x=− e J + (12)
Km Kp + D Km Kp + D

K K u
Now that the steady state response would be KmmKpp+D 0
. If the
disturbance is now added into the system, the steady state
K K u0
response would be KmmKpp+D + Km Kdp +D , where d is the
disturbance. If the value of Kp is large enough, the value of
d
Km Kp +D will become negligible and the steady state value
would be close to u0 , or reference value r. This proves
analytically why closed loop response can eliminate the effects
of disturbance with the right controller gain.

C. Open Loop Frequency Response

The open-loop frequency response is connected in Simulink


Fig. 8. Trajectory of input u(t) for open-loop and closed-loop controllers. as shown in fig 10:
Fig. 10. Closed-loop controller connection in Simulink with an additional
external disturbance signal.

Fig. 13. Trajectory of 50Hz sine-wave input u(t) and output x(t)

Fig 11, 12 and 13 show the trajectories of the output x(t) The output amplitude Aout , gain G, and approximate phase
with 0.5Hz, 5Hz, and 50Hz sine-wave inputs respectively. shift ϕ for each input frequency fin are summarized in Table
I.

TABLE I
O PEN L OOP F REQUENCY R ESPONSE

fin (Hz) Aout (rad) G (rad/V) ϕ (◦ )


0.5 7.208 7.208 110
5 0.466 0.466 170
50 0.046 0.046 175

The transfer function for the system frequency response


with complex conjugate poles is shown by (13).
1
G(jω) = (13)
−ω 2 + 2ζωn ωj + ωn2
The steady-state response of the system described by (13)
is given by (14).

Fig. 11. Trajectory of 0.5Hz sine-wave input u(t) and output x(t)
xss (t) = AM cos (ωt + ϕ) (14)
Where the magnitude and phase are given by (15) and (16)
respectively.
s
1
M = |G(jω)| = (15)
(ωn2 − ω 2 )2 + (2ζωn ω)2
2ζωn ω
ϕ = ∠G(jω) = arctan − (16)
ωn2 − ω 2
It can be observed from considering (16) that as ω → ∞,
ϕ → 180◦ ; explaining why the values for ψ in Table I increase
with increasing fin .

Fig. 12. Trajectory of 5Hz sine-wave input u(t) and output x(t)
III. L AB 3 P OSITION C ONTROL

A. Physical System Description


For this lab session, the position q(t) of a system is
described by the following second order differential equation,
(17):

J q̈(t) + dq̇(t) + kq(t) = km u(t) (17)

Where J = 0.1175, d = 1 and km = 23.2. Note that these


Fig. 14. P controller connection in Simulink.
values are different from the data given in the question. The
reason why these specific values are chosen is because the With kP = 1.0 and r0 = π. The trajectory of the angular
system given in the Simulink has the transfer function shown position is shown in fig 15.
as (18).
23.2
G(s) = (18)
0.1175s2 + s

This transfer function shows that the actual values for J, d


and km are not the ones given in the question description.
For consistency, our group decided to used the data that was
provided in the Simulink file instead of the values in the
question description.
We can write (17) as an open-loop system in the form
ẋ(t) = Ax(t) + Bu(t), as shown by (19):
      
q̇ 0 1 q 0
= + km u (19)
q̈ − Jk − Jd q̇ J

Fig. 15. Trajectory of angular position with P controller, and ’naughty hand’
We can also write (17) as a closed-loop system with a engaged.
proportional-derivative (PD) controller in the form ẋ(t) =
ACL x(t) + BCL r(t) by defining u(t) = Ke(t) = K(r(t) − Despite having the ’naughty hand’ engaged, which sim-
x(t)); where r(t) = [r0 0]′ , K = [kP kD ], and ACL and ulates turning the disk with an external force, the steady-
BCL are given by (20) and (21) respectively. state output still converges to the reference value of r0 = π.
Consequently, the spring constant k must equal 0 to facilitate
 
0 1 the steady-state response observed, even when the system is
ACL = (20)
− k+kJm kP − d+kJm kD subjected to an external disturbance.
To compute the poles of the closed-loop system, we let
  |sI − ACL | = 0, and evaluate the poles as s = −4.26 + 13.39i
0 0 and s = −4.26 − 13.39i.
BCL = km kP km kD (21)
J J C. Proportional-Derivative (PD) Control
The PD controller is connected in Simulink as shown in fig
For a proportional (P), or derivative (D) controller we let
16.
kD = 0, or kD = 0 respectively.
For a proportional-integral-derivative (PID) controller we
redefine e(t) as a scalar signal, and so a PID controller has
the form expressed by (22):
Z τ
de
u = kP e + kD + kI e(t) dt (22)
dt 0

B. Proportional (P) Control


The P controller is connected in Simulink as shown in fig
14. Fig. 16. PD controller connection in Simulink.
With kP = 1.0, kD = 0.1 and r0 = π. The trajectory of
the angular position is shown in fig 17.

Fig. 19. Trajectory of angular position with PID controller, with and without
integrator windup.

Fig. 17. Trajectory of angular position with PD controller. Integrator windup is a phenomenon that can be demon-
strated by simulating holding the disk in the first 1.5 seconds.
It can be observed that with integrator windup implemented,
the PID controller acts in an open-loop as the feedback loop
To compute the poles of the closed-loop system, we let has been broken. kI , and the output with it, will continue to
|sI − ACL | = 0, and evaluate the poles as s = −12.66 and increase until it becomes saturated wherein it will return to
s = −15.59. acting in a closed-loop.
Since the poles have negative real parts with no imaginary Integrator windup can be avoided by back calculating kI
parts, the system can be considered stable as shown in fig 17, to constrain the output within reasonable bounds [1]. Alter-
with considerably less oscillatory behaviour than that which natively, the method of condition integration allows integrator
was observed in fig 15. windup to be avoided by disabling the integrator component
of the controller until the output has stabilized somewhat [1].
The trajectory of the angular position when kD and kI are
kept constant with varying kP is shown in fig 20.

D. Proportional-Integral-Derivative (PID) Control

The PID controller is connected in Simulink as shown in


fig 18.

Fig. 20. Trajectory of angular position with PID controller, with varying kP .
Fig. 18. PID controller connection in Simulink.

By considering fig 20 it can be observed that higher values


With kP = 1.0, kD = 0.1, kI = 0.1 and r0 = π. The of kP correspond to lower overshoot values.
trajectory of the angular position without, and with integrator The trajectory of the angular position when kP and kI are
windup, is shown in fig 19. kept constant with varying kD is shown in fig 21.
IV. L AB 4 C RANE D ESIGN TASK

A. Physical System Description


For this lab session, a controller design is proposed to rotate
a specified crane to designated angles within a reasonable pe-
riod of time. The linearised system which describes the rotary
motion of the crane can be described using two differential
equations, shown as (23) and (24).

1 1
θ̈ = (−(Jp + mp L2p )(Dr θ̇ + kθ)+
JT 4 (23)
1 1 1
mp Lp Lr Dp α̇ + m2p L2p Lr gα + (Jp + mp L2p )τ )
2 4 4
Fig. 21. Trajectory of angular position with PID controller, with varying kD .
1 1
By considering fig 20 it can be observed that higher values α̈ = ( mp Lp Lr (Dr θ̇ + kθ) − (Jr + mp L2r )Dp α̇
JT 2 (24)
of kD correspond to increased settling times. 1 1
− mp Lp g(Jr + mp L2r )α − mp Lp Lr τ )
2 2
In (23) and (24), JT and τ are calculated using (25) and
(26).

1
JT = Jp mp L2r + Jr Jp + Jr mp L2p (25)
4

Kt
τ= u (26)
Rm

The values of the physical parameters are listed in Table II.

TABLE II
VALUES OF P HYSICAL PARAMETERS

Parameter Value Unit


mr 0.095 kg
mp 0.024 kg
Lr 0.085 m
Lp 0.129 m
Jr 5.7 × 10− 5 kgm2
Jp 3.3 × 100 5 kgm2
Kt 0.042 N m/A
Rm 8.40 Ω
Dr 0.0015 N ms/rad
Dp 0.0004 N ms/rad
k 0.0008 N m/rad
g 9.81 m/s2

The original system is quite complex in its current form.


To simplify the equations, the coefficients A to J are used.
The coefficients A to J combine the physical parameters in
the original system. The values of the coefficients A to J are
listed in Tab. III. The simplified equations can be written as
(27) and (28).

θ̈ = Aθ̇ + Bθ + C α̇ + Dα + Eu (27)

α̈ = F θ̇ + Gθ + H α̇ + Iα + Ju (28)
TABLE III an estimation of the crane’s rotational speed is made based
VALUES OF COEFFICIENTS IN THE PHYSICAL SYSTEM EQUATIONS on research. The rotation speed of the crane is assumed to be
Coefficients Values around 0.6 RPM [2]. Since the four reference points are given,
A -14.9889 the maximum turning angle is 90◦ . With this RPM, the crane
B -7.9941 should be able to complete the turn the maximum angle in
C 3.9590
D 150.3005 25s. The settling time is set to be 40s to account for errors
E 49.9631 and instability. Considering the fact that the rotational arm
F 14.8461 of the crane is quite long, even a moderate overshoot may
G 7.9179
H -6.9322 still cause the arm to travel a considerable distance before
I -263.1801 stopping at the reference value, and this could potentially be
J -49.4869 dangerous. Therefore, the overshoot is set to be 2% to ensure
that the rotation is safe. With the settling time and rotational
The state of the system can be written into a vector form: speed determined. The dominant poles can be calculated.
 T
x = θ α θ̇ α̇ . The system can be written as ẋ(t) =
4 4
Ax(t) + Bu(t), as shown in (29), σ= = = 0.1 rad/s (33)
       ts 40
θ̇ 0 0 1 0 θ 0 s s
α̇  0 0 0 1  α  0  ln Mp 2 ln 0.022
 =
 θ̈  B D A C   θ̇  + E  u (29) ζ= = = 0.7797 (34)
   
ln Mp 2 + π 2 ln 0.022 + π 2
α̈ G I F H α̇ J
B. Controller Design σ 0.1
ωn = = = 0.1283 rad/s (35)
Now that the physical system is determined, the controller ζ 0.7797
design can be done by following general procedure. First, the p p
ωd = ωn2 − σ 2 = 0.12832 − 0.12 = 0.0803 rad/s (36)
system should be checked for reachability. The W matrix can
be obtained from A and B as shown in (30). With σ and ωd determined, the first two poles can be written
W = B AB A2 B A3 B as: P1 = −σ + ωd i = −0.1 + 0.0803i, P2 = −σ − ωd i =
 

0 49.96 −944.8 1.062e4
 −0.1 − 0.0803i. The remaining poles are less dominant and
 0 −49.49 1.085e3 −8.127e3 (30) their settling time has been set to be 10 times the settling time
=  49.96 −944.8 1.062e4 −2.074e4
 of the dominant poles. The damping ratio of the remaining
−49.49 1.085e3 −8.127e3 −7.899e4 poles has been set to 0.9 so that they have very low overshoot.
With similar calculations, the less dominant poles are deter-
W has full rank and the system is reachable. The next step mined: P3 = −1 + 0.4843i, P4 = −1 − 0.4843i. These poles
is to find the reachable canonical form z = Ãz + B̃u. Ã can now represent the eigenvalues of the system after the controller
be found by calculating the eigenvalues of the A. Ã should is applied. Therefore, similar method can be used as shown in
have the same eigenvalues as A. The eigenvalues of A are: (31). The new characteristic equation can be written as (37),
λ1 = −6.7244 + 12.3501i, λ2 = −6.7244 − 12.3501i, λ3 = where p1 = 2.2, p2 = 1.651, p3 = 0.2798, p4 = 0.0203,
−7.8863, λ4 = −0.5860. With the eigenvalues determined, it
is possible to write det(SI − Ã) as (31). p(s) = (s − P1 )(s − P2 )(s − P3 )(s − P4 )
(37)
= s4 + p1 s3 + p2 s2 + p3 s + p4
det(SI−Ã) = (s − λ1 )(s − λ2 )(s − λ3 )(s − λ4 )
(31)
= s4 + a1 s3 + a2 s2 + a3 s + a4 With the new characteristic equation determined, K̃ can be
The values of a1 , a2 , a3 and a4 can be determined by the calculated as shown in (38).
eigenvalues. Since à is in canonical form, it can be directly K̃ = k˜4 k˜3 k˜2 k˜1
 
written as (32), where a1 = 21.9211, a2 = 316.3059, a3 =  
1737.5, a4 = 913.8196. = p4 − a4 p3 − a3 p2 − a2 p1 − a1 (38)
 
  = −913.80 −1.74e3 −314.65 −19.72
0 1 0 0
 0 0 1 0  With K̃ determined, the last step is to transform K̃ back to
à =   (32)
 0 0 0 1  K. The transformation matrix T can be calculated with W
−a4 −a3 −a2 −a1 and W̃ , as shown in (39) and (40).
 
B̃ can be directly written basedT on the definition of W̃ = B̃ ÃB̃ Ã2 B̃ Ã3 B̃
canonical form. B̃ = 0 0 0 1 . The next step is to
 
0 0 0 1
calculate the poles. To determine the dominant poles , the 0 0 1 −21.9211 (39)
estimated system specifications need to be determined. Since = 
0 1 −21.9211 164.2309 
no information is provided on the specifications of the crane, 1 −21.9211 164.2309 1.5962e3
T = W̃ W −1
 
1.75e-4 1.63e-4 −4.61e-6 −4.66e-6
−4.34e-19 5.32e-4 1.75e-4 1.77e-4  (40)
= 
−6.94e-18 −0.0202 2.60e-18 2.71e-18 
1.11e-16 1.67e-16 −2.26e-17 −0.0202

With T determined, K can be transformed from K̃ as shown


in (41).
 
K = −K̃T = 0.1600 −5.2850 0.3000 −0.0957 (41)

The first two terms in K can be considered to be proportional


controllers controlling θ and α and the last two terms in K
can be considered to be derivative controllers controlling θ̇
and α̇. Now that the K determined, the input u can be written
as u = −Kx. Since the main objective is to rotate the crane Fig. 23. Variation of angle θ over time
to a certain angle θ. The output of the system can be written
as (42).
 
y = Cx = 1 0 0 0 x (42)

The steady state error in the system also needs to be consid-


ered. For that, either designing a KI or kr is possible. Given
that in this system, A, B and C is known precisely, a Kr
design is more straight forward. kr can be calculated as shown
in (43).
−1
kr = = 0.32 (43)
C(A − BK)−1 B
With kr , the system input u can now be written as (44).

u = −Kx + kr r (44)

Now the controller is set and how the controller affects the
input is known, it is now possible to test the system. The
controller is connected in the Simulink as shown in Fig. 22.

Fig. 24. Variation of angle α over time

Fig. 22. Controller connection in Simulink

C. Results & Discussion


When the controller is connected to the system, the resultant
outputs of the system are shown in Fig. 23 to to Fig. 26. Since
controlling θ is the objective of the system, the results shown
in Fig. 23 are the most critical. Based on Fig. 23, it can be seen
that system and the controller design succeed in reaching the
designated reference value. The system is able to reach the
reference value in a reasonable time period and the system
function properly with the change in reference value. Fig. 25. Variation of angle θ̇ over time
R EFERENCES
[1] K. Astrom and L. Rundqwist, ”Integrator windup and how to avoid it”,
1989.
[2] D. Ilir and H. Beqir, Studying rotational motion of luffing boom
cranes with maximum load using simulations, International Journal
for science, technics and innovations for the industry - MACHINES
TECHNOLOGIES MATERIALS, vol. 1, 2015, pp. 20

Fig. 26. Variation of angle α̇ over time

Additional information provided by Fig. 24 to Fig. 26


suggest that other values in the system tend to reach zero
when the system stabilises. This further proves that the system
is working. However, there are some issues with the current
controller. From the original controller design, the settling time
of the system should be 40 seconds. From the results, it can
be seen that the actual output reaches the reference values
in around 5 to 10 seconds based on the difference in value
between the reference value and the initial value. It can be seen
from Fig. 25 that the rotational velocity of the crane arm can
reach 40 or -30 degrees per second, which is a bit unrealistic
for a large crane. However, this rotational speed may be
acceptable for a small crane. This problem cannot be simply
fixed by only adjusting the settling time as it can be seen
that there is a large difference between the designed settling
time and the actual settling time. Many reasons could have
caused this difference in settling time. Apart from calculation
errors, one potential source may be the effects of the less
dominant poles since in this system there are more than two
poles. Though the rest of the poles are less dominant and
designed accordingly, they might still influence the controller’s
performance. The overshoot of the system is satisfactory as it
can be seen that there is almost no overshoot in the output
of θ and the overshoots in the outputs of other values are
considerably small. Though potential zeroes might cause the
system to overshoot more, based on the current results, the
overshoot performance of the controller is acceptable. Overall,
the current controller should work well if the rotational angle
is small or if the crane has the ability to perform a quick
turn. To improve the controller, the next step would be to
adjust the settling time to make sure that the crane rotational
speed is reasonable. Another way to approach this settling time
problem may be using rise time instead of settling time to
determine the poles of the controller. Also, the system should
be further tested in a scenario where noise and disturbance
occur for its robustness. Additional controller terms may need
to applied to make the system robust and more stable.

You might also like