This action might not be possible to undo. Are you sure you want to continue?
ME 413: System Dynamics and Control 1/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413 System Dynamics & Control
ME 413: System Dynamics and Control 2/220 Laboratory Manual
Preface to the First Edition
All Praises and Glory to Almighty Allah without his help no work can be accomplished.
Acknowledgement is due to King Fahd University of Petroleum and Minerals for its
unlimited moral and financial support to accomplish this task.
I gratefully acknowledge the support and encouragement provided by Dr. Abdulghani
AlFarayedhi, Chairman of the Mechanical Engineering Department in writing this
manual for supporting my request for one month summer supporting 19992000.
Abdelaziz BAZOUNE
Lecturer
Mechanical Engineering Department
July 2000
ME 413: System Dynamics and Control 3/220 Laboratory Manual
Preface to the Second Edition
Objective
Developing the ME 413 laboratory content to meet the following requirements:
1. Optimize the utilization of existing equipments and facilities to enhance
student learning of lecture materials.
2. Synchronize laboratory assignments with lecture topics.
Toward the first objective, the following tasks were undertaken:
► The status of the existing equipment was assessed. Since most of the
equipment were left idle for a prolonged period of time, the power circuits
were the most frequent failure (Signal Analyzer, Vibration meters,
Stroboscope, Chart Recorder, The Ball and Beam Apparatus, etc.).
► Initialize the maintenance of the equipment. This also entailed ordering
several missing parts from the agents. Some broken or badly corroded shafts
were also ordered from the M. E. workshop.
► Assembly and setup of the five apparatus (Simple Harmonic Oscillator,
Torsional Oscillator, Temperature Controller, Coupled Tanks, Servo
Controller).
► Calibration and operation of the experimental setups. In some of the setups,
e.g., CE105, CE110, selected experiments were chosen and performed.
Toward the second objective, changes are proposed for the lecture sequence and
laboratory content. Table 1 shows the proposed course plan along with the
laboratory assignment. The Laboratory assignment is composed of several
laboratory sessions. The main content of Session is shown in Table 2. The details of
the sessions are given in the next part.
Dr. Faleh AlSuleiman
Mechanical Engineering Department
July 2002
ME 413: System Dynamics and Control 4/220 Laboratory Manual
ACKNOWLEDGMENT
The efforts of Angry. Ahmed A. Abdulnabi in setting up the experiments and
following up the order of parts is greatly appreciated.
Many Sections of the previous work of Mr. Abdelaziz Bazoune for the Lab Manual of
ME 413 has been utilized in this manual.
ME 413: System Dynamics and Control 5/220 Laboratory Manual
TABLE OF CONTENTS
[1] Introduction to MATLAB
[2] Laplace transform
[3] Mechanical Systems (I): Translational mechanical Systems
a) Simulation: Simple Harmonic Oscillator
b) Experiment: Simple Harmonic Oscillator
[4] Mechanical Systems (II): Rotational mechanical Systems
a) Simulation: Torsional Oscillations
b) Experiment: Torsional Oscillations
[5] Mechanical Systems (III):
a) Modeling and Analysis of a Pickup Truck
b) Experiment: Centrifugal Governors
[6] Response of Systems in time Domain
a) Block diagram Reduction Using MATLAB
b) Experiment: i) Damped free Vibration
ii) Forced Vibrations
[7] Electrical and Electromechanical Systems
a) Simulation of Electrical Systems
b) Simulation of Electromechanical Systems
[8] Liquid Level Systems
a) Simulation : Two Coupled Tanks
b) Experiment: Coupled Tanks
i) Basic Tests and Transducer Calibration
ii) Open and Closed Loop System
[9] Air Temperature Control
a) Simulation: Air Temperature Control
b) Experiment: Air temperature Control
[10] Transient Response Characteristics
a) Simulation: Transient Response Specifications of a Second Order Systems.
b) Experiment: Vibration Absorbers
[11] Steady State Response characteristics
a) Simulation: Steady State Error and System Type.
ME 413: System Dynamics and Control 6/220 Laboratory Manual
b) Experiment: Servo Trainer
i) Response calculating and Measurements
ii) Proportional Control of Servo Trainer Speed
[12] Design In Control System
a) Simulation: Root Locus.
b) Experiment: The Ball and Beam Apparatus
i) Basic Tests and Familiarization
[13] Design In Control System
a) Simulation: PID Controllers.
b) Experiment: The Ball and Beam Apparatus
i. Proportional Control and Manual Control of Ball Position.
[14] Frequency Domain Analysis of Dynamic Systems
a) Simulation: Bode Plot.
ME 413: System Dynamics and Control 7/220 Laboratory Manual
References
[1] D. M. Etter, “Engineering Problem Solving with MATLAB
®
”, Second Edition, 1997.
Prentice Hall Inc.
[2] Katsuhiko Ogata, ''Solving Engineering Problems with MATLAB
®
'', 1994. Prentice Hall
Inc.
[3] D. K. Frederick and J. H. Chow, ''Feedback Control Problem: Using MATLAB
®
and The
Control System Toolbox'', 1995. PWS.
[4] W. J. Palm III, “Modeling, Analysis, and Control of Dynamic Systems”, 2nd Edition 1999.
John Wiley & Sons.
[5] J. L Shearer, B. T. Kulakowski and J. F. Gardner “Dynamic Modeling and Control of
Engineering Systems”, 2nd Edition, 1997. Prentice Hall Inc.
[6] C. H. Van Loan,“ Introduction to Scientific Computing”, 1997Prentice Hall Inc.
[7] Katsuhiko Ogata, “System Dynamics, 2nd Edition, 1992. Prentice Hall Inc.
[8] G. F Franklin, J. D. Kulakowski and A. EmamiNaeini “Feedback Control of Dynamic
Systems”, 3rd Edition, 1994. Addison Wesley.
[9] R. C Dorf and R. H. Bishop “Modern Control Systems”, 7th Edition, 1995. Addison
Wesley.
[10] R. H. Bishop “Modern Control Systems Analysis and Design Using MATLAB
®
”,
1995. Addison Wesley.
[11] C. L Philippe, and R. D. Harbor, “Feedback Control Systems”, 3rd Edition, 1996.
Prentice Hall Inc.
[12] E. PärtEnander, A. Sjöberg, B. Melin and P. Isaksson, “The MATLAB
®
Handbook”,
1996. Addison Wesley.
[13] D. Rowell, and D. N. Wormley, “System Dynamic”, International Edition, 1997.
Prentice Hall Inc.
[14] D. Hanselman, and B. Littlefield, “Mastering MATLAB
®
: A Comprehensive Tutorial
and Reference”, 1996. Prentice Hall Inc.
[15] H. Saadat, “Computational Aids in Control Systems Using MATLAB
®
”, 1993.
McGrawHill.
[16] N. E. Leonard and W. S. Levine, “Using MATLAB
®
to Analyze and Design Control
Systems”, 2nd Edition, 1995. Benjamin/Cummings Publishing Company, Inc.
ME 413: System Dynamics and Control 8/220 Laboratory Manual
[17] V. Stonick and K. Bradley, “Labs for Signals and Systems Using MATLAB
®
”, 1996.
PWS.
[18] N. S. Nise, “Control Systems Engineering”, 2nd Edition, 1995. Benjamin/Cummings
Publishing Company, Inc.
[19] S. S. Rao, “Mechanical Vibrations, Third Edition, 1995. Addison Wesley.
[20] S. G. Kelly, “Fundamentals of Mechanical Vibrations, 1993. McGrawHill.
[21] CE105 and CE105MV Coupled Tanks Manual, TQ education and Training Ltd.
[22] CE106 Ball and Beam Apparatus Manual, TQ education and Training Ltd.
[23] CE110 Servo Trainer Manual, TQ education and Training Ltd.
ME 413: System Dynamics and Control 9/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
INTRODUCTION TO MATLAB
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 10/220 Laboratory Manual
INTRODUCTION TO MATLAB
®
MATLAB (an abbreviation for MATrix LABoratory) is a matrixbased system for
mathematical and engineering calculations.
MATLAB has an online help facility that may be invoked whenever need arises. The
command help will display a list of predefined functions and operator for which online
help is available. The command
» help 'function name'
will give information on the specific function named as to its purpose and use.
the. command
» help help
will give information as to how to use the online help.
Commands and Matrix Functions Used in MATLAB
We shall first list various types of MATLAB commands and matrix functions that are
frequently used in solving control engineering problems.
Matrix Operators
The following notations are used in the matrix operations:
+ Addition
– Subtraction
* Multiplication
/ Division
\ Leftdivision
^ Power
' Conjugate transpose
Relational and Logical Operators
The following relational and logical operators are used in MATLAB:
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal
== Equal
~= Not equal
Special Characters
ME 413: System Dynamics and Control 11/220 Laboratory Manual
The following special characters are used in MATLAB:
[ ] Used to form vectors and matrices
( ) Arithmetic expression precedence
' Separate subscripts and function arguments
; End rows, suppress printing
: Subscripting, vector generation
! Execute operating system command
% Comments
BASIC CALCULATIONS
Simple Math
MATLAB can be used as a calculator.
Example 1. Calculate the expression
2
3 ) 2 / 5 ( 7 3 + − +
» 3+sqrt(7)–(5/2)+3^2
ans =
12.1458
The variable ans is assigned to the previous result if no assignment is made.
Normally variables are used and assigned values or results.
Example 2. As an alternative, the above can be solved by storing information in
MATLAB variables
» erasers=4; pads=6;tapes=2;
» items=erasers+pads+tapes
items =
12
» cost=erasers*25.75+pads*22+tapes*99.5
» average_cost=cost/items
cost =
434
average_cost =
36.1667
Here we created three MATLAB variables erasers, pads and tapes to store the
number of each item. After entering each statement, MATLAB displayed the results
except in the case of tapes, pads and tapes.
Number Display Format
The semicolon tells MATLAB to evaluate
the line but not tell us the answer
ME 413: System Dynamics and Control 12/220 Laboratory Manual
When MATLAB displays numerical results, it follows several rules. By default, if a
result is an integer, MATLAB displays it as an integer. Likewise, when a result is a
real number, MATLAB displays it with approximately 4 digits to the right of the
decimal point. You can override this default behavior by specifying a different
format using the Numeric Format menu item in the Options menu if available or
by typing the appropriate MATLAB command at the prompt. Using the variable
average_cost from the above example, some of these numerical formats are
MATLAB Command average_cost Comments
format long 36.16666666666666 16 digits
format short e 3.6167e+001 5 digits plus exponent
format long e 3.616666666666666e+001 16 digits plus exponent
format bank 36.17 2 decimal digits
format rat 217/6 rational approximation
format short 36.1667 default display
About Variables
Like any other computer language, MATLAB has rules about variables and names.
Earlier it was noted that variable names must be a single word containing no
spaces. More specifically, MATLAB variables naming rules are
Variable Naming Rules Comments/Examples
Variable names are case sensitive Items, items, itEms and ITEMS are
all different MATLAB variables
Variable names can contain up to howaboutthisvariablename
19 characters; characters beyond
the 19th are ignored.
Variable names must start with a how_about_this_variable_name
letter followed by any number of X51483
letters, digits, or underscores. a_b_c_d
Punctuation characters are not
allowed since many have special
meaning to MATLAB.
Complex Numbers
All the MATLAB arithmetic operators are available for complex operations. The
imaginary unit 1 − is predefined by two variables i and j. In a program, if other
values are assigned to i and j, they must be redefined as imaginary units, or other
characters can be defined for the imaginary unit.
j = sqrt(–1) or i = sqrt(–1)
Once the complex unit has been defined, complex numbers can be generated.
Example. Evaluate the following function
ME 413: System Dynamics and Control 13/220 Laboratory Manual
Z g g Z V / ) ( sinh ) ( cosh + =
where 5 . 1 02 . 0 and 300 200 j g j Z + = + =
» i = sqrt(–1);
» Z = 200 + 300*i;
» g = 0.02+1.5*i;
» V = Z*cosh(g) + sinh(g)/Z
V =
8.1672 +25.2172i
Mathematical Functions
A partial list of the common functions that MATLAB supports is shown in the table
below. Most of these functions are used in the same way you would write them
mathematically.
» x=sqrt(2)/2
x =
0.7071
» y=asin(x)
y =
0.7854
» y_deg=y*180/pi
y_deg =
45.0000
These commands find the angle where the sine function has a value 2 / 2 .
Some of the functions, like sqrt and sin, are builtin. They are part of the MATLAB
core so they are very efficient, but the computational details are not readily
accessible. Other functions, like gamma and sinh, are implemented in Mfiles. You
can see the code and even modify it if you want. Several special functions provide
values of useful constants. (See TABLE 2 for the listing of some MATLAB
functions).
Infinity is generated by dividing a nonzero value by zero, or by evaluating well
defined mathematical expressions that overflow, i.e., exceed realmax. Nota
number is generated by trying to evaluate expressions like 0/0 or InfInf that do
not have well defined mathematical values.
MATRICES
A matrix is a set of numbers arranged in a rectangular grid of rows and columns.
When we use a matrix, we need a way to refer to individual elements or numbers in
These commands find the
angle where the sine
function has a value
2 / 2 .
Note that MATLAB only
works in radians.
ME 413: System Dynamics and Control 14/220 Laboratory Manual
the matrix. A simple method for specifying an element in the matrix uses the row
and the column number. The size of a matrix is specified by the number of rows
and columns. If a matrix has the same number of rows and columns, it is called a
square matrix.
Entering Matrices in MATLAB
In MATLAB a matrix is created with a rectangular array of numbers surrounded by
square brackets. The elements in each row are separated by blanks or commas.
The end of each row, except the last row, is indicated by a semicolon. Matrix
elements can be any MATLAB expression. The statement
» A = [6 1 2; –1 8 3; 2 4 9]
results in the output
A =
6 1 2
–1 8 3
2 4 9
If a semicolon is not used, each row must be entered in a separate line as shown
below
» A = [6 1 2
–1 8 3
2 4 9]
The entire row or column of a matrix can be addressed by means of the symbol (:).
For example:
» r3 = A(3,:)
results in
r3 =
2 4 9
Similarly, the statement A (:,2) addresses all elements of the second column in A.
For example
» c2 = A (:,2)
results in
c2 =
1
8
4
Determinant of a Matrix
ME 413: System Dynamics and Control 15/220 Laboratory Manual
A determinant is a scalar computed from the entries in a square matrix. Determinants
have various applications in engineering, including computing inverses and solving
system of simultaneous equations. For a 2 2× matrix A, the determinant is
12 21 22 11
a a a a A − =
For a 3 3× matrix A, the determinant is
32 31
22 21
13
33 31
23 21
12
33 32
23 22
11
a a
a a
a
a a
a a
a
a a
a a
a A + − =
The determinant of a matrix A can be carried out by MATLAB through the command
det(A)
» det(A)
ans =
335
Transpose of a Matrix
The transpose of a matrix is a new matrix in which the rows of the original matrix are
the columns of the new matrix. We use a superscript T after a matrix name to refer to
the transpose, B = A
T
. In MATLAB, the apostrophe (prime) ' denotes the transpose of a
matrix. If B is the transpose of A then
» B = A'
will produce the following matrix
B =
6 –1 2
1 8 4
2 3 9
Inverse of a Matrix
By definition, the inverse of a square matrix A is the matrix A
–1
for which the
matrix product AA
–1
and A
–1
A are both equal to the identity matrix. The inverse of
an illconditioned or singular matrix does not exist. The inverse of the matrix A is
performed with the function inv(A)
» C = inv(A)
will result in
C =
0.1791 – 0.0030 – 0.0388
0.0448 0.1493 – 0.0597
– 0.0597 – 0.0657 0.1463
ME 413: System Dynamics and Control 16/220 Laboratory Manual
Basic Operations in Matrices
Matrices of the same dimension can be added or subtracted. Two matrices A and B
can be multiplied together to form the product AB if they are conformable (the
number of columns of A is equal to the number of rows of B).
Two symbols are used for nonsingular matrix division. A\B is equivalent to A
–1
B, and
A/B is equivalent to B
–1
A. For example,
» A = [6 1 2; –1 8 3; 2 4 9];
» B = [3 5 0; 5 4 1; 0 –2 2];
To add two matrices A and B, simply type
» A+B
ans =
9 6 2
4 12 4
2 2 11
Similarly, to multiply two matrices A and B, simply type
» A*B
ans =
23 30 5
37 21 14
26 8 22
Dividing by matrices is also straightforward once you understood how MATLAB
interprets the divide symbols / and \. This can be illustrated into the following
topic .
Solving a System of Equations
Consider the following system of three equations with three unknowns
3 3 33 2 32 1 31
2 3 23 2 22 1 21
1 3 13 2 12 1 11
b x a x a x a
b x a x a x a
b x a x a x a
= + +
= + +
= + +
where
i
x are the unknowns and
ij
a and
i
b are known coefficients. The previous
system can be written in matrix form as
=
¦
)
¦
`
¹
¦
¹
¦
´
¦
3
2
1
3
2
1
33 32 31
23 22 21
13 12 11
b
b
b
x
x
x
a a a
a a a
a a a
this can be written in compact form as
 { }   B X A =
ME 413: System Dynamics and Control 17/220 Laboratory Manual
where
  { }  
=
¦
)
¦
`
¹
¦
¹
¦
´
¦
=
=
3
2
1
3
2
1
33 32 31
23 22 21
13 12 11
, ,
b
b
b
b
x
x
x
X
a a a
a a a
a a a
A
A system of equations is nonsingular if the matrix [A] containing the coefficients of
the equations is nonsingular. Solving the previous equation for the unknown { } X
yields
{ }     B A X
1 −
=
In MATLAB, a system of simultaneous equations can be solved using matrix
division. The solution to the matrix equation  { }   B X A = can be computed using
matrix left division, as in A\B. The solution to the matrix equation { }    B A X = can
be computed using matrix right division, as in B/A. (MATLAB uses a Gauss
elimination technique to perform both left and right matrix division).
To illustrate, we can consider the following system equations
1
5 2 3
10 2 3
3 2 1
3 2 1
3 2 1
− = − −
= + + −
= − +
x x x
x x x
x x x
where
  { }  
1
2
3
3 2 1 10
1 3 2 , , 5
1 1 1 1
x
A X x b
x
−
¦ ¹
¦ ¦
= − = =
´ `
¦ ¦
− − −
¹ )
This is shown in MATLAB as
» A=[3 2 1;1 3 2;1 1 1]; B=[10 5 1]';
» x=A\B
x =
2.0000
5.0000
6.0000
The vector x then contains the following values: 2, 5, 6. We can also define and
solve the same system of equations using the matrix equation { }    B A X = as shown
in these statements.
» A=[3 1 1; 2 3 1; 1 2 1]; B=[10 5 1];
» x=B/A
ME 413: System Dynamics and Control 18/220 Laboratory Manual
produces the same result. The vector x then contains the following values: 2, 5, 
6. If a set of equations is singular, an error message is displayed ; the solution
vector may contain values of NaN or ∞
Eigenvalues
If [A] is n n × matrix, the n numbers λ that satisfy
 { } { } x x A λ =
are the eigenvalues of [A]. They are found using eig(A), which returns the
eigenvalues in a column vector. Eigenvalues and associated eigenvectors can be
obtained with a double assignment statement [X, D] = eig (A). The diagonal elements
of D are the eigenvalues and the columns of X are the corresponding eigenvectors
such that AX = XD.
Example. Find the eigenvalues and the associated eigenvectors of the matrix [A]
given by
− −
− −
−
=
5 11 6
6 11 6
1 1 0
A
» A = [0 1 – 1; – 6 – 11 6; – 6 – 11 5];
» [X,D] = eig(A)
X =
– 0.7071 0.2182 – 0.0921
0.0000 0.4364 – 0.5523
– 0.7071 0.8729 – 0.8285
D =
–1.0000
–2.0000
–3.0000
The magic Function
MATLAB actually has a builtin function that creates magic squares of almost any
size. Not surprisingly, this function is named magic.
» B = magic(3)
B =
8 1 6
3 5 7
4 9 2
» B = magic(4)
B =
ME 413: System Dynamics and Control 19/220 Laboratory Manual
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
POLYNOMIALS
A polynomial is a function of a single variable that can be expressed in the
following general form,
n n n
n n n
a x a x a x a x a x a x P + + + + + + =
− −
− −
1
2
2
2
2
1
1
... ) (
ο
where the variable is x and the polynomials coefficients are represented by the
values of
2 1
, , a a a
ο
and so on. The degree of a polynomial is equal to the largest value used as an
exponent.
Polynomial Roots
Finding the roots of a polynomial, i.e., the values for which the polynomial is zero,
is a problem common to many disciplines. In MATLAB, a polynomial is
represented by a row vector of its coefficients in descending order.
Example. The polynomial 116 25 12
3 4
+ + − x x x is entered as
» p = [1 –12 0 25 116];
p =
1 –12 0 25 116
Note that terms with zero coefficients must be included. Given this form, the
roots of a polynomial are found by using the function roots.
» r = roots(p)
r =
11.7473
2.7028
–1.2251 + 1.4672i
–1.2251 – 1.4672i
Since both a polynomial and its roots are vectors in MATLAB, MATLAB adopts the
convention that polynomials are row vectors and roots are column vectors.
Given the roots of a polynomial, it is also possible to construct the associated
polynomial. In MATLAB, the command poly performs this task
» pp = poly(r)
pp =
1.0e+002 *
Columns 1 through 5
ME 413: System Dynamics and Control 20/220 Laboratory Manual
0.0100 – 0.1200 0.0000 0.2500 1.1600 + 0.0000i
» pp = real(pp) % throwaway spurious imaginary part
pp =
1.0000 12.0000 0.0000 25.0000 116.0000
Polynomial Multiplication
Polynomial multiplication is supported by the function conv (which performs the
convolution of two arrays).
Example. Consider the product of the two polynomials 4 3 2 ) (
2 3
+ + + = x x x x a and
16 9 2 ) (
2 3
+ + + = x x x x b
» a = [1 2 3 4]; b = [1 2 9 16];
» c = conv(a,b)
c =
1 4 16 44 67 84 64
This result is 64 84 67 44 16 4 ) (
2 3 4 5 6
+ + + + + + = x x x x x x x c . Multiplication of more
than two polynomials requires repeated use of conv.
Polynomial Addition
MATLAB does not provide a direct function for adding polynomials. Standard array
addition works if both polynomial vectors are the same size. Add the polynomial
a(x) and b(x) given above.
» d = a + b
d =
2 6 12 20
which is 20 12 6 2 ) (
2 3
+ + + = x x x x d . When two polynomials are of different orders,
the one having lower order must be padded with leading zeros to make it have the
same effective order as the higherorder polynomial. Consider the addition of
polynomial c and d above
» e = c + [0 0 0 d]
e =
1 6 20 52 81 96 84
which is 84 96 81 52 20 6 ) (
2 3 4 5 6
+ + + + + + = x x x x x x x e . Leading zeros are required
rather than trailing zeros because coefficients associated with like powers of x must
line up.
Polynomial Division
ME 413: System Dynamics and Control 21/220 Laboratory Manual
In MATLAB, the division of polynomials is accomplished with the function deconv.
Using the polynomials c and b from above
» [q,r] = deconv(c,b)
q =
1 2 3 4
r =
0 0 0 0 0 0 0
This result says that b divided into c gives the quotient polynomial q and the
remainder r, which is zero in this case since the product of b and q is exactly c.
Polynomial Derivatives
Because differentiation of a polynomial is simple to express, MATLAB offers the
function polyder for polynomial differentiation
Example. Use the function polyder to find the derivative of the polynomial e(x)
given above 84 96 81 52 20 6 ) (
2 3 4 5 6
+ + + + + + = x x x x x x x e
» e
e =
1 6 20 52 81 96 84
» h= polyder(e)
h =
6 30 80 156 162 96
which is 96 162 156 80 30 6 ) (
2 3 4 5
+ + + + + = x x x x x x h .
Polynomial Evaluation
In MATLAB, the evaluation of polynomials is accomplished with the function
polyval.
Example. Use the function polyval to evaluate the polynomial e(x) given above
84 96 81 52 20 6 ) (
2 3 4 5 6
+ + + + + + = x x x x x x x e , at the points x = –5 and x = 12
» v= polyval(e,–5)
v =
4504
» W= polyval(e,12)
v =
4996452
ME 413: System Dynamics and Control 22/220 Laboratory Manual
GRAPHICS
The most common plot used by engineers and scientists is the xy plot . The data
that we ploy is usually read from a data file or computed in our programs, and
stored in vectors which we call x and y. In general, we assume that the x values
represent the independent variable and that the y values represent the dependent
variable. The y values can be computed as a function of x, or the x and y values
might be measured in an experiment. We now present some additional ways of
displaying this information.
Plotting Data Points
Example 1. Create a linear xy plot for the following variables
t 0 1 2 3 4 5 6 7 8 9 10 11 12
y 0 0.5 1 2 4 7 11 14 15.5 16 16 16 16
For a small amount of data, you can type in data explicitly using square brackets.
» t = [0 1 2 3 4 5 6 7 8 9 10 11 12];
» y = [0 0.5 1 2 4 7 11 14 15.5 16 16 16 16];
» plot(t,y)
» title('Plot of t versus y')
» xlabel('Variable t')
» ylabel('Function y')
» grid
0 2 4 6 8 10 12
0
2
4
6
8
10
12
14
16
Plot of t versus y
Variable t
F
u
n
c
t
io
n
y
title
xlabel
grid
ylabel
Figure 1. Example of xy plot
Plotting Functions
Single Plot
Example 2. Plot the function y=sin(t)/t, for π π 4 4 < < − t .
» t = – 4*pi:0.05:4*pi; %starting point:increment:end point
ME 413: System Dynamics and Control 23/220 Laboratory Manual
» y = sin(t)./t; %the dot is placed after sin(t) to show that this is a
scalar %division.
» plot(t,y)
» title('The Sinc Function')
» xlabel('Radians')
» ylabel('Displacement')
» grid
15 10 5 0 5 10 15
0.4
0.2
0
0.2
0.4
0.6
0.8
1
The Sinc Function
Radians
D
i
s
p
l
a
c
e
m
e
n
t
Figure 2. Example of Sinc function plot
Multiple Plots
Example 3. For π 4 0 < < t , Plot the functions x = 0.5*sin(0.5*t) and Y = sin(t)*cos(t);
» clf % clear the previous graph windows
» t = 0:0.05:4*pi; % starting point:increment:end point
» x =.5*sin(0.5*t); % first function
» y =.5*cos(0.5*t); % second function
» plot(t,x,':',t,y,'') % multiple plots, the first function is plotted with dotted lines
% while the second one is plotted as solid lines.
» title('Plot of Two Function')
» xlabel('Radians')
» ylabel('Displacement')
» grid
» legend('x','y') % a legend is plotted to show the different plots
The command gtext('x','y') allows you to obtain a crosshair cursor, which you can
move by means of the mouse (or arrow keys on some computers), to any point on
the graph. Moving it to any point on the graph and clicking the mouse (or hitting a
key on some computers) causes MATLAB to display 'x', and 'y' on the screen.
ME 413: System Dynamics and Control 24/220 Laboratory Manual
0 2 4 6 8 10 12 14
0.5
0.4
0.3
0.2
0.1
0
0.1
0.2
0.3
0.4
0.5
Plot of Two Function
Radians
D
i
s
p
l
a
c
e
m
e
n
t
x
y
Legend
Figure 3. Example of two function plot
Subplots
The subplot command allows you to split the graph window into subwindows. The
arguments to the subplot command are three integers: m, n, p. The digits m and n
specify that the graph windows is to be split into an m by n grid of smaller windows,
and the digit p specifies the pth windows for the current plot. The windows are
numbered from left to right, top to bottom.
Example 4. Use the subplot command to plot the following functions
x = 2sin(t)+3sin(2t)+4sin(3t)+5sin(4t);
y = (t)*cos(t).*sin(t);
z = cos(2t)+2 cos(3t)+2 cos(3t)*sin(3t);
w=x + y – z;
» clf % clear the previous graph windows
» t = linspace(–10,10,1000); % generates 1000 points linearly spaced starting
% from –10 and ending at 10.
%
» x = 2*sin(t)+3*sin(2*t)+4*sin(3*t)+5*sin(4*t);
» y = (t).*cos(t).*sin(t);
» z = cos(2*t)+2*cos(3*t)+2*cos(3*t).*sin(3*t);
» w=x+y–z;
%
» hold on
» subplot(221);plot(t,x); title('The Function x');
» subplot(222);plot(t,y); title('The Function y');
» subplot(223);plot(t,z); title('The Function z');
» subplot(224);plot(t,w); title('The Function w');
» hold off
ME 413: System Dynamics and Control 25/220 Laboratory Manual
10 5 0 5 10
15
10
5
0
5
10
15
The Function x
10 5 0 5 10
5
0
5
The Function y
10 5 0 5 10
4
2
0
2
4
The Function z
10 5 0 5 10
20
10
0
10
20
The Function w
Figure 4. Example of subplot.
Polynomial Curve Fitting
In general, a polynomial fit to data in vector x and y is a function p of the form
n
d d
c x c x c x p + + + =
−
... ) (
1
2 1
The degree of the polynomial is d and the number of coefficients is n = d+1. Given a
set of points in vector x and y, polyfit(x,y,d) returns the coefficients of dth order
polynomial in descending powers of x.
Example 5. Find a polynomial of degree 3 to fit the following data:
x 0 1 2 4 6 10
y 1 7 23 109 307 1231
» x = [0 1 2 4 6 10];
» y = [1 7 23 109 307 1231];
» p = polyfit(x,y,3)
The coefficients of a third degree polynomial are found as follows
p =
1.0000 2.0000 3.0000 1.0000
i.e., 1 3 2
2 3
+ + + = x x x y
ME 413: System Dynamics and Control 26/220 Laboratory Manual
ThreeDimensional Mesh Surface Plot
The statement mesh(z) creates a threedimensional plot of the elements in matrix Z.
A mesh surface is defined by the Z coordinates of points above a rectangular grid in
the xy plane. The plot is formed by joining adjacent points with straight lines.
meshgrid transforms the domain specified by vector x and y into arrays X and Y.
Example 6. Obtain the Cartesian plot of the Bessel function
2 2
y x J +
ο
over the
range 12 12 , 12 12 ≤ ≤ − ≤ ≤ − y x .
» clf
» [x,y] = meshgrid(–12:0.6:12, –12:0.6:12);
» r = sqrt(x.^2+y.^2);
» z = bessel(0,r);
» m = [45 60];
» mesh(z,m)
Figure 5. Three dimensional plot.
Line Plots of 3D Data
The 3D analog of the plot function is plot3. If x, y, and z are three vectors of the
same length, plot3(x,y,z) generates a line in 3D through the points whose
coordinates are the elements of x, y, and z and then produces a 2D projection of
that line on the screen.
Example 7. The following statements produce a helix.
» t = 0:pi/50:10*pi;
» plot3(sin(t),cos(t),t)
» axis square; grid on
ME 413: System Dynamics and Control 27/220 Laboratory Manual
Figure 7. Helix plot
Plotting Matrix Data
If the arguments to plot3 are matrices of the same size, MATLAB plots lines
obtained from the columns of X, Y, and Z. For example,
Example 8. The following lines produce plot obtained from the columns of X, Y,
and Z.
» [X,Y] = meshgrid([2:0.1:2]);
» Z = X.*exp(X.^2Y.^2);
» plot3(X,Y,Z)
» grid on
Notice how MATLAB cycles through line colors.
ME 413: System Dynamics and Control 28/220 Laboratory Manual
Figure 8. Three dimensional plot
Additional Plotting Capabilities
Most plots that we generate assume that the x and y axes are divided into equally
spaced intervals; these plots are called linear plots. Occasionally, we may like to use a
logarithmic scale on one or both of the axes. A logarithmic scale (base 10) is convenient
when a variable ranges over many orders of magnitude because the wide range of
values can be graphed without compressing the smaller values. The MATLAB
commands for generating linear and logarithmic plots of the vectors x and y are the
following:
semilogx(x,y) Generates a plot of the values x and y using a logarithmic scale for
x and a linear scale for y.
semilogy(x,y) Generates a plot of the values x and y using a linear scale for x and
a logarithmic scale for y.
loglog(x,y) Generates a plot of the values x and y using a logarithmic scale for
both x and y.
Axes Scaling
MATLAB automatically scales the axes to fit the data values. However, you can
override this scaling with the axis command. There are several forms of the axis
command:
Axis Freezes the current axis scaling for subsequent plots. A second
execution of the command returns the system to automatic
scaling.
Axis(v) Specifies the axis scaling using the scaling values in the vector v,
which should contain [xmin, xmax, ymin, ymax].
Line and Mark Style
ME 413: System Dynamics and Control 29/220 Laboratory Manual
The command plot(x,y) generates a line plot that connects the points represented
by the vectors x and y with line segments. You can also select other line types
dashed, dotted and dashdot. You can also select a point, plus sign, stars circles or
xmark plots instead of a line plot. Table 2 contains these different options for lines
and marks.
TABLE 2. Line and Mark Options
Line Type Point Type Colors
 solid . point y yellow w white
 dashed + plus g green r red
: dotted * star m magenta k black
–. dashdot ○ circle b blue I invisible
x xmark c cyan
PROGRAMMING IN MATLAB
®
MATLAB contains several commands to control the execution of MATLAB statements,
such as conditional statements, loops, and commands supporting user interaction.
Example 1. A script file that produces a sequence of increasingly refined plots of
) 2 ( sin x π .
» clf
» for n = [4 8 12 16 20 50 100 200 500 1000]
x=linspace(0,pi/2,n);
y=(sin(2*pi*x));
plot(x,y)
title(sprintf('Plot based upon n = %3.0f points.',n))
pause(1);
» end
Example 2. How to create polygons. The following script file produces the graph
shown in Figure 9.
» close all
» clc
» theta=linspace(0,2*pi,361);
» c=cos(theta);s=in(theta);
» k=0;
» for sides = [3 4 5 6 8 10 12 18 24]
stride = 360/sides;
k=k+1;
subplot(3,3,k)
plot(c(1:stride:361),s(1:stride:361))
xlabel(sprintf(' n = %2.0f',sides));
axis([1.2 1.2 1.2 1.2])
axis('square')
» end
ME 413: System Dynamics and Control 30/220 Laboratory Manual
1 0 1
1
0.5
0
0.5
1
n = 3
1 0 1
1
0.5
0
0.5
1
n = 4
1 0 1
1
0.5
0
0.5
1
n = 5
1 0 1
1
0.5
0
0.5
1
n = 6
1 0 1
1
0.5
0
0.5
1
n = 8
1 0 1
1
0.5
0
0.5
1
n = 10
1 0 1
1
0.5
0
0.5
1
n = 12
1 0 1
1
0.5
0
0.5
1
n = 18
1 0 1
1
0.5
0
0.5
1
n = 24
Figure 9. Regular polygons
Example 3. How to create a STOP sign.
» t = (1/8:2/8:15/8)'*pi;
» x=sin(t);y=cos(t);
» fill(x,y,'r')
» axis('square')
» text(0,0,'STOP','Color',[1 1 1],'FontSize',80,'HorizontalAlignment','Center')
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
STOP
Figure 10. Red stop sign
ME 413: System Dynamics and Control 31/220 Laboratory Manual
MATLAB Commands and Matrix Functions
Commands and matrix functions
commonly used in solving control
engineering problems
Explanations of what commands do,
matrix functions mean, or statements
mean
abs Absolute value, complex magnitude
angle Phase angle
ans Answer when expression is not assigned
atan Arctangent
axis Manual axis scaling
bode Plot Bode diagram
clear clear workspace
clf Clear graph screen
computer Type of computer
conj Complex conjugate
conv Convolution, multiplication
corrcoef Correlation coefficients
cos Cosine
cosh Hyperbolic cosine
cov Covariance
deconv Deconvolution, division
det Determinant
diag Diagonal matrix
eig Eigenvalues and eigenvectors
exit Terminate program
exp Exponential base e
expm Matrix exponential
eye Identity matrix
filter Direct filter implementation
format long 15Digit scaled fixed point
(Example: 1.33333333333333)
format long e 15Digit floating point
(Example: 1.33333333333333e+000)
format short 5Digit scaled fixed point
(Example: 1.3333)
format short e 5Digit floating point
(Example: 1.3333e+000)
freqs Laplace transform frequency response
freqz zTransform frequency response
grid Draw grid lines
hold Hold current graph on the screen
i
1 −
imag Imaginary part
inf Infinity
inv Inverse
j
1 −
length Vector length
linspace Linearly spaced vectors
ME 413: System Dynamics and Control 32/220 Laboratory Manual
log Natural logarithm
loglog Loglog xy plot
logm Matrix logarithm
logspace Logarithmically spaced vectors
log10 Log base 10
lqe Linear quadratic estimator design
lqr Linear quadratic regulator design
max Maximum value
mean Mean value
median Median value
min Minimum value
NaN Notanumber
nyquist Plot Nyquist frequency response
ones constant
Pi Pi (π )
plot Linear xy plot
polar Polar plot
poly Characteristic polynomial
polyfit Polynomial curve fitting
polyval Polynomial evaluation
polyvalm Matrix polynomial evaluation
prod Product of elements
quit Terminate program
rand Generate random numbers and matrices
rank Calculate the rank of a matrix
real Real part
rem Remainder or modulus
residue Partialfraction expansion
rlocus Plot root loci
roots Polynomial roots
semilogx Semilog xy plot (xaxis logarithmic)
semilogy Semilog xy plot (yaxis logarithmic)
sign Signum function
sin Sine
sinh Hyperbolic sine
size Row and column dimensions
sqrt Square root
sqrtm Matrix square root
std Standard deviation
step Plot unitstep response
sum Sum of elements
tan Tangent
tanh Hyperbolic tangent
text Arbitrarily positioned text
title Plot title
trace Trace of a matrix
who Lists all variables currently in memory
xlabel xAxis label
ylabel yAxis label
zeros Zero
ME 413: System Dynamics and Control 33/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
LAPLACE TRANSFORMS
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 34/220 Laboratory Manual
LAPLACE TRANSFORM
OBJECTIVE
1. To illustrate the use of The Laplace transform with the aid of MATLAB.
2. To use MATLAB in partial fraction.
3. To solve an Initial Value Problem (IVP).
PROBLEM #1: Distinct Real Poles
Consider the following transfer function
3 2
num 7 5
( )
den 4 6
s
G s
s s s
−
= =
− + +
1. Write G(s) in partial fractions (Hint: 1 − = s is a pole)
3
3
2
2
1
1
den
num
) (
p s
r
p s
r
p s
r
s G
−
+
−
+
−
= =
2. Find the inverse Laplace transform L
1 −
[ ) (s G ]= ) (t g .
3. Check your finding by using MATLAB. The MATLAB function residue performs a
partial fraction expansion and is defined as:
[r,p,k] = residue(num,den) finds the residues, poles and direct term of a partial
fraction expansion of the ratio of two polynomials,
num(s)/den(s).If there are no multiple roots, Vectors den
and num specify the coefficients of the polynomials in
descending powers of s. The residues are returned in the
column vector r, the pole locations in column vector p, and
the direct terms in row vector k.
PROBLEM #2: Repeated Real Poles
Consider the following transfer function
( )
2 3
1
2
den
num
) (
−
+
= =
s s
s
s G
1. Write G(s) in partial fractions.
2. Find the inverse Laplace transform L
1 −
[ ) (s G ]= ) (t g .
3. Check your finding by using MATLAB. First write G(s) in the form
den
num
) ( = s G
ME 413: System Dynamics and Control 35/220 Laboratory Manual
For repeated poles, however, the previous command is not applied and one can use the
online help and the MATLAB function resi2. The MATLAB function resi2 performs a
partial fraction expansion is defined as:
resi2(num,den,pole,n,k) returns the residue of a repeated pole of order n and the
kth power denominator of [1pole], where num and den
represent the original polynomial ratio num/den.
PROBLEM #3: Complex Poles
Use the method of completing the square to find the inverse Laplace transform of
5 2
5
) (
2
+ +
+
=
s s
s
s G
PROBLEM #4: Initial Value Problem
1. Solve the Initial Value Problem
0 ) 0 ( , 1 ) 0 ( ), ( = = = + y y t f y y
where f(t) is defined by
t
f(t)
0 π 2π
2. Plot the response y(t)
MATLABPROGRAM
Click at File, New, Mfile
Then write the following program and do not forget to fill the blanks
% Distinct Poles
num=[……………. …………….];
den=[……………. ……………. …………….];
[r,p,k]=residue(num,den)
%
When you finish typing the program
Select in this order: Edit, Select all, Copy
At the MATLAB prompt, type
Paste and then press Enter
Repeat the previous program for the case of repeated poles and apply the
appropriate function.
ME 413: System Dynamics and Control 36/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
MECHANICAL SYSTEMS (I)
Simple Harmonic Oscillator
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 37/220 Laboratory Manual
SIMPLE HARMONIC OSCILLATOR
PART I: EXPERIMENT
OBJECTIVE
4. To determine linear spring characteristics.
5. To determine the period of a mass spring system experimentally.
6. To compare the theoretical period with the one obtained from the
experiment.
THEORY
In order for mechanical oscillation to occur, a system must possess two properties:
elasticity and inertia. When the system is displaced from its equilibrium position,
the elastic property provides a restoring force such that the system tries to return
to equilibrium. The inertia property causes the system to overshoot equilibrium.
This constant play between elastic and inertia properties is what allows oscillatory
motion to occur. The natural frequency of the oscillation is related to the elastic
and inertia properties by
2
n n
f ω π = =
Elastic property
Inertia property
The simplest example of an oscillating system is a mass connected to a rigid
foundation by a spring as shown in Figure 1.
M
k
Figure 1. Mass spring system
The spring constant k provides the elastic restoring force, and the inertia of the
mass m provides the overshoot. By applying Newton’s second law F M a = to the
mass, one can obtain the equation of motion for the system
2 2 2
2
2 2 2
0 0 0
n
d x d x k d x
M kx x x ,
dt dt M dt
ω + = ⇒ + = ⇒ + =
ME 413: System Dynamics and Control 38/220 Laboratory Manual
where
n
k M ω = is the natural frequency of the system. The above equation
represents a second order ordinary differential equation that admits a solution of
the form
( ) ( )
m n
x t X cos t ω φ = +
where
m
X is the amplitude of the oscillation, and φ is the phase shift. Both
m
X
and φ are constants that are determined by the initial conditions (initial
displacement and velocity) at time 0 t = .
Spring Constant
The force exerted by an ideal spring is a linear restoring force vector whose
magnitude is F ky = in direction opposite to the stretch y . This force tries to restore
the spring to its original length L L =
D
. The quantity y L L = −
D
is the elastic
extension (stretch) of the spring from its unstretched length L
D
.
L
D
y
L
M
Mg
F k y = −
Figure 2.
In the static situation shown in Figure 2, in equilibrium, the magnitude of the
upward force, F , exerted by the spring on M is equal to the weight of the attached
mass, W Mg = .
Experiment 1: Measure of the Spring Constant k
We would determine the value of k by measuring the amount of stretch y for various
weights W Mg = .
It turns out simpler and more accurate to measure the length L for various masses
M , and then determine k from
( ) F Mg ky k L L = = = −
D
ME 413: System Dynamics and Control 39/220 Laboratory Manual
so that
( ) / L g k M L = +
D
The above equation represents a straight line relationship between L and M . The
quantity / g k represents the slope and L
D
is the intercept.
M
L
L
D
( ) / L g k M L = +
D
( ) slope / g k =
Figure 3.
Procedure and Requirements
1) Hang the spring with its narrow part at the top.
2) Hang various masses from the spring, and record the values of L for each
mass . M
3) Record your readings in Table 1.
4) Plot a graph of L versus M .
5) Notice that for very small , M the graph representing the relationship
between L and M may not be very straight because not all of the spring is
yet “active.” Some coils are still touching metaltometal so it acts more like
a solid tube than a coil spring. Record the first value L and M at which the
coils all have some air between them. Mark this point on your graph.
6) The slope of this line is / , g k so the spring constant is k g = /slope. For
intermediate values of , M the graph will probably be straight. Measure the
slope of that part of the graph and determine the value of k and its
uncertainty.
7) You might find also that for large , M the graph again deviates from a
straight line. If this happens, record the maximum value of , M and the
corresponding y for which the graph is straight. Mark this point on your
graph also.
ME 413: System Dynamics and Control 40/220 Laboratory Manual
8) In following experiments, try to keep range of oscillations between these two
points you marked on the graphs to avoid complications.
Experiment 2: Period of Oscillations of Mass on spring
Theory
The theory shows that for a massless ideal spring, the period of oscillations is given
by
2 / M k τ π =
from which
( )
2 2
4 k M τ π =
where k is the spring constant that you determined experimentally in Experiment #
1.
A graph of
2
τ versus M is predicted to be a straight line with slope
( )
2
4 k π which
extends through the origin in the case of a massless spring.
For a spring with mass
s
m , the previous relation is no longer valid and the theory is
more complicated. In the simplest case, as long as the spring is active all the time,
the result is that we must add 1/3 of the spring’s own mass,
s
m to the mass M of
the hanging weight in the theory, so
( ) / 3
2
s
M m
k
τ π
+
=
and
( )
2
2
4
/ 3
s
M m
k
π
τ
 
= +

\ .
The reason we add less than ms is fairly simple. Only the bottom of the spring
moves at the speed v of the hanging mass ; M the rest moves slower (top is at rest),
so the effective inertia is less. The reason it comes out 3,
s
m instead of, say 2,
s
m is
more technical. It comes from the fact that the kinetic energy of the spring is
( )( )
2
1 2 3
s
m v , where v is the speed of the hanging mass , M equal to the speed of
the bottom end of the spring. This KE is just ( ) 1 3 of the kinetic energy ( )
2
1 2
s
m v of
the particle of mass
s
m moving at speedv . So, the improved theory predicts the
period and the period squared as given by the above equations. Thus from the
above equations a graph of
2
τ versus M is still predicted to be a straight line with a
slope of
( )
2
4 k π as shown in Figure 4. When the line is extended to
2
0, τ = its
intercept with the horizontal axis should be 3,
s
m − instead of 0. The period is
predicted to be independent of the amplitude of the oscillation.
ME 413: System Dynamics and Control 41/220 Laboratory Manual
Apparatus
1) To plotτ with different weights, use the transducer type 4366 and connect
the transducer with charge amplifier to increase the signal of oscillations.
2) Take the output velocity from the charge amplifier.
3) Connect the output with the Chart recorder type L
M
2
τ
( )
2
2
4
/ 3
s
M m
k
π
τ
 
= +

\ .
2
4
slope
k
π  
=

\ .
/ 3
s
m −
Figure 4.
Procedure and Requirements
How does period T depend on mass M and Amplitude?
1) Measure the mass
s
m of the spring. (To prevent disturbing the experiments,
you should actually measure the mass of an identical spring which will be
provided to you).
2) Choose a mass M in the middle of the straight range of graph from
Experiment #1, Figure 3 and hang it from the spring.
3) Lift the mass straight up to the minimum length for which the whole spring
is active.
4) Release the mass and measure the period τ of oscillations. To measure the
period, use a stop watch determine the time for n complete vibrations.
Divide this time by n to find the period τ the time for one complete
oscillation (the period of oscillation). Perform three trials and average your
results.
5) Repeat the measurement of the period a few times, as the amplitude of
motion decreases due to friction. If the periods change, record τ versus
amplitude of motion and consult your instructor. If the periods do not
change significantly, you can proceed to measure periods without concern
about careful measurement of the amplitude of motion.
ME 413: System Dynamics and Control 42/220 Laboratory Manual
6) Measure τ for other masses M keeping motion in the mid range of graph of
L versus M (Figure 3).
7) Compute
2
τ and plot a graph of
2
τ versus M .
Use enough values of M to see if the graph is straight, and to measure its
slope accurately.
Make sure that the spring stays active through the full range of oscillations.
Make sure that your M axis goes far enough to negative numbers that you
can see the intercept.
8) Plot a theory line for the improved theory ( )
2
2
4
/ 3
s
M m
k
π
τ
 
= +

\ .
on the
same graph. Does it agree (within margin of error) with your measurements?
9) For zero initial conditions, Obtain the plot of the output response for
2.0 M = kg
ME 413: System Dynamics and Control 43/220 Laboratory Manual
TABLE 1. Measure of the Spring Constant k
Trial
#
Mass M
(kg)
Length L
(cm)
1 0.4
2 0.8
3 1.2
4 1.6
5 2.0
6 2.4
7 2.8
8 3.2
9 3.6
10 4.0
TABLE 2. Period of Oscillations of Mass on spring
Trial
#
Mass M
(kg)
Time t for n oscillations
(s)
Period t n τ =
(s)
2
τ
(s
2
)
1 0.4
2 0.8
3 1.2
4 1.6
5 2.0
6 2.4
7 2.8
8 3.2
9 3.6
10 4.0
ME 413: System Dynamics and Control 44/220 Laboratory Manual
PART II: SIMULATION
The mass is fixed to be 2.0 M = kg and k is the same as the obtained in Experiment
1. Model the mass and spring systems used in Experiment 2. Simulate your model
using Matlab
®
.
1) Obtain the differential equation of motion.
2) Obtain the output response for a step input of magnitude 2.0 N? Plot this
response.
3) State clearly the major differences between this response and the one
obtained from the experiment? Justify your answer.
4) If you are asked that your simulation response should match the
experimental one what are the measures that you should take into
consideration?
5) From the above steps obtain a similar response to the one obtained in the
experiment.
Report and Requirements
6) Discuss your experimental results and their uncertainties.
7) How does the period τ depend on the amplitude of oscillations, A?
8) How well does the improved theory compare with your data?
9) How does the simulation compare with the experimental results?
ME 413: System Dynamics and Control 45/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
MECHANICAL SYSTEMS (II)
Modeling of a Pickup Truck
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 46/220 Laboratory Manual
Modeling of a Pickup Truck
OBJECTIVE
To model a suspension system of a pickup truck and simulate its response for a
given profile of the road.
MODELING OF MECHANICAL SYSTEM ELEMENTS
The motion of mechanical elements can be described in various dimensions as
translational, rotational, or combinations. The equations governing the motion of
mechanical systems are often formulated from Newton’s law of motion.
Translational Motion:
The translational motion is defined as a motion that takes place along a straight
line. The variables that are used to describe translational motion are acceleration,
velocity and displacement. Newton’s law of motion states that the algebraic sum
of forces acting on a rigid body in a given direction is equal to the product of
the mass of the body and its acceleration in the same direction. The law can
be expressed as
∑
= a M F (1)
where M denotes the mass and a is the acceleration in the direction considered.
Rotational Motion:
The rotational motion of a body can be defined as a motion about a fixed axis. The
extension of Newton’s law of motion for rotational motion states that the algebraic
sum of moments or torques about a fixed axis is equal to the product of the
inertia and the angular acceleration about the axis. The law can be expressed
as
∑
= α J T (2)
where J denotes the inertia and α is the angular acceleration in the direction
considered. The other variables generally used to describe rotational motion are
torque, angular velocity and angular displacement.
The elements involved with translational and rotational motion are summarized in
Table 1.
ME 413: System Dynamics and Control 47/220 Laboratory Manual
TABLE 1. Summary of elements involved in linear mechanical systems
Translation
Rotation
Spring
k
F F
1
x
2
x
kx x x k F = − = ) (
2 1
k
T
T
2
θ
1
θ
θ θ θ k k T = − = ) (
2 1
Inertia
Damper
b
F F
1
x
2
x
x b x x b F = − = ) (
2 1
b
T
T
2
θ
1
θ
θ θ θ
b b T = − = ) (
2 1
Element
m
1
F
x
2
F
3
F
4
F
∑
= a m F
T
θ
J
∑
= α J T
PROCEDURE
The motion of mechanical elements can be described in various dimensions as
translational, rotational, or combination of both. The equations governing the
motion of mechanical systems are often formulated from Newton’s law of motion.
1. Construct a model for the system containing interconnecting elements.
2. Draw the freebody diagram.
3. Write equations of motion of all forces acting on the free body diagram. For
translational motion, the equation of motion is Equation (1), and for
rotational motion, Equation (2) is used.
PROBLEM
The suspension system for one wheel of an oldfashioned pickup truck can be
illustrated as shown in Figure 1. The mass of the vehicle is M and the mass of the
ME 413: System Dynamics and Control 48/220 Laboratory Manual
wheel is m. The suspension spring has a constant ,
1
K and the tire has a spring
constant .
2
K The damping constant of the shock absorber is B.
x
1
y
2
y
Spring
Shock
absorber
Profile
of road
Figure 1. Pickup truck suspension system.
1. Suggest a suitable model for this system.
2. Draw the free body diagram for the suggested model.
3. Write the equations of motion of the system.
4. For zero initial conditions, take Laplace transform of both sides of the
above equations obtained in part (3). Obtain the transfer functions
) ( 1
) ( 1
) (
) (
) (
1
1
s den
s num
s X
s Y
s G = = and
) ( 2
) ( 2
) (
) (
) (
2
2
s den
s num
s X
s Y
s G = =
in function of the system parameters M, m, B,
1
K and .
2
K In the above
) (
1
s Y and ) (
2
s Y represent the Laplace transform of ) (
1
t y and ) (
2
t y ,
respectively and X(s) represents the Laplace transform of ) (t x . The
quantities num1(s), num2(s), den1(s) and den2(s) are numerator and
denominator polynomials in s.
5. To find the responses ) (
1
t y and ) (
2
t y consider the following
a) m KNs B m N K m N K Kg m Kg M / 0 . 1 and , / 00 5 , / 100 , 10 , 200
2 1
= = = = =
b) m Ns B m N K m N K Kg m Kg M / 0 10 and , / 1000 , / 500 , 10 , 500
2 1
= = = = =
c) m KNs B m N K m N K Kg m Kg M / 0 . 1 and , / 1000 , / 50 , 10 , 500
2 1
= = = = =
For each of the previous cases, use MATLAB to plot the responses ) (
1
t y
and ) (
2
t y if the profile road were given by the following input function
ME 413: System Dynamics and Control 49/220 Laboratory Manual
¹
´
¦
≥
<
=
0 02 . 0
0 , 0
) (
t
t
t x
6. Refer to the previous question, i.e., question # (5), which choice of
system parameters M, m, B,
1
K and
2
K is the best one and why? Justify
your answer.
7. Use the final value theorem to obtain the steady state values
ss
y
1
and
ss
y
2
of the system that appears to you to be the best one.
MATLAB PROGRAM
Click at File, New, Mfile
Then write the following program and do not forget to fill the blanks
% Part a
t=0.0:0.01:15;
M=……….;m=……….;k1=……….;k2=……….;B=……….;
num_1 = [………. ……….];num_2 = [………. ……….];
den=[………. ………. ………. ………. ……….];
%
y1=0.02*step (num_1,den,t);y2=0.02*step (num_2,den,t);
subplot(311);plot(t,y1,'r',t,y2,':');legend('y1','y2');
grid;title('Part A : Response of the pickup ');
xlabel('Time in seconds');ylabel('Deflection in m');
%
Repeat the previous steps for parts b and c and modify the program accordingly. To do
so, follow the following steps:
Edit, Select all, Copy, Paste
When you finish typing the program, follow these steps:
Edit, Select all, Copy
Go to MATLAB prompt and type
Paste and then press Enter
ME 413: System Dynamics and Control 50/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
MECHANICAL SYSTEMS (III)
Torsional Oscillations
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 51/220 Laboratory Manual
TORSIONAL OSCILLATIONS
SUMMARY AND REVIEW
MODELING OF MECHANICAL SYSTEM ELEMENTS
The motion of mechanical elements can be described in various dimensions as
translational, rotational, or combinations. The equations governing the motion of
mechanical systems are often formulated from Newton’s law of motion.
Translational Motion:
The translational motion is defined as a motion that takes place along a straight
line. The variables that are used to describe translational motion are acceleration,
velocity and displacement. Newton’s law of motion states that the algebraic sum
of forces acting on a rigid body in a given direction is equal to the product of
the mass of the body and its acceleration in the same direction. The law can
be expressed as
∑
= a M F (1)
where M denotes the mass and a is the acceleration in the direction considered.
Rotational Motion:
The rotational motion of a body can be defined as a motion about a fixed axis. The
extension of Newton’s law of motion for rotational motion states that the algebraic
sum of moments or torques about a fixed axis is equal to the product of the
inertia and the angular acceleration about the axis. The law can be expressed
as
∑
= α J T (2)
where J denotes the inertia and α is the angular acceleration in the direction
considered. The other variables generally used to describe rotational motion are
torque, angular velocity and angular displacement.
The elements involved with translational and rotational motion are summarized in
Table 1.
PROCEDURE
The motion of mechanical elements can be described in various dimensions as
translational, rotational, or combination of both. The equations governing the
motion of mechanical systems are often formulated from Newton’s law of motion.
1. Construct a model for the system containing interconnecting elements.
ME 413: System Dynamics and Control 52/220 Laboratory Manual
2. Draw the freebody diagram.
3. Write equations of motion of all forces acting on the free body diagram. For
translational motion, the equation of motion is Equation (1), and for
rotational motion, Equation (2) is used.
TABLE 1. Summary of elements involved in linear mechanical systems.
Translation
Rotation
Spring
k
F F
1
x
2
x
kx x x k F = − = ) (
2 1
k
T
T
2
θ
1
θ
θ θ θ k k T = − = ) (
2 1
Inertia
Damper
b
F F
1
x
2
x
x b x x b F = − = ) (
2 1
b
T
T
2
θ
1
θ
θ θ θ
b b T = − = ) (
2 1
Element
m
1
F
x
2
F
3
F
4
F
∑
= a m F
T
θ
J
∑
= α J T
ME 413: System Dynamics and Control 53/220 Laboratory Manual
PART I: SIMULATION
In the system shown in the figure below, the two shafts are assumed to be flexible
with stiffness constants
1
k and
2
k . The two disks, with moments of inertia
1
J and
2
J are supported by bearings whose friction is negligible compared to the viscous
friction element denoted by the coefficients
1
B and
2
B . The reference position for
1
θ
and
2
θ are the positions of the reference marks on the rims of the disks when the
system contains no stored energy.
Figure 1.
1. Draw the FBD of the system and obtain the system differential equations of
motion.
2. For zero initial conditions obtain the transfer functions ( )
1
G s and ( )
2
G s
given by ( )
( )
( )
1
1
a
s
G s
s τ
Θ
= and ( )
( )
( )
2
2
a
s
G s
s τ
Θ
=
where ( )
1
s Θ and ( )
2
s Θ are the Laplace transforms of ( )
1
t θ and ( )
2
t θ ,
respectively; and ( )
a
s τ is the Laplace transforms of ( )
a
t τ . It is clear that
the transfer functions ( )
1
G s and ( )
2
G s should be given in terms of the
system parameters
1
k ,
2
k ,
1
B ,
2
B and
1
J ,
2
J .
3. If in SI units
1
J =
2
J =1.0 and
1
B =
2
B =0.7 and
1
k =
2
k =10; use Matlab to plot
the responses ( )
1
t θ and ( )
2
t θ if ( )
a
t τ is a step input of magnitude 10 N.m.
4. From the above expression of ( )
2
G s , write the explicit expression of ( )
2
t θ
if ( )
a
s τ is a step input of magnitude 10 N.m. as in the previous case.
5. Use the final value theorem find the steady state values of ( )
1
t θ and ( )
2
t θ .
6. (Optional) Obtain a state space representation of the system.
ME 413: System Dynamics and Control 54/220 Laboratory Manual
7. (Optional) Find the eigenvalues of the state matrix   A and compare them
to the roots of the characteristic equation (Denominator of ( )
1
G s ). What do
you conclude.
ME 413: System Dynamics and Control 55/220 Laboratory Manual
PART II: EXPERIMENT
OBJECTIVE
1. To determine the modulus of rigidity G of an unknown material.
2. To determine the mass moment of inertia of a flywheel using the Falling
Weight Method (FWM).
3. To compare between the experimental and theoretical periods for an oscillating
flywheels.
DESCRIPTION
For experiments on torsional oscillations of shafts, the oscillating inertia is
provided by a heavy steel flywheel which is mounted on ball bearings. The moment
of inertia of this flywheel can be found experimentally by the falling weight method,
when the flywheel is mounted in position for the torsional tests.
The flywheel is mounted with its axle horizontal as shown in Figure 1 and one end
of the experimental shaft, which may be 1/8" or 3/16" diameter steel rod, is
gripped by the flywheel chuck. The other end of the shaft is held in a stationary
chuck rigidly fixed to a bracket attached to the cross member of the frame. The
lateral position of the bracket may be varied and the relationship between the
periodic time and the shaft length investigated.
THEORY
The equation of motion for the undamped system shown in Figure 1, when given a
small angular displacement, can be written as follows
I k θ θ = −
⇒ 0
k
I
θ θ
 
+ =

\ .
l
d
I
Figure 1.
Where
ME 413: System Dynamics and Control 56/220 Laboratory Manual
I is the mass moment of inertia of the flywheel.
/ k GJ l = is the shaft stiffness and l is the shaft length.
G is the modulus of rigidity of the shaft’s material.
4
/ 32 J d π = is the second moment of area of the shaft.
The natural frequency of the system can be written as
n
k GJ
I I l
ω = =
Knowing that 2 /
n
τ π ω = , the period of oscillation can be expressed as:
2
I l
GJ
τ π = ⇒
2
2
4 I
l
GJ
π
τ
 
=

\ .
It is obvious that the relationship between
2
τ and l is linear, with a slope equal to
( )
2
4 / I GJ π as shown in Figure 3. If the period τ is measured for different shaft
lengths, the slope of the plot
2
τ versus l can be used to determine G since I and
J are known.
l
2
τ
2
2
4 I
l
GJ
π
τ
 
=

\ .
2
4
slope
I
GJ
π  
=

\ .
Figure 2.
Apparatus
1) A steel portal frame.
2) A cylindrical rotor fitted with a chuck designed to accept shafts of different
diameters.
3) A steel shaft.
4) A chuck with a bracket for holding a shaft.
5) A small mass and a thread.
ME 413: System Dynamics and Control 57/220 Laboratory Manual
The rotor can be mounted on a short axle at the vertical member of the portal
frame and then used with the small mass and cord to perform the experimental
part related to falling weight method.
The shaft can be clamped to the chuck of the rotor at one end and to the chuck
with bracket at the outer end. This assembly is used to study the oscillations of a
single rotor.
Figure 3. Schematic diagram for the setup
ME 413: System Dynamics and Control 58/220 Laboratory Manual
Experiment 1: Determination of the Modulus of Rigidity of a Shaft
Procedure and Requirements
1) Take all dimensions needed for the experiment.
2) Fix a steel shaft to the rotor and measure the period τ for different shaft
lengths.
3) Record your readings in Table 2.
4) Plot a graph of
2
τ versus l .
5) The slope of the above graph should be a straight line with a slope of
( )
2
4 / I GJ π . Measure the slope of that line and determine the value of G and
its uncertainty.
6) How do the value of G compare with the standard value of steel?
7) Does the value of G depend in any way on the shaft Dimensions? Why?
8) What could be the possible source of error if the relation between
2
τ and
l were nonlinear.
9) If the rotor used in this experiment has an unknown inertia, explain briefly
how the auxiliary inertia method can be employed to determine the modulus
of rigidity of the shaft.
10) Notice that the rotor for which the mass moment of inertia can be
determined using the analytical method
2
1
2
i i i
I I mr = =
∑ ∑
where
i
m and
i
r
are the mass and radius of each part separately.
ME 413: System Dynamics and Control 59/220 Laboratory Manual
TABLE 2.
Trial
#
Length l
(m)
Time t for n oscillations
(s)
Period t n τ =
(s)
2
τ
(s
2
)
1
2
3
4
5
6
7
8
Experiment 2: Determination of Moment of Inertia of Flywheel Using
Falling Weight Method (FWM)
DESCRIPTION & THEORY
The flywheel is mounted horizontally on ball bearings as in the above experiment
(Figure 4). A string is looped round a peg on the rim of the flywheel, to which a
weight is attached. The height from which the weight is to be released is measured
carefully, the number of revolutions of the wheel while the weight is descending is
obtained by placing the weight on the ground and counting the number of turns of
the wheel required to wind it up to its starting point. The length of the string is
adjusted so that the loop comes off the peg as the weight reaches the ground.
I
R
m
h
Figure 4. Setup for Falling Weight Method experiment.
ME 413: System Dynamics and Control 60/220 Laboratory Manual
The weight is released from rest and the number of revolutions made by the wheel
after the weight reaches the ground is measured, and also the time taken for the
flywheel to come to rest, after the weight strikes the ground.
Let ( )
1
N be the number of revolutions of the wheel during the time
1
t taken by the
flywheel before stopping, Figure 4.
and ( )
2
N be the number of revolutions of the wheel during
the time
2
t after the weight has struck the ground.
The length of the string is adjusted so that the loop comes off the peg as the weight
reaches the ground. The motion of this system, after adding the small mass m, can
be divided into three phases:
Phase 1: Between the instant 0 t = and
1
t , i.e., falling body motion (falling phase).
When the mass m is released from rest, it moves downwards accelerating towards
the ground, causing the rotor to revolve at an increasing angular velocity. The
motion of the rotor is resisted by a frictional torque
f
T of the rotor’s bearing. The
equation of motion (applying Newton’s second law for rotating system) can be
written as
f
T I mgR T θ = = −
∑
where
2
total
I I mR = + . Knowing that
d d d d
dt d dt d
θ θ θ θ
θ θ
θ θ
= = × = ×
the above equation becomes
( )
2
f
I mR d d mgR T θ θ θ + = −
Integrating the above equation over the whole range of θ , i.e., between 0 and
1
θ ,
results in the following equation:
( )
2 2
1 1 1
2
f
I mR mgR T θ θ θ + = −
Replacing the following expressions
1 1 1
2
2
R h
R v
N
N t
θ ω
θ
θ
θ π
ω π
=
=
=
=
=
hence
( ) ( )
2 2
1 1 1
1 2 1 2 2
f
I mv mgh N T ω π + = − (*)
ME 413: System Dynamics and Control 61/220 Laboratory Manual
Phase 2: Impact between the mass m and the floor, the angular velocity of the rotor
changes from
1
ω to
2
ω .
Phase 3: The rotor moves alone due to its own inertia, decelerating from
2
ω to 0 ,
due to friction
f
T .
The equation of motion can be written as:
f
I T θ = −
Substituting for
d
d
θ
θ θ
θ
= ×
and integrating the above equation over the entire range
of θ , i.e., between
2
θ and
3
θ , results in the following equation:
( ) ( )
2 3 2
1 2
f
I T θ θ θ = − −
(**)
The difference ( )
3 2
θ θ − expresses the total angle traveled by the rotor during the
third phase. It can be expressed as ( )
3 2 2
2 N θ θ π − = , where
2
N is the number of
revolutions of phase 3.
Eliminating
f
T from equations (*) and (**) results in the following equation
2
1
2 2 1
1 2
2
2mgh mv
I
N
N
ω ω
−
=
+
where
1 1
2 / ; v h t = average descending velocity of the mass . m
1 1 1
2 / ; N t ω π = average angular velocity of the rotor during phase (1).
2 2 2
2 / ; N t ω π = average angular velocity of the rotor during phase (3).
1
N and
2
N : Number of revolutions made by the flywheel in phase (1) and phase (3)
respectively.
m = attached mass.
h =release height from the ground.
I = mass moment of inertia of the flywheel.
Procedure and Requirements
1) Take all dimensions required for the experiment.
2) Fix the rotor as explained previously and carry out the procedure of Falling
Weight Method(FWM). Repeat the procedure of data collection several times
to take the average.
3) Release the weight from rest and record the number of revolutions made by
the wheel
1
N and the corresponding time
1
t .
ME 413: System Dynamics and Control 62/220 Laboratory Manual
4) Record the number of revolutions
2
N and the corresponding time
2
t taken by
the flywheel to come to rest after the weight strikes the ground.
5) Record your readings in Table 3.
6) How accurate were your time measurements?
7) How would the results be affected if the cord were wrapped around the axle
of the rotor instead around of its rim?
8) What changes in procedure would be necessary if a stepped shaft were used
instead of one of uniform section?
TABLE 3.
Trial
#
Height h
(m)
Time t1
(s)
N1
1
ω
Time t2
(s)
N2
2
ω
1
2
3
4
5
6
7
8
ME 413: System Dynamics and Control 63/218 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
ELECTRICAL SYSTEMS
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 64/218 Laboratory Manual
ELECTRICAL SYSTEMS
OBJECTIVE
7. To develop models for some simple circuits.
8. To obtain the transfer function description of a model.
9. To apply impedancebased techniques to obtain transfer functions for
electrical systems.
10. To apply MATLAB in analyzing transfer function models and obtaining
their response to various types of input functions.
REVIEW AND SUMMARY OF ELECTRICAL SYSTEM
ELEMENTS
Kirchhoff’s Current Law (KCL)
The algebraic sum of currents leaving a junction or node equals the algebraic sum
of the currents entering that node, or
0 =
∑
j
j
i at any node
Kirchhoff’s Voltage Law (KVL)
The algebraic sum of all voltages taken around a closed path in a circuit is zero, or
0 =
∑
j
j
v at any closed path
Sources
The inputs for electrical circuit model are provided by ideal voltage and current
sources. A voltage source is any device that causes a specified voltage to exist
between two points in a circuit regardless of the current that may flow. A current
source causes a specified current to flow through the branch containing the
source, regardless of the voltage that may be required. The symbols used to
represent general voltage and current sources are shown in Figure 1(a) and (b).
ME 413: System Dynamics and Control 65/218 Laboratory Manual
a) Voltage source
i(t)
v(t) i(t)
b) Current source
i(t)
Circuit
v(t)
+

Circuit
Figure 1. Sources
Open and Short Circuit:
An open circuit is any element through which current cannot flow. For example, a
switch in the open position provides an open circuit, as shown in Figure 2(a).
Likewise, we can consider a current source that has a value of i(t) = 0 over a
nonzero time interval an open circuit and can draw it as shown in Figure 2(b)
0 A Circuit
a)
b)
Figure 2. Examples of open circuits. (a) Open switch. (b) Zero current source
A Short Circuit is any element across there is no voltage. A switch in the closed
position , as shown in Figure 3(a), is an example of a short circuit. Another example
is a voltage source with v(t) = 0, as shown in Figure 3(b).
0 V Circuit
a)
b)
+

Figure 3. Examples of short circuits. (a) Closed switch. (b) Zero voltage source
Circuit elements may be classified as active or passive. Passive elements such as
resistors, capacitors and inductors are not sources of energy, although the last two
elements can store it temporarily. The active elements are energy sources that drive
the system. The passive elements involved with electrical systems are summarized
in Table 1.
ME 413: System Dynamics and Control 66/218 Laboratory Manual
TABLE 1. Summary of elements involved in linear electrical systems
Element
Capacitor
Resistor
Inductor
Voltagecurrent Currentvoltage Voltagecharge
Impedance,
Z(s)=V(s)/I(s)
∫
=
t
d i
c
t v
0
) (
1
) ( τ τ
dt
t dv
C t i
) (
) ( = ) (
1
) ( t q
c
t v =
Cs
1
) ( ) ( t i R t v = ) (
1
) ( t v
R
t i =
dt
t dq
R t v
) (
) ( = R
dt
t di
L t v
) (
) ( =
∫
=
t
d v
L
t i
0
) (
1
) ( τ τ
dt
t q d
L t v
) (
) (
2
= Ls
The following set of symbols and units are used: v(t) = V (Volts), i(t) = A (Amps), q(t)
= Q (Coulombs), C = F (Farads), R = Ω (Ohms), L = H (Henries).
Series Circuits
i
i
i
R
v L
v
C
v
v
i
Figure 4. In series connection, the current is common.
Parallel Circuits

L
v
L
i
R
C L
+
C
i R
i
C
v
R
v
Figure 5. In parallel connection, the voltage is common.
Complex impedance
ME 413: System Dynamics and Control 67/218 Laboratory Manual
In deriving transfer functions for electrical circuits, we frequently find it convenient
to write the Laplacetransformed equations directly, without writing the differential
equations. Table 1 gives the complex impedance of the basics passive elements
such as resistance R, an inductance L, and a capacitance C. Figure 6(a) shows the
complex impedance in a series circuit while Figure 6(b) shows the transfer function
between the output and input voltage. Remember that the impedance is valid only
if the initial conditions involved are all zeros.
1
Z
2
Z
1
v
2
v
v
(a) Impedance in series arrangement
1
Z
2
Z ) (input v
i
(b) Transfer function in parallel arrangement
) (output v
ο
i i i
) (
) (
2 1
s I
s V
Z Z Z = + =
) ( ) (
) (
) (
) (
2 1
2
s Z s Z
s Z
s V
s V
i
+
=
ο
Figure 6. Complex impedance in electrical circuits
PROBLEM # 1:
In the electrical circuit shown below, ( )
i
e t represents the source (input voltage)
while ( ) e t
ο
represents the response (output voltage).
Figure 7. (a) Circuit for Problem 1. (b) switch closed. (c) switch open
ME 413: System Dynamics and Control 68/218 Laboratory Manual
1. Obtain the differential equation for the output voltage ( ) e t
ο
in Figure 7(a)
when the switch is closed. Notice that numerical values are given for the
resistors but not for the capacitor.
2. Repeat the problem when the left branch is disconnected by opening the
switch.
3. Let the input voltage source ( )
i
e t in Figure 7(a) has a constant value of 24 V
and let C=2F.
a. The switch has been open for all t<0, so there is no initial stored
energy in the capacitor. The switch then closes at t=0. Take Laplace
transform of both sides of the modeling equations obtained in (1) for
t>0, and find ( )
0
E s for all t>0. Notice that ( )
0
E s is the Laplace
transform of ( ) e t
ο
.
b. Obtain the response ( ) e t
ο
.
c. Plot the response ( ) e t
ο
.
d. The switch has been closed for a long time, so that the circuit in the
steady state at t=0. The switch then opens at t=0. Take Laplace
transform of both sides of the modeling equations obtained in (2) for
t>0, and find ( )
0
E s for all t>0. As part of your solution show that the
initial voltage across the capacitor is ( ) ( ) 0 0 9 V
A o
e e − = .
e. Obtain the response ( ) e t
ο
.
f. Plot the response ( ) e t
ο
.
g. Find the time constants for parts (a) and (d) and explain why they are
not the same.
PROBLEM # 2:
In the electrical circuit shown below, ( ) e t represents the source (input voltage)
while
1 2
1 2
2 , 5.5 , F and H.
15 15
R R C L = Ω = Ω = =
1. Obtain the statespace model characterizing the circuit of the Figure shown
below. Take the inductor current and the voltage drop across the capacitor
as the state variables, take the input variable to be the output of the voltage
ME 413: System Dynamics and Control 69/218 Laboratory Manual
source, and take the output variables to be the currents through L and
2
R
respectively.
2. Find the transferfunction matrix relating the output variables
1
y and
2
y to
the input variable u . Thus find the system response to the unit step input
( ) ( ) 1 u t t = , assuming that the circuit is initially in a quiescent state.
( ) e t
2 L
i x =
1
R
2
R
C
L
c
i
1 c
v x =
2
y
1
y
Figure 8. Circuit of Problem # 2.
ME 413: System Dynamics and Control 70/218 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
SIMULATION: ElectroMechanical Systems
EXPERIMENT: Centrifugal Governor
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 71/218 Laboratory Manual
PART I: SIMULATION
ELECTROMECHANICAL SYSTEMS
OBJECTIVE
11. To develop models for electromechanical systems.
12. To obtain the transfer function description of a model.
13. To obtain the block diagram of each components and the overall block
diagram using the block diagram algebra.
14. To apply MATLAB in analyzing the characteristic equation of the transfer
function and obtaining pole locations in sdomain.
15. To apply MATLAB in analyzing transfer function models and obtaining
their response to various types of input functions.
PROBLEM
A DC motor may be used to position the angular attitude of a platform. The
platform may be pointing a telescope at a star, an antenna at a satellite, or a gun at
a target. Since the motor in these cases provides the power to actuate the desired
response, the motor in this role may be called the actuator. There are two ways to
configure a DC motor namely the field controlled DC motor and the armature
controlled DC motor. In this problem, the armature controlled DC motor shown
schematically in Figure 1 is examined.
ο ο
ω θ =
J
a
i K
τ
τ =
a
L
a
R
) (t v
a
ο
θ
v c
K v =
+

a
i
B
Figure 1. Schematic diagram of an armaturecontrolled DCmotor
In this case, the load is the inertia plus friction; the field current is held constant.
The input is the applied voltage ) (t v
a
, the output is the shaft’s angular speed
) ( ) ( t t
ο ο
ω θ =
and
ME 413: System Dynamics and Control 72/218 Laboratory Manual
) (t i
a
: armature current
) (t τ : torque
a
R : armature resistance
a
L : armature inductance
B : viscous damping coefficient
J : motor of inertia of motor and load
τ
K : torque constant
v
K : back emf constant
c
v : back emf of the motor
1. Derive the equations that describe the system (for both mechanical and
electrical part) in function of
a
i ,
ο
ω and
a
v .
2. For zero initial conditions, take Laplace Transform of each of the
previous equations derived in (1).
3. Represent each of the transformed equations in block diagrams showing
the relationship between the input and output of each part of the system.
4. Use the schematic diagram shown in Figure 1 and the block diagram
algebra to obtain the overall block diagram.
5. Obtain the transfer function G(s) relating the input to the output and
write it in the form
den
num
s V
s
s G
a
=
Ω
=
) (
) (
) (
ο
where ) (s
ο
Ω and ) (s V
a
are the Laplace transform of ) (t
ο
ω and ) (t v
a
respectively.
6. Write the previous expression in the standard form
den
num
s V
s
s G
a
=
Ω
=
) (
) (
) (
ο
=
2 2
2
n n
s s
k
ω ξω
ο
+ +
In the above,
ο
k is a constant,
n
ω is the natural frequency of the system,
and ξ is the damping ratio. The denominator of the transfer function is
known as the characteristic equation while the roots of the characteristic
equation are known as the poles.
7. Find
ο
k ,
n
ω and ξ in function of the system parameters, i.e.,
) , , ( J L K f k
a τ ο
= , ) , , , , , (
v a a
K R B J L K f
τ
ξ = , ) , , , , , (
v a a n
K R B J L K f
τ
ω =
8. For each of the following values of
ο
k ,
n
ω and ξ , plot the location of the
poles of the characteristic equation in sdomain. Plot also the
corresponding response ) (t
ο
ω for a given unit step input
ME 413: System Dynamics and Control 73/218 Laboratory Manual
a) ( ) ⇒ = ξ = ω =
ο
0 ; 4 , 0 . 1
n
k no damping
b) ( ) ⇒ = ξ = ω =
ο
1 . 0 ; 4 , 0 . 1
n
k The system is underdamped
c) ( ) ⇒ = ξ = ω =
ο
7 . 0 ; 4 , 0 . 1
n
k The system is underdamped
d) ( ) ⇒ = ξ = ω =
ο
0 . 1 ; 4 , 0 . 1
n
k The system is critically damped
e) ( ) ⇒ = ξ = ω =
ο
0 . 2 ; 4 , 0 . 1
n
k The system is overdamped
9. (Optional) Let the state vector defined by  
a
x i ω =
D
. Derive the state
space model of the above system. Determine the state matrix   A , the
input matrix   B , the output matrix   C , and the direct transmission
matrix   D . In function of the system parameters.
10. (Optional) For the given values of the different parameters expressed in SI
units, 4.0
a
R = Ω, 2.75 H
a
L u = ,
6
3.5077 10 Nms B
−
= × ,
6 2 2
3.2284 10 kg m /s J
−
= × , 0.0274 Nm/Amp K K
τ τ
= = , determine the
eigenvalues of the state matrix   A using MATLAB. (The MATLAB
command is eig(A)).
11. (Optional) Using MATLAB find the transfer function relating the input to
the output from the state space model obtained above. The MATLAB
command is [num,den]=ss2tf(A,B,C,D,1) where 1 here indicates the
number of inputs to the system. Compare this expression of the transfer
function with the one obtained in (5).
12. (Optional) Find the roots of the denominator of the transfer function
(called characteristic equation) obtained in the previous part and
compare them to the eigenvalues of the state matrix   A . What do you
conclude?
MATLAB IMPLEMENTATION
pzmap(num,den) Plot polezero map of continuoustime linear system.
pzmap(num,den) computes the poles and zeros of the siso
polynomial transfer function G(s) = num(s)/den(s) where num
and den contain the polynomial coefficients in descending
powers of s. If the system has more than one output, then the
transmission zeros are computed. pzmap(p,z) plots the poles,
p, and the zeros, z, in the complex plane. p and z must be
column vectors. When invoked with left hand arguments,[p,z] =
pzmap(num,den) or [p,z] = pzmap(A,B,C,D) returns the poles
and transmission zeros of the system in the column vectors p
and z. No plot is drawn on the screen. The function sgrid or
zgrid can be used to plot lines of constant damping ratio and
natural frequency in the s or z plane.
ME 413: System Dynamics and Control 74/218 Laboratory Manual
MATLAB Program for Question # 8
Click at File, New, Mfile
Then write the following program and do not forget to fill the blanks
%
k0=10;wn=4.;
num=[];
den=[  ];
zeta=[0.0 0.1 0.7 1.0 2.0];
t=0.0:0.001:3.0
for i=1:5;
num=ko;
den=[1 2*zeta(i)*wn wn^2];
printsys(num,den)
roots(den)
Omega=step(num,den,t);
subplot(5,2,2*i1);pzmap(num,den);
gtext([‘\xi= ‘, num2str(zeta(i))])
subplot(5,2,2*i);plot(t,Omega)
title(‘Your Full Name and ID#)
end
%
When you finish typing the previous lines:
2 Select in this order: Edit, Select all, Copy
3 At the MATLAB prompt, type
Paste and then press Enter
ME 413: System Dynamics and Control 75/218 Laboratory Manual
PART II: EXPERIMENT
CENTRIFUGAL GOVERNORS
OBJECTIVE
1. To study the dynamic characteristics of a centrifugal governor and to
determine its controlling force at various positions.
2. To compare between the experimental and theoretical values.
INTRODUCTION
Governors are devices that control the rotational speed of engines at a
predetermined level. It senses the change in speed as a result of load variation at
the output engine shaft and automatically compensates by adjusting the fuel
supply to the engine. This selfadjusting system involves certain design criteria that
needs thorough evaluation. These include time response of the governor to the
fluctuation in speed and its stability of operation. These and some other functions
are performed on the Tecquipment TM27 Governor Unit, (Figure 1).
Sleeve
Shaft
Arms
Governor balls
Figure 1. Porter Governor
10 mm
5 mm
ME 413: System Dynamics and Control 76/218 Laboratory Manual
These are of centrifugal type and the one used in this experiment is known as
Porter Governor (see Figure 1) that is almost identical to the original Watt
Governor. The difference is only in the use of heavily weighted sleeves to provide
the controlling force.
DESCRIPTION AND THEORY
The diagrammatic details of a Porter Governor are shown in Figure 2. The force
acting radially inwards on each ball is termed the controlling force. It must increase
in magnitude as the distance of the ball from the axis increases, which would occur
due to the centrifugal effects on the governor balls. At uniform governor ball
revolving speed the centrifugal force on the balls is just balanced by the controlling
force.
α
h
β
r
I
B
D
F
A
α
β
T
2
T
1
Mg/2
Mg mg
C
Figure 2. Diagram representation of one half of a Porter Governor.
The two balls, termed the governor balls, of the centrifugal type governor in the
experiment are caused to revolve about the axis of the shaft. If the weights of the
lower and the upper arms are neglected, the forces acting through the pin joint B
(Figure 2) consists of force F, weight of the ball mg, tensions T1 and T2 and half of
the sleeve load Mg acting pin C. Taking moment about I, the force F is found to be
ME 413: System Dynamics and Control 77/218 Laboratory Manual
(1 ) tan
2
M
F K m g
= + + α
(1)
where m=1.0 kg and M=0.794 kg. In the above
α
β
=
tan
tan
K (2)
Notice that K will have a different value at each radius of rotation of B unless the
upper and lower arms are of equal length and the point A and C are on the
governor axis or equidistant from it.
The centrifugal force is given by
r m F
2
ω = (3)
and
h
r
= α tan (4)
where r is the radius of rotation and h is the height of the governor. The angular
velocity ω of the governor is obtained by equating equations (1) and (3), thus
2
(1 ) 1
2
M g
K
m h
ω = + +
(5)
The two balls, termed the governor balls, of the centrifugal type governor in the
experiment are caused to revolve about the axis of the shaft. If the weights of the
lower and the upper arms are neglected, the forces acting through the pin joint B
(Figure 2) consists of force F, weight of the ball mg, tensions T1 and T2 and half of
the sleeve load Mg acting pin C.
Figure 4 gives a calibration of a spindle scale reading against the governor height h
and the radius of rotating weight r, which remains same for a particular governor
configuration.
The effort of the governor is the force, which it exerts on the sleeve of the
mechanism controlling the energy to supply the engine. For constant speed the
effort is zero. The power of a governor is defined as the work done at the sleeve for a
given percentage change in speed. It is the product of the governor effort and the
displacement of the sleeve.
A governor is said to be stable when for each working speed if there is only one
radius of rotation of the governor balls at which the governor is in equilibrium. A
governor is said to be more sensitive if the change in the speed is smaller for a
given displacement or the sleeve displacement is large for a given change in speed.
ME 413: System Dynamics and Control 78/218 Laboratory Manual
α
r 19
r38
β
h
298
Axis of
rotation
Centerline
s
F
38
19
lolkkk
s
r
s h
r
h
− −
−
= β
298
38
tan
s h − − 298
r −
= α
19
tan
−
Figure 3. Geometric details of the rotating Porter Governor. (Dimensions in mm)
APPARATUS
The tecquipment TM27 governor apparatus in the laboratory consists of basic
mainframe capable of locating different governor mechanisms. The crossbeam is
retained by two thumbnuts. The drive unit consists of a small electric motor
connected through a flexible coupling to a 30:1 worm reduction gearbox.
The governor mechanisms are mounted on their own spindles, which are graduated
at 5 mm intervals to indicate the center sleeve position (Figure 1). The rotating
speeds of the shaft may be estimated by counting the number of revolution with a
stopwatch or by using a stroboscope.
ME 413: System Dynamics and Control 79/218 Laboratory Manual
EXPERIMENTAL PROCEDURE
1. Turn ON the speed control knob.
2. Increase the speed and observe the upward movement (s) of the
sleeve.
3. Adjust the speed of the motor to give a suitable sleeve movement.
A steady state value of the sleeve position is then obtained.
4. Use the stroboscope to determine the corresponding output shaft
speed. Record your readings (sleeve position (s) and the
corresponding speed (N)) in Table 1.
5. Increase the speed (N) and repeat steps (3) and (4) for at least
fifteen readings.
Sample of Calculation
The geometric details of the rotating Porter governor are depicted in Figure 3.
Equation (1) is then modified to express the controlling force F in terms of M,
m, r and h, where M and m are respectively the sleeve and rotating masse in
kg, r is the radius of rotation and h is the height of the governor in mm.
tan
(1 ) tan (1 ) tan
2 2 tan
M M
F K m g m g
β
= + + α = + + α
α
or
( )
( ) ( )
( ) 38 19
1
2 298 19
r r M h
F m g
h s r h
¦ ¹ − −
¦ ¦
= + +
´ `
− − −
¦ ¦
¹ )
(6)
To determine the radius of rotation r and the height of the governor h refer to
Figure 4. For a given value of the spindle sleeve position draw a vertical line.
This line crosses the hand rcurves. Record the obtained values of hand r
in Table 1. The corresponding force F is then calculated from the modified
equation (6) for selected sleeve positions.
For a typical case test where m=1.0 kg and M=0.794 kg and from Figure 4
when s=100 mm, r=147 mm and h=125 mm.
( )
( ) ( )
( ) 147 38 147 19 0.794 125
1 1 9.81
2 298 125 100 147 19 125
19.849
F
F N
¦ ¹ − −
¦ ¦
∴ = + + × ×
´ `
− − −
¦ ¦
¹ )
∴ =
ME 413: System Dynamics and Control 80/220 Laboratory Manual
0 20 40 60 80 100 120 140 160 180
60
80
100
120
140
160
180
200
220
240
h
r
Figure 4. Calibration curve of h and r against spindle scale reading s of a Porter governor configuration.
h scale reading (mm)
r scale reading (mm)
r
a
n
d
h
(
m
m
)
Sleeve scale reading s (mm)
ME 413: System Dynamics and Control 81/220 Laboratory Manual
TABLE 1. Reading and Summary of the results
S
mm
Nm
(Motor)
rpm
Ng (gov)
rpm
r (Fig.4)
mm
h (Fig.4)
mm
F (Eq.6)
N
0 0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
Remember
60
2 N π
= ω and
30
m
g
N
N = where ωis in rad/s and N is in rpm
ME 413: System Dynamics and Control 82/220 Laboratory Manual
REQUIREMENT
GIVEN: Mass of the rotating weight m=1.0 kg
Mass of the weight pan and M=0.794 kg
1. Complete Table 1.
2. Plot the relationship between the speed (N) in rpm and the shaft
graduation s (sleeve position) in mm. The plot should be a smooth curve
(not broken lines). This curve is known as a characteristic curve of sleeve
position (s) against the speed of rotation (N). The data points should be
shown on the plot.
3. Find a best fitting for the previous relation N = N(s).
4. Plot the graph of F (in Newton) against the shaft graduation s (sleeve
position) in mm.
5. Discuss in details the previous results and state your conclusions.
ME 413: System Dynamics and Control 83/218 Laboratory Manual
ME 413: System Dynamics and Control 84/218 Laboratory Manual
PART I: BLOCK DIAGRAMS
OBJECTIVE
To simplify a multipleloop feedback control system to a single block relating the output to
the input by using block reduction rules.
SUMMARY
Table 1. Block Diagram Transformations
Transformation
Original Block Diagram Equivalent Block Diagram
Moving a pickoff
point behind a block
G 1
e
1
e
2
e
Moving a pickoff
point ahead of a block
Moving a summing
point behind a block
G
1
e
3
e
2
e
G / 1
G
1
e
3
e
2
e
G
Moving a summing
point ahead of a block
G 1
e
3
e
2
e
G
1
e
3
e
2
e
Eliminating a
feedback loop
G R C
H
R C
GH
G
+ 1
G 1
e
1
e
2
e
G / 1
G 1
e
2
e
2
e
G
1
e
1
e
2
e
G
Series or cascaded
elements 2
G R
C
1
G
Y
R C
2 1
G G
ME 413: System Dynamics and Control 85/218 Laboratory Manual
MATLAB IMPLEMENTATION
Series Connection
den
num
) (
) (
) ( = =
s R
s C
s T
den1
num1
) (
1
= s G
den2
num2
) (
2
= s G
[num,den]=series(num1,den1,num2,den2)
) (
2
s G
) ( s R ) ( s C
) (
1
s G
Parallel Connection
den
num
) (
) (
) ( = =
s R
s C
s T
den1
num1
) (
1
= s G
den2
num2
) (
2
= s G
[num,den]=parallel(num1,den1,num2,den2)
) (
2
s G
) ( s R
) ( s C
) (
1
s G
Cloop Connection
) (
1
s G ) (s R ) (s C
den
num
) (
) (
) ( = =
s R
s C
s T
den1
num1
) (
1
= s G
[num,den]=cloop(num1,den1,sign)
+1 Positive Feedback
1 Negative Feedback (default)
Feedback Function
ME 413: System Dynamics and Control 86/218 Laboratory Manual
1
G R C
[num,den] = feedback(num1,den1,num2,den2,sign)
+1 Positive Feedback
1 Negative Feedback (default)
) (s G
) (s H
den
num
) (
) (
) ( = =
s R
s C
s T
den1
num1
) ( = s G
den2
num2
) ( = s H
PROBLEM # 1:
Draw the system block Diagram shown in the Figure below and obtain the transfer function
=
( )
( )
( )
X s
G s
F s
b
y
k
M
x
PROBLEM # 2:
1. Draw the system block Diagram shown in the Figure below and obtain the transfer
function
=
( )
( )
( )
o
i
E s
G s
E s
2. Use Matlab to obtain the same transfer function obtained above and plot ( )
o
e t .
ο
( ) e t
1
2 F C = u
2
2 M R = Ω
2
1 F C = u
1
1M R = Ω
x
v
( )
i
e t
10
t
ME 413: System Dynamics and Control 87/218 Laboratory Manual
PROBLEM # 3:
The block diagram of a multipleloop feedback control system is shown in Figure 1.
It is interesting to note that the feedback signal ) ( ) (
1
s C s H is a positive feedback
signal and the loop ) ( ) ( ) (
1 4 3
s H s G s G is called a positive feedback loop.
1
G
2
G
3
G
4
G
2
H
2
H
) (s C ) (s R
2
H
1
H
2
H
3
H
Figure 1. Multipleloop feedback control system
where
6
1
) ( ,
4 4
1
) ( ,
1
1
) ( ,
10
1
) (
4 2
2
3 2 1
+
+
=
+ +
+
=
+
=
+
=
s
s
s G
s s
s
s G
s
s G
s
s G
and
1 ) ( , 2 ) ( ,
2
1
) (
3 2 1
= =
+
+
= s H s H
s
s
s H
1. Use block diagram reduction to simplify this system to a single block relating
C(s) to R(s).
2. Write the explicit expression of the transfer function
den(s)
) ( num
) (
) (
) (
s
s R
s Y
s T = =
3. Use MATLAB functions to carry out the block diagram transformations and
obtain the previous expression of the transfer function T(s). Write the
MATLAB program in your answer sheet.
4. Write the expression of T(s) in an irreducible form by applying the MATLAB
function mineral
[numm,denm] = minreal(num,den), where num and den are row vectors of
polynomial coefficients, cancels the
common roots in the polynomials.
ME 413: System Dynamics and Control 88/218 Laboratory Manual
PART II: DAMPED FREE VIBRATIONS
OBJECTIVE
1. To determine the viscous damping coefficient C as a function of the dashpot
position in a certain dynamic system.
2. To learn how to estimate the damping coefficient C of a dynamic system
experimentally.
A): DESCRIPTION AND THEORY
All systems possessing mass and elasticity are capable of executing free vibrations,
i.e., vibrations that take place with the absence of external excitation. The system
shown in Figure 1 is an example here on. If such an ideal undamped and
frictionless system is given a small displacement, it will continue to oscillate
without stopping. Such an ideal system does not exist in the real life due to the
existence of internal friction between the molecules of the beam’s material, due to
the friction between the oscillating beam and surrounding air and due to the
friction at the supports of the beam. One can easily notice, that any system, when
given a small displacement, its oscillatory motion will decay until it completely dies
out after a while. The rate of decay can be increased by introducing a dashpot with
a damping constant C.
C
k
A
h
l
L
θ
Mass m
Figure 1.
ME 413: System Dynamics and Control 89/218 Laboratory Manual
Consider the dynamic system shown in Figure 1. If the beam was pulled down and
released, the equation of the angular motion becomes
2
2 0
n n
+ + =
θ ζω θ ω θ (1)
where
2
2
n
A
l k
I
= ω (2)
2
2
n
A
Ch
I
= ζω (3)
and
3
3
A
L m
I = (4)
In the above,
n
≡ ω natural frequency of the beam.
k ≡spring stiffness.
A
I ≡mass moment of inertia of the system about (A).
≡ ζ damping coefficient.
The solution of Equation.(1) can be written as
( )
2
sin 1
n
t
n
e t
−
= −
ζω
θ θ ζ ω (5)
in the above equation, the frequency of the damped oscillations can be written as
2
1
d n
= − ω ω ζ (6)
The shape of the oscillatory motion described by equation. (5) above is shown in
Figure. 2.
0 2 4 6 8 10 12
4
3
2
1
0
1
2
3
4
5
t
θ
(
t
)
τ
d
θ
1
θ
2
θ
4
n cycles
t
1
t
2
t
4
θ
n+1
Figure 2. The free damped response of a dynamic system.
ME 413: System Dynamics and Control 90/218 Laboratory Manual
A convenient way of measuring the amount of damping present in the dynamic
system is to measure the decay of the oscillations. The larger the damping, the
greater will be the rate of decay, which is expressed as logarithmic decrement. The
logarithmic decrement is defined as the natural logarithm of the ratio of any two
successive amplitudes, i.e. 1 2 ln( / ) = δ θ θ , as shown in Fig.2. The logarithmic
decrement can be found by any of the following equations:
1 2 ln( / )
n
t = = δ θ θ ζω (7)
or
2
1 1 (1/ )ln( / ) 2 / 1 n n + = = −ζ δ θ θ πζ (8)
Both equations (7) and (8) can be used to evaluate the damping coefficient of any
free vibrating system with damping. Equation (8) is more accurate, since the
determination of δ is very sensitive to any inaccuracy in the amplitude
measurements.
The amount of damping in any dynamic system C is usually assessed by any of the
following equations
2
2
n A
C I h = ζω (9)
or
2
2
A d
C I h = δ τ (10)
where
d
τ
is the damped time period. Both methods used to determine the damping
constant C are supposed to giver similar results.
B): EXPERIMENTAL PROCEDURES
APPARATUS
• A rectangular beam, which supported at one end (A) by a trunion,
pivoted in ball bearings and all located in a fixed housing.
• The outer end of the beam is supported by a helical spring of stiffness k .
• The free vibrations of the system are damped by means of a dashpot, fixed to
the base by sliding bracket. The dashpot consists of a transparent cylindrical
container filled with oil. Inside the container, there are two discs each with
several orifices. The two discs can be rotated relatively to each other to
change the damping characteristics of the dashpot
• The amplitude time recording is provided by the chart recorder, which is
clamped to the right hand upright. The unit consists of a slowly rotating
drum driven by a synchronous motor. The motor is operated from the
ME 413: System Dynamics and Control 91/218 Laboratory Manual
auxiliary supply on the speed control unit. A roll of recording paper is fitted
adjacent to the drum and is wound round the drum so that the paper is
driven at a constant speed. A felttipped pen is fitted to the free end of the
beam and the drum may be adjusted in the horizontal plane so that the pen
just touches the paper. The paper is guided vertically downwards by a small
attachable weight. By switching on the motor, a trace can be obtained
showing the oscillations of the end of the beam.
EXPERIMENTAL PROCEDURES AND REQUIREMENTS
1. Record all dimensions needed for your analysis.
2. Pull the beam downward with the dashpot unattached and release it, while
the drum is rotating. Record the total time required for the motion.
3. Clamp the dashpot at a certain distance h along the beam and pull down on
the free end of the beam and release it. Draw the decaying curve on the
recording drum, while it is rotating.
4. Vary the damping characteristics of the system by moving the dashpot to a
new position and obtain a new record of the decaying curve.
5. Repeat steps 3 & 4 to get the records for 8 different positions of the dashpot.
6. From the resulting plot in step # 2 above, obtain the undamped natural time
period (τ) and based on that calculate the natural (undamped) frequency of
the system ( ) 2
n
= ω π τ .
7. From the resulting plots in steps (3 through 5 above), obtain the damped
natural frequencies ( ) 2
d d
= ω π τ of the system in each case (for each h
length). The damped period
d
τ can be determined by using the decaying
curve drawn on the recording drum. Assuming that the length of n
oscillations is measured to be x and the drum speed is ( ) 0.573in/s
drum
V = ,
then the damped period can be found as:
( )
d drum
x n V = τ
8. Determine the damping constant C of the system in each of the cases using
both equations (7) and (8). (Hint: You can use equation (2) to determine the
spring stiffness k . Assume that the mass of the beam is equal to 5 kg).
DISCUSSION POINTS
1. Discuss how the damping constant C is affected by the position of the
dashpot. Explain that using a graph (C vs.
2
1/ h ).
2. Discuss what are the factors affecting the damping characteristics of a
dashpot when h is constant.
3. Discuss briefly how the parameters , and
n
C ζ ω of equation (9) are affected
by the dashpot position h .
ME 413: System Dynamics and Control 92/218 Laboratory Manual
4. Both Equations (7) and (8) are used to evaluate the damping coefficient ζ of
any damped free dynamic system. Which one of them is more accurate?
Explain why.
5. What would be the reason for any differences in the C value obtained from
Equations (9) and (10)?
ME 413: System Dynamics and Control 93/218 Laboratory Manual
PART III: FORCED VIBRATIONS
OBJECTIVE
1. To determine the natural frequency of a dynamic system using different
methods.
2. To determine the magnification factor ( )
d s
X X .
3. Plotting the response curve of the dynamic system (Amplitude against
excitation frequency).
A): DESCRIPTION AND THEORY
When a system is subjected to an external harmonic excitation, its vibrational
response takes place at the same frequency as that of excitation. Forced vibrations
are produced in operating machines either due to unbalance of some rotating parts,
due to reciprocating motion such as in internal combustion engines or due to
impact and shock effects as in punch presses. The excitations that produce
vibrations are either unwanted, i.e., they occur as a byproduct of the machines
operation or wanted, i.e., they are designed into the system as a part of their
operation such as vibrating screens.
The equation of motion for the dynamic system (Figure 1), when given a small
angular displacement (free vibrations) is:
2 2
1
0
A
I Cl kl θ θ θ + + =
(1)
C
k
A
Electric Motor
with mass M
Beam of
mass m
b
a
l
L
l
1
θ
Figure 1. Setup of the experiment
ME 413: System Dynamics and Control 94/218 Laboratory Manual
where
( )
2 2
* 3
A b
I M a m L = + is the mass moment of inertia of the beam about
point A. The natural frequency of the system described by Equation (1) can be
written as
2
1
n
A
kL
I
= ω (2)
Determination of the undamped natural frequency
n
ω
1. Oscillations Method: (Using a chart recorder)
• The counting of oscillations can be done easily performed by using a chart
recorder.
• The pen is brought into contact with a recording paper, then the system is
displaced angularly.
• A stopwatch is started simultaneously with a chart recorder.
• After a while (3 to 5 seconds) both the step watch and the recorder are
stopped.
• The number of cycles and the corresponding time can be used to determine
the time period (T = total time/number of cycles), which can be used to
determine
n
ω according to the equation
2
n
T
=
π
ω (3)
2. Using the Drum Speed
• Using the oscillations plot made above, the distance (∆) traveled by the
recorder can be easily measured.
• The length of one cycle (∆1= ∆/N) can be used to determine the periodic time
as follows
1 drum
T V = ∆ (4)
where 0.573 in/sec
drum
V = , (The circumferential speed of the drum). Then
the natural frequency can be solved using Equation (4). Theoretically, the
natural frequency can is given by Equation (2), from which the stiffness of
the spring can be found.
ME 413: System Dynamics and Control 95/218 Laboratory Manual
3. Resonance Curve
Using the speed control unit, the rotational speed of the motor can be increased
until resonance occurs. The speed at resonance can be employed to determine the
natural frequency of the system, taking into account the reduction ratio between
the motor and the exciting disks.
If the system shown in figure (1) is subjected to a harmonic force using out of
balance excitation due to the eccentric holes in the disks fixed below the motor, the
equation of motion will have the form:
2 2
1
sin( ) sin( )
A
I k l me a t F a t + = =
θ θ ω ω ω (5)
where m is the mass of the removed material from the disks, e is the eccentricity
and ωis the excitation frequency. The solution for Equation (5) is
( )
( ) ( )
2
2 2
2
1 2
me M r
X
r r
=
− + ζ
(6)
where M is the effective mass of the vibrating system, ( )
n
r = ω ω is the frequency
ratio, X is known as the dynamic amplitude and ζ is the damping ratio , which
can be found using the logarithmic decrement method.
The ratio between the dynamic and static amplitude is defined as the Magnification
factor (MF). The static amplitude can be expressed as ( )
s
X F k = , where
2
F m e = ω is the excitation force that can be adjusted to the value of (0.0005
2
ω )
in this experiment.. Substituting for ( )
2
n
k M = ω and
2
F m e = ω into Equation
(6) and rearrange, one can write:
( )
( ) ( )
2 2
2
1 2
F k
X
r r
=
− + ζ
(7)
If the effect of the exciting force is to be studied, while the system is at rest (no
vibrations) but subjected to an external force equal to
2
F m e = ω , then the ratio
( ) F k can be considered as static deflection or static amplitude of the system.
Equation (7) can be written in the form:
( ) ( )
2 2
2
1
(MF)
1 2
d
s
X
X
r r
= =
− + ζ
(8)
The left hand side of this equation was defined as the experimental magnification
factor, while the right hand side is the theoretical one, which can be determined if
r and ζ are known. The experimental (MF) can be determined if
d
X and
s
X are
known. The dynamic amplitude can be measured using the trace of the beam’s
motion obtained from the chart recorder at a specific frequency. The static
amplitude of the beam’s end can be calculated if a static force equals to the
excitation force
2
F m e = ω is supposed to act upon the system. taking the
moments about the hinge A, the spring’s force can be written as
ME 413: System Dynamics and Control 96/218 Laboratory Manual
2
1
/
s
F m e a L = ω (9)
The deflection of the spring is ( )
2
1
/
s
F k m e a k L ∆ = = ω , from which the static
deflection of the beam’s end would therefore be:
2 2
1
/
s
X m e a L k L = ω (10)
where a , L and
1
L are taken from the geometry as shown Figure (2).
k
A
a
l
L
l
1
2
F m e = ω
s
F
Figure 2.
B): EXPERIMENTAL PROCEDURES
APPARATUS
• Forced vibration tests can be conducted using the Exciter Motor and Control
Unit TM.16f. The motor and its lower beltdriven shaft assembly, can be
transversely clamped onto the beam in any convenient position relative to
the pivot. The slow speed (driven) shaft rotates at approximately (1/3) of the
motor speed and carries an unbalanced disc each end. A plain circular piece
of (Teledeltos paper) can be attached to the light smooth plate, which is
clamped to the front unbalanced disc. An upper pen recorder is supplied,
and this can be clamped to the top member of the basic frame. Its energized
stylus can be brought into contact with the Teledeltos disk to make a
circular trace of the beam vibration. Simple analysis of this trace will reveal
both the amplitude of vibration and the phase difference between the beam
and the unbalanced forced.
• A steel beam nominally 762 x 25.4 x 12.7 mm, is clamped at one end into a
bracket which can be fixed to the side of the basic frame. The beam is free to
pivot in ball bearings in the bracket. The free end of the beam is supported
by any one of the tension springs of TM.16c experiment and uses the same
upper adjustable assembly. The assembly provides a handwheel adjustment
so that the beam can be leveled before test.
ME 413: System Dynamics and Control 97/218 Laboratory Manual
• An electrically energized stylus can be fitted to the free end of the test beam
and continuously traces the vibrations onto a synchronous motor driven
drum recorder, which is also supplied. Amplitude and frequency
measurements can be taken from this permanent (Teledeltos paper) trace.
This can be clamped, on its special bracket, to the side of the basic frame.
The electrical leads from the stylus and recorder can be plugged into sockets
on the basic frame.
• The oil dashpot, which is provided can be clamped anywhere along the test
beam to alter the degree of damping. Rotating the holes of its two drilled
plates relative to each other can also vary the effective area of its piston.
Thus, an approximate total variation in damping of between 0.456 and 1.2
N/ms can be obtained over a distance of 330 mm from the beam pivot.
EXPERIMENTAL PROCEDURES AND REQUIREMENTS
1. Take all dimensions needed for the analysis of the experiment.
2. With the dashpot unattached, make a plot of the system’s amplitude and
find the natural frequency of the system
n
ω (as explained in the theory.
3. Now, connect the dashpot and make a plot of the system’s amplitude and
find the damping ratio ζ of the system. You can use the logarithmic
decrement method. Also, remember that
2
1
d n
= − ω ω ζ .
4. Excite the system by adjusting the motor to a certain speed ω. Make a plot
of the beam’s motion. Increase the excitation frequency of the system ω
gradually in steps and make a plot of the beam’s motion at each speed.
Make sure that the range of the frequencies will include the natural
frequency of the system. Obtain the dynamic amplitude
d
X from the plots in
each case.
5. Calculate the natural frequency of the system using different methods and
compare it with the experimental natural frequency of the system (The speed
at resonance). Which method results in a more accurate value?
6. Plot the experimental resonance curve of the system ( ) MF vs. r . Compare
the experimental curve with the theoretical resonance curve. Note that the
right hand side of Equation (8) represents the theoretical magnification
factor.
DISCUSSION POINTS
1. How accurate were your
n
ω values obtained from the different methods?
2. How does the shape of the resonance curve compare with the theoretical
one?
3. If damping were increased, how would be the shape of the resonance curve
going to be affected?
4. How accurate were your experimental ( ) MF values?
5. How would a stiffer spring affect the magnification factor of the system?
ME 413: System Dynamics and Control 98/218 Laboratory Manual
6. Assuming lager holes are used in the disks, what would be the effect on the
response curve?
C): DATA & RESULTS
Dimensions:
1
..................., ...................
...................., ...................
L I
l a
= =
= =
Mass moment of inertia of the beam about point (A):
( )
2 2
* 3 .....................
A b
I M a m L = + =
Natural frequency of the dynamic system:
2
...................
n
T
= =
π
ω
Damped Natural frequency of the system:
2
2
................... or 1 ...................
d d n
d
T
= = = − =
π
ω ω ω ζ
Spring stiffness:
2
2
1
................
A
n
I
k
L
 
= =

\ .
ω
Damping ratio
ME 413: System Dynamics and Control 99/218 Laboratory Manual
Table 1 Readings and Measurements
No
.
N
(rpm)
( ) 2 60 N = ω π
(rad/s)
( )
2
0.0005
s
X F k k = = ω
(m)
( )
n
r = ω ω
d
X (Theoretical)
Equation(8)
d
X (Experimental
)
1
2
3
4
5
6
7
8
9
10
Note: The reduction ratio of the disk speed to the motor speed is (1/3)
ME 413: System Dynamics and Control 100/218 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
Simulation: Transient Response
Specifications of a 2
nd
Order System
Experiment: Vibrations Absorbers
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 101/218 Laboratory Manual
PART I: TRANSIENT RESPONSE SPECIFICATIONS OF A
SECOND ORDER SYSTEM
OBJECTIVE
To obtain the performance criteria for the transient response specification of a
second order system for a typical input step response.
INTRODUCTION
Assessing the timedomain performance of closedloop system model is important
because control systems are inherently timedomain systems. The performance of
dynamic systems in the time domain can be defined in terms of the time response
to standard test inputs. One very common input to control systems is the step
function. If the response to a step input is known, it is mathematically possible to
compute the response to any input. Another input of major importance is the
sinusoidal function. A sinusoidal steadystate output is obtained when an
asymptotically stable linear system is subjected to a sinusoidal input. Thus, if we
know the response of a linear timeinvariant system to sinusoids of all frequencies,
we have a complete description of the system.
REVIEW AND SUMMARY
The standard form of the secondorder transfer function is given by:
2 2
2
2
) (
n n
n
s s
s G
ω ζω
ω
+ +
=
where
n
ω is the natural frequency. The natural frequency is the frequency of
oscillation if all of the damping is removed. Its value gives us an indication of the
speed of the response. The quantity ζ is the dimensionless damping ratio. The
damping ratio gives us an idea about the nature of the transient response. It gives
us a feel for the amount of overshoot and oscillation that the response undergoes.
The transient response of a practical control system often exhibits damped
oscillations before reaching steady state.
The underdamped response ( ) 1 < ζ to typical inputs, subject to zero initial
conditions, is given by
Input: unit step Output: ( ) θ ω
β
ζω
+ − =
−
t e t c
d
t
n
sin
1
1 ) (
Input: impulse Output: ( ) t e t c
d
t n
n
ω
β
ω
ζω
sin ) (
−
=
where
2
1 ζ β − = and


.

\

=
−
ζ
β
θ
1
tan .
TIME DOMAIN PERFORMANCE SPECIFICATIONS
ME 413: System Dynamics and Control 102/218 Laboratory Manual
The performance criteria that are used to characterize the transient response to a
unit step input are shown graphically in Figure 1 and summarized in Table 1.
p
M
s
t
p
t
r
t
d
t
t
) (t c
tolerance Allowable
0.02
0.1
0.5
0.9
Figure 1. Transient response specifications
TABLE 1. Useful Formulas and Step Response Specifications for the
Linear
SecondOrder Model
) (t f x k x c x m = + + , m, c, k constant
1. Roots
m
mk c c
s
2
4
2
2 , 1
− ± −
=
2. Damping ratio or mk c 2 / = ζ
3. Undamped natural frequency
m
k
n
= ω
4. Damped natural frequency
2
1 ζ ω ω − =
n d
5. Time constant
n
c m ζω τ / 1 / 2 = = if 1 ≤ ζ
6. Logarithmic decrement
2
1
2
ζ
πζ
δ
−
= or
2 2
4 δ π
δ
ζ
+
=
7. Stability Property Stable if, and only if, both roots have negative real
parts, this occurs if and only if , m, c, and k have the same sign.
8. Maximum Percent Overshoot
2
1 /
100
ζ πζ − −
= e M
p
9. Peak time
2
1 / ζ ω π − =
n p
t
10. Delay time 1 0
7 . 0 1
≤ ≤
+
≈ ζ
ω
ζ
n
d
t
11. Settling time
n
s
t
ζω
4
=
ME 413: System Dynamics and Control 103/218 Laboratory Manual
12. Rise time
d
r
t
ω
θ π −
= (See Figure 2)
n
ω
θ
σ −
n
ζω
2
1 ζ ω −
n
d
jω
σ
ω j
o
Figure 2. Definition of the angle θ
PROBLEM # 1:
The following block diagram represents a secondorder system:
) 3 . 0 2 . 0 (
2 . 0
+ s
) (s C
) (s R
4
s
1
Find:
1. The transfer function C(s)/R(s)
2. The natural frequency
3. The damped natural frequency
4. The maximum % overshoot
5. The rise time
6. The peak time
7. The delay time
8. The settling time for 3% settling error
PROBLEM # 2:
For the electrical system shown in the Figure below ) (t v
i
is the input voltage while
) (t v
ο
represents the output voltage. Assuming all initial conditions are zero, find the
following:
1. The transfer function relating the output voltage to the input voltage
2. The natural frequency of the system
3. The damping ratio and the damped natural frequency
4. The values of R that will result in ) (t v
ο
having an overshoot of no more than
25%, assuming ) (t v
i
is a unit step, L=10 mH, and C= 4µF.
ME 413: System Dynamics and Control 104/218 Laboratory Manual
) (t v
ο
R
L
) (t i
ο
) (t v
i
C
PROBLEM # 3:
In the system shown in the Figure below, the mass m = 5 kg is subjected to a force
F(t) acting vertically and undergoing a step change from 0 to 1.0 N at time t = 0.
The response of this system to a step change in force F(t) was found to be very
oscillatory as shown in the Figure. The only measurements obtained were two
successive amplitudes
1
A and
2
A , equal to 55 cm and 16.5 cm, respectively, and
the period of oscillation =
d
τ 1 s.
1. Determine the values of the spring constant k and the coefficient of friction b
in this case.
2. Determine the necessary modification to make the system critically damped.
Sketch the modified system and plot the resulting response.
) (t F
) (t x
k
2 / b 2 / b
m
1
A
2
A
sec 1
sec , Time
cm , Output
ME 413: System Dynamics and Control 105/218 Laboratory Manual
PART II: EXPERIMENT
Undamped Dynamic Vibration Absorbers
OBJECTIVE
1. To demonstrate how a tuned vibration absorber is used to eliminate the
excessive vibrations of a single degree of freedom system
2. To verify the validity of the absorber equations
INTRODUCTION
If a single or a multidegree of freedom system is excited into resonance (the
excitation frequency nearly coincides with the natural frequency of the system),
large amplitudes of vibration result with accompanying high dynamic stresses and
noise and fatigue problems. Excessive vibrations in engineering systems are
generally undesirable and therefore must be avoided for the sake of safety and
comfort. If neither the excitation frequency nor the natural frequency can
conveniently be altered, this resonance condition can often be successfully
controlled. It is possible to reduce the unwanted vibrations by extracting the energy
that causes these vibrations. The extraction of this energy can be established by
attaching to the main vibrating system a dynamic vibration absorber, which is
simply a springmass system. The dynamic vibration absorber is designed such that
the natural frequencies of the resulting system are away from the excitation
frequency.
Machine
1
m
) (
1
t x
2 /
1
k
2 /
1
k
t F ω
ο
sin
Figure 1. Idealization of a machine
ME 413: System Dynamics and Control 106/218 Laboratory Manual
DESCRIPTION AND THEORY
When we attach an auxiliary mass
2
m to a machine of mass
1
m through a spring of
stiffness
2
k , the resulting two degrees of freedom system will look as shown in Figure 2.
The equations of motion of the masses
1
m and
2
m are
( )
( ) 0
sin
1 2 2 2 2
2 1 2 1 1 1 1
= − +
= − + +
x x k x m
t F x x k x k x m
ω
ο
(1)
By assuming a harmonic solution,
t X t x
j j
ω sin ) ( = , j=1, 2 (2)
We can obtain the steadystate amplitude of the masses
1
m and
2
m as we can obtain
2
2
2
2 2
2
1 2 1
2
2 2
1
k m k m k k
F m k
X
− − − +
−
=
) )( (
) (
ω ω
ω
ο
(3)
2
2
2
2 2
2
1 2 1
2
2
k m k m k k
F k
X
− − − +
=
) )( ( ω ω
ο
(4)
Machine
1
m
) (
1
t x
2 /
1
k
2 /
1
k
t F ω
ο
sin
) (
2
t x
2
m
2
k
Dynamic vibration absorber
Figure 2. Undamped dynamic vibration absorber
ME 413: System Dynamics and Control 107/218 Laboratory Manual
We are primarily interested in reducing the amplitude of the machine
1
X . In order to
make the amplitude of
1
m zero, the numerator of Equation (3) should be set equal to
zero. This gives
2
2 2
m
k
= ω (5)
If the machine, before the addition of the dynamic vibration absorber, operates near its
resonance,
1 1
2
1
2
/ m k = ≈ ω ω . Thus if the absorber is designed such that
1
1
2
2 2
m
k
m
k
= = ω (6)
The amplitude of vibration of the machine, while operating at its original resonant
frequency, will be zero. By defining
,
1
k
F
st
ο
δ =
1
1
1
m
k
= ω
as the natural frequency of the machine or main system, and
2
2
2
m
k
= ω (7)
as the natural frequency of the absorber or auxiliary system, Equations (3) and (4) can
be rewritten
1
2
2
2
2
1 1
2
2 1
1 1
1
k
k
k
k
X
st
−


.

\



.

\

−


.

\



.

\

− +


.

\

−
=
ω
ω
ω
ω
ω
ω
δ
(8)
1
2
2
2
2
1 1
2
2
1 1
1
k
k
k
k
X
st
−


.

\



.

\

−


.

\



.

\

− +
=
ω
ω
ω
ω
δ
(9)
Figure (3) shows the variation of the amplitude of vibration of the machine
st
X δ /
1
with
the machine speed
1
/ ω ω . The two peaks correspond to the two natural frequencies of
the composite system. As seen before, 0
1
= X at
1
ω ω = . At this frequency, Equation (9)
gives
2 2
1
2
k
F
k
k
X
st
ο
δ − = − = (10)
This shows that the force exerted by the auxiliary spring is opposite to the impressed
force ( )
ο
F X k − =
2 2
and neutralizes it, thus reducing
1
X to zero. The size of the
dynamic vibration absorber can be found from Equations (10) and (6):
ME 413: System Dynamics and Control 108/218 Laboratory Manual
ο
ω F X m X k − = =
2
2
2 2 2
(11)
Thus the values of
2
k and
2
m depend on the allowable value of
2
X .
It can be seen from Figure 3 that the dynamic vibration absorber, while eliminating
vibration at the known impressed frequency , ω introduces two resonant frequencies
1
Ω and
2
Ω at which the amplitude of the machine is infinite. In practice, the operating
frequency ω must therefore be kept away from the frequencies
1
Ω and
2
Ω .
0.7 0.8 0.9 1.0 1.1 1.2 1.3
Without absorber With absorber
0
4
8
12
16
20
24
2
Ω
1
Ω
2 1
ω ω =
20
1
1
2
=
m
m
st
X δ /
1
1
/ ω ω
Figure 3: Effect of undamped vibration absorber on the response of machine
NOTES
1. The primary system possess now the characteristics of a twodegrees of freedom,
it has two natural frequencies
1
Ω and
2
Ω . The new natural frequencies lie in
the neighborhood of the natural frequency
1
ω of the primary system alone as
shown in Figure 3. It can be seen from Figure 3 that
1
Ω ≤
1
ω ≤
2
Ω . Thus the
machine must pass through
1
Ω during startup and stopping leading to large
amplitude vibrations during these transient periods.
2. Since the dynamic absorber is tuned to one excitation frequency ω , the steady
state amplitude of the machine is zero only at that frequency. If the machine
operates at other frequencies or if the force acting on the machine has several
frequencies, then the amplitude of vibration of the machine may become large.
ME 413: System Dynamics and Control 109/218 Laboratory Manual
3. The preceding analysis is valid only for an undamped system. If damping is
present in the absorber it is not possible to eliminate steady state vibrations of
the original mass. The amplitude of vibration can only be reduced.
EXPERIMENTAL PROCEDURES
The above theory is applied to a simply supported beam carrying a motor with mass
unbalance at its midspan.
APPARATUS
Figure 5 shows a simply supported beam carrying a motor with mass unbalance at its
midspan. The motor is connected to a speed control unit through which the speed of
rotation can be varied. Underneath the motor assembly, the vibration absorber can be
fixed. The vibration absorber comprises two bodies of equal mass fixed at equidistant
position from the midpoint of the horizontal cantilever. In order to measure the
amplitude of vibration an accelerometer can be attached at the beam midspan. The
output of the accelerometer is connected to a vibration meter that will provide reading
of the amplitude of vibration.
PROCEDURE
1. For the simply supported beam and motor assembly, vary the motor speed and
measure the vibration amplitude. From the obtained response you can find the
resonance frequency of the system as a single degree of freedom system.
2. With the aid of the experimentally defined resonance frequency, the dynamic
vibration absorber is to be designed such that the frequency of oscillations is
equal to
3
3
2
1
2 ml
EI
f
π π
ω
= = (12)
where f is natural frequency of the auxiliary system, m is the mass of each of
the two bodies, and EI is the flexural rigidity of the double cantilever beam. The
mass mis a given constant and l is to be found from the above formula.
3. One can easily conclude, that any three parameters of equation (12) can be
fixed, in order to determine the fourth parameter. In this experiment we will
determine the position of the mass m, at which the absorber effect is verified.
Experimentally, one can vary the position of the mass m, and excite the system
at the required excitation frequency until no vibrations of the primary system
are observed, or the position of the mass l can be determined from equation (12),
adjusted accordingly and the absorbing effect can be verified.
4. With the auxiliary system attached, vary the motor speed and record the
corresponding frequency and the resulting amplitude of vibration.
ME 413: System Dynamics and Control 110/218 Laboratory Manual
RESULTS AND DISCUSSION
1. Organize your measurements the vibration amplitudes versus the rotational
speed as shown in Table 1.
2. Plot on the same graph the velocity amplitude versus the rotational speed for
the cases with and without the dynamic vibration absorber.
3. Plot on the same graph the displacement amplitude versus the rotational
speed for the cases with and without the dynamic vibration absorber.
4. Find the length l for which the amplitude of vibration is zero when the absorber
is used using Equation (12).
5. Give a brief discussion of your findings.
6. Briefly state your concluding remarks.
ME 413: System Dynamics and Control 111/218 Laboratory Manual
Accelerometer
Speed Control
a) Simple Instrumentation for determining natural frequencies of a simple support beam.
Vibration Meter
h
b) The dynamic vibration absorber as a double cantilever beam with attached masses.
Electric
Motor
Simply supported rectangular
crosssection steel beam
b
m = 0.17 Kg
h = 1.00 mm
b = 12.00 mm
E = 200 GPa
3
3
2
ml
EI
f = = π ω
3
12
1
bh I =
m m
m m
l
Figure 4:  Setup of the experiment.
ME 413: System Dynamics and Control 112/218 Laboratory Manual
Table1 Readings
With no Absorber With Absorber
#
N
(rpm)
Disp.
Ampl.
(mm)
Vel. Ampl.
(mm/s)
Acc. Ampl.
(mm/s
2
)
Disp.
Ampl.
(mm)
Vel. Ampl.
(mm/s)
Acc. Ampl.
(mm/s
2
)
1 850
2 900
3 950
4 1000
5 1050
6 1075
7 1100
8 1150
9 1200
10 1250
11 1300
12 1325
13 1350
14 1400
15 1450
16 1500
17 1600
18 1700
19 1800
20 1900
21 2000
ME 413: System Dynamics and Control 113/218 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
AIR TEMPERATURE CONTROL
Simulation and Experiment
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 114/218 Laboratory Manual
AIR TEMPERATURE CONTROL
PART I: EXPERIMENT
OBJECTIVE
The ability to accurately control a process is vital to numerous design efforts. For
example, the automatic pilot in an airplane would not prove very useful, and
potentially quite dangerous, if large deviations from the desired path could not be
avoided. The Continuous Process Control laboratory will provide “handson”
experience with proportional control techniques. A performance evaluation of these
methods of control will be conducted.
The process to be controlled in this laboratory session is the temperature of a
flowing fluid (air). The PT326 Process Trainer will be employed in this investigation.
The PT326 is built by Feedback Instruments Limited, and discussed in the
Appendix attached to this experiment.
EQUIPMENT
The PT326 is a selfcontained process control trainer. It incorporates a plant and
control equipment in a single unit. In this equipment, a centrifugal blower draws
air from the atmosphere and forces it through a heater grid. The air temperature is
detected downstream of the grid by a bead thermistor before being returned to the
atmosphere. The detecting (bead thermistor) and correcting (heater) elements have
been placed sufficiently far apart to facilitate the investigation of “lag” time. The air
stream velocity may be adjusted by means of an inlet throttle attached to the
blower. The desired temperature may be set in a range from 30 C
D
to 60 C
D
. A toggle
switch provides an internal step increase to the desired temperature signal. The
PT326 may be configured to run with either open or closedloop control. The
process trainer also allows the connection of an external controller (the PID 150Y).
THEORY
A mathematical model of the temperature response for the system must be
developed. A diagram of the system to be modeled is presented in Figure 1.
( )T C V
p
ρ
T Q C
p
ρ
Figure1. Model of the heaterflow system.
ME 413: System Dynamics and Control 115/218 Laboratory Manual
An energy balance yields
Heat stored = heat in  heat out (1)
Replacing terms of equation (1) by their thermodynamic equivalents yields
( )
p p
d
V C T P C QT
dt
ρ ρ = − (2)
where:
p
C = specific heat of air
Q= flow rate
ρ = density
P = power
V = volume from heater to thermistor
T = temperature above ambient
Combining terms yields the first order differential equation for the exhaust
temperature:
1
p
dT Q
T T P
dt V VC ρ
= = − +
(3)
Solving equation (3) yields
( ) ( )
t t
f f
T t T T e T
τ
−  
−

\ .
= − +
D
D
(4)
Taking Laplace Transform of both sides of equation (3) gives:
1
( ) ( )
p
Q
sT s T s P
V VC ρ
 
= − +

\ .
Factoring and arranging in standard form then gives
1
1
p
VC
T
Q P
s
V
ρ
=
 
− +

\ .
(5)
which can be represented by the following block diagram?
 
+1 s
G
K
p
p
τ
) (s R ) (s C
) (s G
) (s E
Figure 2. Simplified closed loop model
ME 413: System Dynamics and Control 116/218 Laboratory Manual
where:
τ = the time constant of the plant
( ) C s = Laplace transform of the response temperature
( ) E s = the deviation of the output temperature from the desired
temperature
p
G = the steady sate gain of the heater system
p
K = proportional gain
( ) R s = Laplace transform of the desired output temperature
One case of closedloop control will be investigated: proportional control (P). For the
analysis of the steadystate accuracy of the control, an equation to describe the
system steadystate error, ) (s E , is first developed. The following set of equations
may be written from the block diagram of Figure 2.
) ( ) ( ) ( s C s R s E − = (6)
) ( ) ( ) ( s C s R s E − = (7)
Equations (5) and (6) can be combined to yield the error, ) (s E
) ( 1
) (
) (
s G
s R
s E
+
= (8)
The final value theorem is now used to determine the steadystate accuracy.
) ( lim
0
s sE e
s
ss
→
= (9)
The subscript ss has been used to denote a steadystate condition. If the input is
taken as a unit step function, s s R 1 ) ( = , equation (8) may be written as
( ) ) ( lim 1
1
0
s G
e
s
ss
→
+
= (10)
where
 
+
=
1
) (
s
G
K s G
p
p
τ
(11)
with proportional control only Ki and Kd are zero and equation (9) becomes
p p
ss
G K
e
+
=
1
1
………(12)
For the proportional control only condition, the closedloop transfer function, T(s),
may be written
ME 413: System Dynamics and Control 117/218 Laboratory Manual
1
1
1
) (
+
+
+
=
s
G K
G K
G K
s T
p p
p p
p p
τ
………(13)
The denominator of equation (13) is first order. Hence, oscillations are not
anticipated for proportional control.
PROCEDURE
Note: Kp=100% Proportional
Therefore, a 100% proportional setting provides a gain of one to the deviation
signal.
A. Open Loop Response without a Proportional Controller
a) Make the following connections on the PT326:
● Turn Proportional control off
● Turn Continuous control on
● No jumper between X and Y (open loop)
● Put a jumper between socket A and B (to complete the circuit).
b) Set the blower intake to 40.
c) Set temperature value to 30 C
D
d) Connect the output socket ‘Y’ to oscilloscope. Use a pigtail or banana
plug to do this and connect the other terminal to the ground. Also
connect the socket “trigger CRO” to the oscilloscope and the terminal
to the ground. This will measure the input impulse.
e) Give input impulse using the ‘internal’ switch and observe the
response on the oscilloscope.
f) Measure the time constant, steadystate value (gain) and steadystate
Time using the oscilloscope.
g) Measure the steadystate error. (This is read directly from the
difference in the values of ‘set value’ and ‘measured value’ of the
temperature when the internal switch is put ON.)
B. Open Loop Response with Proportional Controller
a) Make the following connections on the PT326:
● Turn Proportional control ON
● Keep Continuous control ON
● No jumper between X and Y (open loop)
● Remove the jumper that was put between A and B.
b) Repeat (b) through (g) as in (A) for Proportional Controller value of
ME 413: System Dynamics and Control 118/218 Laboratory Manual
200%, 150%, 100%, 50% and 30%.
C. ClosedLoop Feedback Response with Proportional Controller
a) Make the following connections on the PT326:
● Turn Proportional control ON
● Keep Continuous control ON
● Jumper between X and Y (closed loop)
b) Set the blower intake to 40.
c) Set temperature value to 30 C
D
.
d) Connect the output socket ‘Y’ to oscilloscope. Use a pigtail or banana
plug to do this and connect the other terminal to the ground.
e) Give input impulse using the ‘internal’ switch and observe the
response on the oscilloscope.
f) Measure the time constant, steadystate value (gain), steadystate
time and steadystate error. Repeat with proportional gain of 200%,
150%, 100%, 50% and 30%.
ME 413: System Dynamics and Control 119/218 Laboratory Manual
PART II: SIMULATION
Simulation: Proportional Control
Our first set of simulations will consist of examining the effect of proportional
control on our system. We want to examine the effect of a change in the setpoint
temperature. We will consider the effect of changing the setpoint temperature from
30 C
D
to 60 C
D
. (above the ambient temperature) after 1 second. We will use this
same desired temperature trajectory throughout this simulation exercise.
1. Write a Matlab script this simulation for the following cases:
a) Kp=0.1
b) Kp=0.25
c) Kp=0.75
d) Kp=2.25
2. Plot the obtained time response for each of the previous case. Note how
the measured (simulated) response compares to the desired response (a
step function).
3. Discuss how the SteadyState Error depends on the value of Kp
(Proportional Gain).
4. How does the measured temperature compare to the desired temperature
at steadystate? Was this expected? For the open loop and closed loop?
5. What is the effect of increasing the proportional gain on system
response? For the open loop and closed loop?
6. Assuming no oscillations and proportional control only (closedloop),
what must the gain be in order to reduce the steadystate error to zero
(theoretically)?
7. From the Matlab plots obtained make an analysis on how steadystate
error depends on the value of Kp (proportional gain).
8. What is the time constant and steadystate gain of the closedloop system
at 100% gain? How does the time constant and steadystate gain vary
with change in proportional control?
9. Write your observation on how the percentage overshoot and steadystate
error (from the oscilloscope) depend on varying the proportional gain.
Does the pattern of variation match with the theory? (Hint: What is the
theory to describe overshoot in a 1
st
order system?)
ME 413: System Dynamics and Control 120/218 Laboratory Manual
APPENDIX: DEFINITIONS
Figure .3 represents the basic components of a closedloop process control system.
Figure .3 Basic elements of a closedloop process control system.
The following list provides the definition of terms and information adapted from the
PT326 Process Trainer Manual:
Process: The term process is used to describe a physical or chemical change or the
conversion of energy. The temperature of air flowing in a tube is the process this
laboratory is concerned with.
Detecting Element: The detecting element is a bead thermistor connected to one
leg of a bridge.
Measuring Element: The resistances of the thermistor changes as the temperature
of its surroundings change. This change in resistance causes the bridge output
voltage to change. Thus, the bridge output voltage may be used to measure
temperature.
Measured Value, qo: This is the voltage signal from the measuring element which
corresponds to the value of the controlled condition.
Set Value, qi: This is the desired value of the controlled condition. The set value
may be adjusted using a turn pot on the front panel or externally by providing a
voltage between 0 and 10 volt to socket D. A decrease in voltage at socket D will
cause a rise in process temperature.
Deviation, D: The deviation, D, is the difference of the measured value and the
desired value.
D = qo  qi
ME 413: System Dynamics and Control 121/218 Laboratory Manual
Set Value Disturbance: A step change in the desired value may be introduced
when the INTERNAL SET VALUE DISTURBANCE is applied.
Comparing Element: The measured value from the bridge and the set value are
compared with a summing amplifier. The internal signals of this equipment have
been arranged to be of opposite sign. Therefore, the output from the summing
amplifier represents a deviation. Socket B on the front panel may be use to
monitor this deviation.
Controlling Element: A signal proportional to deviation is applied to the
controlling element. A correcting signal is generated and sent to the correcting
element. The PT326 is capable of continuous or twostep control.
Continuous Control Mode
1) Internal This provides proportional control only. Proportional
control may be varied on the PT326 from 5 to 200 percent. Where the
percent proportional control reflects the gain applied to the deviation
signal.
Gain=100/% Proportional
Therefore, a 100% proportional setting provides a gain of one to the
deviation signal.
2) External The internal proportional band adjustment can be
switched off to allow external control.
Motor Element: The motor element produces an output which is adjusted in
response to the signal from the controlling element. In the PT326, the motor
element supplies power(between 15 and 80 watts) to the correcting element.
Correcting Element: The correcting element directly affects the controlled
condition. The correcting element in the PT326 is a wire grid, which heats the
flowing air.
ME 413: System Dynamics and Control 122/218 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
Simulation: Liquid Level Systems
Experiment: Coupled Tanks
i) Basic Tests and Transducer Calibration
ii) Open and Closed Loop Systems
ME 413: System Dynamics and Control 123/218 Laboratory Manual
LIQUIDLEVEL SYSTEMS
PART I: SIMULATION
OBJECTIVE
1. To develop models for liquidlevel systems containing one or more
storage compartments.
2. To obtain the transfer function description of the model.
3. To obtain the block diagram of each components and the overall
block diagram using the block diagram algebra.
4. To apply MATLAB in analyzing transfer function models and
obtaining their response to various types of input functions.
REVIEW AND SUMMARY LIQUIDLEVEL SYSTEM ELEMENTS
Resistance and Capacitance of Liquid Level Systems
Consider the flow through a short pipe connecting two tanks. The resistance
for liquid flow in such a pipe or restriction is defined as the change in the
level difference (the difference of the liquid levels of the two tanks) necessary
to cause a unit change in flow rate; that is,
s
R
/ m
m
rate flow in Change
difference level in Change
Resistance
3
≡ =
h H +
i
q Q +
R Resistance
ο
q Q +
Control valve
C e Capacitanc
valve Load
Figure 1. Liquid level system
For laminar flow; ( 2000 Re < ), the relationship between the steadystate flow
rate and steady state head at the level of restriction is given by
H K Q
l
=
where
ME 413: System Dynamics and Control 124/218 Laboratory Manual
Q = steadystate liquid flow rate, s / m
3
l
K = constant, s / m
2
H = steadystate head, m
Then
Q
H
K Q
H
R
l
l
= = =
1
d
d
For turbulent flow; ( 3000 Re > ), the steadystate flow rate is given by
H K Q
t
=
where
Q = steadystate liquid flow rate, s / m
3
t
K = constant, s / m
2.5
H = steadystate head, m
The resistance
t
R for turbulent flow is obtained from
Q
H
R
t
d
d
=
Then
Q
H
H Q
H
Q
H
H
K
H
Q
H
H
K
Q
t t
2
) / (
2
d
d
2
d
d
d
2
d = = ⇒ = ⇒ =
Thus
Q
H
R
t
2
=
The capacitance of a tank is defined to be the change in quantity of stored
liquid necessary to cause a unity change in the potential (head). The
potential (head) is the quantity that includes the energy level of the system).
2
3
m or
m
m
head in Change
stored liquid in Change
e Capacitanc ≡ = C
MATLAB IMPLEMENTATION
impulse Impulse response of continuoustime linear systems.vectors.
impulse(num,den) plots the impulse response of the polynomial
transfer function G(s) = num(s)/den(s) where num and den
contain the polynomial coefficients in descending powers of s.
When invoked with left hand arguments, [y,x,t] =
impulse(num,den,t) returns the output and state time history in
the matrices y and x. No plot is drawn on the screen. Y has as
ME 413: System Dynamics and Control 125/218 Laboratory Manual
many columns as there are outputs and length(t) rows. x has as
many columns as there are states.
PROBLEM
The Figure below shows a system of coupled tanks. The input flow is
i
q
while the output flow is .
ο
q
1
h
i
q
2
C
2
h
1
R
2
R
ο
q
Inflow
1
q
1
C
Figure 1: Two tanks liquid level system representation.
1. Derive an equation for each of the three subsystems (the two tanks
and the outflow) and put them into block diagram form.
2. Combine the three diagrams to form a single block diagram of the
overall system.
3. Obtain the transfer function relating the input ) (s Q
i
to the output
) (s Q
ο
.
4. If in normalized units, , 1
2 1
= = C C , 1
2 1
= = R R and , 1
2 1
= = h h plot ) (
2
t h and
) (t q
ο
for the following cases:
a. ) (t q
i
is a unit step input
b. ) (t q
i
is an impulsive input
5. Repeat question (4) for the case where , 5 . 0
2 1
= = C C , 2
2 1
= = R R and
. 1
2 1
= = h h Compare the resulting responses to the previous ones.
6. In each of the previous cases, obtain the steady state value ) (
2
t h and
) (t q
ο
.
MATLAB PROGRAM
File, New, Mfile
Then write the following program and do not forget to fill the blanks
%
num=[]; den=[  ];
%
subplot(211);step(num,den)
subplot(212);impulse(num,den)
When you finish typing the program select in this order: Edit, Select all, Copy
At the MATLAB prompt, type Paste and then press Enter
ME 413: System Dynamics and Control 126/218 Laboratory Manual
PART II: Experiment
1) Basic Tests and Transducer Calibration
2) Open and Closed Loop Systems
ME 413: System Dynamics and Control 127/218 Laboratory Manual
ME 413: System Dynamics and Control 128/218 Laboratory Manual
ME 413: System Dynamics and Control 129/218 Laboratory Manual
ME 413: System Dynamics and Control 130/218 Laboratory Manual
ME 413: System Dynamics and Control 131/218 Laboratory Manual
ME 413: System Dynamics and Control 132/218 Laboratory Manual
ME 413: System Dynamics and Control 133/218 Laboratory Manual
ME 413: System Dynamics and Control 134/218 Laboratory Manual
ME 413: System Dynamics and Control 135/218 Laboratory Manual
ME 413: System Dynamics and Control 136/218 Laboratory Manual
ME 413: System Dynamics and Control 137/218 Laboratory Manual
ME 413: System Dynamics and Control 138/218 Laboratory Manual
ME 413: System Dynamics and Control 139/218 Laboratory Manual
ME 413: System Dynamics and Control 140/218 Laboratory Manual
ME 413: System Dynamics and Control 141/218 Laboratory Manual
ME 413: System Dynamics and Control 142/218 Laboratory Manual
ME 413: System Dynamics and Control 143/218 Laboratory Manual
ME 413: System Dynamics and Control 144/218 Laboratory Manual
ME 413: System Dynamics and Control 145/218 Laboratory Manual
ME 413: System Dynamics and Control 146/218 Laboratory Manual
ME 413: System Dynamics and Control 147/218 Laboratory Manual
ME 413: System Dynamics and Control 148/218 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
Simulation: PID Controllers
Experiment: Coupled Tanks
i) PI Controller Tuning 1 :Hand Tuning of Single Tank
ii) PI Controller Tuning 2 :Hand Tuning of Double Tank
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 149/218 Laboratory Manual
PID CONTROLLERS
PART I: SIMULATION
OBJECTIVE
To recognize the different types of controllers and to illustrate the differences
between them in terms of percent overshoot, settling time, steady state errors…etc.
INTRODUCTION
Using a control signal that is proportional to the error cannot be expected to
result in good damping and fast response and may have unacceptable
steadystate error. Introducing an integral term in the controller can
eliminate steady state errors but may adversely affect the damping. A term
proportional to the derivative of the error can improve the speed of the
response and the damping, but it will not reduce steady state errors. A
controller that combines all three terms, known as a proportionalIntegral
Derivative (PID) controller can provide significant improvements in response
time, damping, and steadystate error reduction.
REQUIREMENTS
The dynamic equations of a DC motor considered in electromechanical systems can
be expressed as
a t m m m
i K b J = + θ θ
(1)
and
a a a
a
a m e
v i R
dt
di
L K = + + θ
(2)
In the above, the input is the voltage
a
v and the output is the shaft speed .
m
θ
1. Define the output to be ( )
m
y θ
= , write equations (1) and (2) based on this
assumption.
2. Write the transfer function in the form
( )( ) s s
A
s V
s Y
s G
a 2 1
1 1 ) (
) (
) (
τ τ + +
= = (3)
where ) (s Y and ) (s V
a
are the Laplace transform of ) (t y and ) (t v
a
. The
quantities A,
1
τ and
2
τ are constants to be determined. Note that if 0 = b and
a
L is small then
a
R L /
2 2
= τ is called the electrical time constant while
m t m a
K K J R /
1
= τ is called the mechanical time constant.
ME 413: System Dynamics and Control 150/218 Laboratory Manual
The transfer function in equation (3) is labeled “Motor” in Figure 1 and shows an
openloop control.
Controller
Y(s)
Reference
speed, R(s)
Motor
( )( ) s s
A
2 1
1 1 τ τ + +
) (s V
a
Figure 1. Openloop control system.
The block diagram in Figure 2 shows a closed loop system and includes a feedback
sensor. In this case the sensor is a tachometer, which is usually a small permanent
magnet DC machine that produces a voltage proportional to the shat speed ( )
m
y θ
= .
_
+
Controller Y(s)
Reference
speed, R(s)
Motor
( )( ) s s
A
2 1
1 1 τ τ + +
) (s V
a
Sensor
11
Y(s)
) (s E
a
Figure 2. Feedback speed control system.
The controller in Figure 2 is an electronic device whose input is the error signal
given by
) ( ) ( ) ( s Y s R s E − = (4)
which is the difference between the voltages that represent the reference speed r
and the motor speed y. The output of the controller is the actuating voltage
a
V ,
which is the input to the motor. For a specific motor, it was found
that: 10 sec, 600 / 1 sec, 60 / 1
2 1
= = = A τ τ and ( ) ), ( 1 * 100 t t r = where ) ( 1 t is the unit step
function.
3. If the controller is a proportional controller whose transfer function is given
by
( )
( )
( )
p
a
a
c
K
s E
s V
s G = = (5)
find the closed loop transfer function ) ( / ) ( s R s Y . By using MATLAB plot the
response y(t) for 5 , 1 = =
p p
K K and 10 =
p
K . Compare the three plots, and
write your remarks when
p
K increases (in terms of overshoot, settling time,
rise time, steady state error …etc).
ME 413: System Dynamics and Control 151/218 Laboratory Manual
4. If the controller is a proportionalplusintegral (PI) controller whose transfer
function is given by
( )
( )
( )


.

\

+ = =
s T
K
s E
s V
s G
i
p
a
a
c
1
1 (6)
find the closed loop transfer function ) ( / ) ( s R s Y . By using MATLAB plot the
response y(t) for 01 . 0 , 005 . 0 , 5 = = =
i i p
T T K and 02 . 0 =
i
T . Compare the three
plots, and write your remarks when
i
T increases and
p
K is held constant.
(in terms of overshoot, settling time, rise time, steady state error …etc).
5. If the controller is a proportionalplusintegralplusderivative (PID)
controller whose transfer function is given by
( )
( )
( )


.

\

+ + = = s T
s T
K
s E
s V
s G
d
i
p
a
a
c
1
1 (7)
find the closed loop transfer function ) ( / ) ( s R s Y . By using MATLAB plot the
response y(t) for , 01 . 0 , 5 = =
i p
T K and 0004 . 0 , 0002 . 0 = =
d d
T T and 004 . 0 =
d
T
Compare the three plots, and write your remarks when
d
T increases and
p
K and
i
T are held constant. (in terms of overshoot, settling time, rise time,
steady state error …etc).
6. Compare the responses obtained in parts (3), (4) and (5) in terms of the
steady state error
ss
e , and the transient response.
MATLAB
®
IMPLEMENTATION
In the MATLAB prompt click at : File ⇒ New ⇒ Mfile
You will get a new window into which you will write the following program and do
not forger to fill the blanks:
%
tau1=1/60; tau2=1/600;
A=10.0;
t=0.0:0.0001:0.015;
%
numg=[A];
deng=[(tau1*tau2) (tau1+tau2) 1];
%
%+
% Case 1: Proportional Controller +
%+
%
kp=[1 5 10];
%
for i=1:length(kp)
[nums,dens]=series(kp(i),1,numg,deng);
ME 413: System Dynamics and Control 152/218 Laboratory Manual
[num,den]=cloop(nums,dens);
[y,x]=step(num*100,den,t);
ys(:,i)=y;
end
%
hold on
%
subplot(311);plot(t,ys(:,1),t,ys(:,2),t,ys(:,3));
%
%+
% Case 2: ProportionalplusIntegral Controller +
%+
%
kp=5;
Ti=[0.005 0.01 0.02];
%
for i=1:length(Ti)
numc=[.......... ..........];
denc=[.......... ..........];
[nums,dens]=series(numc,denc,numg,deng);
[num,den]=cloop(nums,dens);
[y,x]=step(num*100,den,t);
ys(:,i)=y;
end
%
subplot(312);plot(t,ys(:,1),t,ys(:,2),t,ys(:,3));
%
%+
% Case 3: ProportionalplusIntegralplusDerivative Controller +
%+
%
kp=5;
Ti=0.01;
Td=[0.0002 0.0004 0.004];
%
for i=1:length(Td)
numc=[.......... .......... ..........];
denc=[.......... .......... ..........];
[nums,dens]=series(numc,denc,numg,deng);
[num,den]=cloop(nums,dens);
[y,x]=step(num*100,den,t);
ys(:,i)=y;
end
%
subplot(313);plot(t,ys(:,1),t,ys(:,2),t,ys(:,3));
hold off
When you finish typing the program Select in this order: Edit ⇒ Select all ⇒ Copy
At the MATLAB prompt, type Paste and then press Enter
ME 413: System Dynamics and Control 153/218 Laboratory Manual
PART II: Experiment
3) PI Controller Tuning 1: Hand Tuning of Single
Tank
4) PI Controller Tuning 2: Hand Tuning of Double
Tank
ME 413: System Dynamics and Control 154/218 Laboratory Manual
ME 413: System Dynamics and Control 155/218 Laboratory Manual
ME 413: System Dynamics and Control 156/218 Laboratory Manual
ME 413: System Dynamics and Control 157/218 Laboratory Manual
ME 413: System Dynamics and Control 158/218 Laboratory Manual
ME 413: System Dynamics and Control 159/218 Laboratory Manual
ME 413: System Dynamics and Control 160/218 Laboratory Manual
ME 413: System Dynamics and Control 161/218 Laboratory Manual
ME 413: System Dynamics and Control 162/218 Laboratory Manual
ME 413: System Dynamics and Control 163/218 Laboratory Manual
ME 413: System Dynamics and Control 164/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
Simulation: Steady State Error and System Type
Experiment: Servo Trainer
i) Response Calculating and Measurements
ii) Proportional Control of Servo Trainer Speed
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 165/220 Laboratory Manual
PART I: Steady State Error and System
Type
OBJECTIVE
1. To introduce the concept of steadystate error and to show its importance in
the stability of a control system.
2. To calculate the steady state error for a certain class of inputs, namely, step
(positional), ramp (velocity) and parabolic (acceleration) inputs.
INTRODUCTION
Steady state errors constitute an extremely important aspect of system
performance, for it would be meaningless to design for dynamic accuracy if the
steady output differed substantially from the desired value for one reason or
another. The steadystate error is a measure of system accuracy. These errors arise
from the nature of inputs, type of system and from nonlinearities of system
components such as static friction, backlash, etc. The steadystate performance of
a stable control system is judged not only by the transient response, but also by
steadystate error. The steady –state error is the error as the transient response
decays leaving only the continuous response. The steadystate error for a control
system is classified according to its response characteristics to a polynomial input.
A system may have no steadystate error to a ramp input. This depends on the type
of the openloop transfer function.
Consider a unity feedback system shown in Figure 1. The input is R(s) and the
output is C(s), the feedback signal H(s) and the difference between input and output
is the error signal E(s).
C(s)
R(s)
_ +
) (s G
E(s)
H(s)
Figure 1. Unity feedback system.
The closedloop transfer function is
) ( 1
) (
) (
) (
s G
s G
s R
s C
+
=
The error of the closed loop system is
) ( 1
) (
) ( ) ( ) (
s G
s R
s C s R s E
+
= − =
Using the final value theorem, we have
ME 413: System Dynamics and Control 166/220 Laboratory Manual
) ( 1
) (
lim ) ( lim ) ( lim
0 0
s G
s sR
s sE t e e
s s t
ss
+
= = =
→ → ∞ →
For the polynomials inputs, such as step, velocity and acceleration, the steady
state error is summarized in Table 1.
TABLE 1 Steadystate error in closed loop systems
Positional input Velocity input Acceleration input
T
y
p
e

0
s
y
s
t
e
m
T
y
p
e

1
s
y
s
t
e
m
T
y
p
e

2
s
y
s
t
e
m
) ( lim
0
s G K
s
p
→
= ) ( lim
0
s sG K
s
v
→
= ) ( lim
2
0
s G s K
s
a
→
=
c(t)
t
∞ =
ss
e
v
ss
K
A
e =
c(t)
t
t A t r = ) (
0 =
ss
e
t
c(t)
∞ =
ss
e
c(t)
t
∞ =
ss
e
t
c(t)
a
ss
K
A
e =
c(t)
t
2
2
1
) ( t A t r =
p
ss
K
A
e
+
=
1
c(t)
t
A t r = ) (
0 =
ss
e
t
c(t)
0 =
ss
e
c(t)
t
ME 413: System Dynamics and Control 167/220 Laboratory Manual
PROBLEM 1
Given the unity feedback control system of Figure 1, where
( ) a s s
K
s G
+
= ) (
find the following:
a. K and a to yield 1000 =
v
K and 20% overshoot
b. K and a to yield a 1% error in the steady state and a 10% overshoot
PROBLEM 2
Given the system in the Figure below, find the following:
C(s)
R(s) _ +
_
+
( ) 1
1
2
+ s s ( ) 3
1
2
+ s s
s / 1
a. The closed loop transfer function
b. The system type
c. The steady state error for an input of 5 u(t)
d. The steady state error for an input of 5 t u(t)
e. Discuss the validity of your answers to parts (c) and (d).
PROBLEM 3
For the system shown in the figure below
C(s) R(s)
_ +
( ) 2
) 1 (
2
+
+
s s
s K
( ) 3
4
+
+
s
s
1. What is the system type?
2. What is the appropriate static error constant?
3. What is the value of the appropriate static error constant?
4. What is the steadystate error for a unit step input?
5.
Discuss the validity of your answers.
ME 413: System Dynamics and Control 168/220 Laboratory Manual
PART II: Experiment
1) Response Calculating and Measurements
2) Proportional Control of Servo Trainer Speed
ME 413: System Dynamics and Control 169/220 Laboratory Manual
ME 413: System Dynamics and Control 170/220 Laboratory Manual
ME 413: System Dynamics and Control 171/220 Laboratory Manual
ME 413: System Dynamics and Control 172/220 Laboratory Manual
ME 413: System Dynamics and Control 173/220 Laboratory Manual
ME 413: System Dynamics and Control 174/220 Laboratory Manual
ME 413: System Dynamics and Control 175/220 Laboratory Manual
ME 413: System Dynamics and Control 176/220 Laboratory Manual
ME 413: System Dynamics and Control 177/220 Laboratory Manual
ME 413: System Dynamics and Control 178/220 Laboratory Manual
ME 413: System Dynamics and Control 179/220 Laboratory Manual
ME 413: System Dynamics and Control 180/220 Laboratory Manual
ME 413: System Dynamics and Control 181/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
ROOT LOCUS
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 182/220 Laboratory Manual
PART I: ROOT LOCUS
OBJECTIVE
1. The main objective of this chapter is that students master rules for
drawing control system root loci and develop a feeling for the shape of the
root loci as functions of system static gain K.
2. Sketch by hand the major features of a root locus plot for a given transfer
function.
3. Use MATLAB to plot and analyze root locus plots.
DEFINITION
This chapter deals with the rootlocus method developed by W. R. Evans. The root
locus method enables us to find the closedloop poles from the open loop poles for
the values of the gain of the open loop transfer function. The rootlocus of a system
is a plot of the roots of the system characteristic equation as the gain factor K is
varied. It is important to know how to construct the rootlocus by hand, so one can
design a simple system and be able to understand and develop the computer
generated loci.
ROOT LOCUS METHOD
Consider the feedback control system given in Figure 1.
K G(s)
H(s)
C(s)
R(s)
_
+
Figure 1. Control system for root locus.
The closedloop transfer function for this system is
) ( ) ( 1
) (
) (
) (
) (
s H s KG
s KG
s R
s C
s T
+
= = (1)
In general, the open loop transfer function is given by
( )( ) ( )
( )( ) ( )
n
m
p s p s p s
z s z s z s K
s H s KG
+ + +
+ + +
=
...
...
) ( ) (
2 1
2 1
(2)
ME 413: System Dynamics and Control 183/220 Laboratory Manual
Where m is the number of finite zeros and n is the number of finite poles of the loop
transfer function. If n>m, there are (nm) zeros at infinity.
The characteristic equation of the closedloop transfer function is
0 ) ( ) ( 1 = + s H s KG (3)
or
1 ) ( ) ( − = s H s KG (4)
Therefore
( )( ) ( )
( )( ) ( )
K
z s z s z s
p s p s p s
m
n
− =
+ + +
+ + +
...
...
2 1
2 1
(5)
From (5), it follows that for a point in the splane to be on the rootlocus, when
, 0 ∞ < < K it must satisfy the following two conditions:
Magnitude Criterion:
zeros finite from lengths vector of Product
poles finite from lengths vector of Product
= K (6)
Angle Criterion:
From equation (5),
  π φ ) 1 2 ( ) ( ) ( + = = A s H s KG angle , A =0, 1, 2, 3, (7)
which can be expressed in the form
( ) ( ) ... ... ) 1 2 (
3 2 1 3 2 1
+ + + − + + + = + =
p p p z z z
φ φ φ φ φ φ π φ A (8)
or
( ) ( )
∑ ∑
− = + = poles of angles zeros of angles π φ ) 1 2 ( A (9)
ROOT LOCUS RULES SUMMARY
1. The root locus starts at the openloop poles ) 0 ( = K .
2. The root locus ends at the openloop zeros ) ( ∞ = K .
3. The root locus is composed of n branches.
4. The root locus is symmetrical with respect to the real axis.
5. The root locus can exist on the real axis only to the left of an odd number of
real poles and/or zeros; furthermore, it must exist there.
6. Angles of asymptotes:
ME 413: System Dynamics and Control 184/220 Laboratory Manual
( )
,..., 2 , 1 , 0 ,
1 2
=
−
+
= A
A
A
z p
n n
π
θ
7. Intersection of the asymptotes:
z p
n
i
n
i
i i
n n
z p
p
z
−
−
=
∑ ∑
= = 1 1
σ
8. The Routh Hurwitz test produces information about the points of
intersection of the root locus and the imaginary axis.
9. The necessary condition for the breakaway points:
( ) 0 ) ( ) ( = s H s G
ds
d
MATLAB IMPLEMENTATION
The Control System Toolbox functions for root locus are:
rlocus(num,den): calculates and plots the root locus of the system defined
by the transfer function with numerator num and
denominator den for a vector of values of K that is
automatically determined.
[K, poles]=rlocfind(num,den): to obtain a crosshair cursor which you can move
by means of the mouse (or arrow keys on some
computers), to any point on the root locus. Moving it to
any point on the locus and clicking the mouse (or hitting
a key on some computers) causes MATLAB to display the
value of K that places a closedloop pole at that point
and the location of all closedloop poles corresponding to
that value of K. Clicking at a different location will
display that value of K and the location of the
corresponding closedloop poles. Note you may not be
able to click exactly where you want. The computer
maps the cursor position onto a rather coarse grid on its
screen.
sgrid generates a grid over an existing continuous splane root
locus or polezero map. Lines of constant damping ratio
ξ and natural frequency
n
ω are drawn in.
ILLUSTRATIVE EXAMPLE
1. Sketch by hand the rootlocus for K > 0 for a system whose openloop
transfer function is given below
( )( )( ) 12 19 8 4 3 1
) ( ) (
2 3
+ + +
=
+ + +
=
s s s
K
s s s
K
s H s G
ME 413: System Dynamics and Control 185/220 Laboratory Manual
2. Use MATLAB to sketch the rootlocus. Compare the two sketches.
SOLUTION
1. Poles are 4 and , 3 , 1 − = − = − = s s s . Therefore, the number of poles 3 =
p
n ,
while the number of zeros 0 =
z
n .
2. The root loci on the real axis are to the left of an odd number of finite poles
and zeros.
3. Because 3 = p n , there are 3 branches each one starts at ) 0 ( = K and ends at
) ( ∞ = K .
4. The asymptotes intersect on the real axis at
667 . 2
0 3
0 ) 4 3 1 (
1 1
− =
−
− − − −
=
−
−
=
∑ ∑
= =
z p
n
i
n
i
i i
n n
z p
p z
σ
5. The angle of asymptotes
( ) ( )
¦
¦
¹
¦
¦
´
¦
⇒ − = + ≡ =
− = − ≡ =
≡ =
≡ =
=
+
=
−
+
=
repeated is it because here stop 60 3 / 2 3 / 7
60 3 / 5
180
60 3 /
3
1 2 1 2
3
2
1
0
ο
ο
ο
ο
π π π θ
π π θ
π θ
π θ
π π
θ
A A
A
z p
n n
6. Breakaway point on the real axis is given by
0
12 19 8 d
d
d
d
2 3
= 
.

\

+ + +
− =
s s s
K
s s
K
The roots of this equation are 55 . 3
1
− = s and 78 . 1
2
− = s but 55 . 3 − = s is not
part of the root locus for K>0, therefore the breakaway point is at 78 . 1 − = s
7. The Routh array gives the location of the ω j crossing.
s
3
1 19
s
2
8 12+K
s
1
(140K)/8 0
s
0
19 0
Therefore K = 140. Substitute in the auxiliary equation and solve
( )
rad/sec 36 . 4
36 . 4
0 140 12 8
2
= ⇒
± = ⇒
= + +
ω
j s
s
8. The root locus sketch is shown in Figure 2
4. MATLAB PROGRAM
The following lines
ME 413: System Dynamics and Control 186/220 Laboratory Manual
» num=1;
» den=conv([1 1],conv([1 3],[1 4]));
» rlocus(num,den)
produce the graph shown in Figure 3.
ω j
σ
o
1
2 3 4 6 5 1 0 2
3 4
2.66
1.78
36 . 4 = ω
36 . 4 − = ω
0 = K
0 = K 0 = K
Figure 2. Root –locus sketch
ME 413: System Dynamics and Control 187/220 Laboratory Manual
6 5 4 3 2 1 0 1 2
4
3
2
1
0
1
2
3
4
Real Axis
I
m
a
g
A
x
i
s
Figure 3. Rootlocus sketch generated by MATLAB
PROBLEM
1. Sketch by hand the rootlocus for K > 0 for a system whose openloop
transfer function is given below
( )( )( ) 4 3 2
) 1 (
) ( ) (
+ + +
+
=
s s s s
s K
s H s G
2. Use MATLAB to sketch the rootlocus. Compare the two sketches.
ME 413: System Dynamics and Control 188/220 Laboratory Manual
PART II: The Ball Beam Apparatus
Basic Tests and Familiarization
ME 413: System Dynamics and Control 189/220 Laboratory Manual
ME 413: System Dynamics and Control 190/220 Laboratory Manual
ME 413: System Dynamics and Control 191/220 Laboratory Manual
ME 413: System Dynamics and Control 192/220 Laboratory Manual
ME 413: System Dynamics and Control 193/220 Laboratory Manual
ME 413: System Dynamics and Control 194/220 Laboratory Manual
ME 413: System Dynamics and Control 195/220 Laboratory Manual
ME 413: System Dynamics and Control 196/220 Laboratory Manual
ME 413: System Dynamics and Control 197/220 Laboratory Manual
King Fahd University of Petroleum & Minerals
College of Engineering Sciences
Mechanical Engineering Department
ME 413: System Dynamics & Control
Simulation: Frequency Response
Analysis: Bode Plot
Experiment: The Ball & beam
Student Name:_________________________________________________________
Section#:__________________________________________________________________
Student ID#:____________________________________________________________
Date:_________________________________________________________________________
Instructor:________________________________________________________________
ME 413: System Dynamics and Control 198/220 Laboratory Manual
PART I: Frequency Response Analysis
Bode Plot
OBJECTIVE
2. To introduce graphical methods such as Bode plot in the prediction of the
frequency response analysis.
2. To calculate performance specifications in the frequency domain.
FREQUENCY RESPONSE
The frequency response of a linear timeinvariant system is defined as the steady
state response of the system to a sinusoidal input signal. The sinusoidal is a
unique input signal, and the resulting output signal for a linear system, as well as
signals throughout the system is sinusoidal in the steady state; it differs from the
input waveform only in amplitude and phase angle. For example, consider the
system ) ( ) ( ) ( s R s G s C = with ). sin( ) ( t A t r ω = We have
2 2
) (
ω
ω
+
=
s
A
s R (1)
and
∏
=
+
= =
n
i
i
p s
s m
s q
s m
s G
1
) (
) (
) (
) (
) ( (2)
Then, in partial fraction form,
.
) (
...
) (
) (
2 2
1
1
ω
β α
+
+
+
+
+ +
+
=
s
s
p s
k
p s
k
s C
n
n
(3)
If the system is stable, then all
i
p have negative nonzero real parts and
∞ → t
limL ( )   0 /
1
= +
−
i i
p s k (4)
in the limit, for ), (t c we obtain for ∞ → t ( the steady state)
 
  ) ( sin ) (
) ( sin ) (
1
) (
2 2
1
ω ω
ω ω ω
ω
ω
β α
Φ + =
Φ + =
+
+
=
−
t jw G A
t jw G A
s
s
L t c
(5)
ME 413: System Dynamics and Control 199/220 Laboratory Manual
where the transfer function ) ( ω j G is obtained by substituting ω j for s in the
expression of ). (s G The resulting transfer function may be written in polar form as
) ( ) ( ) ( ω ω ω Φ ∠ = j G j G (6)
Alternatively, the transfer function can be represented in rectangular complex form
as
) ( ) ( ) ( Im ) ( Re ) ( ω ω ω ω ω j jX j R j G j j G j G + = + = (7)
The most common graphical representation of a frequency response function is the
Bode plot.
DECIBEL
The Bode magnitude plots are frequently plotted using the decibel logarithmic scale
to display the function ) ( ω j G . The decibel is defined in terms of the base 10
logarithm of the power ratio of two electrical signals, or as the ratio of the square of
the amplitudes of two signals. It is defined as
dB


.

\

=


.

\

=
ο ο
X
X
X
X
log 20 log 10
2
(8)
where
ο
X is a specified reference voltage. In practice, Equation (8) is also used for
expressing the ratios of other quantities such as displacements, velocities,
accelerations, and pressures.
DECADE
The decade is a frequency band (range) from
1
f to
2
f such that 10 /
1 2
= f f . Thus the
frequency band from 3 . 0
1
= f cps to 0 . 3
1
= f cps is one decade, and the frequency
band from 10 cps to 100 cps is also one decade. The number of decades from
1
f to
2
f is ( ). / log
1 2
f f
BODE PLOT
The Bode plot consists of two graphs plotted on semilog paper with linear vertical
scales and logarithmic horizontal scales. The first graph is a plot of the magnitude
of a frequency response function ) ( ω j G in decibels versus the logarithm of , ω the
frequency.
) ( log 20 ) ( ω ω j G j G
dB
= (9)
The second graph of a Bode plot shows the phase function ) (ω Φ versus the
logarithm of . ω
) ( ) ( ω ω j G ∠ = Φ (10)
ME 413: System Dynamics and Control 200/220 Laboratory Manual
The logarithmic representation is useful in that it shows both the low and high
frequency characteristics of the transfer function in one diagram. Furthermore, the
frequency response of a system may be approximated by a series of straightline
segments. In simple terms, the Bode plot has the following features:
1. Since the magnitude of ) ( ω j G in the Bode plot is expressed in dB, product
and division factors in ) ( ω j G became additions and subtractions,
respectively. The phase relations are also added and subtracted from each
other algebraically.
2. The magnitude plot of the Bode plot of ) ( ω j G can be approximated by
straightline segments, which allow the simple sketching of the plot without
detailed computation.
GAIN AND PHASECROSSOVER POINTS
The gaincrossover point (or points) is where the magnitude curve
dB
j G ) ( ω
crosses the 0dB axis. The phasecrossover point (or points) is where the
phase curve crosses the
ο
180 axis (see Figure 1).
GAIN AND PHASE MARGINS
The gain margin is found by using the phase plot to find the frequency, ,
M
G
ω where
the phase angle is
ο
180 . At this frequency look at the magnitude plot to determine
the gain margin,
M
G , which is the gain required to raise the magnitude curve to 0
dB. The phase margin is found by using the magnitude curve to find the frequency,
,
M
Φ
ω where the gain is 0 dB. On the phase curve at that frequency, the phase
margin, ,
M
Φ is the difference between the phase value and
ο
180 .
Magnitude
(dB)
0 dB
M
G
ω
Gain
plot
Phase
plot
Phase (degrees)
ο
180
M
G
ω
M
Φ
ω
M
Φ
Gain
crossover
Phase
crossover
ω
Figure 1. Gain and phase margins on the Bode diagrams
ME 413: System Dynamics and Control 201/220 Laboratory Manual
STEPS TO CONSTRUCT THE BODE MAGNITUDE PLOT
1. Factor the numerator and denominator of the transfer function into the
constant, first order, and quadratic terms in the form described in Table 1.
2. Identify the break frequency associated with each factor.
3. Plot the asymptotic form for each of the factors on semilog axes.
4. Graphically add the component asymptotic plots to form the overall plot in
straightline form.
5. “Round out” the corner sin the straightline approximate curve by hand using
the known values of the responses at the break frequencies ( ± 3dB/dec for first
order sections, and dependent upon ξ for quadratic factors).
The phase plot is constructed by graphically adding the component phase
responses. The individual plots are drawn, either as the piecewise linear
approximation for the firstorder poles or in a smooth form from the exact plot, and
then added to find the total phase shift at any frequency.
SUMMARY
The asymptotic forms of the seven components of the magnitude plot are summarized
in Table 1.
MATLAB IMPLEMENTATION
The Control System Toolbox functions for Bode plots are:
[mag,phase]=bode(num,den,w) Determines the magnitude and phase of the
transfer function defined by the vectors num and
den, which contain the coefficients of the
numerator and denominator polynomials of the
transfer function.
bode(num,den,w) or bode(num,den) generates a semilogarithmic plot of
magnitude ) ( ω j G in decibels versus ω and a
separate semilogarithmic plot of the phase angle
  ) ( arg ω j G in degrees versusω .
[Gm,Pm,Wcg,Wpc]=margin(num,den) returns the gain, phase margins, gain
crossover and phase crossover for a system
in sdomain transfer function form
(num,den).
[Gm,Pm,Wcg,Wpc]=margin(mag,phase,w) returns the gain and phase margins
given the Bode magnitude, phase, and
frequency vectors mag, phase, and w from
a system. When invoked without left hand
arguments, margin(mag,phase,w) plots
ME 413: System Dynamics and Control 202/220 Laboratory Manual
the Bode plot with the gain and phase
margins marked with a vertical line. The
gain margin, Gm, is defined as 1/G where
G is the gain at the 180 phase frequency.
20*log10(Gm) gives the gain margin in dB.
ME 413: System Dynamics and Control 203/220 Laboratory Manual
TABLE 1. Summary of asymptotic magnitude Bode plot parameters for the most basic blocs
Description
Transfer Function ) ( ω j G
Corner Frequency
(rad/s)
Magnitude
dB
j G ) ( ω
Phase ) ( ω j G ∠
Constant gain: K None = 20 log K
0 , 180
0 , 0
<
>
K
K
ο
ο
Poles or zeros at
the origin of
order p
p
j
±
) ( ω None
= 0 for 1 = ω ,
Straight lines of constant slope
p 20 ± dB/dec
ο
90 × ± p
Simple pole
) 1 /( 1 + ωτ j τ / 1
Straight line of 0 dB/dec for , / 1 τ ω <
Straight line of slope –20 dB/dec for
τ ω / 1 >
) ( tan
1
ωτ
−
−
Real zero
1 + ωτ j τ / 1
Straight line of 0 dB/dec for , / 1 τ ω <
Straight line of slope 20 dB/dec for
τ ω / 1 >
) ( tan
1
ωτ
−
Conjugate poles 2
2
) ( ) ( 2 1
n n
n
j
ω
ω
ω
ω
ξ
ω
− +
n
ω
Straight line of 0 dB/dec for ,
n
ω ω <
Straight line of slope – 40 dB/de for
n
ω ω >




.

\

−
−
−
2
1
) ( 1
) ( 2
tan
n
n
ω
ω
ω
ω
ξ
Conjugate zeros


.

\

− +
2
2
) ( ) ( 2 1
1
n n n
j
ω
ω
ω
ω
ξ
ω
n
ω
Straight line of 0 dB/dec for ,
n
ω ω <
Straight line of slope 40 dB/de for
n
ω ω >




.

\

−
−
2
1
) ( 1
) ( 2
tan
n
n
ω
ω
ω
ω
ξ
ME 413: System Dynamics and Control 204/220 Laboratory Manual
ILLUSTRATIVE EXAMPLE:
Draw by hand the Bode plot for the transfer function
) 64 2 . 3 )( 5 . 0 (
) 2 ( 64
) (
2
+ + +
+
=
s s s s
s
s G
Check your answer by using MATLAB. Find also a) the gain crossover and the
phase crossoverb) the phase margin and the gain margin.
SOLUTION
1. Rearrange the transfer function ) (s G in the standard form
) 64 / 05 . 0 1 )( 2 1 (
) 2 / 1 ( 64
) (
2
s s s s
s
s G
+ + +
+
=
2. Substitute ω j s = in ) (s G
( )
2
4(1 0.5 )
( )
( )(1 2 ) 1 2 0.2( / 8) ( / 8)
j
G j
j j j
ω
ω
ω ω ω ω
+
=
+ + × −
3. The factors of this transfer function in order to their occurrence as
frequency increases are:
* Constant gain, K = 4,
* Zero at 2 − = s ; corner frequency 2 5 . 0 / 1
2
= = ω
* Pole at origin, ω j / 1 ,
* Pole at 5 . 0 − = s ; corner frequency 5 . 0 2 / 1
1
= = ω *
Pair of complex conjugate poles with ; 8 , 2 . 0 = =
n
ω ξ corner frequency
8
3
= ω
4. The characteristics of each factor of the transfer function are given in
Table 2
TABLE 2. Asymptotic approximation table for construction of Bode plot of
( )
2
4(1 0.5 )
( )
( )(1 2 ) 1 2 0.2( / 8) ( / 8)
j
G j
j j j
ω
ω
ω ω ω ω
+
=
+ + × −
Factor
Corner
Frequency
(rad/s)
Asymptotic logmagnitude
Characteristic
Phase angle
characteristic
4 None 20 log 4=12.04
ο
0
ω j / 1
None
Straight line of constant slope –20
dB/dec passing through
1 = ω
ο
90 −
) 2 1 /( 1 ω j + 5 . 0 2 / 1
1
= = ω
Straight line of 0 dB/dec for ,
1
ω ω <
Straight line of slope – 20 dB/dec for
1
ω ω >
) 2 ( tan
1
ω
−
−
ω 5 . 0 1 j + 2 5 . 0 / 1
2
= = ω
Straight line of 0 dB/dec for ,
2
ω ω <
Straight line of slope 20 dB/dec for
) 5 . 0 ( tan
1
ω
−
ME 413: System Dynamics and Control 205/220 Laboratory Manual
2
ω ω >
2
)
8
( )
8
( 2 . 0 2 1
1
ω ω
− × + j
2 . 0
8
3
=
=
ξ
ω
Straight line of 0 dB/dec for ,
3
ω ω <
Straight line of slope – 40 dB/de for
3
ω ω >




.

\

−
−
−
2
1
)
8
( 1
)
8
( 4 . 0
tan
ω
ω
5. Construct the log magnitude versus ω of each of the previous factors.
20dB/dec −
40dB/dec −
20dB/dec −
60dB/dec −
Figure 2. Bode plot of
( )
2
4(1 0.5 )
( )
(1 2 ) 1 2 0.2( / 8) ( / 8)
j
G j
j j j
ω
ω
ω ω ω ω
+
=
+ + × −
6. Construct the phase versus ω by adding each of the previous phase
factors, i.e.,
) ( ) ( ω ω j G ∠ = Φ =
ο
90 − ) 2 ( tan
1
ω
−
− + ) 5 . 0 ( tan
1
ω
−




.

\

−
−
−
2
1
)
8
( 1
)
8
( 4 . 0
tan
ω
ω
Accordingly, prepare a table for which you calculate ) (ω Φ in function of
, ω and then plot the obtained values.
ME 413: System Dynamics and Control 206/220 Laboratory Manual
MATLAB PROGRAM
The following program is provided to you to check the validity of the
previous example. Any of the previous commands can be applied in order
to determine the Bode plot (magnitude and phase).
num=64*[1 2];
den=conv([1 0],conv([1 0.5],[1 3.2 64]));
bode(num,den)
This will result in the graph given by Figure 3. In order to determine the
gain crossover, the gain margin, the phase crossover and the phase
margin, the following lines can be added at the MATLAB prompt
clg
margin(num,den)
These statements produce the plots shown in Figure 4.
Figure 3. Bode plot for the previous example.
ME 413: System Dynamics and Control 207/220 Laboratory Manual
Figure 4. Gain margin Gm, phase margin Pm, and associated frequencies
Wcg and Wcp
PROBLEM TO BE SOLVED IN CLASS
1. Draw by hand the Bode plot for the transfer function
) 1 5 . 0 5 . 0 )( 2 (
) 3 ( 10
) (
2
+ + +
+
=
s s s s
s
s G
1. Check your answer by using MATLAB. Find also:
a) the gain crossover and the phase crossover
b) the phase margin and the gain margin
ME 413: System Dynamics and Control 208/220 Laboratory Manual
PART II: The Ball and Beam Apparatus
Proportional Control of Beam Angle and
Manual Control of Ball Position
ME 413: System Dynamics and Control 209/220 Laboratory Manual
ME 413: System Dynamics and Control 210/220 Laboratory Manual
ME 413: System Dynamics and Control 211/220 Laboratory Manual
ME 413: System Dynamics and Control 212/220 Laboratory Manual
ME 413: System Dynamics and Control 213/220 Laboratory Manual
ME 413: System Dynamics and Control 214/220 Laboratory Manual
ME 413: System Dynamics and Control 215/220 Laboratory Manual
ME 413: System Dynamics and Control 216/220 Laboratory Manual
ME 413: System Dynamics and Control 217/220 Laboratory Manual
ME 413: System Dynamics and Control 218/220 Laboratory Manual
ME 413: System Dynamics and Control 219/220 Laboratory Manual
ME 413: System Dynamics and Control 220/220 Laboratory Manual