Académique Documents
Professionnel Documents
Culture Documents
EEE325
Control Systems
List of Contributors
Mr. Abdul Samad
Mr. Fahd Sikandar Khan
Mr. Raheel Ahmad
Mr. Mustafa Pasha
Mr. Waqar Saeed
Mr. Ahsan Malik
Dr. Jamshed Iqbal
ii
Preface
Infinite praise definitely goes to Allah Almighty, Who has given us motivation and strength
to compile this manual.
This manual supports the practical sessions of the course Control Systems for undergraduate engineering degrees. The manual comprises of sixteen experiments which cover
software as well as hardware aspects of control. The hardware experiments consists of
working with platforms like PLC (Exp. 1-3), Rectilinear plant (Exp. 5,13), COM3 lab (Exp.
11), Servo motor trainer (Exp. 12) and Robotic arm (Exp. 14). The software based
experiments mainly use Matlab and Simulink tools and implement the concrete concepts
being taught in theoretical lectures. The theme of the semester course project Robian is
listed at Exp. 16.
The third edition offers significant improvements from previous manual. In an attempt to
make the students capable of correlating theoretical concepts with physical systems, three
new experiments exploiting high-tech in-house facilities have been included in this edition.
While writing this manual, the two main focuses were systematic explanation and problem
solving methodology. Keeping in view these objectives, most of the experiments using
Matlab/Simulink have either been rewritten or updated to reflect better understanding and
illustration.
We hope and pray that you will find this manual useful to enhance your skills and expertise.
Enjoy learning by doing !
iii
Contents
1
INTRODUCTION
TO
MATLAB
AND
SIMULINK,
SOLUTION OF
DIFFERENTIAL
10 STABILITY ANALYSIS VIA PHASE PORTRAIT, POLE ZERO MAP AND ROUTH HURWITZ
CRITERION. STABILITY DESIGN VIA ROUTH-HURWITZ CRITERION...........................62
17
iv
List of Tables
Table 1.1 NOR truth table ................................................................................................. 12
Table 1.2 NAND truth table .............................................................................................. 12
Table 3.5 Full stepping truth table .................................................................................... 25
Table 9.1 System types and errors .................................................................................... 59
Table 10.1 Higher Order Example .................................................................................... 63
Table 10.2 Fifth Order Example........................................................................................ 64
Table 10.3 Sixth Order System Example .......................................................................... 64
Table 12.1 Observation table (Open loop speed control).................................................. 71
Table 12.2 Observation table (Closed loop speed control) ............................................... 74
Table 14.1 ED7220C features .......................................................................................... 82
Table 14.2 Control commands .......................................................................................... 84
List of Figures
Figure 1.1 Parts of PLC ....................................................................................................... 2
Figure 1.2 PLC scan cycle................................................................................................... 3
Figure 1.3 Relay Structure .................................................................................................. 4
Figure 2.1 ON-delay timer operation ................................................................................ 13
Figure 2.2 OFF-delay timer operation............................................................................... 13
Figure 2.3 Retentive timer operation ................................................................................. 14
Figure 2.4 Control System ................................................................................................ 14
Figure 2.5 Water Tank System .......................................................................................... 17
Figure 2.6 Length measurement task ................................................................................ 18
Figure 2.7 PLC wiring diagram (Lab task 2) .................................................................... 19
Figure 2.8 Industrial control task ...................................................................................... 21
Figure 3.1 Flow Chart ....................................................................................................... 23
Figure 3.2 Inserting 1Sec. Clock ....................................................................................... 24
Figure 3.3 Inserting Sequencer.......................................................................................... 24
Figure 3.4 Inserting SeqN:x .............................................................................................. 24
Figure 3.5 Resultant Circuit .............................................................................................. 24
Figure 4.1 RLC circuit ...................................................................................................... 31
Figure 4.2 Simulink model of RLC circuit ....................................................................... 31
Figure 4.3 RLC circuit for Task 3 ..................................................................................... 32
Figure 5.1 Single Mass-Spring-Damper system ............................................................... 34
Figure 5.2 Test inputs used in control systems ................................................................. 35
Figure 5.3 Experimental control systems .......................................................................... 35
Figure 5.4 Electromechanical plant ................................................................................... 36
Figure 5.5 Rectilinear apparatus........................................................................................ 37
Figure 5.6 Mass-spring-damper system for the experiment .............................................. 37
Figure 5.7 Overall rectilinear system ............................................................................... 38
vi
viii
Abbreviations
CPU
DOF
Degree Of Freedom
EPROM
EEPROM
Electrically EPROM
FBD
FRD
IEC
I/O
Input/Output
I/p
Input
LED
LS
Limit Switch
LTI
MATLAB
MATrix LABoratory
O/p
Output
ODE
OS
Over Shoot
PID
PLC
PWM
RLC
RPM
RT
RoboTalk
ix
Experiment 1
Equipment/Tools required:
PLC(Triangular Research Inc.), PC with TRiLOGI software, connecting leads
etc.
Introduction:
A Programmable Logic Controller (PLC) is a specialized computer used to
control machines and processes. It uses a programmable memory to store instructions
and execute specific functions that include on/off control, timing, counting,
sequencing, Arithmetic and data handling. The design of most PLCs is similar to that
of other computers. Basically, the PLC is an assembly of solid-state digital logic
elements designed to make logical decisions and provide outputs. Programmable
logic controllers are used for the control and operation of manufacturing process
equipment and machinery.
PLC Definition:
The term programmable logic controller is defined as follows by EN 611311 (IEC 61131-1).
A digitally operating electronic system, designed for use in an industrial
Environment, which uses a programmable memory for the internal storage of useroriented instructions for implementing specific functions Such as logic, sequencing,
timing, counting and arithmetic, to control, through digital or analogue inputs and
outputs, various types of machines or processes.
History:
In the start of 19th century more and more industries were tend to converted as
Automated. At that time it was done using Relays and Switches.
In the late 1960's PLCs were first introduced by Bedford Associates
MODICON 084. The primary reason was to eliminating complicated relay
based machine control systems.
In the mid70's As conventional microprocessors evolved, larger and larger PLCs
were being based upon them. Communications abilities began to appear in
approximately 1973.
The 80's saw an attempt to standardize communications with General Motor's
manufacturing automation protocol (MAP). It was also a time for reducing the
size of the PLC and making them software programmable through symbolic
programming on personal computers
The 90's have seen a gradual reduction in the introduction of new protocols, and
the modernization of the physical layers of some of the more popular protocols
that survived the 1980's. The latest standard (IEC 1131-3) has tried to merge plc
programming languages under one international standard.
Characteristics of PLC:
Category
Relay
Price
Computer
PLC
Inexpensive Inexpensive
Expensive
Inexpensive
Size
Large
Small
Moderate
Small
Noise
Good
Fair
Excellent
Fair
Speed
Slow
Very Fast
Very Fast
Fast
Difficult
Simple
Simple
Difficult
Simple
Simple
Supported
Supported
Supported
System Modification
Troubleshooting
Complex
Function
Support
Digital Design
Very
Difficult
Very
Difficult
None
Parts of PLC:
A typical PLC can be divided into following parts: (Figure 1.1)
Central processing unit (CPU).
Input/Output (l/O) section.
Power supply.
Programming device.
Communication Port.
Extending PLC:
Every PLC controller has a limited number of input/output lines,
If needed this number can be increased through certain additional modules by
system extension through extension lines.
Each module can contain extension both of input and output lines.
Also, extension modules can have inputs and outputs of a different nature
from those on the PLC controller (ex. in case relay outputs are on a controller,
transistor outputs can be on an extension module).
Adjust Output
Run Program
PLC Programming:
According to International Electrotechnical Commission (IEC) 61131-3/EN 6131
standard, PLC can be programmed using following five different languages:
Ladder diagram (Graphical, Electrical Design base).
Function Block Diagrams (Graphical, Function Block base).
Statement lists (Text, Assembly base, use in Europe).
Structured text languages (Text, Pascal and C base).
Sequential function charts.(Text, Sequentially describes the flow and
conditions of manufacturing process).
Relay:
A relay is a simple electromechanical switch made up of an electromagnet and
a set of contacts. Relays are used where it is necessary to control a circuit by a lowpower signal (with complete electrical isolation between control and controlled
circuits), or where several circuits must be controlled by one signal.
Ladder Diagrams:
Ladder Diagram is graphical depiction of a process with rungs of logic,
similar to the relay ladder logic schemes that were replaced by PLCs. The main
function of the ladder logic diagram program is to control outputs based on input
conditions. This control is accomplished through the use of what is referred to as a
ladder rung. In general, a rung consists of a set of input conditions, represented by
contact instructions, and an output instruction at the end of the rung is represented by
the coil symbol.
LAB TASKS:
Task1: Using TRiLOGI software, design a circuit to control single bulb with single
switch
STEPS:
1. First define Inputs, Outputs and Relay labels on paper. Draw a sketch
of wiring diagram. This diagram may look as shown below
3. Open pull-down "File" menu and select "New". Save the file as
Lab1_Task1.
4. Open up the I/O label editing Window by pressing <F2>.
6. Move the deep blue color highlight bar to Input #1 position by clicking
on it. Click again to open up a text field for entering the name for Input
#1.
7. Enter the name "Switch" for Input #1. Press <Enter> key to accept the
name.
8. Press <Enter> key again and the highlight bar will be moved to Input
#2.
9. Repeat above steps for Outputs, Relay, Timer and Counters as per
requirement.
Now you are ready to Design your first ladder logic Circuit (Rung).
(Design fallowing ladder diagram and simulate).
1. With the circuit pointer (red color triangle) at Circuit #1, press the <Spacebar>
to enter the "Ladder Edit" mode
2. Once you enter the "Ladder Edit" mode, a row of ladder icons appear along the
top of the main TRiLOGI window just below the pull down menu. The following
is a description of each item. A yellow color highlight bar, which you can move
to select an element in the ladder circuit, will appear.
PLC does not know itself which switch you want to use for the input Start
and which LEDs will be used for the outputs Y1 and Y2. We have to map the
input and outputs by connecting simple jumper wires.
iii.
Now from the main menu, select Controller -> Program transfer to PLC or simply
press Ctrl + T as shown below.
You will get following dialog window prompting for Servers details.
You do not have to enter any password. Just click on Detect ID. It will
automatically scan the device and give its ID in hexadecimal format.
You are almost done. But wait, do not go before monitoring the
behavior/performance of your program. There are two ways of doing this. You
should try both ways.
i.
ii.
From PLC itself: By giving the input through switch and visually observing the
outputs from LEDs.
From Trilogy: From main menu bar, select
Controller -> On-Line Monitoring or simply press Ctrl + M.
Lab Task-1
Lab Task-2
Instructor Signature
Lab Task-3a
3 Inputs OR Gate:
Lab Task-3b
Lab Task-3c
Lab Task-3d
Instructor Signature
10
D0
D1
D2
D3
D4
D5
D6
D7
Lab Task-4
Instructor Signature
11
Home Tasks:
1.
Y
F1
12
Experiment 2
Equipment/Tools required:
PLC(Triangular Research Inc.), PC with TRiLOGI software, connecting leads
etc.
Introduction:
Timers:
A timer is a special kind of relay that, when its coil is energized, must wait for
a fixed length of time before closing its contact. The waiting time is dependent on the
"Set Value" (SV)of the timer (1 S.V unit = 100mSec). Once the delay time is up, the
timer's N.O. contacts will be closed for as long as its coil remains energized. When
the coil is de-energized (i.e. turned OFF), all the timer's N.O. contacts will be opened
immediately.
However, if the coil is de-energized before the delay time is up, the timer will
be reset and its contact will never be closed. When a last aborted timer is reenergized, the delay timing will restart afresh using the SV of the timer and not
continue from the last aborted timing operation.
In general, there are three different timers - the ON-delay timer, OFF-delay
timer and retentive timer.
ON-delay timer:
The on-delay timer operates such that when the rung containing the timer is
true, the timer time-out period commences. At the end of the timer time-out period, an
output is made active.
Input
Output
Figure 2.1 ON-delay timer operation
OFF-delay timer:
The off-delay timer operation will keep the output energized for a time period
after the rung containing the timer has gone false.
Input
Output
Figure 2.2 OFF-delay timer operation
13
Retentive Timer:
A retentive timer accumulates time whenever the device receives power, and it
maintains the current time should power be removed from the device. Once the device
accumulates time equal to its preset value the contacts of the device change state.
Input
Output
Figure 2.3 Retentive timer operation
Counters:
A counter is also a special kind of relay that has a programmable Set Value
(SV). When a counter coil is energized for the first time after a reset, it will load the
value of SV-1 into its count register. From there on, every time the counter coil is
energized from OFF to ON, the counter decrement its count register value by 1. Note
that the coil must go through OFF to ON cycle in order to decrement the counter. If
the coil remain energized all the time, the counter will not decrement. Hence counter
is suitable for counting the number of cycles an operation has gone through.
When the count register hits zero, all the counter's N.O. contacts will be turned
ON. These counter contacts will remain ON regardless of whether the counter's coil is
energized or not. To turn OFF these contacts, you have to reset the counter using a
special counter reset function [RSctr].
In general, there are two different counters UP-counters and DOWNcounters.
UP-counters:
The up-counter is incremented by 1 each time the rung containing the counter
is energized.
DOWN-counters:
The down-counter decrements by 1 each time the rung containing the counter
is energized.
Sensor
PLC
14
Actuator
Sensors.
A sensor (also called detectors) is a device that measures a measurable
attribute and converts it into a (Electrical or Mechanical) signal which can be read by
an observer or by an instrument.
There
are
wide
rage
Temperature, Magnetic
of
sensors
available
like
Light,
Motion,
Pressure, Electrical Fields, Sound, And Other Physical Aspects Of The External
Environment.
Digital Sensor is a modified form of switch, as a switch contain two states i.e.
0 for OFF and 1 for ON. Same as Digital Sensors how sense a signals of different
forms and send signals accordingly.
Actuators
An actuator is a type of motor for moving or controlling a mechanism or
system. It is operated by a source of energy, usually in the form of an electric
current, hydraulic fluid pressure or pneumatic pressure, and converts that energy into
some kind of motion.
There are different types of Actuators available like Solenoids, Wheel and
axle and Screw type
Power Supply
A power supply is a device that supplies electrical energy to one or
more electric loads. PLCs are available in market to work on wide range off power
supplies from 5V DC to 220V AC as per requirement of industry operations.
There are two types of Digital I/O exist in PLC.
1. Sinking
2. Sourcing.
Sinking
At 0 state the I/P pin provides ground as common and make it to state 1
connects the pin to the +ve terminal of supply. As same for O/P, the pin provides
GND as common and when it switches-on it provides +ve voltage to the output.
15
Sourcing
Sourcing is inverse to sinking, at 0 state, I/P pin provides +ve as common
and to convert it to state 1 connects it to the GND terminal of supply. For O/P, the
pin provides +ve at OFF and when it switch-on it provides GND as a signal.
(Triangle Research TD100MD PLC is designed on Sourcing Principle)
Push-ON/Push-OFF
To control an output in toggle switch manner, using a single push batten to
ON and OFF an output.
o DIFU
Differential-up (DIFU) is one of the belt in special function in PLC. When the
execution condition for [DIFU] goes from OFF to ON, the designated output or relay
will be turned ON for one scan time only. After that it will be turned OFF.
16
Lab Tasks:
Lab Task No 1a:
Fallowing is the diagram of home water tank filling system. Design the
solution for the system using TD-100MD PLC.
The motor should start filling the tank-1 when the water level of tank-1 goes
down to lower level and stops if the tank-1 file up or tank-2 goes out of water.
(Note: This is a sequential logic Problem, Carefully implement the sensors
NO/NC states)
Sensor-1
Tank-1
Sensor-2
Motor
Tank-2
Sensor-3
17
START
STOP
RESET
Hint, the counter should be enabled for counting based on readings of magnetic
sensor AND photoelectric sensor. The PLC wiring diagram for this task is presented
in Figure 2.9.
18
19
Lab Task-1a
Lab Task-1b
Instructor Signature
Lab Task-2
Instructor Signature
20
Home Tasks:
Design water level Sensor
Design Milk Packing System.
Design ladder logic program that will correctly execute the industrial control
process in. The sequence of operation is as follows:
Product in position (limit switch LS1 contacts close).
The start button is pressed and the conveyor motor starts to move the product
forward toward position A (limit switch LS1 contacts open when the actuating arm
returns to its normal position).
The conveyor moves the product forward to position A and stops (position
counted by 8pulses of an up-counter).
A time delay of 10s occurs, after which the conveyor starts to move the product to
limit switch LS2 and stops (LS2 contacts close when the actuating arm is hit by the
product).
An emergency stop button is used to stop the process at any time.
MOTOR
START
STOP
Figure 2.8 Industrial control task
21
Experiment 3
Equipment/Tools required:
PLC(Triangular Research Inc.), PC with TRiLOGI software, connecting leads
etc.
Introduction:
Sequencers in Trilogi:
A sequencer is a highly convenient feature for programming machines or
processes which operate in fixed sequences. These machines operate in fixed, clearly
distinguishable step-by-step order, starting from an initial step and progressing to the
final step and then restart from the initial step again. At any moment, there must be a
"step counter" to keep track of the current step number. Every step of the sequence
must be accessible and can be used to trigger some action, such as turning on a motor
or solenoid valve, etc.
i-TRiLOGI Version 5 supports up to eight sequencers of 32 steps each. Each
sequencer uses one of the first eight counters (Counter #1 to Counter #8) as its step
counter. Any one or all of the first eight counters can be used as sequencers "Seq1" to
"Seq8".No. of Sequencer supported by PLC Hardware depends upon its Model.
22
LAB TASKS:
Task1: Using TRiLOGI software, control 4 LEDs in Sequence of 1 sec. i.e Each
LED glow for 1 Sec after one another.
STEPS:
1. First define Inputs, Outputs and Relay labels on paper and sketch flow
chart. This diagram may look as shown below.
Start
Puls
LED_
LED_
LED_
LED_
23
9. In Next Rung (Circuit #2) Select input then Special Bits and then
SeqN:x. know select sequencer number and specify the step number.
Lab Task No 2:
Create the following output pattern using sequencers.
Out1
Out2
Out3
Out4
Out5
Lab Task No 3:
Design Full Step Stepper Motor Controller for forward and reverse Drive.
Table 3.5 Full stepping truth table
Outputs
Step no. in
forward direction
1
2
3
1
1
1
0
2
0
1
1
3
0
0
1
4
1
0
0
4
0
0
1
1
Lab Task-2
25
Lab Task-3
Instructor Signature
Home Task:
Implement 3 bit ring counter which counts from 000, 001, . 111 using
sequencers.
Implement two way traffic signal (Red-30s, Green-30s, Yellow-5s)
(Red2)
(Red1)
(Yellow2)
(Yellow1)
(Green2)
(Green1)
Right
Left
lane
lane
26
Experiment 4
Introduction:
Typically, control engineers begin by developing a mathematical description of the
dynamic system that they want to control. The system to be controlled is called a
plant. This plant is normally represented in some form for controlling it.
MATLAB Functions:
Important MATLAB functions used for building linear models include:
sys = tf(num,den) % Transfer function
sys = zpk(z,p,k) % Zero/pole/gain
sys = ss(a,b,c,d) % State-space
sys = frd(response,frequencies) % Frequency response data
% is used to write comments in MATLAB.
Explore these functions from help of the MATLAB and construct your models.
27
where s is the Laplace variable, N(s) is the numerator polynomial, and D(s) is
the denominator polynomial.
Create a SISO transfer function model in polynomial form using:
G = tf(num,den)
where num and den are row vectors of coefficients of the polynomials N(s)
and D(s), respectively. These row vectors are ordered in descending powers
of s. G is a tf model object.
For example, create the transfer function G(s) = s/(s2 + 2s + 1), using:
G = tf([1 0],[1 2 1]);
Alternatively, you can specify the same tf model as a rational expression in
the Laplace variable s:
s = tf('s');
where:
k is a real- or complex-valued scalar gain.
z1 ,..., zm are the real or complex conjugate pairs of zeros of the transfer
function G(s) roots of the numerator polynomial N(s).
p1 ,..., pn are the real or complex conjugate pairs of poles of the transfer
function G(s) roots of the denominator polynomial D(s).
28
s = zpk('s');
G = s/(s+1)^2;
Where
A, B, C, and D are matrices of appropriate dimensions,
x is the state vector ,
u and y are the input and output vectors respectively.
State space representation will be discussed further in experiments 14 & 15
29
ans =
Introduction to Simulink:
Modelling in Simulink is based on a six steps mentioned below:
The first three steps are performed outside the Simulink prior to building the
model. To let you grasp the concept well, an example is stated below.
Example
or in s domain
v(s)/U(s) =3 / s2+4s+3
31
Lab Tasks:
Lab Task No 1:
Considering G(s), prove that tf2zp() and zp2tf() are inverse of each other.
Also, prove that laplace() and illaplace() exhibits the same property.
Lab Task No 2:
Find inverse laplace transform f(t) & hence find inverse from partial fraction
form (use MATLAB to compute the residues). Where
Lab Task No 3:
Consider the following RLC circuit (Fig 4.3) and take values of your choice.
Make a mathematical equation of this circuit (taking your own defined values) and
than make its Simulink block diagram.
32
Experiment 5
Equipment/Tools required:
Rectilinear Plant with controller interfaced with PC
Introduction:
The modelling elements of a translational mechanical system include mass,
spring and damper. Mass is an element which resists the motion due to inertia.
According to Newtons law,
33
(a)
(b)
(c)
The resistive forces aroused from mass, spring and damper are given be
equations mentioned above. According to DAlemberts principle, for any body, the
algebraic sum of externally applied forces and the forces opposing the motion in any
given direction is zero. Thus,
External force = Resistive forces
34
Input / Output
Electronics
Electromechanical
Plant
DSP Based
Controller / Data
Acquisition Board
System Interface
Software
("Executive Program")
The first of these is the electromechanical plant (Figure 5.4) which consists of
the spring/mass mechanism, its actuator and sensors. The design features a brushless
35
The second subsystem is the real-time controller unit which contains the
Digital Signal Processor (DSP) based real-time controller, servo/actuator interfaces,
servo amplifier, and auxiliary power supplies. The DSP is capable of executing
control laws at high sampling rates allowing the implementation to be modelled as
being continuous or discrete in time.
commands and supports such functions as data acquisition, trajectory generation, and
system health and safety checks. A logic gate array performs motor commutation and
encoder pulse decoding.
This controller is
interface to the system and supports controller specification, trajectory definition, data
acquisition, plotting, system execution commands, and more.
Controllers may
assume a broad range of selectable block diagram topologies and dynamic order. The
interface supports an assortment of features which provide a friendly yet powerful
experimental environment.
The top and side views of the rectilinear plant are illustrated in Figure 5.5
36
Brushless
Servo
Motor
Encoder #1
Encoder #2
Encoder #3
Scale Rule
Interchangeable Springs
Dashpot Extension Bracket
TOP VIEW
Rack &
Pinion
Drive
Ball Bearing
Slides
Damping
Adjustment
Knob
Mass Carriages
SIDE VIEW
Procedure:
Calculations:
1. Express the system shown in Figure 5.5 using modelling symbols. Your
schematics should look like as shown in Figure 5.6.
Hardware:
7. Make sure that the equipment is connected as shown in Figure 5.7.
8. Secure two 500g masses each on the first, second and third mass carriages.
9. Make sure that the locking screws do not constrain the linear motion of the
mechanism.
10. From PC, open the ECP software.
11. Reset the controller using Utility tab. You will see Encoder data as zero
now.
38
39
Select an input and then click on Setup to set values of various parameters
of the input (Figure 5.12)
14. Execute the selected trajectory by Command tab -> Execute (Figure 5.13)
40
15. After clicking on Run, the trajectory is executed and the data samples are
collected (Figure 5.14)
17. Selecting Encoder 3 (for example) and then clicking on Plot Data, you
should see plot similar to that of Figureure 5.16.
41
42
Experiment 6
Introduction:
First order systems are those which, when modelled by differential equation
have only first order derivative i.e no higher order derivatives. In this lab, a number
of MATLAB functions are used to analyze these systems and plot their responses.
The basic functions and their representation are mentioned below:
For transfer function:
To represent a system in MATLAB by its transfer function we can use the
function TF(num,den). In num we define the coefficients of the numerator
terms of transfer function. In den we define the coefficients of the
denominator terms of transfer function.
>>sys_tf = TF (num, den); % where num and den are numerator and
% denominator matrices respectively and
% tf calculates transfer function.
For example consider a transfer function given by:
H= 2 s^2 + 3 s + 2
----------------------5 s^3 + 4 s^2 + 7 s + 1
The above transfer function can be implemented in MATLAB as
sys_tf= TF([2 3 2],[5 4 7 1);
For creating time matrix:
The function LINSPACE can be used for creating a linearly spaced vector.
The general format of this function is given below.
43
Natural response:
The impulse response of a system can be found using impulse function. The
general syntax is:
>>[y, t] = impulse (sys) Where sys is transfer function.
returns the impulse response y and the time vector t used for simulation.
The response can then be plotted using plot command as:
>> plot(y,t)
If only plot of impulse response is required then impulse function can be used
as:
>>impulse(sys)
Lab Tasks:
Lab Task No 1:
The standard form of a first order system is
Where T is the time constant of the system. For this transfer function,
a) Plot step response using step function for T=1, 2 and 3 seconds.
b) Comment the effect of time constant on the speed of the system
response.
c) Use lsim for generating step response and compare the results with
the ones calculated in part a.
Lab Task No 2:
Consider the transfer function,
Lab Task No 3:
Find the natural response of the following first order system. Assuming
v(0)=10.
46
Introduction:
A second order system can be represented generally as:
Md2y(t)/dt2 + B dy(t)/dt + Ky(t) = f(t)
If we define n = (K/M)1/2 and = B/2(KM)1/2
Then the general expression for the transfer function of a second order
system(assuming initial conditions to be zero) is:
The time domain expression for the response of second order system to a step input
is:
47
Swiftness of the response is measured by rise time Tr , and peak time Tp.
Steady-state error: ess
Percentage overshoot %OS.(maximum rise over steady state value)
Settling time: Ts. (time required for response to settle within 2% of final
value)
All the above mentioned parameters can be determined from the damping ratio and
natural frequency as can be seen from the mathematical expressions given below.
For second order system, we seek T s for which the response remains within 2% of
the final value. This occurs approximately when:
48
In this lab, a number of MATLAB functions are used to analyze systems and plot
their responses.
The basic functions and their representation are mentioned below:
POLE
POLE computes the poles of LTI models.
>> pole (sys)
Where sys can be transfer function or state space. This command gives poles
in a vector form.
STEP
STEP computes the step response of an LTI system and returns time and
magnitudes in y and t respectively.
>>[y, t] = step (sys)
Where sys can be transfer function or state space.
IMPULSE
IMPULSE calculates the impulse response of the LTI model SYS (created
with either TF, ZPK, or SS).
>>[y, t] = impulse (sys)
DAMP
For calculating natural frequency and damping of LTI model
[Wn, Z, P] = DAMP (SYS)
Returns vectors Wn ,Z and P containing the natural frequencies and damping
factors of the LTI model SYS.
49
Lab Tasks:
Lab Task No 1:
For wn =10rads/sec, plot the step response for general second order system for
zeta=0, 0.7, 1, 1.5, and compare the four systems.
Lab Task No 2:
For the four systems given in task 1 plot their poles and identify the effect of
pole locations on the settling time of the system.
Lab Task No 3:
Plot %OS vs. damping ratio and analyze the plot carefully.
Lab Task No 4:
For the system given below, find its unit step response and impulse response.
50
Experiment 7
Introduction:
Given below is brief description of new MATLAB functions used in this lab.
SERIES:
>>sys = SERIES(sys1,sys2)
Series connects two LTI models in series. This function accepts any
type of LTI model. The two systems must be either both continuous or both
discrete with identical sample time. Static gains are neutral and can be
specified as regular matrices.
PARALLEL:
>>sys = parallel(sys1,sys2)
Parallel connects two LTI models in parallel. This function accepts any
type of LTI model. The two systems must be either both continuous or both
discrete with identical sample time. Static gains are neutral and can be
specified as regular matrices.
FEEDBACK:
>>sys = FEEDBACK(sys1,sys2,1)
Feedback connects two systems in feedback order, where sys1 is the
forward path gain, sys2 is the feedback path gain and 1 specifies positive and
negative feedback respectively.
51
CONNECT:
Used for block-diagram interconnections of LTI models.
CONNECT constructs the aggregate model for a given block diagram
interconnection of LTI models. You can specify the block diagram
connectivity in two ways. We will consider one approach i.e. Name-based.
Name-based interconnection
In this approach, you name the input and output signals of all LTI blocks
SYS1, SYS2,... in the block diagram, including the summation blocks. The
aggregate model SYS is then built by
SYS = CONNECT(SYS1,SYS2,...,INPUTS,OUTPUTS)
Where
INPUTS and OUTPUTS are the names of the block diagram external I/Os
(specified as strings or cell arrays of strings).
Example:
Given SISO LTI models C and G, you can construct the closed-loop transfer T from r
to y using CONNECT function.
e
u
r --->O-->[ C ]---[ G ]-+---> y
- |
|
+<--------------------+
+
52
Lab Tasks:
Lab Task 1:
For the following Figures find the transfer function (C/R) using series, parallel
and feedback functions and plot unit step response for the system. Verify the
results using Simulink.
i.
ii.
iii.
53
Lab Task 2:
Using connect functions find the equivalent transfer function for block
diagram in Figure 7.4 and Figure 7.5. Plot the unit step response and verify
using Simulink.
Gi(s)=1/(s+1)
i.
ii.
54
Lab Task 3:
For the following system consider: Plant=Motor=1/[s(s+6)] and controller=k,
design a closed loop system with poles at 33j. Compare the motor system
response before and after implementation of controller
55
j, we need to
Experiment 8
Introduction:
Stable systems without dead time, which are described by the transfer function
and do not have zeros in the right half plane, are called minimum phase systems.
If a transfer function has poles and/or zeros in the right half plane then this system
shows non-minimum phase behaviour.
Given below is brief description of new MATLAB functions used in this lab.
ZERO:
>>[z, k]= ZERO (sys)
Where
sys can be transfer function or state space,
z output has zeros vector,
k has zeros associated gain vector.
PZMAP:
>> PZMAP(SYS)
where
Lab Tasks:
Lab Task 1:
For the following transfer function study the effect of additional zeros on the
response of second order system, note down the change in Ts, Tr, %OS,
damping ratio, un-damped natural frequency and poles of the system, let
D=s^2+2s+9
i.
G1(s)=9/D
ii.
G2(s)=((s+3)*9/3)/D
iii.
G3(s)=((s+5)*9/5)/D
iv.
G4(s)=((s+10)*9/10)/D
Lab Task 2:
Consider the following systems with D=s^2+2s+4, from the step response
determine which are minimum phase and which are non-minimum phase
systems. Compare the response of G1 and G2 (find Ts, Tr and Tp) for both,
which system is fast and why? Also compare systems G2 and G3, find pole
and zero for both systems and determine why both systems have different
responses?
i.
G1(s)=(s+4)/D
ii.
G2(s)=(-s+4)/D
iii.
G3(s)=(s-4)/D
Lab Task 3:
Consider the following systems and check whether pole zero cancellation
possible or not, justify your answer by some solid arguments.
i.
G1(s)=-(s-5)/{(s-4.99)(s+6)}
ii.
G2(s)=(s+5)/{(s+4.99)(s+6)}
57
Experiment 9
Introduction:
Steady-state error is defined as the difference between the input and output of
a system in the limit as time goes to infinity (i.e. when the response has reached the
steady state). The steady-state error depends on the type of input (step, ramp, etc) as
well as the system type (0, I, or II).
Note: Steady-state error analysis is only useful for stable systems
Equations to calculate steady-state errors from open-loop transfer functions
given different inputs:
Step Input (R(s) = 1/s):
System
Error
Type 0 systems
Type 1 systems
Type 2 systems
Step
Input
Ramp
Parabolic
1/(1+Kp)
1/Kv
1/Ka
Kp = constant
1/(1+Kp)
0
0
Kv = 0
infinity
1/Kv
0
Ka = 0
infinity
infinity
1/Ka
Lab Tasks:
Lab Task 1:
For the following systems find the static error constants, and then steady state
error for the following inputs:
i.
ii.
iii.
Also verify the results using MATLAB. Find the steady state error for unit step
input by creating E/R transfer function in MATLAB. Find steady state error for other
two inputs using MATLAB.
59
Lab Task 2:
For the following systems (i) and (ii), do the following tasks:
a) Find the value of k for which system yields e(t=infinity)=10%, verify
using MATLAB. Is the system stable at that gain?
b) From the MATLAB estimate the value of k for which the system
yields minimum e(t=infinity) (system should stay stable)?
c) Mention the advantages and disadvantages of increasing k (compare
steady state response with transient response and stability)?
i.
ii.
60
Lab Task 3:
For the following figure, do the following tasks:
a) Find e(t=infinity) for reference input only.
b) Find e(t=infinity) for disturbance input only.
c) Find e(t=infinity) for reference input+ disturbance input.
d) How can e(t=infinity) for disturbance input can be decreased (with
reference to k).
e) Can e(t=infinity) for disturbance input be made zero? If yes then how?
Note: G(s) is not correct; place zero in G(s) so that closed loop transfer
function becomes stable
61
Experiment 10
Introduction:
The RouthHurwitz stability criterion is a necessary and sufficient method
to establish the stability of a single-input, single-output (SISO), linear time invariant
(LTI) control system. More generally, given a polynomial, some calculations using
only the coefficients of that polynomial can lead to the conclusion that it is not stable.
The criterion establishes a systematic way to show that the linearized equations of
motion of a system have only stable solutions exp (pt), that is where all p have
negative real parts. It can be performed using either polynomial divisions or
determinant calculus.
62
, all
, and
polynomial
coefficients must satisfy
, all the
Higher-order example
A tabular method can be used to determine the stability when the roots of a higher
order characteristic polynomial are difficult to obtain. For an nth-degree polynomial
When completed, the number of sign changes in the first column will be the number
of non-negative poles.
Consider a system with a characteristic polynomial
63
0.75 1.5
In the first column, there are two sign changes (0.75 3, and 3 3), thus there
are two non-negative roots where the system is unstable. Sometimes the presence of
poles on the imaginary axis creates a situation of marginal stability. In that case the
coefficients of the "Routh Array" become zero and thus further solution of the
polynomial for finding changes in sign is not possible. Then another approach comes
into play. The row of polynomial which is just above the row containing the zeroes is
called "Auxiliary Polynomial".
Consider a system with a characteristic polynomial
20
16
12
16
12
16
64
which is
again equal to zero. The next step is to differentiate the above equation which yields
the following polynomial.
Phase Portrait:
A phase portrait is a geometric representation of the trajectories of a dynamical
system in the phase plane. Each set of initial conditions is represented by a different
curve, or point. Phase portraits are an invaluable tool in studying dynamical systems.
They consist of a plot of typical trajectories in the state space. A phase portrait graph
of a dynamical system depicts the system's trajectories (with arrows) and stable steady
states (with dots) and unstable steady states (with circles) in a state space. The axes
are of state variables.
65
Lab Tasks:
Lab Task 1:
For the following systems, find the range of K for stability using Routh
Hurwitz criterion. Verify using Simulink.
i.
ii.
iii.
Also find open loop stability, total response stability and natural response
stability. Also design K.
Lab Task 2:
Perform the phase portrait Analysis of the following systems:
i.
ii.
iii.
iv.
v.
vi.
66
Experiment 11
Introduction:
COM3LAB (developed by Ld-Didactic Germany) is an interactive,
multimedia, teaching and learning environment covering the theory and practice of
electrical engineering and electronics. It is intended for students as well as for
teachers to learn/teach the basic as well as advanced concepts in Control engineering.
Link at the end of this page gives a useful learning resource to get familiar with
COM3.
COM3LAB consists of a master unit and a number of different courses. The
courses consist of an experiment board (Figure 11.1) and the necessary software. Here
we only focus on Control Technology I board which is specifically targeted for
Control systems course.
Link: http://www.ld-didactic.de/pdf/COM3LAB_EN.pdf
67
Experiment 12
Introduction:
Servo motor trainer (developed by Tidiers Pool, Islamabad) is designed for the
study of angular speed and position transducers and their automatic controls. It
consists of a front panel with test-points and silk screen-printed electrical circuit
diagram (Figure 12.1), divided into blocks forming the control chain. These building
blocks include:
1. Set point
2. Error amplifier (Qty:2)
3. Potentiometer conditioner
4. Tacho generator conditioner
5. Speed detector
6. Digital RPM meter
7. PID controller
8. Current limiter
9. PWM power amplifier
10. Speed and position process unit
On the right side of the module, there are two terminals (a red one and a black
one) for the connection between the trainer and transducers of the external unit. The
external motor unit consists of a permanent magnet showing transparent/opaque radial
sectors (Figure 12.2).
69
(a)
(b)
(c)
70
Lab Tasks:
Lab Task 1 (Automatic open loop speed control)
The step by step procedure of this task is mentioned below:
o Carry out the circuit of Figure 12.3.
o Jump terminals 26-27 to insert the clamp circuit.
o Set a null load value with the knob of the mechanical brake.
o Set a 0V voltage with the knob of the mechanical brake.
o Fill Table 12.1 with these data.
o Repeat measurement for all the voltage values on the table.
o Bring the set point voltage back to 0V.
o Apply a significant load by acting on the brake knob. Take care not to
block the motor with a too strong breaking action.
o Repeat measurement s with load.
o Report in Graph 12.4 the set point voltage / rotating speed diagrams with
no load and load different from zero.
o Repeat measurements with negative set point and voltage values.
Set Point
Voltage
0
1
2
3
4
5
6
RPM
71
Speed
350030002000-
1000-
Set Point
1
V Point
Set
PID Controller
Amplifier
Signal
Motor
Transducer
Conditioner
Set Point: It is the block by which the desired input signal is given for the
whole circuit.
72
73
Voltage
0
1
2
3
4
5
6
7
8
9
RPM
Speed
350030002000-
1000-
Set Point
1
V Point
Home Task:
75
Experiment 13
Equipment/Tools required:
Rectilinear Plant with controller interfaced with PC
Introduction:
This control scheme, acting on plants modelled as rigid bodies finds broader
application in industry than any other.
machine tools, automobiles (cruise control), and spacecraft (attitude and gimbal
control). The block diagram for forward path PID control of a rigid body is shown in
Figure 13.1a where friction is neglected. Figure 13.1b shows the case where the
derivative term is in the return path. Both implementations are found commonly in
application and, as the student should verify, both have the identical characteristic
roots. They therefore have identical stability properties and vary only in their
response to dynamic inputs.
The closed loop transfer functions for the respective cases are:
c(s) =
c(s) =
(13.1a)
khw/m kp s+ki
x(s)
=
r(s)
s 3 + khw/m kds 2 +kp s+ki
(13.1b)
For the first portion of this exercise we shall consider PD control only (ki=0). For the
case of kd in the return path the transfer function reduces to:
c(s) =
khw/m kds+kp
s2 + khw/m kds+kp
76
(13.2)
By defining:
n =
kp khw
m
(13.3)
(13.4)
k k
kdkhw
kdkhw
kdkhw
=
= d hw =
2m n 2 mkp khw
2m n 2 mkp khw
c(s) =
2n
s2 +2n s + 2n
The effect of kp and kd on the roots of the denominator (damped second order
oscillator) of Eq (13.2) is studied in the work that follows.
r(s)
Reference Input
(E.g. Input
Trajectory)
k
kp + si + kds
khw
Hardware
Gain
PID Controller
1
ms2
Plant
x(s)
Output
(Mass position)
r(s)
Reference Input
(E.g. Input
Trajectory)
k
kp + si
khw
PID Controller
Hardware
Gain
1
ms2
Plant
kd s
77
x(s)
Output
(Mass position)
Procedure:
Proportional & Derivative (PD) Control Actions:
1. Construct a model of the plant with four 500g mass pieces on the
first mass carriage with no springs or damper attached. You may
neglect friction.
2. Set-up the plant in the configuration described in Step 1. There
should be no springs or damper connected to the first carriage
and the other carriages should be secured away from the range of
motion of the first carriage.
3. From Eq (13.3) determine the value of kp (kd=0) so that the
system behaves like a 2 Hz spring-mass oscillator.
4. Set-up to collect Encoder #1 and Commanded Position
information via the Set-up Data Acquisition box in the Data
menu. Set up a closed-loop step of 0 (zero) counts, dwell time =
3000 ms, and 1 (one) rep (via Trajectory in the Command menu).
5. Enter the Control Algorithm box under Set-up and set
Ts=0.0042s and select Continuous Time Control. Select PID and
Set-up Algorithm. Enter the kp value determined above for 2
Hz oscillation (kd & ki = 0, do not input values greater than kp =
0.08) and select OK.
Place the first mass carriage at approximately the -0.5 cm
(negative is toward the motor) mark.
In this and all future work, be sure to stay clear of the mechanism
before doing the next step. Selecting Implement Algorithm
immediately implements the specified controller; if there is an
instability or large control signal, the plant may react violently.
If the system appears stable after implementing the controller,
first displace it with a light, non sharp object (e.g. a plastic ruler)
to verify stability prior to touching plant.
Select Implement Algorithm, then OK.
6. Enter Execute under Command. Prepare to manually displace
the mass carriage roughly 2 cm. Select Run, displace the mass
approximately 3 cm and release it. Do not hold the mass position
for longer than about 1 second as this may cause the motor drive
thermal protection to open the control loop.
7. Plot encoder #1 output. Determine the frequency of oscillation.
What will happen when proportional gain, kp, is doubled?
Repeat Steps 5 & 6 and verify your prediction. (Again, for
system stability, do not input values greater than kp = 0.06).
8. Determine the value of the derivative gain, kd, to achieve kdkhw=
50 N/(m/s). Repeat Step 5, except input the above value for kd
and set kp & ki = 0. (Do not input values greater than kd = 0.04).
78
PD Control Design:
11. From Eq's (13.3 and 13.4) design controllers (i.e. find kp & kd)
for a system natural frequencies n = 4Hz, and three damping
cases: (1) = 0.2 (under-damped), (2) = 1.0 (critically
damped), (3) = 2.0 (over-damped).
Step Response:
12. Implement the underdamped controller (via PI + Velocity
Feedback) and set up a trajectory for a 2500 count closed-loop
Step with 1000 ms dwell time and 1 rep.
13. Execute this trajectory and plot the commanded position and
encoder position (Plot them both on the same vertical axis so that
there is no graphical bias.)
14. Repeat Steps 12 & 13 for the critically damped and over-damped
cases. Save your plots for later comparison.
Frequency Response:
15. Implement the underdamped controller from Step 11. Set up a
trajectory for a 600 count closed-loop Sine Sweep from 0.1 Hz to
20 Hz of 60 seconds duration with Logarithmic Sweep checked.
(You may wish to specify Encoder #1 data only via Set-up Data
Acquisition. This will reduce the acquired data size.)
16. Execute the trajectory and plot the Encoder 1 frequency response
using Linear Time and Linear amplitude for the horizontal and
vertical axes. The data will reflect the system motion seen as the
sine sweep was performed. Now plot the same data using
Logarithmic Frequency and Db amplitude. By considering the
amplitude (the upper most portion of the data curve) you will see
the data in the format commonly found in the literature for Bode
magnitude plots. Can you easily identify the resonance frequency
and the high frequency (>5 Hz) and low frequency (< 0.8 Hz)
gain slopes? (i.e. in Db/decade).
17. Repeat Step 16 for the critically damped and overdamped cases.
79
Questions:
I.
What is the effect of the system hardware gain, khw, the mass, m, and
the control gains, kp and kd, on the natural frequency and damping
ratio? Derive the transfer function for the mass/spring/damper system
shown in Figure 13.2. How do the viscous damping constant, c, and
the spring constant k correspond to the control gains kd and kp in the
PD controlled rigid body of Figure 13.1b?
II.
III.
Compare the step response and frequency response plots for the under, critical, and overdamped cases (ki = 0). Discuss how the resonance
(if present), and bandwidth
seen in the frequency response data
correlate with features of the step responses.
x(t)
k
F(t)
m
c
Figure 13.2 Mass/Spring/Damper
80
Experiment 14
Introduction:
The robotic arm 7220C (developed by ED laboratory, Korea) is a vertical
articulated, 5 joint, 6 Degree Of Freedom (DOF) system which is actuated by six DC
servo motors. Such kinds of arms are common and popular in industry. Therefore, the
experience gained through the experiments can be directly mapped in the real
business needs. The ED-7220C is designed such that the main driving mechanism,
including the timing belt, is exposed to the user to offer the visual observation. The
arm is shown in Figure 14.1.
81
Inspired from human arm, the robotic arm has 5 joints; (Figure 14.2); waist,
shoulder, elbow, wrist and hand. All of the joints except wrist have 1 DOF. The wrist
has 2 DOFs. Corresponding to 6 DOF, the arm is equipped with six motors (A-F)
A
B
C
D
E
F
Feature
Position precision
Movement speed
Load capacity
Description
0.5mm (approx.)
100mm/s (max.)
1 Kg
DC servo motor
Actuator
(with optical encoder)
Gripper opening
55mm
Weight
25/33 Kg
Wrist rot: 360
Elbow: 130
Range Of Motion (ROM)
Shoulder: +130/-35
Body: 310
82
The overall system consists of robotic arm, robot controller (ED-MK4) and
teaching loader as shown in Figure 14.3. The robot can be controlled either with a PC
or with a teaching loader (limited control). Major electronics (except encoders) reside
inside the controller. The PC communicates with the system through RS232 interface
using application software RoboTalk (RT) or sending robotic arm commands using
a programming language (e.g. BASIC, C etc).
The controller generates motion commands for the motors which are directed
to the arm through data cables (see A-F cables in Figure 14.4). The motor moves
either in joint coordinate system (encoder ticks) or in Cartesian coordinate system
(x,y,z,two wrist angles). On the way back, the encoder (position sensor) data is sent
from the robotic arm to the controller (and ultimately accessible in PC) thus
completing a closed loop feedback control system.
The controller has a 16 bit microprocessor (80188) and a motor controller
(8751). With a variety of memory storage (RAM, EPROM, EEPROM), the controller
offers flexibility. To interface user-designed circuits/systems with the controller, I/Os
have been provided. The inputs can be given either through eight I/p terminals or
through eight toggle switches. While available eight O/p terminals can be used to
drive external circuit.
83
More than 100 kernel commands are provided to communicate and control the
robotic arm. Table 14.2 lists some of the control commands to read or set various
motor parameters. Commands to read/set the Proportional (P), Integral (I) and
Derivative (D) gains permit the robotic arm to be used in a wide range of educational
and research applications.
Table 14.2 Control commands
Category
Motor
Gains
Commands
Read/Set PWM level & direction
Read/Set destination position
Read actual position
Read/Set rotation angle
Read/Set motor/system velocity
Read/Set system acceleration
Read/Set P/I/D gains
Store/Restore user gains to/from EEPROM
84
Lab Tasks:
Lab Task 1 (Object Placement)
Pick and drop of objects is a universal task in many robotic applications.
Domains like packaging, manufacturing, construction, inspection, spot welding,
production, household etc employ this task in one form or the other. This lab task is
intended to examine this task using ED robotic arm.
Prior to the start of experiment, make sure that the setup is according to Figure
14.3. Place an object (e.g. a car key with a chain) at any location (say point P0) within
the reachable workspace of the robot.
STEP-I: Coding
Create and open a new text file in any editor (e.g. a notepad file named
code.txt). Using robotic arm kernel commands, write a simple program to instruct the
robot to perform pick and place. The sequence can be
i.
Move to Home
ii.
Open gripper
iii.
Move to a temporary point (P01) immediately above P0. This is defined for a
reason. Imagine if the robot moves and directly goes to P0, because of the
orientation of the object (key in this case), the robot (gripper) will collide with
the key and force it to fall down (change the orientation). By defining
temporary point P01, the robot goes immediately above the object and finally
to P0 (next step) thereby having the key in the middle of the gripper.
iv.
v.
After reaching P0, close the gripper. This will let the current object picked up.
vi.
The next step is to drop the object at destination point (P02). Move to P02.
While moving, you may need to define temporary points to avoid the collision
between the robot and environment objects (obstacles) to ensure safe
operation.
vii.
viii.
Now if you command the robot to move to its Home position, the robot will
do so however colliding and changing the orientation of key (object). So better
85
way is first to move up little bit at another temporary point (P03) and then
going toward home.
Note: The code will be explained during the lab session.
Once the robot has been initialized you will see the main system menu and prompt. It
is:
RoboTalk:Edit, Run, Load, Save, Do, Teach, Files, Config, Quit
enter command:
This is the top level menu in the RoboTalk system and will be referred to as
the RoboTalk menu. Only the stated options are valid at this point. You may type
either the first letter of the command or the entire word. Edit invokes the text editor.
Run will execute the current program. Load will load a program from a disk file.
Save will save a program to a disk file. Do invokes direct execution mode where you
may directly execute most RoboTalk language commands one at a time. Teach
allows the assigning of variable names to robot location points for later use in a
program. Files will list the disk files on your current diskette. Config configures
86
RoboTalk to your system environment. Quit exits to the operation system of the
computer.
After running RoboTalk, load the file containing the code (place.txt) by
pressing L or writing Load at RoboTalk menu. It will prompt for file name.
Entering the file name will load the code typed in an editor. Any problem in loading
will result in an error displayed on the screen.
The overall sequence in pictorial form is presented in Figure 14.6 for further
clarity.
87
Home Task:
For optimized placement of multiple objects from one point to the other,
various control algorithms have been proposed. Search the literature and mention at
least two such control algorithms
88
Experiment 15
Introduction:
In control engineering, a state space representation is a mathematical model
of a physical system as a set of input, output and state variables related by first-order
differential equations. To abstract from the number of inputs, outputs and states, the
variables are expressed as vectors, and the differential and algebraic equations are
written in matrix form. "State space" refers to the space whose axes are the state
variables. The state of the system can be represented as a vector within that space.
Advantages:
There are several advantages to using the state space representation compared with
other methods. Some of there are:
the ability to easily handle systems with multiple inputs and outputs;
the system model includes the internal state variables as well as the
output variable;
the model directly provides a time-domain solution, which ultimately
is the thing of interest;
the form of the solution is the same as for a single 1st-order differential
equation;
the effect of initial conditions can be easily incorporated in the
solution;
the matrix/vector modeling is very efficient from a computational
standpoint for computer implementation
89
Where
is the "state vector", y is the "output vector"
u is the "input (or control) vector"
A is the "state matrix",
B is the "input matrix",
C is the "output matrix",
D is the feed forward matrix,
Canonical realizations:
Any given transfer function which is strictly proper can easily be transferred
into state-space. Given a general transfer function:
.
The coefficients are inserted directly into the state-space model as:
91
92
Lab Tasks:
Lab Task 1:
Construct state space for following electrical system:
a) In MATLAB where v(t)=sin(t).
b) In Simulink with:
Lab Task 2:
Considering the following mass-spring-damper system where x1 and x2
denote the outputs while u1 and u2 represent the inputs.
Construct state space in MATLAB and Simulink using all three methods.
Lab Task 3:
Solve using observer and controller canonical form, where f(t)=10N is the
input and x1,x2 and x3 are the outputs.
93
Introduction:
In this lab, a number of MATLAB functions are used to analyze systems and
plot their responses. Given below is brief description of few:
Transfer function:
>>sys_tf = tf (num, den);
lsim:
Used for linear simulation.
>>[y, t] = lsim (sys, u, t)
Here, sys can be sys_tf or sys_ss, u is the input matrix and t is the time matrix.
The function gives two outputs, y and t, where y is the output matrix with time t. The
function simulates for both state space and transfer function.
>>[y, t, x] = lsim (sys_ss, u, t, x0)
94
This has another input, initial condition x0. It also gives additional output x
which has states.
Pole-zero map:
>>pzmap (sys)
where sys can be transfer function or state space.
Step response:
>>[y, t] = step (sys)
where sys can be transfer function or state space.
Natural response:
>>[y, t] = impulse (sys)
where sys can be transfer function or state space.
Conversion between transfer function & state space (MIMO and SISO):
a) ss2tf (state space to transfer function)
>>sys_ss = ss (a, b, c, d)
>>sys_tf = ss2tf (sys_ss)
or
>>[num, den] = ss2tf (a, b, c, d)
>>sys_tf = tf (num, den)
b) tf2ss (transfer function to state space)
>>sys_ss = tf2ss (sys_tf)
95
Example:
Plot the response of the state-space model
sys = ss(a,[ ],c,[ ]); % the values of matrix B and D have to be placed into the
equation
initial(sys,x0)
% initial function calculates the unforced response of a state- space (ss)
model sys with an initial condition on the states specified by the vector x0
96
Lab Tasks:
Lab Task 1:
For the system represented below:
Lab Task 2:
For the transfer function G(s):
Experiment 16
Robian (Theme)
INTRODUCTION
The world of robotics has always fascinated students and engineers.
Historically, ROBIANS were considered a robotic nation with no will
and thinking power. After death of Dr. IVO ROBOTNIK who used to
reprogram them to have the capability of free thinking, CIIT is adopting
ROBIANS and its your responsibility now to make use of them.
How interesting it would be to have your own ROBIAN? . COMSATS
Islamabad is organizing ROBIAN12: the second ever robotic contest
in the history of COMSATS. The main objectives are to unleash talent in
students and to provide an opportunity for them to develop expertise in
various fields of robotics and mechatronics. Not less importantly, this
competition is aimed at preparing the students to face and accomplish
challenges in their future career life and to develop sense of sportsman
spirit.
OBJECTIVES
98
FLOOR DIMENSIONS
i. The Contest Arena is made by Waterproof Floor Mat sheets of size 400 X
250 cm.
ii. Fixed Lines are marked on the arena. The Lines are made from 3 cm wide
White Reflector Tape.
iii. Starting and ending points are marked on the floor.
iv. The three square shaped disaster sites have dimensions of 30.48cm X 30.48
cm
v. The fourth disaster side is a semi-circle with radius 30.48 cm
99
THEME OF CONTEST
Initial starting point of robot is fixed i.e. mentioned in the Figure 16.1 Each
robot will act as an emergency response vehicle that will have to reach the
four disaster sites in the least possible time. All disaster sites have been
highlighted with red color. Initially, each robot will first reach the Checkpost,
which is 1 feet away from the starting point. Valuable marks will be awarded.
(See points table).
Than after entering the arena through the Checkpost, the autonomous
Unmanned Ground Vehicle (UGV) will have to reach the disaster sites and
intelligently track through the possible paths provided by the white line. The
closest disaster site is FIRE highlighted by red in Figure 16.1. It is easily
assessable and so contains the least marks. In order to gain those points, the
robot will have to track any one of the four sides of the 1-square-feet box. The
points will be awarded if the UGV fully traverses any one side of the foursided disaster site. Similarly, the next disaster side is the CAR ACCIDENT
which has only two routes available. The third site BANK ROBBERY has a
more difficult approach. The last site TERRORIST ATTACK is the farthest and
the toughest of the emergency locations because in order to gain the points
for this site, robots will have to track a curved line between any two of the
three points (A, B, C) marked, as shown on Figure 16.1.
100
SENSORS
There is no restriction on the type of sensors that can be used. However,
contestants are not allowed to place any markers, beacons or reflectors in the
contest area to aid in the robots navigation.
POWER SUPPLY
Robot should have on-board power source and maximum supply voltage
allowed is 18 Volts.
TEAMS
A team can only be composed of maximum 4 members. The names and
registration numbers of the team members should be communicated within 1
week (till 1st March 2012) to front office EE Department.
DURATION OF MATCH
i. Each team will be given maximum 9 minutes to complete their task.
However, team may be asked to stop the robot earlier if the referees decide
that the task cannot be completed due to mechanical problems or for safety
reason.
ii. Each team will be given 1 minute for setting up the robot at the start point.
iii. Robot can start at the instant when the start signal is given. It is highly
recommended that your robot must be constructed in a way that it can be
started in minimum possible operation(s).
101
iv. Once the robot started moving, team members will not be allowed to
touch the robot or enter in the contest arena.
v. The robot timing will start immediately after the contestant releases the
robot in arena.
POINTS
i. Successful approach to the CheckPost
5 marks
10 marks
iii. Tracking any one side of the disaster site CAR ACCIDENT
20 marks
iv. Tracking any one side of the disaster site BANK ROBBERY
30 marks
40 marks
TERRORIST ATTACK
vi. Successful exit through Ending Point
45 marks
50 marks
DEDUCTION OF POINTS
i. Retry number 1
5 marks
10 marks
20 marks
40 marks
102
RULES
i. The Contest judges may stop any robot at any time if they feel that it is
performing, or is about to perform, any action that is dangerous or hazardous
to people or equipment.
Robot should have Emergency Stop button (probably implemented by
giving an interrupt of highest priority to the controller to stop the motors
immediately or even more simply emergency stop through turning off the
Power supply).
ii. All electronic circuitry must be designed and fabricated by the contestants
themselves. No Off-the-Shelf boards will be allowed.
iii. Total cost incurred on robot must not exceed Rs. 15,000/iv. Maximum efforts in the design and fabrication of the robot should be put
in by contestants themselves.
v. In all matters of interpreting the rules before and during the contest and in
any issues not covered by these rules, the decisions of the contest judging
committee will be final. However the committee will be bound to enforce the
rules homogeneously to ensure justice and equality.
TEST RUN
Contestants will be given time for trial run a day before the contest to
calibrate their robot/sensors on the actual arena/game field.
PRIZES
Winner
1st Runner Up
2nd Runner Up
Best Engineering Design
Additionally all those teams whose robots manage to traverse at least 2
disaster sites (out of 4) will be awarded with Certificate of successful
participation by ROBIAN12 organizers.
103
ORGANIZERS
Dr. JAMSHED IQBAL
Mr. AHSAN MALIK (& IDEA Student Society)
Mr. MUSTAFA PASHA
Mr. WAQAR SAEED
Mr. SOHAIL KHAN
Mr. IRFANULLAH
Mr. NOMAN JALIL
Mr. SHEHRYAR
Mr. RAHEEL AHMAD
Mr. ABDUS SAMAD
Mr. MUMTAZ ALI
Mr. KHURRAM NAVEED
Mr. ANUM ALI
Mr. FAHD SIKANDAR KHAN
104