SlideShare a Scribd company logo
1 of 18
MODELING, ANALYSIS AND
SIMULATION OF DYNAMIC
SYSTEMS USINGCONTROL
TECHNIQUES IN MATLAB AND
RESPONSES OF A PID
CONTROLLER IN SIMULINK.
1
Table of Contents:
1. Abstract…………………………………………………………………………………3
2. Introduction……………………………………………………………………………..4
3. MATLAB for control systems………………………………………………………….5
3.1. Mathematical model and transfer function………………………………………...5
3.2. Performance analysis of the S-M-D control system…………………….................6
3.3. Stability of a control system in MATLAB…………………………...…………....7
3.4. Most common techniques in control using MATLAB………………………….....8
4. SIMULINK for control systems………………………………………………………..9
4.1. Building a simple system using Simulink…………………………………………9
4.2. PID controller using Simulink……………………………………………………..9
5. Simulations……………………………………………………………………………..11
5.1 Using MATLAB…………………………………………………………………....11
5.2 Using SIMULINK.............................................................................................…....15
6. Conclusions……………………………………………………………………………..17
7. References………………………………………………………………………………18
2
ABSTRACT
Our project on “Modeling, analysis and simulation of dynamic systems using control techniques
in MATLAB and responses of a PID controller in SIMULINK” gives an insight on the diverse
usage of MATLAB and its functions. Starting with the importance of MATLAB, we will cover
the basic concepts required to understand its usage. Further we will understand how to
implement mathematical model of a control system along with its transfer function. All this
application of transfer function will be made clear through a sample S-M-D (Spring Mass
Damper) system. We will realize that this system is a second-order system by determining the
order of its characteristic equation. Further it will be shown how MATLAB helps in determining
the stability of a system using Root-locus and Bode plot method. These two techniques are
already mentioned in the Mechatronics subject, here we will do there analysis and will be able to
understand there actual application with a real world example. Later in this report we will know
about SIMULINK and PID (Proportional, Integral and Differential) controllers. These controllers
will be implemented in SIMULINK from which we will get to know how PID is an important
tool for determining the response (open and closed loop) of a system. In this case also our system
would be the previously mentioned S-M-D system. All this will result in understanding the open
and closed loop response through the plot formed by SIMULINK.
We would like to inform that this report just gives the overview and theoretical aspects to our
research project till where we have completed. The reader won’t be able to see any modelling
and simulation results as the project is being carried out. We have tried to give a brief idea of our
approach and the things which will be done in this project. The final modelling, simulation and
results will be presented in the final review later in this semester.
3
INTRODUCTION
MATLAB is a multi-paradigm programming language and numerical computing environment,
which has been developed through the years for scientific and engineering calculations.
MATLAB provides matrix manipulation, plotting of any function as well as data, implementing
algorithms and interfacing with programs written in other languages. It combines mathematical
computing and visualization along with powerful language providing an efficient and flexible
environment for technical computing. It has various built-in functions which can be used to solve
specific problems. It is also possible to create and add any function to suit any scientific or
engineering application. Since MATLAB is a programming tool in nature, it is possible to
interact with other programming languages such as C++ by an external interface to run those
programs within MATLAB. It provides the flexibility to accept data to be analyzed and produce
the necessary output. MATLAB has several toolboxes to support different applications. Apart
from MATLAB, Simulink is an interactive tool for modeling, simulating, and analyzing dynamic
systems. It enables engineers to create graphical block diagrams, evaluate system performance,
and analyze multi-domain dynamical systems. Simulink integrates effortlessly with MATLAB
and tightly integrates with the Stateflow for modeling event-driven behavior.
Simulink is the perfect tool for control systems, Digital Signal Processing and communication
system related design and other simulations. Analyzing and simulating the behavior of a system
is important to be able to understand its dynamics and therefore be able to design an appropriate
controller to attain the desired response. Some control design techniques will be presented to
show how to design a controller and implement them in both MATLAB and SIMULINK.
4
MATLAB FOR CONTROL SYSTEMS
MATLAB provides a toolbox that can assist drastically in design and analysis of control systems
based on the mathematical models of physical systems. On obtaining the mathematical model of
system, the transfer function of this system can be determined easily.
Mathematical model and transfer function
We will consider a typical spring- mass-damper system for analysis with the assistance of
MATLAB. Mathematical equation expressing the motion of the mass in system is:
M x (t) + fv x(t) + kx(t) = f (t) (1)
Where, M is the mass, x·t is the linear acceleration of the mass, fv is the coefficient of viscous
friction, x·t is the linear velocity, k is the spring constant, x t is the displacement and f t the
applied force. Assuming all initial conditions are zeros and taking the Laplace transform of
Equation (1) yields:
Ms2 Xx(s) + fvs X (s) + ks X (s) = F (s) (2)
Transfer function of the system is given as:
G(s) = X (s)/F (s) =1/ (Ms2 + f s + k) (3)
Once we get the transfer function, the analysis of the system can be carried out in MATLAB.
First step is to assign values to the parameters M, fv and k then the transfer function can be
entered as polynomial of the numerator and denominator and hence the transfer function can be
produced as follows:
5
>; M = 1, fv = 2, k = 2;
>> num = [1];den = [M fv k];
>> TF = tf (num,den)
Transfer function:
1/ (S2 + 2 s + 2)
The poles and zeros of the system will be:
>> p = pole (TF); z = zero (TF)
p = -1.0000 + 1.0000i
-1.0000 +1.0000i
z = Empty matrix: 0 by 1
It can be seen that the z is an empty matrix because the system only has two poles but no zeros.
The output response of the system for a step input is determined and plotted using the following
lines:
>> step (TF)
>> xlabel ('Time (sec)')
>> ylabel ('The output x(t) (m)')
>> title ('The step response of S-M-D
system')
The output response can be obtained for different values of any of the parameters.
Performance analysis of the S-M-D control system
Feedback systems are the most successful control systems which can be found in many
applications everywhere. This success is due to the following reasons:
 They reject the effect of the disturbance in the system.
 They reduce and in some cases eliminate the steady-state errors.
 They allow the adjustment of the transient response of the system.
 They decrease the sensitivity of the system to the variation in the process parameters.
6
We will consider the transfer function of the S-M-D system obtained above to study and analyze
the performance along with the characteristics of the system. The transfer function is rewritten in
terms of the characteristic equation of a second order system as:
The characteristic parameters of the second-order system such as the steady-state error, ess,
maximum overshoot, pos, the rise time, Tr, the peak time, Tp, the settling time, Ts, and the
damping ratio, can be attained by executing a MATLAB function stored in MATLAB file called
gsos.m. On executing gsos.m, the user have to enter the system polynomial (i.e. the numerator
and denominator of the system), then it will produce the values of all the mentioned parameters
along with a plot of the output response.
Stability of a control system in MATLAB
Stability is a fundamental very important in control engineering. An unstable system is neither
useful nor practical when a precise response is needed. A stable system is a system which
produces a bounded output for every bounded input. Furthermore, all poles of the transfer
function of a stable system must have a negative real part (i.e. all poles must lay on the left half
of the plane). Routh-Hurwitz method is one of the most simple and easy tests to determine the
stability of a system. The method is based on analyzing the characteristic equation to determine
the stability of the system as well as number of poles in the unstable region (i.e. the right-half
plane). MATLAB has the ability to assist the user by providing a simple and accurate method to
determine the stability as well as the range of the gain that makes the system stable.
7
Most common techniques in control using MATLAB
Now we will explore some common techniques to study and analyze the relative stability of
control systems. These techniques are Root Locus and Bode Diagram. The root locus is a method
that provides a graphical representation of the closed-loop poles as one parameter is varied.
Secondly, Bode diagram is a graphical method based on the frequency response of the system.
Bode diagram consists of two graphs out of which one is for the magnitude and the other is for
the phase angle of the system. The system is tested by a sinusoidal input signal where the
frequency varies. MATLAB has the ability to provide the graphical output of both methods by
entering simple commands. Considering a simple second order system which is represented by a
transfer function of:
The root locus and the Bode diagram of the system can be obtained from MATLAB.
>> num = [1 2];
>> den = [1 3 6];
>> TF = tf(num,den)
>> rlocus (TF), grid, figure;
>> bode (TF)
>> grid
By clicking on the root locus graph thus produced, we will be able to determine the gain of the
system, position of the poles, damping ratio, percentage overshoot and frequency of the system.
In the Bode diagram, we will be able to determine the gain margin and phase margin of the
system as well as the gain and phase crossover frequencies.
8
SIMULINK FOR CONTROL SYSTEMS
Simulink is a dynamic system which is used as a complement with MATLAB environment to
simulate systems using the built-in blocks rather than writing codes. It is extremely user-friendly
due to the block-driven interface and has the ability to interact with the MATLAB workspace.
We can open a new file in SIMULINK to construct our system and then chose the right block
from any of the toolbox's library along with the Simulink Extra library to build the required
model for application. Once the model is constructed, we have to enter the parameters for each
block. We will be able to change the parameters interactively during a simulation. Simulation
results are observed during the simulation process and then exported to the MATLAB workspace
for subsequent analysis.
Building a simple system using Simulink
S-M-D control system is considered for demonstrating the use of Simulink in the control system.
The system parameters are set as follows:
PID controller using Simulink
The term PID stands for Proportional, Integral and Derivative controller. This type of controller
is very popular and widely used in various applications. The combination of the three types gives
the controller various advantages over other conventional controllers. Each term has its function
and effect on the system. The proportional term, Kp, has the property to reduce the rise time of
9
the output response whereas the integral term, Ki, is used to eliminate the steady-state error but it
may affect the transient response. The derivative term, Kd, improves the stability of the system,
reducing the overshoot and improving the transient response. The transfer function of the PID
controllers is:
The closed-loop transfer function of the S-M-D system with PID controller is obtained as:
The closed-loop system with PID controller will be modelled in Simulink. We can apply any
combination of the three terms of the PID controller by setting the unwanted term equal to zero.
It is important to mention that it is not necessary to implement all three terms if any simple
combination provides a good and accepted output response.
10
SIMULATIONS
1. Using MATLAB:
Here is the step response of a sample SMD system using the MATLAB function “step()”.
11
Step Response of a sample Control System, using its transfer function can be calculated as
below:
BlockDiagram of a Control System
12
Now to determine the stability of any control system the following code may be used.
Using the Root-Locus diagram and Bode plot, it is possible to determine the system stability
using poles and zeroes of the transfer function.
13
14
2. Using SIMULINK:
The open-loop S-M-D system using Simulink.
The open-loopresponse usingSimulink
15
Closed loop simple SMD system using PID controller in SIMULINK:
PID controllerforS-M-DsystemusingSimulink
The closed-loopresponse withPIDcontrollerusingSimulink
16
CONCLUSION
In this project the use of MATLAB and Simulink software package was shown to familiarize
with the advancement of the software in studying and analyzing control systems. First, we
introduced some basic topics about MATLAB, then the mathematical modeling of a physical
system (which is a SMD system in our case) is done and output response with different system
parameters for a step input. Some control techniques to study and analyze control systems such
as root locus and Bode diagrams have also been explained and obtained for the S-M-D system.
Finally, the Simulink is introduced to show the ability to explore its advantages and construct
systems with some basic knowledge about control systems. Simulink provides with the ability to
investigate control systems and design controllers even one does not acquire much knowledge
about control systems design techniques just by experimenting with the controller parameters
and adjusting them to achieve the desired performance.
In general, this project presents the use of MATLAB and Simulink in an effective and direct way
to study, analyze and design control systems.
17
REFERENCES
1. Using MATLAB, Mathworks, Inc., MA.
2. Using SIMULINK, Mathworks, Inc., MA.
3. R. D. Dorf, Modern Control Systems, Prentice-Hall.
4. K. Ogata, Solving Control Engineering Problems with MATLAB, Prentice-Hall.
5. Norman S. Nise, Control Systems Engineering, John Wiley & Sons.

More Related Content

What's hot

PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...
PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...
PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...Waqas Afzal
 
Dcs lec03 - z-analysis of discrete time control systems
Dcs   lec03 - z-analysis of discrete time control systemsDcs   lec03 - z-analysis of discrete time control systems
Dcs lec03 - z-analysis of discrete time control systemsAmr E. Mohamed
 
Dcs lec02 - z-transform
Dcs   lec02 - z-transformDcs   lec02 - z-transform
Dcs lec02 - z-transformAmr E. Mohamed
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Alamgir Hossain
 
Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...
Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...
Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...Waqas Afzal
 
Time Response Analysis
Time Response AnalysisTime Response Analysis
Time Response AnalysisManthan Kanani
 
Lecture 2 transfer-function
Lecture 2 transfer-functionLecture 2 transfer-function
Lecture 2 transfer-functionSaifullah Memon
 
DSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignDSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignAmr E. Mohamed
 
Modern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control SystemModern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control SystemAmr E. Mohamed
 
state space representation,State Space Model Controllability and Observabilit...
state space representation,State Space Model Controllability and Observabilit...state space representation,State Space Model Controllability and Observabilit...
state space representation,State Space Model Controllability and Observabilit...Waqas Afzal
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier TransformAbhishek Choksi
 
Modern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI SystemsModern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI SystemsAmr E. Mohamed
 
STate Space Analysis
STate Space AnalysisSTate Space Analysis
STate Space AnalysisHussain K
 
DSP_FOEHU - Lec 10 - FIR Filter Design
DSP_FOEHU - Lec 10 - FIR Filter DesignDSP_FOEHU - Lec 10 - FIR Filter Design
DSP_FOEHU - Lec 10 - FIR Filter DesignAmr E. Mohamed
 
Exercise 1a transfer functions - solutions
Exercise 1a   transfer functions - solutionsExercise 1a   transfer functions - solutions
Exercise 1a transfer functions - solutionswondimu wolde
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programmingDamian T. Gordon
 
Control systems engineering
Control systems engineeringControl systems engineering
Control systems engineeringAnisur Rahman
 

What's hot (20)

PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...
PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...
PID controller, P, I and D control Comparison PI, PD and PID Controller P, I,...
 
Dcs lec03 - z-analysis of discrete time control systems
Dcs   lec03 - z-analysis of discrete time control systemsDcs   lec03 - z-analysis of discrete time control systems
Dcs lec03 - z-analysis of discrete time control systems
 
Dcs lec02 - z-transform
Dcs   lec02 - z-transformDcs   lec02 - z-transform
Dcs lec02 - z-transform
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
 
Properties of dft
Properties of dftProperties of dft
Properties of dft
 
Energy & Power Signals |Solved Problems|
Energy & Power Signals |Solved Problems|Energy & Power Signals |Solved Problems|
Energy & Power Signals |Solved Problems|
 
Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...
Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...
Signal Flow Graph, SFG and Mason Gain Formula, Example solved with Masson Gai...
 
Time Response Analysis
Time Response AnalysisTime Response Analysis
Time Response Analysis
 
Lecture 2 transfer-function
Lecture 2 transfer-functionLecture 2 transfer-function
Lecture 2 transfer-function
 
DSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter DesignDSP_FOEHU - Lec 11 - IIR Filter Design
DSP_FOEHU - Lec 11 - IIR Filter Design
 
Design of Filters PPT
Design of Filters PPTDesign of Filters PPT
Design of Filters PPT
 
Modern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control SystemModern Control - Lec 01 - Introduction to Control System
Modern Control - Lec 01 - Introduction to Control System
 
state space representation,State Space Model Controllability and Observabilit...
state space representation,State Space Model Controllability and Observabilit...state space representation,State Space Model Controllability and Observabilit...
state space representation,State Space Model Controllability and Observabilit...
 
Discrete Fourier Transform
Discrete Fourier TransformDiscrete Fourier Transform
Discrete Fourier Transform
 
Modern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI SystemsModern Control - Lec07 - State Space Modeling of LTI Systems
Modern Control - Lec07 - State Space Modeling of LTI Systems
 
STate Space Analysis
STate Space AnalysisSTate Space Analysis
STate Space Analysis
 
DSP_FOEHU - Lec 10 - FIR Filter Design
DSP_FOEHU - Lec 10 - FIR Filter DesignDSP_FOEHU - Lec 10 - FIR Filter Design
DSP_FOEHU - Lec 10 - FIR Filter Design
 
Exercise 1a transfer functions - solutions
Exercise 1a   transfer functions - solutionsExercise 1a   transfer functions - solutions
Exercise 1a transfer functions - solutions
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
 
Control systems engineering
Control systems engineeringControl systems engineering
Control systems engineering
 

Similar to Modeling and Simulation of Dynamic Systems Using MATLAB and SIMULINK

Control system Lab record
Control system Lab record Control system Lab record
Control system Lab record Yuvraj Singh
 
Modern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of SystemsModern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of SystemsAmr E. Mohamed
 
Automatic control 1 reduction block .pdf
Automatic control 1 reduction block .pdfAutomatic control 1 reduction block .pdf
Automatic control 1 reduction block .pdfssuser029aa3
 
Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...
Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...
Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...Gollapalli Sreenivasulu
 
Modeling and Simulation of an Active Disturbance Rejection Controller Based o...
Modeling and Simulation of an Active Disturbance Rejection Controller Based o...Modeling and Simulation of an Active Disturbance Rejection Controller Based o...
Modeling and Simulation of an Active Disturbance Rejection Controller Based o...IJRES Journal
 
Simulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in CapellaSimulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in CapellaObeo
 
Lecture_03_EEE 363_Control System.pptx
Lecture_03_EEE 363_Control System.pptxLecture_03_EEE 363_Control System.pptx
Lecture_03_EEE 363_Control System.pptxTasnimAhmad14
 
Unity Feedback PD Controller Design for an Electronic Throttle Body
Unity Feedback PD Controller Design for an Electronic Throttle BodyUnity Feedback PD Controller Design for an Electronic Throttle Body
Unity Feedback PD Controller Design for an Electronic Throttle BodySteven Ernst, PE
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab Arshit Rai
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab Arshit Rai
 
Raymond.Brunkow-Project-EEL-3657-Sp15
Raymond.Brunkow-Project-EEL-3657-Sp15Raymond.Brunkow-Project-EEL-3657-Sp15
Raymond.Brunkow-Project-EEL-3657-Sp15Raymond Brunkow
 
Transfer function, determination of transfer function in mechanical and elect...
Transfer function, determination of transfer function in mechanical and elect...Transfer function, determination of transfer function in mechanical and elect...
Transfer function, determination of transfer function in mechanical and elect...Saad Mohammad Araf
 
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT MissileZac Darcy
 
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT MissileZac Darcy
 
Kevin merchantss
Kevin merchantssKevin merchantss
Kevin merchantssdharmesh69
 
KEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTKEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTtejas1235
 
KNL3353_Control_System_Engineering_Lectu.ppt
KNL3353_Control_System_Engineering_Lectu.pptKNL3353_Control_System_Engineering_Lectu.ppt
KNL3353_Control_System_Engineering_Lectu.pptSherAli984263
 

Similar to Modeling and Simulation of Dynamic Systems Using MATLAB and SIMULINK (20)

Control system Lab record
Control system Lab record Control system Lab record
Control system Lab record
 
Lab03
Lab03Lab03
Lab03
 
Modern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of SystemsModern Control - Lec 02 - Mathematical Modeling of Systems
Modern Control - Lec 02 - Mathematical Modeling of Systems
 
Automatic control 1 reduction block .pdf
Automatic control 1 reduction block .pdfAutomatic control 1 reduction block .pdf
Automatic control 1 reduction block .pdf
 
Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...
Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...
Addison Wesley - Modern Control Systems Analysis and Design Using Matlab, Bis...
 
Modeling and Simulation of an Active Disturbance Rejection Controller Based o...
Modeling and Simulation of an Active Disturbance Rejection Controller Based o...Modeling and Simulation of an Active Disturbance Rejection Controller Based o...
Modeling and Simulation of an Active Disturbance Rejection Controller Based o...
 
Simulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in CapellaSimulation with Python and MATLAB® in Capella
Simulation with Python and MATLAB® in Capella
 
PV inverter
PV inverterPV inverter
PV inverter
 
Lecture_03_EEE 363_Control System.pptx
Lecture_03_EEE 363_Control System.pptxLecture_03_EEE 363_Control System.pptx
Lecture_03_EEE 363_Control System.pptx
 
Unity Feedback PD Controller Design for an Electronic Throttle Body
Unity Feedback PD Controller Design for an Electronic Throttle BodyUnity Feedback PD Controller Design for an Electronic Throttle Body
Unity Feedback PD Controller Design for an Electronic Throttle Body
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab
 
Summer training matlab
Summer training matlab Summer training matlab
Summer training matlab
 
Raymond.Brunkow-Project-EEL-3657-Sp15
Raymond.Brunkow-Project-EEL-3657-Sp15Raymond.Brunkow-Project-EEL-3657-Sp15
Raymond.Brunkow-Project-EEL-3657-Sp15
 
E0463137
E0463137E0463137
E0463137
 
Transfer function, determination of transfer function in mechanical and elect...
Transfer function, determination of transfer function in mechanical and elect...Transfer function, determination of transfer function in mechanical and elect...
Transfer function, determination of transfer function in mechanical and elect...
 
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
 
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
2-DOF Block Pole Placement Control Application To: Have-DASH-IIBITT Missile
 
Kevin merchantss
Kevin merchantssKevin merchantss
Kevin merchantss
 
KEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTKEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENT
 
KNL3353_Control_System_Engineering_Lectu.ppt
KNL3353_Control_System_Engineering_Lectu.pptKNL3353_Control_System_Engineering_Lectu.ppt
KNL3353_Control_System_Engineering_Lectu.ppt
 

Recently uploaded

Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 

Recently uploaded (20)

Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 

Modeling and Simulation of Dynamic Systems Using MATLAB and SIMULINK

  • 1. MODELING, ANALYSIS AND SIMULATION OF DYNAMIC SYSTEMS USINGCONTROL TECHNIQUES IN MATLAB AND RESPONSES OF A PID CONTROLLER IN SIMULINK.
  • 2. 1 Table of Contents: 1. Abstract…………………………………………………………………………………3 2. Introduction……………………………………………………………………………..4 3. MATLAB for control systems………………………………………………………….5 3.1. Mathematical model and transfer function………………………………………...5 3.2. Performance analysis of the S-M-D control system…………………….................6 3.3. Stability of a control system in MATLAB…………………………...…………....7 3.4. Most common techniques in control using MATLAB………………………….....8 4. SIMULINK for control systems………………………………………………………..9 4.1. Building a simple system using Simulink…………………………………………9 4.2. PID controller using Simulink……………………………………………………..9 5. Simulations……………………………………………………………………………..11 5.1 Using MATLAB…………………………………………………………………....11 5.2 Using SIMULINK.............................................................................................…....15 6. Conclusions……………………………………………………………………………..17 7. References………………………………………………………………………………18
  • 3. 2 ABSTRACT Our project on “Modeling, analysis and simulation of dynamic systems using control techniques in MATLAB and responses of a PID controller in SIMULINK” gives an insight on the diverse usage of MATLAB and its functions. Starting with the importance of MATLAB, we will cover the basic concepts required to understand its usage. Further we will understand how to implement mathematical model of a control system along with its transfer function. All this application of transfer function will be made clear through a sample S-M-D (Spring Mass Damper) system. We will realize that this system is a second-order system by determining the order of its characteristic equation. Further it will be shown how MATLAB helps in determining the stability of a system using Root-locus and Bode plot method. These two techniques are already mentioned in the Mechatronics subject, here we will do there analysis and will be able to understand there actual application with a real world example. Later in this report we will know about SIMULINK and PID (Proportional, Integral and Differential) controllers. These controllers will be implemented in SIMULINK from which we will get to know how PID is an important tool for determining the response (open and closed loop) of a system. In this case also our system would be the previously mentioned S-M-D system. All this will result in understanding the open and closed loop response through the plot formed by SIMULINK. We would like to inform that this report just gives the overview and theoretical aspects to our research project till where we have completed. The reader won’t be able to see any modelling and simulation results as the project is being carried out. We have tried to give a brief idea of our approach and the things which will be done in this project. The final modelling, simulation and results will be presented in the final review later in this semester.
  • 4. 3 INTRODUCTION MATLAB is a multi-paradigm programming language and numerical computing environment, which has been developed through the years for scientific and engineering calculations. MATLAB provides matrix manipulation, plotting of any function as well as data, implementing algorithms and interfacing with programs written in other languages. It combines mathematical computing and visualization along with powerful language providing an efficient and flexible environment for technical computing. It has various built-in functions which can be used to solve specific problems. It is also possible to create and add any function to suit any scientific or engineering application. Since MATLAB is a programming tool in nature, it is possible to interact with other programming languages such as C++ by an external interface to run those programs within MATLAB. It provides the flexibility to accept data to be analyzed and produce the necessary output. MATLAB has several toolboxes to support different applications. Apart from MATLAB, Simulink is an interactive tool for modeling, simulating, and analyzing dynamic systems. It enables engineers to create graphical block diagrams, evaluate system performance, and analyze multi-domain dynamical systems. Simulink integrates effortlessly with MATLAB and tightly integrates with the Stateflow for modeling event-driven behavior. Simulink is the perfect tool for control systems, Digital Signal Processing and communication system related design and other simulations. Analyzing and simulating the behavior of a system is important to be able to understand its dynamics and therefore be able to design an appropriate controller to attain the desired response. Some control design techniques will be presented to show how to design a controller and implement them in both MATLAB and SIMULINK.
  • 5. 4 MATLAB FOR CONTROL SYSTEMS MATLAB provides a toolbox that can assist drastically in design and analysis of control systems based on the mathematical models of physical systems. On obtaining the mathematical model of system, the transfer function of this system can be determined easily. Mathematical model and transfer function We will consider a typical spring- mass-damper system for analysis with the assistance of MATLAB. Mathematical equation expressing the motion of the mass in system is: M x (t) + fv x(t) + kx(t) = f (t) (1) Where, M is the mass, x·t is the linear acceleration of the mass, fv is the coefficient of viscous friction, x·t is the linear velocity, k is the spring constant, x t is the displacement and f t the applied force. Assuming all initial conditions are zeros and taking the Laplace transform of Equation (1) yields: Ms2 Xx(s) + fvs X (s) + ks X (s) = F (s) (2) Transfer function of the system is given as: G(s) = X (s)/F (s) =1/ (Ms2 + f s + k) (3) Once we get the transfer function, the analysis of the system can be carried out in MATLAB. First step is to assign values to the parameters M, fv and k then the transfer function can be entered as polynomial of the numerator and denominator and hence the transfer function can be produced as follows:
  • 6. 5 >; M = 1, fv = 2, k = 2; >> num = [1];den = [M fv k]; >> TF = tf (num,den) Transfer function: 1/ (S2 + 2 s + 2) The poles and zeros of the system will be: >> p = pole (TF); z = zero (TF) p = -1.0000 + 1.0000i -1.0000 +1.0000i z = Empty matrix: 0 by 1 It can be seen that the z is an empty matrix because the system only has two poles but no zeros. The output response of the system for a step input is determined and plotted using the following lines: >> step (TF) >> xlabel ('Time (sec)') >> ylabel ('The output x(t) (m)') >> title ('The step response of S-M-D system') The output response can be obtained for different values of any of the parameters. Performance analysis of the S-M-D control system Feedback systems are the most successful control systems which can be found in many applications everywhere. This success is due to the following reasons:  They reject the effect of the disturbance in the system.  They reduce and in some cases eliminate the steady-state errors.  They allow the adjustment of the transient response of the system.  They decrease the sensitivity of the system to the variation in the process parameters.
  • 7. 6 We will consider the transfer function of the S-M-D system obtained above to study and analyze the performance along with the characteristics of the system. The transfer function is rewritten in terms of the characteristic equation of a second order system as: The characteristic parameters of the second-order system such as the steady-state error, ess, maximum overshoot, pos, the rise time, Tr, the peak time, Tp, the settling time, Ts, and the damping ratio, can be attained by executing a MATLAB function stored in MATLAB file called gsos.m. On executing gsos.m, the user have to enter the system polynomial (i.e. the numerator and denominator of the system), then it will produce the values of all the mentioned parameters along with a plot of the output response. Stability of a control system in MATLAB Stability is a fundamental very important in control engineering. An unstable system is neither useful nor practical when a precise response is needed. A stable system is a system which produces a bounded output for every bounded input. Furthermore, all poles of the transfer function of a stable system must have a negative real part (i.e. all poles must lay on the left half of the plane). Routh-Hurwitz method is one of the most simple and easy tests to determine the stability of a system. The method is based on analyzing the characteristic equation to determine the stability of the system as well as number of poles in the unstable region (i.e. the right-half plane). MATLAB has the ability to assist the user by providing a simple and accurate method to determine the stability as well as the range of the gain that makes the system stable.
  • 8. 7 Most common techniques in control using MATLAB Now we will explore some common techniques to study and analyze the relative stability of control systems. These techniques are Root Locus and Bode Diagram. The root locus is a method that provides a graphical representation of the closed-loop poles as one parameter is varied. Secondly, Bode diagram is a graphical method based on the frequency response of the system. Bode diagram consists of two graphs out of which one is for the magnitude and the other is for the phase angle of the system. The system is tested by a sinusoidal input signal where the frequency varies. MATLAB has the ability to provide the graphical output of both methods by entering simple commands. Considering a simple second order system which is represented by a transfer function of: The root locus and the Bode diagram of the system can be obtained from MATLAB. >> num = [1 2]; >> den = [1 3 6]; >> TF = tf(num,den) >> rlocus (TF), grid, figure; >> bode (TF) >> grid By clicking on the root locus graph thus produced, we will be able to determine the gain of the system, position of the poles, damping ratio, percentage overshoot and frequency of the system. In the Bode diagram, we will be able to determine the gain margin and phase margin of the system as well as the gain and phase crossover frequencies.
  • 9. 8 SIMULINK FOR CONTROL SYSTEMS Simulink is a dynamic system which is used as a complement with MATLAB environment to simulate systems using the built-in blocks rather than writing codes. It is extremely user-friendly due to the block-driven interface and has the ability to interact with the MATLAB workspace. We can open a new file in SIMULINK to construct our system and then chose the right block from any of the toolbox's library along with the Simulink Extra library to build the required model for application. Once the model is constructed, we have to enter the parameters for each block. We will be able to change the parameters interactively during a simulation. Simulation results are observed during the simulation process and then exported to the MATLAB workspace for subsequent analysis. Building a simple system using Simulink S-M-D control system is considered for demonstrating the use of Simulink in the control system. The system parameters are set as follows: PID controller using Simulink The term PID stands for Proportional, Integral and Derivative controller. This type of controller is very popular and widely used in various applications. The combination of the three types gives the controller various advantages over other conventional controllers. Each term has its function and effect on the system. The proportional term, Kp, has the property to reduce the rise time of
  • 10. 9 the output response whereas the integral term, Ki, is used to eliminate the steady-state error but it may affect the transient response. The derivative term, Kd, improves the stability of the system, reducing the overshoot and improving the transient response. The transfer function of the PID controllers is: The closed-loop transfer function of the S-M-D system with PID controller is obtained as: The closed-loop system with PID controller will be modelled in Simulink. We can apply any combination of the three terms of the PID controller by setting the unwanted term equal to zero. It is important to mention that it is not necessary to implement all three terms if any simple combination provides a good and accepted output response.
  • 11. 10 SIMULATIONS 1. Using MATLAB: Here is the step response of a sample SMD system using the MATLAB function “step()”.
  • 12. 11 Step Response of a sample Control System, using its transfer function can be calculated as below: BlockDiagram of a Control System
  • 13. 12 Now to determine the stability of any control system the following code may be used. Using the Root-Locus diagram and Bode plot, it is possible to determine the system stability using poles and zeroes of the transfer function.
  • 14. 13
  • 15. 14 2. Using SIMULINK: The open-loop S-M-D system using Simulink. The open-loopresponse usingSimulink
  • 16. 15 Closed loop simple SMD system using PID controller in SIMULINK: PID controllerforS-M-DsystemusingSimulink The closed-loopresponse withPIDcontrollerusingSimulink
  • 17. 16 CONCLUSION In this project the use of MATLAB and Simulink software package was shown to familiarize with the advancement of the software in studying and analyzing control systems. First, we introduced some basic topics about MATLAB, then the mathematical modeling of a physical system (which is a SMD system in our case) is done and output response with different system parameters for a step input. Some control techniques to study and analyze control systems such as root locus and Bode diagrams have also been explained and obtained for the S-M-D system. Finally, the Simulink is introduced to show the ability to explore its advantages and construct systems with some basic knowledge about control systems. Simulink provides with the ability to investigate control systems and design controllers even one does not acquire much knowledge about control systems design techniques just by experimenting with the controller parameters and adjusting them to achieve the desired performance. In general, this project presents the use of MATLAB and Simulink in an effective and direct way to study, analyze and design control systems.
  • 18. 17 REFERENCES 1. Using MATLAB, Mathworks, Inc., MA. 2. Using SIMULINK, Mathworks, Inc., MA. 3. R. D. Dorf, Modern Control Systems, Prentice-Hall. 4. K. Ogata, Solving Control Engineering Problems with MATLAB, Prentice-Hall. 5. Norman S. Nise, Control Systems Engineering, John Wiley & Sons.