You are on page 1of 53

Design and Analysis of Control System

for an Unmanned Free-Swimming


Submersible Vehicle under
Hydrodynamic Disturbances

Submitted by:
M. Hamza Ramzan-F2017019022
Muhammad Waqas-F2017019024
Hassan Ali-F2017019020

Submitted to:
Muhammad Shoaib

Bachelor of Science in Electrical Engineering


School of Engineering
University of Management & Technology
June 2020
Contents

Contents
CONTENTS .................................................................................................................................................................... 2
ABBREVIATIONS ........................................................................................................................................................... 6
ABSTRACT .................................................................................................................................................................... 7
INTRODUCTION ............................................................................................................................................................ 8
1.1 Literature Review ...........................................................................................................................................9
REDUCTION OF BLOCK DIAGRAMS ............................................................................................................................... 10
2.1 Introduction ..................................................................................................................................................10
2.2 Deriving the Transfer Function .....................................................................................................................10
2.2.1 Pitch Control System of UFSS ................................................................................................................................... 11
2.2.2 Heading Control System of UFSS .............................................................................................................................. 13

OPEN LOOP AND CLOSED LOOP RESPONSE OF THESYSTEM ....................................................................................... 15


3.1 Introduction ..................................................................................................................................................15
3.2 Pitch Control System Response ...................................................................................................................15
3.2.1 Open Loop System Response ................................................................................................................................... 15
3.2.2 Close Loop System Response ................................................................................................................................... 17
3.2.3 Stability ..................................................................................................................................................................... 18
3.3 Heading Control System Response ..............................................................................................................22
3.3.1 Open Loop System Response ................................................................................................................................... 22
3.3.2 Close Loop System Response ................................................................................................................................... 24
3.3.3 Stability ..................................................................................................................................................................... 24

ANALYSIS IN FREQUENCY DOMAIN ............................................................................................................................ 28


4.1 Introduction ..................................................................................................................................................28
4.2 Root locus of the System .............................................................................................................................28
4.2.1. Pitch Control System ................................................................................................................................................. 28
4.2.2. Heading Control System ........................................................................................................................................... 30

TRANSFERFUNCTIONFORLEAD COMPENSATOR .......................................................................................................... 31


5.1 Introduction ..................................................................................................................................................31
5.2 Pitch Control System.....................................................................................................................................31
5.2.1 Lead Compensator .................................................................................................................................................... 32
5.3 Heading Control System ...............................................................................................................................36
5.3.1 Lead Compensator .................................................................................................................................................... 36

PID CONTROLLER DESIGN AND TUNING GAINS .......................................................................................................... 39


6.1 Introduction ..................................................................................................................................................39
6.2 Designing the PID Controller .......................................................................................................................39
6.2.1 Pitch Control System ................................................................................................................................................. 40
6.2.2 Heading Control System ........................................................................................................................................... 45

PERFORMANCECOMPARISONOFLEAD AND PID ......................................................................................................... 49


7.1 Introduction ..................................................................................................................................................49
7.2 Pitch Control System Step Response ............................................................................................................49
7.3 Comparison of PID and Lead Controllers ....................................................................................................50
APPENDIX A ......................................................................................................................................................................52
A.1 MATLAB Code of Step Responses of all Designed Controllers for Pitch Control System of UFSS ...............52
A.2 MATLAB Code of Step Responses of all Designed Controllers for Heading Control System of UFSS ..........52
REFERENCES ............................................................................................................................................................... 53
List of Figures
FIGURE 1 : PITCH, YAW AND ROLL ANGLES[3] .................................................................................................................................8
FIGURE 2: PITCH CONTROL SYSTEM FOR UFSS [1] .........................................................................................................................10
FIGURE 3 : HEADING CONTROL SYSTEM OF UFSS [1] .....................................................................................................................11
FIGURE 4 : PITCH CONTROL SYSTEM ............................................................................................................................................11
FIGURE 5: HEADING CONTROL SYSTEM ........................................................................................................................................13
FIGURE 6: OPEN LOOP BLOCK DIAGRAM [1]................................................................................................................................16
FIGURE 7 : OPEN LOOP SYSTEM RESPONSE OF PITCH CONTROL SYSTEM ..............................................................................................16
FIGURE 8: POLE ZERO MAP OF OPEN LOOP PITCH CONTROL SYSTEM ................................................................................................17
FIGURE 9: CLOSED LOOP RESPONSE FOR K1=5 ..............................................................................................................................19
FIGURE 10: CLOSED LOOP RESPONSE FOR K1=10 ..........................................................................................................................19
FIGURE 11: CLOSED LOOP RESPONSE FOR K1=15 ..........................................................................................................................20
FIGURE 12: CLOSED LOOP RESPONSE FOR K1=20 ..........................................................................................................................20
FIGURE 13: CLOSED LOOP RESPONSE FOR K1=25 ..........................................................................................................................21
FIGURE 14: OPEN LOOP BLOCK DIAGRAM ....................................................................................................................................22
FIGURE 15: OPEN LOOP STEP RESPONSE OF HEADING CONTROL ........................................................................................................23
FIGURE 16: POLE ZERO MAP OF OPEN LOOP HEADING CONTROL SYSTEM .............................................................................................23
FIGURE 17: CLOSED-LOOP RESPONSE FOR K1=5 ...........................................................................................................................25
FIGURE 18: CLOSED-LOOP RESPONSE FOR K2=10 .........................................................................................................................25
FIGURE 19: CLOSED LOOP RESPONSE FOR K1=15..........................................................................................................................26
FIGURE 20: CLOSED LOOP RESPONSE FOR K1=20..........................................................................................................................26
FIGURE 21: CLOSED LOOP RESPONSE FOR K1=24..........................................................................................................................27
FIGURE 22: PITCH CONTROL SYSTEM WITH UNITY FEEDBACK............................................................................................................28
FIGURE 23: ROOT LOCUS ALONG WITH PERFORMANCE PARAMETERS .................................................................................................29
FIGURE 24: HEADING CONTROL SYSTEM WITH UNITY FEEDBACK .......................................................................................................30
FIGURE 25: ROOT LOCUS ALONG WITH THE PERFORMANCE PARAMETERS ...........................................................................................30
FIGURE 26: UNCOMPENSATED ROOT LOCUS OF PITCH CONTROL SYSTEM ...........................................................................................32
FIGURE 27: LEAD COMPENSATED SYSTEM BLOCK DIAGRAM ............................................................................................................34
FIGURE 28: COMPENSATED ROOT LOCUS OF PITCH CONTROL SYSTEM ................................................................................................35
FIGURE 29: COMPENSATED STEP RESPONSE OF PITCH CONTROL SYSTEM ...........................................................................................35
FIGURE 30: UNCOMPENSATED ROOT LOCUS OF HEADING CONTROL SYSTEM ......................................................................................37
FIGURE 31: LEAD COMPENSATED SYSTEM BLOCK DIAGRAM ............................................................................................................37
FIGURE 32: COMPENSATED ROOT LOCUS OF HEADING CONTROL SYSTEM ..........................................................................................38
FIGURE 33: COMPENSATED STEP RESPONSE OF HEADING CONTROL SYSTEM.......................................................................................38
FIGURE 34: PID CONTROLLER. ..................................................................................................................................................39
FIGURE 35: PID CONTROLLED STEP RESPONSE ..............................................................................................................................42
FIGURE 36: INPUT DISTURBANCE LOOP ........................................................................................................................................42
FIGURE 37: DISTURBANCE REJECTION OF PID ...............................................................................................................................43
FIGURE 38: WATER WAVE DISTURBANCE.....................................................................................................................................43
FIGURE 39: EQUIVALENT WATER WAVE DISTURBANCE ...................................................................................................................44
FIGURE 40: SIMULATION MODEL OF PID CONTROLLER WITH DISTURBANCE IN LOOP ............................................................................44
FIGURE 41: STEP RESPONSES OF PID WITH AND WITHOUT DISTURBANCES. .........................................................................................45
FIGURE 42: PID CONTROLLED STEP RESPONSE OF HEADING CONTROL SYSTEM ...................................................................................47
FIGURE 43: DISTURBANCE REJECTION OF PID ...............................................................................................................................48
FIGURE 44:STEP RESPONSE OF PID WITH AND WITHOUT DISTURBANCES ............................................................................................48
FIGURE 45: CONTROLLERLESS, LEAD COMPENSATED AND PID CONTROLLED STEP RESPONSE OF PITCH CONTROL SYSTEM ..........................49
FIGURE 46:CONTROLLERLESS, LEAD COMPENSATED AND PID CONTROLLED STEP RESPONSE OF HEADING CONTROL SYSTEM ......................50
FIGURE 47: ZOOMED VERSION OF FIGURE 45................................................................................................................................50
List of Tables
TABLE 1: SYSTEM CONFIGURATION PARAMETERS. .........................................................................................................................12
TABLE 2: SYSTEM CONFIGURATION PARAMETERS. .........................................................................................................................13
TABLE 3: PERFORMANCE PARAMETERS OF OPEN LOOP STEP RESPONSE ...............................................................................................17
TABLE 4: ROUTH TABLE FOR CLOSED LOOP PITCH CONTROL SYSTEM. ..................................................................................................18
TABLE 5: CLOSE LOOP RESPONSE OF THE SYSTEM AT DIFFERENT VALUES OF K1. ................................................................................21
TABLE 6: PERFORMANCE PARAMETERS OF OPEN-LOOP HEADING CONTROL .........................................................................................23
TABLE 7: ROUTH TABLE FOR HEADING CONTROL SYSTEM ................................................................................................................24
TABLE 8: CLOSE LOOP RESPONSE OF THE SYSTEM AT DIFFERENT VALUES OF K1. ................................................................................27
TABLE 9: REQUIRED PERFORMANCE PARAMETERS ..........................................................................................................................31
Abbreviations

PID Proportional Integral Derivative


LQR Linear Quadratic Regulator
OLS Open Loop System
CLS Close Loop System
MATLAB Matrix Laboratory
UUV Unmanned Underwater Vehicle
ROV Remotely Operated Vehicle
AUV Autonomous Underwater Vehicle
UFSS Unmanned Free-Swimming Submersible
Abstract
An unmanned Free-swimming submersible vehicle is to be controlled by using
heading and pitch control systems. The Complex Engineering problem is to control
UFSS vehicle by controlling heading and pitch control systems and meet the desired
performance specifications. This can only be achieved by analyzing the systems and
then designing a suitable controller which meets the desired criteria. The block
diagrams of transfer functions of subsystems are given so the first step to analyze the
system is to reduce the block diagram to obtain the transfer function. Using transfer
functions step responses of the systems can easily be determined by mathematical
techniques and MATLAB. Step responses are used to determine the stability of the
systems afterwards systems are analyzed in frequency domain using Bode plot to
check if system meet the performance specifications. To make the performance
parameters certain suitable controllers (PID, Lead or LQR) must be designed and
their performances are compared to suggest the most suitable controller for UFSS
vehicle.
Chapter 1

Introduction

As we know that 70% of the Earth is covered with water and in order to explore
various resources under oceans, mankind depends on developing underwater vehicles
and employing them. There are various types of underwater vehicles which can be
classified into two categories as manned and unmanned under water systems. In
various research and experiments under the water without human intervention we
need unmanned under water vehicle.[2]

Figure 1 : Pitch, Yaw and Roll angles[3]

Pitch Angle: Pitch angle is controlled by pitch control system. It controls the depth
of AUV.

Yaw Angle: Yaw angle is controlled by heading control system. It controls the
heading movements of AUV.
Chapter 1

1.1 Literature Review


Nowadays, there has been increasing interest in the use of autonomous underwater
vehicles (AUVs) to expand the ability to survey ocean areas. However, due to highly
nonlinear and strongly coupled dynamics of AUVs and the environmental
disturbances, it is always a challenge to design controller for AUVs.

Most existing AUVs use the traditional PID control structure to control various
parameters of vehicle. A number of researchers used sliding mode control (SMC) in
order to tackle the variations in hydrodynamic behavior. Further, the LQR has widely
been researched to control the AUV showing better performance than the PID and
the state feedback. However, LQR being a model-based control structure needs an
accurate mathematical model of AUV to tune Q and R matrices. This limits the
application of LQR as obtaining accurate dynamic model based on physical laws is
complicated and intricate. In this regard, intelligent modeling techniques like the
mathematical model based on laws of physics and yet can approximate the system
with high accuracy. However, these intelligent techniques demand substantial
computational power as controller based on the NN has to deal with computations
involved in each node and that based on the fuzzy logic has to execute complex
decision-making process. With limited on-board computational power embedded on
the AUV, use of controller based on artificial techniques becomes impractical and
unfeasible. Moreover, the presence of hydrodynamic disturbances caused by the
water waves has far been neglected in most control schemes studied and
implemented in literature. There is a need of controller that can control adaptively in
presence of hydrodynamic disturbances without requiring to model equations for
dynamics and kinematics of the vehicle.
Chapter 2

Reduction of block diagrams

2.1 Introduction
We are provided with the block diagrams of pitch and heading control systems for
UFSS. In order to analyze the systems and design controller for them it is necessary
to obtain the transfer function of these systems by using techniques of reducing
multiple subsystems.[1]

2.2 Deriving the Transfer Function


To derive the transfer function of the pitch and heading control systems we have to
take a look on their block diagrams.

Figure 2: Pitch Control System for UFSS [1]


Chapter 2

Figure 3 : Heading Control System of UFSS [1]

2.2.1 Pitch Control System of UFSS

We will first solve the pitch control system of UFSS to gets its closed-loop transfer
function. For our ease we will use the following block diagram.

Figure 4 : Pitch Control System


Chapter 2. Derivation of System’s Transfer Function

The system configuration parameters are defined in the Table 1. which are derived
from Figure 2.

Table 1: System Configuration Parameters.

Parameter Definition Value


G1 Pitch Gain -k1
G2 2
Elevator Actuator 𝑠+2

G3 −0.125(𝑠 + 0.435)
Vehicle dynamics (𝑠 + 1.23)(𝑠 2 + 0.226𝑠 + 0.0169)

H1 Pitch Rate sensor Gain -k2s

We use Figure 4 to solve it for transfer function of Pitch control system of UFSS. By
reducing multiple subsystems, we obtain

𝑃𝑖𝑡𝑐ℎ 𝜃(𝑠) 𝐺1.𝐺2.𝐺3


= = (2.1)
𝑃𝑖𝑡𝑐ℎ 𝑐𝑜𝑚𝑚𝑎𝑛𝑑 𝜃𝑐(𝑠) 1+𝐺3𝐺2𝐻1+𝐺1𝐺2𝐺3

Using equation 2.1 and putting the values from Table 1 the transfer function of pitch
control system obtained is as in the following equation.

0.25𝑘1𝑠+0.108𝑘1
𝜃(𝑠)
= (2.2)
𝜃𝑐(𝑠) 𝑠4 +3.45𝑠3 +(3.207+0.25𝑘2)𝑠2 +(0.6106+0.1088𝑘2+0.25𝑘1)𝑠+(0.1088𝑘1+0.0416)

So, equation 2.2 gives the associated closed-loop transfer function of Pitch
Control System
Chapter 2. Derivation of System’s Transfer Function

2.2.2 Heading Control System of UFSS


Similarly, we will reduce Heading Control system to get its closed-loop transfer
function. We will again use an equivalent diagram of heading control system in order
to solve and represent it easily.

Figure 5: Heading Control System

The system configuration parameters are defined in Table 2 which are derived from
Figure 3.

Table 2: System Configuration Parameters.

Parameter Definition Value

G1 Heading Gain -k1


G2 Rudder Actuator 2
𝑠+2

G3 Vehicle dynamic −0.125(𝑠 + 0.437)


(𝑠 + 1.29)(𝑠 + 0.193)

G4 Integrator 1
𝑠

H1 Yaw Rate Response -k2s


Chapter 2. Derivation of System’s Transfer Function

We use Figure 5 to solve it for transfer function of heading control system of UFSS. By
reducing multiple subsystems, we obtain

Heading Ψ(s) G1.G2.G3.G4


= = (2.3)
Heading command Ψc(s) 1+G3G2G3H1+G1G2G3G4

Using equation 2.3 and putting the values from Table 2 the transfer function of
heading control system obtained is as in the following equation.

0.25𝑘1𝑠+0.109𝑘1
𝛹(𝑠)
𝛹𝑐(𝑠)
= 𝑠 4 +3.483𝑠 3 +(3.215+0.125𝑘2)𝑠 2 +(0.498+0.25𝑘1+0.055𝑘2)𝑠+0.109𝑘1
(2.4)

So, equation 2.4 gives the associated closed-loop transfer function of Heading
Control System.
Chapter 3

Open Loop and Closed Loop


Response of the System

3.1 Introduction
Open-loop system, also referred to as non-feedback system, is a type of continuous
control system in which the output has no influence or effect on the control action of
the input signal. In other words, in an open-loop control system the output is neither
measured nor “fed back” for comparison with the input. Therefore, an open-loop
system is expected to faithfully follow its input command or set point regardless of
the final result.

A Closed-loop Control System, also known as a feedback control system is a control


system which uses the concept of an open loop system as its forward path but has one
or more feedback loops or paths between its output and its input. The reference to
“feedback”, simply means that some portion of the output is returned “back” to the
input to form part of the systems excitation. Closed-loop systems are designed to
automatically achieve and maintain the desired output condition by comparing it
with the actual condition.

3.2 Pitch Control System Response


In the previous chapter we have find the transfer function of Pitch Control System.
Now we will find the open loop and closed loop response of the system in order to
observe the stability of the system.

3.2.1 Open Loop System Response


To find the open loop response of the system we break the feedback and interconnect 2
blocks elevator actuator and vehicle dynamics as show in Figure 6 we multiply both
blocks to get open loop transfer function. Then we apply step input to the system to
observe its open loops step response.
Chapter 3. Open Loop and Closed Loop Response of the System

Figure 6: Open Loop Block Diagram [1].

𝜃(𝑠) −2 −0.125(𝑠+0.435)
= × (3.1)
𝛿𝑐(𝑠) 𝑠+2 (𝑠+1.23)(𝑠 2 +0.226𝑠+0.0169)

Now by multiplying these terms we obtain the open loop transfer function of Pitch
Control System of UFSS.

𝜃(𝑠) 0.25𝑠+0.109
= (3.2)
𝛿𝑐(𝑠) 𝑠 4 +3.456𝑠 3 +3.207𝑠 2 +0.611𝑠+0.042

Now we apply step input to the open loop transfer function and plot the open loop
step response of system using MATLAB.

Figure 7 : Open loop system response of Pitch Control system


Chapter 3. Open Loop and Closed Loop Response of the System

Peak Rise Settling Final


Time Time Time Value

45 sec 20.2 sec 31.7 sec 2.6


Table 3: Performance Parameters of open loop step response

To determine the stability of this open loop system we can observe the pole plot of this
system. The pole plot of this system is given below.

Figure 8: Pole Zero Map of Open Loop Pitch Control System

By observing the Figure 8 we can see that all the poles of the system lie in the left half
plane so the system is stable but its performance parameters are not acceptable.

Although the system has 4 poles but the two real poles are so away from the complex
poles that they will not affect the system. By using ‘Five time’ thumb rule[1] we can
say that only complex poles will dominate and system will behave like 2 pole
underdamped system.

3.2.2 Close Loop System Response


To find the close loop response of the system, we use equation 2.2.

0.25𝑘1𝑠+0.108𝑘1
𝜃(𝑠)
=
𝜃𝑐(𝑠) 𝑠4 +3.45𝑠3 +(3.207+0.25𝑘2)𝑠2 +(0.6106+0.1088𝑘2+0.25𝑘1)𝑠+(0.1088𝑘1+0.0416)

In order to find the closed loop step response and stability of the system we assume
that k2 in equation 2.2 is 1. So, if k2=1 equation becomes
Chapter 3. Open Loop and Closed Loop Response of the System

0.25𝑘1𝑠+0.108𝑘1
𝜃(𝑠)
= ( 3.3)
𝜃𝑐(𝑠) 𝑠4 +3.45𝑠3 +(3.457)𝑠2 +(0.719+0.25𝑘1)𝑠+(0.1088𝑘1+0.0416)

3.2.3 Stability

Now we will find the range of K in which the system will stable. To find the value of K
we will use the Routh-Hurwitz criterion method. From the Equation 3.3 we get
equation:

⇒ s4 + 3.45s3 + 3.457s2 + (0.719+0.25k1) s+(0.1088k1+0.0416)

S4 1 3.457 0.0416+0.109k1
S3 3.456 0.72+0.25k1
S2 11.228-0.25k1 0.14+0.377k1
S1 2
−0.0625𝑘1 + 1.3𝑘1 + 7.575
11.28 − 0.25𝑘1
S0 0.144+0.377k1

Table 4: Routh Table for closed loop pitch control system.

Looking at the first column, the s4 and s3 rows are positive. Thus, all elements of the
first column must be positive for stability. For the first column of the s2 rows to be
positive, -∞< K1< 44.91. For the first column of the s1 row to be positive, the
numerator must be positive, since the denominator is positive from the previous step.
The solution to the quadratic term in numerator yields roots of K1=-4.685 and 25.87.
Thus, for a positive numerator -4.675 < K1 < 25.87. Finally, for the first column of s0
row to be positive -0.382 < K1 < ∞. Using all three conditions, stability will be ensured
if -0.382 < K1 < 25.87.

Now we will plot the step response of closed loop Pitch Control system of UFSS in
MATLAB using equation 3.3 and condition -0.382 < k1 < 25.87. we will use different
values of K1.
Chapter 3. Open Loop and Closed Loop Response of the System

Figure 9: Closed loop response for K1=5

Figure 10: Closed loop response for K1=10


Chapter 3. Open Loop and Closed Loop Response of the System

Figure 11: Closed loop response for K1=15

Figure 12: Closed loop response for K1=20


Chapter 3. Open Loop and Closed Loop Response of the System

Figure 13: Closed loop response for K1=25

From the Figure 9, Figure 10, Figure 11, Figure 12 & Figure 13we constructed the Table 5
which provide the information of the Percentage Overshoot , Rise time, Settling time and
Steady state error % of the system with different values of K.

Table 5: Close Loop Response of the System at Different Values of K1.

Value of K1 % overshoot Rise time (s) Settling time (s) Steady State
Error %
5 33.5 2.06 13.5 7.8
10 55.4 1.32 18.3 4.4
15 71.8 1.05 28.6 3.2
20 84.7 0.895 56.4 2.6
25 95.4 0.797 385 2.2
Chapter 3. Open Loop and Closed Loop Response of the System

3.3 Heading Control System Response


Now as we have found the open and closed loop response of pitch control system of
UFSS we will now find the open and closed loop response of the Heading control
system of UFSS.

3.3.1 Open Loop System Response


To find the open loop response of the system we break the feedback and interconnect 3
blocks Rudder actuator, vehicle dynamics and integrator as show in Figure 14. we
multiply these blocks to get open loop transfer function. Then we apply step input to
the system to observe its open loops step response.

Figure 14: Open loop Block Diagram

𝜃(𝑠) −2 −0.125(𝑠+0.437) 1
𝛿𝑐(𝑠)
= × × (3.4)
𝑠+2 (𝑠+1.29)(𝑠+0.193) 𝑠

Now by multiplying these terms we obtain the open loop transfer function of Heading
Control System of UFSS.

𝜃(𝑠) 0.25𝑠+0.109
= (3.5)
𝛿𝑐(𝑠) 𝑠 4 +3.483𝑠 3 +1.638𝑠 2 +0.50𝑠

Now we apply step input to the open loop transfer function and plot the open loop
step response of system using MATLAB.
Chapter 3. Open Loop and Closed Loop Response of the System

Figure 15: Open loop step response of Heading control

By observing the Figure 15.

Peak Rise Settling Final


Time Time Time Value

infinite infinite infinite infinite

Table 6: Performance parameters of Open-loop heading control

To determine the stability of this open loop system we can observe the pole plot of this
system. The pole plot of this system is given below.

Figure 16: Pole zero map of open loop heading control system
Chapter 3. Open Loop and Closed Loop Response of the System

By observing the Figure 16 we can see that all the poles of this system are not in the
left half plane. 1 pole lies on origin so according to Routh-Hurwitz Criterion this
system is marginally stable. Its performance parameters are also infinite as shown in
Figure 15.

3.3.2 Close Loop System Response

To find the close loop response of the system, we use equation 2.4.

0.25𝑘1𝑠+0.109𝑘1
𝛹(𝑠)
𝛹𝑐(𝑠)
= 𝑠 4 +3.483𝑠 3 +(3.215+0.125𝑘2)𝑠 2 +(0.498+0.25𝑘1+0.055𝑘2)𝑠+0.109𝑘1

In order to find the closed loop step response and stability of the system we assume
that k2 in equation 2.4 is 1. So, if k2=1 equation become

𝛹(𝑠) 0.25𝑘1𝑠+0.109𝑘1
𝛹𝑐(𝑠)
= 𝑠 4 +3.483𝑠 3 +(3.34)𝑠 2 +(0.553+0.25𝑘1)𝑠+(0.109𝑘1)
( 3.6)

3.3.3 Stability

Now we will find the range of K in which the system will stable. To find the value of K
we will use the Routh-Hurwitz criterion method. From the Equation 3.6 the we get the
Equation:

⇒ s4 + 3.483s3 + 3.34s2 + (0.553+0.25k1) s+(0.109K1)

S4 1 3.34 0.109K1
S3 3.483 0.553+0.25K1
S2 38.6-0.87K1 1.323K1
S1 −0.22𝑘12 + 4.56𝑘1 + 21.3
38.6 − 0.87𝐾1
S0 1.32K1
Table 7: Routh Table for Heading Control System

Looking at the first column, the s4 and s3 rows are positive. Thus, all elements of the
first column must be positive for stability. For the first column of the s 2 rows to be
positive, -∞< K1< 44.37. For the first column of the s1 row to be positive, the
numerator must be positive, since the denominator is positive from the previous step.
The solution to the quadratic term in numerator yields roots of K1=-3.79 and 24.5.
Thus, for a positive numerator -3.79 < K1 < 24.5. Finally, for the first column of s0 row
to be positive -∞ < K1 < ∞. Using all three conditions, stability will be ensured if
- 3.790 < K1 < 24.5.
Chapter 3. Open Loop and Closed Loop Response of the System

Now we will plot the step response of closed loop Heading Control system of UFSS in
MATLAB using equation 3.6 and condition -3.790 < k1 < 24.5. we will use different
values of K1.

Figure 17: Closed-Loop Response for K1=5

Figure 18: Closed-Loop Response for K2=10


Chapter 3. Open Loop and Closed Loop Response of the System

Figure 19: Closed Loop Response for K1=15

Figure 20: Closed Loop Response for K1=20


Chapter 3. Open Loop and Closed Loop Response of the System

Figure 21: Closed Loop Response for K1=24

From the Figure 17, Figure 18, Figure 19, Figure 20 & Figure 21 we constructed the Table 8
which provide the information of the Percentage Overshoot , Rise time, Settling time and
Steady state error % of the system with different values of K.

Table 8: Close Loop Response of the System at Different Values of K1.

Value of K1 % overshoot Rise time (s) Settling time (s) Steady State
Error %
5 36.3 2.13 17.9 0
10 58.3 1.34 19.2 0
15 74.5 1.06 32.2 0
20 87.3 0.903 67.8 0
24 95.8 0.821 396 0
Chapter 4. Analysis in Frequency Domain

Chapter 4

Analysis in Frequency Domain

4.1 Introduction
Analysis of a system in the frequency domain can be done through the following
technique

 Root Locus

To analyze the system in the frequency domain we will plot the root locus of both
systems and observe the stability of system and performance specifications.

4.2 Root locus of the System


The Root locus of the system will give us idea about the poles and zeros of the system
and allow us to analyze the performance parameters such as settling time, percent
overshoot, damping ratio, etc. To analyze the performance parameters using Root
Locus technique we need to find the open loop transfer function for both systems i.e.
Pitch Control System and Heading Control System.

4.2.1. Pitch Control System

The open loop transfer function along with the feedback to be used in observing
performance parameters are show in the diagram below.

Figure 22: Pitch Control System with unity Feedback


Chapter 4. Analysis in Frequency Domain

Now we will use MATLAB to do the frequency analysis for the system using root locus
techniques.

Figure 23: Root Locus along with performance parameters

By observing the Figure 23 we can analyze that the system doesn’t meets the
performance parameters, in order to meet the performance parameters, the dominant
poles should lie in the unshaded region. In diagram we can clearly see that the
dominant poles are not in the unshaded region. The rays from the origin represents
the overshoot parameter while the vertical lines show the settling time
requirements. To find the steady state error for step response we can use this
equation

1
𝑠( 𝑠 )
e∞ = lim ( ) (4.1)
𝑠→∞ 1+𝐺(𝑠)

By using the above stated equation steady state error = 0.071


Chapter 4. Analysis in Frequency Domain

4.2.2. Heading Control System

Similarly, we will analyze the performance parameters of the heading control system.
The open loop transfer function along with unity feedback for heading control system
is illustrated below:

Figure 24: Heading Control System with unity Feedback

Using Root locus, we will observe the performance parameters in MATLAB:

Figure 25: Root Locus along with the performance parameters

Similarly, as in pitch control system, this system doesn’t meet the performance
parameters as dominant poles are in shaded region. So, by observing the Figure 25 we
can analyze that the settling time and overshoot requirements are not met. Now to
calculate the steady state error we can use the equation 4.1. The steady state error
is zero in this system.
Chapter 5

Transfer function for Lead


Compensator

5.1 Introduction
In this chapter our task is to design a lead compensator for Pitch control System and
Heading Control System of UFSS. Our task is to design the lead compensated
system to meet the following criteria.

Parameters Pitch Angle Control Heading Control


Max.OS 22 22
Settling Time(s) 4 4
Rise Time(s) 1 1
Steady State Error 0.02 0.02
Table 9: Required performance parameters

5.2 Pitch Control System


To meet this criterion first we will design the lead compensator using the following
equation from textbook.[1]

−ln(%𝑜𝑠
100
)
∵ ζ=
√𝜋 2 + ln2 (%𝑜𝑠
100
)

% OS is 22 so:

22
−ln(100 )
𝜁= = 0.4342
√𝜋2 +ln2 (%𝑜𝑠
100 )
Now as we know that

4
ts =
𝜁 𝑤𝑛

As our required settling time = 4 so

4
wn = = 2.3
0.4342∗4

We can now use these values of 𝜁 and wn in our calculations for the design of lead
compensator for Pitch Control System of UFSS.

5.2.1 Lead Compensator


we will use the design via root locus method. So, first we find the root locus
parameters. As our open loop transfer function is shown in the Equation below. As we
have already taken K2=1, and K1=5 which we find after plotting the range of Routh
Hurwitz criterion[3.2.3].

0.25𝑘1(𝑠+0.435)
G(s) =
(𝑠+2)(𝑠+1.23)(𝑠2 +0.226𝑠+0.0169)+0.25𝑠(𝑠+0.435)

We will use MATLAB to plot the root locus parameter of this pitch control system.

Figure 26: Uncompensated root locus of Pitch Control System


Now we will design the compensator to meet the performance parameters as
described in Table 9.

So, we will get the angle θ = cos−1ζ = 64.2◦

sd = −J d + jωd (5.1)

Where

J d = ζ × ωn = 0.432 × 2.3 = 1 (5.2)

ωd = J d × tan(θ) = 1 ×tan (64.2◦) = 2.1 (5.3)

So, the Equation 5.1 will be

sd = −1 + j2.1 (5.4)

Now we will get the Value of K through the Magnitude Criterion which is define in the
given equation.

1
K= (5.5)
|𝐺(𝑠)𝐻(𝑠)|

By putting the transfer function and value of sd in the above equation we find K

1
K= 0.25𝑘1(𝑠+0.435)
| |
(𝑠+2)(𝑠+1.23)(𝑠2 +0.226𝑠+0.0169)+0.25𝑠(𝑠+0.435)

1
K= 0.25𝑘1((−1+𝑗2.1)+0.435)
|((−1+𝑗2.1)+2)((−1+𝑗2.1)+1.23)((−1+𝑗2.1)2 |
+0.226(−1+𝑗2.1)+0.0169)+0.25(−1+𝑗2.1)((−1+𝑗2.1)+0.435)

By solving the above equation, the value of k1 is obtained


K= 8.977

Now the angle criterion is defined as

∑ ∠Zeros - ∑ ∠ Poles = 180 × (2k+1)


We select an arbitrary zero at s=-1 (s+1) now using root locus program sum the angles
from both this zero and the uncompensated system’s poles and zeroes, using the
design point as a test point.

0.25(5)((−1 + 𝑗2.1) + 0.435)(−1 + 𝑗2.1) + 1)


|
((−1 + 𝑗2.1) + 2)((−1 + 𝑗2.1) + 1.23)((−1 + 𝑗2.1)2 + 0.226(−1 + 𝑗2.1) + 0.0169) + 0.25(−1 + 𝑗2.1)((−1 + 𝑗2.1) + 0.435)

The above equation will give angle -30.5°.

So, θlead will be

θlead = 180-(- 29.7)°


= 209.7°

By using the sd and θlead we will draw the desired poles of compensator in s-plane to
drive the transfer function of the lead compensator.

2.1
= tan (29.7)
𝑝𝑐−1

Pc = 4.68

So, the transfer function of the lead compensator is

8.97(𝑠+1)
G(s)lead =
(𝑠+4.68)

Figure 27: Lead Compensated System Block Diagram


8.97(𝑠+1) 0.25𝑘1(𝑠+0.435)
Where G(s)lead = and G(s) =
(𝑠+4.68) 2
(𝑠+2)(𝑠+1.23)(𝑠 +0.226𝑠+0.0169)+0.25𝑠(𝑠+0.435)

Now we will plot the compensated root locus and step response of the pitch control
system.

Figure 28: Compensated root locus of Pitch control system

Figure 29: Compensated Step Response of Pitch Control System


5.3 Heading Control System

Similarly, to meet this criterion first will design the lead compensator using the
following equation from textbook.[1]

−ln(%𝑜𝑠
100
)
∵ ζ=
√𝜋 2 + ln2 (%𝑜𝑠
100
)

% OS is 22 so:

22
−ln(100 )
𝜁= = 0.4342
√𝜋2 +ln2 (%𝑜𝑠
100 )

Now as we know that

4
ts =
𝜁 𝑤𝑛

As our required settling time = 4 so

4
wn = = 2.3
0.4342∗4

We can now use these values of 𝜁 and wn in our calculations for the design of lead
compensator for Heading Control System of UFSS.

5.3.1 Lead Compensator


Similarly, will use the design via root locus method. So, first we find the root locus
parameters. As our open loop transfer function is shown in the Equation below

0.25𝑘1(𝑠+0.437)
G(s) = 𝑠(𝑠+2)(𝑠+1.29)(𝑠+0.193)+0.25𝑠(𝑠+0.437)
We will use MATLAB to plot the root locus parameter of the Heading Control System.

Figure 30: Uncompensated Root locus of Heading Control System

Now in order to meet the performance parameters we will design the lead
compensator in the same way as we did for Pitch Control System. We will repeat every
step to get the transfer function of lead compensator for the heading control system.
The transfer function which we get after calculations is:

9.1(𝑠+0.5)
G(s)lead =
(𝑠+8)

Now we will use this compensator to plot the compensated root locus.

Figure 31: Lead Compensated System Block Diagram

9.1(𝑠+0.5) 0.25𝑘1(𝑠+0.437)
Where G(s)lead = and G(s) =
(𝑠+8) 𝑠(𝑠+2)(𝑠+1.29)(𝑠+0.193)+0.25𝑠(𝑠+0.437)
Now we will plot the compensated root locus and step response of the heading control
system.

Figure 32: Compensated Root Locus of Heading Control System

Figure 33: Compensated Step Response of Heading Control System


Chapter 6

PID Controller Design and Tuning


Gains

6.1 Introduction
The PID Controlled contains 3 different system in it which are working in parallel and
after summing the output it will control the plant system. Our task is to design the
PID Controller for Pitch Angle Control and Heading Control, the required step
response must meet the following criteria.

Parameters Pitch Angle Control Heading Control


Max.OS 22 22
Settling Time(s) 8 8
Rise Time(s) 5 5
Steady State Error 0.02 0.02

6.2 Designing the PID Controller


To design the PID Controller first we have to take a look on the internal part of PID
Controller which is shown in the Figure 34 which shows the Proportional , Integral
and Derivative block in the PID Controller.

Figure 34: PID Controller.


Chapter 6. PID Controller Design and Tuning Gains

6.2.1 Pitch Control System

To tune the gains of PID we must find the damping ratio and the natural frequency

values

According to our requirement.

−ln( OS%
100 )
∵ ζ= . (6.1)
OS%
π2 + ln2( 100 )

Here we have OS% = 22


22
−ln(100 )
𝜁= = 0.4342
√𝜋 2 + ln2 (%𝑜𝑠
100
)

Now as we know that

4
ts =
𝜁 𝑤𝑛

As our required settling time = 8 so

4
wn = = 1.15
0.4342∗8

Now we use ωn & ζ values in designing the PID Controller. Now we will find the sd. So,
we will get the angle θ = cos−1ζ = 64.2◦

sd = −J d + jωd (6.2)

Where

J d = ζ × ωn = 0.432 × 1.15 = 0.5 (6.3)

ωd = J d × tan(θ) = 1 ×tan (64.2◦) = 1 (6.4)

So, the Equation 6.2 will be

sd = −0.5 + j1 (6.5)

New we convert the Equation 6.5 into Polar form.

sd = αd < β d ° = 1.12 ∠ 116.5° (6.6)


Chapter 6. PID Controller Design and Tuning Gains

Now we will put equation 6.5 in Pitch controls transfer function. k1=5, k2=1.

0.25𝑘1(𝑠+0.435)
G(s) =
(𝑠+2)(𝑠+1.23)(𝑠2 +0.226𝑠+0.0169)+0.25𝑠(𝑠+0.435) (6.7)

0.25(5)((−0.5 + 𝑗1) + 0.435)


((−0.5 + 𝑗1) + 2)((−0.5 + 𝑗1) + 1.23)((−0.5 + 𝑗1)2 + 0.226(−0.5 + 𝑗1) + 0.0169) + 0.25(−0.5 + 𝑗1)((−0.5 + 𝑗1) + 0.435)

After solving convert this equation into polar form

G(s) = α < β◦ = 0.50 ∠ 150° (6.8)

Now we will find the value of gains

−sin(𝛽d°+ 𝛽°)
Kp =
𝛼 sin 𝛽

−sin(116.5°+ 150°)
Kp = = 3.9
0.50 sin 150

sin( 𝛽°)
Kd =
𝛼d.𝛼 sin 𝛽d

sin( 150°)
Kd = = 1
1.12∗0.50 sin 116.5

Now as we know kp and kd we can find ki by hit and trial method to find ki and
further refine the Gains in order to meet parameters. The final values which we
obtain after processing are as follow

Kp = 3.4

Ki = 0.15

Kd = 1.5

After tuning the Gains, we get the transfer function of PID Controller
Chapter 6. PID Controller Design and Tuning Gains

𝐾𝑖
G(s)PId = Kp + +Kd s
𝑠

To obtain the PID controlled step response multiply

G(s)lead × G(s)

Plot the PID controlled step response by using MATLAB:

Figure 35: PID Controlled Step Response

6.2.1.1 Disturbance Rejection

Figure 36: Input Disturbance loop

In Figure 36 we can see that there is added disturbance in the closed loop system. In
our case Controller is PID and Plant is Pitch Control System. We want to observe the
disturbance rejection capability of our designed PID controller. To observe this, we
Chapter 6. PID Controller Design and Tuning Gains
will use an advanced method with the help of MATLAB.

For this purpose, we used built-in-commands of MATLAB

>> pidtool(G,'pid')
>> Reference = getPIDLoopResponse(d,y,"closed loop");
>> Disturbance = getPIDLoopResponse(d,y,"input disturbance")

Figure 37: Disturbance Rejection of PID

From Figure 37 we can observe the Disturbance Rejection Capability of Designed PID
Controller. Now we are provided with the approximate model of the water wave
disturbance for UFSS as shown in Figure 38.

.
Figure 38: Water Wave Disturbance

Now we will try to make this model using Simulink Signal Builder Block. The signal
which we generate to be used as disturbance is shown in
Chapter 6. PID Controller Design and Tuning Gains

Figure 39: Equivalent Water wave Disturbance

Afterward, with the help of Simulink we add disturbance in the loop and observe the
response of PID controller in case of disturbances. The setup which we implement in
Simulink is as in Figure 40.

Figure 40: Simulation Model of PID controller with Disturbance in loop


Chapter 6. PID Controller Design and Tuning Gains

The Figure 41 shows the behavior of PID in case of disturbances. In order to compare
the results, we also add reference signal and undisturbed PID response in the graph.

Figure 41: Step Responses of PID with and without disturbances.

By observing Figure 41 we can see that the disturbed and undisturbed step response
of PID controller. We can see clearly that how efficiently PID controller rejects the
disturbance and returns to its original form. Although there is very small variation in
both responses but that can be more refined by means of designing.

6.2.2 Heading Control System

As in 6.2.1 we will find the values of gains of PID controller for heading Control
System.

According to our requirement.

−ln( OS%
100 )
∵ ζ= . (6.9)
OS%
π2 + ln2( 100 )

Here we have OS% = 22


22
−ln(100 )
𝜁= = 0.4342
√𝜋 2 + ln2 (%𝑜𝑠
100
)

Now as we know that

4
ts =
𝜁 𝑤𝑛
Chapter 6. PID Controller Design and Tuning Gains

As our required settling time = 8 so

4
wn = = 1.15
0.4342∗8

Now we use ωn & ζ values in designing the PID Controller. Now we will find the sd. So,
we will get the angle θ = cos−1ζ = 64.2◦

sd = −J d + jωd (6.10)

Where

J d = ζ × ωn = 0.432 × 1.15 = 0.5 (6.11)

ωd = J d × tan(θ) = 1 ×tan (64.2◦) = 1 (6.12)

So, the Equation 6.2 will be

sd = −0.5 + j1 (6.13)

New we convert the Equation 6.5 into Polar form.

sd = αd < β d ° = 1.12 ∠ 116.5° (6.14)

Now we will put equation 6.13 in heading controls transfer function. k1=5, k2=1.

0.25𝑘1(𝑠+0.437)
G(s) = 𝑠(𝑠+2)(𝑠+1.29)(𝑠+0.193)+0.25𝑠(𝑠+0.437) (6.15)

0.25(5)((−0.5 + 𝑗1) + 0.437)


((−0.5 + 𝑗1)(−0.5 + 𝑗1) + 2)((−0.5 + 𝑗1) + 1.29)((−0.5 + 𝑗1) + 0.193) + 0.25(−0.5 + 𝑗1)((−0.5 + 𝑗1) + 0.437)

After solving convert this equation into polar form

G(s) = α < β◦ = 0.50 ∠ 150.5° (6.16)

Now we will find the value of gains

−sin(𝛽d°+ 𝛽°)
Kp =
𝛼 sin 𝛽
Chapter 6. PID Controller Design and Tuning Gains

−sin(116.5°+ 150°)
Kp = = 3.9
0.50 sin 150

sin( 𝛽°)
Kd =
𝛼d.𝛼 sin 𝛽d

sin( 150°)
Kd = = 1
1.12∗0.50 sin 116.5

Now as we know kp and kd we can find ki by hit and trial method to find ki and
further refine the Gains in order to meet parameters. The final values which we
obtain after processing are as follow

Kp = 3.4

Ki = 0.15

Kd = 1.9

Now as we have kp, ki and kd we can plot the PID controlled step response of heading
control system.

Figure 42: PID Controlled Step Response of Heading Control System

6.2.2.1 Disturbance Rejection

To find the response of the PID regarding the rejection of input disturbance we will
Chapter 6. PID Controller Design and Tuning Gains

follow the same procedure as in 6.2.1.1. Then we will plot the step response along with
the input disturbance rejection of the designed PID.

Figure 43: Disturbance Rejection of PID

By following the same procedure as in pitch control system, we add a disturbance in


the system to check its response in case of water wave disturbances. We use Simulink
for this purpose by modelling similar to Figure 40. Afterwards, we plot Figure 44 to
observe the step response of designed PID in case of disturbances. For our reference
we can also plot undisturbed response and reference signal.

Figure 44:Step Response of PID with and without disturbances

By observing Figure 44 we can see that the disturbed and undisturbed step response
of PID controller. The PID controller in not very effective when disturbance comes in
the heading control system of UFSS. It almost takes more than 10sec to reject the
disturbance and returns to its original form.
Chapter 7

Performance Comparison of Lead


and PID

7.1 Introduction
The Performance comparison of Lead and PID can be done through the step
responses of both the controlled system. In this chapter we will explain that how the
performance wise the both Controllers are different.

7.2 Pitch Control System Step Response


When we talk about the comparison of different controllers in-term of its response on
the system, then we plot the step response of every Control system which is based on
different controllers. In our case we design the Lead Compensator and the PID
Controller. So, we want to compare them through its step responses. So, the Figure 45
& Figure 46 show the step response of the 2 different controllers and uncontrolled step
response of the both systems.

Figure 45: Controllerless, Lead Compensated and PID Controlled Step Response of Pitch Control System
Figure 46:Controllerless, Lead Compensated and PID Controlled Step Response of Heading Control
System

7.3 Comparison of PID and Lead Controllers

We use two different controllers to control the UFSS’s subsystem i.e. Pitch Control
System and Heading Control System. The 2 controllers which we design are lead
compensator and PID controller. Although both controllers fulfill our needs yet
there are some differences which make one controller better than the other. By
observing the graphs of step responses, it is clear that PID behaves more efficiently
and effectively as compared to the lead compensator. Moreover, PID designed needs
less mathematical calculations and can easily be auto tuned using MATLAB.
However, Lead controller is more efficient with respect to overshoot but it is not every
efficient with respect to settling time.

Figure 47: Zoomed version of Figure 45


From Figure 47 it can be observed that PID behaves more responsibly than Lead
compensator as it fulfills the performance parameters more specifically.

In this work, PID controller have shown satisfactory performance in controlling pitch
and heading control systems of UFSS under hydrodynamic disturbances. Its
comparison with the Lead compensator has further advocated effectivity of PID
controller.
Appendix A

MATLAB Coding of Controlled


System’s Step Response

A.1 MATLAB Code of Step Responses of all Designed


Controllers for Pitch Control System of UFSS

k1=5;
k2=1;
s=tf('s');
openloop_Pitch=(0.25*k1*(s+0.435))/((s+2)*(s+1.23)*(s^2+0.226*s+0.0169)+0.25*s*(s+0.435));
leadcompensator=(8.97*(s+1))/(s+4.68);
kp=3.4;
ki=0.15;
kd=1.5;
pidcontroller=pid(kp,ki,kd);
compensated=feedback(leadcompensator*openloop_Pitch,1);
pidcontrolled=feedback(pidcontroller*openloop_Pitch,1);
controllerless=feedback(openloop_heading,1);
step(controllerless,pidcontrolled,compensated)

A.2 MATLAB Code of Step Responses of all Designed


Controllers for Heading Control System of UFSS

k1=5;
k2=1;
s=tf('s');
openloop_heading=(0.25*k1*(s+0.437))/(s*(s+2)*(s+1.29)*(s+0.193)+0.25*s*(s+0.437));
leadcompensator=(9.1*(s+0.5))/(s+8);
compensated=feedback(leadcompensator*openloop_heading,1);
kp=3.4;
ki=0.15;
kd=1.9;
pidcontroller=pid(kp,ki,kd);
pidcontrolled=feedback(pidcontroller*openloop_heading,1);
controllerless=feedback(openloop_heading,1)
step(controllerless,pidcontrolled,compensated)
References

[1] N.S. Nise. Control Systems Engineering. Wiley, 2011. ISBN 9780470646120. URL
https://books.google.com.pk/books?id=7sVfbwAACAAJ.

[2] Bhupendra Kumar and Ekta Tamrakar. Modeling and simulation of pitch and yaw
angle control in unmanned under water vehicle. Research journal of Engineering
Sciences Vol. 5(4) 11-19, April (2016) E-ISSN 2278-9472 Res. J. Engineering Sci.

[3] G.V. Lakhekar & L.M. Waghmare. Robust maneuvering of autonomous


underwater vehicle. Intelligent Service Robotics 10, 195-212(2017).

[4] H. F. Murcia and A. E. Gonzlez. Performance comparison between pid and po


control on a 2-wheel inverted pendulum robot. In 2016 IEEE Colombian Conference
on Robotics and Automation (CCRA), pages 1–6, Sep. 2016. doi: 10.1109/CCRA.
2016.7811420.

[5] I.Abbasi, S.S.S.Ali, M.Ovinis & W.Naeem. U-model based Controller Design for an
Unmanned Frees swimming Submersible Vehicle under Hydrodynamic
Disturbances. Indian Journal of Geo Marine Science Vol 46 (4), April 2017.

You might also like