Professional Documents
Culture Documents
Control Systems
EEE325
Lab Manual
Name
RegistrationNumber
Class
Instructor’sName
Introduction
This manual supports the practical sessions of the course “Control Systems EEE-
325” for under-graduate engineering degrees. The manual comprises of
experiments which cover software as well as hardware aspects of control. The
hardware experiments consists of working with platforms like PLC and rectilinear
plant. The software based experiments mainly use MATLAB and Simulink tools
and implement the concrete concepts being taught in theoretical lectures.
During the labs the students usually work in groups (no more than three students
per group). They are required to complete the “Pre-Lab” section of the lab before
coming to the lab. The students are evaluated against their “Pre-Lab” and “In-
Lab” tasks. The “Post-Lab” section is given as an assignment, which needs to be
completed before next lab.
The students are not allowed to wander in the lab or consult other groups when
performing experiments. Similarly the lab reports must contain original efforts as
the CUI has a zero tolerance anti-plagiarism policy.
Apart from these weekly labs students are given a project as a final lab exam. The
grading policy is already discussed in the Course Description File.
We hope and pray that you will find this manual useful to enhance your skills and
expertise. Enjoy ‘learning by doing’!
Acknowledgement
The labs for EEE-325Control System were designed by Dr. Adeel Mehmood. The
manuals were prepared by Mr. Syed Ali Ajwad, Mr. Rizwan Azam and Mr. Saqib
Irfan.This manual is modified according to OBE requirements
The typesetting and formatting of this version was carried out under the supervision of Dr.
Omar Ahmad and was carried out by Mr. Abdul Rehman, Mr Suleman andMrBaqirHussain .
History of Revision
Version
and Date Team Comments
of Issue
Safety Precautions
Be calm and relaxed, while working in lab.
When working with voltages over 40 V or current over 10 A, there must be at least two
Be sure about the locations of fire extinguishers and first aid kit.
No loose wires or metals pieces should be lying on the table or neat the circuit.
Avoid using long wires, that may get in your way while making adjustments or
changing leads.
Be aware of bracelets, rings, and metal watch bands (if you are wearing any of them).
When working with energize circuit use only one hand while keeping rest of your body
o Disconnect the power source from the circuit breaker and pull out the plug using
insulated material.
Table of Contents
Introduction .................................................................................................................................. 2
Acknowledgement ........................................................................................................................ 3
History of Revision ...................................................................................................................... 3
Safety Precautions ........................................................................................................................ 4
Lab # 1 Introduction to PLC’s and Implementation of Combinational Logic through Ladder
Logic............................................................................................................................................. 8
Objectives ................................................................................................................................. 8
Pre Lab ..................................................................................................................................... 8
In-Lab: .................................................................................................................................... 12
Post-Lab: ................................................................................................................................ 21
Critical Analysis / Conclusion.................................................................................................. 22
Lab # 2 Implementation of Timers and Counters in Trilogy ..................................................... 23
Objectives ............................................................................................................................... 23
Pre Lab ................................................................................................................................... 23
In-Lab: .................................................................................................................................... 27
Post-Lab ................................................................................................................................. 31
Critical Analysis / Conclusion.................................................................................................. 32
Lab # 3 Implementation of Sequencers in Trilogy..................................................................... 33
Objectives ............................................................................................................................... 33
Pre Lab ................................................................................................................................... 33
In-Lab ..................................................................................................................................... 34
Post-Lab: ................................................................................................................................ 38
Critical Analysis / Conclusion.................................................................................................. 39
Lab # 4 Introduction to MATLAB and Simulink, Solution of Differential Equations Using
MATLAB and Simulink and Transfer Function Based Modelling............................................ 40
Objectives ............................................................................................................................... 40
Pre Lab ................................................................................................................................... 40
Pre Lab Tasks ......................................................................................................................... 46
Lab Tasks ............................................................................................................................... 48
Post Lab Tasks ....................................................................................................................... 53
Critical Analysis / Conclusion.................................................................................................. 54
Lab # 5 Modeling of Translational Mechanical System and to Calculate Its Various Responses
.................................................................................................................................................... 55
Objectives ............................................................................................................................... 55
Pre Lab ................................................................................................................................... 55
Lab Tasks ............................................................................................................................... 59
Post Lab Tasks ....................................................................................................................... 64
Critical Analysis / Conclusion.................................................................................................. 67
Lab # 6 Introduction to “lsim” and Time Response of 1st and 2nd Order Systems .................. 68
Objectives ............................................................................................................................... 68
Pre Lab ................................................................................................................................... 68
Lab Tasks ............................................................................................................................... 75
Post Lab Tasks ....................................................................................................................... 81
Critical Analysis / Conclusion.................................................................................................. 84
Lab # 7 Block Diagram Reduction and Analysis and Design of Feedback Systems ................. 85
Objectives ............................................................................................................................... 85
Pre Lab ................................................................................................................................... 85
Pre Lab Tasks ......................................................................................................................... 87
Lab Tasks ............................................................................................................................... 88
Post Lab Tasks ....................................................................................................................... 95
Critical Analysis / Conclusion.................................................................................................. 97
Lab # 8 Effect of Zeros on 2nd Order Systems Response, Pole Zero Cancellation and Stability
Analysis via Routh Hurwitz Criterion........................................................................................ 98
Objectives ............................................................................................................................... 98
Pre Lab ................................................................................................................................... 98
Pre Lab Tasks ....................................................................................................................... 102
Lab Tasks ............................................................................................................................. 104
Post Lab Tasks ..................................................................................................................... 112
Critical Analysis / Conclusion................................................................................................ 114
Lab # 9 Steady State Error Analysis and Design ..................................................................... 115
Objectives ............................................................................................................................. 115
Pre Lab ................................................................................................................................. 115
Lab Tasks ............................................................................................................................. 117
Post Lab Tasks ..................................................................................................................... 122
COMSATS University Islamabad Page6
EEE325 Control Systems
Objectives
To understand the basics of PLCs and their programming using ladder logic.
Equipment/Tools required:
PLC(Triangular Research Inc.), PC with TRiLOGI software, connecting leads etc.
Pre Lab
Part I- 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 61131-1 (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 user-oriented 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
Characteristics of PLC:
Category Relay Digital Design Computer PLC
Very
System Modification Difficult Simple Simple
Difficult
Very
Troubleshooting Difficult Simple Simple
Difficult
Complex Function
None Supported Supported Supported
Support
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.
CommunicationPort.
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).
Read Input
PLC Programming:
According to International Electro technical Commission (IEC) 61131-3/EN 6131 standard,
PLC can be programmed using following five different languages:
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 low-power signal (with
complete electrical isolation between control and controlled circuits), or where several circuits
must be controlled by one signal.
The coil part is an operating part and contacting part is the switching part of relay (see
figure 1.3). When an electric current is passed through the coil it generates magnetic that
activates the armature and the consequent movement of the movable contact either makes or
breaks (depending upon construction) a connection with a fixed contact.
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.
In-Lab:
LAB TASKS:
Lab Task 1:
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
Switch
220V AC Bulb
Figure
1.4 Task 1: Wiring Diagram
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>.
5. Scroll to the "Inputs" window by using the left/right cursor keys or by clicking
on the red color left/right arrow.
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).
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.
3. Now insert the first element by left-clicking on the icon . At the same time, an I/O
table should appear on the screen with a light beige-color background instead of the normal
light blue background.
4. Select the first switch i.e. “Start”.
5. Now insert the second element Output labeled as Bulb by left-clicking on the icon
6. Compile the Result by pressing <F8>
7. Simulate the program by pressing Ctrl+F9.
8. Fill up Task-1 Table at the Result Table Page.
ii. 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 Server’s 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.
Pressing OK will automatically result in compilation of your program. The compilation should
give you an encouraging success message mentioning the details about your circuit as well as
code.
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. From PLC itself: By giving the input through switch and visually observing the outputs
from LEDs.
ii. From Trilogy: From main menu bar, select
Controller -> On-Line Monitoring or simply press Ctrl + M.
Lab Task-1
Problem: what if the Load (Bulb) we are using is of 200watt (220V, 1A Approximate).
Lab Task-2
Instructor Signature
Lab Task-3a
3 Inputs OR Gate:
Lab Task-3b
Lab Task-3c
Instructor Signature
A B C D0 D1 D2 D3 D4 D5 D6 D7
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
(Hint: D0 = A’.B’.C’, D1 = A’.B’.C, D2 = A’.B.C’, D3 = A’.B.C, D4 = A.B’.C’, D5 = A.B’.C,
D6 = A.B.C’, D7 = A.B.C)
Lab Task-4
Instructor Signature
Post-Lab:
1 0 1 0
0 0 1 0
0 1 0 1
0 0 0 1
1 1 0 0
1 0 0 1
1 1 0 1
0 1 1 0
1 1 1 0
0 0 1 1
Y
F1
Z
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To understand the implementation of fundamental building blocks (timers and counters)
through ladder logic.
Equipment/Tools required:
PLC(Triangular Research Inc.), PC with TRiLOGI software, connecting leads etc.
Pre Lab
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 re-energized, 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
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
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 pre-set value the contacts of the device change state.
Input
Output
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 DOWN- 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.
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 range of sensors available like Light, Motion, Temperature, Magnetic
Fields, Gravity, Humidity, Moisture, Vibration, 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
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. PLC’s
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.
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.
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.
Latch Circuit:
Latch circuits use when you need to ON an output from one input and off from the other.
Push-ON/Push-OFF
To control an output in toggle switch manner, using a single push batten to ON and OFF an
output.
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.
In-Lab:
Lab Tasks
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
Suppose the tank-1 is in vibrant environments that cause false signal generation even the tank-
1 isn’t empty. To insure the signal is not false the Controller should wait till 5 sec if the signal
is true and then turn the motor ON.
(Note: implementation of timer is same as relay except a Set Value (S.V) should also be given
at time of initialization and 1 S.V unit = 100mSec.)
The length measurement system mainly consists of a moving conveyor belt and two types of
sensors. Pieces of bars (shown as green rectangles in Figure 2.8) placed above moving
conveyor belt move from one end to the other. Two types of sensors include Magnetic Sensor
(MAG_SENS) and Photoelectric Sensor (PE_SENS).
Using counters, the system accumulates the total length of bar pieces. The operation of the
program can be summarized as follows:
The magnetic sensor generates the count inputs pulses. These pulses detect passing teeth
(‘dandanay’ in Urdu) on a conveyor drive sprocket. If 10 teeth per foot of conveyor motion
pass the sensor, the accumulated count of the counter would indicate feet in tenths.
The photoelectric sensor monitors a reference point on the conveyor. Light collected at the
reflector gives a hint of presence/absence of the pieces of bar below the reference point. Since
the task is to measure the length of bar pieces, (and not the empty space between bar pieces),
so it means the counter should not count when there is no bar pieces under reference point
(photoelectric sensor-reflector pair is activated).The counter is reset by closing the reset button.
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.
START STOP RESET MAG_SENS PE_SENS
X1 X2 X3 X4 X5
Y1 Y2 Y3
Lab Task-1a
Lab Task-1b
Lab Task-2
Post-Lab
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).
MOTOR
START STOP
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To understand the sequencers implementation through ladder logic.
Equipment/Tools required:
PLC(Triangular Research Inc.), PC with TRiLOGI software, connecting leads etc.
Pre Lab
Introduction:
Sequencers in Trilogy:
Interlock [ILock].
The "Interlock" [ILock] and "Interlock Off" [ILoff] functions work together to control an
entire section of ladder circuits. If the execution condition of an [ILock] function is ON, the
program will be executed as normal. If the execution condition of [ILock] is OFF, the program
elements between the [ILock] and [ILoff] will behave as follow:
a. all output coils are turned OFF.
b. all timers are reset to inactive.
c. all counters retain their present values.
d. Latched relays by [Latch] function are not affected.
e. [dDIFU] and [dDIFD] functions are not executed.all other functions are not executed.
Master Reset.
An ON condition to this function clears all mailbox inputs, outputs, relays, timers and counter
bits to OFF, resets all timers counters/sequencers to inactive state, and clears all latched relay
bits. All integer variables will be cleared to zeros and all string variables will be assigned to
empty string.
In-Lab
Lab Tasks
Lab Task 1:
Using TRiLOGI software, control 4 LEDs in Sequence of 1 sec. i.e Each LED glow for 1 Sec
after one another.
1. First define Inputs, Outputs and Relay labels on paper and sketch flow chart. This
diagram may look as shown below.
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.
Lab Task No 3:
Design Full Step Stepper Motor Controller for forward and reverse Drive.
Lab Task-2
Post-Lab:
Task 01:
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
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To evaluate and analyse transfer functions in MATLAB and to implement control systems in
MATLAB using Simulink.
Pre Lab
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:
Explore these functions from help of the MATLAB and construct your models.
Normally four types of representations are used in MATLAB for representing linear models.
These are presented here with the examples:
A continuous-time Single Input Single Output (SISO) transfer function in polynomial form is
given by:
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:
where:
• k is a real- or complex-valued scalar gain.
• z1 ,..., zmare the real or complex conjugate pairs of zeros of the transfer
function G(s) — roots of the numerator polynomial N(s).
• p1 ,..., pnare the real or complex conjugate pairs of poles of the transfer
function G(s) — roots of the denominator polynomial D(s).
where z, p, and k are row vectors of zeroes z1 ,..., zm, poles p1 ,..., pn, and gain k
respectively.
This transfer function has a zero at s = 0, two poles at s = –1, and a gain of 1.
Create a zpk model of this transfer function using:
G = zpk([0],[-1 -1],[1]);
Alternatively, you can specify the same zpk model as a rational expression in
the Laplace variable s:
s = zpk('s'); % Define the Laplace variable s
𝑑𝑥
= 𝐴𝑥 + 𝐵𝑢
𝑑𝑡
𝑦 = 𝐶𝑥 + 𝐷𝑢
Where
>> t = [1 2 3; 4 5 6; 7 8 9]
>> t = 0: 0.1:1
>>[r,p,k]=residue(num,den)
>>syms t
>>f = t^4 % As an example
>>laplace(f) % Laplace
>>syms s
>>f = 1/s^2
>>ilaplace(f) % Inverse laplace
Introduction to Simulink:
Modelling in Simulink is based on a six steps mentioned below:
1. Defining the system.
2. Identifying system components.
3. Modeling the system with equations.
4. Building the Simulink block diagram.
5. Running the simulation.
6. Validating the simulation results.
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
𝑑2 𝑉𝑐 𝑑𝑉𝑐
2
= −4 − 3𝑉𝑐 + 3𝑢(𝑡)
𝑑𝑡 𝑑𝑡
or in s domain
v(s)/U(s) =3 / s2+4s+3
SIMULINK Model
Responses
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.
Solution
MATLAB Code
Lab Task No 2:
Find inverse Laplace transform f(t) & hence find inverse from partial fraction form(use
MATLAB to compute the residues). Where
Solution
MATLAB Code
Results
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 then make its
SIMULINK block diagram.
Mathematical Model
SIMULINK Diagram
Task 01
Task 02
Use the mathematical model , computed in In-lab task 02, and find its state space
representation using MATLAB.
MATLAB Code
MATLAB Results
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To demonstrate the key components of a translational mechanical system, model the system
and finally to obtain various responses using computation and observe it on Rectilinear plant.
Equipment/Tools required:
Rectilinear Plant with controller interfaced with PC
Pre Lab
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 Newton’s
law,
Damping is an element which opposes motion due to friction. If the friction is viscous
friction, then the frictional force is proportional to velocity, i.e.
The resistive forces aroused from mass, spring and damper are given be equations
mentioned above. According to D‘Alembert‘s principle, for any body, the algebraic sum of
externally applied forces and the forces opposing the motion in any given direction is zero.
Thus,
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. The
controller also interprets trajectory 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. Two optional auxiliary Digital-to-Analog
Converters (DAC's) provide for real-time analog signal measurement. This controller is
representative of modern industrial control implementation.
The third subsystem is the executive program which runs on a PC under the DOS or
Windows™ operating system. This menu-driven program is the user's 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
Lab Tasks
Calculations:
1. Express the system shown in Figure 5.5 using modelling symbols. Your schematics
should look like as shown in Figure 5.6.
2. Make mathematical model of the system using laws of Electronics, Mechanics and
Physics (Single Mass-Spring-Damper system has been modelled as an example).
3. Calculate the transfer functions X1(s)/F(s), X2(s)/F(s) and X3(s)/F(s).
4. Calculate impulse, step, ramp, parabolic and sinusoidal responses by taking relevant
values of F(s).
Hardware:
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.
You can change controller gains by clicking on “Setup Algorithm” (Figure 5.10)
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)
17. Selecting Encoder 3 (for example) and then clicking on “Plot Data”, you should see
plot similar to that of Figureure 5.16.
Task 01
Calculations
Results /3
Critical Analysis /1
Comments
Objectives
Pre Lab
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:
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:
2 s^2 + 3 s + 2
H= -----------------------
5 s^3 + 4 s^2 + 7 s + 1
The function LINSPACE can be used for creating a linearly spaced vector. The general format
of this function is given below.
This function can be used for declaring time axis. For example if you want to plot some result
over the time range of 0 to 10 seconds and you want step size to be 0.1 second then you could
declare time axis as.
LSIM command:
Where
The function gives two outputs (y and t)where y is the output matrix with time t. You
can use plot(y,t) to plot the response.
This has another input, initial condition (x0) and an additional output (x) having states. It is
applicable for state space representation only.
Step response:
To find the step response of a system,step function can be used. The general syntax is:
>>[y, t] = step (sys) Where sys is transfer function.
returns the step 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 step response is required then step function can be used as:
>>step(sys)
Natural response:
The impulse response of a system can be found using impulse function. The general syntax is:
>>impulse(sys)
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:
Performance measures are usually defined in terms of the step response of asystem as shown in
Figurer below.
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 theresponse remains within 2% of the final
value. Thisoccurs approximately when:
e −ζωnTs< 0.02orζωnTs≅ 4
Therefore :
Ts ≅ 4τ = 4/ζωn
The expression for peak time( the time at which the response is maximum) is:
Tp = π/ ωn(1− ς2)1/2
In this lab, a number of MATLAB functions are used to analyze systems and
plot their responses.
POLE
>>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.
IMPULSE
[Wn,Z, P] = DAMP(SYS)
Returns vectors Wn ,Z and P containing the natural frequencies and damping factors of the
LTI model SYS.
Lab Tasks
Lab Task No 1:
1
𝐺(𝑠) =
𝑇𝑠 + 1
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 responseand compare the results with the ones
calculated in part a.
MATLAB Code
Lab Task No 2:
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.
MATLAB Code
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.
MATLAB Code
Comments
Plot %OS vs. damping ratio and analyze the plot carefully.
MATLAB Code
Lab Task No 1:
Find the natural response of the following first order system. Assuming v(0)=10.
For the system given below, find its unit step response and impulse response.
Find the values of %OS, Settling Time and peak time by calculations and from the plot of step
response and verify that the two are same.
MATLAB Code
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To reduce block diagrams using MATLAB functions and plot the results. Verification of the
results using Simulink. To design controller system gain for obtaining specified poles.
Pre Lab
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.
>>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.
CONNECT:
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
INPUTSand OUTPUTS are the names of the block diagram external I/Os
(specified as strings or cell arrays of strings).
Task 1
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
- | |
+<--------------------+
MATLAB Code
Results
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.
MATLAB Code
Results
ii.
MATLAB Code
Results
iii.
MATLAB Code
Results
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.
MATLAB Code
Results
MATLAB Code
Lab Task No 1:
For the following system consider: Plant=Motor=1/[s(s+6)] and controller=k, design a closed
loop system with poles at –3±3j. Compare the motor system response before and after
implementation of controller
–𝑎 −𝑎 𝑎2
Hint: According to the feedback analysis, to get poles at ± j, we need to set K =
2 2 2
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To observe the effect of zeros on responses of second order systems in time domain and
to analyze situations in which pole-zero cancellation is possible.
To design controller system gain for obtaining specific characteristics. Using
MATLAB, design controllers for stable systems response and plot the results.
Pre Lab
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:
Where
sys can be transfer function or state space,
‘z’ output has zeros vector,
‘k’ has zero’s associated gain vector.
>> PZMAP(SYS)
where
SYS can be transfer function or state space,
PZMAP(SYS) computes the poles and (transmission) zeros of the
LTI model SYS and plots them in the complex plane. The poles are plotted as x's and the
zeros are plotted as o's.
Routh–Hurwitz:
The Routh–Hurwitz 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.
In the following, we assume the coefficient of the highest order (e.g. a_2 in a second order
polynomial) to be positive. If necessary, this can always be achieved by multiplication of the
polynomial with ‘-1’.
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.
4 5 6 0
0.75 1.5 0 0
−3 6 0
3 0
6 0
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".
2 12 16 0
2 12 16 0
0 0 0 0
. The coefficients of the row containing zero now become "8" and
"24". The process of Routh array is proceeded using these values which yield two points on the
Task 1
For the following systems, find the range of K for stability using Routh Hurwitz criterion.
i.
𝐾 (𝑠 + 0.01)(𝑠 + 6) 10
𝐾 (𝑠) = 𝐺 (𝑠) = 2
𝑠(𝑠 + 20)(𝑠 + 100) 𝑠 + 10𝑠 + 29
ii.
𝐾 (𝑠 + 0.8)(𝑠 + 103)
𝐾 (𝑠) = 𝐺 (𝑠)
𝑠
7570
=
(𝑠 + 62.61)(𝑠 − 62.61)
iii.
63∗ 106
𝐾(𝑠) = 𝐾 𝐺 (𝑠) = (𝑠+30)(𝑠+140)(𝑠+2.5)
Calculations
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
MATLAB Code
Results
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
MATLAB Code
Results
Lab Task 3:
Verify the value of “K” for all the systems, calculated in pre-lab task, using Simulink. Also
find open loop stability, total response stability and natural response stability. Also design “K”.
i.
Simulink Diagram
Results
ii.
Simulink Diagram
Results
Results
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)}
MATLAB Code
Comments
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To find steady state errors and static error constants and verify the results using MATLAB. To
design controller system gain for obtaining specified characteristics.
Pre Lab
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).
The system type is defined as the number of pure integrators in a system. Steady state
error relates to system types as:
Lab Tasks
Lab Task 1:
For the following systems find the static error constants, and then steady state error for the
following inputs:
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.
Calculations
MATLAB Code
Results
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.
Calculations
MATLAB Code
Lab Task 3:
MATLAB Code
Results
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives
To understand construction of Root Locus using MATLAB and compare the results with
Analytical Methods.
Pre-Lab Task.
PROBLEM: Sketch the root locus for the system shown in Figure 8.19(a) and find
the following:
a. The exact point and gain where the locus crosses the 0.45 damping ratio line
b. The exact point and gain where the locus crosses the jv-axis
c. The breakaway point on the real axis
d. The range of K within which the system is stable
1. Solve the problem Analytically and then compare the results with the plot given above.
2. Students should now run the following program. You will learn how to use MATLAB
to plot and title a root locus, overlay constant zeta and wn curves, zoom into and zoom
out from a root locus, and interact with the root locus to find critical points as well as
gains at those points. This exercise solves the above example using MATLAB.
Lab Task-1:
Lab Task-2:
Do the following:
Repeat the above problem using MATLAB. Use one program to do the following:
Post-Lab
Repeat the problem using MATLAB. The program will do the following in one
program:
Program:
numg=1;
deng=poly([0 -3 -7 -8]);
numh=[1 30];
denh=[1 20 200];
G=tf(numg,deng)
Gzpk=zpk(G)
H=tf(numh,denh)
rlocus(G*H)
pause
K=0:10:1e4;
rlocus(G*H,K)
sgrid(0.707,0)
axis([-2,2,-5,5]);
pause
for i=1:1:3;
[K,P]=rlocfind(G*H)
end
T=feedback(K*G,H)
step(T)
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives:
In this Lab we will introduce a simple, yet versatile, feedback compensator structure: the
Proportional-Integral-Derivative (PID) controller.
The PID controller is widely employed because it is very understandable and because it is quite
effective. One attraction of the PID controller is that all engineers understand conceptually
differentiation and integration, so they can implement the control system even without a deep
understanding of control theory. Further, even though the compensator is simple, it is quite
sophisticated in that it captures the history of the system (through integration) and anticipates
the future behavior of the system (through differentiation). We will discuss the effect of each
of the PID parameters on the dynamics of a closed-loop system and will demonstrate how to
use a PID controller to improve a system's performance.
Key MATLAB commands used in this tutorial are: tf , step , pid , feedback , pidtune
Pre-LAB
PID Overview
In this tutorial, we will consider the following unity-feedback system:
The output of a PID controller, which is equal to the control input to the plant, is calculated in the time domain from
the feedback error as follows:
(1)
First, let's take a look at how the PID controller works in a closed-loop system using the schematic shown above.
The variable ( ) represents the tracking error, the difference between the desired output ( ) and the actual output (
). This error signal ( ) is fed to the PID controller, and the controller computes both the derivative and the integral
of this error signal with respect to time. The control signal ( ) to the plant is equal to the proportional gain ( )
times the magnitude of the error plus the integral gain ( ) times the integral of the error plus the derivative gain (
) times the derivative of the error.
This control signal ( ) is fed to the plant and the new output ( ) is obtained. The new output ( ) is then fed back
and compared to the reference to find the new error signal ( ). The controller takes this new error signal and
computes an update of the control input. This process continues while the controller is in effect.
The transfer function of a PID controller is found by taking the Laplace transform of Equation (1).
(2)
We can define a PID controller in MATLAB using a transfer function model directly, for example:
Kp = 1;
Ki = 1;
Kd = 1;
s = tf('s');
C = Kp + Ki/s + Kd*s
C =
s^2 + s + 1
-----------
Alternatively, we may use MATLAB's pid object to generate an equivalent continuous-time controller as follows:
C = pid(Kp,Ki,Kd)
Kp + Ki * --- + Kd * s
with Kp = 1, Ki = 1, Kd = 1
Let's convert the pid object to a transfer function to verify that it yields the same result as above:
tf(C)
ans =
s^2 + s + 1
-----------
system to react more quickly, but also to overshoot more. Another effect of increasing is that it tends to reduce,
but not eliminate, the steady-state error.
The addition of a derivative term to the controller ( ) adds the ability of the controller to "anticipate" error. With
simple proportional control, if is fixed, the only way that the control will increase is if the error increases. With
derivative control, the control signal can become large if the error begins sloping upward, even while the magnitude
of the error is still relatively small. This anticipation tends to add damping to the system, thereby decreasing
overshoot. The addition of a derivative term, however, has no effect on the steady-state error.
The addition of an integral term to the controller ( ) tends to help reduce steady-state error. If there is a
persistent, steady error, the integrator builds and builds, thereby increasing the control signal and driving the error
The general effects of each controller parameter ( , , ) on a closed-loop system are summarized in the
table below. Note, these guidelines hold in many cases, but not all. If you truly want to know the effect of tuning the
individual gains, you will have to do more analysis, or will have to perform testing on the actual system.
LAB TASK-1
Example Problem
Suppose we have a simple mass-spring-damper system.
(3)
Taking the Laplace transform of the governing equation, we get
(4)
The transfer function between the input force and the output displacement then becomes
(5)
m = 1 kg
b = 10 N s/m
k = 20 N/m
F = 1 N
(6)
The goal of this problem is to show how each of the terms, , , and , contributes to obtaining the common
goals of:
s = tf('s');
P = 1/(s^2 + 10*s + 20);
step(P)
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 a steady-state error of 0.95, which is quite large. 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 eliminate the steady-state error.
Proportional Control
From the table shown above, we see that the proportional controller ( ) reduces the rise time, increases the
overshoot, and reduces the steady-state error.
The closed-loop transfer function of our unity-feedback system with a proportional controller is the following,
(7)
Let the proportional gain ( ) equal 300 and change the m-file to the following:
Kp = 300;
C = pid(Kp)
T = feedback(C*P,1)
t = 0:0.01:2;
step(T,t)
C =
Kp = 300
P-only controller.
T =
300
----------------
s^2 + 10 s + 320
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 a small amount.
Proportional-Derivative Control
Now, let's take a look at PD control. From the table shown above, we see that the addition of derivative control (
) tends to reduce both the overshoot and the settling time. The closed-loop transfer function of the given system
with a PD controller is:
(8)
Let equal 300 as before and let equal 10. Enter the following commands into an m-file and run it in the
MATLAB command window.
Kp = 300;
Kd = 10;
C = pid(Kp,0,Kd)
T = feedback(C*P,1)
t = 0:0.01:2;
step(T,t)
C =
Kp + Kd * s
with Kp = 300, Kd = 10
T =
10 s + 300
----------------
s^2 + 20 s + 320
This plot shows that the addition of the derivative term reduced both the overshoot and the settling time, and had a
negligible effect on the rise time and the steady-state error.
Proportional-Integral Control
Before proceeding to PID control, let's investigate PI control. From the table, we see that the addition of integral
control ( ) tends to decrease the rise time, increase both the overshoot and the settling time, and reduces the
steady-state error. For the given system, the closed-loop transfer function with a PI controller is:
(9)
Let's reduce to 30, and let equal 70. Create a new m-file and enter the following commands.
Kp = 30;
Ki = 70;
C = pid(Kp,Ki)
T = feedback(C*P,1)
t = 0:0.01:2;
step(T,t)
C =
Kp + Ki * ---
with Kp = 30, Ki = 70
T =
30 s + 70
s^3 + 10 s^2 + 50 s + 70
Run this m-file in the MATLAB command window and you should generate the above plot. We have reduced the
proportional gain ( ) 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 in this case.
Proportional-Integral-Derivative Control
Now, let's examine PID control. The closed-loop transfer function of the given system with a PID controller is:
(10)
After several iterations of tuning, the gains = 350, = 300, and = 50 provided the desired response. To
confirm, enter the following commands to an m-file and run it in the command window. You should obtain the
following step response.
Kp = 350;
Ki = 300;
Kd = 50;
C = pid(Kp,Ki,Kd)
T = feedback(C*P,1);
t = 0:0.01:2;
step(T,t)
C =
Kp + Ki * --- + Kd * s
Now, we have designed a closed-loop system with no overshoot, fast rise time, and no steady-state error.
5. Adjust each of the gains , , and until you obtain a desired overall response. You can always refer to
the table shown in this "PID Tutorial" page to find out which controller controls which characteristics.
Lastly, please keep in mind that you do not need to implement all three controllers (proportional, derivative, and
integral) into a single system, if not necessary. For example, if a PI controller meets the given requirements (like
the above example), then you don't need to implement a derivative controller on the system. Keep the controller as
simple as possible.
Post-Lab
Let's explore these automated tools by first generating a proportional controller for the mass-spring-damper system
by entering the command shown below. In the shown syntax, P is the previously generated plant model,
and 'p' specifies that the tuner employ a proportional controller.
pidTuner(P,'p')
The pidTuner GUI window, like that shown below, should appear.
Notice that the step response shown is slower than the proportional controller we designed by hand. Now click on
the Show Parameters button on the top right. As expected, the proportional gain, , is smaller than the one we
the response to indeed speed up, and we can see is now closer to the manually chosen value. We can also
see other performance and robustness parameters for the system. Note that before we adjusted the slider, the
target phase margin was 60 degrees. This is the default for the pidTuner and generally provides a good balance
between robustness and performance.
Now let's try designing a PID controller for our system. By specifying the previously designed or (baseline)
controller, C, as the second parameter, pidTuner will design another PID controller (instead of P or PI) and will
compare the response of the system with the automated controller with that of the baseline.
pidTuner(P,C)
We see in the output window that the automated controller responds slower and exhibits more overshoot than the
baseline. Now choose the Domain: Frequency option from the toolstrip, which reveals frequency domain tuning
parameters.
opts = pidtuneOptions('CrossoverFrequency',32,'PhaseMargin',90);
[C, info] = pidtune(P, 'pid', opts)
C =
Kp + Ki * --- + Kd * s
info =
Stable: 1
CrossoverFrequency: 32
PhaseMargin: 90
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Objectives:
To study and analyze the behavior of different control system concepts and various
controller types using interactive software and hardware.
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
In-Lab Tasks:
COM3Lab is divided into 12 experiments or case studies which have been planned to span
over the whole semester. The class will be divided into 7 groups (as 7 kits are available). At the
end of each lab session, after performing normal lab experiment, 30 minutes will be given for
COM3 experiment. Students will open the interactive software i.e Control Technology I and
will start working on their own after listening to audio and instructions on screen and perform
practically on attached hardware and answering question appearing on the screen and
visualizing results on analysis tools like characteristic plotter, multi-meter, oscilloscope,
function generator etc. During each experiment, the software poses different questions and
quizzes which is quiteself accountable for students to grasp the adequate concepts of the
subject.
Following experiments (or case studies) have been planned:
1. Introduction (8 slides)
2. Open loop control (10 slides)
3. Closed loop control (10 slides)
4. Analysis of controlled systems (9 slides)
5. Controlled system with compensation (9 slides)
6. Controlled system with time delay of higher order (4 slides)
7. Controlled system without compensation (7 slides)
8. Controller types (3 slides)
9. Proportional action control (5 slides)
10. Integral action control (3 slides)
11. PI control (6 slides)
12. PID and PD control (9 slides)
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments
Lab Task-1
Cross-multiplying yields
In vector-matrix form,
At this point, we can create an equivalent block diagram of the system to help
visualize the state variables. We draw three integral blocks as shown in Figure
below and label each output as one of the state variables, xi(t), as shown. Since
the input to each integrator is xi(t), use above equations to determine the
combination of input signals to each integrator. Form and label each input.
Finally label the output, y(t)=c(t). The final result is shown in the form of figure
below.
Program 1:
Program 2:
Remember that:
(1)
Example:
Given the system defined by the equations below, find the transfer function, T(s)=Y(s)/U(s),
where U(s) is the input and Y(s) is the output.
SOLUTION:
Now run the program below to learn how to convert state-space representation to a transfer
function.
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1
Comments