0% found this document useful (0 votes)
20 views65 pages

Control Design

Uploaded by

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

Control Design

Uploaded by

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

Control Design

Stability – Introduction
BODE PLOT AND NYQUIST
CRITERIA
As we have seen what stability is and how to identify if a given system is
stable or not, in the PID Module. In this Module we will be looking further
into analyzing the system performance and its stability through Bode and
Nyquist plots.

Brushing Up of a Few
Concepts
Characteristic equation of a system is the denominator polynomial of its
transfer function equated to zero.

Open loop system,

Where, N(s) is the numerator polynomial and D(s) is the denominator


polynomial.

Figure 1: Open Loop System


Closed loop system,

Figure 2:
Closed Loop System
Let us run through few basic stability criterions for better understanding of
the sections to follow,

BIBO stability, simply means that given a bounded input signal the system
gives a bounded output signal. This could be visualized as the poles of the
system’s transfer function when on the,

Left half of the complex plane, the system is BIBO stable.

Right half of the complex plane, the system is Unstable.

Imaginary axis of the complex plane, the system is marginally stable.

The other methods like Routh’s criterion, Root locus are all explained in
detail in the Control Design Module.
Stability – Bode Plot

What Is Bode Plot?

Given the transfer function of a system, let’s say H(s) the Bode plot would
help us visualize H(s) in its frequency domain and determine its stability,
meaning,

then Bode plot is representation of H(jω) as ω is varied.


Bode Plot comprises of,

Magnitude Plot

A Magnitude Plot gives the magnitude of the system (in decibels) as its
varied with ω.

Phase Plot

A Phase Plot gives the phase shift of the system (in degrees) as its varied
with ω.

How these two plots are plotted is discussed in detail in the next section
that follows.

Constructing a bode Plot

Let’s run through some basic properties regarding logarithms and angles.
Given a transfer function H(jω) let’s evaluate its Bode plot

Now let’s evaluate considering a very simple transfer function,

The transfer function contains factors

Let’s first evaluate bode plots of

through a script file.


Figure 3: Script file for Bode plot

Figure 4: Bode plot, 10


Figure 5: Bode plot, s

Figure 6: Bode plot, 1/(5s+1)


Now let’s look at the final plot that is basically the sum of the three plots
(as explained in eqn.1 and eqn.2) that we have analysed above,

Figure 7: Final Script file of Bode plot of system

Figure 8: Bode plot, 10s/(5s+1)

Now that we have understood what and how of a bode plot, but what is
this margin(sys) command that we used to plot the system F4. Let’s look
at how we can estimate the system’s stability factors from the very same!

Terminologies Related to Stability

Gain Margin(GM)
Gain Margin is the amount of gain variance required to make the loop gain
unity at the Phase Crossover frequency. For a system to be stable the
greater the gain margin greater is its stability in terms of how much the
gain can be modulated without making the system unstable.

Gain Crossover Frequency

Frequency at which the magnitude curve cuts the 0 dB axis in the


magnitude plot.

Phase Margin (PM)

Phase of the system at Gain Crossover frequency.

For a system to be stable the greater the phase margin greater is its
stability in terms of how much the phase of the system can be modulated
without making the system unstable.

Phase Crossover Frequency

Frequency at which the phase curve cuts the -180 o axis in the phase plot.

Let us check out how they represent stability of a closed loop system
using its open loop transfer function.

Plots For Better Understanding

Let’s take a simple open loop transfer function , G(s),H(s) then its closed
loop transfer function will be

The characteristic equation of the closed loop transfer function would be 1


+ G(s),H(s)

Bode Magnitude plot that we are plotting is the log of the gain, so the gain
margin is the additional dB that is necessary to make the magnitude unity
at the phase crossover frequency.

Let’s write a Script file that would help us understand the Stability terms
defined above better.

Figure 9: Script file for understanding Stability using Bode plot


Running the Script file for,

Figure 10: Bode plot of 1/(s^3+7s^2+5s+9)

Figure 11: Stability margins of 1/(s^3+7s^2+5s+9)


Figure 12: pole-zero map of the closed loop tf of H

For K=28.3
Figure 13: Bode plot of 28.3/(s^3+7s^2+5s+9)

Figure 14: Stability margins of 28.3/(s^3+7s^2+5s+9)


Figure 15: pole-zero map of the closed loop tf of H

Observation

Given a system whose open loop transfer function does not have poles or
zeros in the right half of s-plane the gain and phase margin should be
positive to ensure stability of the closed loop system. The closed loop
system becomes unstable upon addition of the said Gain and Phase
margins.

MATLAB commands that might help!


1. margin(sys)
2. bode(sys)
Stability – Nyquist Criterion

What is Nyquist Plot?


Given the transfer function of a system, let’s say G(s) the Nyquist plot
would help us visualize G(s) in its frequency domain, meaning,

then Nyquist plot is representation of G(jω) in the complex plane as ω is


varied from 0 to ∞

Significance
In case of a transfer function with the denominator polynomial of higher
order then determining the transfer, function’s poles would be difficult.
Nyquist plot would help reducing the problem.

Plots for Better


Understanding!
Consider characteristic equation of closed loop transfer function,

Zeros of F(s) is the poles of closed loop transfer function

Poles of F(s) is the poles of open loop transfer function G(s)H(s).


For the closed loop transfer function to be stable the zeros of F(s) should
lie strictly in the left half of the s-plane.
Nyquist Stability Criterion states that
Knowing the value of P from the open loop transfer function and upon
constructing its Nyquist plot, we would be able to determine stability of
closed loop system.
If,

Let us take,

And analyze its closed loop stability using Nyquist plot. Given below is a
simple Script file that would help you to do so,

Figure 16: Script file, Nyquist plot.

Figure 17: Roots of s^3+7s^2+5s+9


It can be clearly seen that the poles of the open-loop system are stable, as
they are in left half of s-plane. So, value of P equals to 0.

Let us now check its corresponding Nyquist plot,


Figur
e 18: Nyquist plot of 1/(s^3+7s^2+5s+9)
Number of encirclements around -1 is also zero. M-circles (or grid lines)
defined here are the locus of complex numbers where the following
quantity is a constant value across frequency, in other words they are the
contours of constant closed-loop magnitude.

So, the system is stable. But now let us vary the system’s stability using a
gain value, K=30.
As it can be clearly seen the number of clockwise encirclements around -1
is one.

Implies,

So, the closed loop system will be unstable for gain value of 30.
This shifting using a gain value can also be understood as addition of gain
margin that would make the system go unstable.

Terminologies
The importance of Nyquist stability lies in the fact that it can also be used
to determine the relative degree of system stability by producing the
phase and gain stability margins. These stability margins are needed for
frequency domain controller design techniques.
Gain Cross Over Frequency
(ωg)

Phase Cross Over


Frequency (ωp)
Similarly, as you can recall Gain margin and Phase margin were defined
under Bode plot section with respect to Gain crossover and Phase
crossover frequencies, they are like the additional gain and phase margins
when given to the system that when added would make the system
unstable.

MATLAB commands that might help!


1. nyquist(sys)
2. nyquistplot(sys)

In Short!
In this module we have gone through how to plot Bode and Nyquist plots
using MATLAB commands.

We have discussed the Stability terminologies associated to the plots that


would help us understand the system better.

Bode Plot, consists of a magnitude plot and a phase plot, helps you
understand how much the constructed system can withstand changes in
gain and phase value before it becomes unstable.

Similarly, Nyquist Plot, is a parametric plot of a frequency response, that


helps you understand and analyze the stability of the system just by the
encirclement of the plot around -1 + j 0 ,
It graphically reveals the range of values of controller gain K for which the
system is stable.

State Space Representation –


Introduction

State Space Representation is a mathematical model of a physical system


as a set of input, output and state variables related by first-order
differential equations or difference equations, for ease of computing
and understanding.

State Space Representation


For continuous linear time-invariant (LTI) systems, the standard state-
space representation is given below,

x’ = Ax + Bu
y = Cx + Du

where, x and x’ are state vector (nx1) and time derivative of the state
vector (nx1) respectively,
u and y are input vector (px1) and output vector (qx1) respectively,
A is the system matrix (nxn),
B and C are input matrix (nxp) and output matrix (qxn) respectively,
D is the feedforward matrix (qxp).
Let’s take a simple mass-spring-damper system for better understanding
of state space representation,

Figure 1: mass-spring-damper system

Writing the Force eqn. of the above system,

The order of the above eqn. written above is 2, it is defined that the
number of state variables that could completely characterize the system
is the order of the equation.
So, let the two states that we observe be x and x’, i.e., the displacement
and velocity of the mass.
To avoid confusion, let us represent state vector by z.
Implies,

So, let us now write two first order ODEs each one characterizing the state
variables.

From eqn.1 and 2 we get,

Rephrasing the same we get,

Here we can observe and compare it with the standard state-space


representation and deduce that,

Let the output (y(t) ) that we would want, to be x(t). Implies,


Here we can observe and compare it with the standard state-space
representation and deduce that,

So, the state space representation of the mass-spring-damper system is,

Eqn.3 here is known as State equation and eqn.4 is known as Output


equation of the system.

Let’s Paraphrase the above


Points!
Given a system,

1. Write down its governing equation.

2. Arriving upon the nth order ODE representing the system, select n state variables.

3. Write n 1st order ODEs, each one characterizing the n state variables.

4. Put them all together in the form of matrices and vectors to come up with the
state space representation of the system.
State Space Representation – Working in
Laplace Domain

Given the state space representation of a system,

Writing the same in Laplace Domain we get,

Using the above equations let’s try to get our transfer function of the
system described.

(Here, the term (sI – A)-1 is a matrix. So, matrix rules of multiplication
should be followed)

Using eqn.6 we get,

Substituting X(s) from eqn.7


(This step is allowed as det(sI – A) is a scalar)

Here eqn.8 gives the transfer function of the system and that det(sI – A) =
0 is the characteristic equation and gives the poles of the system, in other
words the poles of the system could also be defined as the eigenvalues of
matrix A.

For better understanding of what are poles and their role in stability refer
PID Module.

In the next section let’s investigate State Feedback Controller, it’s purpose
and how to come up with it.

State Feedback Controller

What is a State Feedback Controller?

State Feedback Controller comes into picture when we have to,

Regulate the output ———————————-

When the states of the system are expected to approach zero or a


constant value from an arbitrary initial state, the problem can be labeled
as a regulation. Here the internal stability is achieved with desired
transients. The control input here is given as:

Track the output to follow a reference data ———————————-

Unlike regulation the system is expected to follow a reference signal. The


control input for a tracking problem is given as follows:

Here ‘r’ is the reference signal that needs to be tracked and ‘N’ is a Gain
value, whose need would be clearly explained using an example below.
Factors To Be Checked First

Before designing a controller for a system, it is essential to analyze the


system and determine whether we can control the system and observe its
state fully.

Controllability ————————————————————————

Controllability of a system refers to the ability of the system to transfer


from an initial state x0 to any desired arbitrary state xt in a finite time
given an unconstrained control ‘u’.

The system described before can be said to be controllable if:

Here Pc is the controllability matrix defined as

Observability ————————————————————————–

Observability of a system is the ability to fully determine the state of the


system for a finite time T given the observation history, output Y(t) and
control u(t).

The mathematical condition for the system to be observable is:

Here P0 is the observability matrix defined as:

Let’s check how it works!

Consider the mass-spring-damper system initially defined:

Figure 2: mass-spring-damper system


Wherein,

So, let’s write up a script file declaring the physical parameters and
defining its state space representation as discussed above and checking
out if the system is,
——•Controllable
——•Observable

Figure 3:Script file, Modelling and Evaluating the system


It can be observed that,
1. n = nc = no = 2
2. det(Pc) and det(Po) are not equal to zero, i.e., Pc and Po are not singular
matrices.

Therefore, the system described is Controllable and Observable.

Now that we know that the system’s state variables can be controlled and
observed, let’s proceed to the Gain matrix K which helps us in controlling
the state variables individually.

Let us design a controller that tracks the state variable displacement to


follow its input, in our case it will be a simple step input.

So far our Script code comprises of defining the parameters and analyzing
the system about whether it could be controlled and whether the state
variables could be observed. Now we will look into how the existing
system without a state feedback controller responds to a step input.
Figure 4:Continuation of Script file, Defining the Open Loop system

Upon adding the above lines in your existing script file and running it, you
would get the following results,

Figure 5:Step response of an Open-Loop system


Figure 6: Bode, Root Locus and Step response of an Open Loop system

The step(sys) gives the step response of sys that we have defined in the
script and the sisotool(sys) gives its Bode plot and Root locus along with
its step response. Let us go to the Root locus plot and right click on it and
select Design Requirements >> New. As shown in the next page.
Figure 7: Creating a Design Requirement

In this you can specify the Design Requirement that you would want,

For instance let’s give,

Settling time: 0.5 and click on Ok.

We get,
Figure 8: Unshaded Region, that denotes Settling time<0.5 s

Give Percent overshoot: 5 (meaning 5%) as New Design Requirement.


Figure 9: Unshaded Region, that denotes Percent overshoot<5 and
Settling time<0.5 s

As our new Design Requirements.

So based on unshaded region that we have got given our design


requirements we can see that the poles of the open loop system lies in the
shaded region meaning, its Percent overshoot > 5 and Settling time > 0.5
s This can also be verified from the result of stepinfo(sys) command.

Now why are we doing this? State feedback controller helps us in tracking
the input, i.e., step input of value 1, with a better performance just by
shifting the poles! Let’s check how this happens.

Pole Placement —————————————————-


Let us first understand how this shifting of poles of the system occurs with
use of State feedback controller.
As we all know that given a reference value r(t), u(t) = -Kx(t) + Nr(t)
wherein, N is to amplify the input signal and K is the Gain matrix. For the
mass-spring-damper system described above,
Now, upon including State feedback controller we get,

Applying Laplace transform,

This would open up another use of state feedback controller, that is to


change the poles placement of an unstable system (that have poles in the
right half of the plane) to a stable system (that have poles strictly in the
left half of the plane).

Now that we have understood how state feedback controller plays a major
role in the poles of the system. Let us now look into how it helps with its
performance.

Performance ————————————————————————–

From analyzing Figure 7, we understand that the system performance


would be on par with the desired design requirements that we have
specified, if the poles of the system lies in the unshaded region. Keeping
this in mind let us choose two poles appropriately.

Figure 10:Continuation of Script file, Designing the Controller Matrix

Variable p in the code denotes the set of desired poles and K denotes the
gain matrix that would help us achieve poles at the said p using the
function called place(A, B, p), wherein A, B are system parameters in its
state space representation that we had calculated prioly and p is the set
of desired poles.

Now we need to integrate the State feedback controller with the system.

Figure 11:Continuation of Script file, Defining the Closed Loop system

The above script file shows how to represent the Closed loop system. For
the closed loop system as we already saw,
Figure 12:Step response of the Closed Loop system with N=1

Performance of,

Open Loop System:

Figure 13: Performance of Open Loop System

Closed loop system:


Figure 14: Performance of Closed Loop System

As we can clearly see that the closed loop system meets the design
requirements that we desired the system to achieve, with the exception of
it not reaching the desired value of 1.

This is where the gain value N comes into picture, now that we know that
our closed loop system’s steady state value is at 0.312 instead of 1, we
simply just have to scale our reference value, in other words amplify it, in
order to achieve one.

Now we implement the same in the script file of ours,

Figure 15:Continuation of Script file, Defining the Closed Loop system-final

Now when we run the script file we get,


Figure 16:Step response of the Closed Loop system with N

Open loop system:

Figure 17: Performance of Open Loop System

Closed loop system:

Figure 18: Performance of Closed Loop System

As we can clearly see now that our state feedback controller helped us in
improving the performance of the system and in tracking the reference
value of one.
PID Controller Design

PID with its simple design is one of the most common controllers found in
automobiles today. With its 3 gains, the PID is easy to understand and deploy for
beginners. Start your journey in the field of controls with the PID module. Learn
about the significance of the gains and familiarize yourself with the tuning
process.

PID Controller Design | Technical Terms – Introduction

This section explains the general terms commonly used in Control Design.

Transfer Functions

Figure 1:System

Given a system, we can observe that on inputting x(t) to the SYSTEM we


get y(t) as the output.

Given that the plant transfer function is p(t),

Let P(s) be the Laplace transform of the plant function p(t) then,

P(s) is known as the Plant transfer function.

X(s) = 0 gives the poles of P(s) while Y(s)=0 gives the zeros. Poles are
used in control design to determine the stability of the system under
consideration. We will be studying more about stability of the system in
the next section.
Refer the Appendix for commonly used Laplace transforms.
Open Loop System
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.

Figure 2:A Simple Open Loop System

Closed Loop System


Closed-loop Control System, also known as a feedback control system, is a
control system in which there are one or more feedback loops or paths
between its output and its input.

Figure 3:A Simple Closed


Loop System

Linear Systems
A linear system is said to follow the principle of superposition and
linearity.

For example, let there be a linear system “SYSTEM”.

Figure 4: A simple linear system

Implies, when x(t) is given as input the output observed is y(t).


Figure 5: Applying different inputs and
getting their corresponding outputs

On giving inputs x1(t) and x2(t), we get y1(t) and y2(t) respectively as
outputs.

According to principle of superposition, when x1(t) + x2(t) is given as


input output observed is y1(t) + y2(t).

Figure 6:Principle of superposition

According to principle of linearity,


When ax1(t) is given as input output observed is ay1(t) (where a is
constant).

Figure 7:Principle of linearity

In short, when ax1(t) + bx2(t) is given as input output observed should


be ay1(t) + by2(t).

Figure 8:Linear system

Time invariant System


A time invariant system is one that provides same output for same input
irrespective of when the input is given.

Figure 9: Time Invariant system

Causal System
A causal system is one where the output at any instant of time depends
on current and past inputs.

For example, y(t) = ax(t-1) + bx(t) is a causal system, as the output


depends on past and current input.

y(t)=ax(t+1) +bx(t) is not a causal system, as the output depends on


future input.

BIBO Stability
A system is said to be BIBO stable, when for a given bounded input the
output obtained is also bounded.

Figure 10:BIBO Stable

Implies,

And,
For the output to be bounded the poles of the plant transfer function
should lie in the left half of the complex plane (that is, have negative real
parts).

PID Controller Design | Technical Terms – Stability


of a System:

As discussed earlier the poles of the system play an important role is


determining the stability. The poles are the roots of the denominator.
Once determined, we should make sure that they all lie on the left side of
the complex plane. This means that the real part of the pole is negative.

Marginally stable: Poles lie on the imaginary axis (Real part=0)

Stable: Poles lie on the left half of the plane

Unstable: Poles lie on the right half of the plane

The following methods talk about how you can determine whether a given
system is stable or not by analyzing the denominator of the transfer
function.

Hurwitz polynomials

A polynomial is said to be ‘Hurwitz’ if all its roots have negative real parts.
Let the polynomial be

For polynomials of order less than 3 is stable if it is ‘Hurwitz’. For


polynomials of order 3 and more Hurwitz is a necessary condition but for
sufficiency Routh’s array should be constructed.

Routh’s Array
Sufficient Condition

 The number of sign changes in the 1stcolumn of the Routh’s array should
be zero.
•Implies, the elements in the 1stcolumn of the Routh’s array should be
non-zero and of the same sign.
•The number of sign changes indicates number of roots in RHP.
•In case of zeros in the 1st column of the Routh’s array the roots might be
present at the imaginary axis or in RHP.
———•Roots on the imaginary axis implies that the system is marginally
stable. Marginally stable systems have sinusoidal oscillations, with a
constant amplitude and has poles on the imaginary axis.
Two sign changes indicate that there are 2 poles in RHP.
Next sub section describes the Root Locus Method. Till now we have seen
how to determine if the system is stable or not. Further we will see how
you can design a controller for a stable system.

Root Locus

Significance

For the above system,


Characteristic

Therefore, the root locus is the path of the roots of the characteristic
equation due to k ask is traced out to infinity.
In order to draw the root locus of the above open loop transfer function.

Step 1]

Locate open loop poles and zeros in the ‘s’ plane. (n- number of open loop
poles; m- number of open loop zeros)

The open loop poles: 0, -1, -5 n=3

open loop zeros: nil m=0


Figure 11:Root Locus Branch

Step 2]

Locate the parts of the real axis that lie on the root locus. By taking a test
point on the axis, if odd number of the open loop poles and zeros exist to
the right side of a point on the real axis, then that point is on the root
locus branch. Implies, the branch of points which satisfies this condition is
the real axis of the root locus branch.

Regions

 (-∞, -5) test point in this region has 3(odd number) open loop poles on its
right, therefore this branch is Root Locus Branch.
•(-5, -1) test point in this region has 2(even number) open loop poles on
its right, therefore this branch is not a Root Locus Branch.

 (-1, 0) test point in this region has 1(odd number) open loop pole on its
right, therefore this branch is Root Locus Branch.
•(0, ∞) test point in this region has 0(even number) open loop poles on its
right, therefore this branch is not a Root Locus Branch.

Step 3]

Find angle ( θ ) made by the asymptotes and their point of intersection.


The intersection point of asymptotes on the real axis is known as centroid
α.

For the transfer function given above,


Figure 12:Asymptotes of the Root Locus

Step 4]

Find the Break-away/ Break-in points


•If there exists a real axis root locus branch between two open loop poles,
then there will be a break-away point in between these two open loop
poles.
——–Implies in the root locus of the given transfer function there will be
one break-away point on the real axis root locus branch between the
poles s=−1 and s=0.
•If there exists a real axis root locus branch between two open loop zeros,
then there will be a break-in point in between these two open loop zeros.
•Steps to find Break-away and break-in points.
——––Write K in terms of s from the characteristic equation 1+G(s)H(s)=0
——––Differentiate K with respect to s and make it equal to zero.
Substitute these values of s in the above equation.
——––The values of s for which the K value is positive are the break
points.
——––By following the procedure given for the calculation of break-away
point, we get it as s = −0.473 for the given transfer function.
Figure 13:Break-away/Break-in points in Root Locus

Step 5]

Find the angle of departure (φd) and the angle of arrival (φa) .

The Angle of departure and the angle of arrival can be calculated at


complex conjugate open loop poles and complex conjugate open loop
zeros respectively.

In the given transfer function, there are no complex conjugate open loop
poles and zeros.

Step 6]

Find the cross-over points (points where the root locus cuts the imaginary
axis)
•Substituting s = jꙍ in the closed loop characteristic equation and equate
it to zero.
•We get two equations,
——–Real part equal to zero.
——–Imaginary part equal to zero.
•On solving the equations, we get values of K (should be positive) and jꙍ
(cross-over points).
For the given transfer function cross-over points are ±j√5 .

MATLAB commands that might guide you in this!


rlocus(sys)

PID Controller Design | Technical Terms – Understanding a


System

Let us consider a mass-spring-damper system.

Figure 14:mass-spring-damper system

Writing the Force eqn. of the above system,


We Get

The script file below depicts modelling the mass-spring-damper system on


MATLAB using Laplace Transform.

On Running the above code, you can observe from the graph obtained
how a under, critically and over damped system responds to a step unit,
i.e., on giving a unit force as input.
Step Response Of a System

Here we will investigate the step response of a system and how to obtain
its performance characteristics.
Figure 15: Step response

Settling time (ts)

Time it takes for the error |y(t) – yfinal| between the response y(t) and the
steady-state response yfinal to fall to within 2% or 5% of yfinal (depending on
the band chosen).

For step response of P(s) given above the settling time can also be
calculated directly,
Steady State Error(sse)

Steady state error is defined as |ydesired – yfinal|.

Max Peak Overshoot (mp)

Maximum peak overshoot is defined as the percentage of system


response’ peak value with respect to its steady state value.

Rise Time (tr)

Time taken by the system response to reach 100% of its final value for the
first time.

Peak Time (tp)

Time taken by the system response to reach its peak value.

MATLAB Commands that might Guide you in this!

1.stepinfo(sys)
Gives you the values of,
•RiseTime — Time it takes for the response to rise from 10% to 90% of
the steady-state response.
•SettlingTime — Time it takes for the error |y(t) – yfinal| between the
response y(t) and the steady-state response yfinal to fall to within 2% of
yfinal.
•SettlingMin — Minimum value of y(t) once the response has risen.
•SettlingMax — Maximum value of y(t) once the response has risen.
•Overshoot — Percentage overshoot, relative to yfinal).
•Undershoot — Percentage undershoot.
•Peak — Peak absolute value of y(t)
•PeakTime — Time at which the peak value occurs.

2.step(sys, Tfinal)
Step response plot of dynamic system till the specified time Tfinal.

PID Controller Design | Designing a Controller

After analysing the system and its response we turn to the controller design. In this section
we will only be covering PID controllers. PID is one of the most common controllers used
due its versatility and robustness. In this section we will get to know more about this popular
controller.

Figure 16:PID Controller Block in Simulink


The gain factors P, I and D represent the relative weighting towards the proportional, integral
and derivative terms respectively.

Note: The controller gain factors P, I and D are also represented as kp, ki and kd.

The common goal of a PID is to,


—–•Minimize rise time
—–•Minimize overshoot
—–•Zero steady-state error
—–•Minimize settling time

Figure 17:PID controller block in Closed Loop system in Simulink

In a Closed Loop system, the variable (e(t)) represents the tracking error, the difference
between the desired output (x(t)) and the actual output (y(t)). This error signal (e(t)) is fed to
the PID controller, and the controller computes both the derivative and the integral of this
error signal with respect to time along with scaling it depending on the choice of controller.
Let us now design a PID controller for an under damped mass-spring-damper system. The
below script focuses on,
•Generating step responses of an open loop and closed loop mass-spring-damper system.
——Given that, the controller functions C(s)=0 the step response of closed loop mass-spring-
damper system is zero initially. So, the graph obtained shows the step response of open loop
system.
•Generating step response info of an open loop and closed loop mass-spring-damper system.
Figure 18: Script of PID Modelling
Figure 19: Step response of open loop system

UCTS
PID Controller Design | Designing a Controller –
Proportional controller (P)

xFigure 20:Proportional Controller (P)

Increasing the proportional gain (kp) has the effect of proportionally


increasing the control signal for the same level of error. The fact that the
controller will push the system more for a given level of error, it tends to
cause the closed-loop system to react more quickly, but also to overshoot
more. Another effect of increasing kp is that it tends to reduce, but not
eliminate, the steady-state error.

Let us run the Script of PID Modelling by keeping the values of ki, kd as
zero and run it for kp= 7, 14, 21.

1. Kp=7
SSE observed – 0.125

Figure 21: Step response of closed loop system kp=7 ki=0 kd=0

2. Kp=14
SSE Observed – 0.0667

Figure 22: Step response of closed loop system kp=14 ki=0 kd=0

3. Kp=21
SSE Observed – 0.0455

Figure 23: Step response of closed loop system kp=21 ki=0 kd=0

Observation

Kp increases:
1. Rise time decreases
2. SSE decreases but not zero
3. Settling time very little change
4. Overshoot (%) increases
PID Controller Design | Designing a Controller – Integral
Controller (I)

The controller (ki) tends to help reduce steady-state error. If there is a


persistent, steady error, the integrator builds and builds, thereby
increasing the control signal and driving the error down. A drawback of
the integral term, however, is that it can make the system more sluggish
(and oscillatory) since when the error signal changes sign, it may take a
while for the integrator to “unwind”.

PI

Figure 24:PI Controller

Advantages: Zero steady state error, Stability and Maximum peak


overshoot is better than Integral only Controller.
Disadvantages: We cannot use PI controller for slow moving Process
variables.
Application: Majority of the speed control applications use PI control
action. E.g. Speed control of motors, generators, turbines etc.
NOTE: PI control is faster than only Integral action, but it may or may not
be faster than Proportional only controller.

Let us run the Script of PID Modelling by keeping the value of kd as zero,
kp as 7 and run it for ki= 7, 14, 21.

1. Kp=7 ki=7 kd=0


SSE Observed – 0

Figure 25: Step response of closed loop system kp=7 ki=7 kd=0

2. Kp=7 ki=14 kd=0


SSE Observed = 0

Figure 26: Step response of closed loop system kp=7 ki=14 kd=0

3. Kp=7 ki=21 kd=0


SSE Observed = 0

Figure 27: Step response of closed loop system kp=7 ki=21 kd=0

Observation

Keeping kp constant and increasing ki:


1. Rise time decreases
2. SSE is zero
3. Settling time increases
4. Overshoot (%) increases
PID Controller Design | Designing a Controller – Differential
Controller

With derivative control, the control signal can become large if the error
begins sloping upward, even while the magnitude of the error is still
relatively small. This anticipation tends to add damping to the system,
thereby decreasing overshoot. The addition of a derivative term, however,
has no effect on the steady-state error.

PD

Figure 28: PD Controller

Advantages: Stability increased, Maximum peak overshoot decreased,


Settling time decreases.

Disadvantages: Steady state error is not zero, cannot be used for fast
moving process variables like flow, pressure. It is highly affected by
external noise. It amplifies high frequency noise if present.

Application: PD controllers are most widely used in temperature control


applications.

NOTE: extra care must be taken in a PD controller to avoid a derivative


kick.

Let us run the Script of PID Modelling by keeping the value of ki as zero,
kp as 7 and run it for kd= 7, 14, 21.

1. Kp=7 ki=0 kd=7


SSE Observed = 0.125

Figure 29: Step response of closed loop system kp=7 ki=0 kd=7

2. Kp=7 ki=0 kd=14


SSE Observed = 0.125

Figure 30: Step response of closed loop system kp=7 ki=0 kd=14

3. Kp=7 ki=0 kd=21


SSE Observed = 0.125

Figure 31: Step response of closed loop system kp=7 ki=0 kd=21

Observation

Keeping kp constant and increasing kd:


1. Rise time very little change in value.
2. SSE very little change in value but is not zero.
3. Settling time increases.
4. Overshoot (%) increases.
——-a. The overshoot is calculated w.r.t. the signal’s steady state value,
which is less than the desired vale (which is one).

You might also like