0% found this document useful (0 votes)
9 views

Lab Manual

Uploaded by

naimrashid2901
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lab Manual

Uploaded by

naimrashid2901
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Laboratory Manual

Control System Laboratory


EEE/ECE 306 (V1, V2)
EEE/ECE 305L (V3)

Department of Electrical & Electronic Engineering (EEE)


School of Engineering (SoE)
Brac University

Revision: August 2021

1
A. Course Objectives:
The objectives of this course are to:
-To demonstrate an understanding of the fundamentals of feedback control systems, design a system, component
or process to meet desired needs
- To use the techniques, skills and modern engineering tools necessary for modern engineering practice related to
control systems

B. Course Outcomes, CO-PO-Taxonomy Domain & Level- Delivery-Assessment Tool:


Sl. CO Description POs Bloom’s Delivery Assessment
taxonomy methods and tools
domain/level activities
EEE_ECE 305 / EEE_ECE 305 Control System

Identify an approximate Cognitive/ Lectures, Assignment,


CO1 linear/linearized model for a physical a
Understand notes Quiz
dynamic system.

Examine the stability and feedback Lectures, Assignment,


CO2 control of linear time-invariant (LTI) a Cognitive/ Apply
notes Quiz, Exam
systems

Design linear control systems using Lectures, Assignment,


CO3 time domain and frequency domain c Cognitive/ Apply
notes Quiz, Exam
techniques

Recognize the need for learning new Cognitive/


Independent Case-study
CO4 concepts, theories, technologies and l Understand,
case-study report
systems related to control systems Affective/ Valuing
engineering field
EEE_ECE305L / EEE_ECE 306 Control System Laboratory

Utilize software tools to design and Cognitive/ Apply, Software


CO5 analysis of control systems e Psychomotor/ Lab Class
Assessment
Precision

Perform hands-on practical Cognitive/ Apply, Hardware


CO6 demonstration of control theories in e Psychomotor/ Lab Class
Assessment
laboratory setup Precision

-2-
C. Mark Distribution
Assessment Tools Weightage

Attendance 10

Assessment (Hardware) 25

Assessment (Software) 15

Lab Report (Hardware, Software) 25

Viva 10

Software assignment 15

D. References
Sl. Title Author(s) Publication Edition Publisher ISBN

1 K. Ogata 2010 5th Ed. Prentice- 0-13-615673-


Modern Control Hall 8
Engineering

2 Norman S. Nise 2011 6th Ed. John Wiley 978-0470-


Control Systems & Sons, 54756-4
Engineering Inc.

Lab Safety and Security Issues

1. Laboratory Safety Rules (General Guidelines):


The Department of EEE maintains general safety rules for laboratories. The guideline is attached in front of
the door in each of the laboratories. The written rules are as follows.

1. Closed shoes must be worn that will provide full coverage of the feet and appropriate personnel
clothing must be worn.
2. Always check if the power switch is off before plugging in to the outlet. Also, turn the instrument or
equipment OFF before unplugging from the outlet.
3. Before supplying power to the circuit, the connections and layouts must be checked by the teacher.
4. Voltages equal or above 50V are always dangerous. Therefore, extra precautions must be taken as
voltage level is increased.
5. Extension cords should be used only when necessary and only on a temporary basis.

-3-
6. Once the lab exercise is done, all equipment must be powered down and all probes, cords and other
instruments must be returned to their proper position.
7. In case of fire, disconnect the electrical mains power source if possible.
8. Students must be familiar with the locations and operations of safety and emergency equipment like
Emergency power off, Fire alarm switch and so on.
9. Eating, drinking, chewing gum inside electrical laboratories are strictly prohibited.
10. Do not use damaged cords or cords that become too hot or cords with exposed wiring and if
something like that is found, inform the teacher/LTO right away.
11. No laboratory equipment can be removed from their fixed places without the teacher/LTO’s
authorization.
12. No lab work must be performed without the laboratory teacher/lab technical officer being present.

2. Electrical Safety
To prevent electrical hazards, there are symbols in front of the Electrical Distribution Board, High voltage
three phase lines in the lab, Backup generator and substation. Symbols related to Arc Flash and Shock
Hazard, Danger: High Voltage, Authorized personnel Only, no smoking etc. are posted in required places.
Only authorized personnel are allowed to open the distribution boxes.

3. Electrical Fire:
If an electrical fire occurs, try to disconnect the electrical power source, if possible. If the fire is small, you are
not in immediate danger, use any type of fire extinguisher except water to extinguish the fire. When in doubt,
push in the Emergency Power Off button.

4. IMPORTANT:
Do not use water on an electrical fire.

List of Experiments

Exp. Experiment Name Page Tentative Is this


No. schedule experiment
used for any CO
assessment?

Yes No

HW-1 Time Response Analysis 1-12 2nd week ✓

HW-2 Frequency Response 13-18 3rd week ✓

HW-3 Principle of Feedback 19-27 4th week ✓

-4-
HW-4 Behavior of Second Order Systems 28-35 5th week ✓

HW-5 Position Control with Velocity Feedback 36-40 6th week ✓

Analysis of Open Loop and Closed Loop 46-58 8th week ✓


SW-1 Control Systems and Effect of Gain on
Stability of the System via Root Locus

Analysis of Effect of Input Waveform, Loop 59-63 9th week ✓


SW-2 Gain, and System Type upon Steady-State
Errors

Design of Compensators to Improve Steady 63-75 10th week ✓


SW-3 State and Transient Response of a Second
Order System

Modelling of a Control System Using Root 75-81 11th week ✓


SW-4
Locus

Updated by:
1. Md. Nahid Haque Shazon
2. Taiyeb Hasan Sakib
3. Afrida Malik
4. Nahid Hossain Taz

-5-
Hardware Experiment No. 1
Time Response Analysis

1. Objective:
● Measure the parameters of a plant using step tests
● Describe the characteristics of a first order lag
● State the time model of the DC motor

2. Theoretical Background:

The First Order Lag:


The step response of a system is characteristic of a First Order Time Lag. A first order lag produces an
exponential rise to a step input. Mathematically this is of the form:

Where e is the exponential (or natural) number 2.7183... . τ is called the Time Constant and, with the Gain,
fully characterizes a first order lag.

The two parameters that define the model are Gain and Time Constant.
Gain (K) is the Steady State relationship between input and output, which is obtained by analysing steady
state step response. Time Constant (τ) defines the Transient Time which is determined by analysing transient
response.

Step Response:
We wish to determine a model which describes the time behaviour of the plant using the ‘Black Box’ approach.
To do this, you will ask the motor to change speed and infer the relationship between input voltage and output
speed from the way in which the motor responds. You will be measuring the Step Response of the motor.
Fig 1 shows the block diagram of the motor with the parts used for a speed control system included within
the shaded region.

Fig 1: Block diagram of the DC motor

6
There are two parts to any output time response when there is a change in input:
● A Transient period which occurs immediately when the input changes and during which the system
seems to be dominated by something other than the input.
● A Steady State condition which is reached after the transient has died out. The system seems to
have settled down to the influence of the input. The transient situation is produced by elements within
the plant which cannot respond instantly. Mass in a mechanical system and capacitance in an
electrical system both store energy so it takes time to change the velocity of a mass or to change the
voltage across a capacitor.

In the DC motor, it is the mass of the motor armature and all the disks and dials connected to the motor shaft
which require energy to get them moving or stop them moving. Actually it is the inertia of these elements, not
mass, since we are dealing with rotating bodies.

Transient Response:
There are a number of ways to characterize the transient response. These come under the general heading
of time constant but there are many different definitions of time constant. Three methods of determining the
time constant are:
● Initial Slope Method – measured from the slope of the transient response
● Settling Time Method – measured from the time taken by the transient to reach the final value.
● 63% Method – time taken by the transient to reach 63% of final value
Of the three methods, by definition of time constant, 63% method gives the most accurate approximation.

Position Response:
We work with velocity response as that becomes constant over time. Since position is the integral of the
velocity, it constantly changes with the changing velocity and it becomes difficult to measure something
changing rapidly. Again, the output potentiometer shows position from 0 0 to 3600 and it again jumps back to
00. As a result, the position curve does not make much sense at first.

Although the identification is difficult, the integral effect of the position makes servo control easier. To be able
to model the plant it is necessary to know the relationship between the velocity measured by the tachometer
voltage and rate of change of position measured by the potentiometer voltage. This relationship is called the
Integral Gain Ki.

Velocity Measurement:
We have so far considered the voltage across the tachometer as the measure of the velocity. We can obtain
the velocity in Revolutions per minute (RPM) by relating the voltage with the position response as velocity is
the change in position with time.

7
3. Equipment:

● MS15 DC Motor Module


● AS3 Command Potentiometer
● CLIO Interface Module with PC Connection Lead
● System Power 90 Power Supply (or equivalent)
● 4mm Connecting Leads
● PC running VCL Virtual Control Laboratory Software

4. Connection Diagram:

Fig 2: Wiring Diagram - Analog Control

5. Procedure:
● The system should be wired with the standard analog system connections as shown in
Fig 2. Start the VCL software and Load setup | CA06PE03.

8
● Disengage the output potentiometer then switch power ON and Enable the motor. The
output velocity trace (purple) on the PC shows what is called the Step Response (what
happens when there is a step change in the input).
● The purple trace is the Step Response of motor speed. Observe that the speed does
become constant after a time but initially lags behind the input. Expand the time scale
by decreasing the Rate to 10msec and click the x2 time multiplier. Click Freeze | Freeze.
This freezes the display at the end of the current cycle. The ‘Frozen’ control box appears
when the cycle ends. The motor can now be disabled and measurements made from
the screen.
● Measure the Gain and Time Constant which characterize the motor. The measurement
facility is activated from the Frozen control box by clicking Time ON. The measurement
lines and value boxes appear on the graph.

9
Measuring Input Span:

● Select channel 1/Input/Dark Blue. The scale will show the input channel scale.
● Select Line A by clicking within the A box. The box and the line will change colour.
● Move the mouse until the pointer is pointing at the upper dark blue trace in the graph
area. Click the left button and line A will move to where you are pointing. You can click
again if you did not position the line exactly the first time. The A box indicates the level
of the line.
● Click in the B box and, in the same way, position line B over the lower part of the dark
blue trace. The difference between A and B is the Input Span. Note the results in your
datasheet.

Measuring Output Span:

● Output span is the amount by which the output changes in response to the input
changes. Change to channel 4/Velocity/purple and repeat the measurements on the
purple trace. Line B should be positioned where the trace can be seen starting at the left
of the graph. The difference between A and B is the Output Span. Note the results in
your datasheet.

Measuring Gain:

● Gain, or Magnitude Ratio or Amplitude Ratio, is the ratio between input and output when
they have reached a steady state. The spans have been measured when the output has
reached a steady state so:

Note the results in your datasheet. The steady state relationship between input and
output is characterized by the Gain of the plant.

10
Measuring Time Constant:

Initial Slope Method:

● Make sure that lines A and B are the final and initial values of trace 4 respectively.
● Click in the Slope box. The line from the beginning of the transient sloping up to the right
has changed to blue. This allows you to measure the initial slope of the velocity trace.
The slope of the line can be changed by clicking in the graph area. The top of the line
will move to the time at which you clicked.
● Move the slope line until its slope is the same as that of the initial part of the transient,
such that the blue line covers the initial part of the purple velocity trace line.
● Click in the Time box. The vertical time line is highlighted.
● Click where the slope line crosses line A. The time shown is the Time Constant
measured by the initial slope method. Note the results in your datasheet.

Settling Time Method:

● Move the ‘Time’ line to the time at which the velocity trace first reaches its final value
(when the purple trace reaches line A). The time shown is 5 time constants from the start
of the transient Note the results in your datasheet.

63% Method:

● Calculate the 63% level, 63% level = Lower limit of output + 0.63 (Output Span).
● Click the A box to highlight Line A and move it to the 63% level. You may not be able to
set the line exactly owing to the screen resolution. Expanding the scale using the Magnify
and Shift controls may help. The traces require to be redrawn using Freeze | Redraw
option after Magnify or Shift are changed.
● Now click the Time box and move the time line to the time at which the velocity trace
reaches its 63% level. The time shown is the Time Constant measured by the 63%
method. Note the results in your datasheet.

11
Determining the response of First Order Lag:

● Click on Plant | Servo. The Plant has changed to a simulation of a servomotor such as
the MS15. In the top box of the plant area, set Kp equal to the measured gain. In the
next lower box Note the value of time constant measured (in milliseconds) then click in
the Overlay box alongside the plant area. Note that for the overlay feature to be of use
the magnify feature must be set to x1.
● This will show the measured response of the motor (purple) and the response of an
exponential (light green) having the Gain and Time Constant you have measured. The
values of gain and time constant can be changed and the graph redrawn until a good fit
between the experimental data and the response of the theoretical model is found. The
values of Gain and Time Constant set are the parameters which can be used to model
the plant.
● The two traces will not be an exact match owing to nonlinearities in the electronics and
mechanics (such as deadband in the drive amplifier, or static bearing friction) but should
be close enough for you to see that the response of the motor speed to a step input can
be represented by an exponential function. Note the results that show the most overlap
with the practical response in your datasheet.

Step Response with Different Load:

● The brake has the effect of increasing the friction. Unfreeze the display by selecting
Freeze | Start then select Plant | MS 15 Analog. Set the eddy current brake to position 2
and repeat the gain and time constant measurements. Note the loaded gain and loaded
time constant in your datasheet. The gain and time constant with load should be
significantly different than unloaded condition as it is still an open loop system.

Measuring Integrator Gain:

● With the motor disabled, engage the potentiometer and change the settings to those
shown below:

12
● Note the velocity in the red display.
● Set the timebase multiplier to x2, freeze the picture and switch the time markers ON.
The graph will look like that shown in Fig 4.

Fig 4: Determining the Relationship between Velocity and Position.

● The rate of change of position is measured by measuring the time it takes for the position
trace (blue) to go from the bottom of the screen to the top.
● Select channel 2 then set Line A to +4.000 volts and Line B to -4.000 volts. Using the
Time line, measure the times at which the output ramp crosses the two voltage markers.
Note the values in datasheet,

● Select channel 4 and use a voltage line to measure the tachometer voltage Vvel (purple
trace) Calculate the integrator gain Ki = Slope/Vvel volts per second per volt. A

13
tachometer output of Vvel volts will produce a rate of change of position of Ki x Vvel
volts/second.

Measuring Velocity in RPM:

● Observe the position curve. Click the time box. Position on time cursor T1 on starting of
a position cycle (00) and another time cursor on starting position of the next cycle.
Difference in the time gives the time period of revolution. 1/(𝑇2−𝑇1) gives the velocity in
revs/second. We can divide it by 60 to get RPM.

Fig 5: Measuring actual rotational velocity.

● We can determine Kr as the conversion relation between VVel and RPM where
RPM=Kr*Vvel

After determining all the parameters, the plant model would look something like this:

14
6. Data Table:

Step response:

15
Response under loaded condition:

Position response and the relationship between position and velocity:

Relationship between voltages and the parameters they represent:

The plant model in time:

Faculty Signature and Date

16
7. Lab report Questions:

● Why does the step response of the system differ from the ideal exponential response obtained from
the measured gain and time response?
● Why are the gain and time constants different for loaded and unloaded conditions?
● What can you infer from the position curve?
● What are the methods of determining the gain and time constant from Impulse and Ramp response?
● Use the calculator to calculate data points of the curve at 11 different time constants (t/τ = 0, 0.5, 1,
... ... ... 5). Draw a clear amplitude vs time plot and mark the 63% point for the first order lag using
the following equation:

17
Hardware Experiment No. 2
Frequency Response
1. Objective:
● Measure the parameters of a plant using frequency tests
● Describe the frequency characteristics of a first order lag
● Explain why Bode Plots are used in preference to other frequency plots
2. Theoretical Background:
Sine waves are naturally occurring phenomena. Pluck a guitar string and it vibrates sinusoidally. A ’pure’
musical tone is a sinusoid. Middle C is a sinusoid vibrating at 261.63 cycles per second. The S.I. unit is
the Hertz (Hz = cycles per second = revolutions per second) after the German physicist who first
described the concept.
It can be shown that any signal can be made up from a series of sinusoids of different frequencies and
amplitudes so that there is a definite mathematical relationship between the frequency composition of a
signal and its shape in time. For plant identification purposes, the nice thing about a sine wave is that if
you put a sine wave into a linear ’black box’, you get out a sine wave of the same frequency but changed
in amplitude and phase. Knowing the output frequency allows the signal to be extracted from noise using
tuned filters or digital filtering techniques.

Fig 1: Relationships between input and output sinusoids


The output has a different amplitude from the input and the ratio: 𝑂𝑢𝑡𝑝𝑢𝑡 𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒𝐼𝑛𝑝𝑢𝑡
𝐴𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒 is called the Amplitude ratio.
𝑉𝑜𝑢𝑡
Amplitude Ratio (dB) = 20log10( 𝑉𝑖𝑛 )
From the diagram, it can be seen that the output sinusoid lags in time behind the input. This lag is
measured in Degrees and is called the Phase Lag φ. Phase Lag can be calculated from the time
difference between the peaks of the two sinusoids. The Frequency of a signal (in Hertz, Hz) is the
number of cycles in one second. The Period is the time to complete 1 cycle so is the inverse of
frequency:
1
Period (sec) =
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦(𝐻𝑧)

18
Since there are 360° in one cycle period:
Phase lag φ = 360 𝑋 𝑇𝑖𝑚𝑒 𝐿𝑎𝑔𝑃𝑒𝑟𝑖𝑜𝑑 = 360 × Time Lag × Frequency
We will be analysing the frequency response of the DC motor in this experiment. A first order lag is
characterized, in frequency, by its low frequency gain and its cut-off frequency. At low frequency, there
is no phase shift. At high frequency, the Phase φ tends towards -90° (90° lag). At the Break Frequency
the phase φ is at -45°. It can be found out from the Bode Plot.

Fig 2: Bode Plot of the Frequency Response of the DC Motor


At low frequency, the Amplitude Ratio is the Gain (Kp) of the plant. At high frequency, the Amplitude
Ratio drops linearly on the graph. The straight line actually drops at a rate of -20 dB/decade, such that
every time the frequency increases by a factor of 10, the amplitude drops by 20 dB. In the bode plot, a
straight line needs to be drawn with this slope as a best fit to the high frequency section of the measured

19
curve. This line is shown dashed in Fig 2. It is only on a Bode plot that the curve at high frequency
becomes a straight line making it easy to determine the slope.
Also, a horizontal line needs to be drawn to extend the low frequency part of the curve to higher
frequencies. The frequency at which these two lines meet is called the Cut-off Frequency or Break
Frequency. At the break frequency, the actual curve should be 3 dB below the low frequency level.

3. Equipment:
● MS15 DC Motor Module
● AS3 Command Potentiometer
● CLIO Interface Module with PC Connection Lead
● System Power 90 Power Supply (or equivalent)
● 4mm Connecting Leads
● PC running VCL Virtual Control Laboratory Software

4. Connection Diagram:

Fig 3: Wiring Diagram - Analog Control

20
5. Procedure:
Load setup | CA06PE04. The setup is given below. Note that the Rate has been replaced by Frequency
and that the horizontal scale of the graph is now in Degrees.

Following the procedure, measure the amplitude and phase change of the speed signal over a range of
frequencies. Enter the measured values into the table in the datasheet then calculate the amplitude ratio.
Disable the motor after all frequencies have been measured. Start at 100 mHz then go down the table
then come back to 50 mHz and complete the low frequency tests. At each frequency, do the following
tasks:
● Freeze the display using the Freeze | Freeze option. Remember that the graph is not frozen until it
has completed drawing across the screen. At low frequency, do not initiate the freeze until the trace
has began a cycle at the left of the graph area.
● When the Frozen message appears, click Frequency ON. Measurement boxes appear in the scale
area.
● Measure the peak-peak voltage by placing lines A and B on the maximum and minimum velocity
values. The scale must be set to channel 4/velocity. The input peak-peak can be found by measuring
the input/dark blue trace. The input need only be measured at one frequency provided the signal
generator level is not changed. The peak-peak value is A - B. At high frequencies the output
amplitude will drop. Extra accuracy of measurement can be obtained by using the Magnify and Shift
controls.
● Select Phase D by clicking in the D box. Move the vertical line until it intersects with the peak value.
The reading in the box is the phase shift relative to 0° of the input trace. As you are measuring the
phase shift at the peak, the phase lag will be the measured value minus 90°.
● Find the amplitude ratio for all the frequencies and draw magnitude and phase bode plots in a semi-
log graph paper and find the break frequency by the following three ways:
● Draw a horizontal line through the low frequency amplitude points.
● Draw a line at slope –20 dB/decade through the high frequency points.
● The frequency at which these two lines meet is the break frequency.
● Adjust the lines if necessary to ensure that the actual amplitude curve is at 3 dB and the phase shift
is -45° at the break frequency.
● Average the three break frequencies to get the break frequency in Hz.

21
● Convert the frequency in radians/second unit, wc=2𝜋fc. It needs to be found because we can relate
time constant 𝜏=1𝑤𝑐.
● Observe the difference between gain and time constant obtained from the previous experiment.

6. Observation and Tabulation:

Determine the break frequency from the bode plot:

Comparison between the time and frequency tests:

7. Report:
● Do the time and frequency tests give the same result?
● What are the advantages of bode plots in building and identification of complex responses?

22
23
Hardware Experiment No. 3
Principles of Feedback
1. Objectives:
● Identify the significant parts of a feedback control system and manipulate transfer function blocks
● Derive the closed loop and error transfer functions from the forward and open loop transfer functions
● Describe the effect of closing the loop on the steady state performance, stiffness, response time and
frequency response
2. Theoretical Background:
a. Transfer Function:
The term Transfer Function is used to describe the relationship between the input and the output of
a block and is usually denoted by the symbol G.

Transfer Functions can be equations in time or frequency but all that is of concern at the moment is
that the output can be calculated if the transfer function and input are known.

Blocks described by transfer functions can be connected in series (one after the other) as shown in
Fig-1. The output of the first block is input to the second block, creating a series connection of the
two blocks.Transfer Functions of blocks in series are multiplied together.

Fig-1: Transfer function blocks in series.

If two blocks are in parallel, such that both have the same input and their outputs are summed together,
then a parallel connection results, as shown in Fig-2. Transfer Functions of blocks in parallel are
added together.

24
Fig-2: Transfer function blocks in parallel.
A special term is used when the output is directly proportional to the input, such that there are no time
constants involved. In this case the transfer function is termed the Gain which is given the symbol K.

Note: the gain can be less than 1 in which case it is sometimes termed Attenuation.
b. Closed Loop Transfer Function:
In the block diagram of Fig-4 ‘K’ is the transfer function of the controller, ‘G’ is the transfer function of
the plant and ‘H’ is the transfer function of the feedback.

Fig-3: Block Diagram of a General Control System


Studying Fig-4 and applying the rules of block combination, it can be seen that:
Output (C) = K x G x Error (E) ⇒ C = K.G.E ……………………….Eqn 1
and that:
Error (E) = Input (R) - H Output (C) ⇒ E = R - (H x C) ………….….Eqn 2
Substituting Eqn 2 for Error into Eqn 1 gives:
C = K x G x E = K x G x [R - (H x C)] = K.G.R - K.G.H.C
Manipulate this to get the Output(C) on one side and Input(R) on the other:

25
Bring the input over to the left to give the Closed Loop Transfer Function (CLTF):

K.G is called the Forward Loop Transfer Function (FLTF) and K.G.H is called the Open Loop
Transfer Function (OLTF). The Closed Loop Transfer Function can then be written as:

or,

c. Error Transfer Function:


It is sometimes useful to know the amount of error there is between the input and the output, relative to
the input. The equation for the amount of error (relative to the input) can also be derived from equations
1 and 2.

d. Closed Loop Performance - Steady State


The closed loop performance is described by the closed loop transfer function. To design a controller,
we need to know what influences the closed loop transfer function. Restate the closed loop transfer
function equation:

For Steady State performance we do not need to consider the dynamic effects so each of the transfer
functions can be represented by its gain. Dividing top and bottom by KG gives:

In most systems there is direct feedback so H = 1. This is called Unity Feedback. K is under our
control so we could make K.G large. 1/(K.G) would then be much less than 1 in which case this term
can be ignored and the output equals the input.

26
There are two difficulties to just increasing the gain. One is the transient effects which will be
considered later and the other is noise in the measurement. As you may have noticed, the velocity
measurement available from the tachometer tends to be noisy. If the gain is high, this noise is amplified
and affects the performance of the motor.
e. Closed Loop Performance – Transient
If tp is the plant time constant, as measured in Experiment 1, and tcl is the time constant of the closed
loop system, it can be shown, for the motor speed control system we have, that:

As the controller gain is increased, the time constant falls leading to a speeding up of the system.
Consider Fig-5:

Fig-4: Exponential Curves With The Same Time Constant But Different Amplitudes
The two exponential curves shown have the same time constant but are of different amplitude. There is
a 3:1 ratio in amplitude. Since the larger curve has to cover 3 times the distance in the same time,
initially it must be moving 3 times faster than the smaller curve.
In a feedback system, it is the error amplified which provides the drive. Initially the error is the size of
the step change and this is amplified so there is a large signal to drive the motor pumping more energy
into the system.
f. Closed Loop Performance – Frequency Response
Since the time constant is reduced by increasing the gain, it would be expected that the break
frequency would increase since break frequency is the inverse of time constant. Measuring the

27
frequency response is not, as you have seen, an easy task but the effect of gain on frequency
response can be illustrated by observing the phase change.
3. Equipment:
● MS15 DC Motor Module
● AS3 Command Potentiometer
● CLIO Interface Module with PC Connection Lead
● System Power 90 Power Supply (or equivalent)
● 4mm Connecting Leads
● PC running VCL Virtual Control Laboratory Software
4. Connection Diagram:

Fig 5: Wiring Diagram - Analog Control

28
Procedure:
1. Steady State Velocity Error with Proportional Gain
The system is set to control the motor speed. The block diagram of the system is shown in Fig-6.

Fig-6: Diagram of the Speed Control System


The circuit is arranged so that the voltage from the tachometer (measuring motor velocity) is
compared with the demanded velocity from the signal generator. The difference between
these two signals, the error, is amplified and used to drive the motor.
Start VCL software and Load setup | CA06PE05. The on-screen mimic should be compared
with Fig 5.5. The Input signal is trace 1 (dark blue), the output velocity is trace 4 (purple),
Error is trace 3 (dark green) and Drive is trace 5 (brown). The mimic shows where these
measurements are made.

● In Experiment 1, the gain Kp of the motor was found. Substituting Kp for G gives the
forward loop gain K.G = K.Kp. The velocity voltage is fed back directly so H = 1. In this
case, the Closed Loop Transfer Function can be written as:

………………………………………...Eqn 6

29
and the Error Response, from Eqn 4, is:

…………………………………………….........Eqn 7
● Check that the gain K in the gain box on the on-screen mimic is set to 1 and switch ON the
motor. Investigate how the error decreases as the gain is increased. With the Reference
Velocity set to 2.5 volts (50%), measure the Output Velocity and Error as the gain is
increased. Make these measurements for the values of gain shown in Table-1 and enter the
results in your workbook. If the motor starts to make a lot of noise at high gain, abandon the
high gain settings as this could damage the motor.
● Disable the motor.
● In line with predictions, as the gain increases, C/R → 1 and E/R → 0.

However, with high gain the output became noisy and the motor started

making peculiar noises. Steady State Error decreases as loop gain is

increased.
● Observation of the Drive signal should show that this signal gets noisier as the gain
increases - all of the tacho measurement noise is being amplified. This noise is not good for
the motor.
2. Decreasing time constant with increasing gain
Change the setup as indicated by the Table below.

● Using your measured value for gain Kp and time constant tp from Experiment 1, calculate the
expected time constant tcl at each of the gains in Table 2 using Equation 8. Measure the actual
time constant using the same technique that was used in Experiment 1 to measure time
constants and enter the theoretical and experimental values into your workbook.
● To help, the Time control should be set to x8 and the Magnify control to 5 on channel 4. Owing
to the static friction, it is not easy to measure the time constant with K = 1 so, for this
measurement only, set the Level to 40%.

30
● Set K = 10 and look at the Drive signal - the brown trace. When the step occurs, the initial error
is 2V. The drive, theoretically, should be K x Error = 20V. But the maximum drive signal
available is only 5V so the system saturates. Much less power than expected is being fed to
the motor so the transient time does not decrease as expected. Once the drive saturates, the
rise time of the transient becomes almost constant. The speed of response to a transient
should increase with increasing gain but the initial slope is limited by the maximum
drive signal.

3. Closed loop frequency response


● Change the setup as indicated by the Table below:

● Measure the phase lag of the output at the three gain settings shown in Table 3 and enter the
values of your workbook. Compare this figure with the open loop phase lag at this frequency as
measured in Experiment 2.
● The phase lag has reduced indicating that the break frequency does increase with increasing
gain. This time the increase continues as the gain increases. If you observe the drive signal you
will see that, even at a gain of 10, it is not saturating. Because the input signal does not have
steps in it, the error is never too great and the system stays within the linear region.
Observation and Tabulation:
1. Steady State Velocity Error with Proportional Gain
Input Voltage, R = 2.5 volts, Plant gain Kp =

Table-1: Accuracy as gain is increased.

31
2. Decreasing time constant with increasing gain

Table 2: Decreasing Time Constant with Increasing Gain


3. Closed loop frequency response

Table 3: Closed Loop Phase Lag


Report:
1. Did the measured closed loop time constant behave as expected (decreasing steadily until
saturation is reached) over the range of gains measured? If not, explain why.
2. Were the measured phase lags expected? Justify your answer

32
Hardware Experiment No. 4
Behavior of Second Order Systems

1. Objective
● Distinguish between underdamped, critically damped and overdamped systems
● Relate the overshoot and damped frequency to damping factor and natural frequency
● Describe the form of the step response and the frequency response of a second order
● system
2. Theoretical Background
Second Order Systems:
In the speed control system, the plant was characterized by its time constant, which is determined by the
inertia of the rotor and the viscous friction. This arrangement can be described mathematically by a first order
differential equation.
The position control system has an integration effect between velocity and position. This makes the position
control servomechanism into a second order system.
As a first order system is characterized by its time constant, it could be expected that a second order system
would be characterized by two time constants.
Fig 1 shows how the step response changes as the proportional gain is increased in a typical second order
system.

Figure 1: Step response of a typical second order system

33
When the gain is low, the response is sluggish and is said to be Overdamped. An overdamped response is
characterized by two separate time constants.
Curve b shows the fastest response this system can have without any oscillation. This response is said to be
Critically Damped. A critically damped response is characterized by two time constants both of the same
value.
With higher gain, the response overshoots and oscillates. This type of response is said to be Underdamped.
An underdamped response cannot be characterized by time constants. Mathematically it is described by a
decaying sinusoid.
Examining Fig-1, the "best" response would appear to be somewhere between curves b and c. Before we
can predict the gain necessary to give a specified response, we need to know how to describe the behaviour
of a second order system.
Underdamped systems are often described by the amount the response overshoots and by the frequency at
which it oscillates.
There are two other parameters used to describe second order systems - Damping Factor and Natural
Frequency of Oscillation.

Overshoot and Damping Factor:


Overshoot is the amount by which a response goes beyond the steady state value before settling down. Fig-
2 shows the response of a typical underdamped system.

Figure 2: Step response of an underdamped system


Overshoot can be measured from the step response. It is the ratio:

34
Overshoot is usually stated as a percentage, which is the above ratio multiplied by 100.
Another parameter called Damping Factor is used and this gives an indication of the amount of overshoot
in a system. The damping Factor has the symbol ζ (Zeta). ζ has a value of 1 when the system is critically
damped, less than 1 when underdamped and greater than 1 when overdamped.

The amount of overshoot is wholly dependent on the Damping Factor. Measuring overshoot allows the
damping factor to be calculated and knowing allows the overshoot to be calculated. They are linked by the
equations:

Damped and Natural Frequencies of Oscillation:


Damped Frequency
The frequency at which an underdamped system oscillates is called the Damped Frequency, ωd . This can
be determined by measuring the time between successive positive peaks if, as shown in Fig-3, there is more
than one cycle. The inverse of the period of a cycle is its frequency in Hertz:

The time to the first peak, Tp, is half the period. The damped frequency can then be found by measuring the
time to the first peak:

35
Natural Frequency
If there was no damping at all ( ζ = 0), the system would continuously oscillate at a frequency which is called
the Natural Frequency of the system. This is given the symbol ωn. The relationship between Natural and
Damped frequencies is:

The ωd increases as the gain increases, which means that increasing the gain makes the system work faster
but at the expense of increasing the overshoot.

Relating ζ and ωn to Open Loop Parameters:


To be able to design a system, we need to know how, in a closed loop system, ζ and ωn relate to the plant
parameters Kp, Ki and which were measured in Experiments 1 & 2.
The model shown in Fig-3 was developed.

Figure 3: Block Diagram of a Servo System


The two parameters describing the system are Gain (Kp x Ki) and Time Constant . The time constant can
also be stated as its inverse, the cut-off frequency ωc . The proportional gain in the controller must also be
considered so the forward loop gain of the servo system is K = Kc x Kp x Ki.
Damping Factor
Analysis of the system equations show that:

Critical Damping is when = 1, this occurs at,

36
Natural Frequency

Since ωc is fixed by the motor and the other system mechanics, the gain Kc is the only control variable in
proportional control. Varying Kc affects both ωd and ζ.
Using only proportional gain control, we can design for a particular overshoot or a particular time to first peak
but not both.
Second Order Step Response:
Rise Time
Fig-2 shows the step response of a second order system with the time to first peak and the overshoot marked.
So far the time response has been described by Tp, the time to first peak. With small overshoots this time
can be difficult to measure so Rise Time, Tr, is used instead. In this context, Rise Time is the time it takes
for the step response to reach its final value for the first time. Obviously this only has meaning if there is an
overshoot. Rise time is dependent on both damped frequency and damping factor. For a given damping
factor, rise time is proportional to the inverse of damped frequency, which gives:

Decay Time
Another characteristic of the response which has not been discussed is the time it takes for the oscillation to
die away. This is called the Decay Time. This is an exponential with time constant,

Fig-4 shows a number of step responses with the same ωn and different values of ζ. These curves can be
used to estimate a step response when the parameters are known.

37
Figure 4: Second order step response for various damping factors
3. Equipment
● MS15 DC Motor Module
● AS3 Command Potentiometer
● CLIO Interface Module with PC Connection Lead
● System Power 90 Power Supply (or equivalent)
● 4mm Connecting Leads
● PC running VCL Virtual Control Laboratory Software
4. Connection Diagram

Figure 5: Wiring diagram - Analog control


5. Procedure
● Start VCL software and Load setup | CA06PE07.

38
● Set the gain Kc to 1.5. and Kv to 0 (VFB is not used in this exercise).
● Switch On and, when a complete graph has been drawn, freeze the traces and enable the Time
markers.
● Using the markers, measure the steady state output change and the peak output change. This
allows the overshoot to be calculated.
● Obtain the damping factor ζ.
● Measure the time to the first peak.
● Calculate the damped frequency ωd and then the natural frequency ωd.
● Enter these values in Table-1 in your workbook.
● Using the model obtained in Experiments 1 and 2, calculate the expected values for damping factor
and natural frequency with Kc = 1.5. Enter the values into Table-2.

6. Data table

Faculty Signature and Date


39
7. Lab Report Questions
● A plant has a gain Kp of 2 and an integrator gain Ki of 2. If the break frequency is 10 rad/sec, what
gain is required to give a damped frequency of 13 rad/sec?
● What are the factors that contribute to errors between calculated and measured values for damping
factor and natural frequency?

40
Hardware Experiment No. 5
Position Control with Velocity Feedback

1. Objective
● Set up a servo system to respond to step inputs using proportional gain and velocity feedback.
● Set up a servo system to respond to ramp inputs using proportional gain and transient velocity
feedback

2. Theoretical Background
A system can be characterized by its Natural Frequency ωn and its Damping Factor ζ. The natural frequency
ωn is a measure of the speed of response of the system, the time to first peak being dependent mainly on
ωn. The damping factor ζ is an indication of how oscillatory the system is. It was also shown that, in a closed
loop system, the proportional gain affected both ωn and ζ. Increasing gain makes the system respond faster
but also makes it more oscillatory. This results in greater overshoot and longer settling time.
What is required is a scheme whereby the proportional gain can be increased to speed up the system and
another control introduced to increase the damping.
The additional control added is called Velocity Feedback (VFB). In the early days of electromechanical servo
systems, it was easy to introduce velocity feedback as a voltage proportional to rotational velocity can be
obtained from the signals associated with an electric motor. Nowadays a separate tachogenerator is more
likely to be used to generate the velocity signal.
To influence the damping factor, the apparent time constant of the motor must be changed. Increasing the
gain of the speed controller reduces the time constant. Velocity Feedback uses this fact to produce an inner
control loop with Kv being a time constant adjustment independent of the proportional gain. The block
diagram of this is shown in Fig 1.

Figure 1: Servo System with Velocity Feedback

41
With velocity feedback to dampen the oscillations:
● Increasing the gain makes the system work faster - provided the drive signal does not saturate.
Once the drive saturates the response time tends to remain constant.
● Increasing gain reduces steady state errors due to static friction and backlash.
However, owing to drive saturation, high gain will make the response to large changes differ from that to
small changes. The gain and velocity feedback have to be optimized for the most important type of signal.
Having two controls allows two parameters to be controlled. Gain controls the speed of response and
velocity feedback controls the amount of damping.
Calculating Kv and Kc from Rise Time and Overshoot specifications:
Often the specification for a system is given in terms of a required maximum %Overshoot and a maximum
Rise Time.
Damping Factor can be obtained from overshoot by the formula:

It can be shown that the controller proportional gain, Kc, required for the specified time to first peak and
damping factor is given by:

Kp, Ki and ωc were measured in previous experiments.


The velocity feedback required is given by:

Since Kv is dependent on Kc, Kc must be calculated first.


3. Equipment
● MS15 DC Motor Module
● AS3 Command Potentiometer
● CLIO Interface Module with PC Connection Lead
● System Power 90 Power Supply (or equivalent)
● 4mm Connecting Leads
● PC running VCL Virtual Control Laboratory Software
4. Connection Diagram
42
Figure 2: Wiring Diagram - Analog Control
5. Procedure
The system should be wired with the standard analog system connections as shown in Fig 2.
● Start the VCL software and Load setup | CA06PE08.

● Switch on the system. The Gain Kc should be set to 2.5 and the Velocity Feedback Kv to 0 (Off). The
Magnify control of the input and position traces have been set to 5.
● The system is very underdamped. Observe that the drive signal (brown) does not go negative to
brake movement until the position (blue) has gone above the input (dark blue). Selecting Time x4
will make this more obvious.
● Add Velocity Feedback by setting Kv to 1.00. The oscillations have been reduced. Observe that the
drive now goes negative to brake the motor well before the output reaches its final value. Increase
Kv to 2.00. Braking now starts even earlier. Velocity Feedback has stabilized the system.
● Adjust Kv until there is just a small overshoot and note the value in your datasheet. This is usually
considered the “best” or “optimal” setting for a particular gain.

43
● Increasing the gain should increase the speed of response. With a small

overshoot, the speed of response can be measured by taking the time for the

output response to reach its final value for the first time, i.e. when it crosses the

input trace assuming both are on the same scale. This is called the Rise Time Tr.

Since ωn is proportional to K, rise time will be proportional to √K, i.e. if K is doubled,

rise time will fall by 0.7. Using the x2, x4 or x8 time expansion controls will allow

the rise times to be measured more accurately. Set the gain to different values.

For each gain adjust Kv to give the same overshoot. Measure the rise time,

calculate the expected rise time (using the Kc = 2.5 values and √K proportionality)
and enter the values into your datasheet.
● With Kc = 10 and Kv at the setting to give optimum response, set the eddy current brake to position
2. Observe that there is little change to the overall response even though the extra load changes the
gain and time constant of the plant. The response is now dominated by the loop gain and the velocity
feedback.

6. Data Table
Velocity feedback:

Optimizing the settings:

Design exercise:

44
Faculty Signature and Date

7. Lab Report Questions


● Is the rise time almost the same as expected rise times for all values of gain? If not, what is the
reason for this discrepancy?
● In the design exercise, are the measured plant and model parameters consistent? If not, what is
the reason for this discrepancy?

45
Software Experiment No. 1

Analysis of Open Loop and Closed Loop Control Systems


and Effect of Gain on Stability of the System via Root Locus

1. Objective:
● Analyze the output of open loop and closed loop control system using MATLAB and SIMULINK
● Observe the effect of proportional, Integral and Differential Controller using MATLAB and SIMULINK
● Learn the basics of root locus
● Analyze the effect of gain on stability of the system

2. Theoretical Background:

The prerequisite of understanding and controlling a physical system is to derive a mathematical model of it.
Once the model is known, it becomes easier to analyze the effect of perturbation and disturbances in the
system and control the system. Control system can be of two types:

Open Loop Control System:


A control system in which the control action is totally independent of output of the system is called an open
loop control system. A manual control system is also an open loop control system.

Closed Loop Control System:


Control system in which the output has an effect on the input quantity in such a manner that the input quantity
will adjust itself based on the output generated is called a closed loop control system. Open loop control
system can be converted into a closed loop control system by providing feedback. This feedback
automatically makes the suitable changes in the output due to external disturbance.

46
There are three classes of controllers available – proportional, derivative and integral.
Combining them, proportional-integral controller, proportional-derivative controller and proportional-
integral-derivative controller can also be made. The transfer function of the controllers is: 𝐾𝑝 + 𝐾𝑖 /𝑠 +
𝐾𝑑 ∗ 𝑠) where 𝐾𝑝 =proportional gain, 𝐾𝑖 =integral gain and 𝐾𝑑 = derivative gain.

3. Software Requirements:
MATLAB with Simulink.
Recommended PC specifications:
Windows/ Mac: Microsoft® Windows® 7 Professional, Enterprise, Ultimate or Home Premium (64-bit);
Windows 8 (64-bit) (All Service Packs); Windows 10 (64-bit); Windows 2008 R2 Server; Windows 2012
Server (All Service Packs).
Ram: 4 GB
Processor: Intel® Pentium® 4 or AMD Athlon XP 2000 with multi-core CPU
Display resolutions: 1,024 x 768 display resolution with true color (16-bit color)

4. Procedure:
Example 1: Consider, a second order system is characterized by the transfer function 𝐺(𝑠)=2𝑠2+12𝑠+20.
Analyze the output if:
● the system is open loop
● the system has a unity negative feedback with proportional, integral and differential controller
MATLAB Interpretation:
clc;
clear all;
close all;
s=tf('s');
num=2;
den=s^2+12*s+20;
G=num/den;
kp=5;
ki=10;
kd=2;
figure;

47
step (G,0:0.1:5);
title('Step Response for the Open Loop System');
GP=feedback(G*kp,1);
figure;
step (GP,0:0.1:5);
title('Step Response for the Close Loop System with Proportional Controller');
GPI=feedback(G*(kp+ki/s),1);
figure;
step (GPI,0:0.1:5);
title('Step Response for the Close Loop System with Proportional-Integral Controller');
GPD=feedback(G*(kp+kd*s),1);
figure;
step (GPD,0:0.1:5);
title('Step Response for the Close Loop System with Proportional-Derivative Controller');

Output graphs:

48
49
Example-2: Consider the same system described in Example-1 and analyse outputs using Simulink.
Simulink:
1. Open Simulink by typing simulink in the command window or by clicking Simulink Library icon from
Home.

2. A window will appear.

50
3. Go to File>New>Model
A design window will open. Here you will design and simulate different models of systems.

If you click on the button marked with red arrow, it will take you to Simulink Library Browser from where you
can find necessary components to design your model/models.

51
Open loop without controller-

Closed loop with proportional control-

Closed loop with proportional-integral (PI) control-

52
Closed loop with proportional-derivative (PD) control-

Homework- Closed loop with proportional-integral-derivative (PID) control.

There is an alternative approach to design closed loop with PID control. There is a component available in
MATLAB Simulink Library- PID Controller. You can use this component instead of using multiple gains,
integrator and derivative component/s. It also provides an advantage of Tuning.

53
Root Locus:
The root locus of a feedback system is the graphical representation in the complex s-plane of the possible
locations of its closed-loop poles for varying values of a certain system parameter.
Consider the system:

The overall transfer function of the system is:

Change in gain causes change in pole location of the system and as a result, the stability is affected.

MATLAB Interpretation:
clc;
clear all;
close all;
s=tf('s');
num=(s-3)*(s-5);
den=(s+1)*(s+2);
G=num/den;
figure;
rlocus(G);
[k,poles] = rlocfind(G);
figure;
G1=feedback(k*G,1);
step (G1,0:0.1:10);
stepinfo(G1)

54
Overdamped:

55
Critically Damped:

Underdamped:

Undamped:

56
Unstable:

5. Lab Report Direction:


1. Consider the following transfer function:𝐺(𝑠) = 25/(𝑠 2 + 11𝑠 + 25)

a. Plot the step response of the system in the same plot if proportional controller of Kp=5,10,50 and 100 are
used and make a table containing the settling time, overshoot and steady state error. Show the step
response using Simulink for any one of the Kp values.

b. Plot the step response of the system in the same plot if proportional integral controller of Kp=5 and
Ki=5,10,20 and 50 are used and make a table containing the settling time, overshoot and steady state
error. Show the step response using Simulink for any one of the Kp and Ki combinations.

57
c. Plot the step response of the system in the same plot if proportional derivative controller of Kp=5 and
Kd=0.5,1,2 and 3 are used and make a table containing the settling time, overshoot and steady state error.
Show the step response using Simulink for any one of the Kp and Kd combinations.

d. Determine the Kp, Kd and Ki required to design the best control system in terms of both steady state and
transient performance and plot the step response using the PID controller. Use Simulink to obtain the
values of Kp, Kd and Ki fulfilling following criteria-

i. Rise time- 0.4-0.5 sec


ii. Settling time is less than 0.8 sec
iii. Maximum overshoot 5%

2. Consider the following system:


𝐺(𝑠)=𝐾 ∗ [(𝑠 − 3)(𝑠 − 5)/(𝑠 + 1)(𝑠 + 2)]

Find the range or value of gain K that makes the system:


a. Overdamped
b. Critically Damped
c. Under Damped
d. Marginally Stable
e. Unstable

58
Software Experiment No. 2
Analysis of Effect of Input Waveform, Loop Gain, and System
Type upon Steady-State Errors

1. Objective:
To verify the effect of input waveform, loop gain, and system type upon steady-state errors

2. Theoretical Background:
The difference between the input and output of a control system as the time tends to infinity, i.e. the system
has reached a steady state is called the steady state error. The steady-state error depends on the type of
input (step, ramp, parabolic etc.) and the type of system (0, I or II).

System Type:
The system type depends on the open loop transfer function (G(s)). The number of pure integrations in the
forward path of a system is called the type of a system. Let us consider the following systems:

Type-0 system-

Type-1 system-

Type-2 system-

Steady State Error:


Consider the following block diagram-

Here,

59
Now if the system is provided with unit step input, R(s)= (1/s)

Here kp = Position Constant

Now if the system is provided with unit ramp input, R(s)= (1/s2)

Here kv= Velocity Constant

Now if the system is provided with parabolic input, R(s)= (1/s3)

Here, ka = Acceleration Constant


kp, kv and ka are called static error constants.

Relationships between input, system type, static error constants, and steady-state errors:

3. Software Requirement:
MATLAB Simulink,
Recommended PC specifications:
Windows/ Mac: Microsoft® Windows® 7 Professional, Enterprise, Ultimate or Home Premium (64-bit);
Windows 8 (64-bit) (All Service Packs); Windows 10 (64-bit); Windows 2008 R2 Server; Windows 2012
Server (All Service Packs).
Ram: 4 GB
Processor: Intel® Pentium® 4 or AMD Athlon XP 2000 with multi-core CPU

60
Display resolutions: 1,024 x 768 display resolution with true color (16-bit color)
4. Procedure:
MATLAB Interpretation-
clc;
clear all;
close all;

% System Definition
s=tf('s');
G0=(100*(s+3)*(s+5))/((s+7)*(s+8)); %Type 0 System
G1=(100*(s+3)*(s+5))/(s*(s+7)*(s+8)); %Type I System
G2=(100*(s+3)*(s+5))/(s*s*(s+7)*(s+8)); %Type II System
ts0 = feedback(G0,1);
ts1 = feedback(G1,1);
ts2 = feedback(G2,1);

%Input Definition
t = 0:0.1:10;
R0=(t>=0); %Unit Step
R1=t; %Unit Ramp
R2=0.5.*t.*t; %Parabola

y0 = lsim(ts0,R0,t); %Response of Type 0 system to Step input


e0=R0'-y0; %Error of Type 0 system to Step input
y1 = lsim(ts1,R0,t); %Response of Type I system to Step input
e1=R0'-y1; %Error of Type I system to Step input
y2 = lsim(ts2,R0,t); %Response of Type II system to Step input
e2=R0'-y2; %Error of Type II system to Step input
figure;
subplot(311),plot(t,y0,'r',t,R0,'b', t,e0 ,'k'),xlabel('Time
(sec)'),ylabel('Amplitude'),ylim([0,1.5]),legend('output','input','error');
subplot(312),plot(t,y1,'r',t,R0,'b', t,e1 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude'),ylim([0,1.5])
subplot(313),plot(t,y2,'r',t,R0,'b', t,e2 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude'),ylim([0,1.5])

%%
yy0 = lsim(ts0,R1,t); %Response of Type 0 system to Ramp input
ee0=R1'-yy0; %Error of Type 0 system to Ramp input
yy1 = lsim(ts1,R1,t); %Response of Type I system to Ramp input
ee1=R1'-yy1; %Error of Type I system to Ramp input
yy2 = lsim(ts2,R1,t); %Response of Type II system to Ramp input

61
ee2=R1'-yy2; %Error of Type II system to Ramp input
figure;
subplot(311),plot(t,yy0,'r',t,R1,'b', t,ee0 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude')
subplot(312),plot(t,yy1,'r',t,R1,'b', t,ee1 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude')
subplot(313),plot(t,yy2,'r',t,R1,'b', t,ee2 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude')

Homework- Try for parabolic input (same process)

Output Graphs-
Step input for Type-0, Type-1 and Type-2 systems-

Ramp input for Type-0, Type-1 and Type-2 systems-

62
We can verify the relationship table from these graphs.

5. Lab Report Direction:


Observe the following unity negative feedback system:

1. What is the type of the system? Comment by analyzing the error corresponding to step, ramp and parabolic
input.
2. Show the step response of the system and find the step information of the system. Show the same for the
other two types. Find the steady state error in each case.
3. Show the ramp response of the system. Show the same for the other two types. Find the steady state error
in each case.
4. Show the parabolic response of the system. Show the same for the other two types. Find the steady state
error in each case.
5. What are the theoretical values of errors in each case? Does the steady state error in each case match
the theoretical value?

63
Software Experiment No. 3
Design of Compensators to Improve Steady State and
Transient Response of a Second Order System

1. Objective:
• Design lag compensator to decrease the steady state error
• Design lead compensator to increase the speed of response of a system

2. Theoretical Background: A second order system is characterized by its overshoot, rise time, peak
time, settling time and steady state error. All the components of a control system are designed
keeping these considerations in mind. Design of a controller needs to maintain a specific overshoot
level which is capable of performing a duty in a specific time and also minimize the steady state error
of the system. Different types of controllers are designed in order to meet up the design requirements
of the system.

Compensator Transfer Function Operation

PI 𝑠 + 𝑧𝑐 Improves steady state error


𝐾
𝑠
PD 𝐾(𝑠 + 𝑧𝑐 ) Improves transient performance

PID (𝑠 + 𝑧1 )(𝑠 + 𝑧2 ) Improves Both


𝐾
𝑠
Lag 𝑠 + 𝑧𝑐 Improves steady state error
𝐾
𝑠 + 𝑝𝑐

Lead 𝑠 + 𝑧𝑐 Improves transient performance


𝐾
𝑠 + 𝑝𝑐

Lag-Lead 𝑠 + 𝑧𝑙𝑎𝑔 𝑠 + 𝑧𝑙𝑒𝑎𝑑 Improves Both


𝐾
𝑠 + 𝑝𝑙𝑎𝑔 𝑠 + 𝑝𝑙𝑒𝑎𝑑

PI, PD and PID compensators require active elements in circuit implementation and external power supplies
are required which as well make them unsuitable for most use. Lag, lead and lag-lead can perform similar
tasks using passive components. Unlike PI, lag compensator cannot increase the type of the system as they
cannot perform pure integration. But nevertheless, they improve the steady state performance.
In PD controllers, a single zero is placed on the path to improve the transient performance. This cannot be
done using lead compensator. A pole has to be introduced with the zero but nevertheless they perform the
desired task.

64
3. Software requirements:

MATLAB Simulink,
Minimum PC specifications:
Windows/ Mac: Microsoft® Windows® 7 Professional, Enterprise, Ultimate or Home Premium (64-bit);
Windows 8 (64-bit) (All Service Packs); Windows 10 (64-bit); Windows 2008 R2 Server; Windows 2012
Server (All Service Packs).
Ram: 4 GB
Processor: Intel® Pentium® 4 or AMD Athlon XP 2000 with multi-core CPU
Display resolutions: 1,024 x 768 display resolution with true color (16-bit color)

4. Procedure:
Designing a lag compensator:
A system is characterized by the transfer function:
1
𝐺(𝑠) =
𝑠(𝑠 + 2)(𝑠 + 10)
We have to design a lag compensator for a system operating with an overshoot of 20% to reduce the
steady state error to a ramp input tenfold.
1
𝜁=√ 𝜋 = 0.4559
1+[ ]2
𝑙𝑛 𝑙𝑛 (𝑂𝑆)
Now,
𝑠 + 𝑧𝑙𝑎𝑔
𝐺𝑙𝑎𝑔 (𝑠) = 𝐾
𝑠 + 𝑝𝑙𝑎𝑔
Now for ramp input,
1 𝑒(∞) 𝑙𝑖𝑚 𝑠. 𝐺𝑙𝑎𝑔 (𝑠). 𝐺(𝑠)
𝑒(∞) = ⇒ = 𝑠→0
𝑙𝑖𝑚 𝑠. 𝐺(𝑠) 𝑒𝑙𝑎𝑔 (∞) 𝑙𝑖𝑚 𝑠. 𝐺(𝑠)
𝑠→0 𝑠→0
𝑧𝑙𝑎𝑔
2.10. 𝑝𝑙𝑎𝑔
⇒ 10 =
1
2.10
𝑧𝑙𝑎𝑔
⇒ = 10
𝑝𝑙𝑎𝑔
If we take Plag=0.01, Zlag=0.1

clc;
clear all;
close all;
s=tf('s');
t = 0:0.1:30;
G=1/(s*(s+2)*(s+10)); %transfer function

65
figure;
rlocus(G); %root locus
sgrid(.4559,0); %zeta=0.4559
[k,poles]=rlocfind(G)
G1=feedback(k*G,1); %actual system
figure;
step(t,G1);
stepinfo(G1)
lag=(s+.1)/(s+.01); %zero=10*pole
G2=G*lag;
figure;
rlocus(G2);
sgrid(.4559,0); %zeta=0.4559
[k,poles]=rlocfind(G2)
G3=feedback(k*G2,1); %compensated system
figure;
step(t,G3);
stepinfo(G3)
R1=t; %Unit Ramp
[yy1,t,xx1] = lsim(G1,R1,t); %Response of Type I system to Ramp input
ee1=R1'-yy1; %Error of Type I system to Ramp input
[y1,t,x1] = lsim(G3,R1,t); %Response of Type I system to Ramp input
e1=R1'-y1; %Error of Type I system to Ramp input
figure;
plot(t,yy1,'r',t,R1,'b', t,ee1 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude');
figure;
plot(t,y1,'r',t,R1,'b', t,e1 ,'k'),xlabel('Time (sec)'),ylabel('Amplitude')

66
67
68
Designing a lead compensator:
A system is characterized by the transfer function:
1
𝐺(𝑠) =
(𝑠 + 1)(𝑠 + 2)(𝑠 + 10)
We have to design a lead compensator to a system operating with overshoot of 20% to reduce the settling
time twofold.
𝑠 + 𝑧𝑙𝑒𝑎𝑑
𝐺𝑙𝑒𝑎𝑑 (𝑠) = 𝐾
𝑠 + 𝑝𝑙𝑒𝑎𝑑
Step 1. Find the pole location at the desired value of overshoot.

69
clc;
clear all;
close all;
s=tf('s');
G=1/((s+1)*(s+2)*(s+10)); %transfer function
figure;
rlocus(G); %root locus
sgrid(.4559,0); %zeta=0.4559
[k,poles]=rlocfind(G)
G1=feedback(k*G,1); %actual system
t=0:.1:50;
figure;
step(t,G1);
stepinfo(G1)

70
4 𝜋
Step 2: We know, 𝑇𝑠 = 𝜁𝑤 𝑎𝑛𝑑 𝑇𝑝 =
𝑛
𝑤𝑛 √(1−𝜁2 )
𝑤𝑛 2
Now for a second order system of transfer function: 𝐺(𝑠) =
𝑠 2 +2𝜁𝑤𝑛 𝑠+𝑤𝑛 2

The locations of the poles are: 𝜁 𝑤𝑛 ± 𝑖𝑤𝑛 √(1 − 𝜁2 )

Thus, the settling time is inversely proportional to the real part of the pole and the peak time is inversely
proportional to the imaginary part of the pole. And so, in order to decrease the settling time twofold, we have
to increase the real part of the pole by a factor of 2.
Again, since we want to keep the overshoot fixed, we need to move through the constant ζ line. Since a
constant zeta line is a straight line passing through origin (follows the formula y=mx), increasing the real part
twofold inherently means increasing the imaginary part twofold as well.
So the new pole location= 2(-1.1849) ± i 2(2.3249) = -2.3698 ± i 4.6498
In order to make this pole a part of our root locus, we need to satisfy the angle contribution. In order to do
that, we at first cancel an arbitrary pole of the open loop system placing a zero through pole zero cancellation.
This zero will act as the zero of the controller (Zlead) And then we measure the angle contribution of the rest
of the poles with the new pole. Let us choose Zlead=2 in our problem.

71
𝐴𝐷 4.6498
In triangle ABD, 𝜃1 = 𝑡𝑎𝑛−1 𝐵𝐷 = 𝑡𝑎𝑛−1 10−2.3698 = 31.350
𝐴𝐷 4.6498
In triangle ABD, 𝜃2 = 1800 − 𝑡𝑎𝑛−1 𝐷𝐶 = 𝑡𝑎𝑛−1 2.3698−1 = 106.410
Total angle contribution from the two existing poles=106.410 + 31.350 = 137.760
Thus the new pole of the compensator has to contribute an angle of 𝜃 = 1800 − 137.760 = 42.240
𝐴𝐷 4.6498
Now 𝜃 = 𝑡𝑎𝑛−1 𝑃 𝐷 = 𝑡𝑎𝑛−1 𝑃 −2.3698 𝑃𝑐 = 7.49
𝑐 𝑐
𝑠+2
Thus the designed lead compensator is 𝐾 𝑠+7.49
We still need to find the gain of the compensator using the rlocfind() function.

Gc=G*((s+2)/(s+7.49));
rlocus(Gc); %root locus
sgrid(.4559,0);
[k,poles]=rlocfind(Gc)
G2=feedback(k*Gc,1); %compensated system
figure;
step(t,G2);
stepinfo(G2)

72
5. Lab report directions:

1. A system is characterized by the transfer function:


1
𝐺(𝑠) =
(𝑠 + 1)(𝑠 + 2)(𝑠 + 10)
We have to design a lag compensator for a system operating with an overshoot of 20% to reduce the
steady state error to a step input tenfold.

73
2. A system is characterized by the transfer function:
1
𝐺(𝑠) =
(𝑠 + 1)(𝑠 + 2)(𝑠 + 10)
We have to design a lead compensator to a system operating with an overshoot of 20% to reduce the peak
time twofold.

74
Software Experiment No. 4
Modelling of a Control System Using Root Locus

1. Objective:
Apply the knowledge of lag and lead compensators to design a controller to operate a given system
within specification in terms of error and transient response.

2. Theoretical Background: A lag controller improves the steady state characteristics of the system but at
the same time the system becomes slow. Again a lead controller speeds up a system but cannot improve
the steady state condition without affecting the overshoot. Both the controllers have their own
disadvantages and trade-offs. A lag-lead controller can be designed in order to improve both the steady
state and transient response.

3. Software requirements:

MATLAB Simulink,
Minimum PC specifications:
Windows/ Mac: Microsoft® Windows® 7 Professional, Enterprise, Ultimate or Home Premium (64-bit);
Windows 8 (64-bit) (All Service Packs); Windows 10 (64-bit); Windows 2008 R2 Server; Windows 2012
Server (All Service Packs).
Ram: 4 GB
Processor: Intel® Pentium® 4 or AMD Athlon XP 2000 with multi-core CPU
Display resolutions: 1,024 x 768 display resolution with true color (16-bit color)

4. Procedure:
A system is characterized by the system function:
𝑘
𝐺 (𝑠 ) =
(𝑠 + 1)(𝑠 + 6)(𝑠 + 10)
We have to design a lag-lead controller that controls the system in such a way that the system operates
with overshoot of 15%, the peak time of 470 milliseconds and Steady State Error of 5% for step input.

Step 1: Design the lead compensator:


1
𝜁=√ 𝜋 = 0.5169
1+[ ] 2
𝑙𝑛 𝑙𝑛 (𝑂𝑆)
For the desired value of overshoot, we find the dominant poles.

75
clc;
clear all;
close all;
s=tf('s');
G=1/((s+1)*(s+6)*(s+10)); %transfer function
figure;
rlocus(G); %root locus
sgrid(.5169,0); %zeta=0.5169
[k,poles]=rlocfind(G)
G1=feedback(k*G,1); %actual system
t=0:.1:50;
figure;
step(t,G1);
stepinfo(G1)

76
The peak time is 875 milliseconds. We want to reduce the peak time to 470 milliseconds, that is 875/470=
1.86 times. Thus, we have to increase the dominant poles by 1.86 times.
So, new set of dominant poles= 1.86*( -2.2355 ± 3.8711 i) = -4.16 ± 7.20 i
Now,
𝑠 + 𝑧𝑙𝑒𝑎𝑑
𝐺𝑙𝑒𝑎𝑑 =
𝑠 + 𝑝𝑙𝑒𝑎𝑑
Let us select Zlead = 6 so that we can cancel the (s+6) pole. The angle contribution of (-4.18 + 7.24 i) on the
system is
7.20 7.20
𝑡𝑎𝑛−1 + (180 − 𝑡𝑎𝑛−1 ) = 164.650
10 − 4.16 4.16 − 1
Thus, the pole of lead compensator has to make the angle contribution of 1800 − 164.910 = 15.350 .
7.20
New pole position, 𝑃𝑙𝑒𝑎𝑑 = 𝑡𝑎𝑛 (15.350) + 4.16 = 30.39
Thus, the lead compensator:
𝑠+6
𝐺𝑙𝑒𝑎𝑑 =
𝑠 + 30.39
Glead=(s+6)/(s+30.39);
rlocus(G*Glead);
sgrid(.5169,0); %zeta=0.5169
[k,poles]=rlocfind(G*Glead)
G2=feedback(k*G*Glead,1); %Lead compensated system
figure;
step(t,G2);
stepinfo(G2)

77
Step:2 Design the lag compensator:
𝑠 + 𝑧𝑙𝑎𝑔
𝐺𝑙𝑎𝑔 =
𝑠 + 𝑝𝑙𝑎𝑔
We can see that after lag compensation, the steady state value is 0.863. Thus, the error is 13.7%. We want
to make the error 5%. Thus, the new error should be 0.05.
Since this is a type-0 system,

78
1 1
𝑒(∞) = ⇒ 𝑒𝑙𝑎𝑔−𝑙𝑒𝑎𝑑 (∞) = = 0.05
1 + 𝑙𝑖𝑚 𝐺(𝑠) 1 + 𝑙𝑖𝑚 𝐾. 𝐺𝑙𝑒𝑎𝑑 (𝑠). 𝐺𝑙𝑎𝑔 (𝑠). 𝐺(𝑠)
𝑠→0 𝑠→0

1
Now, 𝑙𝑖𝑚 𝐾. 𝐺𝑙𝑒𝑎𝑑 (𝑠). 𝐺𝑙𝑎𝑔 (𝑠). 𝐺(𝑠) = 0.05 − 1 = 19
𝑠→0
1 6 𝑧𝑙𝑎𝑔
𝑙𝑖𝑚 𝐾. 𝐺𝑙𝑎𝑔 (𝑠). 𝐺𝑙𝑒𝑎𝑑 (𝑠). 𝐺(𝑠) = 1.9124 × 103 × × × = 19
𝑠→0 1 × 6 × 10 30.39 𝑝𝑙𝑎𝑔
𝑧𝑙𝑎𝑔
⇒ = 3.02
𝑝𝑙𝑎𝑔
Let us take Plag=0.1; Thus Zlag=0.302
Thus, the lag compensator:
𝑠 + 0.302
𝐺𝑙𝑎𝑔 =
𝑠 + 0.1

Glag=(s+0.302)/(s+0.1);
rlocus(G*Glead*Glag);
sgrid(.5169,0); %zeta=0.5169
[k,poles]=rlocfind(G*Glead*Glag)
G3=feedback(k*G*Glead*Glag,1); %Lag-lead compensated system
t1=0:.1:20;
figure;
step(t1,G3), hold on;
step(t1,G1) %actual system
stepinfo(G3)

79
5. Lab report directions:

A system is characterized by the transfer function:


𝑘
𝐺(𝑠) =
𝑠(𝑠 + 6)(𝑠 + 10)

80
Design a lag-lead compensator for the system so that the system will operate with 20% overshoot and
a twofold reduction in settling time. Further, the compensated system will exhibit a tenfold
improvement in steady-state error for a ramp input.

81

You might also like