Professional Documents
Culture Documents
LAB # 1:
INTRODUCTION TO MATLAB
Section: ….……………………………………………….………………………..
PROCEDURE:
3. Executing "help" gives a list of HELP topics, including the M-files in the
various libraries on disk. Typing "help topic" gives help on the
specified topic. If the topic is not in the help file, the help facility looks
on the disk for an M-file with the filename topic.m .
LAB TASKS:
1. Use the "help" command to get familiar with each of the following MATLAB
commands:
e) A transfer function command ‘tf’ can be used to get transfer function expressed as
numerator polynomial divided by denominator polynomial.
2
𝐹𝐹(𝑠𝑠) =
(𝑠𝑠 + 8)(𝑠𝑠 + 4)
f) The command ′𝑭𝑭 = 𝒛𝒛𝒛𝒛𝒛𝒛([ ], 𝒃𝒃, 𝒂𝒂)′ is used to get transfer function expressed as
numerator polynomial divided by denominator polynomial in factored form.
g) The command ‘𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕𝒕’is used to get a transfer function if the numerator and denominator
are expressed in factored form.
h) The command polyval is use to calculate the value of polynomial of degree n evaluated
at particular variable used in polynomial.
m) The command step is used to get the step response of the system.
n) The command bode is used to get the frequency response of the system.
o) The command pzmap is used to plot the pole zero map of the system.
t) The command imag is used to get the imaginary part of the system
a) P=
3 P1 + P 2
b) P=
4 P1 − P 2
c) P5 = P1.P 2
C (s)
4) Find the overall transfer function = G1 ( s ).G2 ( s ) symbolically in both factored and
R( s)
polynomial forms by using Matlab. Also find its magnitude and phase in degree with s= 2 + j 4 .
G1 ( s ) G2 ( s )
2( s + 2)
R( s) ( s + 2)( s + 8) C (s)
s + 5s 2 + 10 s + 20
3
MATLAB code
Outputs
C (s)
5) Find the overall transfer function = G1 ( s ) + G2 ( s ) symbolically in both factored and
R( s)
polynomial forms by using Matlab. Also find its magnitude and phase in degree with s= 2 + j 4 .
𝑮𝑮𝟐𝟐 (𝒔𝒔)
MATLAB code
Outputs
Partial-Fraction Expansion:
b( s )
The partial-fraction for a transfer function F ( s ) = can be found using the
a( s)
[ r, p, k ] = residue ( b, a ) command. In this command ‘r’ is residue, ‘p’ is the roots of the
denominator and ‘k’ is direct quotient.
1) Find the Laplace Inverse of the following function by using partial fraction.
s3 + 2s 2 + 6s + 7
F ( s) =
s2 + s + 5
2) Find the Laplace Inverse of the above transfer function by using 𝒇𝒇 = 𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊𝒊(𝑭𝑭(𝒔𝒔))
b) Find Laplace Inverse by using ‘ilaplace’ command then compare both the results.
c) Plot the pole zero plot and output plot in time domain.
The University of Lahore, Lahore.
LAB # 2:
INTRODUCTION TO MATLAB BASIC TOOL
(SIMULINK)
Name of student: …………………………………………………………………..
Section: ….……………………………………………….………………………..
OBJECTIVES:
INTRODUCTION:
SIMULINK has two phases of use: model definition and model analysis. A typical session starts
by either defining a model or recalling a previously defined model, and then proceeds to analysis
of that model.
To facilitate model definition, SIMULINK adds a new class of windows called Block diagram
windows. In these windows, models are created and edited principally by mouse driven
commands. Part of mastering SIMULINK is to become familiar with the manipulation
After you define a model, you can analyze it either by choosing options from the SIMULINK
menus or by entering commands in MATLAB's command window.
Final results can be made available in MATLAB workspace when simulation is complete.
TUTORIAL:
To master SIMULINK, you must learn how to manipulate blocks and how to build models. You
must also become familiar with the types of blocks available.
Finally, you must learn how to use the analysis tools provided in SIMULINK. The construction
and simulation of a simple model, described in the following section, introduces you to each of
these concepts.
The standard block library is organized into several subsystems, grouping blocks according to
their behavior. Blocks can be copied from these or any other libraries or models into your model.
Example 1:
Generate the sinusoid 4sin(2t) and display it on the scope.
1. Double click on the on the MATLAB icon to display the MATLAB command window.
2. Open the SIMULINK block library by entering the command SIMULINK or by double
clicking on the SIMULINK icon .This command displays a new window containing icons
for the subsystem blocks that make up the standard library.
3. Open the sources subsystem by double clicking on the sources block, this displays
another window containing all blocks that produce output but have no input.
4. Select New from the File menu to open a new system window.
5. Drag the Signal Generator block from the Sources window to the new yet untitled,
window
6. Open the Signal Generator Block by double-clicking on its icon. This displays a dialog
box showing the controls for specifying the waveform, amplitude, and frequency of the
signal generated by the block.
7. Select the text box marked Frequency by positioning the cursor on it, set the frequency
to 1, and the Units to Hertz. Select the text box Amplitude and set the peak to 4. Click
on the OK button to close this window.
8. Open the Sinks library, and drag a copy of the Scope block to the new system window.
9. Open the Scope to see that its window is a graphic representation of an oscilloscope. Use
the pointer to select a suitable horizontal range. To set the Y-Axis Limits right-click on
an axes and choose Axes Properties.
10. The angle bracket (>) pointing out of the Signal Generator block's icon represents its
output port, and the angle bracket pointing into the Scope icon represents its input port.
To connect these two blocks, use the left mouse button to click on either the output or
input port of one block, drag to the other block's input or output port to draw a
connecting line, and then release the left mouse button. When the blocks are connected,
the angle brackets disappear, and a line with an arrowhead shows the direction of
the data flow.
11. Pull down the Simulation menu and choose Simulation Parameters.
12. A dialog box opens showing all the simulation parameters that can be modified.
Select the text box for the Maximum Step Size parameter, change the value to
0.01, and click on the OK button to close the simulation parameter dialog box.
13. Start the simulation by choosing Start from the Simulation menu. The Signal Generator
outputs the sinusoidal waveform for each time step and the Scope shows its input as the
trace of a sine wave.
14. The simulation stops when the stop-time in the Control Panel dialog box has been
reached, or by choosing Stop on the Simulation menu.
15. Choose Save from the File menu to display a dialog box in which you can specify the
filename and directory for this model.
Example 2:
Speed-Control System:
The speed control system is shown in basic form in fig.1. The system is composed of a dc motor
whose shaft speed is constant, a power amplifier that controls the motor voltage, a tachometer
coupled to the motor shaft and a circuit that detects the deviation or error between the reference
input and feedback signals. Fig. 2 is a block diagram representation of a system.
In analyzing the speed control of dc motor we will first find the transfer function of the system as
shown in Fig.3
In control systems, a DC motor is a common actuator. The electric circuit and free body diagram
of the DC motor is shown in Fig 4.
Fig 4 circuit diagram of dc motor
Jθ •• + bθ • =
Ki
di
L + Ri =V − Kθ •
dt
Taking the Laplace transform of the differential equation transfer function of the DC motor can
be obtained
s( Js + b)θ (s) =
KI (s)
V − Ksθ (s)
( Ls + R) I (s) =
Eliminating I(s) we get transfer function of dc motor which is described as:
𝜃𝜃 𝐾𝐾𝑡𝑡 𝐾𝐾𝑚𝑚
= =
𝑉𝑉𝑎𝑎 𝑠𝑠(𝐽𝐽𝑚𝑚 + 𝑏𝑏)(𝐿𝐿𝑎𝑎 + 𝑅𝑅𝑎𝑎 ) + 𝐾𝐾𝑡𝑡 𝐾𝐾𝑒𝑒 𝑠𝑠(𝜏𝜏𝜏𝜏 + 1)
Where
𝐾𝐾𝑡𝑡
𝐾𝐾 =
𝑏𝑏𝑅𝑅𝑎𝑎 + 𝐾𝐾𝑡𝑡 𝐾𝐾𝑒𝑒
𝑅𝑅𝑎𝑎 𝐽𝐽𝑚𝑚
𝜏𝜏 =
𝑏𝑏𝑅𝑅𝑎𝑎 + 𝐾𝐾𝑡𝑡 𝐾𝐾𝑒𝑒
Thus the Transfer function between motor input and the output speed (𝑤𝑤𝑚𝑚 =𝜃𝜃̇)
becomes
𝑤𝑤𝑚𝑚 𝐾𝐾𝑚𝑚
=
𝑉𝑉𝑎𝑎 (𝜏𝜏𝜏𝜏 + 1)
For the purpose of simulation the following numerical values can be used:
Procedure:
Notes on Simulation
A simulation can be started from either the command line or the Simulation menu. All of the
methods use the same arguments and menu parameters:
1. A simulation can be run by selecting Start from the Simulation menu. Set the simulation
parameters in the Control Panel dialog box by selecting Simulation Parameters from the
Simulation menu.
2. The Control Panel dialog box has fields in which you can enter numbers or any legal
MATLAB expression, for example, the variables "Start time", Stop time", "Min step
size", and " Max step size", which can be defined in the MATLAB workspace.
3. The return variables [t, x, y] are used to put the time, state, and output trajectories into the
MATLAB workspace. The start and stop times for the simulation are set in the
variables tstart, and tfinal. The integration parameters minstep,maxstep, and final
control the relative local error, minimum step size, and maximum step size of the
simulation.
Simulation Steps:
3. Open the SIMULINK block library by entering the commandsimulink
4. Open the Continuous subsystem by double-clicking on the Continuous block.
5. Select New from the File menu to open a new system window.
6. Build the block diagram of the system by dragging appropriate boxes.
7. Open the Sources subsystem by double-clicking on the Sources block. Drag the step
function block.
8. Start the simulation.
9. Output Trajectories from SIMULINK can be plotted using Scope blocks, or Return
variables and the MATLAB commands. For example:
Where the block labeled y is an output port taken from the Sinks list of blocks. Naming the
system tfout , [t, x, y] = sim('tfout' , 2) produces time histories, which can be plotted with plot(t,
y)
Report:
2. Attach plots of all time responses for all cases considered. Comment on all your results.
Disturbance Rejection in Cruise control system
1) The term Open loop-loop refers to the fact that there is no closed path or loop around
which the signals go in the block diagram. The open-loop output is given as
Y=10(u-0.5w)
𝑟𝑟
Y=10(10 – 0.5w) = r-5w;
2) The term Closed loop-loop refers to feedback system. Thus, the feedback has reduced the
sensitivity of the error to the grade by a factor 101 when compared with the open-loop
system. However, that there is now a small error on level ground, because even when
w=0,
Output=y=100r-100y-5w
Then;
100
Output=y= (101 )*r=0.99r
This error will be small as long as the loop gain (product of the plant and controller gains) is
large.
101
In case the error id too large, it is common practice to reset the reference, in this case to (100 ) r,
so the output reaches the true desired value.
The University of Lahore, Lahore.
LAB # 3:
MODELING IN SIMULINK
Section: ….……………………………………………….………………………..
x (displacement)
𝑥𝑥̈ (Acceleration)
Write the equations of motion for the speed and forward motion of the car i.e.
u- b𝑥𝑥̇ =m𝑥𝑥̈
𝑏𝑏 𝑢𝑢
𝑥𝑥̈ +𝑚𝑚 𝑥𝑥̇ =𝑚𝑚
So, the transfer function will be,
1
𝑉𝑉(𝑠𝑠) 𝑚𝑚
= 𝑏𝑏
𝑈𝑈(𝑠𝑠) 𝑠𝑠+
𝑚𝑚
Implement this transfer function using SIMULINK and analyze its output. Use the values of m =
1580 kg, and b = 26 N.sec/m
Its output will be quite similar to a car whose driver accelerates it for instance and then leaves the
car to decelerate at its own speed.
Also make use of the differential equation to make a second model of the same system using
SIMULINK. Compare the output of both the systems now. It should be same.
Satellites usually require attitude control so that antennas, sensors and solar panels are properly
oriented. Antennas are usually appointed toward a particular location on earth, while solar panels
need to be oriented toward the sun for maximum power generation.
The angle Ө that describes the satellite orientation must be measured with respect to an inertial
reference. The equation of motion becomes;
𝐹𝐹𝑐𝑐 d+𝑀𝑀𝐷𝐷 =I𝜃𝜃̈
The output of this system Ө, results from integrating the sum of the input torques twice; hence
this type of system is often referred to as the double-integrator plant. The transfer function can
be obtained as;
(↔)(𝑠𝑠) 1 1
=
𝑈𝑈(𝑠𝑠) 𝐼𝐼 𝑠𝑠 2
1
Where u=𝐹𝐹𝑐𝑐 d+𝑀𝑀𝐷𝐷 .In this form, the system is often referred to as the 𝑠𝑠 2 plant.
𝜃𝜃 Suspension point
Length(L)
Mass m
mgsin 𝜃𝜃
mg
Use MATLAB to determine the time history of Ө to a step input in 𝑇𝑇𝑐𝑐 of 1 N.m. Assume l=1m,
m=0.5 kg, and g=9.81 m/𝑠𝑠𝑠𝑠𝑠𝑠 2 .
The moment of inertia about the pivot point is I=m𝑙𝑙 2 . The sum of moments about the pivot point
contains a term from gravity as well as the applied torque 𝑇𝑇𝑐𝑐 . The equation of motion,
𝑇𝑇𝑐𝑐 -mglsin 𝜃𝜃=I𝜃𝜃̈
This is usually written in form of
𝑔𝑔 𝑇𝑇𝑐𝑐
𝜃𝜃̈ + sin 𝜃𝜃=
𝑙𝑙 𝑚𝑚 𝑙𝑙 2
Due to linearization the motion is small enough that sin 𝜃𝜃 ≅ 𝜃𝜃.
𝑔𝑔 𝑇𝑇𝑐𝑐
𝜃𝜃̈+ 𝜃𝜃=
𝑙𝑙 𝑚𝑚 𝑙𝑙 2
So the transfer function becomes
1
(↔)(𝑠𝑠) 𝑚𝑚 𝑙𝑙 2
= 𝑔𝑔
𝑇𝑇𝑐𝑐 (𝑠𝑠) 𝑠𝑠 2 + 𝑙𝑙
Once a control system is synthesized and shown to have desirable performance based on linear
analysis, it is then prudent to carry out further analysis are an accurate numerical simulation of a
system with all the nonlinearity in order to validate that performance.
VL ( s )
1) Find the transfer function G ( s ) = of the following system using Mat-lab.
V (s)
MATLAB code:
X 2 (s)
2) Find the transfer function G ( s ) = of the following system using Mat-lab.
F (s)
MATLAB code:
θ 2 (s)
3) Find the transfer function G ( s ) = of the following system using Mat-lab.
T (s)
MATLAB code:
1) Use MATLAB to find the response of the velocity of car as discussed in example 2.1.
2) Use MATLAB to determine the time history of motion for simple pendulum as discussed
in example 2.5.
The University of Lahore, Lahore.
LAB # 4:
Response of Dynamic System
Name of student: …………………………………………………………………..
Roll No: …..……………………………………………………………………….
Date of LAB: ………………………………………………………………………
Report submitted on: ….……………………………………………….…………..
Section: ….……………………………………………….………………………..
Part B:
1. Using Simulink, set up the systems of Part A 1 and plot the step response of each
of the four transfer functions on a single graph by using the Simulink LTI Viewer.
Also, record the values of settling time and rise time for each step response.
2. Using Simulink, set up the systems of Part A 2. Using the Simulink LTI Viewer,
plot the step response of each of the three transfer functions on a single graph.
Also, record the values of percent overshoot, settling time, peak time, and rise
time for each step response.
3. Using Simulink, set up the systems of Part A2a and Part A3 using the Simulink
LTI Viewer, plot the step response of each of the three transfer functions on a
single graph. Also, record the values of percent overshoot ,settling time, peak
time, and rise time for each step response.
4. Using Simulink, set up the systems of Part A2a and Part A4 using the
Simulink LTI Viewer, plot the step response of each of the three transfer
functions on a single graph. Also, record the values of percent overshoot, settling
time, peak time, and rise time for each step response
Part C:
1. For the first-order systems, make a table of calculated and experimental values of
settling time, rise time, and pole location.
2. For the second-order systems of Part A2, make a table of calculated and
experimental values of percent overshoot, settling time, peak time, rise time, and
pole location.
3. For the second-order systems of Part A 2a and Part A 3, make a table of calculated
and experimental values of percent overshoot, settling time, peak time, rise time,
and pole location.
4. For the second-order systems of Part A 2a and Part A 4, make a table of
calculated and experimental values of percent overshoot, settling time, peak time,
rise time, and pole location.
5. Discuss the effects of pole location upon the time response for both first- and
second-order systems. Discuss any discrepancies between your calculated and
experimental values.
Systems response with additional pole and zero
1. Evaluate the step response for percentage over shoot, rise, settling and peak time in
the following transfer function by adding a third pole at s = -100, -50 and -1
respectively if second order approximation is valid.
150
𝐺𝐺(𝑠𝑠) =
𝑠𝑠 2 + 20𝑠𝑠 + 150
Third pole Tp
Second Order Approximation %O.S Ts Tr
s=
-100
-50
-1
2. Evaluate the step response for percentage over shoot, rise, settling and peak time in
the following transfer function by adding a zero at s = -100, -50 and -1 respectively if
second order approximation is valid.
150
𝐺𝐺(𝑠𝑠) =
𝑠𝑠 2 + 20𝑠𝑠 + 150
-100
-50
-1
3. Evaluate the step response for percentage over shoot, rise, settling and peak time in
the following transfer function by adding a pole at s = -3.5, -4.5,-3.9 and -4.01
respectively if second order approximation is valid.
150(𝑠𝑠 + 4)
𝐺𝐺(𝑠𝑠) =
𝑠𝑠 2 + 20𝑠𝑠 + 150
Pole s = Second Order Approximation %O.S Ts Tr Tp
-3.5
-4.5
-3.9
-4.01
The University of Lahore, Lahore.
LAB # 5:
Block Diagram Reduction & Time Specifications for
Closed loop Control Systems
Name of student: …………………………………………………………………..
Roll No: …..………………………………………………………………………..
Date of LAB: ………………………………………………………………………
Report submitted on: ….……………………………………………….…………..
Section: ….……………………………………………….………………………..
The following three methods are available for block diagram reduction.
• Solution via series, parallel and feedback commands.
Series ( G1, G2 ) for cascade connection
Parallel ( G1, G2 ) for parallel connection
Feedback ( G, H sign) for feedback connection
• Solution Via Algebraic Operation
Ge ( s ) = G1 ( s ) * G2 ( s ) for cascade connection
G=e (s) G1 ( s ) + G2 ( s ) for parallel connection
G (s)
Ge ( s ) = for feedback connection
1 ± G (s) * H (s)
• Solution Via Append and Connect Commands
This topology may be used effectively for complicated system.
G1 ( s) G2 ( s)
2( s + 2)
R( s) ( s + 2)( s + 8) C (s)
s + 5s 2 + 10s + 20
3
G1 ( s )
( s + 10)( s + 100)
s 4 + s 3 + s 2 + 100
R( s) C (s)
G1 ( s )
2
s 3 + 1000 s + 2000
3) Find the equivalent transfer function using feedback command.
G1 ( s )
( s + 1)
R( s) C (s)
s ( s + 2)
G1 ( s )
( s + 3)
( s + 4)
Part A
𝟏𝟏
1. Find the equivalent transfer function of three cascaded block 𝐆𝐆𝐆𝐆(𝐬𝐬) = 𝐬𝐬+𝟏𝟏,
𝟏𝟏 𝐬𝐬+𝟑𝟑
𝐆𝐆𝐆𝐆(𝐬𝐬) = 𝐒𝐒+𝟒𝟒 , and 𝐆𝐆𝐆𝐆(𝐬𝐬) = 𝐬𝐬+𝟓𝟓.
2. Find the equivalent transfer function of three parallel blocks of G1, G2, and G3.
5. For the system of Part A3, push H(s) to the right past the pickoff point and draw the
equivalent system.
Part B
1. Using Simulink set up the cascade system of PartA1 and the equivalent single block.
Make separate plots of the step response of the cascaded system and its equivalent single
block. Record the values of settling time and rise time for each step response.
2. Using Simulink, setup the parallel system of Part A2andtheequivalentsingleblock. Make
separate plots of the step response of the parallel system and its equivalent single block.
Record the values of settling time and rise time for each step response.
3. Using Simulink set up the negative feedback system of PartA3 and the equivalent single
block. Make separate plots of the step response of the negative feedback system and its
equivalent single block. Record the values of settling time and rise time for each step
response.
4. Using Simulink, setup the negative feedback systems of Part A3, 4, and5.Make separate
plots of the step response of each of the systems. Record the values of settling time and
rise time for each step response.
PartC
1. Using your Part B data, verify the equivalent transfer function of blocks in cascade.
2. Using your Part B data, verify the equivalent transfer function of blocks in parallel.
3. Using your Part B data, verify the equivalent transfer function of negative feedback
systems.
4. Using your Part B data, verify the moving of blocks past summing junctions and pickoff
points.
5. Discuss your results. Were the equivalencies verified?
Part D
1. Given the block diagram from replaceG1, G2, G3, H1, H2, H3with the following transfer
functions and obtain an equivalent transfer function and draw figure in Simulink compare
the results.
2. Use Simulink to implement the block diagram from above figure using the transfer
functions given in the Part D1.
3. Verify your calculations from the Part D 1 with that of the equivalent transfer function
obtained with Simulink
The University of Lahore, Lahore.
LAB # 6:
Stability of a System
Name of student: …………………………………………………………………..
Roll No: …..………………………………………………………………………..
Date of LAB: ………………………………………………………………………
Report submitted on: ….……………………………………………….…………..
Section: ….……………………………………………….………………………..
G (s)
1
R( s) s (2 s + 3s + 2 s 2 + 3s + 2)
4 3
C (s)
Poles-Zeros plot
2. Determine the value of ‘K’ that yield the close-loop response unstable, stable with
Overdamped, Underdamped and Undamped. Also plot the step response for each
value of ‘K’.
K
R( s) s ( s + 7)( s + 11) C (s)
System K
Unstable
Over damped
Under damped
Un damped
Step Responses
Lab Assignment no.4
3) Use MATLAB to plot transient response of the systems given in example no. 3.29 and
3.30 for a range of system’s gain if the systems remain stable.
The University of Lahore, Lahore.
LAB # 7:
STEADY STATE ERROR
+
+ Controller Plant
R ∑ D ∑ G Y
+
-
+
+
∑ V
Figure No.1
Table No.1
500( s + 2)( s + 5)
G (s) =
( s + 8)( s + 10)( s + 12)
H(s)=1, Controller=1
System Type =
Step Kp = 1
e=
(∞ ) =
1+ K p
Ramp Kv = 1
e(∞=
) =
Kv
Parabolic Ka = 1
e(∞=
) =
Ka
Compare the above steady state errors by implementing Figure no.1 in SIMULINK and m
file for loop gain and input of table no.1.
Table No.2
500( s + 2)( s + 5)( s + 6)
G (s) =
s ( s + 8)( s + 10)( s + 12)
H(s)=1, Controller=1
System Type =
Step Kp = 1
e=
(∞ ) =
1+ K p
Ramp Kv = 1
e(∞=
) =
Kv
Parabolic Ka = 1
e(∞=
) =
Ka
Compare the above steady state errors by implementing Figure no.1 in SIMULINK and m
file for loop gain and input of table no.2.
Table No.3
System Type =
Step Kp = 1
e=
(∞ ) =
1+ K p
Ramp Kv = 1
e(∞=
) =
Kv
Parabolic Ka = 1
e(∞=
) =
Ka
Compare the above steady state errors by implementing Figure no.1 in SIMULINK and m file
for loop gain and input of table no.3
2) Find the value of K in the following control system by using MATLAB if steady
error is 10%.
K ( s + 5)
R( s) G (s) = C (s)
s ( s + 6)( s + 7)( s + 8)
MATLAB code:
Electric-Motor Position Control Problem:
+
1
+ 𝑘𝑘𝑝𝑝
R ∑ ∑ 𝑠𝑠(𝜏𝜏𝜏𝜏 + 1) Y
- +
+
1+𝑘𝑘𝑡𝑡 𝑠𝑠 +
∑ V
Figure No.2
3) Consider an electric motor position control problem, including a non unity feedback
system caused by having tachometer fixed to the motor shaft and its voltage is fed
back as part of the control. Equivalent feedback block diagram is shown in the
above figure
Let 𝒌𝒌𝒑𝒑 = 𝟖𝟖 𝑽𝑽/𝑽𝑽 ,τ= 2 sec and 𝒌𝒌𝒕𝒕 = 𝟎𝟎. 𝟖𝟖
Determine the system types, static error constants and steady state errors with
respect to reference input
Table No.4
1
G(s)= H(s)= 1+𝑘𝑘𝑡𝑡 𝑠𝑠D=𝑘𝑘𝑝𝑝
𝑠𝑠(𝜏𝜏𝜏𝜏+1)
System Type =
Step Kp = 1
e=
(∞ ) =
1+ K p
Ramp Kv = 1
e(∞=
) =
Kv
Parabolic K a = e(∞=)
1
=
Ka
Compare the above steady state errors by implementing Figure No.2 in SIMULINK and m file
for loop gain and input of table no.4
The University of Lahore, Lahore.
LAB # 8:
STATE SPACE REPRESENTATION
𝑥𝑥1̇ 0 1 0 𝑥𝑥1 0
𝑥𝑥̇
� 2� = � 0 0 𝑥𝑥
1 � � 2 � + � 25 �u
𝑥𝑥̇ 3 −5 −25 −5 𝑥𝑥3 −120
𝑥𝑥1
y=[1 0 0]�𝑥𝑥2 �
𝑥𝑥3
.
Example: Consider a spring-mass system in the figure below:
x (displacement)
𝑥𝑥̈ (Acceleration)
Write the equations of motion for the speed and forward motion of the car i.e.
u- b𝑥𝑥̇ =m𝑥𝑥̈
Rewrite the equation of motion in state variable form, where the output is the car position
x. Obtain its controller and observer canonical forms. Find the observability and
controllability matrices and state whether the above system is observable/controllable or
both?
The University of Lahore, Lahore.
LAB # 9:
Designing Controller and Observer in MATLAB
Name of student: …………………………………………………………………..
Roll No: …..………………………………………………………………………..
Date of LAB: ………………………………………………………………………
Report submitted on: ….……………………………………………….…………..
Section: ….……………………………………………….………………………..
LAB # 10:
Root Locus
Name of student: …………………………………………………………………..
Roll No: …..………………………………………………………………………..
Date of LAB: ………………………………………………………………………
Report submitted on: ….……………………………………………….…………..
Section: ….……………………………………………….………………………..
1
R( s) G (s) = C (s)
s 2 + 10s + 1
Figure No.1
Table No.1
( s + 3)( s + 4)
R( s) G ( s) = C (s)
( s + 1)( s + 2)
Figure No.2
3. Plot the root locus of the following system. Find break away point, the exact point
and gain where root locus crosses the 0.45 damping line and jω axis crossing. Also
find the range within which the system is stable.
K ( s 2 − 4 s + 20)
R( s) G (s) = C (s)
( s + 4)( s + 2)
Figure No.3
Range of K for system stability Z line crossing jω Crossing Breakaway point
4. Design the K in the following system to yield 1.52% over shoot. Also estimate the
settling time, peak time and steady state error if second order approximation is
valid.
K ( s + 1.5)
R( s) G (s) = C (s)
s ( s + 1)( s + 10)
Figure No.4
Close Loop Third
Case Close Loop Poles 𝑻𝑻𝒔𝒔 𝑻𝑻𝒑𝒑 𝑲𝑲𝒗𝒗
Gain C.L.P
The University of Lahore, Lahore.
LAB # 11:
Lead-Lag Compensation
Name of student: …………………………………………………………………..
Roll No: …..………………………………………………………………………..
Date of LAB: ………………………………………………………………………
Report submitted on: ….……………………………………………….…………..
Section: ….……………………………………………….………………………..
b) Assume that the sensor transfer function is modeled by a single pole with a 0.1 sec time
constant and unity DC gain. Using the root-locus procedure, find a value for the gain K
that will provide the maximum damping ratio
Fc + F
1
∑ x
- 𝑠𝑠 2
𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆
H(s)