0% found this document useful (0 votes)
9 views47 pages

Insturment Lab 3

This document is a report for Experiment 3 on Control System Design using MATLAB, submitted by Lew Xian Gang. It includes sections on the introduction to control systems, objectives, methodology, results, discussion, and conclusion. The report details the use of MATLAB for various control system analyses, including block diagram reduction and feedback systems.

Uploaded by

Dion Lim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views47 pages

Insturment Lab 3

This document is a report for Experiment 3 on Control System Design using MATLAB, submitted by Lew Xian Gang. It includes sections on the introduction to control systems, objectives, methodology, results, discussion, and conclusion. The report details the use of MATLAB for various control system analyses, including block diagram reduction and feedback systems.

Uploaded by

Dion Lim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 47

FACULTY OF ENGINEERING AND

QUANTITY SURVEYING (FEQS)

EEE4210 INSTRUMENTATION AND CONTROL

EXPERIMENT 3: CONTROL SYSTEM DESIGN


USING MATLAB

REPORT BY:

NAME MATRICULATION SECTION


NO

LEW XIAN GANG I20019803 8K1

LECTURER: ASSOC. PROF. DR. ARWINDER SINGH JIGIRI SINGH

SUBMISSION DATE: 1/10/2022

1
TABLE OF CONTENTS

Contents

TABLE OF CONTENTS..........................................................................................................................2

1. INTRODUCTION.......................................................................................................................3
1.1. Block Diagram of Control System......................................................................................3
1.2. Elements of Block Diagram.................................................................................................3
1.3. Block Diagram Reduction Rules – Control System..........................................................4
1.4. Block Diagram of Feedback System...................................................................................6

2. OBJECTIVES............................................................................................................................7

3. METHODOLOGY AND RESULTS.........................................................................................8

4. DISCUSSION............................................................................................................................31

5. CONCLUSION..........................................................................................................................47

6. REFERENCES..........................................................................................................................48

2
1. INTRODUCTION

1.1. Block Diagram of Control System

A system typically consists of several elements that work together to accomplish a certain purpose as a
whole. Different connected parts in a control system might direct or control another system or
themselves to produce a certain result (Block Diagram of Control System - Electronics Coach, 2022).

An analysis of a system becomes quite challenging when several entities are incorporated into a single
unit. Therefore, a control system block diagram is used to simplify the complexity of a complicated
system. A system's block diagram is nothing more than the connectivity of various system elements.
This system analysis is made simple by the interconnection of the blocks.

To simplify the system, a system's block diagram is created so that the transfer function approach can
be applied. By doing this, it was simple to identify the cause-and-effect connected between the system's
input and output.

1.2. Elements of Block Diagram

Functional Block

Functional block is a particular block represents the mathematical operation that was performed out by
that element on the input to produce the intended output. The transfer function of the block shows the
mathematical function of the element present as a block.

Figure 1.1 Functional Block (Block Diagram of Control System - Electronics Coach, 2022)

Summing Point

The summing point is the location in the block diagram representation where the various signals are
compared.

3
Figure 1.2 Summing point (Block Diagram of Control System - Electronics Coach, 2022)

Take-off Point

The take-off point is the location from which a portion of the output from a closed-loop system is sent
back into the input, which serves as feedback for the system.

Figure 1.3 Take-off point (Block Diagram of Control System - Electronics Coach, 2022)

1.3. Block Diagram Reduction Rules – Control System

There are certain set of rules that must be followed for a complicated block diagram such that the output
and feedback of the system were unchanged.

When blocks are joined in series, the transfer function of each individual block in the connection is
multiplied to create the overall transfer function of all the blocks.

For serially connected blocks

4
Figure 1.4 Block reduction for series connected blocks (Block Diagram Reduction Rules with Example
- Electronics Coach, 2022)

For parallely connected blocks

The transfer function of the entire system will equal the sum of the transfer functions of all the blocks if
the blocks are connected in parallel (considering sign).

Figure 1.5 Block reduction for parallel connected blocks (Block Diagram Reduction Rules with
Example - Electronics Coach, 2022)

5
1.4. Block Diagram of Feedback System

Positive Feedback:

A positive feedback system is the one in which the feedback signal is in phase with the reference input
signal. Thus, the two are combined, and the result serves as input for further system action. In a positive
feedback system, the two signals are summed to produce the consequent response, which raises the
system's total gain.

When there is positive feedback, the input signal's strength grows, which causes the system to respond
oscillatorily.

Figure 1.6 A positive feedback system (What is Feedback System? Block Diagram and Types of
Feedback - Electronics Coach, 2022)

Negative Feedback:

A negative feedback system is one in which the feedback signal is out of phase with the reference input.
The two signals are subtracted in order to create the difference signal because of their out of phase
connection. A decrease in overall gain results from the inclusion of negative feedback. Since the
disparity between the two numbers identifies the erroneous value that must be reduced in order to get
the intended value.

6
Figure 1.7 A negative feedback system (What is Feedback System? Block Diagram and Types of
Feedback - Electronics Coach, 2022)

2. OBJECTIVES

 Having studied this chapter, you will be able to:


 Describe how to change transfer function into state space equation and vice versa
 Reduce block diagram
 Plot impulse, step and ramp response
 Plot time and frequency domain graphs
 Design PID controllers

7
3. METHODOLOGY AND RESULTS

3.1.1(a)&(b)&(c)
tf2ss ss2tf
A] Matlab Code:
Matlab Code: %lewxiangang
%lewxiangang a=[-4 -5;1 0];
x=tf([5],[1 4 5]) b=[1;0];
[a b c d]=tf2ss([5],[1 4 5]) c=[0 5];
d=[0];
Matlab Answer: [n,d]=ss2tf(a,b,c,d);
tf(n,d)
>> %lewxiangang
x=tf([5],[1 4 5])
[a b c d]=tf2ss([5],[1 4 5]) Matlab Answer:
>> %lewxiangang
x= a=[-4 -5;1 0];
b=[1;0];
5 c=[0 5];
------------- d=[0];
s^2 + 4 s + 5 [n,d]=ss2tf(a,b,c,d);
tf(n,d)
Continuous-time transfer function.
ans =

a= 5
-------------
-4 -5 s^2 + 4 s + 5
1 0
Continuous-time transfer function.

b=

1
0

c=

0 5

d=

B] Matlab Code:
Matlab Code: %lewxiangang
%lewxiangang a=[-5 -6 -4;1 0 0;0 1 0];
x=tf([8],[1 5 6 4]) b=[1;0;0];
[a b c d]=tf2ss([8],[1 5 6 4]) c=[0 0 8];
d=[0];
[n,d]=ss2tf(a,b,c,d);
tf(n,d)
Matlab Answer:
>> %lewxiangang

8
x=tf([8],[1 5 6 4]) Matlab Answer:
[a b c d]=tf2ss([8],[1 5 6 4]) >> %lewxiangang
a=[-5 -6 -4;1 0 0;0 1 0];
x= b=[1;0;0];
c=[0 0 8];
8 d=[0];
--------------------- [n,d]=ss2tf(a,b,c,d);
s^3 + 5 s^2 + 6 s + 4 tf(n,d)

Continuous-time transfer function. ans =

8
a= ---------------------
s^3 + 5 s^2 + 6 s + 4
-5 -6 -4
1 0 0 Continuous-time transfer function.
0 1 0

b=

1
0
0

c=

0 0 8

d=

0
C] Matlab Code:
Matlab Code: %lewxiangang
%lewxiangang a=[-4 -8 -9;1 0 0;0 1 0];
x=tf([1 1],[1 4 8 9]) b=[1;0;0];
[a b c d]=tf2ss([1 1],[1 4 8 9]) c=[0 1 1];
d=[0];
Matlab Answer: [n,d]=ss2tf(a,b,c,d);
tf(n,d)
>> %lewxiangang
x=tf([1 1],[1 4 8 9])
[a b c d]=tf2ss([1 1],[1 4 8 9])
Matlab Answer:
x= >> %lewxiangang
a=[-4 -8 -9;1 0 0;0 1 0];
s+1 b=[1;0;0];
--------------------- c=[0 1 1];
s^3 + 4 s^2 + 8 s + 9 d=[0];
[n,d]=ss2tf(a,b,c,d);
Continuous-time transfer function. tf(n,d)

ans =
a=

9
s+1
-4 -8 -9 ---------------------
1 0 0 s^3 + 4 s^2 + 8 s + 9
0 1 0
Continuous-time transfer function.

b=

1
0
0

c=

0 1 1

d=

3.1.2(a)

Matlab Code:
%lewxiangang
G1=tf([10],[1]);
G2=tf([1],[1 0]);
G3=tf([1],[1 3]);
G4=tf([1 4],[1 10]);
G5=tf([4],[1]);
G6=tf([10],[1]);
G7=series(G1,G2);
G8=parallel(G3,G4);
G9=feedback(G7,G5,1);
G10=series(G9, G8);
G11=feedback(G10, G6);
tf(G11)

Matlab Answer:
>> %lewxiangang
G1=tf([10],[1]);
G2=tf([1],[1 0]);
G3=tf([1],[1 3]);
G4=tf([1 4],[1 10]);

10
G5=tf([4],[1]);
G6=tf([10],[1]);
G7=series(G1,G2);
G8=parallel(G3,G4);
G9=feedback(G7,G5,1);
G10=series(G9, G8);
G11=feedback(G10, G6);
tf(G11)

ans =

10 s^2 + 80 s + 220
---------------------------
s^3 + 73 s^2 + 310 s + 1000

Continuous-time transfer function.


3.1.2(b)

Matlab Code:
%lewxiangang
G1=tf([10],[1]);
G2=tf([1],[1 0]);
G5=tf([4],[1]);
G7=feedback(G1,G5,1);
G8=parallel(G7,G2);
tf(G8)

Matlab Answer:
>> %lewxiangang
G1=tf([10],[1]);
G2=tf([1],[1 0]);
G5=tf([4],[1]);
G7=feedback(G1,G5,1);
G8=parallel(G7,G2);
tf(G8)

ans =

-10 s + 39
----------
39 s

Continuous-time transfer function.

3.2.1

11
Matlab Code:
%lewxiangang
A=[-7 -30 -40;1 0 0; 0 1 0];
B=[1;0;0];
C=[2 11 5];
D=[0];
sys=ss(A,B,C,D);
subplot(2,1,1)
impulse(sys)
subplot(2,1,2)
step(sys)

Matlab Answer:
>> %lewxiangang
A=[-7 -30 -40;1 0 0; 0 1 0];
B=[1;0;0];
C=[2 11 5];
D=[0];
sys=ss(A,B,C,D);
subplot(2,1,1)
impulse(sys)
subplot(2,1,2)
step(sys)

3.2.2
Matlab code
%lewxiangang
a=tf([1.5 1],[1 2 2.5 0.5]);
pzmap(a)
grid on

Matlab answer
%lewxiangang

12
a=tf([1.5 1],[1 2 2.5 0.5]);
pzmap(a)
grid on

Pole-Zero Map
1.5 1.4
0.46 0.34 0.24 0.17 0.11 0.05
1.2
0.62 1
1
0.8
Imaginary Axis (seconds -1)

0.6
0.84
0.5 0.4
0.2

0.2
-0.5 0.4
0.84
0.6
0.8
-1
0.62 1
1.2
0.46 0.34 0.24 0.17 0.11 0.05
-1.5 1.4
-0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0
-1
Real Axis (seconds )

3.2.3
Matlab code

13
%lewxiangang
a=tf([1],[1 16.01 15.16 0.15]);
step(a)
damp(a)

Matlab answer
%lewxiangang
a=tf([1],[1 16.01 15.16 0.15]);
step(a)
damp(a)

Pole Damping Frequency Time Constant


(rad/seconds) (seconds)

-1.00e-02 1.00e+00 1.00e-02 1.00e+02


-1.00e+00 1.00e+00 1.00e+00 1.00e+00
-1.50e+01 1.00e+00 1.50e+01 6.67e-02

Step Response
7

5
Amplitude

0
0 100 200 300 400 500 600 700 800 900
Time (seconds)

3.3.1
Matlab code
%lewxiangang
a=tf([1 1],conv([1 0],conv([1 2],[1 4])));
rlocus(a)

Matlab answer
%lewxiangang
a=tf([1 1],conv([1 0],conv([1 2],[1 4])));
rlocus(a)

14
15
K=gain=1.51
3.3.2
Matlab code
%lewxiangang
a=tf([1 5],conv([1 1],conv([1 3-2i],[1 3+2i])));
rlocus(a)

Matlab answer
%lewxiangang
a=tf([1 5],conv([1 1],conv([1 3-2i],[1 3+2i])));
rlocus(a)

16
K = gain = 77.8

tan (theta) = (2.1-2)/(-2.5+3)

17
theta/angle =11.3 degree

3.3.3
Matlab code
%lewxiangang
a=tf(conv([1 5], [1 10]),conv([1 0 0],conv([1 20],[1 40])));
rlocus(a)

Matlab answer
>> %lewxiangang
a=tf(conv([1 5], [1 10]),conv([1 0 0],conv([1 20],[1 40])));
rlocus(a)

18
K1=183

K2=3500
K3=0

19
0-2/(0+0.482) = tan (theta)
Theta = -76.45 degree
Angle of departure = 180-76.45 = 103.55 degree

3.3.4
Matlab code
%lewxiangang
a=[0 1 0;-4 -2 1;0 0 -12];
b=[0;0;10];
c=[1 0 0];
d=[0];
sys=ss(a,b,c,d);
rlocus(sys)

Matlab answer
>> %lewxiangang
a=[0 1 0;-4 -2 1;0 0 -12];
b=[0;0;10];
c=[1 0 0];
d=[0];
sys=ss(a,b,c,d);
rlocus(sys)

20
Critical K=34.4

21
X= -1+j1.73
Y= 0+j5.29
tan(theta)=(5.29-1.73)/(0+1)
theta= 74.31 degree

3.4.1
MATLAB code
%lewxiangang
G=tf(400*[1 5],conv([conv([1,1],[1 3])],[1 12]))
subplot(3,2,1)
margin(G)
subplot(3,2,2)
nyquist(G)
subplot(3,2,3)
nichols(G)
subplot(3,2,4)
pzmap(G)
subplot(3,2,5)
rlocus(G)

MATLAB answer
>> %lewxiangang
G=tf(400*[1 5],conv([conv([1,1],[1 3])],[1 12]))
subplot(3,2,1)
margin(G)
subplot(3,2,2)
nyquist(G)
subplot(3,2,3)

22
nichols(G)
subplot(3,2,4)
pzmap(G)
subplot(3,2,5)
rlocus(G)

G=

400 s + 2000
------------------------
s^3 + 16 s^2 + 51 s + 36

Continuous-time transfer function.

23
The system is stable because pole zero map indicated all the poles at left hand side (-ve)

3.4.2
MATLAB code
%lewxiangang
G=tf(50*[1 5],conv([conv([1,-2],[1 8])],[1 15]))
subplot(3,2,1)
margin(G)
subplot(3,2,2)
nyquist(G)
subplot(3,2,3)
nichols(G)
subplot(3,2,4)
pzmap(G)
subplot(3,2,5)
rlocus(G)

MATLAB answer
>> %lewxiangang
G=tf(50*[1 5],conv([conv([1,-2],[1 8])],[1 15]))
subplot(3,2,1)
margin(G)
subplot(3,2,2)
nyquist(G)
subplot(3,2,3)
nichols(G)
subplot(3,2,4)
pzmap(G)
subplot(3,2,5)
rlocus(G)

G=

50 s + 250
-------------------------
s^3 + 21 s^2 + 74 s - 240

Continuous-time transfer function.

24
The system was unstable because the pole-zero map has one pole as a positive real number.

The critical gain was 0.958.

3.5.1
MATLAB code
%lewxiangang
% original
G=tf([1],[conv([1 0],[1 1])])
A=feedback(G,1);
tf(A)
step(A)
hold on

% with my PID controller


Kp=14.5;
Ki=0.05;
Kd=10;
% my PID controller
B=pid(Kp,Ki,Kd);
C=series(B,G);

25
D=feedback(C,1);
tf(D)
step(D)
hold off

MATLAB answer
>> %lewxiangang
% original
G=tf([1],[conv([1 0],[1 1])])
A=feedback(G,1);
tf(A)
step(A)

G=

1
-------
s^2 + s

Continuous-time transfer function.

ans =

1
-----------
s^2 + s + 1

Continuous-time transfer function.

26
>> %lewxiangang
% original
G=tf([1],[conv([1 0],[1 1])])
A=feedback(G,1);
tf(A)
step(A)
hold on

% with my PID controller


Kp=14.5;
Ki=0.05;
Kd=10;
% my PID controller
B=pid(Kp,Ki,Kd);
C=series(B,G);
D=feedback(C,1);
tf(D)
step(D)
hold off

G=

1
-------
s^2 + s

Continuous-time transfer function.

27
ans =

1
-----------
s^2 + s + 1

Continuous-time transfer function.

ans =

10 s^2 + 14.5 s + 0.05


----------------------------
s^3 + 11 s^2 + 14.5 s + 0.05

Continuous-time transfer function.

3.5.2
MATLAB code
%lewxiangang
% original
G=tf([10],conv([conv([1 0],[1 2])],[1 4]));
A=feedback(G,1);
tf(A)
step(A)
hold on

% with my PID controller


Kp=1.73;
Ki=0.05;
Kd=1;
% my PID controller
B=pid(Kp,Ki,Kd);
C=series(B,G);
D=feedback(C,1);
tf(D)

28
step(D)
hold off

MATLAB answer
>> %lewxiangang
% original
G=tf([10],conv([conv([1 0],[1 2])],[1 4]));
A=feedback(G,1);
tf(A)
step(A)

ans =

10
----------------------
s^3 + 6 s^2 + 8 s + 10

Continuous-time transfer function.

>> %lewxiangang
% original
G=tf([10],conv([conv([1 0],[1 2])],[1 4]));
A=feedback(G,1);
tf(A)
step(A)
hold on

% with my PID controller


Kp=1.73;

29
Ki=0.05;
Kd=1;
% my PID controller
B=pid(Kp,Ki,Kd);
C=series(B,G);
D=feedback(C,1);
tf(D)
step(D)
hold off

ans =

10
----------------------
s^3 + 6 s^2 + 8 s + 10

Continuous-time transfer function.

ans =

10 s^2 + 17.3 s + 0.5


-----------------------------------
s^4 + 6 s^3 + 18 s^2 + 17.3 s + 0.5

Continuous-time transfer function.

4. DISCUSSION

3.1.1
tf([]/[]) was used to show the transfer function of the differentiation equation.
Inside of the left bracket of tf([]/[]) stand for the numerator coefficient of ‘s^0’ which
depends on the highest power and can be arranged as the form,

30
“s^(0+n)+s^(0+n-1)+s^(0+n-2)… until s^0 where n=highest power”
The same was true for denominator (the right bracket).
tf2ss is used to convert transfer function to state space representation.
ss2tf is used to convert to state space representation to transfer function.
For block diagram, the
(a) s2Y+4sY+5Y=5U can be converted into Y/U=5/(s 2+4s+5), thereafter can the “tf2ss” be
applied. Then, the “ss2tf” was doing the reverse of the matrix -> Y/U.

(b) s3Y+5s2Y+6sY+4Y=8U can be converted into Y/U=8/(s3+5s2+6s+4), thereafter can the


“tf2ss” be applied. Then, the “ss2tf” was doing the reverse of the matrix -> Y/U.

(c) s3Y+4s2Y+8sY+9Y=(s+1)U can be converted into Y/U=(s+1)/(s 3+4s2+8s+9), thereafter can


the “tf2ss” be applied. Then, the “ss2tf” was doing the reverse of the matrix -> Y/U.

It was initially a transfer function, then was converted into state space representation by using
the tf2ss, which was transformed into 4 matrices, a, b, c, d, where,
‘a’ was a n x n matrix, where n is the highest power of s from the denominator,
‘b’ was a n x 1 matrix, with the same n,
‘b’ was a 1 x n matrix, with the same n,
‘d’ was a 1 x 1 matrix, all zero for (a), (b), (c) during steady state.
After that, by listing all the matrices, a, b, c, d, “ss2tf” was applied to convert back into Y/U
form again to be displayed using tf(numerator, denominator).
3.1.2

Block diagram of series (g1, g2)

Block diagram of parallel(g1, g2)

Block diagram of feedback(g1, g2) (+ -)

31
Block diagram of feedback(g1, g2, 1)(+ +)
(a)

First, each block was represented by the preset function. Then, from inside to outside, G1 and
G2 was combine into G7 with a series block diagram function G7=series(G1,G2),
G3 and G4 was combine into G7 with a parallel block diagram function G8=parallel(G3,G4)
as the block return was after, judging from the configuration.

Second, the finished product of G1, G2 which is G7 was combined with G5 into G9 with a
feedback positive block diagram function G9=feedback(G7,G5,1) as the block return was
before and positive, judging from the configuration. Next, the finished product of G3, G4
which is G8 was combined with G9 into G10 with a series block diagram function
G10=series(G9, G8). Finally, G10 was combined with G6 to form G11 with a feedback
negative block diagram function G11=feedback(G10, G6)as the block return was before and
negative, judging from the configuration.

Finally, transfer function of G11 was displayed using tf(G11).

32
10 s^2 + 80 s + 220
---------------------------
s^3 + 73 s^2 + 310 s + 1000

(b)

First, each block was represented by the preset function. Then, from inside to outside, G1 and
G5 was combine into G7 with a feedback block diagram function G7=feedback(G1,G5,1); as
the block return was before and positive, judging from the configuration. Then,
G7 and G2 was combine into G8 with a parallel block diagram function G8=parallel(G7,G2);
as the block return was after, judging from the configuration.
Finally, transfer function of G8 was displayed using tf(G8).
-10 s + 39
----------
39 s

3.2.1
(a) First, the state space representation of A, B, C, D matrices were defined. Then, the
matrices were simulated using ss(A,B,C,D);
Next, subplot function was used to plot two graphs on 2 row, 1 column in the same window.
The first subplot(2,1,1) indicates the top position of the first graph, before plotting the
impulse of the state space model by “impulse(sys)”. The next subplot(2,1,2) indicates the
bottom position, before plotting the step response of the state space model by “step(sys)”.

33
3.2.2

“a=tf([1.5 1],[1 2 2.5 0.5]);” was used to store the transfer function, then “pzmap(a)” was
used to plot it out. Thereafter, “grid on” was used to open the grid on the graph to locate the
zeros and poles.

As can be seen from the graph,

Pole-Zero Map
1.5 1.4
0.46 0.34 0.24 0.17 0.11 0.05
1.2
0.62 1
1
0.8
Imaginary Axis (seconds -1)

0.6
0.84
0.5 0.4
0.2

0.2
-0.5 0.4
0.84
0.6
0.8
-1
0.62 1
1.2
0.46 0.34 0.24 0.17 0.11 0.05
-1.5 1.4
-0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0
Real Axis (seconds -1)

the zero which was the root of the numerator, was around -0.66667 (circle) on the real axis
which aligned with the answer derived from 1.5s + 1 = 0

34
The poles which were the roots of the denominator, there were 3 poles (cross) indicated by
the highest power of the equation of denominator. From the same graph, there were three
poles situated at around -0.88 + 1.2i, -0.88 – 1.2i, -0.24 which aligned with the answer
derived from s^3 + 2s^2 + 2.5s + 0.5 = 0

3.2.3

“a=tf([1],[1 16.01 15.16 0.15]);” was used to store the transfer function, then the output
response was simulated using the “step(a), damp(a)” which the damping ratio and the
undamped natural frequency can be found within it.

3.3.1

“a=tf([1 1],conv([1 0],conv([1 2],[1 4])));” was used to store the transfer function, then
“rlocus(a)” was used to plot out the locus.

The zero which was the root of the numerator, was around -1 (circle) on the real axis which
aligned with the answer derived from (s + 1) = 0 The poles which were the roots of the
denominator, there were 2 poles (cross) indicated by the highest power of the equation of

35
denominator. There were two poles situated at around -2, -4 which aligned with the answer
derived from (s + 2) = 0 and (s + 4) = 0

Then, by dragging the point on the green or red branch till the corner end of the branch, the
value of K at the intersection of two branches was found to be 1.51.

3.3.2

“a=tf([1 5],conv([1 1],conv([1 3-2i],[1 3+2i])));” was used to store the transfer function, then
“rlocus(a)” was used to plot out the locus.

The zero which was the root of the numerator, was around -5 (circle) on the real axis which
aligned with the answer derived from (s + 5) = 0 The poles which were the roots of the
denominator, there were 3 poles (cross) indicated by the highest power of the equation of
denominator after expanding. There were 3 poles situated at around -1, -3+2j, -3-2j which
aligned with the answer derived from (s + 1) = 0 and (s + 3 - j2) = 0, (s + 3 + j2) = 0

Next, by dragging the point on the locus of the pole at s=-3+j2 (blue) until the imaginary part
reached 9.2i, the value of K was found to be 77.8.

36
The angle at which the locus departs from the pole was found to be 11.3 degree, computed
from the inverse tangent of the gradient (y2-y1)/(x2-x1) at two points, one of which was the
pole at s=-3+j2.

3.3.3

“a=tf(conv([1 5], [1 10]),conv([1 0 0],conv([1 20],[1 40])));” was used to store the transfer
function, then “rlocus(a)” was used to plot out the locus.

The zero which was the root of the numerator, was around -5, -10 (circle) on the real axis
which aligned with the answer derived from (s + 5) = 0, (s + 10) = 0 The poles which were
the roots of the denominator, there were 4 poles (cross) indicated by the highest power of the
equation of denominator after expanding. 2 of them was overlapped due to the same point.

37
The poles situated at around 0, -20, -40 which aligned with the answer derived from s2= 0 and
(s + 20) = 0, (s + 40) = 0

By dragging the point on the locus of the pole at s=-20 (red) until the point of the change of
axis for the locus, the value of K1 (gain) was found to be 183.

By dragging the point on the locus of the zero at s= -10 (green) until the left end point of the
change of axis for the locus, the value of K2 (gain) was found to be 3500; whereas by
dragging the point on the locus of the zero at s= -5 (green) until the right end point of the
change of axis for the locus, the value of K3 (gain) was found to be 0.

38
The angle at which the branches leave at s=0 was 103.55 degree, using initial ray (positive x-
axis) at reference point, computed from the inverse tangent of the gradient (y2-y1)/(x2-x1) at
two points, one of which was the pole at s=0 (Hartman, n.d.).

3.3.4

First, matrices a, b, c, d were defined with a set of values. Matrix a was fixed to be a square
matrix, matrix b was fixed to be a column matrix, matrix c was fixed to be a row matrix, and
matrix d was fixed to be [0]. “sys=ss(a,b,c,d);” was used to store the state space model, then
“rlocus(sys)” was used to plot out the locus.

From the graph, there were 3 poles observed, as indicated by the 3x3 matrix, the 3 is the
highest power of s from the denominator.

39
The critical point of K can be found at 0 from the real axis, which was 34.4.

Then finally, the angle of departure was 74.31 degree from the initial ray, computed from the
inverse tangent of the gradient (y2-y1)/(x2-x1) at two points, one of which was the pole at s =
-1 + 1.73i and another was the critical point at (0, 5.29i).

3.4.1
“G=tf(400*[1 5],conv([conv([1,1],[1 3])],[1 12]))” was used to store the feedback transfer
function, then a subplot of (3,2,n) was used to set the graph sheet into 3 rows and 2 columns
to plot the following graph; whereas n was the graph number that decide the location of the
graph. The bode diagram, Nyquist diagram, Nichols Chart, Pole-Zero map, Root Locus were
plotted out using the following commands, “margin(G), nyquist(G), nichols(G). pzmap(G),
rlocus(G)”. The system was found to be stable because pole-zero map indicated all the poles

40
(cross) at negative side of the real axis.

3.4.2
“G=tf(50*[1 5],conv([conv([1,-2],[1 8])],[1 15]))” was used to store the feedback transfer
function, then a subplot of (3,2,n) was used to set the graph sheet into 3 rows and 2 columns
to plot the following graphs; whereas n was the graph number that decide the location of the
following graph. The bode diagram, Nyquist diagram, Nichols Chart, Pole-Zero map, Root
Locus were plotted out using the following commands, “margin(G), nyquist(G), nichols(G).
pzmap(G), rlocus(G)”. The system was found to be unstable because pole-zero map indicated
that there was one pole (cross) at positive side of the real axis.

41
The critical gain at the origin (0, 0) was found to be 0.958.

3.5.1
For the design of PID controller,
“G=tf([1],[conv([1 0],[1 1])])” was used to store the open loop transfer function of a unity
feedback system. Then, it was put into a negative feedback system using “A=feedback(G,1);”
before showing the transfer function using tf(A). Then, step response of (A) was plotted and
the original settling time and overshoot were determined.

42
From the graph, the maximum overshoot has exceeded 15% and the setting time was more
than one second. Thus, a transfer function must be plotted to correct the graph of the system
that was subjected to the unit step input signal.
After plotting the step response of the original system, a “hold on” was used to freeze the
current graph before plotting the graph with PID controller on the same page. After setting
and adjusting suitable values for Kp, Ki, Kd, “B=pid(Kp,Ki,Kd);” was used to make these
variable into a block of system. “C=series(B,G);” had combined the original system and the
PID controller into series form to apply the PID controller onto the original system, just
before making the combined system into a negative feedback system using
“D=feedback(C,1);” and showing the transfer function. Last but not least, step response of
(D) was plotted and the settling time and overshoot of the graph with the PID controller were
determined. “hold off” was used at the end to resume the graph.

43
From the graph, the maximum overshoot of the graph with PID controller was 2.33% which
was within 15%. The setting time of the graph with PID controller was 0.772 second which
was less than one second. Thus, the transfer function has met the requirements.

3.5.2
For the design of PID controller,
“G=tf([10],conv([conv([1 0],[1 2])],[1 4]));” was used to store the open loop transfer function
of a unity feedback system. Then, it was put into a negative feedback system using
“A=feedback(G,1);” before showing the transfer function using tf(A). Then, step response of
(A) was plotted and the original settling time and overshoot were determined.

44
From the graph, the maximum overshoot has exceeded 10% and the setting time was more
than 2.8 second. Thus, a transfer function must be plotted to correct the graph of the system
that was subjected to the unit step input signal.
After plotting the step response of the original system, a “hold on” was used to freeze the
current graph before plotting the graph with PID controller on the same page. After setting
and adjusting suitable values for Kp, Ki, Kd, “B=pid(Kp,Ki,Kd);” was used to make these
variable into a block of system. “C=series(B,G);” had combined the original system and the
PID controller into series form to apply the PID controller onto the original system, just
before making the combined system into a negative feedback system using
“D=feedback(C,1);” and showing the transfer function. Last but not least, step response of
(D) was plotted and the settling time and overshoot of the graph with the PID controller were
determined. “hold off” was used at the end to resume the graph.

45
From the graph, the maximum overshoot of the graph with PID controller was 3.82% which
was within 10%. The setting time of the graph with PID controller was 1.81 second which
was less than 2.8 second. Thus, the transfer function has met the requirements.

5. CONCLUSION

In a nutshell, MATLAB was very useful for the analysis of control system. It can converting
transfer function into state space model and vice versa, reduce complex block diagram
through function such as “series(), feedback(), etc.”, plotting impulse, step and ramp
response, plotting time and frequency domain graphs, besides capable of designing PID
controllers. It can find and plot out the zero(s) and pole(s) for transfer function and state
space model, then determine the stability of the system by simulating impulse response or by
looking at the location of the poles. It can also be used for finding the damping ratio and
natural frequency of closed system poles. Moreover, it was capable of plotting locus from the
poles and zeroes of transfer function or state space model, therefore, the values of K (gain)
and the angles of departure can be determined from the graphs. Other than that, it can be used
to plot Bode diagram, Nyquist diagram and Nichols Chart as well. Last but not least, it is
useful in constructing a PID controller to make adjustments on the original system to improve
the parameter of the system such as making changes on the peak amplitude, overshoot(%),
and setting time.

46
6. REFERENCES

1. Electronics Coach. 2022. Block Diagram of Control System - Electronics Coach.


[online] Available at: <https://electronicscoach.com/block-diagram-of-control-
system.html> [Accessed 30 September 2022].

2. Electronics Coach. 2022. Block Diagram Reduction Rules with Example - Electronics
Coach. [online] Available at: <https://electronicscoach.com/block-diagram-reduction-
rules.html> [Accessed 30 September 2022].

3. Electronics Coach. 2022. What is Feedback System? Block Diagram and Types of
Feedback - Electronics Coach. [online] Available at:
<https://electronicscoach.com/feedback-system.html> [Accessed 30 September 2022].

4. Hartman, G., n.d. 9.4: Introduction to Polar Coordinates. [online] Mathematics


LibreTexts. Available at: <https://math.libretexts.org/Bookshelves/Calculus/Book
%3A_Calculus_(Apex)/09%3A_Curves_in_the_Plane/
9.04%3A_Introduction_to_Polar_Coordinates> [Accessed 1 October 2022].

47

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy