Download as pdf or txt
Download as pdf or txt
You are on page 1of 231

DEE, CEME, NUST EE-371 Linear Control Systems

National University of Science and


Technology

Department of Electrical Engineering

EE-371 Linear Control Systems

Laboratory Manual

1
DEE, CEME, NUST EE-371 Linear Control Systems

List of Experiments

Sr.no Labs Type

1 DCMCT kit and software Intro Quanser DCMCT

2 Modeling DC Motor I Quanser DCMCT

3 Modeling DC Motor II Quanser DCMCT

4 Modeling in MATLAB MATLAB

5 Modeling in Simulink MATLAB

6 Speed Control I Quanser DCMCT

7 Speed Control II Quanser DCMCT

8 Robust Control MATLAB Quanser

9 Position Control I Quanser DCMCT

10 Position Control II Quanser DCMCT

11 Curve fitting toolbox MATLAB

12 SISO tool controller design MATLAB

13 State Feedback Control MATLAB

14 Output Feedback Control MATLAB

2
DEE, CEME, NUST EE-371 Linear Control Systems

List of Softwares Required

1) MATLAB
2) QICii

List of Equipment required

1) Quanser DCMCT with accessories

3
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 1: Introduction to DCMCT and QICii

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
Introduction of DC Motor Control Trainer (DCMCT) hardware and QICii software.

Theory
Nil

Equipment
DC Motor Control Trainer (DCMCT) and QICii installed PC,

Task Breakdown Marks


1) Using QICII software 5

2) Getting familiar with various parts of Quanser Engineering Trainer 5

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 2: Modelling of DC Motor 1

Conducted on: Submitted on:

Instructor:

Lab Engineer:
Group Members

1)
2)
3)

Aim
Understanding following key concepts

1) Analysis of DC motor dynamics using first principles

2) Determining system parameter using static relationship between system states/variable

3) Computing Open loop transfer function.

4) Estimating motor parameters experimentally

Theory
Topic 1.3 through 1.12 of Feedback Control Systems

Task Breakdown Marks


1) Determine electrical and mechanical equation describing dynamics of DC motor 2
2) Find following motor specification by using static equation governing motor working. 3
Motor torque constant, moment of inertia, max speed, max torque, maximum current,
measurement noise
3) Estimating Motor resistance 1
4) Estimating Motor torque constant 1
5) Calculating motor transfer function 1
6) Estimating measurement noise 2

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 3: Modelling of DC Motor II

Conducted on: Submitted on:

Instructor:

Lab Engineer:
Group Members

1)
2)
3)

Aim
At the end of lab student should be able to determine model of motor and validate it experimentally.

Theory
Topic 1.3 through 1.12 of Feedback Control Systems by Stefani

Equipment
PC with QICii software, DC motor control trainer.

Task Breakdown Marks


1) Find open loop transfer function of general DC Motor and its various forms. 2
2) Find transfer function of available Maxon dc motor using values of parameters. 2
Draw Block diagram of DC Motor using transfer function.
3) Bump test 2
4) Model validation 2
5) Sources of error 2

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 4: Linear Systems Analysis in MATLAB

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
Analysis of linear systems in Matlab

Theory
Chapter 1 and chapter 2 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB installed

Task Breakdown Marks


1) System definition in Matlab 1
2) Model interconnections in Matlab 4
3) Impulse and Step response in Matlab(LTI view) 3
4) Stability analysis of system in Matlab 2

1
DEE, CEME, NUST EE-371 Linear Control Systems

Explanation

System Definition In Matlab


1) sys = tf(num, den) creates a continuous-time transfer function with numerator(s) and
denominator(s) specified by num and den. The output sys is A tf model object, when num and
den are numeric arrays
>> r=tf([1 0 1],[1 2 1])
r=
s^2 + 1
-------------
s^2 + 2 s + 1
Continuous-time transfer function.
2) To use a rational expression to create a SISO TF model, type
s = tf('s');

H = s/(s^2 + 2*s +10);

This produces the same transfer function as

h = tf([1 0],[1 2 10]);

3) sys = zpk(z,p,k) creates a continuous-time zero-pole-gain model with zeros z, poles p, and
gain(s) k. The output sys is a zpk model object storing the model data. In the SISO case, z and p
are the vectors of real- or complex-valued zeros and poles, and k is the real- or complex-valued
scalar gain:
tr=zpk([1 3],[1 2 4],1)
tr =
(s-1) (s-3)
-----------------
(s-1) (s-2) (s-4)
Continuous-time zero/pole/gain model.
4) Tf commands also converts zpk form of system to tf form same holds for zpk command
5) In Simulink a block labelled “LTI System” is available in control system toolbox. Write above
commands (tf, zpk) in input space of block to define a linear system.

Task 1
Use all of above mentioned commands to define a fifth order system.

Model Interconnections
Interconnecting models of components allows you to construct models of control
systems. You can conceptualize your control system as a block diagram containing multiple
interconnected components, such as a plant or a controller. Using model arithmetic or
interconnection commands, you combine models of each of these components into a single model
representing the entire block diagram.

2
DEE, CEME, NUST EE-371 Linear Control Systems

For example, you can interconnect dynamic system models of a plant G(s), a controller C(s), sensor
dynamics S(s), and a pre filter F(s) to construct a single model that represents the entire closed-loop
control system in the following illustration:

Catalogue of Model Interconnections


Each type of block diagram connection corresponds to a model interconnection command or
arithmetic expression. The following table summarizes the block diagram connections with the
corresponding interconnection command and arithmetic expression

The connect command lets you connect systems in any configuration given in above figure. To use
connect, specify the input and output channel names of the components of the block diagram.
Connect automatically joins ports that have the same name, as shown in the following figure

3
DEE, CEME, NUST EE-371 Linear Control Systems

Example 1
We will define above system in Matlab

1) We assume following values for these models

G = zpk( [ ] , [ - 1 , - 1 ] , 1 ) ;
C = pid( 2 , 1 . 3 , 0 . 3 , 0 . 5 ) ;
S = tf( 5 , [ 1 4 ] ) ;
F = tf( 1 , [ 1 1 ] ) ;

The plant G is a zero-pole-gain (zpk) model with a double pole at s =–1. Model object C is a PID
controller. The models F and S are transfer functions

2) Connect the controller and plant models.


H = G*C;
To combine models using the multiplication operator *, enter the models in reverse order
compared to the block diagram. Alternatively, construct H(s) using the series command.
H = series(C,G);
3) Construct the unfiltered closed-loop response T s   H/(1  HS) .
Do not use model arithmetic to construct T algebraically:
T = H/(1+H*S)

4
DEE, CEME, NUST EE-371 Linear Control Systems

This computation duplicates the poles of H, which inflates the model order and might lead to
computational inaccuracy
4) Construct the entire closed-loop system response from r to y.
T_ry = T*F;
T_ry is a Numeric LTI Model representing the aggregate closed-loop system. T_ry does not keep
track of the coefficients of the components G, C, F, and S. You can operate on T_ry with any
Control System Toolbox control design or analysis commands

Example 2

Input = ysp , Output = y

1) Create the components of the block diagram: the process model P, the predictor model Gp, the
delay model Dp, the filter F, and the PI controller C. Specify names for the input and output
channels of each model so that connect can automatically join them to build the block diagram.

s=tf('s');
P = e x p ( - 93.9*s )*5.6 / ( 40.2*s + 1 ) ;
P.InputName = 'u' ; P.OutputName = ' y ' ;
Gp = 5.6/ ( 40.2*s + 1 ) ;
Gp.InputName = ' u ' ; Gp.OutputName = ' yp ' ;
Dp = exp ( - 9 3.9*s ) ;
Dp.InputName = ' yp ' ; Dp.OutputName = ' y1 ' ;
F = 1 / ( 2 0 *s + 1 ) ;
F.InputName = ' dy' ; F.OutputName = ' dp ' ;
C = pidstd ( 0.574 , 40.1 ) ;
C.InputName = ' e ' ; C.InputName = ' u ' ;
2) Create the summing junctions needed to complete the block diagram
sum1 = sumblk( ' e = ysp - ym ' ) ;
sum2 = sumblk( ' ym = yp + dp ' ) ;
sum3 = sumblk( ' dy = y - y1 ' ) ;

The argument to sumblk is a formula specified as a string. This string relates the input and
output signals of the summing junction. Sumblk creates a summing junction with the input and
output signal names specified in the formula. For example, in sum1, the string 'e = ysp - ym'

5
DEE, CEME, NUST EE-371 Linear Control Systems

specifies an output signal named e, which is the difference between input signals named ysp
and ym

3) Assemble the complete model from ysp to y.

T = connect(P,Gp,Dp,C,F,sum1,sum2,sum3,'ysp','y');

You can list the models and summing junctions in any order because connect automatically
interconnects them using their input and output channel names.

Task 2
Define following system given in MATLAB

1) example 1
2) example 2
3) DC Motor Position
4) Ball and Beam

DC Motor Model
J = 3.2284E-6;

b = 3.5077E-6;

K = 0.0274;

R = 4;

L = 2.75E-6;

s = tf('s');

P_motor = K/(s*((J*s+b)*(L*s+R)+K^2))

Impulse Response
Impulse (sys) plots the impulse response of the dynamic system model sys. This model can
be continuous or discrete, and SISO or MIMO. The impulse response of multi-input systems is the
collection of impulse responses for each input channel. Impulse (sys, Tfinal) simulates the impulse
response from t = 0 to the final time t = Tfinal.

Step Response
Step (sys) plots the step response of an arbitrary dynamic system model sys. This model can
be continuous or discrete, and SISO or MIMO. The step response of multi-input systems is the
collection of step responses for each input channel. In Simulink step block is available

S = stepinfo (y,t,yfinal) takes step response data (t,y) and a steady-state value yfinal and
returns a structure S containing the following performance indicators:

RiseTime — Rise time

SettlingTime — settling time

Overshoot — Percentage overshoot (relative to yfinal)

6
DEE, CEME, NUST EE-371 Linear Control Systems

Undershoot — Percentage undershoot

Peak — Peak absolute value of y

PeakTime — Time at which this peak is reached

System Response for Arbitrary Inbut


lsim simulates the (time) response of continuous or discrete linear systems to arbitrary inputs.
When invoked without left-hand arguments, lsim plots the response on the screen.

lsim(sys,u,t) produces a plot of the time response of the dynamic system model sys to the input
time history t,u. The vector t specifies the time samples for the simulation (in system time units,
specified in the TimeUnit property of sys), and consists of regularly spaced time samples.

The matrix u must have as many rows as time samples (length(t)) and as many columns as system
inputs. Each row u(i,:) specifies the input value(s) at the time sample t(i).

S = lsiminfo( y,t,yfinal) takes the response data (t,y) and a steady-state value yfinal and returns a
structure S containing the following performance indicators:

SettlingTime — settling time

Min — Minimum value of Y

MinTime — Time at which the min value is reached

Max — Maximum value of Y

MaxTime — Time at which the max value is reached

All of the above responses can be viewed in LTI VIEW TOOL

Task 3
View step response impulse response, step response characteristics m impulse response, impulse
response characteristics of systems given in task2

Repeat task 3 using LTIVIEW TOOL

Stability Analysis
1) Pole (sys) computes the poles p of the SISO or MIMO dynamic system model sys.
2) z = zero(sys) returns the zeros of the single-input, single-output (SISO) dynamic system model sys
3) [Wn, zeta] = damp(sys) returns the natural frequencies, Wn , and damping ratios, zeta, of the poles
of sys.(check this command for higher order systems)
4) h = pzplot(sys) computes the poles and (transmission) zeros of the dynamic system model sys and
plots them in the complex plane. The poles are plotted as x's and the zeros are plotted as o's. It also
returns the plot handle h. You can use this handle to customize the plot with the “getoptions” and
“setoptions” commands. Type “help pzoptions “for a list of available plot options.
5) p = poly(A) where A is an n-by-n matrix returns an n+1 element row vector whose elements are the
coefficients of the characteristic polynomial, det(λI – A). The coefficients are ordered in descending
powers: if a vector c has n+1 components, the polynomial it represents is c1λn + c2λn-1 + … + cn λ + cn+1

7
DEE, CEME, NUST EE-371 Linear Control Systems

p = poly(r) where r is a vector returns a row vector whose elements are the coefficients of the
polynomial whose roots are the elements of r.
6) r = roots(c) returns a column vector whose elements are the roots of the polynomial c. Row vector
c contains the coefficients of a polynomial, ordered in descending powers. If c has n+1 components,
the polynomial it represents is c1sn + … + cns + cn + 1.
7) pzmap(sys) creates a pole-zero plot of the continuous- or discrete-time dynamic system model sys.
For SISO systems, pzmap plots the transfer function poles and zeros. For MIMO systems, it plots the
system poles and transmission zeros. The poles are plotted as x's and the zeros are plotted as o's.

Task 4
Do stability analysis of systems given in task2.

8
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 5: Modelling in Simulink

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
At the end of lab student should be able to

1) Define linear systems in Simulink in two different ways.

Theory
Chapter 1 and chapter 2 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB installed

Task Break down Marks

1) System Modeling in Simulink using Direct form I 5


2) System Modeling in Simulink using Direct form II 5

1
DEE, CEME, NUST EE-371 Linear Control Systems

Explanation

System Definition in Simulink


1) LTI system block in control system toolbox allows you to define any LTI system using MATLAB
commands tf, zpk and ss.
2) You can define LTI system using basic blocks of Simulink for example differentiator, integrator,
summer and gain block

Example 1
Y (S ) 3s
In following figure the system  T (S )  is defined in many ways.
U (S ) s 1

Direct Form I Realization

b0 s 3  b1s 2  b2 s  b3
H ( s) 
s 3  a1s 2  a2 s  a3

b1 b2 b3
b0   
H ( s)  s s 2 s3
a a a
1  1  22  33
s s s
 
 b b b  1 
H ( s )   b0  1  22  33   
 s s s   1  a1  a2  a3 
 s s 2 s3 

2
DEE, CEME, NUST EE-371 Linear Control Systems

Direct Form II Realization


 
 1  b1 b2 b3 
H (s)     b0   2  3 
 s 
a1 a2 a3 s s
 1  2  3
 s s s 

DC Motor Model
J = 3.2284E-6;

b = 3.5077E-6;

K = 0.0274;

R = 4;

L = 2.75E-6;

s = tf('s');

3
DEE, CEME, NUST EE-371 Linear Control Systems

P_motor = K/(s*((J*s+b)*(L*s+R)+K^2))

Task 1
Define following systems (figure p1.26 of textbook). Using Direct form 1

Task 2
Define following system given in Simulink using direct form II

1) DC Motor Position

4
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 6: Speed Control 1

Conducted on: Submitted on:

Instructor:

Lab Engineer:
Group Members

1)
2)
3)

Aim
The objective of this lab is to develop an understanding of PI controller (applied to speed), how it works
and how it can be tuned to meet required specification

Theory
Chapter 5 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB and QICii installed, DCMCT

Task Breakdown Marks


1) PI Controller design to given specification 5
2) Ziegler Nichols method 3
3) Set-point weighting 2

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 7: Speed Control II

Conducted on: Submitted on:

Instructor:

Lab Engineer:
Group Members

1)
2)
3)

Aim
At the end of the lab student should know following concepts

1) Integrating windup in DC motor


2) How motor tracks a certain reference signal
3) How motor reacts to load disturbances

Theory
Chapter 4 and chapter 5 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB and QICii installed, DCMCT

Task Breakdown Marks


1) Integrator Windup 2
2) Tracking triangular signals 4
3) Response to load disturbance 4

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 8: Position Control I

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members
1)
2)
3)

Aim
To develop understanding of position Control of Motor using PD Control Algorithm

Theory
Chapter 4 and chapter 5 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB and QICii installed DCMCT

Task Breakdown Marks


1) Qualitative properties of proportional and derivative control 4
2) PD controller design to meet given specifications 6

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 9: Position Control II

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
Studying Student should understand dynamics of closed loop systems used for position control of
motor

Theory
Chapter 4 and chapter 5 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB and QICii installed, DCMCT

Task Breakdown Marks


1) Tracking triangular signals 5
2) Response to load disturbance 5

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 10: Robust Control

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members
1)
2)
3)

Aim
Understanding robust control design of motor control

Theory
Chapter 3 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB and QICii installed, DC motor control trainer

Task Breakdown Marks


1) Robustness and sensitivity 6
2) Complementary sensitivity 4

1
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 11: Controller design in Matlab

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
At the end of lab student should be able to design controller for LTI system using SISO tool of
MATLAB

Theory
Chapter 5 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB installed

Task Breakdown Marks


1) Controller design part A 2
2) Controller design part B 4
3) Controller design part C 4

1
 
     
 
     
 
Root Locus Controller Design Using the Matlab ‘sisotool’ Toolbox 

Overview 
In  this  lab  you  will  explore  the  use  of  the  root  locus  controller  design  methodology.  The  root  locus 
indicates  the  achievable  closed‐loop  pole  locations  of  a  system  as  a  parameter  (usually  the  controller 
gain) varies from zero to infinity. For a given plant it may or may not be possible to implement a simple 
proportional controller (i.e., select a gain that specifies closed‐loop pole locations along the root locus) 
to achieve the specified performance constraints. In fact, in most cases it will not be possible. When this 
occurs, it is the control engineer’s job to select a controller structure (a gain and numbers of poles and 
zeros of a controller transfer function) and the respective controller parameters (values for the gain and 
poles and zeros) to change the shape of the root locus so that for some values of the controller gain, the 
dominant  second  order  closed‐loop  poles  lie  within  the  performance  region.  In  this  lab  we  are 
investigating  several  controller  structures  on  individual  plants  and  comparing  the  design  process  and 
performance. We will be using the Matlab ‘sisotool’ toolbox to complete the root locus designs. 

Objectives 
At the conclusion of this laboratory experience, students should be able to: 

• To successfully design P, I, PD, PI, and PID controllers to meet closed‐loop performance 
specifications including transient performance and steady‐error. 

Deliverables 
A completed worksheet including the following: 

• Figures with plots of closed‐loop step responses. 
• Controller parameters, gain, pole(s), and zero(s), for each of the controller designs. 
• Answer all the questions on the worksheet. 

Background 
For this lab, we will assume a unity feedback controller of the form shown in Figure 1, where   is the 
controller transfer function and   is the plant transfer function. 
 
   
     
 
  Controller  Plant

Figure 1 – Generic Unity Feedback Control System. 

   

Page 1 of 9 
 
      
 

Note, in controller design there are multiple possible solutions, some better than others. It is possible to 
have  multiple  designs  that  satisfy  the  given  performance  constraints,  but  practical  implementation 
issues and cost could be prohibitive for some designs. As a general rule, it is a good idea to keep your 
controller as simple as possible while meeting the prescribed performance criteria. In this lab we will be 
investigating  several  controller  structures  on  individual  plants  and  comparing  the  design  process  and 
performance. The common controller structures we will be using in this lab are listed in Table 1 along 
with their respective transfer functions. 

Table 1 – Common Controller Types 
Controller Type  Controller Structure 

Proportional (P)   

Integral (I)   

·
Proportional + Integral (PI)   

·
Lag Controller  where | | | | 

Proportional + Derivative (PD)  ·  

·
Lead Controller  where | | | | 

Proportional + Integral + Derivative (PID)  ·
(Real Zeros)   

Proportional + Integral + Derivative (PID)  ·
(Complex Conjugate Zeros)   

Note that the I, PI, and PID controller’s will produce a position error ( ) of zero as long as the plant does 
not contain a zero at the origin, which would cancel the controllers pole at the origin. 

    Page 2 of 9 
 
     
 

Introduction to Matlab ‘sisotool’ 
A. Getting Started 
1. Enter the transfer function for the plant,  , in your workspace (i.e., from the Matlab 
command prompt). 

2. Type ‘sisotool’ at the command prompt. 

3. Click Close when the help window comes up. 

4. Click on View Æ Open Loop Bode to turn off the bode plot. (Whatever is checked in this list will 
be displayed in the window.) 

B. Loading the Transfer Function 
1. Click on File Æ Import. 

2. A window on the left will show you the transfer functions in your workspace, while the window 
on the right will let you choose the control system configuration. 

3. We will usually be assigning   to block ‘G’ (the plant). Double‐click the space next to ‘G’ and 
type your transfer function name and hit Enter. You must hit enter or nothing will happen. 

4. Once you hit enter, you should be able to click the OK button at the bottom of the window. 
Then the window will close. 

5. After you enter the transfer function, the root locus will be displayed. Double check to make 
sure that the open‐loop poles and zeros of your plant are in the correct locations. 

C. Generating the Step Response 
1. Click on Analysis Æ Response to Step Command. 

2. You will probably two curves on your step response plot. To fix this click on Analysis Æ Other 
Loop Responses… Make sure only   to   is checked, and then click OK. 

3. You can now click on the pink boxes on the root locus (the current closed‐loop poles for the 
given gain) and move them along the root locus. Essentially, you are exploring different 
controller gain values by doing this. Note how the step response changes as you move the 
closed‐loop pole locations. 

4. The values of the closed‐loop poles will appear at the bottom of the root locus window as you 
click and hold the mouse on the pink boxes representing them. This only gives you the value of 
the closed‐loop pole you are clicking on. If you need the other closed‐loop pole locations, you 
will have to click on them on each of the other branches. 

    Page 3 of 9 
 
     
 

D. Entering the Compensator (Controller) 
1. Click Compensators Æ Edit Æ C. Click on Add Real Zero or Add Real Pole to enter controller 
zeros or poles. You will be able to make changes to these values later. After you are done, click 
OK to exit this window. 

2. Look at the form of  to be sure it is correct. Then look at the root locus window and see how 
it changed once the compensator was added. 

3. You can again see how the step response changes with the compensator by c licking on the 
closed‐loop poles (the pink squares) and dragging them along the root locus. 

4. You can also change the location of the poles/zeros of the compensator by clicking on them and 
dragging them. Be careful not to inadvertently change the poles and zeros of the plant! 

E. Adding Design Constraints 
1. Click Edit Æ Root Locus Æ Design Constraints then either New to add new constraints or Edit 
to edit existing constraints. 

2. At this point you can choose from settling time, percent overshoot, damping ratio, and natural 
frequency constraints. 

F. Printing/Saving the Figures 
To save a figure ‘sisotool’ created during your session, click File Æ Print to Figure. This opens a 
figure window and puts the current figure there. 

G. Odds and Ends 
1. You may want to adjust the axes. To do this, click Edit Æ Root Locus Æ Properties, click on 
Limits, and set the desired axis limits. 

2. You may also want to turn the grid on. Click Edit Æ Root Locus Æ Grid. 

3. It is convenient to use the zero/pole/gain format for the compensators. To do this, click on Edit 
Æ SISO Tool Preferences Æ Options and click on zero/pole/gain. 

   

    Page 4 of 9 
 
     
 

In­Lab – Part A 
Use the plant given in (3) for this section of the lab. 

    (3) 
This is a second order system with two real poles located at ‐5 and ‐6. Our goal is to speed up the closed‐
loop system response so that the two‐percent settling time is less than 1 second, produce a position 
error of 0.1 or less, and keep percent overshoot less than 10%. To keep things reasonable, keep the gain, 
, less than 10 for all designs. 
 

1. Entering the Constraints 
Enter the percent overshoot and settling time constraints in ‘sisotool’. Remember that these 
constraints are based on a second order system step response and for higher order systems are 
predicated by the assumption of second order dominance of the closed‐loop system poles. 
Therefore, these design constraints are guidelines and you may have to refine your design to stay 
further inside these constraints to meet the performance specifications. 

2. Proportional (P) Control 
Determine the root locus for this system with proportional control. (When you enter the plant 
transfer function in ‘sisotool’, this is the default root locus plot. At this point the controller is 
specified as  1. 

Look at the step response as the gain increases. You should notice a few things: 

• as   increases, the imaginary part of the closed‐loop poles increases, and therefore the 
percent overshoot increases 
• as   increases, the position error decreases 
• since the real part of the pole does not change once   is greater than about 0.008, the 
settling time remains constant at about 0.8 seconds. 
• there is no value of   for which the system is unstable 

Do as well as you can to meet both constraints (you will not be able to do very well) then save the 
step response and control effort plots and your controller gain to turn in with the lab worksheet. 

3. Integral (I) Control 
a) Add a real pole at zero to implement the integral controller. You can do this from the root locus 
plot or the ‘Control and Estimation Tools Manager’ as described earlier. Note that once you 
place a compensator pole (or zero) you can click and drag it to a new location. However, for an 
integral controller the pole is always at zero, so leave it there for now. 
b) You should note that there are two root locus branches that head towards the imaginary axis 
(toward instability), which is generally not desirable.  
c) Find the value of   that makes the system marginally stable (the critical gain). 

    Page 5 of 9 
 
     
 

d) Try to find a value for   that gives a response with settling time less than or equal to 2 seconds 
and has little overshoot. Save the corresponding step response and control effort plots and the 
controller gain to turn in with the lab worksheet. 
e) Is the position error zero? Could you find a   value for which you could meet the 1 second 
settling time constraint? 

4. Proportional + Derivative (PD) Control 
a) Edit your compensator by removing the integrator (the pole at zero) and add a real zero. Note 
that in this PD design that you can select where you place this real zero along the real axis. Take 
a moment to explore what happens to the root locus, the step response, and the control effort 
as you move the zero. 
b) Now move the zero between ‐1 and ‐4. Find a configuration with a position error less than 0.5. 
Save the step response and control effort figure and the controller that produced it. 
c) Next move the zero between ‐7 and ‐9. What happens to the root locus? Are we likely to get a 
faster response of the closed‐loop system with this design than the previous one? Specify a 
controller with a zero in this range that produces a settling time of 0.1 seconds or less. (Don’t 
forget that  10.) Save the step response and control effort figure and the controller that 
produced it. 

5. Proportional + Integral (PI) Control 
a) Edit your compensator by adding a real pole at zero (adding the integral element). Note that in 
this PI design that you can select where you place this real zero along the real axis, but that the 
real pole must remain at zero.  
b) Place the zero between 0 and ‐5. Find a controller that produces a settling time of less than 0.8 
seconds, a percent overshoot of less than 2%, and a position error of zero. Save the step 
response and control effort figure and the controller that produced it. Are all your poles inside 
the design region? 
c) Now set the real zero to the left of ‐6. This type of configuration is not likely to get a faster 
response than with just a P controller. Why? 

6. Proportional + Integral + Derivative (PID) Control 
a) Let’s start by making a PID controller with complex conjugate zeros. Edit the previous 
compensator by deleting the real zero and adding complex conjugate zeros at  7 7 and look 
at the root locus plot. 
b) Find a gain value of   on this root locus so that the step response has less than 10% percent 
overshoot and a settling time less than 0.5 seconds. Save the step response and control effort 
figure and the controller that produced it. Are all your poles and zeros within the design region? 
Would you call this a second order dominant system? 
c) Keeping the real part of the zeros at ‐7, reduce the imaginary part of the zeros as much as 
possible while keeping the same basic shape of the root locus. At some point, as you reduce the 
imaginary part, the root locus will take a very different shape. Find a value of   on this root locus 
so that the step response has a percent overshoot of less than 2%, settling time less than 1 

    Page 6 of 9 
 
   
 

second, and a position error of less than 0.01. (Remember to keep  10.) Save the step 
response and control effort figure and the controller that produced it. 
d) Now let’s make a PID controller with real zeros at ‐7 and ‐8. Determine the root locus for this 
system. Find a value of   on this root locus so that percent overshoot is less than 2% and the 
settling time is less than 1 second. (Remember to keep  10.) Save the step response and 
control effort figure and the controller that produced it. 

   

    Page 7 of 9 
 
     
 

In­Lab – Part B 
Use the plant given in (4) for this section of the lab. 
.
    (4) 
. .

This is a model obtained from one of the mass‐spring‐damper systems in the controls lab. 

Performance Constraints 
• 0.1 for unit step inputs 
• , % 0.5 seconds 
• %OS 10% 

Controller Parameter Constraints 
• 1 
• 0.03 
• 10 

Meet these design constraints by implementing the following controller structures 
• I controller (hard to meet settling time, probably need  , % 1 sec) 
• PD controller (try to get  , % 0.1 sec) 
• PI controller (hard to meet settling time, probably need  , % 1.5 sec) 
• PID controller with real zeros 
• PID controller with complex conjugate zeros 

For each one of these controller designs, you need to include your plot of the step response, your 
controller parameters, and the steady state error. 
   

    Page 8 of 9 
 
     
 

In­Lab – Part C 
Use the plant given in (5) for this section of the lab. 
.
    (5) 
. .

This is a model obtained from another mass‐spring‐damper system in the controls lab. 

Performance Constraints 
• 0.2 for unit step inputs 
• , % 1 seconds 
• %OS 20% 

Controller Parameter Constraints 
• 1 
• 0.03 
• 10 

Meet these design constraints by implementing the following controller structures 
• I controller (hard to meet settling time, do the best you can) 
• PD controller (try to get  , % 0.1 sec) 
• PI controller (hard to meet settling time, probably need  , % 10 sec) 
• PID controller with real zeros 
• PID controller with complex conjugate zeros 

For each one of these controller designs, you need to include your plot of the step response, your 
controller parameters, and the steady state error. 

    Page 9 of 9 
 
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 12: Curve fitting

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
At the end of lab student should be able to use “curve fitting toolbox” of MATLAB for analytical
representation of data sets

Theory
Nil

Equipment
PC with MATLAB installed

Tasks Marks
1) Line fitting 4
2) Curve fitting of Sin2 function 6

1
ï ײ¬®±¼«½¬·±²
ײ ¬¸·­ ¬«¬±®·¿´ × ¿­­«³» §±« µ²±© ¬¸» ¾¿­·½­ ±º ©±®µ·²¹ ©·¬¸ Ó¿¬´¿¾ò Ú±®
¬¸» ±²»­ ©¸± ¼±²ù¬ µ²±©ô ¬¸»®» ¿®» ³¿²§ ±¬¸»® ¬«¬±®·¿´­ô ´·µ» ¬¸» ±²»­ §±«

»¨°´¿·² ¬¸» ¾¿­·½ ½±³³¿²¼­ ¿²¼ ©·´´ ¹·ª» »¨¿³°´»­ò


Ú»© ³±®» ¹»²»®¿´ ½±³³»²¬­æ

̸» °·½¬«®»­ ±º ¬¸» ½±³°«¬»® ­½®»»² ¼±­²ù¬ ´±±µ ½´»¿®ò ̸·­ °®±¾´»³ ·­
¼«» ¬± ¬¸» ­½®»»² ­·¦» ®»´¿¬·ª» ¬± ¬¸» °¿°»® ­·¦»ô ¦±±³·²¹ ·² ©·´´ ­±´ª»
¬¸·­ °®±¾´»³ò

ײ ¬¸» °·½¬«®»­ ¬¸¿¬ §±« ­»» ¿ ©·²¼±© ¿²¼ ¬¸» ½±³³¿²¼ ©·²¼±© ·²
¬¸» ¾¿½µ¹®±«²¼ô «­«¿´´§ §±« ½¿² ­»» ·² ¬¸» ½±³³¿²¼ ©·²¼±© ¬¸» ½±³ó
³¿²¼­ × «­»¼ò

ײ Ú·¹òï ©» ½¿² ­»» ¬¸» Ó¿¬´¿¾ ©·²¼±©ô ©¸»®» ¬¸» ¾·¹ °¿®¬ ·­ ¬¸»
þݱ³³¿²¼ É·²¼±©þ ¿²¼ ±² ¬¸» ´»º¬ ¬¸»®» ¿®» í ¬¿¾­æ þÝ«®®»²¬ Ü·®»½¬±®§þô
þɱ®µ­°¿½»þ ¿²¼ þݱ³³¿²¼ Ø·­¬±®§þò

̸» þݱ³³¿²¼ É·²¼±©þ ·­ ¬¸» ³¿·² ©·²¼±© ¿²¼ ·² ·¬ ©» ·²­»®¬ñ¿¼¼


¼¿¬¿ ·²¬± ¬¸» Ó¿¬´¿¾ ɱ®µ­°¿½» ±® ©®·¬·²¹ ½±³³¿²¼­ò

̸» þÝ«®®»²¬ Ü·®»½¬±®§þ ·­ ©¸»®» ¬¸» Ó¿¬´¿¾ °¿¬¸ ·­ ­»¬ò DZ« ½¿²

Ú·¹«®» ïæ ß² »¨¿³°´» ±º ¬¸» Ó¿¬´¿¾ ©·²¼±©ò

î
¬± ®«² ­½®·°¬­ ±® º«²½¬·±²­ô ¬¸»§ ²»»¼ ¬± ¾» ·² ¬¸·­ ¼·®»½¬±®§ ±® §±«
²»»¼ ¬± ¹± ¬± ¬¸»·® ¼·®»½¬±®§ò

·² ¬¸·­ Ó¿¬´¿¾ ­»­­·±²ò ɸ»² §±« ½´±­» Ó¿¬´¿¾ ¬¸» ɱ®µ­°¿½» ·­ ¾»·²¹

¬·³» ©·¬¸ ¬¸» Ú·´» ³»²«ò

̸» þݱ³³¿²¼ Ø·­¬±®§þ ¬¿¾ ­¿ª»­ ¿´´ ¬¸» ½±³³¿²¼ §±« ¬§°»¼ ·² ¬¸»
þݱ³³¿²¼ É·²¼±©þô ¿´­± ·² ±´¼ ­»­­·±²­ ±º Ó¿¬´¿¾ò

Ò±© ×ù´´ »¨°´¿·² ª»®§ ­¸±®¬´§ ¸±© ¬± ·²­»®¬ ¼¿¬¿ ·²¬± ¬¸» Ó¿¬´¿¾ ɱ®µ­°¿½»ô
îô × ¬§°»¼ í ½±³³¿²¼­ò ̸»

ââ ¨ ã Åðæðòïæîö°·Ã

©·¬¸ ¶«³°­
±º ðòïò ߺ¬»® ¬§°·²¹ ¬¸» ½±³³¿²¼ Ó¿¬´¿¾ °´±¬­ ¬¸» ®»­«´¬ ó ¬¸» ª¿´«» ±º ¬¸»
ª»½¬±® ¨ò ײ ¬¸» ­»½±²¼ ½±³³¿²¼æ

ââ § ã ­·²ø¨÷ò îå

­·²ø¨÷î ò ײ ¬¸·­ ½±³³¿²¼ ×

í
Ú·¹«®» íæ ̸» ®»­«´¬ ±º ¬¸» þ°´±¬ø¨ô§÷þ ½±³³¿²¼ò

©±«´¼ ´·µ» §±« ¬± °¿§ ¿¬¬»²¬·±² ¬± î ¬¸·²¹­æ


ïò Ú·®­¬ô ¬± ¬¸» º¿½¬ ¬¸¿¬ ¬¸»®» ©¿­ ²± ±«¬°«¬ò ̸·­ ·­ ¾»½¿«­» ±º ¬¸»
­»³·½±´±² øå÷ ¿¬ ¬¸» »²¼ ±º ¬¸» ½±³³¿²¼ò ̸·­ ­»³·½±´±² ¬»´´­ Ó¿¬´¿¾
¬¸¿¬ ·¬ ­¸±«´¼²ù¬ °®·²¬ ¬¸» ±«¬°«¬ò DZ« ­¸±«´¼ °«¬ ¬¸» ­»³·½±´±² ¿¬
¬¸» »²¼ ±º »ª»®§ ´·²»ô «²´»­­ §±« ©¿²¬ ¬± ­»» ¬¸» ±«¬°«¬ô º±® î ³¿·²
®»¿­±²­æ ׬ù­ »¿­·»® ¬± ­»» ©¸¿¬ ½±³³¿²¼­ §±« ¿´®»¿¼§ ·²­»®¬»¼ ¿²¼
©¸»² ¬¸»®» ·­ ¿ ´±¬ ¬± °®·²¬ ·¬ ½¿² ¬¿µ» ­±³» ¬·³»ò
îò ̸» ­»½±²¼ ¬¸·²¹ ·­ ¬¸¿¬ ©¸»² × ©¿²¬»¼ ¬± «­» ¬¸» þ­¯«¿®»þ ±°»®¿¬±®
× °«¬ ¿ ¼±¬ øò÷ ¾»º±®» ·¬ò ̸» ®»¿­±² ·­ ¬¸¿¬ Ó¿¬´¿¾ô ¾§ ¼»º¿«´¬ô ©±®µ­
©·¬¸ ³¿¬®·½»­ ¿²¼ ª»½¬±®­ô ¿²¼ ·² ±®¼»® ¬± ³«´¬·°´§ î ª»½¬±®­ ¿¬ ­·¦» ²ô
¬¸»·® ­·¦» ²»»¼ ¬± ¾» Åï ²Ã Å² ïà º±® ­½¿´¿® °®±¼«½¬ô ±® Ų ïà Åï ²Ã
º±® ¹»¬¬·²¹ ¬¸» ­¯«¿®» ±º »¿½¸ »´»³»²¬ò Í·²½» ±«® ª»½¬±®­ ¸¿ª» ¬¸» ­¿³»
­·¦»ô «­·²¹ ¬¸» ¼±¬ ¾»º±®» ¬¸» ­¯«¿®» ±°»®¿¬±® ¬»´´ Ó¿¬´¿¾ ¬± ¼± ¬¸·­
±°»®¿¬·±² ø­¯«¿®» ·² ±«® ½¿­»÷ ±² »¿½¸ »´»³»²¬ ¿²¼ ²±¬ ±² ¬¸» ª»½¬±®ò
̸» ´¿­¬ ½±³³¿²¼ ¶«­¬ ±°»²­ ¿ ²»© Ú·¹«®» ©·²¼±© øÚ·¹òí÷ ¿²¼ °´±¬­ §
¿­ ¿ º«²½¬·±² ±º ¨ò
× ©¿²¬ ¬± ³»²¬·±² ¿ º»© ³±®» ¬¸·²¹­ ¾»º±®» ©» ½±²¬·²«»æ
ß­ §±« ½¿² ­»»ô ¬¸» î ª¿®·¿¾´»­ ©»®» ¿¼¼»¼ ¬± ¬¸» ɱ®µ­°¿½»ô ­»» Ú·¹òîò
É» ½¿² ­»» ¬¸»·® ­·¦» ¿²¼ ¬¸»·® ²·³ñ³¿¨ ª¿´«»­ò
̸» ª¿®·¿¾´»
¼±²ù¬ ­»» ·¬ ·² ¬¸» ɱ®µ­°¿½» ¬¿¾ò ß´­± ¬¸» ·³¿¹·²¿®§ ²«³¾»® ¥ ·­

ì
Ú·¹«®» ìæ ̸» Ý«®ª» Ú·¬¬·²¹ ©·²¼±©ò

ââ ·ã­¯®¬øóï÷å

̸» º«²½¬·±²­ þ­·²þ ¿²¼ þ­¯®¬þô ­¯«¿®» ®±±¬ô ¿®» Ó¿¬´¿¾ º«²½¬·±²­ò ̸»
Ó¿¬´¿¾ Ø»´° ½±²¬¿·²­ ·²º±®³¿¬·±² ¿¾±«¬ ¬¸»­» º«²½¬·±²­ ¿²¼ ±² ¿²§
±¬¸»® Ó¿¬´¿¾ º«²½¬·±²ò ̸»®» ¿®» ß ÔÑÌ ÑÚ Ó¿¬´¿¾ º«²½¬·±²­ò ß²§
³¿¬¸»³¿¬·½¿´ º«²½¬·±² ´·µ» þ­·²þ ±® þ»¨°þ ±® ³¿²·°«´¿¬·±² º«²½¬·±² ø±²
ª»½¬±® ±® ³¿¬®·½»­÷ ´·µ» þ³¿¨þ ±® þ³»¿²þ ¬¸¿¬ §±« ½¿² ¬¸·²µ ±ºô ·­
°®±¾¿¾´§ ¬¸»®»ò

î ̸» Ý«®ª» Ú·¬¬·²¹ ̱±´


¬± ±°»² ¬¸» Ý«®ª» Ú·¬¬·²¹ ¬±±´ ¶«­¬ ¬§°»æ

ââ ½º¬±±´

¿²¼ ¬¸·­ ¬±±´ ©·´´ ¾» ±°»² ·² ¿ ²»© ©·²¼±©ò Í»» Ú·¹òìò ̸·­ ©·²¼±© ¸¿­ ë
¾«¬¬±²­æ

Ü¿¬¿òòòæ É·´´ ±°»² ¿ ²»© ©·²¼±© ¬¸¿¬ ©·´´ ¿´´±© «­ ¬± ·³°±®¬ ¼¿¬¿ º®±³
¬¸» Ó¿¬´¿¾ ©±®µ­°¿½» ·²¬± ¬¸» Ý«®ª» Ú·¬¬·²¹ ¬±±´ »²ª·®±²³»²¬ ø½¿´´»¼
¼¿¬¿ ­»¬÷ò

ë
Ú·¹«®» ëæ Ý®»¿¬·²¹ ¿ ²»© ¼¿¬¿ ­»¬ò

Ú·¬¬·²¹òòòæ

Û¨½´«¼»òòòæ É·¬¸ ¬¸·­ ©·²¼±© ©» ½¿² »¨½´«¼» ­±³» ¼¿¬¿ °±·²¬­ º®±³ ¬¸»
¼¿¬¿ ­»¬ò

䱬¬·²¹òòòæ ׺ ©» ¸¿ª» ¿ º»© ¼¿¬¿ ­»¬ ¿²¼ñ±® ¿ º»© ¹®¿°¸­ô ¸»®» ©» ½¿²
¼»½·¼» ©¸·½¸ ±²» ©» ©¿²¬ ¬± ­»»ô ¬± °´±¬ò ̸» ®»­¬ ¿®» ¶«­¬ ²±¬ ­¸±©²ô
¬¸»®» ¿®» ²±¬ ¼»´»¬»¼ò

ß²¿´§­·­òòòæ
¼±©ò

̸» Ü¿¬¿òòò ¿²¼ Ú·¬¬·²¹òòò ¿®» ¬¸» ³±­¬ ·³°±®¬¿²¬ ¿²¼ ×ù´´ »¨°´¿·² ¸±© ¬±
«­» ¬¸»³ ·² ³±®» ¼»¬¿·´­ «­·²¹ ¬¸» ²»¨¬ »¨¿³°´» ø§ ã ­·²ø¨÷÷ò

îòï Ü¿¬¿òòò
ߺ¬»® °®»­­·²¹ ¬¸» Ü¿¬¿òòò ¾«¬¬±²ô ¿ ²»© ©·²¼±© ©·´´ ±°»²ô Ú·¹òëô ¿²¼ ©»
½±«´¼ ½¸±±­» ¬¸» ¨ô § ¿²¼ ©»·¹¸¬­ ª¿®·¿¾´»­ï ô ­»¬ ¬¸» ¼¿¬¿ ­»¬ ²¿³» ¿²¼ ½´·½µ
¬¸» þÝ®»¿¬» ¼¿¬¿ ­»¬þ ¾«¬¬±²ò ߺ¬»® ¬¸¿¬ §±«ù´´ ­»» §±«® ¼¿¬¿ ­»¬ ·² ¬¸» ´·­¬
¿²¼ §±« ½¿² ½´±­» ¬¸» ©·²¼±©ò
ï
̸»­» ª¿®·¿¾´»­ ÓËÍÌ »¨·­¬ ·² ¬¸» Ó¿¬´¿¾ ɱ®µ­°¿½»ô ±¬¸»®©·­» ¬¸»§ ©±²ù¬ ¿°°»¿®
·² ¬¸» ´·­¬ò

ê
ײ ¬¸·­ ­¸±®¬ »¨¿³°´» × ¼·¼²ù¬ ­»¬ ¿²§ ª¿´«» ¬± ¬¸» ©»·¹¸¬ ¾»½¿«­» ×
½®»¿¬»¼ ¬¸» ¨ ¿²¼ § ª¿®·¿¾´»­ò ɸ»² §±« ©¿²¬ ¬± ¿²¿´§¦» ­±³» ¼¿¬¿ô «­«¿´´§
¬¸» ¨ °¿®¿³»¬»® ·­ ­±³»¬¸·²¹ §±« ½¸±±­»ò Ô·µ» ³»¿­«®·²¹ ­±³»¬¸·²¹ »ª»®§
­»½±²¼ ø±® ­±³» ±¬¸»® ¬·³»÷ô ±® »ª»®§ ïð ½³ò ̸¿¬ù­ ¬¸» ³»¿²·²¹ ±º º®»»
°¿®¿³»¬»®ò ̸» § °¿®¿³»¬»® ·­ ­±³»¬¸·²¹ §±« ³»¿­«®» ø¬¸» ¼»°»²¼»²¬
°¿®¿³»¬»®÷ ¿²¼ ­·²½» ©»ù®» ·² ®»¿´ ´·º»ô ¬¸» ³»¿­«®»³»²¬ ¸¿­ »®®±®­ò ͱ³»
±º ¬¸» ¼¿¬¿ °±·²¬­ ©·´´ ¸¿ª» ­³¿´´ »®®±® ¿²¼ ­±³» ©·´´ ¸¿ª» ¾·¹ »®®±®î ò ̸»

­±³» ±º ¬¸» ¼¿¬¿ °±·²¬­ ¸¿ª» ´¿®¹»® »®®±® ¾¿®­ ø®»´¿¬·ª» ¬± ¬¸» ±¬¸»® °±·²¬­÷

°±·²¬­ ´»­­ ·² ·¬­ ½¿´½«´¿¬·±²­ò ̸¿¬ù­ ©¸¿¬ ¬¸» ©»·¹¸¬­ ¿®» º±®ò ̸» ³±®»
¿½½«®¿¬» ¼¿¬¿ °±·²¬­ ¹»¬ ¸·¹¸»® ©»·¹¸¬­ ®»´¿¬·ª» ¬± ¬¸» ´»­­ ¿½½«®¿¬» ¼¿¬¿
°±·²¬­ò
̸» ©¿§ ¬± ½®»¿¬» ¬¸» ©»·¹¸¬­ô ¿½½±®¼·²¹ ¬± ¬¸» ¿¾±ª» ´±¹·½ô ·­ ¬¸¿¬ ¬¸»
©»·¹¸¬ ·­ ¬¸» ·²ª»®­» ±º ¬¸» ­¯«¿®» ±º ¬¸» »®®±® ¾¿®ò ײ ¿ ³¿¬¸»³¿¬·½¿´ ©¿§æ
·º ©· ·­ ¬¸» ©»·¹¸¬ ¿²¼ · ·­ ¬¸» »®®±® ±º ¬¸» ·¬¸ ¼¿¬¿ °±·²¬ô ¬¸»²æ
ï
©· ã îæ
·

̸» ͳ±±¬¸ ¬¿¾ ·­ º±® ­³±±¬¸·²¹ ²±·­§ ¼¿¬¿ô ­±³»¬¸·²¹ ©» ¼±²ù¬ ²»»¼
º±® ²±© ¿²¼ × ©±²ù¬ »¨°´¿·²ò

îòî Ú·¬¬·²¹òòò

¿ ¹®¿°¸ ·² ¬¸» Ý«®ª» Ú·¬¬·²¹ ̱±´ò ײ Ú·¹òê ©» ½¿² ­»» ¬¸» ·²°«¬ × »²¬»®»¼

Ú·¬ Û¼·¬±® ­± ©» ½±«´¼ ­»» ¿´´ ±º ¬¸» ±«¬°«¬ò Ö«­¬ ¾§ ´±±µ·²¹ ±² ¬¸» °´±¬ ©»

·­ ïô ¬¸» º®»¯«»²½§ ø±® ³±®» °®»½·­»´§ô ÿ ã î ô ©¸·½¸ ·­ ¾ï ·º ±«® ¨ ª¿®·¿¾´»


î

̸» »®®±® ø±® »®®±® ¾¿®÷ ·­ º±® »¿½¸ ³»¿­«®»³»²¬ò ׬ ½¿² ¸¿°°»² ¬¸¿¬ ¿´´ ¬¸» ³»¿­«®»³»²¬­
º±® ¬¸» ­¿³» ¨ ª¿´«» ©·´´ ¸¿ª» ¬¸» ­¿³» »®®±®ò

é
Ú·¹«®» êæ Ú·¬¬·²¹ ¬¸» ¼¿¬¿ ©·¬¸ § ã ¿ï ­·²ø¾ï ¨ õ ½ï÷ º«²½¬·±²ò

·­ ¬¸» ¬·³»÷ ·­ ¿´­± ï ¿²¼ ¬¸¿¬ ¬¸» °¸¿­» ø½ï÷ ·­ ðô ´·µ» ¬¸» °¿®¿³»¬»®­ ©»
½¸±±­» ©¸»² ©» ½®»¿¬»¼ ¬¸» § ª»½¬±® ø§ ã ­·²ø¨÷÷ò

¬¸» °¿®¿³»¬»® ·¬­»´º÷ò ײ ±¬¸»® »¨¿³°´»­ô ´·µ» ·² Í»½ò íòï

½±²­¬¿²¬­ ø¿ïô ¾ï ¿²¼ ½ïô ·² ±«¬ »¨¿³°´»÷ ¬¸¿¬ Ó¿¬´¿¾ ½¸±±­»ô ¿²¼ ¬®§ ¬±

¬± ­±³»¬¸·²¹ »´­» ±® ¼±»­²ù¬ ½±²ª»®¹» ¿¬ ¿´´ò Ý´·½µ·²¹ ¬¸» þÚ·¬ ±°¬·±²­òòòþ


©·´´ ±°»² ¿ ©·²¼±© ¬¸¿¬ ¿´´±© ¿­ ¬± ½¸¿²¹» ¬¸·­ ·²·¬·¿´ °¿®¿³»¬»®ò × ©·´´ «­»
¬¸¿¬ ·² ±²» ±º ¬¸» »¨¿³°´»­ò

¬¸» ²»»¼»¼ º«²½¬·±²ò × ©·´´ ­¸±© ¸±© ¬± ¼± ¬¸¿¬ ·² »¨¿³°´» íòîò

©» ½¿² ½±²¬·²«» ¬± ©±®µ ©·¬¸ ¬¸·­ ¼¿¬¿ ·² ¬¸» ݱ³³¿²¼ É·²¼±©ò ײ »¨ó
¿³°´» íòïô ×ù´´ ­¸±© ¿²±¬¸»® ©¿§ ¬± ­¿ª» ¼¿¬¿ ¬± ¬¸» ɱ®µ­°¿½» ¿²¼ ¬± °´±¬
·¬ ©·¬¸ Û®®±® ¾¿®­ò

è
îòí Û¨½´«¼»òòòô 䱬¬·²¹òòò ¿²¼ ß²¿´§­·­òòò

×ù´´ ²±¬ »´¿¾±®¿¬» ±² ¬¸»³ò


̸» ¿²¿´§­·­ ©·´´ ±°»² ¿ ©·²¼±© ¬¸¿¬ »²¿¾´» «­ ¬± ¹»¬ ¬¸» ª¿´«» ±º ¬¸»

·²¬»¹®¿¬» ¬¸» º«²½¬·±²ò ×ù´´ »¨°´¿·² ³±®» ©¸»² ×ù´´ ­¸±© ¿² »¨¿³°´» øÍ»½ò
íòï

îòì λ­·¼«¿´­
Ù±·²¹ ¬± ¬¸» ³»²«æ Ê·»© ÿ λ­·¼«¿´­ ÿ ͽ¿¬¬»® 䱬ô ©·´´ ±°»² ¿ ²»©

é ·­ ©¸¿¬ ©»ù´´ ¹»¬ º±® ±«® »¨¿³°´»ò


ɸ»² ´±±µ·²¹ ±² ¬¸» ®»­·¼«¿´­ ·¬ù­ ·³°±®¬¿²¬ ¬± ­»» ¬¸¿¬ ¬¸»§ ¿®» ­½¿¬ó
¬»®»¼ ®¿²¼±³´§ ¿²¼ »ª»²´§ ¿®±«²¼ ¬¸» ¦»®± ª¿´«»ò ̸¿¬ ¬¸»§ ¿®» ²±¬ °±­·¬·ª»

ײ ±«® ¹®¿°¸ ¾±¬¸ ±º ¬¸»­» ½®·¬»®·±²­ ¼±²ù¬ »¨·­¬ô ¾«¬ ·º ©» ´±±µ ±² ¬¸»
ª¿´«» ±º ¬¸» ®»­·¼«¿´­ô «° ¬± ë ïð ïì ô ©» ½¿² «²¼»®­¬¿²¼ ¬¸¿¬ ¬¸»­» ·­ ¶«­¬
®±«²¼·²¹ ø±® ½¿´½«´¿¬·±² ±º ¬¸» ­·² º«²½¬·±²÷ »®®±® ¾»½¿«­» ¬¸» ²«³¾»®­ ·²

í Û¨¿³°´»­

ââ ¨ãÅï î í ì ëÃå
ââ §ãÅï î í ì ìòëÃå

¿²¼ ¬¸» »®®±® ¾¿®­ ¿®»æ

ââ »®®ãÅðòï ðòî ðòí ðòì ðòëÃå

̸·­ ·­ ½´»¿®´§ ¿ ­¬®¿·¬ ´·²» ©·¬¸ ­´±°» ±º ïô ¶«­¬ ¬¸» ´¿­¬ °±·²¬ ´±±µ­ ¬± ¾»
©®±²¹ò Ѳ» ±°¬·±² ·­ ¬± »¨½´«¼» ¬¸·­ °±·²¬ º®±³ ¬¸» ¹®¿°¸ ¾«¬ ¬¸·­ ±°¬·±²
·­ ²±¬ ¬¸» °®»º»®®»¼ ±²»ò É»ù´´ ­»» ¬¸¿¬ ¿¼¼·²¹ ©»·¹¸¬­ ¸¿­ ­·³·´¿® ®»­«´¬ò
í

ç
Ú·¹«®» éæ ̸» °´±¬ ©·¬¸ ¬¸» ®»­·¼«¿´­ò

©»·¹¸¬­

ײ Ú·¹òè

ïð
Ú·¹«®» çæ ̸» ß²¿´§­·­ ©·²¼±© ¿²¼ ¬¸» ±«¬°«¬ò

°»®º»½¬ ¬±±ò Þ»¬©»»² ¬¸» î ©·²¼±©­ô ¬¸» Ó¿¬´¿¾ ½±³³¿²¼­ ¿®» ¿´­± ª·­·¾´»

½¿´½«´¿¬» ­»°¿®¿¬»´§ ó ·² ¬¸·­ ½¿­» ·¬ù­ ïðû ±º ¬¸» ¨ ª¿´«»ò


Ò±© ©»ù´´ ¹± ¾¿½µ ¬± ¬¸» Ý«®ª» Ú·¬¬·²¹ ̱±´ ¿²¼ ±°»² ¬¸» ß²¿´§­·­

°±·²¬­ ¬± ¾»æ ðæðòëæïð ø¾»¬©»»² 𠬱 ïð ·² ¶«³°­ ±º ðòë÷ò ߺ¬»® ¬¸¿¬ ©»ù´´


È· þ ¿²¼ þÚ±® º«²½¬·±²þò É»ù´´ ¿´­± ¿¼¼ þ䱬 λ­«´¬­þ
¿²¼ þ䱬 ¼¿¬¿ ­»¬þô ¿²¼ ½´·½µ ß°°´§ò ̸» ±«¬°«¬ ·­ ¼·­°´¿§»¼ ·² Ú·¹òçò

·² ¬¸» ®¿²¹» ©·¬¸±«¬ ¼¿¬¿ °±·²¬­ ·¬ ­¬¿®¬ ¬± ¾» ´»­­ ¿½½«®¿¬»ò ׺ ©»ù´´ ¼± ¬¸»
­¿³» º±® ¬¸» ¼¿¬¿ ­»¬ ©·¬¸±«¬ ¬¸» ©»·¹¸¬­ ©»ù´´ ­»» ¬¸¿¬ ¬¸» °®»¼·½¬·±² ·­ ´»­­
¿½½«®¿¬»ò

Ô»¬ù­ ¿²¿´§¦» ¿¹¿·² ¬¸» ¼¿¬¿ ­»¬ ©·¬¸ ©»·¹¸¬­ ¿²¼ ­¿ª» ·¬ ¬± ɱ®µ­°¿½»
ø«­·²¹ ¬¸» ¾«¬¬±²÷ò ß ²»© ª¿®·¿¾´» ©·´´ ¾» ½®»¿¬»¼ò É» ½¿² ½¸¿²¹» ·¬­ ²¿³»
¾«¬ × «­»¼ ¬¸» ¼»º¿«´¬ ±²»æ þ¿²¿´§­·­®»­«´¬­ïþò ܱ«¾´» ½´·½µ ±² ¬¸·­ ª¿®·¿¾´»
·² ¬¸» ɱ®µ­°¿½» ¬¿¾ ©·´´ ±°»² ¬¸» þß®®¿§ Û¼·¬±®þ ©¸»®» ©» ½¿² ­»» ©¸¿¬
¬¸·­ ª¿®·¿¾´» ½±²¬¿·²­ò
ײ ¬¸» Ó¿¬´¿¾ ݱ³³¿²¼ É·²¼±© ¬§°» ¬¸» º±´´±©·²¹ ½±³³¿²¼­ ø»ª»®§ó
¬¸·²¹ ¿º¬»® û ·­ ½±³³»²¬­ ¿²¼ ¿®»²ù¬ ²»½»­­¿®§÷æ

ââ
ââ »®®±®¾¿®ø¨ô §ô »®®ô ù®±ù÷ û °´±¬­ ¬¸» ¼¿¬¿ô ¿­ ½·®½´»­ ø­³¿´´ ´»¬¬»® ± ó ²±¬
¦»®±÷ô ©·¬¸ »®®±®¾¿®­ ·² ¿ ®»¼ ½±´±®

ïï
ââ ¸±´¼ ±² û 䱬¬·²¹ ¬¸» ²»¨¬ °´±¬­ ©·¬¸±«¬ ¼»´»¬·²¹ ¬¸» ±´¼ ±²»­
ââ
§­·­®»­«´¬­ïò´±©»®ô ù¾æùô ¿²¿´§­·­®»­«´¬­ïò¨·ô ¿²¿´§­·­®»­«´¬­ïò«°°»®ô ù¾æù÷ û

ââ

ø׺ §±« «­» ½±°§ñ°¿­¬» ¼»´»¬» ¿²§ ²»© ´·²» ·² ¬¸» ݱ³³¿²¼ É·²¼±© ·º
§±« ¸¿ª» ±²» ó ¿´´ ¬¸» ½±³³¿²¼­ ¿®» ±²» ´·²»÷ò
Ú·¹òïð
¬·¬´»­ô ½´·½µ·²¹ ¬¸» ­³¿´´ ·½±² ¾»´±© ¬¸» ¸»´° ³»²« ©·´´ ±°»² ¬¸» ²»»¼»¼
»¼·¬±®­ ø±® ©·¬¸ ¬¸» ³»²«æ Ê·»© ÿ 䱬 Þ®±©­»® ¿²¼ Ê·»© ÿ Ю±°»®¬§
Û¼·¬±®÷ò ݸ±±­·²¹ ¬¸» ߨ»­ ·² ¬¸» 䱬 Þ®±©­»® ©·´´ ¿´´±© «­ ¬± ¿¼¼ ¬·¬´»­
ø·² ¬¸» Ю±°»®¬§ Û¼·¬±®÷ ¬± ¬¸» °´±¬ ¿²¼ ¿¨»­ô ¿²¼ ½¸±±­·²¹ ±²» ±º ¬¸» °´±¬­
©·´´ ¿´´±© «­ ¬± ½¸¿²¹» ¬¸» ½±´±®ô ­¸¿°» ¿²¼ ³±®» °®±°»®¬·»­ ±º ¬¸» °´±¬
´·²»­ ¬¸»³­»´ª»­ò É» ½¿² ¿´­± ·²­»®¬ þÔ»¹»²¼þ ±® þÌ»¨¬¾±¨þ ©·¬¸ ¬¸» þײ­»®¬þ
ïïò

­·²î º«²½¬·±²ò ̸·­ º«²½¬·±² ·­²ù¬ ¿ ¾«·´¬

²±·­§ ¼¿¬¿ ¾«¬ ©·¬¸±«¬ »®®±®¾¿®­ ó ¶«­¬ ¾»½¿«­» ×ù´´ ¿´®»¿¼§ »¨°´¿·² ¿¾±«¬
¬¸»³ ¿²¼ ·² ¬¸·­ »¨¿³°´» × ©¿²¬ ¬± ­¸±© ­±³»¬¸·²¹ »´­»ô ²±¬ ¾»½¿«­» ¬¸»§ù®»
²±¬ ·³°±®¬¿²¬ò

¾±«²¼­ò

ïî
Ú·¹«®» ïïæ ̸» ­¿³» °´±¬ ¿­ ·² Ú·¹òï𠾫¬ ©·¬¸ ¬·¬´»­ ¿²¼ ­±³» ¼¿¬¿ ±² ¬¸»

ײ Ú·¹òïî ©» ½¿² ­»» ¬¸» ½±³³¿²¼­ ¬¸¿¬ ½®»¿¬» ¬¸» ¼¿¬¿ ¿²¼ ¿¼¼ ­±³»
®¿²¼±³ ª¿´«»ò ̸» ¼¿¬¿ ·­ ­·²î ©·¬¸ ¿³°´·¬«¼» ±º èô º®»¯«»²½§ ±º ðòî ¿²¼

ײ ±®¼»® ¬± ¹»¬ ¬± ¬¸» ­¬¿¬» ±º Ú·¹òïîô ©» ²»»¼ ¬± ½®»¿¬» ¬¸» ª¿®·¿¾´»­

Ú·¹«®» ïîæ ­·²î »¨¿³°´»ò

ïí
Ú·¹«®» ïíæ ­·²î »¨¿³°´» ó ¿º¬»® ½¸¿²¹·²¹ ¬¸» ·²·¬·¿´ °¿®¿³»¬»®­ò

·² ¬¸» Ó¿¬´¿¾ ɱ®µ­°¿½»ô ±°»² ¬¸» Ý«®ª» Ú·¬¬·²¹ ̱±´ ¿²¼ ½®»¿¬» ¬¸» ¼¿¬¿
­»¬ô ¿²¼ ¬¸»² ¬± ±°»² ¬¸» Ú·¬ Û¼·¬±®ô ½®»¿¬» Ò»© Ú·¬ô Ý«­¬±³ Û¯«¿¬·±²

Ú·¹«®» ïìæ ­·²î

ïì
¿²¼ Ò»© Û¯«¿¬·±²ò ײ ¬¸» ²»© ©·²¼±©ô þÝ®»¿¬» Ý«­¬±³ Û¯«¿¬·±²þô ¹± ¬±
þÙ»²»®¿´ Û¯«¿¬·±²­þ ¬¿¾ ¿²¼ ¬§°» ¬¸» »¯«¿¬·±² ø¸»®» ©» ¼±²ù¬ ²»»¼ ¬¸» ¼±¬
¾»º±®» ¬¸» ±°»®¿¬±®­ô ´·µ» ©» ²»»¼ ·¬ ·² ¬¸» Ó¿¬´¿¾ ݱ³³¿²¼ É·²¼±©÷ò

±²» Ó¿¬´¿¾ ½¸±±­» ±²´§ º±® °»¼¿¹±¹·½ ®»¿­±²ô ¬¸·­ ©¿§ × ½±«´¼ ­¸±© ¸±©
¬± ½¸¿²¹» ¬¸»³ ¿º¬»®©¿®¼ò ߺ¬»® ½´·½µ·²¹ ÑÕ ¬¸·­ »¯«¿¬·±² ©·´´ ¾» ¿¼¼»¼
¬± ¬¸» þÝ«­¬±³ Û¯«¿¬·±²­þ ·² ¬¸» Ú·¬ Û¼·¬±®ò Ý´·½µ·²¹ ß°°´§ ©·´´ ¹·ª» ¬¸»
®»­«´¬ ¬¸¿¬ ·­ °´±¬¬»¼ ·² ¬¸» Ý«®ª» Ú·¬¬·²¹ ̱±´ ·² Ú·¹òïîô ©¸·½¸ ·­ ½´»¿®´§

¬¸¿¬ ­¿§­ ¬¸» ­¿³»ò


Ý´·½µ·²¹ ¬¸» þÚ·¬ Ñ°¬·±²­òòòþ ¾«¬¬±² ©·´´ ±°»² ¿ ²»© ©·²¼±© ©¸»®» ©»
ïíò
ß½¸·»ª·²¹ ¬¸» ®·¹¸¬ ®»­«´¬ ½¿² ¾» ¿ ¾·¬ ¬®·½µ§ ¿²¼ ¿²²±§·²¹ô »­°»½·¿´´§
º±® °»®·±¼·½ º«²½¬·±²­ô ¿²¼ ·¬ ®»¯«·®»­ ¬¸¿¬ ¿º¬»® »ª»®§ ½¸¿²¹» §±« ¿°°´§

®·¹¸¬ ±²» §±« ²»»¼ ¿´­± ¬± °´±¬ ¬¸» ®»­·¼«¿´­ ¿²¼ ­»» ¬¸¿¬ ¬¸»§ ¿®» ®¿²¼±³´§
¼·­¬®·¾«¬»¼ô ­»» Ú·¹òïìò Ó§ ´±¹·½ ¸»®» ©¿­ ¬¸¿¬ ¬¸» ¿³°´·¬«¼» ·­ ¿¾±«¬ ïðô

ïë
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 13: State Feedback Control

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
Learning Stabilizing State feedback control and tracking state feedback

Theory
Chapter 8 and 9of Feedback Control Systems by Stefani

Equipment
PC with MATLAB

Tasks Marks
1) State feedback control(Stabilization) 5
2) State feedback control (tracking using pre scalar N) 5

1
DEE, CEME, NUST EE-371 Linear Control Systems

Explanation

Stabilization
The first step in the state feedback control requires us to assume that all the states are available for feedback-that is,
we have access to the complete state, x(t), for all t. The control input u(t), is given by control law.

u  K x
Determining the gain matrix K is the objective of the full-state feedback design procedure. The stability of
the closed-loop system is guaranteed if the system is controllable.

System Model

x  A x  B u

u x

-K

Full-state feedback

Figure 1. Full-state feedback block diagram (with no reference input)

D
 y
u x x  
B  C

A
K
Figure 2: State Feedback System (Stabilization Case)

2
DEE, CEME, NUST EE-371 Linear Control Systems

Tracking
For tracking a certain reference r(t) we have in addition to control law u = -kx we have to use block named
pre scalar N the value of N is given by

1
N
C ( A  BK )1 B

System Model
r(t) u
N
x  A x  B u
x

Control Law

-K
Figure 3: Using pre scalar for tracking control

Systems

Motor Model
A = [0 1 0

0 -b/J K/J

0 -K/L -R/L];

B = [0 ; 0 ; 1/L];

C = [1 0 0];

D = [0];

motor_ss = ss(A,B,C,D)

Inv

Ball and Beam Model

H = -m*g/(J/(R^2)+m);

A = [0 1 0 0

00H0

3
DEE, CEME, NUST EE-371 Linear Control Systems

0001

0 0 0 0];

B = [0 0 0 1]';

C = [1 0 0 0];

D = [0];

ball_ss = ss(A,B,C,D)

Task1
Design tracking state feedback controller for stabilization of above two systems.

Task2
Design tracking state feedback tracking controller for two systems reference signal is step.

Optional
Design state feedback control including integrator for eliminating the effect of Perturbation

4
DEE, CEME, NUST EE-371 Linear Control Systems

Lab 14: Output Feedback Control

Conducted on: Submitted on:

Instructor:

Lab Engineer:

Group Members

1)
2)
3)

Aim
Simulation of Output feedback control in Matlab

Theory
Chapter 8 and chapter 9 of Feedback Control Systems by Stefani

Equipment
PC with MATLAB installed

Task Marks
1) Output feedback Control 10

1
DEE, CEME, NUST EE-371 Linear Control Systems

Explanation
Practically it is not possible to implement state feedback controller because we can't measure all the
states x. As using “n” sensor for measuring “n” states is too costly we can build an observer to estimate
them, while measuring only the output y = C x.

Consider the observer


.^ ^
 ^

x  A x  Bu  H  y  y 
 

Where H is the observer gain. How to make it sure that the states are estimated correctly??
~ ^
x  xx
. .
~ . ^
x  x x
.
~ . ^
x  [ Ax  Bu ]  [ A x  Bu  H ( y  y )]
.
~ ~ ~
x  A x  HC x
.
~ ~
x  ( A  HC ) x

The observer is basically a copy of the plant; it has the same input and almost the same differential
equation. An extra term compares the actual measured output y to the estimated output y_hat; this will
cause the estimated states \hat{x} to approach the values of the actual states x. The stability of the
observer can be determined by calculating the Eigen values of (A-HC).Now we will use estimate of states
instead of actual states for implementing control law.

Figure 1: Output feedback Control

Task
Design Output feedback control for following system (tracking control is recommended)

 0 1 1 1  0
A   2 3 0  , B  1  C  1 
   
 5 1 1  0 1 

Optional: Introduce integral control and show that integral control rejects effect of perturbation.

You might also like