Вы находитесь на странице: 1из 35

Acknowledgment

I would like to thank my lecturer NASRODIN TABARA MUSTAPHA for his


valuable guidance and advice in this subject and in others subjects as well.
His willingness has motivated me in my studies and in this project, he
inspired me greatly to work on this assignment. He clarifies to me everything
related to control engineering and MATLAB for doing this assignment.
Without his help, I would have faced many difficulties in completing this
assignment. Also, honorable mention goes to my family who support me to
study abroad and who always motivate me to get high marks in my studies.
Finally, I would like to thank my classmate and my friends for their
supporting and helping me in my study.

Thanks to all of you.

Page 1 of 35
Abstract

In this assignment, the main aim is to illustrate the significance of using


control systems and analyzing a control system to control the pitch and the
elevator angel. In order to design a pitch control system for aircraft. A
mechanical system was modeled and the transfer function of that system
was derived for analysis. MATLAB is a suitable software environment to study
different case and parameters effects on the control system response. The
parameters of the system were taking according to 777 Boeing aircraft. The
response of the system has been studied and analyzed to comprehend its
performance. Several controllers were applied to control the response of this
mechanical system. Finally, the controllers with the best performance have
been chosen for this system is PID were the graph plotted and analyzed.

Page 2 of 35
Table of Contents
Acknowledgment........................................................................................................ 1
Abstract...................................................................................................................... 2
List of Figure............................................................................................................... 4
List of Tables............................................................................................................... 5
Introduction................................................................................................................ 6
Open loop................................................................................................................ 6
Closed loop.............................................................................................................. 7
Objective.................................................................................................................... 8
Research and control design:..................................................................................... 9
System modeling:.................................................................................................... 9
Mathematical modelling........................................................................................ 10
Open Loop Transfer Function.............................................................................. 12
Closed loop transfer function............................................................................. 12
Design simulation and analysis................................................................................ 14
Original system analysis........................................................................................... 15
Open loop response........................................................................................ 15
Close loop response........................................................................................ 15
Stability.................................................................................................................... 18
Control System Design and Analysis........................................................................19
Compensator......................................................................................................... 19
Designing of PID Controller:.................................................................................. 20
Results of PID Controller........................................................................................ 24
Discussion................................................................................................................ 26
Conclusion................................................................................................................ 28
References................................................................................................................ 29

Page 3 of 35
Appendixes............................................................................................................... 30

List of Figure
Figure 1: description of the control system (Nise, 2011).................................3
Figure 2: open loop control system..................................................................4
Figure 3: closed loop control system................................................................5
Figure 4: Description of pitch control system. (Chegg, 2016)..........................6
Figure 5: Force, moments and velocity definition in body fixed coordinate.....7
Figure 6: open loop transfer function in MATLAB...........................................10
Figure 7: Close loop transfer function in MATLAB..........................................10
Figure 8: Codes of closed loop response syste..............................................10
Figure 9: open loop response original system................................................11
Figure 10: Close loop response original system.............................................11
Figure 11: Steady state from command window of MATLAB..........................13
Figure 12: poles location................................................................................14
Figure 13: PID compensator...........................................................................15
Figure 14: The step responce of PID compensted system.............................17
Figure 15: The step response for the original system and the compensated
system...........................................................................................................18

Page 4 of 35
List of Tables

Table 1: System parameters..................................................................................... 10


Table 2: Steady State Error table..............................................................................15
Table 3: Step response for the original system and the PID compensated system...23
Table 4: Step response for the original system and the PID compensated system.. .25

Page 5 of 35
Introduction

Control systems are an important factor in the development and


advancement of modern technology and civilization. Every aspect
of our daily life actives is affected by some type of control system.
In modern civilization, systems are found in abundance. They are
found in abundance in all sectors of industry such as power
systems, automatic assembly lines, quality control of
manufactured products, space technology and weapon systems,
transportation systems, aircraft attitude system, computer
control, nanotechnology, Micro-Electro-Mechanical system
(MEMS), robotics, and many others (Golnaraghi, Kuo and
Golnaraghi, 2010) .

Figure 1: description of the control system (Nise, 2011).

On the other word, control system is a device or a group of devices which


understand and control the behavior of other devices or systems in order to

Page 6 of 35
give a desired output. There are two types of control system open-loop
control systems and a closed-loop control systems.

Open loop
Open loop control system (a non-feedback control system) is a control
system in which the control action is totally independent of output of the
system then it. Manual control system is also an open loop control system.
Figure (2) shows the block diagram of open loop control system in which
process output is totally independent of controller action.

Figure 2: open loop control system

Closed loop
Closed loop control system can be defined as control system in which the
output has an effect on the input quantity in such a manner that the input
quantity will adjust itself based on the output generated. Open loop control
system can be converted in to closed loop control system by providing a
feedback. This feedback automatically makes the suitable changes in the
output due to external disturbance. In this way closed loop control system is
called automatic control system (Johan, 2016). Figure (3) shows the block
diagram of closed loop control system in which feedback is taken from
output and fed in to input.

Page 7 of 35
Figure 3: closed loop control system

This assignment is to design and analyzing clearly a control system to control


the pitch and elevator angle of the plane. On the other hand, evaluation and
improvements of the system will be analyzed as well by using MATLAB
software also for plotting the graphs to obtain the results of the transfer
function. Finally, the main objective of this assignment is to design a suitable
compensator in order to improve the performance of the system.

Objective
The main objective of this assignment is to design a pitch control system for
aircraft. Design consideration as following:

Overshoot should not exceed 10%.


Rise time should not exceed 2 second.
When the values of the parameter of the pitch change constantly, pitch
change should be within 2% in 10 seconds.

Page 8 of 35
Research and control design:
System modeling:

Figure 4: Description of pitch control system. (Chegg, 2016)

Figure 4 shows the physical modeling design of the angles of elevator and
pitch which the elevator angle represent the input while the output is pitch
angle .Also shows the basic coordinate axes and forces acting on an aircraft.

There for figure 5 shows the moments, velocity and forces


components in the body fixed coordinal

Page 9 of 35
of aircraft system. Aerodynamic torque component for roll, pitch and yaw
axis is denoted as L, M and N terms P, Q, R representative of angular rate
about roll, pitch and yaw axis item u, V, W designates a roller velocity
component, pitch and yaw axis. and are expressed as an attack and
sideslip angle (Nelson, R.C., 1998).

Figure 5: Force, moments and velocity definition in body fixed coordinate.

Mathematical modelling
Model is a mathematical representation of a physical, biological or
information system. Models allow us to reason about a system and make
predictions about who a system will behave. In this section, it will be mainly
interested in models describing the input and output behavior of systems
and often in so-called state space form. Moreover, the first step in the
control design process is to develop appropriate mathematical models of the
system derived either from physical laws or experimental data. Therefore, in
this part it will be introducing the state-space and transfer function
representations of dynamic systems."

According to a coordinate axes and forces acting on an aircraft figure (5)


mathematical equations can be obtain as following:

X mgS m(u qv rv)


.(1)

Page 10 of 35
Z mgC C m(w pv qu)
(2)
M = Iy q + rq(Ix Iz ) + Ixz (p2 r2)
.(3)
It is required to completely solved the aircraft problem with considering the
following assumption:

P = S .. ..(Rolling rate)

q = C + CS.. .(Yawing rate)

r = C C S( Pitching rate)

= qC rS.. (Pitch angle)

= p + qST + rCT (Roll angle)

= (qS + rC) sec . (Yaw angle)

Based on the three equations above it have to linearize using small


disturbance theory. All equations have to replace by reference value plus a
perturbation, disturbance or a variable, as shown following:

u u o u v vo v w w o w u uo u

v vo v w wo w p=p0+p q=q0+q
r=r0+r X=X0+X M=M0+MY Z=Z0+Z
= 0 +
Therefore, for convenience the reference flight condition is assumed to be
symmetric and the propulsive forces are assumed to remain constant. This
means that:

v0 = p0 = q0=r0 = 0 = w0 = 0.

After linearization the (4), (5) and (6) are obtained.

Page 11 of 35
( dtd X ) u Xw w+( g cos ) =Xe e

(4)

-Zu u = [ (1Zw )
d
dt ]
Zw w - [ (uo +Zq )
d
dt ]
g cos o =Ze e

.(5)

-Mu u - ( Mu dtd + Mw) w+ ( dtd 22 + Mq dtd ) = Me e

.(6)

After manipulating the three equation(4),(5)and(5) above and substituting


the parameters values of the longitudinal stability derivatives, the following
transfer function will obtain for the change in the pitch rate to the change in
elevator deflection angle.

MZe MZe MZ
q (S ) 1
=
(
Me+
u0
S
u0

u0 ) ( )
e(S) s 2 Z ZMq
(
S Mq + M+
u0
S+
u0
M ) ( )

Table 1: System parameters

Longitudinal Dynamic Pressure and Dimensional Derivative


Q=1.550756Kg/m2, QS = 3071.274Kg, QSC
Derivatives
=57.4372103Kg/m, (c / 2u0) = 0.016s
X Force, (S-1) Z Force, (F-1) Pitching Moment,
(FT-1)
Rolling Velocities Xu = -0.045 Zu = -0.369 Mu = 0
Yawing Velocities Xw = 0.036 Zw = -2.02 Mw = -0.05

Page 12 of 35
Xw = 0 Zw = 0 Mw = -0.05
Angle of Attack X = 0 Z = -355.42 M = -8.8
X = 0 Z = 0 M = -0.8976
Pitching Rate Xq = 0 Zq = 0 Mq = -2.05
Elevator X e =0 Z e = -28.15 M e = -11.874
Deflection

Table 1 shows the list of parameters of an aircraft .those parameters


will be substituted in to the obtain transfer function after substituted
the parameters the transfer function can be seen as following:

1.151 s+0.1774
G(s)=
S + 0.7391 S2 +0.921 S
3

Open Loop Transfer Function

Open loop transfer function is same as the main transfer function that was
obtained above which is given as following:

1.151 s+0.1774
G(s)=
S + 0.7391 S2 +0.921 S
3

Closed loop transfer function

G(S)
Formula of unity closed loop transfer function is: Gc(S)=
1+G(S )(1)

Where;

1 is stands for the unity feedback

G(S) is open loop transfer function

Page 13 of 35
By substitution the open loop transfer function G(S) into closed loop transfer
function formula above, the closed loop transfer function can be seen in the
following equation below:

1.151 s+0.1774
Gc(s)= 3 2
S +0.7391 S +2.072 S+0.1774

Page 14 of 35
Design simulation and analysis
A program was created to analyze the optimal values of the pitch and the
elevator angel. But, before it have been start testing student need to choose
an input to the system. Surely, in reality the input is random, but a random
input will make the system impossible to analyze. Because the input will
keep changing and therefore determining any improvement by changing
values of elevator deflection angle delta which was chosen to to be 0.2 rad
(11 degrees). Hence, we need a constant input. Figure (6)shows the open
loop transfer function in command window of MATLAB.

Figure 6: open loop transfer function in MATLAB.

The coding for closed loop transfer function is similar to open loop transfer
function. In addition, the function feedback (name of open loop system,
type of the feedback) is used to find out the closed loop transfer function.
Due to the unity feedback the type of feedback was used as 1. Figure 7
shows the close loop transfer function in command window of MATLAB after
it have been add the feedback to the the transfer function.

Figure 7: Close loop transfer function in MATLAB

Page 15 of 35
Figure 8: Codes of closed loop response system.

Original system analysis


Open loop response
This section is putting an emphasizing on MATLAB program that have been
used to show the behavior of the system when the input is unit step. There
are two types of systems, closed loop and open loop. Firstly, it have been
analyzed open loop response by used the transfer function in MATLB,
However, the system response did not satisfy the design criteria at all. As
Figure 9 shows the open loop response is unstable.

Figure 9: open loop response original system

Close loop response


Secondly, the closed loop response by used the transfer function in MATLB .
The system response is about the addition of feedback that has stabilized
the system. Its important to note that, the steady state error appears to be
driven to zero and there is no overshoot in the response, though the settling
time requirements are not met. Figure 10 shows.

Page 16 of 35
Figure 10: Close loop response original system

Based on Figure 9 and 10 the amplitude response of a closed-loop system


will be less because of the feedback some of the output is feedback to the
input. The open loop response takes more time than the closed loop
response to become stable.

Steady State Error

In general, the steady-state error is the difference between the input and the
output on the system. SSE can be used to define the accuracy of the system
response respect to the input. The steady-state error is depends on the type
of the input used and the type of the system.

N (s)
The system type can be defined using formula: G ( s )= By comparing
S n D( s)

the system type formula with the transfer function obtained in part 1, it
shown that no s can be factored from the denominator, which mean the
system type for the transfer function is type 0.

Table 1 shows the value of steady state error (ess) respects to the system
type. Steady-state error for every system type respect to step, ramp and
parabolic can be obtained.

Page 17 of 35
Table 2: Steady State Error table

Type Steady State Error (ess)


Step Ramp Parabolic
0 constant
1 0 constant
2 0 0 constant

In this point, we can conclude that the type 0 system to the ramp and
parabolic inputs will have steady state error (ess) with value of infinite.

The stead-state formula:


1
ess = 1+ Kp

To calculate Kp:
Kp=lim Gc( s)
s0

lim 1.151 s +0.1774


s 0
Kp=
S 3 +0.7391 S 2+2.072 S +0.1774

1.151(0)+ 0.1774
Kp = (0)+0.7391(0)+2.072(0)+0.1774

0.1774
Kp = 0.1774

Kp = 1
By substitute the value of Kp that has been obtained above in the following
formula in order to evaluate the steady state error:

1
ess = 1+1 , ess = 0.5000

Page 18 of 35
However, the Figure 11 below from the command window of MATLAB shows
the same values of Kp and steady state that had been calculate.

Figure 11: Steady state from command window of MATLAB.

Stability

This section is putting an emphasizing of the stability of the system. In order


to determine and analyze the system whether it is stable or unstable is to
plot the S-plane to locate the poles and zeros of the system. The location of
poles would be obtained and being displayed on graph. After that, the
transfer function is being imported into LTI viewer to plot the S-plane which
significantly the location of the zeros and poles are determined and
analyzed. Figure 12 shows the result of pole and zero map

Page 19 of 35
Figure 12: poles location

Based on the above graph it can see clearly, there are three poles and one
zero. Therefore, the location of poles and zeros are being in negative side.
That means the system is stable because all poles are located at left side of
plane .Furthermore, the transfer function is a third order system has 3 poles
as shows in the Figure above. All 3 poles are located in the stable region of
the Pole-Zero Map. Based on that, system is stable because all poles are
located at left side of plane (negative plane). Not only that, if you have the
closed loop transfer function of a system, only the poles matter for closed-
loop stability.

Control System Design and Analysis


Compensator
In general, Control systems design and analysis is describes the time domain
system features based on the differential equations. This focuses on the
compensator design for continuous time linear time-invariant systems.
Control systems can have more than one input or output. The input and the

Page 20 of 35
output represent the desired response and the actual response respectively.
A control system provides an output or response for a given input or
stimulus. Furthermore, the system will be improved by using the
compensator. A proportional compensator is typically applied in first order
procedures with single energy storage to stabilize the unstable process. The
P controller is used to decrease the steady state error (ess) of any system. If
the gain factor K increases, the steady state error (ess) of the system
reduces. However, despite the reduction, the steady state error of the
system cant eliminate during using P controller. PI compensator is mostly
used to remove the steady state error resulting from P controller. Though, in
terms of the speed of the response and overall stability of the system, it has
an undesirable effect. PD compensator used to increase the stability of the
system, by increasing the numerator of the transfer function (Oscar Liang,
2013)

Moreover, PID compensator is based on transient response which improves


the existing overshoot and decreased the settling time while it may reduce
the speed slower system. In this case, the main aim of the compensator is
set to be decreasing the settling time and reducing the overshoot percentage
of the system. Also, the speed of the system is not really taken into
consideration.

Page 21 of 35
Figure 13: PID compensator

Designing of PID Controller:

In this assignment, the controllers with the best performance have been
chosen for this system which is PID. It have been used PID controller to
control the pitch angel which is the output of the system and the elevator
angel which is the input of the system . In order to improve the overshoot
and settling time of this particular system, a PID compensator is needed to
connect to closed loop. The transfer function of the PID compensator is

Gc ( S )=Kp+ KDS+ KI /S

Since the overshoot is 20 Ts=3.645 se cend


2

From OS =e / (1 ) x 100

20 =e / (1 ) x 100

20/100 = e / (1 )

Apply ln both sides.

Page 22 of 35
e
20
ln ( / (1 2 ))=ln( )
100

20
( )=ln( )
1 2 100


( )=(1.609 )
1 2


( )2=(1.609)2
1 2
2 2
2 = (2.59) ( 1

2 2
2 = 2.59 2.59

2 2
2 + 2.59 =2.59

2
= 0.208

= 0.456

From settling time (Ts) = 4/ n

4
n=
0.456 x 3.645

n=0.602 rad /s

Dominant pole

Sd = n+ j n (1 2)

Page 23 of 35
Sd = -(0.456 x 0.602 + j0.602 (10.456 2)

Sd = -1.0974 +j2.1421


2
|Sd| = -1.0974 + 2.14212)

|Sd|= 2.4068 rad /s

Or

Sd = 2.4068 177.956

D=n=2.4068 rad / s

Determining the angle.

From =cos

1
=cos

=cos1 0.456

=62.871

Determining beta.

=18062.871

=117.13

Determine magnitude.

The closed loop transfer function is:

1.151 s+0.1774
Gc(s)=
S +0.7391 S 2+2.072 S+0.1774
3

Page 24 of 35
By using calculator to simplify the denominator in order to find the
magnitude:

1.151 s +0.1774
Gc ( S )=
( s+0.0881)(s+0.3255 j 1.382)(s+ 0.3255+ j 1.382)

1.151 sd +0.1774
Gc ( Sd )=
( sd +0.0881)(sd + 0.3255 j1.382)( sd +0.3255+ j1.382)

Put the value of dominant pole Sd = (-1.0974 +j2.1421) into a formula of


closed loop transfer function;

1.151(1.0974 + j 2.1421)+ 0.1774


Gc ( Sd )=
(1.0974+ j 2.1421+0.0881 ) (1.0974+ j 2.1421+ 0.3255 j 1.382 )
(1.0974+ j 2.1421+ 0.3255+ j 1.382)

G ( Sd )=
[ 1.08571+ j 2.4656
(1.0093+ j 2.1421 )(0.7719+ j 0.7601 ) (0.7719+ j3.5241 ) ]
2 2
1.08571 +2.4656
1.0093
( 2+ 2.14212)
0.7719
( 2+ 0.76012)
0.7719
( 2+ 3.52412)




A (d )=

Ad= 0.2912.

Page 25 of 35
2.4656
d=
tan 1 ( 1.08571 )
2.1421 0.761 3.5241
tan 1 ( 1.0093 ) tan ( 0.7719
1
) tan ( 0.7719
1
)
d=66.2323(64.7831+ 135.4259+ 102.3563)

d=117.1261

sin ( d + )
Kp=
Adsin

sin ( 117.1261+117.13 )
Kp=
0.2912 sin117.13

Kp=3.487

sin (d)
KD=
DAdsin

sin ( 117.1261)
K D=
2.4068 x 0.2912 sin 117.13

K D =4.465

Dsin ( d )
KI=
Adsin

2.4068 sin ( 117.1261)


KI=
0.2912 sin 117.13

Page 26 of 35
KI= 7.996

Applying PID controller transfer function:

KI
C ( s )=Kp+ + Kds
s

7.996
C ( s )=3.487 + + 4.465 s
s

8
C ( s ) 3.5+ +4.5 s
s

Results of PID Controller

Graph in Figure 14 shows the step response of close loop system after used
PID control which the system has rise time of 0.0723 seconds, an overshoot
of 1.02%, settling time of 0.117 seconds and a steady state value of 1.

Page 27 of 35
Figure 14: The step responce of PID compensted system.

Table 3: Step response for the original system and the PID compensated system

System Oversho Rise time Settling Final Steady State


ot time value Error
Original system ---- 1. 75 35.1 0.2 0.500
second second
PID 1.02% 0.0723 0.117 1 0
compensated second second
system

Table 2 shows the step response for the original system and the PID
compensated system. Its important to note that, the steady state error
appears to be driven to zero and there is no overshoot in the response before
control the system, though the settling time requirements are not met. But,
after control the system the overshoot become 1.02%.

Page 28 of 35
Figure 15: The step response for the original system and the compensated system

Figure 15 shows the transient behavior comparison between the original


system and the compensated system. It can be observed from Figure 15 that
the there is no overshoot in the response before control the system, though
the settling time requirements are not met and the steady state error
appears to be driven to zero. But, after control the system the overshoot
become 1.02%. Where the settling time for the original system was 35.1
second and reduce to 0.117 second, means that the PID compensator was
designed successfully since the PID compensator was used to make the
system more stable where this can be seen in Figure 15 and Table 2.

Page 29 of 35
Discussion

MATLAB has been used to study the transfer function of the system designed
as well as to design and analyze the controller. By this software the way of
designing and analyzing the controller become too easy comparing to the
hand calculation.

In order to design a compensator to any of the systems either closed loop or


open loop. As the open loop systems do not have a feedback instrument, so
they are very imprecise in terms of result output and they are unreliable to
used. Also they are unable to remove the disturbances happening from
outside sources. In this assignment the closed loop was used to control
because it has a feedback to read the information of output and in order to
control any system it is necessary to know the information of output to fix or
to overcome if there any undesired outputs such as large increased of pitch
angle which is lead to lose the control of the aircraft or large negative
increases of the pitch which lead to send the aircraft nose into the ground.

As discussed earlier that the controller is designed to be robust against


parametric variations and disturbances. The main parameters that control
the pitch angle (output) when they are changed are e, q, and
where e,q, represent elevator deflection angle , Pitching Rate and Angle
of Attack respectively. The system work and behave differently when there is
any changing in its parameters values. The first choice of control system
design was the proportional controller. As simple as this controller is, it did
not have any noticeable impact on the system characteristics. In this
mechanical system, certain characteristics were required to be changed by
the controller. By using the PID controller these pitch was change from one
constant value to another constant value within 2% in 10 second. So, the
output design has an overshoot of less than 10%, rise time of less than 2
seconds, settling time of less than 10 seconds, and the steady state error of
less than 2% as the question assignment requirement. For example, if the

Page 30 of 35
input is 0.2 rad (11 degrees), then the pitch angle will not exceed 0.22 rad,
reaches 0.2 rad within 2 seconds, settles 2% of the steady state within 10
seconds, and stays within 0.196 to 0.204 rad at the steady state. Moreover,
table 3 shows the step response of close loop system befor and after used
PID control which the overshoot less than 10% and the rise time not exceed
2 second.

Table 4: Step response for the original system and the PID compensated system.

System Oversho Rise time Settling Final Steady State


ot time value Error
Original system ---- 1. 75 35.1 0.2 0.500
second second
PID 1.02% 0.0723 0.117 1 0
compensated second second
system

Based on the table above, it can be note that the design requirements are
fulfilled by the PID controller design. This is because the response with PID
compensator meets all of the given requirements as given below.

Overshoot = 1.02% < 10%, Rise time = 0.0723 seconds < 2 seconds,
Steady state error = 0.5000% < 2%. Hence, from the mechanical point of
view using a PID with reasonable parameter values is a preferable option.

Based on the results, the system responses indicate the performance of pitch
control system using PID controller has been improved and satisfied
compared to the system response before applied the PID controller .

Page 31 of 35
Conclusion

In conclusion, the design requirements are fulfilled by the PID controller


design. Which is to control the pitch and the elevator angel. The system has
been designed and analyzed for step input after it was mathematically
modeling. Also, transfer function was obtained and it was simulated using
MATLAB. Some of the parameters were manipulated in order to check how
the parameters affect the behavior of the system. After comparing between
open loop and closed loop, closed loop had been chosen for this system.
Which the stability of the open and close loop had been determined in time
domains. To improve the system response. A control system have been
designed and analyzed. Moreover, PID controller it is used to control the
system where the results obtained in MATLAB software and discussed in this
report. Finally, by using MATLAB software the aim of this assignment has
been perfectly achieved.

Page 32 of 35
References

E. Wellstead, P. (2014). Introduction to Physical system modelling. [online]


Control system modelling. Available at: http://www.control-systems-
principles.co.uk/ebooks/Introduction-to-Physical-System-Modelling.pdf
[Accessed 3 Sep. 2016].

Norman S.Nise, Control System Engineering

Oscar Liang. (2013). Quadcopter PID Explained and Tuning - Oscar Liang.
[online] Available at: https://oscarliang.com/quadcopter-pid-explained-tuning/
[Accessed 17 Sep. 2016].

Johan, K. (2016). Control System Design by Karl Johan strm. [online]


Cds.caltech.edu. Available at:
http://www.cds.caltech.edu/~murray/courses/cds101/fa02/caltech/astrom. html
[Accessed 25 Sep. 2016].

Page 33 of 35
Appendixes

Appendixes of the system before control;


1- Open loop Transfer function

close all; clear all; clc;


de=0.2;%elevator deflection angle
num=[1.151 0.1774];
den=[1 0.739 0.921 0];
sys = tf(num,den)
t= 0:0.01:10; % t is the time in second
step(sys,t)%step response
ylabel('pitch angle (rad)')
title('open loop step response')

2- Closed loop transfer function :

close all; clear all; clc;


de=0.2;%elevator deflection angle
num=[1.151 0.1774];
den=[1 0.739 0.921 0];

Page 34 of 35
sys = tf(num,den);
t= 0:0.01:10; % t is the time in second
system = feedback(sys,1)%to get the transfer function of unity closed loop
step(de*system)
ylabel('pitch angle (rad)')
title('closed loop step response')
3- Closed loop steady state
Step input
close all; clear all; clc;
de=0.2;
num=[1.151 0.1774];
den=[1 0.739 0.921 0];
sys = tf(num,den);
t= 0:0.01:10; % t is the time in second
system = feedback(sys,1)
step(system,t)
'step input';%unit step function
kp = dcgain(system)%to get the value of kp
ess = 1/(1+kp)%steady state error
ylabel('pitch angle (rad)')
title('closed loop step response')

4- Control system PID

close all, clear all, clc;


de=0.2;%elevator deflection angle
num=[1.151 0.1774];
den=[1 0.739 0.921 0];
sys = tf(num,den)
t= 0:0.01:10; % t is the time in second

system = feedback(sys,1)
step(de*system)
Kp = 3.5
Ki = 8
Kd = 4.5
C = pid(Kp,Ki,Kd)
controlled = feedback(C*system,1) %the closed loop controlled system
%lsim(system,controlled,r,t)%to plot the the time response of the
subplot(211), step(de*system);%subplt to plot both of the systems separately
%and this function to ploot the closed loop system before control
subplot(212), step(de*controlled)%to plot the time response of the closed loop
%system after control
step(de*controlled)%to get the LTI to chose any type of plotting
%and it used to plot the system and controlled system

Page 35 of 35

Вам также может понравиться