0% found this document useful (0 votes)
3 views

Automatic Control System - Final Project

The document is a final project report for a course on Automatic Control Systems at HCMC University of Technology and Education. It covers basic concepts of control systems, mathematical models, transient response, and stability analysis, including practical examples and simulations using MATLAB. The project includes tasks such as defining control systems, analyzing closed-loop and open-loop systems, and simulating various control scenarios.

Uploaded by

22142002
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Automatic Control System - Final Project

The document is a final project report for a course on Automatic Control Systems at HCMC University of Technology and Education. It covers basic concepts of control systems, mathematical models, transient response, and stability analysis, including practical examples and simulations using MATLAB. The project includes tasks such as defining control systems, analyzing closed-loop and open-loop systems, and simulating various control scenarios.

Uploaded by

22142002
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

HCMC University of Technology and Education

Faculty of international education

Course: Automatic Control System

Final Project
Lecture: Vu Van Phong

Name : Trần Lê Tuấn Anh


Student ID: 22142002
Birth: 07/08/2004
Major: Electrical Electronic Egineering

Name: Trần Bá Thiên


Student ID: 22151040
Birth: 10/03/2004
Major: Control and Automatic Egineering
Task 1: Basic Concepts of the Automatic Control System
1.1
1.1.1 Please provide the definition of control and automatic control and
give a real specific example of automatic control.

The definition of a control system is a system of devices which manually adjusts,


regulates, and manages the behavior of other devices to achieve a desired output.
The definition of an automation control system is also a control system, but the
output of devices is controlled automatically to meet the desired setpoint.
A specific example of an automation control system: An air conditioner- an air
conditioner functions depending on the temperature of the room.

1.1.2 Please describe the structure of a typical automatic control


system. Please list the typical components and their function.

The structure of a typical automatic control system

Set-point: Set-point is an input variable that an automation control system tries to


achieve to get a desired result.

Controller: Controller is the device or algorithm that compares the measured


process variable to the set point and calculates the error signal. Based on this error
signal, the controller generates the control signals to the actuator.
Actuator: Actuator is the device that causes the process to provide the output. It is
the device that provides the motive power to the process.
Process variable: This is the physical quantity that is being controlled, such as
temperature, pressure, or position...

Sensor: This is a device that measures the process variable and provides input to the
control system.

Disturbance: This is an external element that causes undesirable effects on the


operation of system.

Actual output: Actual output is an actual result after ending of procedure of the
system.

1.1.3 What is the difference between a closed-loop and an open-loop


system? Please provide practical examples for closed-loop and open-
loop systems.

(a) closed-loop system, (b) open-loop system.

A close-loop system: A closed-loop control system in which input is dependent on


output of the system. It means that the input quantity will adjust itself based on the
output generated. Example: Water level controller, Cooling system in car, An air
conditioner.
An open-loop system: An open-loop control system in which input is totally
independent of output of the system. A manual control system or timer is also an
open-loop control system. Example: Electric hand drier, Light switch, Timer based
clothes drier.
1.1.4 Consider the temperature control system in Figure 1.1.4.1, please
list the components, and make a block diagram of this system. Is it an
open-loop or closed-loop system?

Temperature control of the fish tank


o
Set-point: 30 C.
Sensor: Water temperature sensor in the tank.
Disturbance: Environment temperature.
Actuator: Heater in the tank.
Controller: Thermostat. Environment
temperature
Process: Water temperature.

Set-point=30oC Actual
temperature
Thermostat Heater Water
temperature

Temperature
sensor

Block diagram of the temperature control system


 It is a closed-loop system.
Task 2: Mathematical Models of the Control System
2.1 Find Mathematical Models of the Mechanical and Electrical System
2.1.1 For a given Spring-Mass-Dashpot system in Figure 5.
Spring-Mass-Dashpot system

M1 and M2 are the mass; K1, K2, and K3 are the spring constants, and f v3
is the viscous friction coeffection of the dashpot. X 1(t) and x2(t) are the
displacement of mass M1 and M2 respectively and are output. f(t) is the
input.
2.1.1.1 Find the transfer function of the system.
X1 X2
*M1: *M2
Fk1 Fd Fd
Fk3
Fo M1 Fk2 Fk2 M2

2.1.1.2 Simulate this system by MATLAB with f=1; M1=1kg; M2=1.5kg;


K1=0.1; K2=0.2; K3=0.1; fv3=0.15;
m1=1; m2=1.5; k1=0.1; k2=0.2;k3=0.1; fv3=0.15;
M2=tf([fv3 k2],[m1*m2 fv3*(m1+m2)
m1*k2+m1*k3+m2*k1+m2*k2 k1*fv3+k3*fv3
k1*k2+k1*k3+k2*k3]);
M1=tf([m2 fv3 k2+k3],[m1*m2 fv3*(m1+m2)
m1*k2+m1*k3+m2*k1+m2*k2 k1*fv3+k3*fv3
k1*k2+k1*k3+k2*k3]);
hold on
step(M1)
step(M2)
grid on
ylabel('Displacement (m)')
title('The displacement of mass M1 and M2 of Spring-
Mass-Dashpot system')

The displacement of mass M1 and M2 of Spring-Mass-Dashpot system


12
M1
M2
10

8
Displacement (m)

-2
0 0.5 1 1.5 2
Time (seconds) 10 4

The displacement of mass M1 and M2 of Spring-Mass-Dashpot system

 In conclusion: When object M1 is pushed by Fo, it moves forward


first and pressures on M2 moving forward through spring. After
that, those are pulled by the force acting of springs and
dampers. Procedure
Is repeated continuously until those stop at the specific
displacement
( M1 at 6(m) and M2 at 4(m) ) from initial position of those after
20000s.
2.1.2 For the circuit as follows in Figure 7.

Electrical system

2.1.2.1 Determine the transfer function of the above system in which v i ( t )


is the input voltage and v o ( t ) is the output voltage.

S 3S 2/S

There are three equations:


2.1.2.2 Simulate this system by MATLAB/Simulink using sine wave v i ( t ) .

Block diagram of the system in MATLAB


The value of Vin and Vout of the electrical circuit system
 In conclusion: The output voltage peak-peak is a quarter of the input voltage
peak-peak in phase with phase shift equals 0. So, the voltage gain equals ¼.
2.2 Block diagram.
The block diagram of the position-control system of an electronic word processor is
shown.

Position-control system of an electronic word processor


θ r (s)
2.2.1 Please find the transfer function G ( s )= θ (s) of the above system.
o

2.3. Using MATLAB to find the closed-loop transfer function.


Consider a closed-loop system as follows in Figure.

R(s) C(s)
+
G(s)
-

H(s)

A closed-loop control system.


where
1 1
G ( s )= , H ( s )=
2
s +s +5 s+2
2.3.1 Determine the closed-loop transfer function of the above system
manually.

2.3.1 Using MATLAB software, determine the transfer function of the


closed-loop systems.

Transfer function of the closed-loop systems by using MATLAB.

 In conclusion: Transfer function of the closed-loop systems by using MATLAB is


the same the transfer function determined manually.
2.4 State-space equation
Consider a system illustrated in Figure 2.4. e(t) is the voltage input; and i 2 (t) is the
output.

An electrical circuit system.


2.4.1 Please determine the mathematical model under the state-space
equation with x 1 ( t )=i 1 (t ) , x2 ( t )=i 2 ( t ) , x 3 ( t )=ec ( t ).

2.4.2 Please simulate the system using MATLAB/Simulink with inputs are
step signal R1 = 1, R2 = 1, L1 = 1, L2 = 1, C = 1.

Block diagram of the system in MATLAB


The relationship between Vin and i2 of the electrical circuit system
 In conclusion: With the step signal ( V in=2V ) at 0 step time, the
current i2 gets the value of 1A.
Task 3: Transient Response and Stability Analysis
3.1. Analyze the behavior and response of the first-order system as follow:

G(s)
1
where G ( s )= , a is the last number of your student ID (if your last number of the
4 s+ a
student ID is zero, please select a=2).

3.1.1 Determine the settling time with 5% criterion.

3.1.2 Simulate the system in MATLAB with a unity step signal.


*Code:
G=tf(1,[4 4]);
T=tf([1],[1]);
hold on
step(T)
step(G)
legend('Input','Actual ouput')
grid on
The value of input and actual output of the first-order system
=> In conclusion: With %5 criterion, the settling time of the first-order system is exactly 3
seconds by using MATLAB, which is as same as the value of the settling time determined
manually.

3.2 Consider the Hubbe Space Telescope is modeled in Figure 3.2. Analyze
the behavior and response of this system.
The block diagram of the system
3.2.1. Ignore the effect of the disturbance, please determine the transfer
function between Y(s) and R(s).

3.2.2. Find K and K1 such that the overshoot is 15%, settling time with 5%
criterion is 4s.
There is a 2nd order function.

We have:

3.2.3. With obtained K and K1, please find the steady state error with the
unity step signal.
3.2.4. Simulating the system in MATLAB with input is a unity step signal.
*Code:
Q=tf([2.1025],[1 1.49 2.1025]);
T=tf([1],[1]);
hold on
step(T)
step(Q)
legend('Input','Actual ouput')
grid on

The value of input and actual output of the second-order system

*Code:
Q=tf([2.1025],[1 1.49 2.1025]);
T=stepinfo(Q,'SettlingTimeThreshold',0.05);

The behavior and response of this system.


=> In conclusion: Using MATLAB, with 5% criterion, the settling time is 3.65s, which is
faster than the settling time given (4s). The resulting overshoot is as same as the
overshoot given (15%). The steady-state error equals 0 represented on the figure 3.2.4.1.

3.3 Take into account the following system as shown in Figure 3.3.

+ s+5
2
R(s) 2 s + 4 s+3 C(s)
-
1
s +1

Block diagram of the system

3.3.1. Find the poles and zeros of the closed-loop system in Figure 15.
*Closed-loop equation:
3.3.2. Plot the poles and zeros on the complex plane using MATLAB.
K=tf([1 5],conv([2 4 3],[0 1 1]));
pzplot(K)
grid on

Plot the poles and zeros on the complex plane using MATLAB.

3.3.3. Based on the position of poles on the complex plane, please check
the stability of the system.
System is stable because all poles locate on left hand side complex plane.
3.3.4. Simulate the system with unity step input by MATLAB/Simulink.
Analyze the obtained results.
*Code:
G=tf([1 6 5],[2 6 8 8]);
H=tf([1],[1]);
hold on
step(H)
step(G)
legend('Input','Actual ouput')
grid on
T=stepinfo(G,'SettlingTimeThreshold',0.05);

The value of input and actual output of the system


The behavior and response of this system.
Overshoot: 55% In conclusion: POT is high (55%), settling time is low (6.63s),
Rise time: 0.64 (seconds) steady-state error equals 0,375 but the system which is stable is
as same as inclusion of positions of poles. These can’t make the
Settling time (5%): 6.63 (seconds) system get the best quality. PID controller need to be installed
to improve the quality of system. In real-life, it’s up to the
Steady-state error: 0.375 system that we will decide which values to improve.
3.4 Consider the Disk Drive Read System in Figure 3.4.

Disk drive read system

Motor and Arm


+
Gp(s) G(s)
-
C(s)
R(s)
Block diagram
where

Km
G ( s )=
s ( Js +b ) (Ls + R)
G P ( s )=K p

Table of The parameters of a DC motor

3.4.1. Please determine the conditions of parameters of P controller such


that the system is stable according to the Routh-Hurwirtz criterion.
*Closed-loop equation:

*Characteristic equation:
The system is stable if:

3.4.2. Select two values of Kp, one satisfies the Routh-Hurwirtz condition
and another is not, then using Matlab to simulate above system with two
values of Kp. The input signal is unity step input signal. Based on the
simulation results, please evaluate the stability of the system with P
controller when the parameter of P controller is determined based on the
Routh-Hurwirtzcriterion.
With Km=50:
*Code:
G=tf([5],conv([1 20 0], [0.001 1]));
K=50;
H=series(G,K);
Q=feedback(H,1);
D=tf([1],[1]);
hold on
step(D)
step(Q)
legend('Input','Actual ouput')
grid on
T=stepinfo(Q,'SettlingTimeThreshold',0.05);

Step Response
1.2
Input
Actual ouput
1

0.8
Amplitude

0.6

0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6
Time (seconds)

The value of input and actual output of the Disk Drive Read System with Km =50.

With Km=5000:
*Code:
G=tf([5],conv([1 20 0], [0.001 1]));
K=5000;
H=series(G,K);
Q=feedback(H,1);
D=tf([1],[1]);
hold on
step(D)
step(Q)
legend('Input','Actual ouput')
grid on
T=stepinfo(Q,'SettlingTimeThreshold',0.05);
1027 Step Response
8
Input
6 Actual ouput

2
Amplitude

-2

-4

-6

-8

-10
0 5 10 15 20 25 30
Time (seconds)

Figure 3.4.2.2: The value of input and actual output of the Disk Drive Read System
with Km =5000.

Km=50 Km=5000

Comparing the behavior and response of this system between


Km=50 and Km=5000.
Based on the simulation results, we observe that the value of Km is higher than 0 and
lower than 4080, which make the system good quality with parameters: POT is slow,
settling time is fast, steady-state error is nearly 0, system is stable at steady-state while
the value of Km is out of range making final value, rise time…. not to be determined, the
system is unstable at steady state.

Task 4: PID controller design


4.1 Please explain.
4.1.1 What is a PID controller?
A PID controller is a closed-loop system used in an automation system (SISO only)
to regulate the output of the system by computing the error signal based on comparing
the process variable (feedback variable) with set point.

4.1.2 The roles of the P, I, D of PID control in the control system.


Proportional (P) response: Term ‘P’ is proportional to the actual value of error
e(t) [process value y(t) – set point r(t)]. The resulting error is multiplied with
proportionality gain factor (Kp) as shown in figure 4.1.2. Speed of response is also
directly proportional to proportional gain factor (Kp).
y(t) ∝ e(t)
y(t) = ki * e(t)

Integral (I) response: Term ‘I” is integrate (with respect to time) to the actual
value of the error. It is generally used to decrease the steady state error. Integral
controller action continues to change until error becomes zero.
y(t) ∝ ∫ e(t)
y(t) = ki ∫ e(t)

Derivative (D) response: Output of derivative controller is directly proportional


to the rate of change of error with respect to time as shown in equation. Generally,
derivative controller is used when processor variables starts oscillating or changes at a
very high rate of speed.
y(t) ∝ de(t)/dt
y(t) = Kd * de(t)/dt
None, P controller, PI controller, PID controller

4.2 Let us consider the following system.


R(s) C(s)
+
GPID(s) G(s)
-

Figure 4.2. Block diagram of the system

where

1
G ( s )= 2 and input R(s) is the unity step signal.
s +3 s +5
4.2.1 Let Ki=0, Kd=0, using the Simulink to simulate the system with Kp=1, 5, 10, 200,
based on these simulation results, please give comments on the effects of Kp on the
response of the system.
Block diagram of the system in MATLAB.

Figure 4.2.1.2: The effects of Kp on the response of the system


=> In conclusion: The value of Kp increases leading the steady-state error to decrease. Kp
Is increased, the settling time is also faster than if the overshoot does not exist. When
the value of Kp is much bigger than normal range, process variable starts fluctuating at
high rate and make system overshoot and be unstable.
4.2.2 Let Kp=10, Kd=0, using the Simulink to simulate the system with Ki=0.1, 1, 20, 50,
based on these simulation results, please comment on the effects of Ki on the response
of the system.

Block diagram of the system in MATLAB.


The effects of Ki on the response of the system.
=> In conclusion: With the PI controller, the value of Ki increases making the steady-state
error decreases to 0. However, Kp is big (Ki=20) making the system overshoot and still be
stable, but Kp is so big (Kp=50) making the system overshoot and be unstable at steady
state.
4.2.3 Let Kp=10, Ki=10, using the Simulink to simulate the system with Kd=0.1, 1, 5, 15,
based on these simulation results, please comment on the effects of Kd to the response
of the system.
Block diagram of the system in MATLAB.

The effects of Kd on the response of the system.


=> In conclusion, PID controllers improve the quality of system well. The value of Kd
increases gradually making the overshoot decrease and the system be more stable.

4.3 Consider a system in the following figure.

+
GPID(s) G(s)
-

Figure 4.3. Block diagram of the system

in which

1 1
G PID ( s )=K p (1+ +T D s) is PID controller and G ( s )= is the plant.
TI s s (s+2)(s+6)

4.3.1 Based on the Ziegler-Nichols method, determine the parameter of


the PID controller (Kp, TI, TD).
According to Ziegler-Nichols method:

Kcr is critical gain

Pcr is critical period


We choose s=jw:

Table 4.3.1: Ziegler Nichols Recipe -Second Method

Depending on table 4.3.1:

4.3.2 Simulate the system without and with the PID controller and evaluate these
simulation results.
*Code:
Kp= 57.6;
Ti=0.905;
Td=0.22625;
Ki=Kp/Ti;
Kd=Kp*Td;
Gpid=pid(Kp,Ki,Kd)
G=tf(1,conv([1 2 0],[1 6]));
T=feedback(Gpid*G,1);
D=feedback(G,1);
Q=tf([1],[1]);
hold on
step(Q)
step(T)
step(D)
legend('Input','Actual output with PID','Actual output
without PID')
grid on

Step Response
1.8
Input
Actual output with PID
1.6
Actual output without PID

1.4

1.2
Amplitude

0.8

0.6

0.4

0.2

0
0 10 20 30 40 50 60 70
Time (seconds)

The system without and with the PID controller


 In conclusion, without PID controller, the system does not exist overshoot,
steady-state error equals 0 but the settling time is so slow. With PID controller,
the system exists overshoot (60.6%) but the settling time is much faster than the
settling time of non-PID controller and steady-state error also equals 0.
4.3.3 If with the PID controller, the overshoot of the system is 40% or
more, please carry out the fine-tuning of the parameters of the PID
controller to reduce the overshoot is approximately 25%.
*Code:
Kp= 57.6;
Ti=0.905;
Td=0.22625;
Ki=Kp/Ti;
Kd=Kp*Td;
Gpid=pid(Kp,Ki,Kd+16.3)
G=tf(1,conv([1 2 0],[1 6]));
T=feedback(Gpid*G,1);
D=feedback(G,1);
Q=tf([1],[1]);
hold on
step(Q)
step(T)
step(D)
legend('Input','Actual output with PID','Actual output
without PID')
M=stepinfo(T,'SettlingTimeThreshold',0.05)
grid on

The parameters of PID controller include Kp=57.6, Ki= 63.6, Kd=29.3


The overshoot of system is 24.88%
=> In conclusion, the parameters of PID controller include Kp=57.6, Ki= 63.6, Kd=29.3
making the overshoot of system is 24.88%. The value of Kd increased will make the rate
of change of error with respect to time decrease leading to decrease percent of
overshoot.

4.4 Controller Design.


We choose the DC motor in Figure bellow.

Model of the DC motor with the inertial load

It is modelled in the following transfer function.


Structure of DC motor with the inertial load

where E a(s) is the input voltage, and Θ m (s) is the position (output). The parameters of the DC
motor are

Ra =2 , La =0.5 H , K i=0.15 , Bm =0.015 , K b=0.2 , Jm=0.02

4.4.1 Simulating the system with and without the PID controller by Matlab/Simulink
and

Block diagram of the system with and without the PID controller in MALAB
The system with and without the PID controller
4.4.2 Apply auto-turning of Matlab/Simulink, design PID controller
Auto tuner:

The actual output of the system after using PID auto-tune


Change the coefficient a little:

Update PID coefficient to the controller:


4.4.3 Compare the simulation result before and after using PID controller.
Block diagram of the system with/without PID controller

 Without the PID controller, the actual output of the system always increases and
strays from setpoint making the system be out of control. With the PID
controller, the quality of the system is perfect with the percent of overshoot is
low, the settling time is very fast and the steady-state error equals 0. The
system applied with a PID controller is sufficiently more reliable.
4.4.4 Design state feedback controller.
Pick a system:

[][ ][]
ẋ 1 0 1 0 0
ẋ 2 = 0 0 1 + 0 u
ẋ3 −4 −3 −2 4

[]
x1
y= [ 1 0 0 ] x 2
x3

System open loop poles are:


-1.6506 + 0.0000i
-0.1747 + 1.5469i
-0.1747 - 1.5469i
Respond of system with no state feedback controller.

To manipulate the system to have zero overshoot, I choose 3 poles that lie on the real axis
on the left side of imaginary axis.

Poles of close loop system:


-1.0000
-2.0000
-3.0000
Respond of system with state feedback controller.

Code script:
A = [0 1 0; 0 0 1; -4 -3 -2]
B = [0; 0; 4]
C = [1 0 0]
D = 0
model = ss(A,B,C,D)
poles = pole(model)
figure
step(model)
figure
rlocus(model)

p =[-1, -2, -3]


K = place(A,B,p)
Acl = A-B*K
modelcl = ss(Acl,B,C,D)
Pcl = pole(modelcl)
step(modelcl)
rlocus(modelcl)

END.

You might also like