Linear Control Systems Lab Manual
Linear Control Systems Lab Manual
CISE 302
Linear Control Systems
Laboratory Manual
Systems Engineering Department
Semester 083
2 Lab Experiment 1: Using MATLAB for Control Systems
Table of Contents
Lab Experiment 1: Using MATLAB for Control Systems ................................................................................ 4
Part I: Introduction to MATLAB ................................................................................................................. 4
Part II: Polynomials in MATLAB ............................................................................................................... 15
Part III: Scripts, Functions & Flow Control in MATLAB ............................................................................ 20
Laboratory Experiment 2: Mathematical Modeling of Physical Systems ................................................... 27
Mass‐Spring System Model ................................................................................................................. 27
Speed Cruise Control example: ........................................................................................................... 29
Mass‐Spring System Example: ............................................................................................................ 30
Exercises .................................................................................................................................................. 32
Laboratory Experiment 3: Linear Time‐invariant Systems and Representation ......................................... 33
Mass‐Spring System Model ................................................................................................................. 33
Transfer Function: ............................................................................................................................... 34
Linear Time‐Invariant Systems in MATLAB: ........................................................................................ 34
Examples of Creating LTI Models ........................................................................................................ 34
Simulation of Linear systems to different inputs .................................................................................... 36
Exercises ..................................................................................................... Error! Bookmark not defined.
Lab Experiment 4: Block Diagram Reduction .............................................................................................. 40
Lab Experiment 5: Performance of First order and second order systems ................................................ 47
Lab Experiment 6: DC Motor Characteristics .............................................................................................. 52
Model of the armature‐controlled DC motor: ........................................................................................ 53
Model Simulation using Simulink: ........................................................................................................... 54
Parameter Identification: ........................................................................................................................ 60
Lab Experiment 7: Validation of DC Motor Characteristics ........................................................................ 64
Model validation: .................................................................................................................................... 64
Nonlinear characteristics ........................................................................................................................ 67
Lab Experiment 8: Effect of Feedback on disturbance & Control System Design ...................................... 70
Lab Experiment 9: Effect of Feedback on disturbance & Control System Design of Tank Level System .... 73
Lab Experiment 10: Introduction to PID controller .................................................................................... 75
Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor ........................................ 83
Lab Experiment 12: PID Controller Design for Two Tank System ............................................................... 89
Semester ‐ 083 Page 2
3 Lab Experiment 1: Using MATLAB for Control Systems
Part – I: Design of Proportional Control in the PID Controller ................................................................ 91
Part – II: Design of Integral Part in the PID Controller ............................................................................ 94
Lab Experiment 13: Simple Speed Control of DC Motor ............................................................................. 96
Semester ‐ 083 Page 3
4 Lab Experiment 1: Using MATLAB for Control Systems
CISE 302
Linear Control Systems
Lab Experiment 1: Using MATLAB for Control Systems
Objectives: This lab provides an introduction to MATLAB in the first part. The lab also
provides tutorial of polynomials, script writing and programming aspect of MATLAB from
control systems view point.
List of Equipment/Software
Following equipment/software is required:
MATLAB
Category Soft-Experiment
Deliverables
A complete lab report including the following:
___________________________________
___________________________________
___________________________________
___________________________________
Reference: Engineering Problem Solving Using MATLAB, by Professor Gary Ford, University of California, Davis.
___________________________________
Semester ‐ 083 Page 4
5 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
Topics ___________________________________
Introduction
Plotting
___________________________________
___________________________________
___________________________________
Introduction
___________________________________
What is MATLAB ?
• MATLAB is a computer program that combines computation and
visualization power that makes it particularly useful tool for
engineers. ___________________________________
• MATLAB is an executive program, and a script can be made with a
list of MATLAB commands like other programming language.
MATLAB Stands for MATrix LABoratory. ___________________________________
• The system was designed to make matrix computation particularly easy.
___________________________________
___________________________________
MATLAB
Environment ___________________________________
To start MATLAB:
START PROGRAMS
MATLAB 6.5 MATLAB ___________________________________
6.5
Or shortcut creation/activation
on the desktop
___________________________________
___________________________________
___________________________________
___________________________________
Semester ‐ 083 Page 5
6 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
Semester ‐ 083 Page 6
7 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
Variables ___________________________________
Variable names:
Must start with a letter
May contain only letters, digits, and the underscore “_” ___________________________________
Matlab is case sensitive, i.e. one & OnE are different variables.
Matlab only recognizes the first 31 characters in a variable name.
Assignment statement:
Variable = number;
___________________________________
Variable = expression;
Example: NOTE: when a semi-colon
>> tutorial = 1234;
”;” is placed at the end of ___________________________________
>> tutorial = 1234
tutorial = each command, the result
1234 is not displayed.
___________________________________
___________________________________
___________________________________
Variables (con’t…)
___________________________________
Special variables:
ans : default variable name for the result
pi: = 3.1415926…………
variables.
clear name: clears the variable name
___________________________________
clc: clears the command window
clf: clears the current figure and the graph window.
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
Semester ‐ 083 Page 7
8 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
Vectors ___________________________________
A row vector in MATLAB can be created by an explicit list, starting with a left bracket,
entering the values separated by spaces (or commas) and closing the vector with a right
bracket.
A column vector can be created the same way, and the rows are separated by semicolons.
Example:
___________________________________
>> x = [ 0 0.25*pi 0.5*pi 0.75*pi pi ]
x=
0 0.7854 1.5708 2.3562 3.1416 x is a row vector. ___________________________________
>> y = [ 0; 0.25*pi; 0.5*pi; 0.75*pi; pi ]
y=
0
0.7854 y is a column vector.
1.5708 ___________________________________
2.3562
3.1416
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
dot (x, y) returns the scalar dot product of the vector x and y.
___________________________________
___________________________________
___________________________________
Semester ‐ 083 Page 8
9 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
Matrices ___________________________________
A Matrix array is two-dimensional, having both multiple rows and multiple columns,
similar to vector arrays:
it begins with [, and end with ]
spaces or commas are used to separate elements in a row ___________________________________
semicolon or enter is used to separate rows.
•Example:
A is an m x n matrix. >> f = [ 1 2 3; 4 5 6] ___________________________________
f=
1 2 3
4 5 6
>> h = [ 2 4 6
1 3 5] ___________________________________
h=
2 4 6
1 3 5
the main diagonal
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
Semester ‐ 083 Page 9
10 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
Semester ‐ 083 Page 10
11 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
Example:
>> x = [ 1 2 3 ];
___________________________________
>> y = [ 4 5 6 ];
Each element in x is multiplied by
>> z = x .* y the corresponding element in y.
z=
4 10 18 ___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
Solutions to Systems of Linear Equations
(con’t…)
___________________________________
Solution by Matrix Inverse: Solution by Matrix Division:
Ax = b The solution to the equation
A-1Ax = A-1b Ax = b
x = A-1b can be computed using left division.
___________________________________
MATLAB: MATLAB:
>> A = [ 3 2 -1; -1 3 2; 1 -1 -1]; >> A = [ 3 2 -1; -1 3 2; 1 -1 -1];
>> b = [ 10; 5; -1]; >> b = [ 10; 5; -1];
>> x = inv(A)*b >> x = A\b ___________________________________
x= x=
-2.0000 -2.0000
5.0000 5.0000
-6.0000 -6.0000 ___________________________________
Answer: Answer:
x1 = -2, x2 = 5, x3 = -6 x1 = -2, x2 = 5, x3 = -6
NOTE: ___________________________________
left division: A\b b A right division: x/y x y
___________________________________
Semester ‐ 083 Page 11
12 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
Plotting ___________________________________
For more information on 2-D plotting, type help graph2d
Plotting a point: the function plot () creates a
>> plot ( variablename, ‘symbol’) graphics window, called a Figure
window, and named by default
“Figure No. 1” ___________________________________
Example : Complex number
>> z = 1 + 0.5j;
>> plot (z, ‘.’)
___________________________________
commands for axes:
command description
___________________________________
axis ([xmin xmax ymin ymax]) Define minimum and maximum values of the axes
axis square Produce a square plot
axis equal equal scaling factors for both axes
axis normal
axis (auto)
turn off axis square, equal
return the axis to defaults
___________________________________
___________________________________
___________________________________
semilogy (x,y) – generate a plot of the values of x and y using a linear scale
for x and a logarithmic scale for y. ___________________________________
loglog(x,y) – generate a plot of the values of x and y using logarithmic scales
for both x and y
___________________________________
___________________________________
___________________________________
___________________________________
vectors. Two curves will be plotted: y vs. x, and z vs. w.
legend (‘string1’, ‘string2’,…) – used to distinguish between plots on the
___________________________________
same graph
___________________________________
Semester ‐ 083 Page 12
13 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
___________________________________
rescaled when necessary.
hold off – release the current figure window for new plots
___________________________________
Grids and Labels:
Command Description
grid on Adds dashed grids lines at the tick marks ___________________________________
grid off removes grid lines (default)
grid toggles grid status (off to on, or on to off)
title (‘text’) labels top of plot with text in quotes
xlabel (‘text’) labels horizontal (x) axis with text is quotes ___________________________________
ylabel (‘text’) labels vertical (y) axis with text is quotes
text (x,y,’text’) Adds text in quotes to location (x,y) on the current axes, where (x,y) is in
units from the current plot.
___________________________________
___________________________________
Semester ‐ 083 Page 13
14 Lab Experiment 1: Using MATLAB for Control Systems
___________________________________
color of the point or curve Marker of the data points Plot line styles
Symbol Color Symbol Marker Symbol Line Style
___________________________________
y yellow . – solid line
m magenta o : dotted line
c cyan x –. dash-dot line
r red + + –– dashed line ___________________________________
g green *
b blue s □
w white d ◊
k black
^
v
___________________________________
h hexagram
___________________________________
___________________________________
Semester ‐ 083 Page 14
15 Lab Experiment 1: Using MATLAB for Control Systems
Objective: The objective of this session is to learn how to represent polynomials in MATLAB,
find roots of polynomials, create polynomials when roots are known and obtain partial fractions.
Polynomial Overview:
MATLAB provides functions for standard polynomial operations, such as polynomial roots,
evaluation, and differentiation. In addition, there are functions for more advanced applications,
such as curve fitting and partial fraction expansion.
Symbolic Math Toolbox contains additional specialized support for polynomial operations.
Representing Polynomials
MATLAB represents polynomials as row vectors containing coefficients ordered by descending
powers. For example, consider the equation
2 5
This is the celebrated example Wallis used when he first represented Newton's method to the
French Academy. To enter this polynomial into MATLAB, use
>>p = [1 0 -2 -5];
Polynomial Roots
The roots function calculates the roots of a polynomial:
>>r = roots(p)
r=
2.0946
-1.0473 + 1.1359i
-1.0473 - 1.1359i
Semester ‐ 083 Page 15
16 Lab Experiment 1: Using MATLAB for Control Systems
By convention, MATLAB stores roots in column vectors. The function poly returns to the
polynomial coefficients:
>>p2 = poly(r)
p2 =
1 8.8818e-16 -2 -5
Characteristic Polynomials
The poly function also computes the coefficients of the characteristic polynomial of a matrix:
ans =
1.0000 -3.9500 -1.8500 -163.2750
The roots of this polynomial, computed with roots, are the characteristic roots, or eigenvalues, of
the matrix A. (Use eig to compute the eigenvalues of a matrix directly.)
Polynomial Evaluation
The polyval function evaluates a polynomial at a specified value. To evaluate p at s = 5, use
>>polyval(p,5)
ans =
110
It is also possible to evaluate a polynomial in a matrix sense. In this case the equation
2 5 becomes 2 5 , where X is a square matrix and I is the identity
matrix.
Y=
377 179 439
111 81 136
490 253 639
Semester ‐ 083 Page 16
17 Lab Experiment 1: Using MATLAB for Control Systems
c=
4 13 28 27 18
>>[q,r] = deconv(c,a)
q=
4 5 6
r=
0 0 0 0 0
Polynomial Derivatives
The polyder function computes the derivative of any polynomial. To obtain the derivative of the
polynomial
>>p= [1 0 -2 -5]
>>q = polyder(p)
q=
3 0 -2
polyder also computes the derivative of the product or quotient of two polynomials. For example,
create two polynomials a and b:
>>a = [1 3 5];
>>b = [2 4 6];
Calculate the derivative of the product a*b by calling polyder with a single output argument:
>>c = polyder(a,b)
c=
8 30 56 38
Calculate the derivative of the quotient a/b by calling polyder with two output arguments:
>>[q,d] = polyder(a,b)
Semester ‐ 083 Page 17
18 Lab Experiment 1: Using MATLAB for Control Systems
q=
-2 -8 -2
d=
4 16 40 48 36
if there are no multiple roots, where r is a column vector of residues, p is a column vector of pole
locations, and k is a row vector of direct terms.
r=
-12
8
p=
-4
-2
k=
[]
Given three input arguments (r, p, and k), residue converts back to polynomial form:
>>[b2,a2] = residue(r,p,k)
b2 =
-4 8
a2 =
1 6 8
Semester ‐ 083 Page 18
19 Lab Experiment 1: Using MATLAB for Control Systems
Exercise 1:
Exercise 2:
b.
Semester ‐ 083 Page 19
20 Lab Experiment 1: Using MATLAB for Control Systems
Objective: The objective of this session is to introduce you to writing M-file scripts, creating
MATLAB Functions and reviewing MATLAB flow control like ‘if-elseif-end’, ‘for loops’ and
‘while loops’.
Overview:
MATLAB is a powerful programming language as well as an interactive computational
environment. Files that contain code in the MATLAB language are called M-files. You create
M-files using a text editor, then use them as you would any other MATLAB function or
command. There are two kinds of M-files:
Scripts, which do not accept input arguments or return output arguments. They operate on
data in the workspace. MATLAB provides a full programming language that enables you
to write a series of MATLAB statements into a file and then execute them with a single
command. You write your program in an ordinary text file, giving the file a name of
‘filename.m’. The term you use for ‘filename’ becomes the new command that
MATLAB associates with the program. The file extension of .m makes this a MATLAB
M-file.
Functions, which can accept input arguments and return output arguments. Internal
variables are local to the function.
If you're a new MATLAB programmer, just create the M-files that you want to try out in the
current directory. As you develop more of your own M-files, you will want to organize them into
other directories and personal toolboxes that you can add to your MATLAB search path. If you
duplicate function names, MATLAB executes the one that occurs first in the search path.
Scripts:
When you invoke a script, MATLAB simply executes the commands found in the file. Scripts
can operate on existing data in the workspace, or they can create new data on which to operate.
Although scripts do not return output arguments, any variables that they create remain in the
workspace, to be used in subsequent computations. In addition, scripts can produce graphical
output using functions like plot. For example, create a file called ‘myprogram.m’ that contains
these MATLAB commands:
% Create random numbers and plot these numbers
clc
clear
r = rand(1,50)
plot(r)
Typing the statement ‘myprogram’ at command prompt causes MATLAB to execute the
commands, creating fifty random numbers and plots the result in a new window. After execution
of the file is complete, the variable ‘r’ remains in the workspace.
Semester ‐ 083 Page 20
21 Lab Experiment 1: Using MATLAB for Control Systems
Functions:
Functions are M-files that can accept input arguments and return output arguments. The names
of the M-file and of the function should be the same. Functions operate on variables within their
own workspace, separate from the workspace you access at the MATLAB command prompt. An
example is provided below:
The first line of a function M-file starts with the keyword ‘function’. It gives the function name
and order of arguments. In this case, there is one input arguments and one output argument. The
next several lines, up to the first blank or executable line, are comment lines that provide the help
text. These lines are printed when you type ‘help fact’. The first line of the help text is the H1
line, which MATLAB displays when you use the ‘lookfor’ command or request help on a
directory. The rest of the file is the executable MATLAB code defining the function.
The variable n & f introduced in the body of the function as well as the variables on the first line
are all local to the function; they are separate from any variables in the MATLAB workspace.
This example illustrates one aspect of MATLAB functions that is not ordinarily found in other
programming languages—a variable number of arguments. Many M-files work this way. If no
output argument is supplied, the result is stored in ans. If the second input argument is not
supplied, the function computes a default value.
Semester ‐ 083 Page 21
22 Lab Experiment 1: Using MATLAB for Control Systems
Flow Control:
Conditional Control – if, else, switch
This section covers those MATLAB functions that provide conditional program control. if, else,
and elseif. The if statement evaluates a logical expression and executes a group of statements
when the expression is true. The optional elseif and else keywords provide for the execution of
alternate groups of statements. An end keyword, which matches the if, terminates the last group
of statements.
The groups of statements are delineated by the four keywords—no braces or brackets are
involved as given below.
if <condition>
<statements>;
elseif <condition>
<statements>;
else
<statements>;
end
It is important to understand how relational operators and if statements work with matrices.
When you want to check for equality between two variables, you might use
if A == B, ...
This is valid MATLAB code, and does what you expect when A and B are scalars. But when A
and B are matrices, A == B does not test if they are equal, it tests where they are equal; the result
is another matrix of 0's and 1's showing element-by-element equality. (In fact, if A and B are not
the same size, then A == B is an error.)
>>A = magic(4);
>>B = A;
>>B(1,1) = 0;
>>A == B
ans =
0 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
The proper way to check for equality between two variables is to use the isequal function:
isequal returns a scalar logical value of 1 (representing true) or 0 (false), instead of a matrix, as
the expression to be evaluated by the if function.
Semester ‐ 083 Page 22
23 Lab Experiment 1: Using MATLAB for Control Systems
>>isequal(A, B)
ans =
0
Here is another example to emphasize this point. If A and B are scalars, the following program
will never reach the "unexpected situation". But for most pairs of matrices, including our magic
if A > B
'greater'
elseif A < B
'less'
elseif A == B
'equal'
else
error('Unexpected situation')
end
squares with interchanged columns, none of the matrix conditions A > B, A < B, or A == B is
true for all elements and so the else clause is executed:
Several functions are helpful for reducing the results of matrix comparisons to scalar conditions
for use with if, including ‘isequal’, ‘isempty’, ‘all’, ‘any’.
There must always be an end to match the switch. An example is shown below.
n=5
switch rem(n,2) % to find remainder of any number ‘n’
case 0
disp(‘Even Number’) % if remainder is zero
case 1
disp(‘Odd Number’) % if remainder is one
end
Semester ‐ 083 Page 23
24 Lab Experiment 1: Using MATLAB for Control Systems
Unlike the C language switch statement, MATLAB switch does not fall through. If the first case
statement is true, the other case statements do not execute. So, break statements are not required.
for:
The ‘for’ loop, is used to repeat a group of statements for a fixed, predetermined number of
times. A matching ‘end’ delineates the statements. The syntax is as follows:
for n = 1:4
r(n) = n*n; % square of a number
end
r
The semicolon terminating the inner statement suppresses repeated printing, and the r after the
loop displays the final result.
It is a good idea to indent the loops for readability, especially when they are nested:
for i = 1:m
for j = 1:n
H(i,j) = 1/(i+j);
end
end
while:
The ‘while’ loop, repeats a group of statements indefinite number of times under control of a
logical condition. So a while loop executes atleast once before it checks the condition to stop the
execution of statements. A matching ‘end’ delineates the statements. The syntax of the ‘while’
loop is as follows:
while <condition>
<statements>;
end
Here is a complete program, illustrating while, if, else, and end, that uses interval bisection to
find a zero of a polynomial:
Semester ‐ 083 Page 24
25 Lab Experiment 1: Using MATLAB for Control Systems
a = 0; fa = -Inf;
b = 3; fb = Inf;
while b-a > eps*b
x = (a+b)/2;
fx = x^3-2*x-5;
if sign(fx) == sign(fa)
a = x; fa = fx;
else
b = x; fb = fx;
end
end
x
The result is a root of the polynomial x3 - 2x - 5, namely x = 2.0945. The cautions involving
matrix comparisons that are discussed in the section on the if statement also apply to the while
statement.
break:
The break statement lets you exit early from a ‘for’ loop or ‘while’ loop. In nested loops, break
exits from the innermost loop only. Above is an improvement on the example from the previous
section. Why is this use of break a good idea?
a = 0; fa = -Inf;
b = 3; fb = Inf;
while b-a > eps*b
x = (a+b)/2;
fx = x^3-2*x-5;
if fx == 0
break
elseif sign(fx) == sign(fa)
a = x; fa = fx;
else
b = x; fb = fx;
end
end
continue:
The continue statement passes control to the next iteration of the for loop or while loop in which
it appears, skipping any remaining statements in the body of the loop. The same holds true for
continue statements in nested loops. That is, execution continues at the beginning of the loop in
which the continue statement was encountered.
Semester ‐ 083 Page 25
26 Lab Experiment 1: Using MATLAB for Control Systems
Use MATLAB to generate the first 100 terms in the sequence a(n) define recursively by
a) Write a MATLAB M-file function to obtain numerical values of y(t). Your function must
take y(0), ζ, ωn, t and θ as function inputs and y(t) as output argument.
b) Obtain the plot for y(t) for 0<t<10 with an increment of 0.1, by considering the following
two cases
Case 1: y(0)=0.15 m, ωn = √2 rad/sec, ζ = 3/(2√2 and θ = 0;
Case 2: y(0)=0.15 m, ωn = √2 rad/sec, ζ = 1/(2√2 and θ = 0;
Use ‘for’ or ‘while’ loop to convert degrees Fahrenheit (Tf) to degrees Celsius using the
following equation . Use any starting temperature, increment and ending
temperature (example: starting temperature=0, increment=10, ending temperature = 200).
Please submit the exercises (m-files and results) in the next lab.
Semester ‐ 083 Page 26
27 Laboratory Experiment 2: Mathematical Modeling of Physical Systems
CISE 302
Linear Control Systems
Laboratory Experiment 2: Mathematical Modeling of Physical Systems
Objectives: The objective of this exercise is to grasp the important role mathematical models
of physical systems in the design and analysis of control systems. We will learn how MATLAB
helps in solving such models.
List of Equipment/Software
Following equipment/software is required:
MATLAB
Category Soft-Experiment
Deliverables
A complete lab report including the following:
x(t)
Fs(x) Fs(x)
M Fa(t) Fa(t)
M
Ff( )
Ff( )
Where
,
Semester ‐ 083 Page 27
28 Laboratory Experiment 2: Mathematical Modeling of Physical Systems
,
and
.
(1)
The differential equation for the above Mass-Spring system can then be written as follows
(2)
Where r > 1.
(3)
Equation (3) represents another possible model that describes the dynamic behavior of the mass-
damper system under external force. Model (2) is said to be a linear model whereas (3) is said to
Semester ‐ 083 Page 28
29 Laboratory Experiment 2: Mathematical Modeling of Physical Systems
The solution of the difference equations (1), (2), or (3) leads to finding x(t) subject to certain
initial conditions.
MATLAB can help solve linear or nonlinear ordinary differential equations (ODE). To show
how you can solve ODE using MATLAB we will proceed in two steps. We first see how can we
solve first order ODE and second how can we solve equation (2) or (3).
(4)
Or
(5)
Semester ‐ 083 Page 29
30 Laboratory Experiment 2: Mathematical Modeling of Physical Systems
% dv/dt=Fa/M-B/M v
dvdt=Fa/M-B/M*v;
2_ in MATLAB write
>> v0= 0; %(initial speed)
>> options = odeset('RelTol',1e-4,'AbsTol',[1e-5],'Stats','on');
>>[t,v]=ode45('cruise_speed', [0 125],v0);
>> plot(t,v);
>>title('cruise speed time response to a constant traction force Fa(t) ')
>>grid
There are many other MATLAB ODE solvers such as ode23, ode45, ode113, ode15s, etc… The
function dsolve will result in a symbolic solution. Do ‘doc dsolve’ to know more. In MATLAB
write
>>dsolve(‘Dv=Fa/M-B/M*v’, ‘v(0)=0’)
Note that using MATLAB ODE solvers are able to solve linear or nonlinear ODE’s. We will see
in part II of this experiment another approach to solve a linear ODE differently. Higher order
systems can also be solved similarly.
The second order differential equation has to be decomposed in a set of first order differential
equations as follows
dx(t)/dt X2
Semester ‐ 083 Page 30
31 Laboratory Experiment 2: Mathematical Modeling of Physical Systems
Assignment:
Semester ‐ 083 Page 31
32 Laboratory Experiment 2: Mathematical Modeling of Physical Systems
Exercises 1
Consider the mechanical system depicted in the Spring
Forcing Constant k
figure. The input is given by , and the output is Function f(t)
given by . Determine the transfer function from k
Mass Mass dis‐
placement y(t)
to and using MATLAB, write a m-file M
Exercises 2
Consider the differential equation 4 4 where 0 0 0 and
is a unit step. Determine the solution analytically and verify by co-plotting the analytical
solution and the step response obtained with ‘step’ function.
Exercise 3:
Find a dynamic system represented by a differential equation(s) in a journal article.
Write a two-pages paper that describes the systems, illustrate the solution using
MATLAB and determine by simulation which coefficient in the dynamic equation that
has most impact on the dynamic behavior of the system.
Semester ‐ 083 Page 32
33 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
CISE 302
Linear Control Systems
Laboratory Experiment 3: Linear Time-invariant Systems and
Representation
List of Equipment/Software
Following equipment/software is required:
MATLAB
Category Soft-Experiment
Deliverables
A complete lab report including the following:
Semester ‐ 083 Page 33
34 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
x(t)
Fs(x) Fs(x)
M Fa(t) Fa(t)
M
Ff( )
Ff( )
The differential equation for the above Mass-Spring system can be derived as follows
Transfer Function:
Applying the Laplace transformation while assuming the initial conditions are zeros, we get
Semester ‐ 083 Page 34
35 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
>>num = [1 0];
>>den = [1 2 1];
>>sys = tf(num,den)
Transfer function:
s
-------------
s^2 + 2 s + 1
A useful trick is to create the Laplace variable, s. That way, you can specify polynomials using s
as the polynomial variable.
>>s=tf('s');
>>sys= s/(s^2 + 2*s + 1)
Transfer function:
s
-------------
s^2 + 2 s + 1
Zero/pole/gain:
s
-------
(s+1)^2
produces the same transfer function built in the TF example, but the representation is now ZPK.
This example shows a more complicated ZPK model.
Zero/pole/gain:
0.776 s (s-1)
--------------------
(s+1) (s+3) (s+0.28)
Semester ‐ 083 Page 35
36 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
pzmap
Compute pole-zero map of LTI models
pzmap(sys)
pzmap(sys1,sys2,...,sysN)
[p,z] = pzmap(sys)
Description:
pzmap(sys) plots the pole-zero map of the
continuous- or discrete-time LTI model sys. For
SISO systems, pzmap plots the transfer function
poles and zeros. The poles are plotted as x's and the
zeros are plotted as o's.
pzmap(sys1,sys2,...,sysN) plots the pole-zero map
of several LTI models on a single figure. The LTI
models can have different numbers of inputs and
outputs. When invoked with left-hand arguments,
[p,z] = pzmap(sys) returns the system poles and
zeros in the column vectors p and z. No plot is
drawn on the screen. You can use the functions
sgrid or zgrid to plot lines of constant damping
ratio and natural frequency in the s- or z- plane.
Example
Plot the poles and zeros of the continuous-time system.
2 5 1
2 3
Semester ‐ 083 Page 36
37 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
invoked without left-hand arguments, all three commands plots the response on the screen. For
example:
Time-interval specification:
To contain the response of the system you can also
specify the time interval to simulate the system to.
For example,
>> t = 0:0.01:10;
>> impulse(H,t)
Or
>> step(H,t)
lsim(sys,u,t) produces a plot of the time response of the LTI model sys to the input time history
‘t’,’u’. The vector ‘t’ specifies the time samples for the simulation and consists of regularly
spaced time samples.
T = 0:dt:Tfinal
2 5 1
2 3
First generate the square wave with gensig. Sample every 0.1 second during 10 seconds:
Semester ‐ 083 Page 37
38 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
>>[u,t] = gensig(‘square’,4,10,0.1);
Transfer function:
2 s^2 + 5 s + 1
s^2 + 2 s + 3
>> lsim(H,u,t)
Semester ‐ 083 Page 38
39 Laboratory Experiment 3: Linear Time‐invariant Systems and Representation
Exercise 1:
Using MATLAB plot the pole zero map of the above system
Exercise 2:
1
0.2 1
0.2 1
Exercise 3:
A system has a transfer function
15⁄
3 15
Plot the response of the system when R(s) is a unit impulse and unit step for the
parameter z=3, 6 and 12.
Semester ‐ 083 Page 39
40 Lab Experiment 4: Block Diagram Reduction
CISE 302
Linear Control Systems
Lab Experiment 4: Block Diagram Reduction
Objective: The objective of this exercise will be to learn commands in MATLAB that would
be used to reduce linear systems block diagram using series, parallel and feedback configuration.
List of Equipment/Software
Following equipment/software is required:
MATLAB
Category Soft-Experiment
Deliverables
A complete lab report including the following:
Series configuration: If the two blocks are connected as shown below then the blocks are said
to be in series. It would like multiplying two transfer functions. The MATLAB command for the
such configuration is “series”.
Example 1: Given the transfer functions of individual blocks generate the system transfer
function of the block combinations.
Semester ‐ 083 Page 40
41 Lab Experiment 4: Block Diagram Reduction
Parallel configuration: If the two blocks are connected as shown below then the blocks are
said to be in parallel. It would like adding two transfer functions.
The MATLAB command for implementing a parallel configuration is “parallel” as shown below:
Example 2: For the previous systems defined, modify the MATLAB commands to obtain the
overall transfer function when the two blocks are in parallel.
Feedback configuration: If the blocks are connected as shown below then the blocks are said
to be in feedback. Notice that in the feedback there is no transfer function H(s) defined. When
not specified, H(s) is unity. Such a system is said to be a unity feedback system.
The MATLAB command for implementing a feedback system is “feedback” as shown below:
Semester ‐ 083 Page 41
42 Lab Experiment 4: Block Diagram Reduction
When H(s) is non-unity or specified, such a system is said to be a non-unity feedback system as
shown below:
A non-unity feedback system is implemented in MATLAB using the same “feedback” command
as shown:
Example 3: Given a unity feedback system as shown in the figure, obtain the overall transfer
function using MATLAB:
Semester ‐ 083 Page 42
43 Lab Experiment 4: Block Diagram Reduction
Example 4: Given a non-unity feedback system as shown in the figure, obtain the overall transfer
function using MATLAB:
Poles and Zeros of System: To obtain the poles and zeros of the system use the MATLAB
command “pole” and “zero” respectively as shown in example 5. You can also use MATLAB
command “pzmap” to obtain the same.
Example 5: Given a system transfer function plot the location of the system zeros and poles
using the MATLAB pole-zero map command.
For example:
Semester ‐ 083 Page 43
44 Lab Experiment 4: Block Diagram Reduction
Exercise 1: For the following multi-loop feedback system, get closed loop transfer function and
the corresponding pole-zero map of the system.
1 1 s2 1 s 1 s 1
Given G1 ; G2 ; G3 2 ; G4 ; H1 ; H2 2 ;
( s 10) ( s 1) ( s 4s 4) ( s 6) ( s 2)
H3 1
Semester ‐ 083 Page 44
45 Lab Experiment 4: Block Diagram Reduction
MATLAB solution:
Instruction: Please refer to Section 2.6 and Section 2.2 in Text by Dorf.
Exercise 3: A satellite single-axis altitude control system can be represented by the block
diagram in the figure given. The variables ‘k’, ‘a’ and ‘b’ are controller parameters, and ‘J’ is the
spacecraft moment of inertia. Suppose the nominal moment of inertia is ‘J’ = 10.8E8, and the
controller parameters are k=10.8E8, a=1, and b=8.
a. Develop an m-file script to compute the closed-loop transfer function
/ .
Semester ‐ 083 Page 45
46 Lab Experiment 4: Block Diagram Reduction
R(s)
+ G s
Y(s)
‐
H s
Semester ‐ 083 Page 46
47 Lab Experiment 5: Performance of First order and second order systems
CISE 302
Linear Control Systems
Lab Experiment 5: Performance of First order and second order systems
Objective: The objective of this exercise will be to study the performance characteristics of
first and second order systems using MATLAB.
List of Equipment/Software
Following equipment/software is required:
MATLAB
Category Soft-Experiment
Deliverables
A complete lab report including the following:
R
C
E(t) + Vc(t)
‐
Figure 1: RC Circuit
If the capacitor is initially uncharged at zero voltage when the circuit is switched on, it starts to
charge due to the current ‘i' through the resistor until the voltage across it reaches the supply
voltage. As soon as this happens, the current stops flowing or decays to zero, and the circuit
becomes like an open circuit. However, if the supply voltage is removed, and the circuit is
closed, the capacitor will discharge the energy it stored again through the resistor. The time it
takes the capacitor to charge depends on the time constant of the system, which is defined as the
Semester ‐ 083 Page 47
48 Lab Experiment 5: Performance of First order and second order systems
time taken by the voltage across the capacitor to rise to approximately 63% of the supply
voltage. For a given RC-circuit, this time constant is . Hence its magnitude depends on
the values of the circuit components.
The RC circuit will always behave in this way, no matter what the values of the components.
That is, the voltage across the capacitor will never increase indefinitely. In this respect we will
say that the system is passive and because of this property it is stable.
For the RC-circuit as shown in Fig. 1, the equation governing its behavior is given by
v t E where v 0 v (1)
RC RC
where v t is the voltage across the capacitor, R is the resistance and C is the capacitance. The
constant is the time constant of the system and is defined as the time required by the
system output i.e. v t to rise to 63% of its final value (which is E). Hence the above equation
(1) can be expressed in terms of the time constant as:
τ v t E where v 0 v (1)
(2)
where τ is time constant of the system and the system is known as the first order system. The
performance measures of a first order system are its time constant and its steady state.
Exercise 1:
a) Given the values of R and C, obtain the unit step response of the first order system.
a. R=2KΩ and C=0.01F
b. R=2.5KΩ and C=0.003F
b) Verify in each case that the calculated time constant ( ) and the one measured from
the figure as 63% of the final value are same.
c) Obtain the steady state value of the system.
Semester ‐ 083 Page 48
49 Lab Experiment 5: Performance of First order and second order systems
x(t)
K
M F(t)
The differential equation for the above Mass-Spring system can be derived as follows
provided that, all the initial conditions are zeros. Then the transfer function representation of the
system is given by
1
The generalized notation for a second order system described above can be written as
n2
Y (s ) 2 R (s )
s 2n s n2
n2
Y (s )
s (s 2 2n s n2 )
for which the transient output, as obtained from the Laplace transform table (Table 2.3,
Textbook), is
1
y (t ) 1 e nt sin(n 1 2 t cos 1 ( ))
1 2
Semester ‐ 083 Page 49
50 Lab Experiment 5: Performance of First order and second order systems
where 0 < ζ < 1. The transient response of the system changes for different values of damping
ratio, ζ. Standard performance measures for a second order feedback system are defined in terms
of step response of a system. Where, the response of the second order system is shown below.
Rise Time: The time for a system to respond to a step input and attains a response equal to a
percentage of the magnitude of the input. The 0-100% rise time, Tr, measures the time to 100%
of the magnitude of the input. Alternatively, Tr1, measures the time from 10% to 90% of the
response to the step input.
Peak Time: The time for a system to respond to a step input and rise to peak response.
Overshoot: The amount by which the system output response proceeds beyond the desired
response. It is calculated as
M pt f
P.O.= 100%
f
where MPt is the peak value of the time response, and fv is the final value of the response.
Settling Time: The time required for the system’s output to settle within a certain percentage of
the input amplitude (which is usually taken as 2%). Then, settling time, Ts, is calculated as
4
Ts
n
Exercise 2: Effect of damping ratio ζ on performance measures. For a single-loop second order
feedback system given below
Semester ‐ 083 Page 50
51 Lab Experiment 5: Performance of First order and second order systems
+ E(s) n2
R(s) G (s ) Y(s)
‐ s (s 2n )
Find the step response of the system for values of ωn = 1 and ζ = 0.1, 0.4, 0.7, 1.0 and 2.0. Plot
all the results in the same figure window and fill the following table.
ζ Rise time Peak Time % Overshoot Settling time Steady state value
0.1
0.4
0.7
1.0
2.0
Semester ‐ 083 Page 51
52 Lab Experiment 6: DC Motor Characteristics
CISE 302
Linear Control Systems
Lab Experiment 6: DC Motor Characteristics
Objective: The objective of the experiment is to show how a permanent magnet D.C. motor
may be controlled by varying the magnitude and direction of its armature current and recognize
the torque/speed characteristic of the D.C. Motor
List of Equipment/Software
Following equipment/software is required:
MATLAB
LabVIEW
DC Servo System (feedback equipment)
a. OU150A Op Amp Unit
b. AU150B Attenuator Unit
c. PA150C Pre-Amplifier Unit
d. SA150D Servo Amplifier
e. PS150E Power Supply
f. DCM150F DC Motor
g. IP150H Input Potentiometer
h. OP150K Output Potentiometer
i. GT150X Reduction Gear Tacho
j. DC Voltmeter
Deliverables
A complete lab report including the following:
Semester ‐ 083 Page 52
53 Lab Experiment 6: DC Motor Characteristics
Introduction:
This experiment will illustrate the characteristics of the D.C. motor used in the Modular Servo
and show how it can be controlled by the Servo Amplifier.
The motor is a permanent magnet type and has a single armature winding. Current flow through
the armature is controlled by power amplifiers as in figure so that rotation in both directions is
possible by using one, or both of the inputs. In most of the later assignments the necessary input
signals are provided by a specialized Pre-Amplifier Unit PA150C, which connected to Inputs 1
and 2 on SA150D
As the motor accelerates the armature generates an increasing 'back-emf' Va tending to oppose
the driving voltage Vin. The armature current is thus roughly proportional to (Vin - Va). If the
speed drops (due to loading) Va reduces, the current increases and thus so does the motor torque.
This tends to oppose the speed drop. This mode of control is called 'armature-control' and gives a
speed proportional to Vin as in figure.
The model of the armature-controlled DC motor has been developed in many text books in
particular (Dorf and Bishop, 2008).
Assignment: Read (Dorf and Bishop, 2008) page 62-65
Semester ‐ 083 Page 53
54 Lab Experiment 6: DC Motor Characteristics
The motor torque, T, is related to the armature current, i, by a constant factor Kt. The back emf,
e, is related to the rotational velocity by the following equations:
T Kt i
d
e Ke
dt
This system will be modeled by summing the torques acting on the rotor inertia and integrating
the acceleration to give the velocity, and integrating velocity to get position. Also, Kirchoff's
laws will be applied to the armature circuit.
Open Simulink and open a new model window. First, we will model the integrals of the
rotational acceleration and of the rate of change of armature current.
Semester ‐ 083 Page 54
55 Lab Experiment 6: DC Motor Characteristics
d 2 d
dt 2
dt
di
dt i
Insert an Integrator block (from the Linear block library) and draw lines to and from its
input and output terminals.
Label the input line "d2/dt2(theta)" and the output line "d/dt(theta)" as shown below. To
add such a label, double click in the empty space just above the line.
Insert another Integrator block attached to the output of the previous one and draw a line
from its output terminal.
Label the output line "theta".
Insert a third Integrator block above the first one and draw lines to and from its input and
output terminals.
Label the input line "d/dt(i)" and the output line "i".
Next, we will start to model both Newton's law and Kirchoff's law. These laws applied to the
motor system give the following equations:
Semester ‐ 083 Page 55
56 Lab Experiment 6: DC Motor Characteristics
The angular acceleration is equal to 1/J multiplied by the sum of two terms (one pos., one neg.).
Similarly, the derivative of current is equal to 1/L multiplied by the sum of three terms (one pos.,
two neg.).
Insert two Gain blocks, (from the Linear block library) one attached to each of the
leftmost integrators.
Edit the gain block corresponding to angular acceleration by double-clicking it and
changing its value to "1/J".
Change the label of this Gain block to "inertia" by clicking on the word "Gain"
underneath the block.
Similarly, edit the other Gain's value to "1/L" and it's label to Inductance.
Insert two Sum blocks (from the Linear block library), one attached by a line to each of
the Gain blocks.
Edit the signs of the Sum block corresponding to rotation to "+-" since one term is
positive and one is negative.
Edit the signs of the other Sum block to "-+-" to represent the signs of the terms in
Kirchoff's equation.
Now, we will add in the torques which are represented in Newton's equation. First, we will add
in the damping torque.
Insert a gain block below the inertia block, select it by single-clicking on it, and select
Flip from the Format menu (or type Ctrl-F) to flip it left-to-right.
Set the gain value to "b" and rename this block to "damping".
Tap a line (hold Ctrl while drawing) off the first rotational integrator's output (d/dt(theta))
and connect it to the input of the damping gain block.
Draw a line from the damping gain output to the negative input of the rotational Sum
block.
Semester ‐ 083 Page 56
57 Lab Experiment 6: DC Motor Characteristics
Insert a gain block attached to the positive input of the rotational Sum block with a line.
Edit it's value to "K" to represent the motor constant and Label it "Kt".
Continue drawing the line leading from the current integrator and connect it to the Kt
gain block.
Now, we will add in the voltage terms which are represented in Kirchoff's equation. First, we
will add in the voltage drop across the coil resistance.
Insert a gain block above the inductance block, and flip it left-to-right.
Set the gain value to "R" and rename this block to "Resistance".
Tap a line (hold Ctrl while drawing) off the current integrator's output and connect it to
the input of the resistance gain block.
Draw a line from the resistance gain output to the upper negative input of the current
equation Sum block.
Insert a gain block attached to the other negative input of the current Sum block with a
line.
Edit it's value to "K" to represent the motor constant and Label it "Ke".
Tap a line off the first rotational integrator's output (d/dt(theta)) and connect it to the Ke
gain block.
Semester ‐ 083 Page 57
58 Lab Experiment 6: DC Motor Characteristics
The third voltage term in the Kirchoff equation is the control input, V. We will apply a step
input.
Insert a Step block (from the Sources block library) and connect it with a line to the
positive input of the current Sum block.
To view the output speed, insert a Scope (from the Sinks block library) connected to the
output of the second rotational integrator (theta).
To provide a appropriate unit step input at t=0, double-click the Step block and set the
Step Time to "0".
Semester ‐ 083 Page 58
59 Lab Experiment 6: DC Motor Characteristics
The physical parameters must now be set. Run the following commands at the MATLAB
prompt:
J=3.2284E-6;
b=3.5077E-6;
K=0.0274;
R=4;
L=2.75E-6;
3. Simulation:
To simulate this system, first, an appropriate simulation time must be set. Select Parameters from
the Simulation menu and enter "0.2" in the Stop Time field. 0.2 seconds is long enough to view
the open-loop response. Also in the Parameters dialog box, it is helpful to change the Solver
Options method. Click on the field which currently contains "ode45 (Dormand-Prince)". Select
the option "ode15s (stiff/NDF)". Since the time scales in this example are very small, this stiff
system integration method is much more efficient than the default integration method.
Semester ‐ 083 Page 59
60 Lab Experiment 6: DC Motor Characteristics
Step input:
- Use step input from 0 volts to 2 volts and observe the response.
- Save the response to workspace variable to further compare with the
experimental DC motor (DCM 150F).
- Now Step the input voltage from 2 volts to 4 volts. Save the response to
further compare with experimental motor.
- This is the simulation section for the Exercise 2 – Step input.
- Remove the Step Input and connect a Function Generator from the Simulink-
Library to the input of the motor model in Simulink.
- Select Sinusoidal function in the function generator.
- Fix the amplitude of the sine wave to 2.
- Take several responses by varying the frequency of the sinusoidal wave
keeping the amplitude fixed.
- Save the input and output of the DC motor model to further compare with
experimental motor response.
- This is the simulation section for the Exercise 2 – Sine input
Parameter Identification:
Semester ‐ 083 Page 60
61 Lab Experiment 6: DC Motor Characteristics
(magnetic load disk). Data should be acquired for the unloaded spin up of the motor, as well as
the response of the system upon the application of a load. The data from the experimental setup
can be collected using USB DAQ from National Instruments and LABVIEW software.
Derivations
To measure the constants km and R, we can use equations following equations,
em k m
ea em
ia
R
Divide by e a ,
ia 1 k
m
ea R R ea
km i 1
a
R ea ea R
k m R i a ia 1
R ea ea R
R ea
R
k m R ia
ea k m R ia
ea
km R
ia ia
Hint: The last equation resembles with the well known y mx c equation of a line.
ea
Since we have measured values for e a , i a , and , we can plot versus to determine the
ia ia
slope and intercept, which reveals the constant values of k m and R .
Semester ‐ 083 Page 61
62 Lab Experiment 6: DC Motor Characteristics
If we plot the graph of m and , and plot a best fit line, we can get the corresponding values of
B and f .
Once we know m , we can find ki using
m k i ia
Summarize the system parameters for the DC motor in corresponding graphs and tables. Use
these parameters in the Simulink Model simulation and validate the Simulation results with the
experimental set up.
We can estimate the speed at which the viscous friction is greater than the coulomb friction, that
is, when B T f . The speed can be calculated by dividing T f by B .
The approximate tachometer voltage corresponding to this speed can be determined by using the
best fit equation for the relationship between et and .
After determining the best fit equation for et and , we can plug in the value of calculated
above to get an expected tachometer voltage et .
Note that the voltage estimated may be greater than the tachometer voltage determined by the
experimental setup in lab. This case, we can assume that the Coulomb friction in the motor
system dominates.
Applying a step input of to the motor and acquiring data samples, we can obtain a curve for the
tachometer voltage vs. time. Given the form of the first order response of the system to an input,
we can further fit the data with an appropriate exponential to determine the time constant.
Et (s) 1 K 1
Transfer Function(s) . et (t ) K . (1 e at )
Ea ( s) s s a a
Where,
1 BR k m k i k i k
a , and K
RJ RJ
Using the above equations and the best fit constants for the motor spin up obtained above, we
can calculate the value of J .
Figures to be plotted:
1. et (volts) versus ( rad / s ) : To determine k .
Semester ‐ 083 Page 62
63 Lab Experiment 6: DC Motor Characteristics
ea
2. (volts/ampere = ohms) versus (rad/(sec*Amp)): To determine constants k m and R.
ia ia
3. Tm (N*m) versus (rad/s): To determine B and T f .
Table of values: k B R km Tf kT
Semester ‐ 083 Page 63
64 Lab Experiment 7: Validation of DC Motor Characteristics
CISE 302
Linear Control Systems
Lab Experiment 7: Validation of DC Motor Characteristics
Objective: The objective of the experiment is to validate the learning outcomes of the last
experiment (Exp. 6) for the characteristic of the D.C. Motor.
List of Equipment/Software
Following equipment/software is required:
LabVIEW
DC Servo System (feedback equipment)
a. OU150A Op Amp Unit
b. AU150B Attenuator Unit
c. PA150C Pre-Amplifier Unit
d. SA150D Servo Amplifier
e. PS150E Power Supply
f. DCM150F DC Motor
g. IP150H Input Potentiometer
h. OP150K Output Potentiometer
i. GT150X Reduction Gear Tacho
j. DC Voltmeter
Deliverables
A complete lab report including the following:
Model validation:
Preliminary Procedure:
Attach the AU150B, SA150D and PS150E, to the baseplate by means of the magnetic
bases.
Fit the eddy-current brake disc to the motor shaft.
Semester ‐ 083 Page 64
65 Lab Experiment 7: Validation of DC Motor Characteristics
Now attach the DCM150F to the baseplate by means of the magnetic fixings and fix the
plug into the SA150D.
Attach the GT150X to the baseplate by means of the magnetic fixings and position it, so
that it is connected to the motor shaft by means of the flexible coupling.
Attach the LU150L to the baseplate by means of the magnetic fixings and position it so
that when the cursor is on position 10 the eddy-current disc lies midway in the gap with
its edge flush with the back of the magnet.
Fix the plug from the SA150D into the PS150E
Connect the Power Supply to the mains supply line, DO NOT switch on yet.
Procedure:
Exercise 1:
1. Set the magnetic brake to the unloaded position and turn the potentiometer till there is a
reading of 1V on the voltmeter.
2. Repeat this reading with a 2V output. Then repeat for 3V, 4V and 5V.
Now record the speed. Tabulate your results in a copy of the table given below.
Semester ‐ 083 Page 65
66 Lab Experiment 7: Validation of DC Motor Characteristics
Tacho-generator Speed
Volts r/min
3. Plot a graph of your results, as in figure below, of Speed against Tacho-generator volts.
The calibration factor Kg = Vg/N-r/min. It should be about 2.OV to 3.OV per 1000 r/min.
Step the input voltage from 0V to 2 V and compare the output with MATLAB
response.
While the system is stable and the input is at 2 V, Step the input voltage from 2V to
4V. Record the input and output and compare the output with the same experiment in
MATLAB.
Connect a frequency generator to the input voltage and fix the input to 2*sin(wt)
where 2 . Record the output and compare it to MATLAB response.
Semester ‐ 083 Page 66
67 Lab Experiment 7: Validation of DC Motor Characteristics
Nonlinear characteristics
The difference between the MATLAB model and the real system can be explained by the
presence of a nonlinear dynamic that was ignored during modeling. Indeed, Due to brush
friction, a certain minimum input signal is needed to start the motor rotating. Above figure shows
how the speed varies with load torque. The first experiment will be to obtain the characteristics
of the motor.
Reduce the input voltage till the motor is just turning then measure with your voltmeter
the voltages between OV and potentiometer slider and the tacho-generator output. Then
tabulate as in fig 3.3.6. Increase the input voltage in one-volt steps, take readings of the
input voltage and tachogenerator voltage up to approximately 2000 r/min which is the
maximum speed of the motor.
Plot the input voltages against speed, your results should be similar to the figure which
shows plot of speed vs voltage.
Vin Vg Speed
Volts Volts rpm
Semester ‐ 083 Page 67
68 Lab Experiment 7: Validation of DC Motor Characteristics
To measure the torque/speed characteristics, fix the brake so that it passes over the disc
smoothly while the motor is running.
Set the brake at position 0 and increase the input voltage until the motor rotates at close
to its maximum speed.
Then set the brake at position 10 and if necessary reduce the input voltage so that the
ammeter on the PS150E is just below 2 amps; note the value of the input voltage. Take
tacho-generator readings over the range of the brake down to zero position, tabulating
your results.
Brake Vg Speed
Position Volts Rpm
Now reset the brake back to maximum position and reduce the signal input voltage so
that the motor is slowly rotating. Note the actual value of the input voltage.
Take readings over the brake range tabulating the further results.
Brake Vg Speed
Position Volts rpm
Semester ‐ 083 Page 68
69 Lab Experiment 7: Validation of DC Motor Characteristics
Plot the two sets of results, as in figure of Speed against Torque (brake position) for the
two input voltage values.
Below figure shows the approximate brake position/g.cm characteristics of the motor at
1000 r/min. For other speeds, the torque will be proportional to the speed.
With armature control the negative feedback of the back emf will oppose the input signal and so
tend to maintain a steady motor current; this results in a more constant speed over the torque
range. As a result the torque/speed curve becomes more similar to that produced by a shunt
wound motor. The armature-controlled shunt-wound motor is extensively used in control
systems.
Semester ‐ 083 Page 69
70 Lab Experiment 8: Effect of Feedback on disturbance & Control System Design
CISE 302
Linear Control Systems
Lab Experiment 8: Effect of Feedback on disturbance & Control System
Design
Objective: The objective of this exercise will be to study the effect of feedback on the
response of the system to step input and step disturbance taking the practical example of English
Channel boring machine and design a control system taking in account performance
measurement.
List of Equipment/Software
Following equipment/software is required:
MATLAB
Deliverables
A complete lab report including the following:
Overview:
The construction of the tunnel under the English Channel from France to the Great Britain began
in December 1987. The first connection of the boring tunnels from each country was achieved in
November 1990. The tunnel is 23.5 miles long and bored 200 feet below sea level. Costing $14
billion, it was completed in 1992 making it possible for a train to travel from London to Paris in
three hours.
The machine operated from both ends of the channel, bored towards the middle. To link up
accurately in the middle of the channel, a laser guidance system kept the machines precisely
aligned. A model of the boring machine control is shown in the figure, where Y(s) is the actual
angle of direction of travel of the boring machine and R(s) is the desired angle. The effect of load
on the machine is represented by the disturbance, Td(s).
Semester ‐ 083 Page 70
71 Lab Experiment 8: Effect of Feedback on disturbance & Control System Design
Td(s)
R(s)
+ Gc(s)
Controller
+ G(s)
Plant
Y(s)
+
Desired 1 Angle
Angle
‐ K 11s
s s 1
Exercise 1:
a) Get the transfer function from R(s) to Y(s)
b) Get the transfer function from D(s) to Y(s)
c) Generate the system response; for K= 10, 20, 50, 100; due to a unit step input - r(t)
d) Generate the system response; for K= 10, 20, 50, 100; due to a unit step disturbance - d(t)
e) For each case find the percentage overshoot(%O.S.), rise time, settling time, steady state
of y(t)
f) Compare the results of the two cases
g) Investigate the effect of changing the controller gain on the influence of the disturbance
on the system output
M-files for two cases of K=20 and K=100 are shown below
xlabel(‘Time (seconds)’);ylabel(‘y(t)’);grid
Due to unit step – r(s) on;
Semester ‐ 083 Page 71
72 Lab Experiment 8: Effect of Feedback on disturbance & Control System Design
For the motor system given below, we need to design feedback such that the overshoot is limited
and there is less oscillatory nature in the response based on the specifications provided in the
table. Assume no disturbance (D(s)=0).
Motor D(s)
Amplifier Constant Load
+ ‐ 1
R(s) Y(s)
Ka 5 20
‐ +
Use MATLAB, to find the system performance for different values of Ka and find which value of
the gain Ka satisfies the design condition specified. Use the following table.
Ka 20 30 50 60 80
Percent
Overshoot
Settling
time
Semester ‐ 083 Page 72
73 Lab Experiment 9: Effect of Feedback on disturbance & Control System Design of Tank Level System
CISE 302
Linear Control Systems
Lab Experiment 9: Effect of Feedback on disturbance & Control System
Design of Tank Level System
Objective: The objective of this exercise will be to study the effect of feedback on the
response of the system to step input and step disturbance on the Two Tank System.
List of Equipment/Software
Following equipment/software is required:
MATLAB
LabVIEW
NI USB 6009 Data Acquisition Card
Two Tank System (CE 105)
Deliverables
A complete lab report including the following:
Overview:
A model of the tank system and the controller is shown in the figure, where Y(s) is the actual
level of the tank and R(s) is the desired level. The effect of disturbance to the tank system is
represented by the disturbance, Td(s). The Td(s) is the leakage that can be generated from the
hand valve at the bottom of the tank system.
Leakage Td(s)
R(s)
+ Gc(s)
Controller
+ G(s)
Plant
Y(s)
+
Desired Height
Level
‐
(Level of
tank)
Semester ‐ 083 Page 73
74 Lab Experiment 9: Effect of Feedback on disturbance & Control System Design of Tank Level System
NOTE: Instructors should manage to complete the hardware/software setup for the students to
take reading and implement the controller.
Exercise:
a) Launch the data collection LabVIEW file and make the proper connections to the Two
Tank System. This experiment uses only one tank of the system.
b) The disturbance to the tank is the hand-valve in the bottom of the first tank.
c) Collect the data for the FIVE cases of leakage valve (valve at bottom).
d) From the theory and understanding from last experiment (Exp 7), identify and prepare the
transfer function and respective controllers for the specifications discussed during last
experiment.
e) Generate the system response; for K= 10, 20, 50, 100; due to the five cases of leakage
disturbance - d(t)
f) For each case find the percentage overshoot(%O.S.), rise time, settling time, steady state
of y(t)
g) Compare the results of all the cases
h) Investigate the effect of changing the controller gain on the influence of the disturbance
on the system output
Semester ‐ 083 Page 74
75 Lab Experiment 10: Introduction to PID controller
CISE 302
Linear Control Systems
Lab Experiment 10: Introduction to PID controller
Objective: Study the three term (PID) controller and its effects on the feedback loop response.
Investigate the characteristics of the each of proportional (P), the integral (I), and the derivative
(D) controls, and how to use them to obtain a desired response.
List of Equipment/Software
Following equipment/software is required:
MATLAB
LabVIEW
Deliverables
A complete lab report including the following:
R + e u Y
Controller Plant
‐
Controller: Provides excitation for the plant; Designed to control the overall system behavior.
The three-term controller: The transfer function of the PID controller looks like the following:
Semester ‐ 083 Page 75
76 Lab Experiment 10: Introduction to PID controller
KP = Proportional gain
KI = Integral gain
KD = Derivative gain
First, let's take a look at how the PID controller works in a closed-loop system using the
schematic shown above. The variable (e) represents the tracking error, the difference between the
desired input value (R) and the actual output (Y). This error signal (e) will be sent to the PID
controller, and the controller computes both the derivative and the integral of this error signal.
The signal (u) just past the controller is now equal to the proportional gain (KP) times the
magnitude of the error plus the integral gain (KI) times the integral of the error plus the
derivative gain (KD) times the derivative of the error.
This signal (u) will be sent to the plant, and the new output (Y) will be obtained. This new output
(Y) will be sent back to the sensor again to find the new error signal (e). The controller takes this
new error signal and computes its derivatives and its internal again. The process goes on and on.
Example Problem:
The transfer function between the displacement X(s) and the input F(s) then becomes
Semester ‐ 083 Page 76
77 Lab Experiment 10: Introduction to PID controller
Let
M = 1kg
b = 10 N.s/m
k = 20 N/m
F(s) = 1
1
10 20
The goal of this problem is to show you how each of Kp, Ki and Kd contributes to obtain
Open-loop step response: Let's first view the open-loop step response.
num=1;
den=[1 10 20];
plant=tf(num,den);
step(plant)
MATLAB command window should give you the plot shown below.
Semester ‐ 083 Page 77
78 Lab Experiment 10: Introduction to PID controller
The DC gain of the plant transfer function is 1/20, so 0.05 is the final value of the output to a unit
step input. This corresponds to the steady-state error of 0.95, quite large indeed. Furthermore, the
rise time is about one second, and the settling time is about 1.5 seconds. Let's design a controller
that will reduce the rise time, reduce the settling time, and eliminates the steady-state error.
Proportional control:
The closed-loop transfer function of the above system with a proportional controller is:
P Controller Plant
R + e u 1 Y
KP
‐ 10 20
10 20
Kp=300;
contr=Kp;
sys_cl=feedback(contr*plant,1);
t=0:0.01:2;
step(sys_cl,t)
Semester ‐ 083 Page 78
79 Lab Experiment 10: Introduction to PID controller
Note: The MATLAB function called feedback was used to obtain a closed-loop transfer function
directly from the open-loop transfer function (instead of computing closed-loop transfer function
by hand). The above plot shows that the proportional controller reduced both the rise time and
the steady-state error, increased the overshoot, and decreased the settling time by small amount.
Proportional-Derivative control:
The closed-loop transfer function of the given system with a PD controller is:
PD Controller Plant
R + e u 1 Y
KP+KDs
‐ 10 20
10 20
Kp=300;
Kd=10;
contr=tf([Kd Kp],1);
sys_cl=feedback(contr*plant,1);
t=0:0.01:2;
step(sys_cl,t)
Semester ‐ 083 Page 79
80 Lab Experiment 10: Introduction to PID controller
This plot shows that the derivative controller reduced both the overshoot and the settling time,
and had a small effect on the rise time and the steady-state error.
Proportional-Integral control:
Before going into a PID control, let's take a look at a PI control. For the given system, the
closed-loop transfer function with a PI control is:
PI Controller Plant
R + e u 1 Y
KP+KI/s
‐ 10 20
10 20
Kp=30;
Ki=70;
contr=tf([Kp Ki],[1 0]);
sys_cl=feedback(contr*plant,1);
t=0:0.01:2;
step(sys_cl,t)
Semester ‐ 083 Page 80
81 Lab Experiment 10: Introduction to PID controller
We have reduced the proportional gain (Kp) because the integral controller also reduces the rise
time and increases the overshoot as the proportional controller does (double effect). The above
response shows that the integral controller eliminated the steady-state error.
Proportional-Integral-Derivative control:
Now, let's take a look at a PID controller. The closed-loop transfer function of the given system
with a PID controller is:
PID Controller Plant
R + e u 1 Y
KP+KI/s+ KDs
‐ 10 20
10 20
After several trial and error runs, the gains Kp=350, Ki=300, and Kd=50 provided the desired
response. To confirm, enter the following commands to an m-file and run it in the command
window. You should get the following step response.
Kp=350;
Ki=300;
Kd=50;
contr=tf([Kd Kp Ki],[1 0]);
sys_cl=feedback(contr*plant,1);
t=0:0.01:2;
step(sys_cl,t)
Semester ‐ 083 Page 81
82 Lab Experiment 10: Introduction to PID controller
Now, we have obtained a closed-loop system with no overshoot, fast rise time, and no steady-
state error.
The proportional controller (KP) will have the effect of reducing the rise time and will reduce,
but never eliminate, the steady state error. An integral controller (KI) will have the effect of
eliminating the steady state error, but it may make the transient response worse. A derivative
control (KD) will have the effect of increasing the stability of the system, reducing the overshoot
and improving the transient response.
Effect of each controller KP, KI and KD on the closed-loop system are summarized below
Note that these corrections may not be accurate, because KP, KI, and KD are dependent of each
other. In fact, changing one of these variables can change the effect of the other two. For this
reason the table should only be used as a reference when you are determining the values for KP,
KI, and KD.
Exersice:
400
G p (s)
s ( s 48.5)
Based on your results in parts b) and c) above what do you conclude as a suitable PID controller
for this process and give your justification.
Semester ‐ 083 Page 82
83 Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor
CISE 302
Linear Control Systems
Lab Experiment 11: Open Loop and Closed Loop position control of DC
Motor
Objective: To familiarize the servo motor system and experience the open and closed loop
control of servo system to be used in an automatic position control system.
List of Equipment/Software
Following equipment/software is required:
LabVIEW
DC Servo System (feedback equipment)
a. OU150A Op Amp Unit
b. AU150B Attenuator Unit
c. PA150C Pre-Amplifier Unit
d. SA150D Servo Amplifier
e. PS150E Power Supply
f. DCM150F DC Motor
g. IP150H Input Potentiometer
h. OP150K Output Potentiometer
i. GT150X Reduction Gear Tacho
j. DC Voltmeter
Deliverables
A complete lab report including the following:
Semester ‐ 083 Page 83
84 Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor
1. Attach the AU150B, SA150D and DCM150F to the baseplate by means of the magnetic
fixings.
2. Fix the plugs from the servo amplifier into the power supply.
3. Fix the plug from the motor unit into the servo amplifier.
4. Attach the GT150X to the baseplate by means of the magnetic fixing and position it so
that it is connected to the motor shaft by means of the flexible coupling.
6. Use a push-on coupling to link a low-speed shaft of the GT150X to the output
potentiometer shaft.
7. Starting with AU150B the potentiometer knob at the fully counter-clockwise position
gradually turn it till the motor just rotates and record:
10. Return the output rotary potentiometer cursor to zero by turning the GT150X high-speed
shaft.
11. Decide on a position in the direction (2), you wish the potentiometer shaft to turn to and
then turn the AU150B potentiometer knob to position (1). As the cursor nears the
required angle, reduce this input signal so that the cursor comes to rest nearly at the
required point.
The open loop system will have you as a feedback. Such a system could be shown as in the
figure.
Semester ‐ 083 Page 84
85 Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor
Semester ‐ 083 Page 85
86 Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor
2. This shall utilize the error signal output VO of the operational amplifier to drive the
output potentiometer via the pre-amplifier and motor.
3. The upper potentiometer on the AU150B can now be used as a gain control and should
initially be set to zero before switching on the power.
4. Adjust the PA150C `zero set' so that the motor does not rotate.
5. Now set the IP150H to some arbitrary angle and increase the gain control setting.
6. The output potentiometer cursor should rotate to an angle nearly equal to that of the input
potentiometer cursor.
Trouble-shooting:
Make sure that the upper potentiometer on the AU150B is all down to zero (i.e.
the gain is equal to zero) and then rotate the zero set knob on pre-amplifier
PA150C so that the motor stop rotating or oscillating.
After increasing the gain (i.e. make the upper potentiometer on the AU150B other
than zero) the motor behaves in the same way then change the order of connection
from pre-amplifier to servo-amplifier (i.e. if the output “3” and “4” of pre-
amplifier PA150C is connected to input “1” and “2” of the servo-amplifier
SA150D respectively then change it such that the output “3” and “4” of pre-
amplifier PA150C is connected to input “2” and “1” of the servo-amplifier
SA150D respectively or vice-versa)
Semester ‐ 083 Page 86
87 Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor
Semester ‐ 083 Page 87
88 Lab Experiment 11: Open Loop and Closed Loop position control of DC Motor
Double-click the icon which says “motor” ( ) on the desktop to start the program to
capture the signal. And click the “run” button which is the first button on the toolbox below the
file menu. The program should be as shown below.
Identify from the setup the equipment which should be place in the following block diagram
Plant equipment
Controller
IP150H + equipment
Y(s)
___ PA150C
SA150D,__________,
______ _________________,
‐ __________,OP150K
Semester ‐ 083 Page 88
89 Lab Experiment 12: PID Controller Design for Two Tank System
CISE 302
Linear Control Systems
Lab Experiment 12: PID Controller Design for Two Tank System
Objective: To familiarize the Two Tank System and experience the PID controller design to
control the level of the tank system.
List of Equipment/Software
Following equipment/software is required:
LabVIEW
NI USB 6009 Data Acquisition Card
Two Tank System
Deliverables
A complete lab report including the following:
Semester ‐ 083 Page 89
90 Lab Experiment 12: PID Controller Design for Two Tank System
In this exercise, two-tank system is introduced. The two tank system is as shown in the figure. It
has a water pump which takes in 0..10 voltages and pumps in water with speeds depending at the
voltage supplied. Two outputs which are the speed of flow and the level of water in the tank are
shown visually. There are speed and level sensors that provide voltages between 0 and 10
voltages to indicate speed and voltage. The yellow filled area shows the flow of water from
pump to tank to reservoir through valves. The flow from tank to reservoir can be controlled using
the value. At “0” indicator the valve is “fully closed” and at “5” it is “fully opened”.
This exercise will interface the tanks output to analog inputs to measure the tank level and speed
of flow and use the analog voltage output of the USB 6009 to voltage input of the tank to run the
pump motor. Use your knowledge of previous experiments to send a constant voltage out of the
USB card and receive the two analog signals.
To conduct this experiment, we will have to first connect the 2-Tank system to LabVIEW
through the NI DAQ card. The steps are as follows:
1. Connect the sensor of the tank system (top-most pin) to any Analog Input (AI) pin of the
DAQ card.
2. Next connect the motor (2nd last/above ground) to an Analog Output (AO) pin.
3. Connect the ground of the tank (bottom most) pin to a ground of the DAQ.
Now the hardware wire connections are complete and we can start building the VI:
1. Use two sets of “DAQ Assistant” to capture the analog signal of level at the channel.
And use one “DAQ Assistant” to send a signal from USB 6009 to the tank.
2. Use a Knob to select the voltage being sent from the USB 6009 to Tank. “Knob” can be
found at “Controls” >> “Num Ctrls” >> “Knob”
3. Use the tank level indicator from “Controls” >> “Numerical Ind” >> “Tank” to
display the output of tank level.
4. Use the “Flat sequence” in the block diagram from “Functions”>> “Structures” >>
“Flat Sequence” to send the analog out signal first from computer to two tank and then
read the two analog inputs signals from two tank to computer.
5. Add frames on the flat sequence by right clicking on the border of the flat sequence and
selecting “Add frame after” from the menu.
Note: Connect all the wiring and use a while loop and stop button to run the VI.
Semester ‐ 083 Page 90
91 Lab Experiment 12: PID Controller Design for Two Tank System
Proportional Controller (part of the PID controller) is a common feedback loop component
in industrial control systems. The controller takes a measured value from a process or other
apparatus and compares it with a reference setpoint value. The difference (or "error" signal) is
then used to adjust some input to the process in order to bring the process' measured value back
to its desired setpoint. Basically, when the controller reads a sensor, it subtracts this
measurement from the "setpoint" to determine the "error". It then uses the error to calculate a
correction to the process's input variable (the "action") so that this correction will remove the
error from the process's output measurement.
It is used mainly to handle the immediate error, which is multiplied by a constant P (for
"proportional"), and added to the controlled quantity. P is only valid in the band over which a
controller's output is proportional to the error of the system. This is known as the Propotional
Band, often abbreviated as Pb. A controller setting of 100% proportional band means that a
100% change of the error signal (setpoint – process variable) will result in 100% change of the
output, which is a gain of 1.0. A 20% proportional band indicates that 20% change in error gives
a 100% output change, which is a gain of 5.
Pb = 100/gain OR
With proportional band, the controller output is proportional to the error or a change in
measurement (depending on the controller). So,
(controller output) = (error)*100/(proportional band)
This theory will be implemented on the 2-Tank system in this experiment. The controller will be
designed in a VI while the hardware connections remain the same- as shown below:
1. Connect the sensor of the tank system (top-most pin) to any Analog Input (AI) pin of the
DAQ card.
2. Connect the +5 In and GND In pins of the Amplifier to the 5V and ground terminals of
the Power supply.
3. Connect the negative input of the amplifier you are using, A- In or B- In, to ground and
connect the positive inputs, A+ In or B+ In, to an Analog Output (AO) pin of the DAQ.
4. Next connect the motor (2nd last/above ground) to the Amplifier Output i.e. A Out or B
Out.
5. Connect the ground of the Amplifier to the ground of the DAQ.
6. Connect the ground of the tank (bottom most) pin to a ground of the DAQ.
Note: Make sure that ALL devices are connected to a common ground.
The VI will be build as follows:
Semester ‐ 083 Page 91
92 Lab Experiment 12: PID Controller Design for Two Tank System
Semester ‐ 083 Page 92
93 Lab Experiment 12: PID Controller Design for Two Tank System
Semester ‐ 083 Page 93
94 Lab Experiment 12: PID Controller Design for Two Tank System
The next step in PID control is the inclusion of the Integral component – It is needed to learn
from the past. The error is integrated (added up) over a period of time, and then multiplied by a
constant Ki (making an average), and added to the controlled quantity. A simple proportional
system either oscillates, moving back and forth around the setpoint because there's nothing to
remove the error when it overshoots, or oscillates and/or stabilizes at a too low or too high value.
By adding a proportion of the average error to the process input, the average difference between
the process output and the setpoint is continually reduced. Therefore, eventually, a well-tuned
PID loop's process output will settle down at the setpoint. As an example, a system that has a
tendency for a lower value (heater in a cold environment), a simple proportional system would
oscillate and/or stabilize at a too low value because when zero error is reached P is also zero
thereby halting the system until it again is too low. Larger Ki implies steady state errors are
eliminated quicker. The tradeoff is larger overshoot: any negative error integrated during
transient response must be integrated away by positive error before we reach steady state. The
integral component is always used with the proportional one and is so referred to as PI
controller.
This theory will be implemented on the 2-Tank system in this experiment. The controller will be
designed in a VI while the hardware connections remain the same- as shown below:
1. Connect the sensor of the tank system (top-most pin) to any Analog Input (AI) pin of the
DAQ card.
2. Connect the +5 In and GND In pins of the Amplifier to the 5V and ground terminals of
the Power supply.
3. Connect the negative input of the amplifier you are using, A- In or B- In, to ground and
connect the positive inputs, A+ In or B+ In, to an Analog Output (AO) pin of the DAQ.
4. Next connect the motor (2nd last/above ground) to the Amplifier Output i.e. A Out or B
Out.
5. Connect the ground of the Amplifier to the ground of the DAQ.
6. Connect the ground of the tank (bottom most) pin to a ground of the DAQ.
Note: Make sure that ALL devices are connected to a common ground.
Semester ‐ 083 Page 94
95 Lab Experiment 12: PID Controller Design for Two Tank System
2. The 2nd frame to receive the sensor signal from the Tank, scale it properly and display it
on the front panel in a graph as well as tank format- using DAQ Assistant, Waveform
Chart, Tank and other numeric icons.
3. The last frame to manually terminate the execution of the program through a stop button
on the front panel and make sure the motor is turned off at the end- using DAQ
Assistant, Case Structure and Numeric Constant.
4. (The entire Flat Sequence must be included in the while loop and the Stop button
terminal must be connected to the stop button of the while loop)
5. Calculate the Error by subtracting (“Functions” >> Programming>> “Numeric” >>
“Subtract”) the sensor value or level from the desired set point. The set point can be
given in the form of a Numeric Constant in the Block diagram or through Vertical pointer
slides, Numeric controls, etc. on the Front panel. This can be done in the 2nd or 3rd frame.
6. On the front panel, add 2 Control Knobs from the Numeric palette. This will be used to
control the Proportional gain Kp and the Integral Gain KI.
7. In the 3rd frame of the Block diagram sequence, check if the error is less than zero. If it is,
then send the tank 0.If not go to the next step. The comparison can be made using the
Case Structure and the “Lesser Or Equal?” function.
8. Multiply the error with the gain by connecting the error and gain terminal to a
multiplication block. Also, integrate the error by sending it to the Integral block
(“Functions” >> Mathematics>> Integ & diff >>Time Domain Math- select Integral
in this block) and then multiply the integrated error with the Integral gain as was done
with the Proportional gain. Next, add the 2 products together (use compound arithmetic
or 2 add functions). Send the sum to the Tank through the DAQ Assistant.
9. In the same frame check the above product (input to controller) and if it is greater than 1
send one to the Tank system- using DAQ. If it is lesser than 0 send the tank 0. If it is
between 0 and 1, send the control input as it is. The comparison can be done using
“Greater Or Equal?” and “Lesser Or Equal?” functions along with a Case Structure
having another Case Structure inside (as in the On-Off Control). Here the control input is
connected to the Case Selector.
10. In the 2-Tank system open the exit valve a little to see the proper effect of the PI Control.
The valve can be opened to the number 2 position or another one depending on the speed
of the motor.
11. After all the wiring is complete switch to Front Panel and press the RUN button to
execute the VI.
Semester ‐ 083 Page 95
96 Lab Experiment 13: Simple Speed Control of DC Motor
CISE 302
Linear Control Systems
Lab Experiment 13: Simple Speed Control of DC Motor
Objective: Observe how the Simple Speed control system is constructed and appreciate the
importance of Tacho-generator in closed-loop speed control system.
List of Equipment/Software
Following equipment/software is required:
LabVIEW
DC Servo System (feedback equipment)
a. OU150A Op Amp Unit
b. AU150B Attenuator Unit
c. PA150C Pre-Amplifier Unit
d. SA150D Servo Amplifier
e. PS150E Power Supply
f. DCM150F DC Motor
g. IP150H Input Potentiometer
h. OP150K Output Potentiometer
i. GT150X Reduction Gear Tacho
j. DC Voltmeter
Deliverables
A complete lab report including the following:
Introduction:
In the last experiments we saw how simple position control could be constructed. In today's
assignment we shall see how simple speed control of motor could be done. In the experiment
involving the DC Motor Characteristics we saw how the signal inputs into SA150D could vary
the speed of the motor. This means that without any load you can set the motor to run at
specified speed determining the value of the input signal. What kind of speed control was it?
Semester ‐ 083 Page 96
97 Lab Experiment 13: Simple Speed Control of DC Motor
Now if we look at the torque/speed characteristics in the experiment, we can say that if load is
placed on the motor the speed of the motor will change to some extent. With open-loop system
the results show that there can be a reasonable speed control when operating without or with a
fixed load but the system would be very unsuitable where the load was varying.
With closed load, we will show improvement in speed control with respect to varying load. That
is, the actual speed will be compared to the required speed. This produces an error signal to
actuate the servo amplifier output so that the motor maintains a more constant speed.
In this exercise we will simply feedback a signal proportional to the speed, using the Tacho-
generator. We then compare it with a reference signal of opposite polarity, so that the sum will
produce an input signal into the servo amplifier of the required value. As comparator, we will use
an operational amplifier.
Semester ‐ 083 Page 97
98 Lab Experiment 13: Simple Speed Control of DC Motor
Before connecting the Tacho-generator to an input of the OA150A, increase the 'reference'
voltage so that the motor revolves and on your voltmeter determine which the Tacho’s positive
output is. The correct side can then be connected to OA150A input and the other side to 0V.
Reset the reference voltage to zero and then gradually increase it so that you can take readings
over the motor speed range of upto approximately 2000 r/min for the reference, tacho-generator
and error voltages.
Semester ‐ 083 Page 98
99 Lab Experiment 13: Simple Speed Control of DC Motor
200
400
600
800
1000
1200
1400
1600
1800
2000
To find the effect of the load on speed we can user the magnetic brake as a load. The change in
speed for a change in load will give us the regulation. Ensure that the eddy current brake disc is
fitted to the motor. Also ensure that the load unit can be fully engaged without fouling either the
motor mount or the eddy current disc.
The exercise is concerned to show how an increase in the forward path gain will cause a given
fall in speed to cause a larger increase in the value of the error V0, so that for any change in load
the speed drop or 'droop' will decrease with increase gain as shown in the figure.
Semester ‐ 083 Page 99
10 Lab Experiment 13: Simple Speed Control of DC Motor
0
For a gain control we can use the circuit given above, which has a gain of -1/α.
Semester ‐ 083 Page 100
10 Lab Experiment 13: Simple Speed Control of DC Motor
1
On the OA150A set the 'feedback selector' switch to 'external feedback'. On the LU150L swing
the magnets clear. Initially set the gain to unity, that is to position 10 of the upper potentiometer
and adjust the reference volts till the motor runs at 1000 r/min. Then take readings of the
reference voltage, Vin, Error voltage, Ve and the Tacho-generator voltage, using the voltmeter,
over the range of brake positions 0 – 10 and then tabulate your results in the following table. Be
careful that you do not exceed the 2A limiting current. Repeat the readings for a gain of 5,
which is to set the gain potentiometer to position 1. Re-adjust the reference potentiometer to give
no-load motor speed of 1000 r/min.
Semester ‐ 083 Page 101
10 Lab Experiment 13: Simple Speed Control of DC Motor
2
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
Plot your results in the form of graphs of error voltage against brake setting and speed for gain
values of 1 and 5.
In the last part of the experiment we will assemble a simple reversible speed control system.
From your reading you have seen that a high gain decreases the minimum reference signal
needed for the motor to respond so this exercise we will use high gain.
The inputs into the SA150D can drive the motor in opposite directions but both inputs require
positive voltages. As the output of the OA 150A varies from positive to negative it is necessary
to use the PA150C pre-amplifier unit that is so designed that a negative input gives a positive
voltage on output and a negative input gives a positive voltage on the other output with a gain of
about 25.
Semester ‐ 083 Page 102
10 Lab Experiment 13: Simple Speed Control of DC Motor
3
Replace the OA150A with PA150C. Setup as shown in the above figure, adjusting the reference
to zero output before coupling to the pre-amplifier. Set the pre-amplifier to 'ac compensation',
this will reduce the effect of ripple on the tacho-generator signal, which causes instability.
Set the potentiometer on AU150B to 5.
With no load on the motor, now find that you can invert the sign of the reference signal so that
you can reverse the direction of the motor rotation, by slowly turning the reference potentiometer
knob to either side of the center position 5. Record the reference voltage that just causes the
motor to rotate.
Forward Reverse
Semester ‐ 083 Page 103
10 Lab Experiment 13: Simple Speed Control of DC Motor
4
Set the speed of rotation in one direction to 1000 r/min and then take readings over the brake
position 0-10, and record them in the following table. To measure the error voltages place the
voltmeter across both the PA150C outputs.
Then reverse direction and repeat the readings.
Practical Aspects:
So important has the tacho-generator been considered in the speed control, that it has very often
been made an integral part of the motor.
Examples of speed control can be seen in every branch of industry and transport. They have
become particularly important in continuous processes such as in the control of sheet-metal
thickness in hot rolling mills, in generators and most industrial motors. In guidance systems,
automatic pilots, lifts and overhead hoists both reverse speed and positional control may be used.
Forward Reverse
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
Semester ‐ 083 Page 104