Control Lab Manual
Control Lab Manual
Control Laboratory
MX-0908453
Mechatronics Eng. Dept.
Automatic Control System
Experiment 1: Mathematical Modelling Using Simulink
• Static vs. Dynamic: A dynamic model accounts for time-dependent changes in the state of the
system, while a static (or steady-state) model calculates the system in equilibrium, and thus is
time-invariant. Dynamic models typically are represented by differential equations.
• Explicit vs. Implicit: If all of the input parameters of the overall model are known, and the
output parameters can be calculated by a finite series of computations (known as linear
programming, not to be confused with linearity as described above), the model is said to
be explicit. But sometimes it is the output parameters which are known, and the corresponding
inputs must be solved for by an iterative procedure, such as Newton's method (if the model is
linear) or Broyden's method (if non-linear). For example, a jet engine's physical properties such
as turbine and nozzle throat areas can be explicitly calculated given a design thermodynamic
cycle (air and fuel flow rates, pressures, and temperatures) at a specific flight condition and
power setting, but the engine's operating cycles at other flight conditions and power settings
cannot be explicitly calculated from the constant physical properties.
• Discrete vs. Continuous: A discrete model treats objects as discrete, such as the particles in
a molecular model or the states in a statistical model; while a continuous model represents the
objects in a continuous manner, such as the velocity field of fluid in pipe flows, temperatures and
stresses in a solid, and electric field that applies continuously over the entire model due to a point
charge.
• Deterministic vs. Probabilistic (stochastic): A deterministic model is one in which every set of
variable states is uniquely determined by parameters in the model and by sets of previous states
of these variables; therefore, a deterministic model always performs the same way for a given set
of initial conditions. Conversely, in a stochastic model—usually called a "statistical model"—
randomness is present, and variable states are not described by unique values, but rather
by probability distributions.
• Deductive, Inductive, or Floating: A deductive model is a logical structure based on a theory.
An inductive model arises from empirical findings and generalization from them. The floating
model rests on neither theory nor observation, but is merely the invocation of expected structure.
Application of mathematics in social sciences outside of economics has been criticized for
unfounded models. Application of catastrophe theory in science has been characterized as a
floating model.
3. Introduction to Simulink
2. The Library Browser keeps a repository of all the libraries it shows. If your library has
missing repository information, a notification bar appears above the Libraries pane when
you refresh the Library Browser. To prevent this notification from appearing again, click
on Fix in the notification bar and choose Resave libraries in SLX file format. This saves all
libraries in .slx format with Enable LBRepository property set to on. You can also open the
Simulink Library Browser from the MATLAB Toolstrip, by clicking
the Simulink Library button. To keep the Library Browser above all other
windows on your desktop, in the toolbar, select the Stay on topbutton .
where is a square wave with an amplitude of 1 and a frequency of 1 rad/sec, use an integrator
block and a gain block.
The Integrator block integrates its input to produce . Other blocks needed in this model
include a Gain block and a Sum block. To generate a square wave, use a Signal Generator block and
select the Square Wave form but change the default units to radians/sec. Again, view the output
using a Scope block. Gather the blocks and define the gain.
Example .2: Model the differential Equation (Frequency Domain- Transfer Function)
2 (2)
The equation you modeled in this example can also be expressed as a transfer function. The model
uses the Transfer Fcn block, which accepts u as input and outputs .
So, the block implements / . If you substitute for in the above equation, you get
2
Solving for gives
2
Or
1
2
The Transfer Fcn block uses parameters to specify the numerator and denominator coefficients. In
this case, the numerator is 1 and the denominator is s+2. Specify both terms as vectors of
coefficients of successively decreasing powers of s
In this case the numerator is [1] (or just 1) and the denominator is [1 2].
Exercises:
Exercise1-Solving differential equations using SIMULINK:
Find the solution of the following differential equations using MATLAB- Simulink for a step
input function:
2. Build a Simulink model for the system. With a=1,b=1.Run the model for u=1 , 5 and10 .
3. Find the time constant and the steady state value from the scope.
4. For a=0.5, b=1 and u=1, run the model and find the time constant.
where M is the mass, b is the damper, k is spring, x (t) is the position of the cart and F(t) is the
force applied to the system.
b- Let M=0.1Kg , b=1 Ns/m and k=10 . Determine the transfer function of this system
X(S)/F(S).
c- Calculate (from the transfer function) the %OS, Tr, Ts, Tp and s.s error.
d- Build a SIMULINK model and plot the step response of the system and from the curve
find %OS, s.s error, Ts, Tr and Tp.
Build the simulink model using matlab, then find the step response of the system for ωn=1,
and ξ=0.1, 0.5, 0.8, 1 and 2.
Control Laboratory
MX-0908453
2. Key Features
• Single environment for modeling and simulating mechanical, electrical, hydraulic, thermal,
and other multidomain physical systems
• Libraries of physical modeling blocks and mathematical elements for developing custom
components
• MATLAB based Simscape language, enabling text-based authoring of physical modeling
components, domains, and libraries
• Physical units for parameters and variables, with all unit conversions handled automatically
• Ability to simulate models that include blocks from related physical modeling products
without purchasing those products
• Support for C-code generation
• Modeling of System
To create an equivalent Simscape diagram, follow these steps:
1. Open the Simulink® Library Browser, as described in Simscape Block Libraries.
2. Create a new model. To do this, from the top menu bar of the Library Browser,
select File > New > Model. The software creates an empty model in memory and displays it
in a new model editor window.
3. Open the Simscape > Foundation Library > Electrical Element Elements library as shown in
Figure 2.5.
4. Drag the Mass, Translational Spring, Translational Damper, and two Mechanical
Translational Reference blocks into the model window.
5. Orient the blocks as shown in the Figure 2.6. To rotate a block, select it and press Ctrl+R.
6. Connect the Resistor, Capacitor, and Inductor blocks to one of the Electrical Reference
Ground blocks as shown in Figure 2.7.
Figure 2.9: The block of circuit after add the voltage source, step7
8. Add the sensor to measure speed and position of the mass. Place the Voltage and current
Sensors block from the Electrical Sensors library Figure 2.10 into your diagram and connect
it as shown in Figure 2.11.
model. Then open the Simulink > Sinks library and copy two Scope blocks..
10. Every time you connect a Simulink source or scope to a Simscape diagram, you have to use
an appropriate converter block, to convert Simulink signals into physical signals and vice
versa. Open the Simscape > Utilities library Figure 2.12 and copy a Simulink-PS Converter
block and two PS-Simulink Converter blocks into the model. Connect the blocks as shown in
Figure 2.13.
11. Each topologically distinct physical network in a diagram requires exactly one Solver
Configuration block, found in the Simscape > Utilities library Figure 2.12. Copy this block
into your model and connect it to the circuit by creating a branching point and connecting it
to the only port of the Solver Configuration block. Your diagram now should look like Figure
2.13.
Exercises:
For the following electrical system answer the questions.
4. For a step input vi(t)=5u(t),t>0 plot the open loop response of:
a) The output voltage on the inductor L( )
b) The current IL(t) .
5. Study the sensitivity of the output voltage due to change the following :
a) The value of capacitor c1.
b) The value of capacitor c2
c) The value of resistor R1.
d) The value of resistor R2
e) The value of Inductor L1.
Control Laboratory
MX-0908453
In this example, you are going to model a simple mechanical system and observe its behavior under
various conditions. This tutorial illustrates the essential steps to building a physical model and makes
you familiar with using the basic Simscape blocks.
The figure 3.1 shows a simple model of a car suspension. It consists of a spring and damper
connected to a body (represented as a mass), which is agitated by a force. You can vary the model
parameters, such as the stiffness of the spring, the mass of the body, or the force profile, and view the
resulting changes to the velocity and position of the body.
Figure 3.6: The block diagram after add the Force, step 7
8. Add the sensor to measure speed and position of the mass. Place the Ideal Translational Motion
Sensor block from the Mechanical Sensors library figure 3.7 into your diagram and connect it
as shown in figure 3.8.
Figure 3.17: The block diagram after add the Force, step 7
19. Add the sensor to measure angular speed and angular position at . Place the Ideal Rotaional
Motion Sensor block from the Mechanical Sensors library figure 3.18 into your diagram and
connect it as shown in figure 3.19.
Exercises:
For M is the mass, b is the damper, k is spring, x (t) is the position of the cart and F(t) is the force
applied to the system.
1. Write the differential equations of the system.
2. Let M=1Kg , b=1 Ns/m and k=1. Find the transfer function, G(S)=X(S)/F(S).
3. Build the system using simscape.
4. For a step input f(t)=5u(t),t>0 plot the open loop response of the position x(t).
5. Find the %OS, s.s output, Ts, Tr and Tp from the previous part.
6. How does the change in the spring stiffness affect the mass displacement?
7. How does the change in the damper viscosity affect the mass displacement?
Control Laboratory
MX-0908453
1. Introduction:
First order systems are, by definition, systems whose input-output relationship is a first order
differential equation. A first order differential equation contains a first order derivative but no
derivative higher than first order – the order of a differential equation is the order of the highest order
derivative present in the equation.
First order systems contain a single energy storage element. In general, the order of the input-output
differential equation will be the same as the number of independent energy storage elements in the
system. Independent energy storage cannot be combined with other energy storage elements to form
a single equivalent energy storage element. For example, we previously learned that two capacitors
in parallel can be modeled as a single equivalent capacitor – therefore, a parallel combination of two
capacitors forms a single independent energy storage element.
First order systems are an extremely important class of systems. Many practical systems are first
order; for example, the mass-damper system and the mass heating system are both first order
systems. Higher order systems can often be approximated as first order systems to a reasonable
degree of accuracy if they have a dominant first order mode.
Figure 1: (a) Block Diagran of a first-order system; (b) Simplifed block Diagram
1 (1)
1
Example 2:
1
In order to represent the response of the system in time domain we need to compute the inverse
Laplace transform of the above equation, we have
(2)
Example 3:
For the first order system given below
3
2 1
The impulse response is shown in figure 3
1
1
In order to represent the response of the system in time domain we need to compute the inverse
Laplace transform of the above equation, we have
(3)
Example 4:
For the first order system given below
1
1
In order to represent the response of the system in time domain we need to compute the inverse
Laplace transform of the above equation, we have
(4)
$
1) Where $ 1
(5)
2) Where
0.632 (6)
The step response of the first order system takes five time constants to reach its final value.
• ' (, * , ,, +, -
• ' , ,, +, ( , *
1 . (7)
1
1 1 .
1
(8)
.
• Case 1: * 0 1
The shape of the step response is approximately same (with offset added by zero)
Example 5:
10 1 2
3 1
In this system:
1. 10
2. 3
3. . 2
10 /
10 2 3
3
233 .
• Case 2: * 4 1
Example 6:
10 1 2
1.5 1
In this system:
1. 10
2. 1.5
3. . 2
10 / .
10 2 1
1.5
Figure 12: The step response of first order system with zero
(9)
5
1
Where
6 ∶ 8 9 # :!; 8<
Figure 13: the step response of first order system with delay time
Example 6:
10
1
A much more common approach is therefore to start from measurements of the behavior of the
system and the external influences (inputs to the system) and try to determine a mathematical
relation between them without going into the details of what is actually happening inside the system.
This approach is called system identification. Two types of models are common in the field of
system identification:
1) Grey box Model: although the peculiarities of what is going on inside the system are not
entirely known, a certain model based on both insight into the system and experimental data
is constructed. This model does however still have a number of unknown
free parameters which can be estimated using system identification.
One example, uses the Monod saturation model for microbial growth. The model contains a
simple hyperbolic relationship between substrate concentration and growth rate, but this can
be justified by molecules binding to a substrate without going into detail on the types of
molecules or types of binding. Grey box modeling is also known as semi-physical modeling.
2) Black box Model: No prior model is available. Most system identification algorithms are of
this type.
In science, computing, and engineering, a black box is a device, system or object which can
be viewed in terms of its inputs and outputs (or transfer characteristics), without any
knowledge of its internal workings. Its implementation is "opaque" (black). Almost anything
might be referred to as a black box: a transistor, algorithm, or the human brain.
Example 7:
Assume the unit step response given in figure 16;
6 1 # :!; 8<
We can simulate this system in Simulink using the basic block diagrams (Transfer Fcn, gain , sum
and Transport Delay)
Depend on the two responses of system, we observe to determine the transfer function of the
system we must get the parameter from the open loop characteristic because in this case we
obtain the response and the behavior of the system without any modification or addition effect.
System Identification Toolbox lets you create models from measured input-output data. You can:
1. Analyze and process data
2. Determine suitable model structure and order, and estimate model parameters
3. Validate model accuracy
System identification is open using the command (ident)
1. Importing Data
When preparing data for identifying models, you need to specify information such as input-output
channel names, sampling time, and intersample behavior. The toolbox lets you attach this
information to the data, which facilitates visualization of data, domain conversion, and various
preprocessing tasks.
The procedure of importing data as shown in figure 2:
1) Select the time domain data
2) Write the variable of input and Output
For example, if the (Input: Vin, Output: Vc)
3) Write the Starting time, and Sample time and this depend on the experimental data, for
example (Starting time :0, Sample time :0.1)
For example, if we choose Transfer model, the new screen will appear as shown in figure 5, form
this screen:
1) determine the number of poles and number of zeros of estimated transfer function,
2) Estimate the transfer function
Note:
1) Always started estimation by small number of poles and zeros and increase it by one and
repeat the estimation.
2) There is no specific rules to select the optimal number of poles and zeros, you need trial and
error or experience.
3. Validation Model
For a given set of input data, the toolbox computes the output of the identified model and lets you
compare that output with the measured output from a real system.
After estimated the model, we can compare the estimated output with measured output and
determine the fitness value, as shown in figure 6
The validation Data, must be matching with Importing data, otherwise the validation will be
incorrect
Check the box (Model Output) and the response will appear as shown in figure 7
Best fits: is measure the error ratio between estimated and measured output.
Exercises:
Build a Simulink model for the following systems:
System A
System B
System C
System D
1. From the response on the scope find the transfer function for each system by calculations.
2. From X and Y data in the workspace estimate the transfer function for each system using
system identification toolbox in matlab.
Control Laboratory
MX-0908453
In terms of damping ratio and natural frequency , the system shown in figure 1 , and the
closed loop transfer function / given by the equation 1
1
2
The dynamic behavior of the second-order system can then be description in terms of two
parameters and .
We shall now solve for the response of the system shown in figure 1, to a unit-step input. We
shall consider three different cases: the underdamped 0 1 , critically damped 1 ,
and overdamped 1
1) Underdamped Case :
In this case, the closed-loop poles are complex conjugates and lie in the left-half s plane. The
/ can be written as
Where 1 , the frequency is called damped natural frequency. For a unit step-input,
can be written
3
2
By apply the partial fraction expansion and the inverse Laplace transform for equation 3, the
response can give by
!" 1
1 sin & tan & **
4
)
1
If the damping ratio is equal to zero, the response becomes undamped and oscillations continue
indefinitely. The response for the zero damping case may be obtained by substituting 0 in
Equation 4, yielding
1 cos 5
By apply the partial fraction expansion and the inverse Laplace transform for equation 6, the
response can give by
1 !" 1 7
3) Overdamped Case :
In this case, the two poles of / are negative real and unequal. For a unit-step input,
1/ and can be written
8
- 1.- 1.
By apply the partial fraction expansion and the inverse Laplace transform for equation 6, the
response can give by
01 " 02 "
1 / 3
9
2 1 )
), 5 1
A family of unit-step response curves with various values of z is shown in Figure1 , where the
abscissa is the dimensionless variable .
The transient response of a system to a unit-step input depends on the initial conditions. For
convenience in comparing transient responses of various systems, it is a common practice to use the
standard initial condition that the system is at rest initially with the output and all time derivatives
thereof zero. Then the response characteristics of many systems can be easily compared.
The transient response of a practical control system often exhibits damped oscillations before
reaching steady state. In specifying the transient-response characteristics of a control system to a
unit-step input, it is common to specify the following:
1. Delay time,
2. Rise time , 6
3. Peak time, 7
4. Maximum overshoot, 87
5. Settling time, 0
These specifications are defined in what follows and are shown graphically in Figure 2.
These specifications are defined in what follows and are shown graphically in Figure 2.
1. Delay time, 9: : The delay time is the time required for the response to reach halfthe final value the
very first time.
2. Rise time, 9; : The rise time is the time required for the response to rise from 10% to 90%, 5% to
95%, or 0% to 100% of its final value. For underdamped second order systems, the 0%to 100%rise
time is normally used. For overdamped systems, the 10% to 90% rise time is commonly used.
3. Peak time, 9< : The peak time is the time required for the response to reach the first peak of the
overshoot.
4. Maximum overshoot, =< : The maximum overshoot is the maximum peak value of the response
curve measured from unity. If the final steady-state value of the response differs from unity, then it is
common to use the maximum percent overshoot. The amount of the maximum (percent) overshoot
directly indicates the relative
stability of the system.
5. Settling time, 9> :The settling time is the time required for the response curve to reach and stay
within a range about the final value of size specified by absolute percentage of the final value
(usually 2% or 5%). The settling time is related to the largest time constant of the control system.
Which percentage error criterion to use may be determined from the objectives of the system design
in question.
The time-domain specifications just given are quite important, since most control systems are time-
domain systems; that is, they must exhibit acceptable time responses. (This means that, the control
system must be modified until the transient response is satisfactory.)
In the following, we shall obtain the rise time, peak time, maximum overshoot, and settling time
of the second-order system These values will be obtained in terms of and .The system is
assumed to be underdamped.
1. Rise time , 9;
? @
6
where angle @ is defined in figure 3. Clearly, for a small value of 6 , must be large.
Figure 3
?
Since the peak time corresponds to the first peak overshoot,
7
The peak time 7 corresponds to one-half cycle of the frequency of damped oscillation.
If the final value ∞ of the output is not unity, then we need to use the following
equation:
- 7. ∞
87
∞
4
0 (2% criterion)
3
0 (5% criterion)
E
1 E F
G J
E IJK F
H K
The closed loop T.F. of any linear invariant system can be expressed as :
I L MN
7"
N
NO)
Notes:
Real poles and pairs of complex conjugate poles: C (s) may be given as:
a q rj r
b ( s + ζ k wk ) + ck wk 1 − ζ k2
C (s) = +∑ +∑ k
s j =1 s + p j k =1 s 2 + 2ζ k wk s + wk2
This means that the factored form of the poles of higher order systems consists of first and 2nd
order terms. As a result, the response of the higher order system is composed of a number of terms
involving the responses of first order and 2nd order systems. The response is given as:
( ) ( ) t
q r r
c(t ) = a + ∑ a j e + ∑bk e−ζ k wk t cos wk 1 − ζ k2 t + ∑ ck e−ζ k wk t sin wk 1 − ζ k2
− p jt
j =1 k =1
k =1
which means that for a stable higher order with nonrepeated simple or complex roots, the response is
the sum of a number of exponential curves (for real distinct roots) and damped sinusoidal curves (for
unrepeated complex poles).
For a stable higher order system, the exponential terms and the damped or sinusoidal curves
will approach zero as t →∞ and the steady state output y ss = a = y (∞)
As the real part of the poles moves farther from the origin or |real part| increase then the
response of that pole decay rapidly to zero and correspondingly the setting time of that pole
decrease. That is,
1
t sα
real part
The type of transient response is determined by the closed loop poles, while the zeros of the
close loop T.F. do affect the magnitudes and signs of the residues of the expanded terms.
The poles of the input R (s ) yield the steady state in the solution while the poles of the closed
loop T.F. yield the transient response terms of the solution as they enter exponential transient
response terms and/or damped sinusoidal transient response terms.
2) The relative magnitudes of the poles residues which depend on both the closed loop poles and
zeros.
If the real part of the closest pole to the “jw” axis is (5 - 10) times less than the real part of the
closest pole to this pole and there are no zeros nearly, then former pole is called dominant closed
loop pole since this pole will dominant the transient response and will decay slowly.
The dominant closest loop poles are the most important among all closed loop poles.
And the question now, How I can determine the transfer function of the system form measured
output data ??
The step response is given in the following figure 5, and to determine the transfer function we follow
the following step
1) Determine the settling time and the Overshoot of system
2) Determine the natural frequency and the damping ratio
A
87 ) 2
4
0 (2% criterion)
3
0 (5% criterion)
Figure 5
From the over shoot determine
PQR
16
4 16
Exercises:
Exercise-1:Build the following system using simscape:
From Vin and Vout data in the workspace estimate the transfer function for the system using system
identification toolbox.
Use the output response data for identification and find the transfer function.
Control Laboratory
MX-0908453
Introduction
A proportional-integral-derivative controller (PID controller) is a control loop feedback
mechanism (controller) widely used in industrial control systems. A PID controller calculates
an error value as the difference between a measured process variable and a desired set point. The
controller attempts to minimize the error by adjusting the process through use of a manipulated
variable.
The PID controller algorithm involves three separate constant parameters, and is accordingly
sometimes called three-term control: the proportional, the integral and derivative values,
denoted P, I, and D. Simply put, these values can be interpreted in terms of time: P depends on
the present error, I on the accumulation of past errors, and D is a prediction of future errors,
based on current rate of change. The weighted sum of these three actions is used to adjust the
process via a control element such as the position of a control valve, a damper, or the power
supplied to a heating element.
In the absence of knowledge of the underlying process, a PID controller has historically been
considered to be the most useful controller. By tuning the three parameters in the PID controller
algorithm, the controller can provide control action designed for specific process requirements.
The response of the controller can be described in terms of the responsiveness of the controller to
an error, the degree to which the controller overshoots the setpoint, and the degree of system
oscillation. Note that the use of the PID algorithm for control does not guarantee optimal
control of the system or system stability.
Some applications may require using only one or two actions to provide the appropriate system
control. This is achieved by setting the other parameters to zero. A PID controller will be called a
PI, PD, P or I controller in the absence of the respective control actions. PI controllers are fairly
common, since derivative action is sensitive to measurement noise, whereas the absence of an
integral term may prevent the system from reaching its target value due to the control action.
calculate the output of the PID controller. Defining u t as the controller output,
manipulated variable (MV). The proportional, integral, and derivative terms are summed to
Controller manufacturers arrange the Proportional, Integral and Derivative modes into three
different controller algorithms or controller structures. These are called
Interactive, Noninteractive, and Parallel algorithms. Some controller manufacturers allow you to
choose between different controller algorithms as a configuration option in the controller
software. The PID Algorithms are:
1
1) Interactive Algorithm
1
2) NonInteractive Algorithm
3) Parallel Algorithm
Where
K K : Propotional Gain
K
K* : Integral Gain
T*
K / K T/ : Derivative Gain
e t r t 2y t
1.1 Proportional Term
The proportional term produces an output value that is proportional to the current error value.
The proportional response can be adjusted by multiplying the error by a constant Kp, called the
proportional gain constant. The proportional term is given by:
P456 K e t
A high proportional gain results in a large change in the output for a given change in the error. If
the proportional gain is too high, the system can become unstable. In contrast, a small gain
results in a small output response to a large input error, and a less responsive or less sensitive
controller. If the proportional gain is too low, the control action may be too small when
responding to system disturbances. Tuning theory and industrial practice indicate that the
proportional term should contribute the bulk of the output change
The contribution from the integral term is proportional to both the magnitude of the error and the
duration of the error. The integral in a PID controller is the sum of the instantaneous error over
accumulated error is then multiplied by the integral gain K * and added to the controller output.
time and gives the accumulated offset that should have been corrected previously. The
6
I:56 K* e τ dτ
The integral term accelerates the movement of the process towards set-point and eliminates the
residual steady-state error that occurs with a pure proportional controller. However, since the
integral term responds to accumulated errors from the past, it can cause the present value
to overshoot the set-point value.
2.3 Derivative Term
and multiplying this rate of change by the derivative gain K / . The magnitude of the contribution
The derivative of the process error is calculated by determining the slope of the error over time
of the derivative term to the overall control action is termed the derivative gain, K / . The
derivative term is given by
=>?
Derivative action predicts system behavior and thus improves settling time and stability of the
system. An ideal derivative is not causal, so that implementations of PID controllers include an
additional low pass filtering for the derivative term, to limit the high frequency gain and noise.
Derivative action is seldom used in practice though - by one estimate in only 20% of deployed
controllers- because of its variable impact on system stability in real-world applications.
2. Overview of Methods
There are several methods for tuning a PID loop. The most effective methods generally involve
the development of some form of process model, then choosing P, I, and D based on the dynamic
model parameters. Manual tuning methods can be relatively inefficient, particularly if the loops
have response times on the order of minutes or longer.
The choice of method will depend largely on whether or not the loop can be taken "offline" for
tuning, and on the response time of the system. If the system can be taken offline, the best tuning
method often involves subjecting the system to a step change in input, measuring the output as a
function of time, and using this response to determine the control parameters.
of the process is calculated. Knowing K D , τD and t / the PID parameters can be evaluated from
curve with one of the First Order Plus Dead Time (FOPDT) estimation methods an approximation
E F
G H IJ
GF 1
3.1 Ziegler-Nichols Open Loop Method
In the 1940's, Ziegler and Nichols devised two empirical methods for obtaining controller
parameters. Their methods were used for first order plus dead time situations, and involved intense
manual calculations. With improved optimization software, most manual methods such as these are
no longer used. However, even with computer aids, the following two methods are still employed
today, and are considered among the most common.
This method remains a popular technique for tuning controllers that use proportional, integral, and
derivative actions. The Ziegler-Nichols open-loop method is also referred to as S-shaped curve
method, because it tests the open-loop reaction of the process to a change in the control variable
output. This basic test requires that the response of the system be recorded, preferably by a plotter or
computer. Once certain process response values are found, they can be plugged into the Ziegler-
Nichols equation with specific multiplier constants for the gains of a controller with either P, PI, or
PID actions.
In this method, we obtain experimentally the open loop response of the FOPDT to a unit step input.
This method only applied if the response to a step input exhibits an s-shaped curve as shown in
figure 7. This means that if the plant involves integrators (like 2nd order prototypes system) or
complex-conjugate poles (general 2nd order system), then this method can’t be applied since s-shaped
will not be obtained.
This method remains a popular technique for tuning controllers that use proportional, integral, and
derivative actions. The Ziegler-Nichols open-loop method is also referred to as a process reaction
method, because it tests the open-loop reaction of the process to a change in the control variable
output.
The Tuning Procedure:
To use the Ziegler-Nichols open-loop tuning method, you must perform the following steps:
1. Make an open loop step test
2. From the process reaction curve determine the transportation lag or dead time, , the time
constant or time for the response to change, G , and the ultimate value that the response
reaches at steady-state, G , for a step change of K> .
3. Determine the loop tuning constants. Plug in the reaction rate and lag time values to the
Ziegler-Nichols open-loop tuning equations for the appropriate controller (P, PI, or PID) to
calculate the controller constants. Use the table 3.
Figure 3: Open Loop of First order system plus dead Time (s-shaped curve)
Table 3: Open-loop Calculation of ( . . )
@A MB MC
K>
∞
G
G
P- Controller 0
OP SR
QR I
PI- Controller 0.9 3.3 0
OP SR
QR I
PID- Controller 1.2 2 0.5
The PID controller tuned by this method gives (according to the formula shown in Table (8.4)).
1
G c (s ) = K p 1 + +T d s
Ti s
X o τm 1
. = 1.2 1 + + 0.5t d s
K m t d 2t d s
(s + 1/ t d ) 2
= 0.6τ m
s
This mean that the controller adds double zero at F 2 , and pole at origin
T
•
I
• Advantages Ziegler-Nichols Open Loop Tuning Methods
In this method the process response curve is obtained first, by an open loop test as shown in figure8
and then the process dynamics is approximated by a first order plus dead time model, with following
parameters:
W 2 G
Again the particular rules for this method are used to calculate the PID parameters. They are
listed in table 4
Table 3: the parameter of Cohen-Coon Method
Controller @X MB MC
Y1 Z
G
P 3 G
- -
3
G
Y0.9 Z 30
12 G ] G
^
20
PI -
9
G
2
G
Y1.25 Z 62
6 G ] G
^
3
PD -
22
G
6
G
Y1.33 Z 32 4
4 G ] G
^ ] ^
8 2
PID
13 11
G G
two parameters, c and d c , are used to find the loop-tuning constants of the controller (P, PI, or
period is the time required to complete one full oscillation while the system is at steady state. These
PID). To find the values of these parameters, and to calculate the tuning constants, use the following
procedure:
• The Tuning Procedure:
1. Remove integral and derivative action. Set integral time ( ) to ∞ or its largest value and set
the derivative controller ( ) to zero.
2. Create a small disturbance in the loop by changing the set point. Adjust the proportional,
increasing and/or decreasing, the gain until the oscillations have constant amplitude.
3. Record the gain value ( c ) and period of oscillation (d c ).
4. Plug these values into the Ziegler-Nichols closed loop equations and determine the necessary
settings for the controller.
@A MB MC
c
∞
2
P- Controller 0
c dc
2.2 1.2
PI- Controller 0
c dc dc
1.7 2 8
PID- Controller
The PID controller tuned by this method gives (according to the formula shown in Table 8.5).
1
G c (s ) = K p 1 + +T d s
Ti s
1
= 0.6K cr 1 + + 0.125Pcr s
0.5Pcr s
(s + 4 / Pcr ) 2
= 0.075K cr Pcr
s
Thus the PID Controllers adds a pole at origin and double zeros at F 2
f
ghi
If the system has a known mathematical model (Transfer function is given), then RL method can be
used to find K cr value (critical gain) and the frequency of the sustained oscillations w cr . After that
Pcr is found from
2π
Pcr =
w cr
These values can be found from the crossing points of the root locus branches with the jw axis. This
method doesn’t apply if the root locus doesn’t cross the jw axis.
• Advantages Ziegler-Nichols Closed-Loop Tuning Methods
1. Easy experiment; only need to change the P controller
2. Includes dynamics of whole process, which gives a more accurate picture of how the system
is behaving
• Disadvantages Ziegler-Nichols Closed-Loop Tuning Methods
1. Experiment can be time consuming
2. Can venture into unstable regions while testing the P controller, which could cause the
system to become out of control
You can automatically tune PID controllers to achieve the optimal system design and to meet design
requirements, even for plant models that traditional rule-based methods cannot handle well.
An automated PID tuning workflow involves:
The PID Tuner automatically designs a controller for your plant. You specify the controller type
(P, I, PI, PD, PDF, PID, PIDF) and form (parallel or standard). You can analyze the design using
a variety of response plots, and interactively adjust the design to meet your performance
requirements.
To launch the PID Tuner, use the pidTuner command:
pidTuner(sys,type)
where sys is a linear model of the plant you want to control, type is a string indicating
the controller type to design
PID Controller Type
The PID Tuner can tune up to seven types of controllers. To select the controller type, use one of
these methods:
Provide the type argument to the launch command pidTuner.
In PID Tuner, use the Type menu to change controller types.
2) SIMULINK
Select the PID controller block form Simulink Library
Drag the PID controller and place in the Simulink model , and double click on block.
Example 1:
1
This example shows how to use the PID tuner to design a controller for the plant
G s
s 1 k
1. Create the plant model and open the PID Tuner to design a PI controller for a first pass design.
5. Slide the Response time slider to the right to try to improve the loop performance. The response
plot automatically updates with the new design
Moving the Response time slider far enough to meet the rise time requirement of less than 1.5 s
results in more oscillation. Additionally, the parameters display shows that the new response has
an unacceptably long settling time.
To achieve the faster response speed, the algorithm must sacrifice stability.
6. Change the controller type to improve the response.
Adding derivative action to the controller gives the PID Tuner more freedom to achieve adequate
phase margin with the desired response speed.
In the Type menu, select PIDF. The PID Tuner designs a new PIDF controller
The rise time and settling time now meet the design requirements. You can use the Response
time slider to make further adjustments to the response. To revert to the default automated tuning
result, click Reset Design.
7. Analyze other system responses, if appropriate.
To analyze other system responses, click Add Plot. Select the system response you want to
analyze.
For example, to observe the closed-loop step response to disturbance at the plant input, in
the Step section of the Add Plot menu, select Input disturbance rejection. The disturbance rejection
response appears in a new figure.
Example 2:
Assume the system in example 1 Bu
1) Build the Simulink block represent the closed loop system
Exercises:
Exercise-1: Suppose we have a simple mass, spring, and damper problem.
1) Design a PI Controller to yield a closed-loop step response with overshoot less than 10% and
settling time less than 11 sec.
2) Design a PD Controller to yield a closed-loop step response with overshoot less than 20%
and settling time less than 3 sec.
3) Design a PID Controller to yield a closed-loop step response with overshoot less than 5% and
settling time less than 5 sec.
Control Laboratory
MX-0908453
OBJECTIVES:
The aim of this experiment is to provide students with a sound introduction to the principles of
analogue servomechanisms, and by extension to those of closed-loop systems more generally.
PRE-LAB:
1. In this experiment, what type of DC motors is used?
2. Draw the speed torque characteristics for DC motor, what is the equation that performs the
relationship between torque and speed?
3. From the following step response for a second order system, determine the following:
− What is the behavior of this system?
− What is the supposed valu for ζ?
− The overshoot.
− The settling time.
− The rise time.
The output shaft carries analogue (potentiometer) and digital (64 location Gray code) angle
transducers.
The unit contains a simple signal generator to provide low frequency test signals; sine, square and
triangular waves, and requires an external power supply providing:
Motor shaft This carries the brake disc, together with a 2-phase speed
track and tachogenerator.
Brake disc and magnet The brake is applied by the lever projecting at the left. The
lever scale is provided to enable settings to be repeated.
Speed tracks and readers These provide two-phase, 0-5 V square waves at 8 cycles per
revolution. These signals are available on the 34-way socket but
are not used in the Analogue system.
Motor check switch This enables the motor to be rotated as an initial check.
Armature current signal This is a voltage waveform indicating the armature current
with scale of 1 V/A.
Input shaft This carries the input potentiometer and scale and gives a signal i in the
range ±10 V.
Test signal frequency These control the internal oscillator to provide ±10 V square, and
range switch triangular and sine waveforms with nominal frequency 0.1 to
10 Hz in two ranges. The square and triangular waveforms
are connected to the 34-way socket.
Output shaft This carries the output potentiometer and digital angular
measurement tracks. The potentiometer provides o in the range
±10V.
Digital measurement and The digital tracks give 6 bit Gray code (64 locations) Readers
information and are read by infra-red readers. The 6-bit
information is supplied as 0 or 5 V to six pins on the 34-way socket.
Index pulse At one pulse per revolution this provides an output shaft reference
point for incremental control connected to a pin on the 34-way socket.
Output speed display This provides a direct reading of output shaft speed in r/min in the
range 00.0 to 99.9, derived from the tachogenerator. Since the
reduction ratio is 32:1, a motor speed of 1000 r/min gives 31.1 r/min
at the output shaft.
Figure 2 shows the general arrangement of the panel, interconnections are made by 2 mm plug
leads and there are a few 4 mm sockets for conversion or oscilloscope connections.
Upper portion of panel These sockets give the voltage signals from the input and
From left to right θ i,θo output shaft potentiometers. These are represented
diagrammatically in the centre of the panel, the
potentiometers themselves being in the Mechanical Unit.
Fault switches These enable faults to be introduced. For normal (no fault)
operation all switches should be down.
Power amplifier This drives the motor. The two inputs drive the motor in opposite
directions for a given input. The zero adjustment enables the motor
to be rotated with no amplifier input.
Motor This is in the Mechanical Unit and drives the brake disc and
tachogenerator directly, and the output shaft through a 32:1 belt
reduction.
Brake disc and magnet These are in the Mechanical Unit and provide an adjustable load for
the motor.
Lower portion of panel This enables a manually switched 10 V step input to be from left
to right ±10 V obtained.
step
Test signals These sockets provide ±10 V low frequency (nominally 0.1 to 10 Hz)
square and triangle waveforms. The frequency control and range
switch are on the Mechanical Unit. A sine wave test input is available
from the Mechanical Unit.
Controller This contains operational amplifiers with associated networks to enable various
compensating and control circuits to be introduced to improve the performance of a
basic system
Introduction:
The servo is an automatic electromechanical device that uses error-sensing feedback to correct
the performance of a mechanism. The term applies only to systems where the feedback or error-
correction signals help control mechanical position or other parameters.
A common type of servomotors provides position control. Servos are commonly electrical or partially
electronic in nature, using an electric motor as the primary means of creating mechanical force.
Other types of servos use hydraulics, pneumatics, or magnetic principles. Usually, servos operate
on the principle of negative feedback, where the control input is compared to the actual position
of the mechanical system as measured by some sort of transducer at the output. Any difference
between the actual and wanted values (an "error signal") is amplified and used to drive the system
in the direction necessary to reduce or eliminate the error. An entire science known as control theory
has been developed on this type of system.
Various names are given to the signals in different industrial or other contexts, but the meanings of
words in any one of the columns below are much the same:
Difference Output Input
Error Actual value Reference value
Deviation Measured value Set value
Controlled quantity Set point
Desired value
Demanded value
Where the system is electrical, the state will normally be represented by signals expressed in volts;
in the strip that being rolled in a steel mill it might be, for the width, a signal representing ten inches
per volt.
The difference in the comparison will be called the error signal and the part of the system that carries
out the comparison is the error channel.
There is usually a power amplifying device to drive the Actuator (which in Figure 4 is the geared
motor).
It is usual for control engineers to describe their systems in a block diagram form. The block diagram
below describes the type of system we shall be using in this experiment.
Here there is a comparison by the error channel of the input and output, the error is then amplified
to drive a motor and gearing in the forward path so that the speed or position of the output shaft can be
modified.
The motor is a permanent magnet type and can be represented in idealized form as in Figure 5, where
Ra is the armature resistance and T1, T2 are the actual motor terminals.
If the motor is stationary and a voltage Va is applied, a current Ia flows which causes the motor to
rotate. As the motor rotates a back emf Vb is generated. As the motor speeds up, the back emf
increases and Ia falls. In an ideal (loss free) motor, the armature current falls to substantially zero and
Vb approximately equals Va. Thus if Va is varied slowly in either polarity, the motor speed is
proportional to Va, and a plot of motor speed against Va would have the form of Figure 6.
In the 33-100 the armature voltage Va is provided by a power amplifier. A power amplifier is
necessary, because although the voltages in the error channel may be of the same order as Va, the
motor current may be up to 1 A, while the error channel operates with currents of less than 1 mA and
could not drive the motor directly. The amplifier has two input sockets, enabling the motor
rotation direction to be reversed for a given input.
The tachogenerator is a small permanent magnet machine and hence when rotated produces an emf
proportional to speed which can be used as a measure of the rotation speed.
The magnetic brake consists of a permanent magnet which can be swung over an aluminum disc. When
the disc is rotated eddy currents circulate in the area of the disc within the magnet gap, and these react
with the magnet field to produce a torque which opposes rotation. This gives an adjustable torque speed
relation of the form of Figure 7, and provides a very convenient load for the motor.
The overall characteristics of a motor may be considered from two aspects, both of which can be
related to the idealized representation of Figure 8. These aspects are: Steady-state, which are
concerned with constant or very slowly changing operating conditions, and transient,
corresponding with sudden changes, both are important in control system applications.
PROCEDURE:
4. By setting SW1 and varying P3, fill in the following table, then make a plot of motor speed
against amplifier input.
Brake Load
Considering the idealized motor shown in Figure 9(a), when the motor is unloaded the back emf
Vb substantially equals the applied voltage Va, the armature current being very small. When the motor
is loaded the speed falls, the back emf falls, and the armature current increases and the voltage drop in
the armature resistance Vr (= IaRa) added to Vb matches Va, that is:
Hence, if the motor is loaded so that the speed falls, the armature current increases, the general
characteristic being as the solid lines in Figure 9(b). If the armature resistance is low, which is the
situation for a normal motor, the current increases greatly, as shown dotted, for a small change in
speed. The proper operating range of the motor would be up to a load corresponding with a few
percent drop in speed, perhaps to the point when the dotted current line crosses the speed line.
1. Adjust P3 to set the motor speed to 2000 r/min (62.5 r/min at output), with the brake fully
upwards. Connect the DVM to the Armature Current (1volt/amp) output on the Mechanical
Unit.
2. Set the brake to each of its six positions in turn and for each setting record the speed and armature
current.
3. Plot the speed and armature current against brake setting, the plot should have the general form
of Figure 9(c).
An important aspect of closed-loop control is speed control, which has many industrial applications,
varying from heavy industrial, such as paper mills or steel rolling mills, to tape or video transport
mechanisms.
The essential principle of closed-loop speed control is similar to position control, except that the
feedback signal is an output velocity signal Vs, normally from a tachogenerator, which is compared with
a reference voltage Vr to give an error
Ve= Vr – Vs
In operation the reference is set to a required value, which drives the motor to generate Vs, which
reduces the error until the system reaches a steady speed.
If the motor is loaded, e.g. with the magnetic brake on the 33-100, the speed falls; this tends to
increase the error, increasing the motor drive and thus reducing the speed fall for a given load.
Note that this implies negative feedback around the loop.
The speed fall with load, sometimes termed droop is a very important characteristic in speed control
systems.
The rotation direction can be reversed by reversing the reference voltage, though many industrial speed
control systems are required to operate in one direction only.
1. Arrange the system as in Figure 11. Set P2 (tacho) to zero and set the amplifier feedback resistor
to 100 k, this gives G = 1. Set P1 to 100. Set SW1 up to +10 and adjust P3 to run the motor at
1000 r/min (31.25 r/min at output).
2. Turn up P2 slightly, if the speed decreases the loop feedback is negative as required. If the
speed increases use the other tachogenerator polarity.
Note that if the system has negative feedback and both the tachogenerator polarity and the power
amplifier input are reversed, the system still has negative feedback, but the motor runs in the
opposite direction.
3. Set P2 to zero and fill in the following table then plot the speed against brake setting to
full brake load. The general characteristic should be as in Figure 12.
4. Set P2 to 100 and readjust P3 to give 1000 r/min with the brake off.
5. Fill in the following table, then plot the speed characteristic and error (Power Amplifier
input).
1. Arrange the system with the solid connections of Figure 13, with the error amplifier feedback
resistor 100 k, giving G = 1.
2. Set the desired angle i at a certain position.
3. Set P1 to zero, and then turn up P1 until the motor just rotates; notice the response.
4. Disconnect the position feedback signal o, and notice the response.
− What is the P1 percentage value that makes the system just rotates?
− What is the relationship between the Time to reach steady state (Ta) and the overshoot
value?
− Draw both open-loop and closed-loop position responses versus time.
Control Laboratory
MX-0908453
Introduction
Traditional logic is based upon the idea that problems can reduced to a series of statements
which are either true or false. However, many everyday situations are not suited to this logical
form. Many questions exist where the answer is neither 'yes' nor 'no', but somewhere an in-
between answer is required. For example, on a pleasant summer's day, the statement 'the
temperature is too high' is neither true nor false. The response to the question requires us to
grade the response to indicate that the temperature is neither too hot nor too cold. Common
sense tells us that there are grades of meaning or qualified responses to most problems.
Philosophers and mathematicians have considered forms of logic for this situation by
introducing concepts such as 'vagueness' and multi-valued logic. The topic of fuzzy logic is
one way of dealing with things where there is vagueness, by allowing degrees of certainty to
be associated with the answer to a question.
Fuzzy Control
The most useful application of fuzzy logic is in the control of events where precise regulation
of a process variable is not a primary requirement. As such, the most suitable applications
are where there are qualitative requirements for a satisfactory control action. Specifically,
these qualitative requirements can be easily stated as fuzzy logic rules and then embedded
in a fuzzy logic control algorithm. In this connection, fuzzy logic controllers are widely used
to operate the automatic functions of washing machines, video recorders, compact disk
players, air conditioning systems, cameras and so on.
It is also possible to use fuzzy logic in industrial feedback control problems that are
conventionally solves using experienced human operators who have manual control over a
complex process. The procedure followed is to put the operator's control procedure into a
fuzzy rule set and hence develop a fuzzy control system. Specifically, the fuzzy logic designer
notes the heuristic actions of a human operator when they control a process and writes down
the corresponding fuzzy rule. By careful observations of a skilled operator, a complete set of
fuzzy rules is obtained which hopefully will reproduce the best performance of the human
operator. The result is an 'intelligent' control system which is obtained without reference to
control systems theory. This is a simplified view of how fuzzy controller is prepared, but the
basic idea is that intuition and common sense ideas are used.
The intuitive nature of such control systems has a great appeal to many users.
Unfortunately, the set of rules for such a system may be very large indeed and must be
carefully checked because human operators are often very subtle in their actions and it can
be difficult to translate their nuances into fuzzy logical statements. Depending upon the
complexity of the process to be controlled, the construction if the fuzzy rules can be time
consuming and involve much fine tuning. The most effective industrial applications have
been on processes which are inherently stable and the control actions are for keeping
process variables within operational bounds, rather than accurate regulation or servo
following
A further popular application is the control of simple loops of the kind usually controlled using
three-term (PID) controllers. The use of fuzzy logic here is to emulate the PID action, often
with some modifications to accommodate non-linear plant behavior. Figure 1 shows how a
fuzzy logic system replaces the conventional controller in this form of application. Note that
the fuzzy interference engine in the diagram will consist of a set of fuzzy rules.
Main Apparatus:
• CE124 Fuzzy Logic Trainer (figure 2).
• CE103 Thermal Control Process apparatus (figure 3).
• CE105 Coupled Tanks apparatus (figure 4).
A. Fuzzy Membership
- Connect the equipment as shown in figure 5.
- With a potentiometer output of -10 V, measure the classifier outputs using the fuzzy
variable meter connected to the outputs LP (large positive), MP (medium positive), S
(small), MN (medium negative) and LN (large negative).
- Increase the potentiometer output and repeat the above procedure for different values
of potentiometer output.
- Record your results in table 1and draw a block diagram for the experimental setup.
TABLE 1
B. Defuzzification
- Connect the equipment as shown in figure 6, including the dotted connection.
- Set the fuzzy variable potentiometer fv1 to zero (fully anticlockwise) and the fuzzy
variable potentiometer fv2 to one (fully clockwise).
- Check that the fuzzy variable fv2=1 and is connected to defuzzifier input MP (this is
the dotted connection in figure 5). Increase the fuzzy variable fv1 from o to 1 and
record the reading.
- Connect the fuzzy variable fv2 to defuzzifier input S by altering the dotted connection
in figure 5 appropriately. Increase the fuzzy variable fv1 from o to 1 record the reading
in table 2.
- Try to repeat the previous step to the rest of the defuzzifier inputs if you have free time!
TABLE 2
FV1 FV2 Output
FIGURE 6: DEFUZZIFICATION
TABLE 3
Operation FV1 FV2 Output Output with
not
AND
OR
• Complete the following rule set so that it operate in a similar manner to a conventional
proportional controller:
The potentiometer P1 will be used to produce the reference (set-point) signal. The defuzzifier
output u is the control signal which is sent to the system input. The control signal is defuzzified
from the fuzzy control law according to the classification mentioned in part 2.
- Connect the apparatus as shown in figure 9 and apply the following initial settings:
• Set potentiometer P1 to 3 V.
• Pre-processor gain Kp set to 10 which is included so that additional amplification of
the error signal may be applied.
• CE105 Coupled Tank Apparatus: valve A set to 5, valve B closed, valve C set to
between 3 and 4.
- Use the error and control signal to write a fuzzy logic rule set to provide a proportional
positive control when error is positive taking in consideration that the minimum pump
input is 0 V.
- Apply the fuzzy rule set written above on your connection and then connect the control
signal to CE105 pump input.
- With P1 producing a set point (or reference) of 3 V, record the level in tank 1 using the
voltmeter. After the level has settled to the desired value, increase the set point to 6 V
and again record the output. After the level has settled to the desired value, decrease
the set point to 3 V and again record the output. Observe the output of the fuzzy controller
and compare it with what you would expect from a conventional controller.
- Vary the gain Kp and observe the effect upon the system response.
Control Laboratory
MX-0908453
Objectives
In this experiment, the students will learn the basic operation of a temperature controlled
system and will also learn the static and transient behaviour of the temperature process.
Introduction:
The objective of any automation is to be able to efficiently and reliably control the
behaviour of the process. Temperature systems are widely used in real life as in industrial
applications, domestic domain (home, office), medical and biological process engineering.
The basic operation of a temperature-controlled system is analyzed in this experiment.
Further, we should understand the system and determine the mathematical model of the
process (Transfer function). This transfer function is used to design a PID controller that
improves the performance of the system in closed loop.
Experiment Procedure:
A. Static Performance
Static test
Static test is performed to check the linearity of the equipment under test. If we want to
test the “input power” we need to keep the ventilator-motor and flap at constant values
and vary the input power scale.
Experiment:
- Connect the “Temperature Control System Block Diagram” (Figure 1) to the
Power Supply unit and with the “Reference Variable generator”.
- Set the output switch to 1V/10°C.
- Make sure that the temperature of the process settles at room temperature (Output
voltage = the room temperature).
2. Evaluation
- Plot the temperature versus the input power.
Label your scales very carefully.
B- System Identification.
The dynamic model of the temperature process can be described as first order linear
transfer function:
Where K is the DC gain defined as the ratio of output voltage to input voltage.
1. With the plant in open loop, take the plant manually to a normal operation point.
Assume that the plant output settles at y (t) = y0 for a constant input 0 u (t) =u.
2. At an initial time 0 t, apply a step change to the plant input, from 0 u to u∞.
3. Record the plant output until it settles to the new operating point. Assume that
you obtain the curve shown in figure 2. This curve is known the process reaction
curve.
4. Compute the model parameters.
Experiment:
1- Connect the open loop Temperature control experiment as shown in the figure 3.
2- Connect the Temperature control system with the profi-cassy in order to plot the
input and output signals
First measurements
When the software detects one or more CASSY devices, the CASSY tab of the setup
dialog (F5) displays the current configuration (including any attached sensor boxes). To
conduct a measurement, just click on the corresponding input or output (1)
The channel initially appears automatically in the table (5) and in the diagram (6).
And will appear the box allows you to change the settings of measuring parameters
which control the actual measurement.
When you want to start measurement just press to , Starts and stops a new
measurement. You can use the right mouse button to open the table display menu in the
table and the evaluation menu in the diagram.
4- Using Cassy lab software, Record the transient behaviour for the following case:
(Step input):
• Cool down the system at room temperature (remove the input power from the
temperature system open flap to 4 and increase the potentiometer to 10 to
increase speed of motor until the output voltage equal the room temperature).
• After cooling the system restore the input power, set the flap at scale 2 and
ventilator potentiometer at scale 3.
• Start with Reference voltage = 6 V until you reach a steady state.
• Record the time required to achieve this state, name it T.
Figure 3
5- From the transient responses in above case, deduce the open loop transfer
function of the temperature process (identify the parameters K, τ and L from the
obtained response).
The main targets of the previous parts were to have an understanding of modelling
concepts in terms of static and transient performance. The temperature process was used
in its open-loop form. This Part will introduce the idea of open and closed-loop control.
Following are the objectives of this Part:
- Study the two-position (discontinuous) controller.
- Examine the effect of hysteresis on the temperature process.
- Maintaining output temperature close to a reference (set point) value.
There are many controllers that could be used to perform the task. They differ in
simplicity and configuration. In this part, the two-position controller is introduced as the
regulator. This controller will recognize only two states and will have only two actions:
On or OFF.
Figure 4 shows a block diagram of the circuit under study:
The controller that we will study can have hysteresis effects, by examining the block
diagram, we can easily deduce that:
e(t) = r(t) – y(t)
If there is no switching hysteresis (h = 0), the two states of the controller are:
Experiment:
1- Cool down the system at room temperature (remove the input power from the
temperature system open flap to 4 and increase the potentiometer to 10 to
increase speed of motor until the output voltage equal the room temperature).
2- Set up the experimental arrangement as shown in the block diagram of Figure 5.
3- Keep the same settings as before (switch off).
4- Disconnect the feedback path from the output to the input of the controller.
5- Setting fan potentiometer to 3-scale division and the flap to 2-scale.
6- Set the reference to 6 V.
Control Laboratory Manual
Mechatronics Eng. Dept. 6
Experiment 9: Control of Temperature System
7- Set the switching hysteresis to 0 V and plot the reference and the output on the
same graph.
Figure 5
Experiment:
1- Cool down the system at room temperature (remove the input power from the
temperature system open flap to 4 and increase the potentiometer to 10 to increase
speed of motor until the output voltage equal the room temperature).
2- Set up the experimental arrangement as shown in the block diagram of Figure 5.
3- Set the fan potentiometer to 3-scale division and the flap to 2-scale.
4- Set the reference to 6 V.
5- Plot the output and control signal for the following values of hysteresis:
1) h = 0 V 2) h = ± 0.5 V
Observe the behaviour of the lamp!, Deduce the frequency of the control signal.
6- Discuss the difference between the open-loop and the closed-loop two-position
controller.
7- Discuss the effects of the hysteresis on the output and control signal.
E. PID-Controller:
So far, a simple control technique has been evaluated: the two-position control. This
part will introduce another type of controller; which is called PID (Proportional, Integral
and Derivative). This control approach is one of the oldest and most popular techniques
used in the industry, because it is simple and effective.
Figure 6
• Cohen and Coon method.
The model obtained (transfer function) can be used to derive various tuning methods for
PID controllers. Cohen and Coon proposed one of these methods. The suggested
parameters are shown in table 1.
Table 1
Experiment:
The connection for this experiment is given below in Figure 7:
1. Cool down the system at room temperature (remove the input power from the
temperature system open flab to 4 and increase the potentiometer to 10 to increase
speed of motor until the output voltage equal the room temperature).
2. Set the fan potentiometer to 3-scale division, the flap to 2-scale and power supply
to 6 V.
Figure 7
- Study the Effects of change each of controllers Kp, Kd, and Ki on a closed-
loop system and summarized it in table shown next:
Control Laboratory
MX-0908453
1. Introduction
The TRMS workshop serves as a model of helicopter. However some significant simplifications are
made. First is the fact that TRMS is attached to a tower and second of great importance that the
helicopter position and velocity is controlled through the rotor velocity variation. In real helicopter the
rotor velocity is more less constant and the propulsion is varied through the rotor blades angle
modification.
Nevertheless, the most important dynamic characteristics present in a helicopter are captured in the
TRMS mode. Like in a real helicopter there is significant cross coupling between two rotors. If we
active the vertical position rotor the helicopter will also turn in the horizontal plane
With two inputs (the voltage supplied to the rotors) and Outputs (vertical and horizontal angles and
angular velocities) the TRMS is an excellent MIMO plant for laboratory exercises.
2. Description
Figure 1 shows the TRMS mechanical unit consists of two rotors placed on beam together with a
counterbalance. The whole unit is attached to the tower allowing for safe helicopter control
experiments
In order to design any control algorithm one must first understand the physical background behind the
process and carry out identification experiments. A complete control system setup presented in figure
2
TRMS models are nonlinear, that means at least one of the state (i- rotor current, ∅ position) is an
argument of a nonlinear function. In order to present such a model as a transfer function (a form of
linear plant dynamics representation used in control engineering), it has to be linearized.
The following momentum equations can be derived for the vertical movements
𝐼𝜓 𝑀 𝑀 𝑀 𝑀 (1)
where
𝑀 𝑎 𝜏 𝑏 𝜏 Nonlinear static characteristic (2)
𝑀 𝑀 . sin 𝜓 Gravity momentum (3)
𝑀 𝐵 𝜓 𝐵 𝑠𝑖𝑔𝑛 𝜓 Friction force momentum (4)
𝑀 𝐾 𝑀 𝜑 cos 𝜓 Gyroscopic momentum (5)
The motor and the electrical control circuit is approximated by a first order transfer function thus in
Laplace domain the motor momentum is described by:
𝑘 (6)
𝜏 .𝑢
𝑇 𝑠 𝑇
𝑘 𝑇𝑠 1 (10)
𝑀 .𝜏
𝑇𝑠 1
4. System Identification
The TRMS is a MIMO plant – multiple input multiple output. Figure 4 presents a simplified schematic
of the TRMS.
The TRMS is controlled with two inputs the 𝑢 and 𝑢 . The dynamics cross couplings are one of the
key features of the TRMS. The position beams is measured with the means of incremental encoders,
which provide a relative position signal. Thus every time the Real-Time TRMS simulation is run one
must remember that setting proper initial conditions is important.
As mentioned in the previous description the MIMO is a nonlinear plant with significant cross
couplings between the rotors (Figure 4). To keep the identification simple, the model can be treated as
two linear rotor models with two linear couplings in between.
Thus four linear model have to be identified: two for the main dynamics path from 𝑢 to 𝜓 𝑝𝑖𝑡𝑐ℎ
and 𝑢 to 𝜑 𝑦𝑎𝑤 and cross coupling dynamics paths from 𝑢 to 𝜑 𝑦𝑎𝑤 and 𝑢 to 𝜓 𝑝𝑖𝑡𝑐ℎ .
In this part, the results are used to identified the model 𝑮𝟏𝟏 that describe the relation between the
control voltage 𝑢 and the angle 𝜓 𝑝𝑖𝑡𝑐ℎ and the model the model 𝑮𝟏𝟐 that describe the relation
between the control voltage 𝑢 and the angle 𝜑 𝑦𝑎𝑤
The identified experiment is carried out using the model called (Exercise 1.mdl). This model excites
the TRMS and records its response. The excitation signal is composed of several sinusoids. Two
signals are collected in the form of vectors and available in the Workspace.
In this part, the results are used to identified the model 𝑮𝟐𝟏 that describe the relation between the
control voltage 𝑢 and the angle 𝜓 𝑝𝑖𝑡𝑐ℎ and the model the model 𝑮𝟐𝟐 that describe the relation
between the control voltage 𝑢 and the angle 𝜑 𝑦𝑎𝑤
The identified experiment is carried out using the model called (Exercise 2.mdl). This model excites
the TRMS and records its response. The excitation signal is composed of several sinusoids. Two
signals are collected in the form of vectors and available in the Workspace.
Task
1) Carry out the identification experiment and collect the data from exercise 1. Identify the two
model 𝑮𝟏𝟏 and 𝑮𝟏𝟐 using the MATLAB identification toolbox??
2) Carry out the identification experiment and collect the data from exercise 2. Identify the two
model 𝑮𝟐𝟏 and 𝑮𝟐𝟐 using the MATLAB identification toolbox??
3) Build the Simulink Model like figure 4. Find the closed loop step response specification for two
cases1: u1: step input, u2=0 and case 2: u1=0, u2: step input.
There are numerous control algorithms. The PID controller algorithm is popular because of its
simplicity. A general schematic of a simple control closed loop system is presented in figure 5.
Assuming that the plant is represented by its linear model its transfer function can be described as
𝐵 𝑠
𝐺 𝑠
𝐴 𝑠
where (s) is Laplace operator.
The idea of control algorithm is to find a controller, which will fulfil our requirements (certain dynamic
response, certain frequency damping, good response to the dynamic change of the
desired value etc.). Every controller’s input is 𝑒 𝑡 error signal, sometimes disturbance signals are also
measured. Depending on the present and past values of the error signals, the controller performs such
an action (changes the 𝑢 𝑡 control signal) that the 𝑦 𝑡 is as close to the 𝑦 𝑡 value as possible
at all the times.
1) Plot the Response of pitch angle. Use the PID control that already designed in Task1. By
change the parameters of the PID controller block (desired input is step).
2) Plot the Response of pitch angle. Set the following parameters P=2, I=0.5, D= 5 of the PID
controller with apply desired input is step.
3) Plot the Response of pitch angle. Set the following parameters P=1, I=2, D= 5 of the PID
controller with apply desired input is step
4) Plot the Response of pitch angle. Set the following parameters P=2, I=0.5, D= 5 of the PID
controller apply desired input is sinusoid signal.
5) Compare between the response and write your comments
2) Set the following parameters P=5, I=8, D= 10 of the PID controller for pitch angle, Set the
following parameters P=1, I=0.5, D= 5 of the PID controller with for yaw controller.
3) Plot the Response of pitch angle. And yaw angle for two desired input (step and sinusoidal)
Compare between the response and write your comments