Вы находитесь на странице: 1из 123

TechTeach http://techteach.no/index.

htm

Books Teaching material Tutorials Courses

Regulerings- LabVIEW Kurs i


teknikk Matlab & reguleringsteknikk
Dynamiske Simulink
systemer Octave

About TechTeach Links

Updated 24 October 2018. Finn Aakre Haugen (finn@techteach.no)

1 di 1 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/

[What is SimView?] [What is needed to run the simulators?] [Tips for using SimVIEW] [Previous SimView (2010)]

DYNAMIC SYSTEMS
TRANSFER FUNCTION MODELS
Integrator
Time constant
Second order system
Time delay
Transfer function (with two poles and one zero)
PHYSICAL SYSTEMS
Liquid tank with valve and pump outlets
Blending tank
Heated tank
Mass-spring-damper
RC-circuit
DC-motor
STABILITY
Stability and poles
CONTROL
APPLICATIONS (INCL. BASIC PID TUNING)
You - the controller!
Level control of wood chip tank
Temperature control of liquid tank
Dynamic positioning
Control of separator train
Speed servo
Level control of equalization tank
PRACTICAL PROPERTIES OF PID-CONTROLLERS
Anti wind-up
Discrete-time PID controller
Reverse and direct action of a PID controller
Reducing control kicks in PID controller
Serial and parallel PID controller
Bumpless transfer PID controller
Pulse Width Modulated (PWM) PID control signal
Measurement noise in PID control loop: See Level control of wood chip tank
CONTROL METHODS
Cascade control of product temperature in vessel
Feedforward control of liquid level
Feedforward control of tank temperature
Feedforward control of heat exchanger temperature
Gain scheduling
Control of product quality and flow including ratio control
Multivariable control using linear decoupling
Smith-predictor (Dead-time compensator)

1 di 2 23/05/2019, 18:11
TechTeach: SimView http://techteach.no/simview/

On/off controller: See Temperature control of liquid tank


ANALYSIS OF CONTROL SYSTEMS
Frequency response of a PID control system
LOGICAL AND SEQUENTIAL CONTROL
Logical functions
Sequential control of a batch process
ESTIMATION AND SYSTEM IDENTIFICATION
Kalman Filter
SIGNALS AND SIGNAL PROCESSING
SIGNAL TYPES
Signal types
White and coloured noise
SAMPLING PHENOMENA
Signal quantizer
Aliasing at sampling
FILTERING/FREQUENCY RESPONSE
Time-constant lowpass filter
Filter types
SPECTRAL ANALYSIS
Spectral analysis
TIME-DOMAIN ANALYSIS
Correlation

[TechTeach]

Updated 21 Oct 2017 by Finn Haugen. E-mail address: finn@techteach.no.

2 di 2 23/05/2019, 18:11
TechTeach: SimView http://techteach.no/simview/integrator/index.php

Integrator
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: integrator.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the simulated system


In this simulator a general integrator is simulated. You can freely adjust the input signal u(t)
and the gain of the integrator, K.

1 di 3 23/05/2019, 18:11
TechTeach: SimView http://techteach.no/simview/integrator/index.php

The relation between the input signal u and the output signal y can be expressed with the
following integral equation:

This integral equation is equivalent with the


following differential equation:

dy(t)/dt = Ku(t)

The transfer function of the integrator is

h(s) = y(s)/u(s) = K/s

The simulator is based on discretizing the integrator with the Runge-Kutta second-order
method with time-step of 0.05 sec.

Aims
The aims of the simulator is to give insight into the dynamic behaviour of an integrator.

Motivation
There are many dynamic systems with interating behaviour, e.g.:

Liquid tanks where the outflow is level is independent of the level, as if the outflow is
produced by a pump. In such a system the pump control signal can be the input variable
and the level is the output variable of the integrator.
Thermal systems without heat loss to the environment. The iInput variable is heat supply
(via a heatring element), and the output variable is the temperature.
A motor having neglectable (or very quick) dynamics. The input variable is the motor
control signal, and the output variable is the motor rotational position.
The integrator-term of a PID-controller. The input variable is the control error, and the
output variable is the integrator term, ui.

Tasks
Below, U is the amplitude of the input step, and K is the gain of the integrator.

1. The shape of the step response: Set K = 1. Simulate with an input step amplitude of U
= 1. Characterize the shape of the step response.

2. The importance of the gain K: Simulate with input step amplitude U = 1 for different
values of K, both positive and negative. How does the slope of the step response depend
on K?

3. The integrator effect: Simulate while adjusting the input u(t). Do you see that the

2 di 3 23/05/2019, 18:11
TechTeach: SimView http://techteach.no/simview/integrator/index.php

integrator actually integrates ("stores") the input?

[SimView] [TechTeach]

Updated 23. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:11
TechTeach: SimView http://techteach.no/simview/time_constant/index.php

Time Constant
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: time_constant.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


In this lab the step response of a general or standard first order system is simulated (that is, the
time response on the output of the system is calculated numerically).

A mathematical model of the first order system is the following differential equation:

T dy(t)/dt + y(t) = Ku(t) (Eq. 1)

where

K is the gain
T is the time-constant

1 di 3 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/time_constant/index.php

An alternative way of representing this model is by Laplace transforming the differential


equation, and taking the ratio of output to input (in the Laplace domain), to get the transfer
function from input u to output y:

h(s) = y(s)/u(s) = K/(Ts+1) (Eq. 2)

Aim of this lab


The aim is to develop both a qualitative and a quantitative understanding of the impact that the
gain K and the time-constant T, and the step input height U have on the step respons of a first
order system.

Motivation
First order systems constitute an important class of dynamic systems: Many physical systems
behave (approximately) as first order systems, e.g. stirred liquid tanks, motors, and sensors.
And a very common lowpass filter algorithm is a first order system.

Tasks
Note: The equality sign "=" in the following text can be regarded as "approximately equal to"
(so that you do not have to enter exact numeric values).

1. Impact of gain K: Set U=2 and T=1. Adjust K.


a. What is the impact of K on the stationary response?
b. What is the impact of K on the response-time?

2. Impact of time-constant T: Unless otherwise instructed, set U=2 and K=2. Adjust T.
a. What is the impact of T on the stationary response?
b. What is the impact of T on the response-time?
c. Adjust U up and down continuously (like a sinusoidal variation) for a small and for
a large value of T. How does T influate the "speed" of the system?

3. Impact of step height U: Set K=2 and T=1. Adjust U.


a. What is the impact of T on the stationary response?
b. What is the impact of T on the response-time?

4. Very large time-constant: Set U=1, T=100, and K=100 (enter these values into the
respective numeric displays). Characterize the step response. Explain that this step
response is (almost) the same response as for an integrator.

[SimView] [TechTeach]

2 di 3 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/time_constant/index.php

Updated 12. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/second_order_system/index.php

Second Order System


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: second_order_system.zip (unzip, and open second_order_system.exe).

Description of the system to be simulated


In this lab the step response of a general or standard second order system is simulated (that is, the
time response on the output of the system is calculated numerically).

The mathematical model of the second order system which is simulated in this lab, is the
differential equation

d2y/dt2 + 2zw0dy/dt + w02y = w02Ku (Eq. 1)

1 di 3 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/second_order_system/index.php

where

K is the gain
z is the relative damping factor
w0 is the natural resonance frequency

An alternative way of representing this model is by Laplace transforming the differential equation,
and taking the ratio of output to input (in the Laplace domain), to get the transfer function from
input u to output y:

h(s) = y(s)/u(s) = Kw02/(s2 + 2zw0s + w02) (Eq. 2)

Aim
To develop a qualitative understanding of how the following (standard) parameters influate the step
respons of a second order system: Gain K, relative damping factor z, natural (or undamped)
resonance frequency w0, and the step input height U.

Motivation
Second order systems - as first order systems - constitute an important class of dynamic systems:
There are many physical systems which behave (approximately) as second first order systems, e.g.
stirred liquid tanks with thermal capacities in the liquid and in the heating element, DC-motors with
armature dynamics and electro-mechanical dynamics, feedback control systems (e.g. process
control systems and servomechanisms), sensors, and second order lowpass filters.

Tasks
The equality sign "=" in the following text can be regarded as "approximately equal to" (so that you
do not have to enter exact numeric values).

In several taskes below you are to give a value for the response-time, Tr. It is a convenient
parameter to characterize how quick is a dynamic system with respect to it's step response. Tr is
defined as the time it takes the step response to reach 63% of it's stationary (final) value. (For first
order systems the response-time is equal to the time-constant.) It can be shown that for second
order systems Tr is approximately equal to 1.5/w0 (it actually varies somewhat with z).

1. Impact of K: Set U=1, z=0.2, w0=2. Adjust K.


a. What is the impact of K on the stationary response?
b. What is the impact of T on the response-time, Tr?

2. Importance of z: Set U=1, K=2, w0=2. Adjust z.


a. What is the impact of z on the overshoot?
b. What is the impact of z on the response-time Tr?
c. What is the impact of z on the stationary response?
d. What is the impact of z on the stability of the system?

2 di 3 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/second_order_system/index.php

3. Importance of w0: Set U=1, K=2, z=0.2. Adjust w0.


a. What is the impact of w0 on the response-time Tr?
b. What is the impact of w0 on the stationary response?
c. What is the impact of w0 on the overshoot?
d. Adjust U up and down continuously (like a sinusoidal variation) for a small and for a
large value of w0. How does w0 influate the "speed" of the system?

4. Importance of step height U: Set K=2, z=0.2, w0=2. Adjust U. What is the impact of U on
the stationary response?

[SimView] [TechTeach]

Updated 27 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/timedelay/index.php

Time Delay
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: timedelay.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the simulated system


The simulator simulates a pure time delay between the input signal u and the output signal y:

y(t)=u(t-Td)

1 di 2 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/timedelay/index.php

The time delay Td can be adjusted while the simulator runs.

Aims
The main aim is to develop an understanding of how a time delay works in the time domain.

Motivation
The time delay is an important phenomenon in practical systems. It appears in transportation of
material and signals. A time delay can be used to represent imperfect blending in tanks. In
feedback control systems time delays are important identify since any increase of the time
delay will decrease the stability of the control loop.

Task
1. Adjust the input signal in any way, and observe how the response in the output signal
depends on the time delay.

[SimView] [TechTeach]

Updated 14. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:12
TechTeach: SimView http://techteach.no/simview/transferfunction/index.php

Transfer Function
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: transferfunction.zip (unzip, and open transferfunction.exe).

Description of the simulated system


The following general second order transfer function model is simulated:

y(s)/u(s) = H(s) = (b1s + b0)/(s2 + a1s + a0)

H(s) can have both poles and zeros. You can determine the coefficients of the numerator and the
denominator polynomial.

Aims

1 di 2 23/05/2019, 18:13
TechTeach: SimView http://techteach.no/simview/transferfunction/index.php

The aims of this simulator is to develop the understanding of the relation between poles and zeros
and the time response of transfer function models.

Motivation
Transfer function models are frequently used in signal processing (to represent signal filters) and
control theory (to represent process models, controllers, and sensors).

Tasks
It is assumed that you answer the following questions by running the simulator.

1. Is it confirmed that the system is unstable if the system has at least one pole in the right half
plane? (You may set b1 = 0; b0 = 1; a1 = -0.2; a0 = 1;)
2. Is it confirmed that the system is on the stability limit if the system have poles on the
imaginary axis (and no poles in the right half plane)? (You may set b1 = 0; b0 = 1; a1 = 0; a0
= 1;)
3. Find (by calculation) the static transfer function Hs of the system. Assume that the input u is
a step of amplitude U. Calculate the corresponding static response, ys. Is the resultat
confirmed in a simulation? (You may set b1 = 0; b0 = 1; a1 = 1; a0 = 1;)
4. Is it confirmed that a zero in the right half plane causes an inverse response (assuming a step
in the setpoint)? (You may set b1 = -2; b0 = 1; a1 = 1; a0 = 1;)

[SimView] [TechTeach]

Updated 17. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:13
TechTeach: SimView http://techteach.no/simview/liquid_tank/index.php

Liquid Tank with Valve and Pump Outlets


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: liquid_tank.exe.

Description of the simulated system


A liquid tank with inflow and outflow is simulated. The tank has straight walls. You can adjust the
inflow and the control signal to the outlet valve and the outlet pump during the simulation.

A mathematical model of the tank can be derived using mass balance of the liquid. The model is

where A is the cross sectional area, qin is the volumetric inflow, qp is the volumetric outflow

1 di 2 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/liquid_tank/index.php

through the pump and qv is the volumetric outflow through the valve.

Aim
The aim of this simulator is to develop an understanding of the dynamic properties of a liquid tank,
and the differences between having a valve and a pump in the outlet.

Motivation
Liquid tanks are common in industrial process plants. It is therefore useful to understand the
dynamic properties of liquid tanks.

Tasks
1. Explain that the liquid level is proportional to the integral of the inflow. Verify the integrator
behaviour with a simulation (set both the valve outflow and the pump outflow to zero).
2. Pump outflow (no valve outflow): Explain that the liquid level is proportional to the integral
of the pump control signal. Is the outflow dependent of the level? Verify your answer to these
two questions with a simulation (set the inflow to zero, and fill the tank with water using the
reset-button, and then set the pump control signal to e.g. 1).
3. Valve outflow (no pump outflow): Explain that the liquid level is not proportional to the
integral of the valve control signal. Is the outflow dependent of the level? Verify your answer
to these two questions with a simulation (set the inflow to zero, and fill the tank with water
using the reset-button, and then set the valve control signal to e.g. 1).
4. A process is said to be self-regulating if the process variable (state variable) stabilizes at
some constant value when the system is excited by constant input signal(s). Is the tank self-
regulating with pump outlet (no valve)? What if there is valve outlet (no pump)? Verify your
answers with simulations.

[SimView] [TechTeach]

Updated 18 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/blending_tank/index.php

Blending Tank
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: blending_tank.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Information and tasks to appear.

[SimView] [TechTeach]

Updated 16 April 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

1 di 1 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/heated_tank/index.php

Heated Tank
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: heated_tank.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the simulated system


In this simulator a thermal system is simulated. The system is a continuously stirred heated tank
with continuous mass (liquid) inflow and outflow. The front panel of the simulator shows the
system. The mathematical model can be derived from an energy balance for the liquid in the tank.
The energy balance can be expressed as the following first order differential equation:

crVdT/dt = P + cw(Ti - T) + U(To - T)

1 di 2 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/heated_tank/index.php

der

T [oC] is the liquid temperature in the tank


Ti [oC] is the inlet temperature
To [oC] is the ambient temperature
c [J/(kg K)] is the specific heat capacity of the liquid
r [kg/m3] is the liquid density.
w [kg/s] is the liquid mass flow through the tank
V [m3] is the tank volume
U [J/(s K)] is the total heat transfer coefficient (between the the tank and the environment)

The simulator is based on the model above.

Aims
The aim of the simulator and the tasks below is to develop the understanding of the dynamic
properties of a continuously stirred heated tank with continuous heating and inlet flow and outlet
flow. This system .

Motivation
Stirred tanks are common in industrial plants. The dynamic properties of heated tanks, heat
exchangers, and reactors have many similarities with stirred tanks.

Task
Unless otherwise stated, you should use the default values of the parameters (a default value is
retrieved via right-click on the element / Reinitialize to Default on the front panel).

1. Get familiar with the system/model: Observe in simulations how the temperature T of the
liquid in the tank depends qualitatively of the following variables and parameters:
Inlet temperature Ti (it can be changed e.g. as a step)
Mass flow w (e.g. increase it).
Environmental temperature Ti.
Heat transfer coefficient U (increase from e.g. U=500).

2. Static operating point: It is specified that the static value of the tank temperature, Ts, shall
be 40 degrees C. The inlet flow temperature is assumed to be Ti0 = 20 degrees C. Calculate
from the static version of the model the constant power, P0, neeeded. In this case use the
default values of the prosess parameters (as shown on the frontpanel). Confirm the calculated
resultat in a simulation.

[SimView] [TechTeach]

Updated 10 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/mass_spring_damper/index.php

Mass-Spring-Damper
Snapshot from the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: mass_spring_damper.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the simulated system


A mass-spring-damper system is simulated, see the front panel of the simulator. You can adjust the
force acting in the mass, and the position response is plotted.

The mathematical model of the system can be derived from a force balance (or Newton's second
law: mass times acceleration is equal to the sum of forces) to give the following second order
differential equation:

1 di 3 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/mass_spring_damper/index.php

mdx2/dt2 = -Ddx/dt - Kf x + F

where

x [m] is the position of the mass


F [N] is the force acting on the mass
m [kg] is the mass
D [N/(m/s)] is the damping constant (Ddx/dt is the damping force)
Kf [N/m] is the spring constant (Kfx is the spring force)

It can be shown that the transfer function from force F to position x is a second order tramsfer
function with the following standard parameters:

K = 1/Kf

z = D/[2*sqrt(mKf)]

w0 = sqrt(Kf/m)

The values of the above parameters can be seen on the front panel of the simulator.

Aim
The aim of the simulator is to develop an understanding of the dynamic properties of a mass-
spring-damper.

This simulator can develop a "physical" interpretation of the standard parameters of second order
systems. (This assumes you master the theory of of second order systems.) However, you may
benefit well from working with most of the tasks below even if you do not master this theory (you
can skip tasks 1d, 2d and 3d).

Motivation
The mass-spring-damper system is a standard example of a second order system, since it relatively
easy to give a physical interpretation of the model parameters of the second order system.

Tasks
Unless otherwise stated, it is assumed that you use the default values of the parameters.

1. The importance of mass m:


a. How does the mass m influence the speed of the transient response (the transient
response is the first part of the response - before it stabilizes)?
b. How does the mass m influence the damping of the transient response? (There is small
damping if the response oscillates much.)
c. How does the mass m influence the stationary response (which is the response as time
goes to infinity)?
d. Observe at the front panel how the standard parameters of the second order systems
(K, z, w0) depend on m. Are the observations in accordance with the above expressions
of these parameters?

2 di 3 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/mass_spring_damper/index.php

2. The importance of the spring constant Kf:


a. How does the spring constant Kf influence the speed of the transient response (the
transient response is the first part of the response - before it stabilizes)?
b. How does the spring constant Kf influence the damping of the transient response?
(There is small damping if the response oscillates much.)
c. How does the spring constant Kf influence the stationary response (which is the
response as time goes to infinity)?
d. Observe on the front panel how the standard parameters of the second order systems
(K, z, w0) depend on Kf. Are the observations in accordance with the above
expressions of these parameters?

3. The importance of the the damping constant D:


a. How does the damping constant D influence the speed of the transient response (the
transient response is the first part of the response - before it stabilizes)?
b. How does the damping constant D influence the damping of the transient response?
(There is small damping if the response oscillates much.)
c. How does the damping constant D influence the stationary response (which is the
response as time goes to infinity)?
d. Observe on the front panel how the standard parameters of the second order systems
(K, z, w0) depend on D. Are the observations in accordance with the above expressions
of these parameters?

4. The importance of the constant force Fs: Observe the step response in x for various Fs.
How does the stationary value of the step response, xs, depend on Fs?

[SimView] [TechTeach]

Updated 3. June 2009. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:14
TechTeach: SimView http://techteach.no/simview/rc_circuit/index.php

RC-Circuit
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: rc_circuit.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the simulated system


In this simulator an RC-circuit is simulated. It consists of a resistor R [Ohm] and a capacitor C
[Farad] connected in a circuit, see the front panel of the simulator.

In the tasks below the dynamic properties of the RC-circuit will be observed through simulations.
In the simulator the input signal is a sum of two independent sinusoids and a bias (a constant).

Aim

1 di 3 23/05/2019, 18:15
TechTeach: SimView http://techteach.no/simview/rc_circuit/index.php

The aim of this simulator is to increase the understanding of the RC-circuit as a dynamic system.

Motivation
In applikations where a simple analog lowpass filter is needed, the RC-circuit is commonly used, as
in I/O equipment (input/output) for attenuation of measurement noise.

Mathematical model
It can be shown that the relation between the input voltage v1 and the output voltage v2 is given by
the following differential equation:

(1) RC*dv2/dt = v1 - v2

By taking the Laplace transform of this differencial equation we find the following transfer
function, H(s), from v1 to v2:

(2) H(s) = 1/(Ts+1)

where

(3) T = RC [s]

is the filter time constant.

Using frequency response theory, it can be found that the bandwidth of the filter is

(4) fb = (1/T)/(2p) [Hz]

Tasks
Unless otherwise stated you should use default values of the various parameters (you get the the
default value via right-click on the front panel element).

1. The step resonse of the filter: In this subtask, you should suppress the sinusoids (by setting
the amplitudes to zero).
a. Calculate (by hand) the time constant T according to Eq. (3) above. Is the result the
same as can be seen on the front panel of the simulator when the simulator runs? Then
run a simulation where you adjust the signal component B as a step, and read off the
time constant from the response. Is the observed time constant the same as the
calculated time constant?
b. Run a simulation with some constant input signal, say V1. What is the corresponding
steady-state value, v2s, of the output voltage response? From these results, what is the
relation between V1 and v2s? Can you calculate this relation directly from the model
(1)?

2. Frequency response of the filter: Set the signal component B to zero. Use default values of
R and C.
a. Let the sinusoid v1a have amplitude 0.5 and frequency 0.05Hz, and let sinusoid v1b

2 di 3 23/05/2019, 18:15
TechTeach: SimView http://techteach.no/simview/rc_circuit/index.php

have amplitude 0.5 and frequency 1Hz. Thus, signal component v1a has a smaller
frequency than the bandwidth, which is 0.16Hz, while the component v1b has larger
frequency than the bandwidth. In other words, v1a are in the passband of the filter,
while v1b is in the stoppband of the filter. Run the simulator! Can you observe from the
simulation that signal component that component 1 is in the passband, while v1b is in
the stoppband?
b. The bandwidth is defined as the frequency where the amplitude gain of the filter is
1/sqrt(2) = 0.71 = -3dB. In other words, if the sinusoidal input signal has frequency
equal to the bandwidth, the amplitude of the output signal is 71% of the amplitude of
the input signal. Verify this by running a simulation.

[SimView] [TechTeach]

Updated 27 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:15
TechTeach: SimView http://techteach.no/simview/dc_motor/index.php

DC-Motor
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: dc_motor.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Introduction
DC-motors are used in many servo mechanisms. Compared to other electric motors, DC-motors are
easy to model mathematically.

The DC-motor simulated is the Electro-Craft S-19-3AT which is an armature controlled DC-motor.
The motor parameters are given on the front panel of the simulator.

Theory

1 di 3 23/05/2019, 18:15
TechTeach: SimView http://techteach.no/simview/dc_motor/index.php

In the expressions below the following quantities are used: S is rotational speed. va is armature
voltage. ia is armature current. Tf is friction torque. TL is load torque. J is the sum of the intertias
of the motor and the load, i.e. J = Jmotor + Jload. B is the sum of the damping coefficients of motor
and load. La is the armature inductance. Ra is the armature resistance. Ke is the voltage constant
(the so called back-emf constant). KT is the torque constant.

Dynamic model (differential equation)

A mathematical model of the motor can be found from the Kirchhoff's voltage law on the armature
circuit and the torque balance of the mechanical rotation:

Kirchhoffs voltage law yields

(1) Ladia/dt = va - Raia - KeS

Torque balance yields

(2) JdS/dt = KTia - BS - Tf - TL

Transfer function model

By taking the Laplace transform of the model above we will find the following transfer function
from armature voltage va to speed S:

(3) S(s)/va(s) = H(s) = K/[(s/w0) + 2z(s/w0) + 1]

where the parameters are as follows:

Gain:

(4) K = Kt/(KtKe+BRa) [rpm/V]

Relative damping factor:

(5) z = 0.5*(JRa+BLa)/[sqrt(JLa(KtKe+BRa))]

Undamped resonance frequency:

(6) w0 = sqrt[(KtKe+BRa)/(JLa)] [rad/s]

Static model

By setting the derivatives in (1) and (2) equal to zero and eliminating ia, we get the following static
model (all variables are assumed to have constant values):

(7) S = [Kt/(KtKe+BRa)]va - [Ra/(KtKe+BRa)](Tf + TL)

Tasks
1. Assume that the armature voltage va is 30 volt and that the motor parameters have values
equal to the default values (can be recalled using the menu Operate / Reinitialize All to
Default on the front panel of the simulator).
a. Find the static speed (using simulation).

2 di 3 23/05/2019, 18:15
TechTeach: SimView http://techteach.no/simview/dc_motor/index.php

b. Calculate the static speed from the static model (7). Is the answer in accordance with
the result found in task 1a?
2. See equation (5). How are the relative damping factor and the undamped resonance
frequency changed if the total inertia J increases? Is the result confirmed in a simulation
(qualitatively)?
3. Confirm both from the model and from simulations that the statis speed is independent of the
inertia.
4. Use the default values of the motor parameters.
a. What is the value of w0 (you can read it off from the simulator front panel)?
b. In general the response time (the 63% raise time of the step response) of a second order
system is approximately equal to 1.5/w0 [sec]. Calculate from this the response time of
the motor. Is the result in accordance with a simulated step response?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:15
TechTeach: SimView http://techteach.no/simview/stability_poles/index.php

Poles and Stability of Feedback System


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: stability_poles.zip (unzip, and open stability_poles.exe).

Description of the simulated system


In this simulator a feedback system, namely a control system, is simulated. The controller is a P
controller. The front panel of the simulator shows a block diagram of the control system.

It can be shown that the transfer funcion from setpoint ymSP to process measurement ym is

ym(s)/ymSP(s) = [Hc(s)Hp(s)]/[1 + Hc(s)Hp(s)]

= Kp/(s3+2s2 + s + Kp)

= Kp/a(s)

where a(s) is the characteristic polynomial.

The stability property of the feedback system can be determined from the poles, which are the roots

1 di 2 23/05/2019, 18:16
TechTeach: SimView http://techteach.no/simview/stability_poles/index.php

of the characteristic equation:

a(s) = s3+2s2 + s + Kp = 0

In the simulator the controller gain Kp can be adjusted in real time, and the response in the process
measurement and the poles are shown.

Aims
The aim of this simulator is to observe the connection between stability and pole placement.

Tasks
1. From the poles, which are displayed on the front panel of the simulator, for which values of
the controller gain Kp (both negative and positive values Kp should be investigated) the
feedback system is
asymptotically stable
marginally stable
unstable
2. Select one Kp value for each of the three cases described above. For each such Kp: Does the
step response confirm the stability property as determined by pole placement? (Apply a step
at the setpoint.)

[SimView] [TechTeach]

Updated 18 October 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:16
TechTeach: SimView http://techteach.no/simview/you_the_controller/index.php

YOU - The Controller!


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: you_the_controller.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the simulated system


A level control for a wood chip tank is simulated. The level control system is (quite) similar to a
real control system at Tofte Södra Cell in Norway. (As of 2017, the factory has been closed - not
due to poor level control, however.)

To quantize the performance of the controller the IAE performance index (Integral of Absolute
value of control Error) is calculated continuously:

1 di 2 23/05/2019, 18:16
TechTeach: SimView http://techteach.no/simview/you_the_controller/index.php

We can say that the less IAE index, the better control. However, the IAE index does not express the
control usage, so it may happen that the control usage is abrupt, causing wear on mechanical
actuatorsas valves, motors and pumps.

When you click the IAE button on the front panel of the simulator, the chip outflow (disturbance)
wout and the level setpoint are automatically changed at specific points of time, and the IAE
calculation is started to be running for 250 minutes (simulation time). The less IAE you obtain, the
better controller you are!

Aim
One aim is that you experience how a controller works by trying to being a controller yourself, and
to observe that it may be difficult to control a process manually equally well as an automatic PI(D)
controller does.

Motivation
Many industrial processes may be controlled manually, i.e. by an operator, but it can be useful to
experience that a PI controller can do the job better - and not the least important: to do it
automatically.

Tasks
Follow the instructions down to the left on the front panel of the simulator.

1. What is the IAE value with the PID controller in action? (You can use the default PI settings
in the simulator.)
2. What IAE value do you achieve by manually controlling the process? (You may of course try
several times.)

[SimView] [TechTeach]

Updated 3 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:16
TechTeach: SimView http://techteach.no/simview/levelcontrol_chiptank/index.php

Level Control of Wood Chip Tank


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: levelcontrol_chiptank.exe . The simulator runs immediately after the
download by clicking Open in the download window. Alternatively, you can first save a copy
of the exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


The level control system for a wood chip tank is simulated. The purpose of the level control is to
keep the level between specified limits: It is important that the level is not too high, otherwise the
chip will not be sufficiently pre-heated (by steam from the cookery), or the tank will simply run
full. And it is important that the level is not too low, otherwise the steam will stream through the
chip causing an awful smell in the neighbourhood.

The level control system is (quite) similar to an existing control system at Tofte Södra Cell in
Norway.

The process consists of a chip tank with an inlet screw, a conveyor, and an outlet screw. The inlet
flow can be controlled by adjusting the screw control variable. The outlet flow can not be
controlled, and it constitutes a disturbance on the level.

1 di 5 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/levelcontrol_chiptank/index.php

Video
Here are a couple of instructional videoe where the present simulator is used as an example:

Feedback control

How a control system may become unstable.

Mathematical description of chip tank, level sensor and measurement


filter
Below is a mathematical model of the process. However, knowledge about this model is not
necessary to do the tasks below.

Process model

A mathematical model of the process can be found using a mass balance:

A*r*dy(t)/dt = Ku*u(t-td) - wout(t) (Eq. 1)

y [m] is the level. y is the process output variable, which is to be controlled.


u [%] is the control variable, acting on the inlet screw, and giving a proportional mass flow
through the screw.
A [m2] is the cross sectional area of the tank.
r [kg/m3] is the chip density.
Ku [(kg/min)/%] is the inlet screw gain.
td [min] is the transport time of the conveyor belt, which runs with constant speed. td can also
be denoted as dead-time or time-delay.
wout [kg/min] is the mass outflow from the tank. wout is a disturbance on the level.

Dynamically, this process is "an integrator with dead-time" from the screw control.

The values of the model parameters are available via the front panel of the simulator.

Level measurement and measurement filter

The level is measured with a gamma-ray based measurement device having range 0 - 15 m,
corresponding to 0 - 100% range. The correspondence between the measurement value ym in
percent and the level y in percent is given by the measurement function:

ym = Km,LT*(y - ym0) (Eq. 2)

Km,LT [%/m] is the measurement gain (LT is Level Transmitter).


ym0 is the lower limit of the measurement range.

Measurement random noise is added to the level measurement. The measurement signal passes
through a lowpass filter which attenuates the noise component of the signal. The filter is
characterized by its time constant, Tf [s]. The filter action is removed by setting Tf = 0.

Aims

2 di 5 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/levelcontrol_chiptank/index.php

The aims of the tasks given below are

to give an understanding of how an automatic feedback control system works, and which
benefits feedback control has compared to using a fixed value of the manipulated variable
to give an understanding of the properties of two important control functions, namely PID
control and on/off-control
to develop skills in tuning controller parameters
to give insight into how various parameters (in the controller, in the process, and in the
measurement device) influates the dynamic properties and the stability properties of the
control system.

In other words: This lab will give your (more) insight into the most important issues of control
engineering!

Motivation
Control systems are essential in industry because it is important to control process variables so that
they are kept equal to or close to set-points. The PID-controller is by far the most frequently used
controller function, and it is a main topic in this lab.

This lab is about level control, and in most plants there is a need to control level. The simulated
tank with it's level control system in this lab is a "real" system, as it actually exists, as mentioned
above.

Suggested exercises
In the tasks below it is assumed that the process is in it's nominal operating point unless something
else is stated. The nominal operating point is defined as follows:

The level reference (setpoint) is 10 m.


The chip outflow is wout = 1500 kg/min = wout,nom.
The nominal value of the manipulated variable is unom = 45%, which gives an inflow that is
equal to the nominal outflow.
The filter time constant is Tf = 20 s.

In the tasks about PID-control: Set the set-point weights wp and wd equal to 1, and the coefficient a
= Tf/Td equal to 0.1 (these are also the default values as set on the front panel). Let the PID-
controller have anti-windup.

1. First: No controller! Set the controller in manual mode. Give the outflow a step from e.g.
1500 to 1800 kg/min, which implies that unom no longer fits to the nominal outflow, wut,nom.
Characterize the response in the level. Is control using a fixed value of the manipulated
variable (unom = constant) an acceptable way of controlling this process?
2. Then: Manual control, that is: YOU are the controller! Set the controller in manual mode.
Give the outflow a step from e.g. 1500 to 1800 kg/min. Compensate for this disturbance by
adjusting unom. How long time do you need to bring the level back to the set-point with an
error less than 0.1 meter? Are there any drawbacks with using a human being as a continuous
controller?
3. Automatic control using an on/off controller: Set the controller in automatic mode. Set the
on/off controller's amplitude to 10 % and the hysteresis width to 0%. Give wut and unom their
nominal values.
a. Characterize the response in the level. Explain!

3 di 5 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/levelcontrol_chiptank/index.php

b. Apply a step to wut from 1500 to 1800 kg/min. How is the response in the level?
Explain! What happens with the response if you increase M (from 10%)?
4. Automatic control with a PID-controller: Parameter tuning: In the tasks above you
should have observed that there are certain problems connected to having a constant
manipulated variable, and also with on/off-control. May be continuous control with PID-
controller will work better?
a. Find the PID-parameters using the Åstrøm-Hägglund-method. (You will see that the
response in the level is not sinusoidal, but just pretend it is - that is, you can read off
the amplitude of the oscillations in the usual way.)

b. Find the PID-parameters also using Ziegler-Nichols' closed-loop method. Are the
parameters approximately the same as with the relay- or on/off-tuner?

In the following tasks you shall use the PID-parameter values as found in task 4a or 4b.
If you have not executed task 4, you can use the following PID-parameter values,
which you can regard as "standard values":

Kp = 1.8, Ti = 9 min = 540 sec, Td = 2.25 min = 135 sec.

5. Is the stability of the control system OK? Give wut a step from e.g. 1500 to 2000 kg/m, and
observer how the level returns to the set-point. Does the control system have proper stability?
6. Compensation properties:
a. How large is the stationary control error using a PID-controller after a step in wut from
1500 to 1800 kg/min?
b. How long time time does it take for the PID-controller to bring the level back to the
set-point with an error smaller than 0,1m (after the step in wut as described above)?
Which controller is best in this respect: You, the on/off-controller, or the PID?
c. Use a P-controller. Choose a proper value of Kp in the P-controller. How large is now
the stationary control error? Zero?
7. Tracking properties: How large is the stationary control error with a PID-ontroller after a
step in the set-point (choose the step value yourself)?
8. How the P-, I- and D-term woks: Observe how the three terms in the control signal, u,
works after a step in the disturbance. (There is a button beneath the diagram of u to show the
time-response of the individual control signal terms.)
9. How parameter changes influences the stability of the control system: Observe how the
stability of the control system changes due to the parameter changes describes below. In each
subtask/experiment you can excite the control system with a small step in the set-point. The
experiments must be performed independant of each other, that is, you have to reset the
parameters to the standard values (defines above) between each experiment.
a. The controller gain Kp is increased (much).
b. The integral time Ti is reduced (much).
c. The derivate time Td is increased (much).
d. The screw gain Ku is increased (much).
e. The sampling interval of the controller, Ts_reg (which can be adjusted in the parameter
field in the upper part of the front panel) is increased (much).
f. The dead-time (time-delay) td of the conveyor is increased (much).
g. The cross sectional area A is reduced (much).
h. The measurement gain Km,LT is increased (much).
i. The set-point gain Km,LC is increased (much).

4 di 5 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/levelcontrol_chiptank/index.php

10. The importance of using the correct measurement function in the setpoint generation:

a. What happens with the control error of the set-point gain Km,LC is different from the
measurement gain Km,LT?
b. What happens with the control error if the lower limit, rm0, of the set-point range is
different from the lower limit, ym0, of the measurement range?

11. Measurement lowpass filter: Demonstrate that the measurement lowpass filter attenuates
the noise component of the measurement signal. Also demonstrate that the filter reduces the
variation of the control signal. (Compare the behaviour of the signals with filter and without
filter.) In general, what may be the drawback of large variations of the control signal?

12. Derivative term and measurement noise: Demonstrate that the derivative term of the
controller causes the control signal to vary more (compared to not having derivative term).

[SimView] [TechTeach]

Updated 12. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

5 di 5 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/temp_control_pid_onoff/index.php

Temperature Control of Liquid Tank


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: temp_control_pid_onoff.exe.

Description of the simulated system


A temperature control system for a water tank with continuous inflow and outflow is simulated.
The water is heated by a heating element which controlled by the controller. The temperature is
measured by a temperature sensor which in practice may be a Pt100 element or a thermocouple.

The process model on which the simulator is based is a 1. order model based on energy balance
under the assumption of homogenous conditions in the liquid in the tank. The processs model also
contains a time delay which represents the time delay which in practice exists between an exitation
of the heating element and the response in the temperature sensor. In addition the simulator
contains a 1. order transfer function representing a time constant in the heating element.

Video
Here are some instructional videos where the present simulator is used as an example:

1 di 4 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/temp_control_pid_onoff/index.php

PID controller tuning with the Good Gain method


PID controller tuning with Ziegler-Nichols' oscillations method

Process model
Knowledge about the process model is not necessary for doing the tasks below. The parameter
values are shown on the front panel of the simulator.

The process model used in the simulator is based on energy balance:

(1) d(crVT1)/dt = Keu + cw(Tinn - T1) + U(Tenv - T1)

where Keu = P is the power delivered by the heating element. T1 is the temperature in the tank
assuming homogenous conditions. In practice there is a time delay between an excitation in the
heating element and the response in the temperature sensor:

(2) T(t) = T1(t-t)

We assume that this time delay is inversely proportional to the mass flow w:

(3) t = Kt/w

By taking the Laplsce transform of the model above we can get the following transfer function
from the control signal to the temperature T:

(4) T(s)/u(s) = H(s) = [Ku/(Ts+1)]e-ts

Thus a first order model with time delay. The parameters of H(s) are:

(5) Gain Ku = Ke/(cw+U)

(6) Time constant Tk = rV/(w+U/c)

(7) Time delay t = Kt/w

In addition the simulator contains a 1. order transfer function representing a time constant in the
heating element. (This submodel is not shown in the model above.)

Aims
To get an understanding of how an automatic control system based on feedback works and
which benefits feedback control has compared to control using a constant control signal.
To get an understanding of the features of the PID controller and the on/off controller.
To get skills in tuning a PID controller
To get insight into the importance of different system parameters on the dynamic properties
of the control system.

In other words: You will get knowledge about the basics of control!

Motivation

2 di 4 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/temp_control_pid_onoff/index.php

Control systems are essential in industrial processes since it is important and useful to control
process variables so that they are kept on or close to specifies values (setpoints). The PID controller
is the most frequently used control function in industrial systems.

In the industry temperature control is used on e.g. reactors and heat exchangers.

Tasks
The nominal operating point of the process is defined as follows:

The tank temperature T is 50 degrees C.


The inlet temperature Tin is 20 degrees C.

The default process parameter values are as shown on the this snapshot of the front panel of the
simulator.

Unless otherwise stated it is assumed that the tasks below are executed while the simulator runs.

1. First: Control using constant control signal. Set the controller in manual mode. Find the
nominal control signal uman "experimentally". Then change the distrubance Tin from 20 to 15
degrees C. What is the value of the resulting steady-state control error?

2. Feedback control by you ! Reset the settings of the simulator to its default values (menu:
Operate / Reinitialize All to Default), but the controller shall be in manual mode. Change the
disturbance Tin from 20 to 15 degrees C, and control the process via the nominal control
signal u0. Are you able to obtain zero steady-state control error?

3. Automatic control using a PI controller: Tuning the controller: Tune the controller using
the Ziegler-Nichols' closed loop method.

In the subsequent tasks you shall use a PI controller with settings as found in Task 4.
Alternatively, you can use the following parameter values:

Kp = 2.6, Ti = 6.3 min, Td = 0s

4. Disturbance compensation: Reset the settings of the simulator to its default values (menu:
Operate / Reinitialize All to Default). Change the disturbance Tin from 20 to 15 degrees C.
What is the steady-state control error?

5. Setpoint tracking: Change the setpoint as a step, say from 50 to 60 degrees C. What is the
steady-state control error?

6. The stability of the control system at parameter variations: Reset the settings of the
simulator to its default values (menu: Operate / Reinitialize All to Default). Check what
happens with the stability of the control system at the below parameter changes. In each of
the subtasks/experiments you can excite the control system using a small step in the setpoint.

3 di 4 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/temp_control_pid_onoff/index.php

The experiments shall be performed independent of each other, that is, the parameters should
be reset to the default values once the experiment is completed.
a. Controller gain Kp is increased (much).
b. Integral time Ti is reduced (much).
c. Derivative time Td is increased (much).
d. Power gain Ke is increased (much).
e. Mass flow w is decreased (much).
f. Measurement gain Km,TT is increased (much). (This gain is the ration between the
temperature measurement in % and the temperature in degreees C. The gain is changed
by changing the measurement range. If you change the measurement range, you must
also change the setpoint range accordingly, otherwise there will be a steady-state
control error.)

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

4 di 4 23/05/2019, 18:17
TechTeach: SimView http://techteach.no/simview/dynpos/index.php

Dynamic Positioning
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: dynpos.zip (unzip, and open dynpos.exe).

[SimView] [TechTeach]

Updated June 14, 2014. Developed by Finn Haugen. E-mail: finn@techteach.no.

1 di 1 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/separators/index.php

Control of Separator Train


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: separators.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the system to be simulated


...

Aim
...

Motivation
...

Tasks

1 di 2 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/separators/index.php

.....

[SimView] [TechTeach]

Updated 27 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/speedservo/index.php

Speed Servo
Snapshot of parts of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: speedservo.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the simulated system


A speed control system - i.e. a speed servo -- is simulated. The motor is the DC motor Electro-Craft
S-19-3AT which is an armature controlled, voltage controlled DC motor.

The speed is measured using a tachometer. The tachometer gain and the other motor parameters
can be adjusted from the front panel of the simulator.

Mathematical model
In the expressions below the following quantities are used: S is rotational speed. va is armature
voltage. ia is armature current. Tf is friction torque. TL is load torque. J is the sum of the intertias
of the motor and the load, i.e. J = Jmotor + Jload. B is the sum of the damping coefficients of motor
and load. La is the armature inductance. Ra is the armature resistance. Ke is the voltage constant

1 di 4 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/speedservo/index.php

(the so called back-emf constant). KT is the torque constant.

The values of the motor parameters can be adjusted from the front panel.

Dynamic model (differential equation)

A mathematical model of the motor can be found from the Kirchhoff's voltage law on the armature
circuit and the torque balance of the mechanical rotation (refererence):

Kirchhoffs voltage law yields

(1) Ladia/dt = va - Raia - KeS

Torque balance yields

(2) JdS/dt = KTia - BS - Tf - TL

Transfer function model

By taking the Laplace transform of the model above we will find the following transfer function
from armature voltage va to speed S:

(3) S(s)/va(s) = H(s) = K/[(s/w0)2 + 2z(s/w0) + 1]

where the parameters are as follows:

Gain:

(4) K = Kt/(KtKe+BRa) [rpm/V]

Relative damping factor:

(5) z = 0.5*(JRa+BLa)/[sqrt(JLa(KtKe+BRa))]

Undamped resonance frequency:

(6) w0 = sqrt[(KtKe+BRa)/(JLa)] [rad/s]

Static model

By setting the derivatives in (1) and (2) equal to zero and eliminating ia, we get the following static
model (all variables are assumed to have constant values):

(7) S = [Kt/(KtKe+BRa)]va - [Ra/(KtKe+BRa)](Tf + TL)

Aim
The aim of this simulator is to get a better understanding of how a speed control system works
dynamically.

Motivation
DC motors are used in many servo systems. Compared to other electro motors DC motors are easy

2 di 4 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/speedservo/index.php

to model mathematically, and, hence, easy to simulate.

Tasks
In the tasks below is assumed - unless otherwise stated - that the process (motor) is in its normal or
nominal operating point, defined as follows:

The speed S is 3.0 krpm (revolutions per minute), which is used as a nominal speed setpoint.
The load torque TL is 0 Nm.

Unless other information is given, it is assumed that the simulator runs while you do the tasks.

1. Control using constant control signal. Set the controller in manual mode.
a. Find the nominal control signal u0 experimentally (on the simulator) which brings the
process to the nominal operating point.
b. Change the load torque (disturbance) from 0 to -20 Nm. What is the steady-state
control error?

2. Tuning a PID control: In the subsequent tasks the motor speed is controlled by a PID
controller (unless otherwise stated). Adjust the controller using the Ziegler-Nichols' closed
loop method.

3. Steady state setpoint tracking and disturbance (load torque) compensation:


a. Let the the load torque be zero and the speed setpoint 3.0 krpm. What is the steady-
state control error?
b. Change the load torque as a step frm 0 to 20 Nm. What is the steady state control
error? Is there an improvement from task 1b?
c. Are the static setpoint tracking and disturbance tracking perfect?

4. Control using a P controller:


a. Find a proper value of the controller gain.
b. Are the static setpoint tracking and disturbance tracking perfect with a P controller?
(Simulate!)

5. Tracking a setpoint ramp: Let the load torque be constant. Let the setpoint be a ramp of
slope 100 krpm/s.
a. Use a PID controller. What is the steady state control error (as read off from the front
panel of the simulator)?
b. Use a P controller. What is the steady state control error?

6. The stability of the control system at parameter changes: Let the setpoint be 3.0 krpm and
the load torque 0 Nm. Observe what happen to the control system stability at the parameter
changes described below. In each task/experimentyou can excite the control system via a
small step in the setpoint. The experiments should be performed independently, i.e. the
parameter values should be reset to default values once each of the experiments is finished.
a. The control gain is increased (much).

3 di 4 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/speedservo/index.php

b. The integral time is decreased (much).


c. The derivative time is increased (much).
d. The tachometer gain (measurment gain) is increased (much).
e. First, set the total damping coefficient B to zero. Then, reduce the intertia of the load
(much). Try to explain the influence that this reduction has on the stability of the
control system from Eq. 5.

[SimView] [TechTeach]

Updated 30. May 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

4 di 4 23/05/2019, 18:18
TechTeach: SimView http://techteach.no/simview/level_control_equalization_tank/index.php

Level Control of Equalization Tank


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator:level_control_equalization_tank.exe.

Description of the simulated system


The system being simulated is a level control system of a liquid tank. The controller function is PI
(proportional plus integral), in the form of the LabVIEW PID Advanced function.

The mathematical model of the process to be controlled is based on mass balance of the contents,
which is water, of the tank. The mass balance is as follows:

A*dh(t)/dt = Fin(t) - Fout(t)

The outflow Fout(t) is assumed to be the same as the pump control signal u(t) (both in unit of m3/s).

Video
Here is an instructional video where a previous version of the present simulator is used as an
example: Flow Smoothing with Buffer Tank.

1 di 2 23/05/2019, 18:19
TechTeach: SimView http://techteach.no/simview/level_control_equalization_tank/index.php

Aims
The aim of this simulator is to demonstrate the use of level control to obtain equalization (or
buffering) of flow.

Motivation
Flow equalization is important in e.g. wastewater treatment plants. Compliant or soft level control
is used to obtain a proper equalization or smoothing of the varying inflow.

Tasks
1. Observe in simulations how the closed-loop time-constant, T_c, in the Skogestad PI tuning
method affects the flow equalization or smoothing property of the level controlled tank.

2. It can be shown (assuming the level controller is a P controller) that the maximum variation in
the level, dh_max, due to a step change of amplitude dF in the inflow is not larger than T_c*dF/A.
Verify this in a simulation.

[SimView] [TechTeach]

Updated 18 October 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:19
TechTeach: SimView http://techteach.no/simview/antiwindup/index.php

Anti Windup
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: antiwindup.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the system to be simulated


The simulated system is a temperature PID control system for a tank with continuous inflow and
outflow. The inflow temperature Tin is a disturbance to the control system. If Tin becomes low, the
heating element reaches its saturation limit. The user can choose to activate or deactivate the anti
windup in the PID controller, but in most commercial controllers some anti windup function is
activated.

Video
Here is an instructional video where the present simulator is used as an example: Anti windup in a
PI(D) controller.

1 di 2 23/05/2019, 18:19
TechTeach: SimView http://techteach.no/simview/antiwindup/index.php

Aim
The aim is to observe the importance of having anti windup in the PID controller when a large
disturbance drives the control variable into saturation.

Motivation
All practical PI(D) controllers must have anti windup, so this is standard in commercial controllers.
If you are to implement a PI(D) controller yourself, it should definitely have anti windup.

Tasks
Reasonable PID parameter settings are shown on the front panel of the simulator (i.e. Kp=6.7,
Ti=252s, Td=63s). The temperature setpoint can be set to 80 degrees C.

1. Control without anti windup: Deactivate the anti windup action. Set Tin = 40 degrees C,
and let the control system settle to a steady state. Then reduce Tin to 10 degrees C and keep
Tin at this value for about 100min. Does the control variable go into saturation? Then
increase Tin back to 40 degrees. How long does it take until the temperature T converges to
the setpoint with zero control error after Tin was increased from 10 to 40 degrees? To which
value is the I-term (ui) integrated?

2. Control with anti windup: Activate the anti windup, and adjust Tin as in Task 1. How long
does it take before the temperature T converges to the setpoint with zero control error after
Tin was increased from 10 to 40 degrees? To which value is the I-term (ui) integrated?

Is anti windup of any importance?

[SimView] [TechTeach]

Updated 15 April 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:19
TechTeach: SimView http://techteach.no/simview/piddiscrete/index.php

Discrete-Time PID Controller


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: piddiscrete.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the simulated system


Typically, commercial PID controllers of today are implemented as an algorithm running on a
computer. The PID algorithm is executed once per time step (sampling interval), Ts. A typical value
of Ts is 0.1 sec. The tasks below deomonstrates effects of the discrete-time nature of such computer
implemented controllers.

Tasks

1 di 2 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/piddiscrete/index.php

Assuming the following parametrers of the process to be controlled (these values are default values
of the simulator): Ku=1, Kv=1, T1=2, T2=1, tau=0.5. Controller tuning using the Ziegler-Nichols'
ultimate gain tuning method yields

Kp=3.6, Ti=2.0 og Td=0.5

You can apply the above parameter values in the following task.

Start the simulator.

1. Set Ts = 0.1. Change the setpoint e.g. as a step. Observe the control signal. Does this signal
seem to be almost continuous?
2. Increase Ts to 0.5. What does the control signal look like? What has happened to the stability
of the control system?
3. Find experimentally (on the simulator) for which values of Ts the control system is
asymptotically stable.
4. Adjust Ts to the value giving marginally stability of the control loop. Readjust the PID
parameters so that the loop again becomes asymptotically stable (using e.g. the Ziegler-
Nichols' closed loop method). Is the control loop as quick with this new PID setting as with
the original setting?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/pid_reverse_direct/index.php

Reverse and Direct Action of a PID


Controller
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: pid_reverse_direct.exe.

Description of the simulated system


In this simulator a level control system for a liquid tank is simulated. The control signal controls
the mass outflow from the tank. The user can select the sign of the controller gain. The default PID
parameter values (already set on the simulator) can be used.

Video
Here is an instructional video where the present simulator is used as an example: Reverse or direct
action in the PID controller?

Aim
The aim of this simulator is to observe the consequences of selecting wrong sign of the controller
gain.

Motivation

1 di 2 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/pid_reverse_direct/index.php

Commercial controller give the user the option to select the controller gain according to the process
gain. Selecting wrong sign has dramatic concequences for the stability of the control loop.

Tasks
1. Explain (without simulating) that the left tank process has positive gain, and that right tank
process has negative gain.
2. What happens to the stability of the control systems if you select the wrong mode among the
reverse and direct modes?
3. What happens to the stability of the control systems if you select the correct mode(s)?

[SimView] [TechTeach]

Updated 15 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/control_kick/index.php

Reducing Control Kicks in PID Controller


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: control_kick.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the system to be simulated


In this simulator a control system for a process represented by a transfer function model is
simulated. The process model is two time constant terms and a time delay in series. The controller
is a PID controller with the possibility for the user to select reduced setpoint weight in the
proportional and in the serivative terms.

The derivative term is given byer

ud = KpTd d(wdySP-y)/dt

1 di 3 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/control_kick/index.php

where wd is the weight of value either 1 or 0 (values between 1 ans 0 are not used in practice).
Normally wd is 1. With wd equal to 0 the setpoint is effectively removed from the derivative term.

In some PID controllers the user can select a reduced setpoint weight also in the proportional term:

up = Kp(wpySP-y)

where the weight wp can be e.g. 0.3 (normally 1).

Reduced setpoint weight implies that abrupt setpoint changes (as step changes) are not propagated
to the control signal. This results in a smoother control signal, but it also causes a somewhat more
sluggish control system as far as setpoint tracking is concerned, which may be unfortunate when
the controller is a secondary controller in a cascade control system.

An alternative way to achieve a smoother control signal is to simply use a smoother setpoint signal,
e.g. changing the setpoint between two values as a ramp in stead of as a step.

Aims
The aims of this simulator is to observe the benefits and drawbacks of using reduced setpoint
weights in the proportional term and the derivative term of a PID controller, and to see that ramping
of the setpoint can be an alternative to reduced setpoint weighting.

Motivation
In many commercial controllers the user can select reduced setpoint weight in the proportional and
in the derivative term. It is important to be aware the benefits and drawbacks of such reduced
weighting, and to know about the alternative solution of choosing smooth setpoint changes, a
ramped change between two setpoint values.

Tasks
If the controlled process has default parameter values (i.e. Ku=1, Kv=1, T1=2, T2=1, tau=0.5)
proper PID settings are

Kp=3.6; Ti=2.0; Td=0.5

(as found using the Ziegler-Nichols' closed loop method). These settings may be used in the tasks
below.

Start the simulator.

1. Reduced setpoint weight in the D term:


a. Change the setpoint as a step (e.g. from 50% to 60%). What is the consequence for the
response in the control variable of using reduced setpoint weight wd = 0 in stead of the
normal value of 1?
b. Change the setpoint as a step (e.g. from 50% to 60%). Does a reduced weight wd have
any impact on the setpoint tracking? Why/Why not?
c. Change the process disturbance as a step Endre forstyrrelsen som et sprang (e.g. from 0
to -40). Does the reduced weight wd have any impact on the disturbance tracking of the
control system. Why/Why not?

2 di 3 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/control_kick/index.php

2. Reduced setpoint weight in the P term:


a. Change the setpoint as a step (e.g. from 50% to 60%). What is the consequence for the
response in the control variable of using setpoint the reduced weight wp = 0,3 in stead
of the normal value of 1?
b. Change the setpoint as a step (e.g. from 50% to 60%). Does a reduced weight wp have
any impact on the setpoint tracking? Why/Why not?
c. Change the process disturbance as a step Endre forstyrrelsen som et sprang (e.g. from 0
to -40). Does the reduced weight wd have any impact on the disturbance tracking of the
control system. Why/Why not?

3. Using ramped setpoint changes: Set the setpoint weights wp and wd to 1. Is the control
signal smoother at a ramped setpoint change than at a stepwise change?

[SimView] [TechTeach]

Updated 17. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/pid_serial_parallel/index.php

Serial and Parallel PID Controller


Snapshot of a part of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: pid_serial_parallel.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


Some commercial PID controllers implement a PID controller function on serial form, while others
use the parallel form. The serial form corresponds closer to the former pneumatic controllers. In
this simulator two PID control systems are simulated simultaneously - one with a serial PID
controller and one with a parallel PID controller. Therefore, it is easy to compare the behaviour of
these two control systems. The process which is controlled is given by a transfer function model,
namely a second order system in series with a transport delay.

In the simulator the user can choose to transform the PID parameters for a serial PID controller to
parameters for a parallel controller so that the parallel controller behaves like a serial controller.

Here is the parallell PID controller:

1 di 3 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/pid_serial_parallel/index.php

Here is the serial PID controller:

Here are the transformations from serial to parallell PID settings:

Aim
The aims of this simulator is to observe differences between a PID controller on serial form and a
PID controller on parallel form, and to see if there is any use of transforming parallel PID
parameters to serial PID parameters.

Motivation
There are both serial and parallel commercial PID controllers. It is useful to see if there is any
substantial difference between these two controllers. Furthermore, it may be useful to see if a
transformation from serial PID parameters to parallel PID parameters has any important effect.

Tasks
In the outset you can use the following PID parameters (found by using the Ziegler-Nichols' closed
loop method on the default process):

Kp = 3.6; Ti = 2.0; Td = 0.5

1. First, use the same PID parameter values in the serial controller as in the parallel controller.
Is there any substantial difference between the responses in the process output variable of the
two control systems due to a setpoint step and a disturbance step?
2. What are the PID parameter settings for the parallel controller when the serial PID settings
are transformed to parallel PID settings? Apply these transformed PID settings to the parallel

2 di 3 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/pid_serial_parallel/index.php

controller. Is there any observable difference between the responses in the two control
systems?

[SimView] [TechTeach]

Updated 1 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:20
TechTeach: SimView http://techteach.no/simview/bumpless_transfer/index.php

Bumpless Transfer PID Controller


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: bumpless_transfer.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


A temperature control system for a liquid (water) tank with inflow and outflow is simulated. Via
the front panel of the simulator you can select whether the temperature controller has bumpless
transfer between automatic and manual mode or not. Bumpless transfer means that the control
signal is not changed abruptly at switching between automatic and manual mode.

1 di 3 23/05/2019, 18:21
TechTeach: SimView http://techteach.no/simview/bumpless_transfer/index.php

How is bumpless transfer realized in the PID controller used in this simulator? The PID controller
calculates the control signal as follows:

u = u0 + up + ui + ud

where u0 is the nominal control signal, which is an adjustable constant. When the controller is in
manual mode, u = u0.

Bumpless transfer from automatic to manual mode is realized by giving u0 value equal to the
control signal immediately before the switching (from automatic to manual mode).
Bumpless transfer from automatic to manual mode is realized by ensuring that u0 keeps its
value from manual mode and that up, ui and ud are set equal to 0 immediately before the
switching.

If bumpless transfer is deactivated (which is an option in this simulator), u0 maintains its value
from automatic mode in manual mode (thus it does not get the value of u as it is immediately
before the switch). Also at switching from manual to automatic mode, u0 maintains its value (this is
the same implementation as for bumpless transfer)

Aim
The aim of this simulator is to demonstrate why it is important that a PID controller has bumpless
transfer.

Motivation
Bumpless transfer is an important property of practical PID controllers. You can assume that
bumpless transfer is implemented in commercial PID controllers. If you are to implement a
practical controller yourself, you should implement it with bumpless transfer.

Tasks
The normal operating point of the process is defined as follows:

The tank temperature T is 50 degrees C. The temperature setpoint TSP is 50 deg C.


The inlet temperature Tin is 20 deg C.

You can use the following PID settings (according to the Ziegler-Nichols' closed loop method):

Kp = 6.7; Ti = 250min; Td = 63 min

Unless otherwise stated the tasks below assumes that the simulator runs.

1. Control without bumpless transfer:


a. Set the controller in automatic mode. Deactivate bumpless transfer using the proper
switch in the parameter field of the PID controller. To clearly demonstrate the
drawback of not using bumpless transfer you should set the nominal control value u0 to
0. Let the temperature settle at the setpoint value (50 deg C) (the integral term in the
controller ensures zero static control error even if u0 if 0).
b. Switch the controller from automatic to manual mode, which implies that the control

2 di 3 23/05/2019, 18:21
TechTeach: SimView http://techteach.no/simview/bumpless_transfer/index.php

signal to the process is u0 = 0. Characterize the control action during the mode
switching.
c. Switch the controller from manual to automatic mode, which implies that the control
signal is equal to the sum of u0 and the P-, I- and D-terms. Characterize the control
action during the mode switching.

2. Control with bumpless transfer:


a. Set the controller in automatic mode. Activate bumpless transfer via the proper switch
in the PID parameter field. You may set u0 to 0. Let the temperature settle at the
setpoint value (50 deg C).
b. Observe the value of u (it is assumed that the control error is zero, cf. Task 2a). Switch
the controller from automatic to manual mode. Characterize the control action during
the mode switching. Which value did u0 get immediately after the switching (compare
with the value of u just before the switching)?
c. Switch the controller from manual to automatic mode. Characterize the control action
during the mode switching.

[SimView] [TechTeach]

Updated 16 April 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:21
TechTeach: SimView http://techteach.no/simview/pwm_control/index.php

Pulse Width Modulated (PWM) Control


Signal
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: pwm_control.zip (unzip, and open pwm_control.exe).

Description of the system to be simulated


A control system with a pulse width modulated (PWM) control signal is simulated. The process
being controlled is given by a transfer function model representing two time constants in series
with a time delay. A process disturbance acts on the process (at the same place as the control
signal).

The purpose of PWM is to obtain an approximately continuous or smooth control signal using a
binary or on/off actuator or PWM elementet which typically is an SSR element (solid state relay).
The principle of PWM is to keep the element in the on state (and in off state) so that the resulting
average control signal is as specified. PWM elements operates with a given fixed period, Tp, e.g. 1
sec. The part of the period where the PWM element is in on-state is denoted the duty cycle (D),

1 di 3 23/05/2019, 18:21
TechTeach: SimView http://techteach.no/simview/pwm_control/index.php

which is measured in percent. See Figure 1.

Figure 1

In general, the less PWM period Tp, the smoother control signal. PWM is not proper for
mechanical actuators as valves because of excessive wear.

Aims
The aims of this simulator is to give an understanding of how pulse width modulation works, and to
show how the control action works in a control system where the control signal is pulse width
modulated.

Motivation
PWM is an important control technique. It is frequently used for controlling transistor based
switches, as SSR elements (solid state relays) for controlling motors or valves.

Tasks
The normal operating point is defined as ym = 75 and v = 0.

1. Set the controller in manual mode. The disturbance may be set to zero. The PWM periode
may be set to 1 sec. Control the process with a control signal (u0) equal to 75%. Observe the
PWM signal. Is the generated PWM signal 75% in average, as it should be?
2. Set the controller in automatic mode. Set ySP to 75%. The controller can be a PI controller
with gain Kp = 3.5 and Ti = 6.0 (tuned using the Ziegler-Nichols' closed loop method). Is the
control system behaving satisfactory regarding stability and average control error?
3. Now use a PID controller with settings Kp = 4.8, Ti = 3.5 and Td = 0.9 (according the
Ziegler-Nichols' closed loop method). Set ySP = 75%. What is the average control error?
How is the behaviour of the PWM control signal? Can you explain why the control signal u

2 di 3 23/05/2019, 18:21
TechTeach: SimView http://techteach.no/simview/pwm_control/index.php

(from the controller) is more variable with the PID controller than with the PI controller?

[SimView] [TechTeach]

Updated 19. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:21
TechTeach: SimView http://techteach.no/simview/cascade_control_temperature/index.php

Cascade Control
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: cascade_control_temperature.zip (unzip, and open
cascade_control_temperature.exe)

Description of the simulated systems


In this simulator two temperature control systems of a liquid tank heated with hot liquid in a jacket
are simulated in parallel (i.e. simultaneously), so that the benefits of cascade control are easily
observed:

A cascade control system with temperature control of both the tank and the jacket.
A single-loop control system with temperature control of the tank only.

Both control systems are excited by the same temperature setpoint and the same disturbances.

In both control systems the process to be controlled is given by the following model based on
energy balances:

dTp/dt=[cp*Fp*(Tpin-Tp)+Uhp*(Th-Tp)]/(cp*dp*Vp)

dTh/dt=[ch*Fh*(Thin-Th)-Uhp*(Th-Tp)+Ueh*(Te-Th)]/(ch*dh*Vh)

where Tp is product liquid temperature, Th is heating liquid temperature, cp and ch are specific
heat capacities, Fp and Fh are flows, Tpin and Thin are inlet temperatures, Vp and Vh are volumes

1 di 3 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/cascade_control_temperature/index.php

of jacket and tank respectively, Te is environmental temperature, dp and dh are liquid densities,
Uhp and Ueh are heat transfer coefficients between jacket and tank, and between jacket and
enviroment (air) respectively. (All parameter values are available from the front panel of the
simulator.)

To account for unmodelled dynamics, a pure time delay is added to the measured temperatures Tp
and Th.

The measurements of Tp and Th are fed to measurement lowpass filters with time constant Tf.

Aims
The aims of the tasks given below are

to give experience in tuning the controller parameters,


to demonstrate the situations where cascade control gives better control than single-loop
control,
to demonstrate the situations where cascade control does not give better control than single-
loop control.

Motivation
Cascade control is a common control structure in both process control systems and in
servomechanisms. In process control cascade control is used for temperature control, level control,
pressure control, and quality control. These are the primary control loops, while the secondary loop
typically performs flow control or pressure control.

In servomechanisms the primary loops perform positional control or speed control, while the
secondary loop typically performs speed control (in a primary positional loop), or current control
(in electrical servomechanisms).

Cascade control can give a much better compensation for disturbances than single loop control can
do.

Tasks
In the tasks below the starting point is that the process is in it's nominal operating point which is
characterized as follows:

The product temperature setpoint is 40 C.


The product inlet temperature is 20 C.
The product inlet flow is 0.5 kg/s.
The environmental temperature is 20 C.
The heating liquid inlet temperature is 60 C.

1. Checking the present controller settings:

The controllers have already been tuned for fast and stable control, but you should check if
the present PI settings are ok.

Excite the control systems with a small step in the set-point (a step amplitude of 0.5 C is
appropriate here). Is the stability of the control loops ok (just make a qualitative assessment)?

2 di 3 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/cascade_control_temperature/index.php

(You may of course tune the controllers yourself, but this is not a prerequisite for the tasks
below.)

2. Cascade control versus single-loop control:


a. Disturbance compensation: Compare the two control systems with respect to their
ability to compensate for the following disturbance changes:
Changes in the heating liquid inlet temperature, Th_in (adjust Th_in freely via
the slider). Is cascade control significantly better than single-loop control?
Why/why not?
Changes in the environmental temperature, Te. Is cascade control significantly
better than single-loop control? Why/why not?
Changes in the product liquid inlet temperature, Tpin. Is cascade control
significantly better than single-loop control? Why/why not?

Observe also how the control variable works in the two control systems. In which of
them is the control variable working most actively?

b. Setpoint tracking: Make step change of the temperature setpoint, Tpsp. Is cascade
control significantly better than single-loop control? Why/why not?

[SimView] [TechTeach]

Updated 02. November 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/feedforward_liquid_level_control/index.php

Feedforward Control of Liquid Level


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator:feedforward_liquid_level_control.exe.

Description of the simulated system


The system being simulated is a level control system based on feedback PI control from level
measurement and with the possibility of including feedforward control from outflow (disturbance)
and from level setpoint. The simulator is implemented in LabVIEW Simulation Module. The PID
controller is the LabVIEW PID Advanced function.

The mathematical model of the process to be controlled is based on mass balance of the contents,
which is water, of the tank. The mass balance is as follows:

rho*A*dh(t)/dt = Fin(t) - Fout(t)

Here the inflow Fin(t) is assumed to be the same as the pump control signal u(t), hence both are in

1 di 3 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/feedforward_liquid_level_control/index.php

unit of kg/s. Solving for the time-derivative gives

dh(t)/dt = [1/(rho*A)]*[u(t) - Fout(t)]

which constitutes the process model written as a state-space model. This model will be the basis of
the development of the feedforward control action, cf. the tasks below.

Video
Here is an instructional video where the present simulator is used as an example: Feedforward
control.

Aims
The aim of this simulator is to demonstrate the benefit for the level control by using feedforward
control in addition to the (compulsory) feedback control.

Motivation
Feedforward control can improve the control substantially, i.e. the control error may become
substantially smaller compared to not using feedforward. However, feedforward control may be
difficult to implement because a process model is required (in the present example, however, the
process model is quite simple), and disturbances have to be measured, implying extra expenses.

Tasks
In all the task below always use feedback control (with PI controller), i.e. set the PI controller in
automatic mode. The PI parameter settings can be as shown in the figure above.

1. Deriving the feedforward control function: Assume that the level control setpoint is hSP [m].

From the process model given above, show that the feedforward control function is

uf(t) = A*rho*dhSP(t)/dt + Fout(t)

Explain the physical meaning of this feedforward control! Does this control function "make sense"?

You should never implement a pure time-differentiation because the time-derivative is very
sensitive to noise and abrupt changes of the signal to be differentiated. In stead, you should
implement a smoothed derivative by letting the signal pass through a lowpass filter before the
differentiation. According to this we modify the feedforward from setpoint part of our feedforward
controller as shown below:

uf(t) = A*rho*dhSP,filt(t)/dt + Fout(t)

where hSP,filt is a lowpass filtered level setpoint. The filter may be a time-constant filter:

hSP,filt(s) = ]1/(Tfs+1)] hSP(s)

where Tf is the filter time-constant. In the simulator the time constant is set to 5 sec.

2 di 3 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/feedforward_liquid_level_control/index.php

2. Not using feedforward control:

1. Adjust the outflow (disturbance) arbitrarily. Observe the level control error.
2. Then, adjust the level setpoint arbitrarily, and observe the control error.

3. Using feedforward control:

1. By default the output of the feedback controller (PI controller) has only a positive value
range, from 0 to 5 kg/s. This non-negative range may imply that the controller is not able to
make the control error become zero in steady state after you have activated the feedforward
controller. Why not?
2. Then, change the minimum output value of the PI controller from 0 to -5. Does this help?
3. Adjust the outflow arbitrarily. Is the level control error reduced because of the feedforward
control action?
4. Then, djust the level setpoint arbitrarily. Is the control error smaller with feedforward
control?

[SimView] [TechTeach]

Updated 24 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/feedforward_control_tank_temp/index.php

Feedforward Control of Tank Temperature


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: feedforward_control_tank_temp.exe . The simulator runs immediately after
the download by clicking Open in the download window. Alternatively, you can first save a
copy of the exe-file on any directory (folder) on your PC and then run the exe-file, which
starts the simulator.

Introduction
The system being simulated is a temperature control system based on feedforward control in
addition to feedback PID control from temperature measurement. The PID controller has already
been tuned (as a PI controller, actually) for good stability.

Tasks
In all the task below, use feedback control in addition to feedforward control. It is assumed that the
simulator runs as you do the tasks.

1. Feedforward control at setpoint changes:


a. Add a ramp to the temperature setpoint. What is the steady-state control error with and
without feedforward control?
b. Use feedforward control. Adjust the setpoint manually (e.g. like a ramp), which will

1 di 2 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/feedforward_control_tank_temp/index.php

give more or less randomly abrupt setpoint changes. How does the control signal react
as compared to a smoother setpoint ramp, as in task no. a above?
2. Feedforward control at disturbance changes: Change the inflow temperature. Is the
control error be reduced by introdusing feedforward control?

[SimView] [TechTeach]

Updated 30. October 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:22
TechTeach: SimView http://techteach.no/simview/feedforward_temp_control_heat_ex/index.php

Feedforward control of heat exchanger


temperature
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: feedforward_temp_control_heat_ex.exe . The simulator runs immediately
after the download by clicking Open in the download window. Alternatively, you can first
save a copy of the exe-file on any directory (folder) on your PC and then run the exe-file,
which starts the simulator.

Description of the system to be simulated


The simulated system is a feedforward (plus feedback) control system for temperature control of a
heat exchanger. The feedforward is from measured process liquid temperature. The feedforward
controller is experimental, implemented as a table-lookup function.

Aim
The aim is to observe how adding feedforward control to the basic feedback control is improving

1 di 2 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/feedforward_temp_control_heat_ex/index.php

the disturbance compensation of the control system.

Motivation
Disturbance compensation is the main task of most control systems.

Tasks
While adjusting the T_{in} temperature, try first feedback control and then add feedforward
control. Is the control system performance improved with feedforward control?

[SimView] [TechTeach]

Updated 16 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/gain_scheduling/index.php

Gain Scheduling
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: gain_scheduling.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the simulated system


A temperature control system of a heated stirred liquid tank with continuous throughflow may vary,
is simulated, see the front panel of the simulator. It can be shown (see below) that the process
dynamics (gain, time constant, time delay) largely depends on the mass flow through the tank, so
the PID parameters should be be adjusted as functions of the mass flow to maintain satisfactory
dynamics (as good stability) of the control system. In other words: Gain scheduling may be
necessary.

About the process to be controlled

A process model can be derived from an energy balance (it is for simplicity assumed that the heat
transfer through the walls is zero, i.e. U = 0, see the front panel of the simulator):

1 di 4 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/gain_scheduling/index.php

(1) d(crVT1)/dt = cw(Tin - T1) + P

where the power P [W] is given by

P = KP*u

where u [%] is the control signal.

T1 is the temperature of the liquid in the tank assuming homogenous conditions. In practice there is
a time delay t in the response in the temperature sensor relative to an excitation in the supplied
power P. Thus,

(2) T(t) = T1(t-tau)

We assume that the time delay is inversely proportional to the mass flow w:

(3) tau = Ktau/w

The nominal operating point

The nominal operating point is charactericed as follows:

The tank temperature T is 50 degrees C,


The inlet flow temperature Tin is 20 degrees C.

The controller

In the simulator the gain scheduling PID controller of the PID Control Toolset in LabVIEW is used.
In this controller a piecewise constant interpolation is used between the different PID parameter
sets. In each interval the PID parameter values are held constant at a conservative value, which
implies that the stability is ensured during the interval.

Aims
The aims of the tasks below are as follows:

To demonstrate that the dynamics of a process may vary with process parameter value, here:
the mass flow through the system.
To calculate proper PID settings for various mass flows, to be used in a gain scheduled PID
controller
To observe the benefits of gain scheduling (i.e. an adaptive controller) compared to a
controller with fixed parameter values.

Motivation
Gain scheduling is an important practical way to implement an adaptive PID controller, which
means that the controller is continuously adapted to the process it controls. Gain scheduling is
available in many commercial PID controllers.

A typical kind of processes which may require gain scheduling (i.e. controller adaptivity) is
processes with varying mass flow, as in the present simulator. Concrete examples of such processes
are heat exchangers and continuous reactors being in a process line with varying production rate.

2 di 4 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/gain_scheduling/index.php

Tasks
1. Varying process dynamics:
a. From the model equations (1), (2) and (3) above, derive the transfer function HP(s)
from the control signal u [%] to the temperature T. This transfer function becomes of
first order with time delay. Show that the transfer function has the following
parameters:

(4) gain Ku = KP/(cw)

(5) time constant Tc = rV/w

(6) time delay tau = Ktau/w

Thus, the process dynamics varies with the mass flow w.

b. Run simulations to demonstrate that Ku, Tc and t depends on the mass flow w as found
in Task a above. Qualitative resultes are sufficient (thus, you are not expected to
calculate the values of the gain, time constant and time delay for different values of w).
(Tips for the simulations: Set the controller in manual mode. Change the supplied
power as a step from the value, P0 (found experimentally, although you may calculate
it from the model), which keeps the process at the operating point, and observe the
response in the tank temperature.

2. PID controller with fixed parameters:


a. Controller tuning: Find proper PID settings for w = 20 (using e.g. the Ziegler-
Nichols' closed loop method). Alternatively you can use the parameter values shown
on the front panel of the simulator.
b. The dynamic behaviour of the control system when the process dynamics varies:
Reduce the mass flow w to its smallest value (12 kg/min). How does the process
parameters K, Tc and tau vary (the values are calculated and shown on the front panel
of the simulator)? Is the stability of the control system still satisfactory? Does it seem
to be need to adjust the PID settings as a function of w?
c. Choosing mass flow for conservative controller tuning: By conservative controller
tuning is meant that the control system is guaranteed to not have bad stability. Which
value of the mass flow w should be chosen for conservative controller tuning? (You do
not have to run simulations to give an answer..)

3. Gain scheduling (adaptive) PID controller:


a. Controller tuning: Tune the PID controller (using e.g. the Ziegler-Nichols' closed
loop method) for the following three w values: 16, 20 and 24 kg/min. Alternatively you
can use the PID settings shown on the the front panel of the simulator. The above
mentioned w values are used as the gain scheduling parameter P, see the front panel of
the simulator.
b. The dynamic behaviour of the control system when the process dynamics varies:
Use a gain scheduling PID controller. First, set the mass flow w at its maximum value,
24 kg/min, and let the controller system stabilize for this w value. Then, reduce the w
value to 12 kg/min. This reduction may be in the form of three stepwise changes as

3 di 4 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/gain_scheduling/index.php

follows: From 24 to 20, from 20 to 16, from 16 to 12). Observe that both the process
parameters and the controller parameters varies. Is the stability of the control system
satisfactory for any mass flow? Is gain sheduling (adaptivity) beneficial compared to
using a controller with fixed settings, cf. Taks 2 above?

[SimView] [TechTeach]

Updated 19. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

4 di 4 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/quality_flow_control/index.php

Control of Product Quality and Flow


Incuding Ratio Control
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: quality_flow_control.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the simulated system


A process in the form of a tank blending cold and hot water is simulated. The product flow Fp and
the product quality, which is here assumed to be the product temperature Tp, are controlled by
adjusting or manipulating two feed flows, namely the cold water flow Fc and the hot water flow Fh.
Fc is manipulated directly by a flow controller, while Fh is manipulated using ratio control where
the ratio Kf is the ratio between the cold water flow and the hot water flow, i.e., Kf = Fh/Fc.

In the simulator Fp and Tp can be controlled manually by manipulating Fc and Kf. They can also

1 di 3 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/quality_flow_control/index.php

be controlled automatically using feedback from measured Fp and Tp and using Fc and Kf as
control (or manipulating) variables.

Aim
The aim of this simulator is to get knowledge about controlling flow and quality of a simple, yet
representative, industrial process, and to experience the benefits of using feedback control in stead
of an open loop control strategy.

Motivation
The process in this simulator is in many aspects similar to industrial processes as combustion
processes and reactors which can be controlled analogously.

Tasks
In the text below values are given without any specific unit. You may however assume that the unit
is percent corresponding to some transformation from physical units as degrees C or kg/min to
percent. The time unit may be interpreted as minutes.

1. Closed loop control (automatic control) of Fp and Tp:


a. Ensure that the FC controller and the T controller are set in automatic mode (this is
happenig automatically by selecting "external setpoint " for Fc and Kf). What is the
static control error for Fp and for Tp?
b. Change the setpoint of Fp and for Tp (select the new values yourself). Is the feedback
control system capable to bring the control error to zero?
c. The controllers TC, FCc og FCh have been tuned from the rule that the integral time of
the controller is set equal to the time constant of the controlled process, while the
control gains are given values giving proper stability of the control loops. For the
controller FC the integral time is set to 1 (which is slightly larger than the sum of the
time constants of the cold water tank and the hot water valve). Play with the PI
parameter values, and observe effects. Particularly try to obtain faster control of Tp.

2. Open loop control of Fp and Tp:


a. On the front panel of the simulator are shown formulas for calculation of Fc and Kf
(=Fc/Fh). Now, derive these formulas from a static energy balance. These values of Fc
and Kf may be used in open loop control of the product flow Fp and the product
temperature Tp using the cold water feed flow as one control variable and the hot
water flow as the other. (You may assume homogeneous conditions in the tank when
you put up the energy balance.)
b. Start the simulator. Select "local setpoint" of Fc and Kf. Ensure that the FC controller
and the TC controller are set in manual mode (this will actually happen automatically
by selecting local setpoints of Fc and Kf).

Assume that Fp should have value 60 and that Tp should have value 45. Tc is assumed
to be 30, and Tv is assumed to be 70. What are the corresponding values of Fc and Kf?
(The simulator calculate these values.) Use these values as setpoint values Fc,SP and
Kf,SP for Fc,SP,local and Kf_SP_local. What is the static (steady state) control error for Fp
and for Tp?

c. Repeat task 1b, but now include model errors by setting Tc_error equal to 10. What is

2 di 3 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/quality_flow_control/index.php

now the static control errors of Fp and Tp?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/multivariable_control/index.php

Multivariable Control Using Linear


Decoupling
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: multivariable_control.exe . The simulator runs immediately after the
download by clicking Open in the download window. Alternatively, you can first save a copy
of the exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


I this simulator a 2x2 multivariable system represented by a model consisting of 4 transfer
functions - one in each of the 4 couplings between the 2 control variables and the 2 output
variables. Each of the transfer functions is a "first order with time delay":

yi(s)/uj(s) = Hij(s) = Kij(e-tijs)/[(Tijs + 1)]

Aim
The aims of this simulator is to give an understanding of the dynamics of a multivariable process,
to give experience with controller tuning, and to observe the benefits of using decoupling.

1 di 3 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/multivariable_control/index.php

Motivation
Multivariable processes may be difficult to control due to cross couplings in the process, which
causes interaction between the control loops. The PID controller tuning shoould follow certain
procedures. Using a decoupler between the PID controllers and the process may give better control.
Linear decouplers are available in some commercial control systems.

Tasks
1. Configuring a process without cross couplings:
a. Choose parameter values of the process transfer functions (but you may keep the
default values), but it is required in this subtask that the process has no cross couplings.
b. Verify the process dynamics (as expresses by the transfer functions) by running some
setp response tests (steps in the control variables with the controllers in manual mode).
In particular, verify that there are no cross couplings in the process.

2. Controlling a process which does not have cross couplings:


a. Tune the PID controllers.
b. Show (using simulations) that there the control loops does not interact.

3. Single loop control of a process which has cross couplings:


a. Choose process parameters so that the process has cross couplings (in both directions),
e.g. K12 = K21 = 0.5, and time delays equal to 0.5, and time constants equal to 1.
Verify (using simulations) that there are cross couplings in the process.
b. Keep the the PID settings from task 1.
i. Verify (using simulations) that there are interactions between the control loops.
ii. What happens to the stability of the control system if the cross couplings
becomes stronger (you can increase the proper gains)? Adjust the PID
parameters so that the stability again is acceptable.
iii. Tune the PID controller using the following procedure:

(1) Tune the controller in each of the loops in turn with all the other controllers
in manual mode. (2): Close all the loops (set all controllers in automatic mode).
(3) If there are stability problems, reduce the gain and/or increase the integral
time of the controllers in the least important loops.

4. Control based on decoupling:

Keep the process parameter values from Task 3 above.

a. Find a decoupler for the process (calculate the parameters of the transfer functions in
the decoupler from the process model). Show (using simulations) that the decoupling
works (run step response tests of the process, with the controllers in manual mode).
b. Tune the PID controllers for the process including the decoupler. Show (using
simulations) that there is no interaction between the control loops. (Note: You may
observe a steady state control error even though there is integral action on the
controllers. This may stem from saturation in the control signal as it tries to

2 di 3 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/multivariable_control/index.php

compensate for the disturbance which the cross couplings represents.)

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/smith_predictor/index.php

Smith Predictor
(Dead-Time Compensation)
Snapshot of a part of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: smith_predictor.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the system to be simulated


This simulator simulates a control system based on the Smith-predictor, which implemenets dead-
time compenastion. The process to be controlled is given as a transfer function model of the form
"first order system with dead-time". For clear comparison a traditional single-loop control system
for an identical process is simulated in parallell.

The Smith-predictor contains a PID-controller. In the simulator there is support for tuning this
controller as a PI-controller based on pole-placement design [cf. Ch. 8 in PID Control (to appear
during Summer 2004)].

In the simulator the PI(D)-controller in the traditional single-loop control system can be tuned as a
PI-controller using Skogestad's method of PID-tuning [cf. Ch. 8 in PID Control (to appear during
Summer 2004)].

Aim

1 di 2 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/smith_predictor/index.php

To see the benefits and drawbacks of using Smith-predictor to control processes having dead-time
compared to using ordinary single-loop control.

Motivation
Some industrial processes has a dominating dead-time, e.g. transportation processes. Using
ordinary single-loop PID control the dead-time forces the bandwidth of the control system to be
relatively low. If the dead-time can not be reduced, usning a Smith-predictor may be beneficial both
for tracking control purposes and disturbance compensation purposes.

Tasks
If nothing else is stated, you should use the default values of the parameters (in general, the default
value is retrieved using right-click in the element on the front panel of the simulator).

1. Assuming perfect process model: Use the following parameters in both the process model
and the process model usind internally in the Smith predictor: Ku = 1 = Kv, T = 0.5 sec and
tau = 2 sec (relatively large dead-time). Thus, there is no model errors in this case.
a. Tune the PI controller in the Smith-predictor and the PI controller in the traditional
single-loop control system. (Alternatively, you can use the following parameters:
Smith-predictor: Kp = 1.4 and Ti = 0.17. Traditional single-loop control system: Kp =
0.17 and Ti = 0.50.)
b. Check (using simulations) if the tracking properties and the distrurbance compensation
properties are better with the Smith-predictor than with traditional single-loop control
system. In the simulations you can apply setpoint steps and disturbance steps,
respectively.
2. Robustness of Smith-predictor against model errors: Use the same parameter values as in
Task 1, unless otherwise stated (below).
a. Increase the dead-time of the controlled process from 2.0 to 2.5 sec (without adjusting
any controller parameter). Is the Smith-predictor robust against this parameter change,
which introduces a model error. (Observe the stability of the control system). What
about the traditional control system - does it have greater robustness against the model
error?
b. Are the two stability of each of the two control systems robust against a reduction of
the dead-time from 2.0 to 1.5?
3. Improving the robstness of the Smith-predictor?:
a. Tune the PI controller in the Smith-predictor out from the following more careful or
conservative requirement: The relative damping factor, z, of the internal control loop in
the Smith-predictor is increased from 0.6 to 0.8, and, in addition, the natural resonance
frequency, w0, is reduced to the half, from 4 to 2 rad/s. (Alternatively, you can use the
following PI parameters in the Smith-predictor: Kp = 0.6 and Ti = 0.3 sec.)
b. Check if the robustness of the Smith-predictor is improved as compared to Task 2.

[SimView] [TechTeach]

Updated 21. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:23
TechTeach: SimView http://techteach.no/simview/freqanalysis_controlsys/index.php

FREQUENCY RESPONSE ANALYSIS OF


CONTROL SYSTEM
What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: Download the zip file freqanalysis_controlsys.zip, then extract both the
zipped files (lvalarms.dll and freqresp_consys.exe) to any folder, and then open or run
the freqresp_consys.exe to start the simulator.
A comment: This application has been developed using the new Control Design Toolkit
and the Simulation Module in LabVIEW.

Description of the simulated system


The control system of a process given by a transfer function model is simulated. You can adjust
the setpoint and the disturbance. The frequency response of the control system is shown in a
Bode diagram.

The controlled process

The process model which is controlled in this simulator can be chosen you. By default the
transfer function from control variable, u, to measurement signal, y, is a second order transfer
function with time-delay, with a disturbance, v, acting on the process at the same place
dynamically as the control variable. More specifically, the default process model is

y(s) = Hps(s)u(s) + Hps(s)v(s)

where

Hps(s) = [1/(s^2 + 2s + 1)]e-0.5s)

The nominal operating point

The nominal operating point is characterized as follows:

The process measurement ym is 50 (in a proper unit)


The disturbance is 10.
The nominal control signal, u0, which keeps the process in or close to the operating point,
is 40.

Controller function

The PID controller is on serial form, i.e. its transfer function is

Hc(s) = Kp [(1+Tis)(1+Tds)]/[Tis(Tfs+1)]

Aim

1 di 3 23/05/2019, 18:24
TechTeach: SimView http://techteach.no/simview/freqanalysis_controlsys/index.php

The aim of this simulator is to give practice in frequency response based analysis of feedback
control systems.

Motivation
The frequency response is a good tool for expressing the dynamic properties of a control
system, regarding setpoint tracking and disturbance compensation, and stability.

Tasks
In the tasks below it is assumed that the process is in the nominal operating point, which is
defined above.

1. Controller tuning:

Find proper PID settings using e.g. Ziegler-Nichols' closed-loop method (the sustained
oscillations method or the frequency response method).

Unless otherwise stated, it is assumed that you use a PID controller with these settings in
the tasks below.

2. Static setpoint tracking:


a. Characterize qualitatively the setpoint tracking property of the control system as
read off from both the tracking function and the sensitivity function.
b. Confirm the results in subtask a by running a simulation (apply steps in the
setpoint and the disturbance).

3. Dynamic setpoint tracking:


a. What is the -3dB bandwidth?
b. Run a proper simulation which hopefully confirms that the bandwidth is as found
in subtask a above.
c. Run simulations which demonstrate that the tracking is good "below" the
bandwidth, and poor above the bandwidth.
d. Assume the setpoint tracking response time Tr from the bandwidth. (The response
time is gthe 63% rise time of the step response, analog to the time constant of a
first order system.) Tr can be estimated as

Tr = 1.5/wb.

Compare with the response time as found from a simulation. Are the values
similar?

e. What is the bandwidth and the response time for a properly tuned PI controller?
Compare with the PID controller.

4. Static disturbance compensation:


a. Explain from the shape of |S| (sensitivity function) in a Bode plot why the control

2 di 3 23/05/2019, 18:24
TechTeach: SimView http://techteach.no/simview/freqanalysis_controlsys/index.php

system gives perfect static disturbance compensation.


b. Confirm the result in subtask a by running a proper simulation.

5. Dynamic disturbance compensation:


a. Let the setpoint be constant (50). Run the following two simulations with a
sinusoidal disturbance of frequency wv less than the bandwidth (e.g. 0.3rad/s): In
the first simulation the control loop shall be open (i.e. the controller is in manual
mode). In the second simulation the controller the control loop is closed (i.e. the
controller is in automatic modus). Calculate from the simulations the ratio of the
respective amplitudes in the response in ym. Is this ratio in accordance with the
|S(jw)| plot?
b. As in subtask a above, but the disturbance frequency shall now be larger than the
bandwidth (e.g. 5 rad/s).

6. Stability:
a. What are the stability margins (gain margin GM and phase margin PM) with the
PID controller (tuned in task 1)? Do they have proper values?
b.
i. Increase the controller gain Kp until the control system becomes marginally
stable as seen from the time response. (Keep this value Kp in the following
subtasks.)
ii. What does the tracking function |T| and the sensivity function |S| look like
(at marginal stability)?
iii. Read off the amplitude crossover frequency and the phase crossover
frequency. Do they have equal values?
iv. Calculate the period of the time response from the wc value. Confirm the
result by a simulation.
v.
c. Reset the PID controller to proper settings (as found in task 1).
i. Increase the controller gain Kp until the control system gets poor stability.
How are the |T| and |S| curves changed? (Then reset Kp.)
ii. Increase the process time delay until the control system gets poor stability.
How are the |T| and |S| curves changed?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:24
TechTeach: SimView http://techteach.no/simview/logics/index.php

Logical Functions
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: logics.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


Four different simple logic (boolean) systems are simulated. The user can set the switches in
off- or on-position (input signal), and a lamp (output signal) is lit or not dependent on the logic
function between the inputs and the output.

Aim
The aim is to understand the fundamental logic functions.

1 di 2 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/logics/index.php

Motivation
Logic control is important in most automation systems. Some examples:

The motor is stopped when the traversal crane has reached its end position.
The lamp is lit when the switch is turned on.
The valve is closed when the specified water level has been reached.

If you are to develop a logic control system you must master the fundamental logic functions.

Tasks
Find the logic function implemented in each of the different systems in the simulator.

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/sequential_control/index.php

Sequential Control of a Batch Process


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: sequential_control.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


This simulator simulates a sequential control system for a simple batch process. A tank is filled
with water. The water is then heated and stirred, and finally the heated water is discharged from
ther tank.

The simulator is based on the following mathematical model of the process (the individual
parameters are defined on the front panel of the simulator):

dh/dt=(1/rho)*(1/A)*[K_in*u_valve_in-K_out*u_valve_out]

which is based on mass balance, and

dT/dt=[1/(c*rho*A*h)]*[K_heat*u_heat+(T_in-T)*c*w_in+(T_env-T)*U]

which is based on energy balance. There is a time-delay in the temperature measurement.

A stirring motor is controlled by the control signal

1 di 3 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/sequential_control/index.php

u_motor

The motor is assumed to ensure homogenuous thermal conditions in the water in the tank.

The control signals are

u_valve_in (boolean, i.e. having value TRUE or FALSE, or ON or OFF)

u_valve_out (boolean)

u_motor (boolean)

u_heat (continuous having any value between 0% and 100%)

The measurements are

Temperature T of the water in the tank

Level h of the water in the tank

Aim
The aim of the tasks below is to develop a better understanding of sequential control, and using a
state diagram.

Motivation
Sequential control is crucial in many control applications, as in chemical batch processes.

A sequential control procedure can be represented graphically by one of the following two
methods:

A state diagram
A sequential function chart (SFC)

State diagrams and SFC are quite similar, as they have the same basic elements:

States with actions to be executed when the state is active


Transitions from one active state to another taking place if the transition condition is
logically true.

Controllers can be implemented using graphical programming of state diagrams or SFCs in proper
programming tools. For example, state diagrams are supported by the State Diagram Toolkit in
LabVIEW, and HiGraph in the Step 7 programming tools of Simatic PLCs, while SFC is supported
by the GX IEC Developer programming tool of Mitsubishi FX2N PLCs.

Tasks
1. Run the simulator, and make sure you understand how the control system works.
2. Draw a detailed SFC of the sequential control system (draw without looking at the SFC
available from the front panel of the simulator). The actions in every state must be defined,
and the transition conditions in every transition must be defined. For your information:
Introduction to state diagrams.

2 di 3 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/sequential_control/index.php

[SimView] [TechTeach]

Updated 27 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/kalmanfilter/index.php

Kalman Filter
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: kalmanfilter.zip (unzip, and open kalmanfilter.exe).

Aims
The aim of this simulator is to show how a Kalman Filter can be used to continuously estimate the
value of an unknown process variable. The typical trade-off is demonstrated: You can not have both
fast estimate update and noise-attenuated estimates, i.e. you have to choose to emphasize either of
them.

Motivation
The Kalman Filter is a generic algorithm for estimating process variables, assuming that you have a
mathematical model of the process (a set of differential equations) and that there is at least one
variable that is continuously measured. The Kalman Filter is used in a large variety of applications
- in control applications where the controller uses estimates as if they were real measurements and

1 di 2 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/kalmanfilter/index.php

in supervisory systems (as "soft-sensors").

Description of the simulated system


The process is a water tank with inflow and outflow. The level is maintained at or close to a level
setpoint by a level controller which controls the inflow. The outflow, which is regarded as a
disturbance to the process, can be adjusted freely by the user. A Kalman Filter is used to estimate
the assumed unknown outflow. Detailes about the model and the Kalman Filter are described in
kalmanfilter.pdf.

Tasks
1. Change the outflow Fout arbitrarily, but keep it constant for a while, too. Is the Kalman Filter
able to estimate Fout correctly in steady-state?

2. In an attempt to make the estimate converge faster to the real value, the assumed process
disturbance variance Q22 of state x2 (which is the outflow) can be increased. What is the impact on
the state-estimate (benefit and drawback)? Simultaneously, observe how the Kalman Gain K21 is
changed accordingly. Does this change of K21 make sense?

3. Also the assumed measurement variance R influences the state-estimates. Descrease R. What is
the impact on the state-estimate (benefit and drawback)? Simultaneously, observe how the Kalman
Gains K21 are changed accordingly. Does these changes of make sense?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/signal_types/index.php

Signal Types
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: signal_types.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Introduction
When you are to analyze dynamic systems (e.g. control systems, motors, thermal processes,
signal filters), you may excite the system with some signal. This simulator realizes the most
common test signals:

Square pulse, which is an appoximation to an impulse


Step, which is the most commonly used signal
Ramp
Sinusoid, which is used in frequency response analysis

In practice the test signal is overlayed (added to) a constant, which is denoted bias or DC
component (direct current).

Tasks
1. Square pulse: Ideally an impulse is a signal of infinite amplitude and zero duration but

1 di 2 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/signal_types/index.php

with a finite area men A under the signal curve. The area is also denoted the strength of
the impulse. If we assume that the impulse comes at time t0 and that it has bias B, it can
be expressed as follows:

y(t) = Ad(t - t0) + B

An ideal impulse can not be realized fully. An approximation is a square pulse having
amplitude or height H and duration dt. The area of this signal is A = H*dt.

Task: Run the simulator. Select signal type "Square pulse". Observe how the signal
depends on H, dt, and B, and time t0.

2. Step: A step is given by

y(t) = US(t - t0) + B

where U is the step amplitude or step height, and B is the bias. t0 is the step time. S(t) is
the unit step function, having amplitude 1.

Task: Select signal type "Step". Observe how the signal depends on U, B and t0.

3. Ramp: A ramp is given by

y(t) = KR(t - t0) + B

where K is the slope. B is the bias. t0 is the starting time. R(t) is a unit ramp, having slope
1, and starting at t = 0.

Task: Select signal type "Ramp". Observe the signal depends on K, B and t0.

4. Sinusoid: A sinusoid is given by

y(t) = Asin(wt) = Asin(2p f t) + B

where A is the amplitude, w is the frequency in rad/s, f is the frequency in Hertz and B is
the bias. The period of the signal is

Tp = 1/f [sec]

Task: Select signal type "Sinus".

a. Observe how the signal depends on A, f and B.


b. Select one specific f value, and verify that the period actually is 1/f.

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:25
TechTeach: SimView http://techteach.no/simview/noise_white_coloured/index.php

White and Coloured Noise


Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: noise_white_coloured.exe . The simulator runs immediately after the
download by clicking Open in the download window. Alternatively, you can first save a
copy of the exe-file on any directory (folder) on your PC and then run the exe-file, which
starts the simulator.

Description of the simulated system


A noise signal, v(k), being a uniformly distributed random signal is generated. Thus, v is white
noise, which means it varies principally completely randomly between the samples. This signal
is sent to the following discrete-time signal filter - also denoted shaping filter:

x(k) = a*x(k-1) + K*v(k)

where a is a filter parameter and K is a gain. With a = 0, the filter output signal, x, is also white
noise. With parameter between 0 and 1, x becomes coloured noise, which means it does not

1 di 2 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/noise_white_coloured/index.php

vary completely randomly between the samples. The autocorrelation of x, Rxx(L), is plotted. L
is the lag parameter. Rxx(L) shows the "colour" of x.

Aims
To see typical plots of white noise and coloured noise.
To observe how the autocorrelation function expresses the "colourness" of a signal.

Motivation
White noise and coloured noise are important signals in stochastic systems. For example, in
applications as minimum variance optimal control and in state estimation using a Kalman filter
the noise signals acting on the system (for control or estimation) are assumed to be white. If the
noise is coloured, it can be regarded as the output of a dynamic signal filter typically called a
shaping filter.

Tasks
1. White noise: Set parameter a = 0, causing x to be white noise. Also set the gain K = 1.
a. Observe the signal x. Can you clearly see the random characteristics of the signal?
b. Observe the autocorrelation Rxx(L). For ideal white noise the normalized Rxx(L) is
1 for lag L = 0, and 0 for other values of L. Why does the autocorrelation of x
differ from the ideal form of Rxx(L).
2. Coloured noise:
a. Initially, set a = 0. Also set the gain K = 1.
b. Increase the parameter a continuously. Observe how the shape of the signal x
changes. Does it become less random? Explain thsi from the shaping filter model.
Simultaneously, observe the autocorrelation Rxx(L). How does its shape change as
parameter a increases? Explain!

[SimView] [TechTeach]

Updated 19. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/signal_quantizer/index.php

Signal Quantizer
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: signal_quantizer.exe . The simulator runs immediately after the download
by clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the simulated system


In this simulator the sampling of an analog, continuous-time signal by an AD converter
(analog-digital) is simulated.

When an analog, continuous-time signal y(t) of signal range [Ymin, Ymax] is sampled by an AD
(analog-digital) converter of n bits: bn-1, bn,..., b1, b0, the resolution, i.e. the maximum signal
range represented by the LSB (least significant bit), is

q = (Ymax - Ymin)/(2n - 1)

Example: Given a signal y between Ymax = 100% and Ymin = 0% which is sampled using a 8

1 di 2 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/signal_quantizer/index.php

bit AD converter. The resolution is

q = (Ymax - Ymin)/(2n - 1)
= (100% - 0%)/(28 - 1)
= 100%/255
= 0.392 %

Aim
The aim of the tasks below is to give an understanding of how the sampled (discrete-time
signal) depends on the number of bits in the AD converter.

Motivation
Sampling av continuous-time signals takes place in all applications where a computer is used to
read measurement data. It is important to be able to calculate the resolution of the digital signal
generated by the AD converter to decide if the accuracy is acceptable.

Tasks
1. Change the input signal u, and observe how the resolution of the digital signal depends
on the number of bits n. You can select n between 2 and 12.
2. There will be a difference between the analog signal and the digital (sampled) signal.
What is the maximum value of this difference? Verify the result by running a proper
simulation.

[SimView] [TechTeach]

Updated 21. January 2008. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/aliasing/index.php

Aliasing at Sampling
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: aliasing.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the
exe-file on any directory (folder) on your PC and then run the exe-file, which starts the
simulator.

Description of the system to be simulated


Sampling of sinusoid, x(t), is simulated. The sampling results the discrete-time signal xs(k)
where k is a time index (number of samples). Both signals are plotted simultaneously. You can
adjust both the signal frequency and the signal frequency.

1 di 3 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/aliasing/index.php

Aim
The aim is to develop an understanding of the aliasing phenomenon.

Motivation
Sampling av continuous-time signals takes place in all applications where a computer is used to
read measurement data. If the sampling rate is too low compared to the frequency of the signal
to be sampled, aliasing occurs. Aliasing means that the discrete-time signal gets a lower
frequency than the original signal. Obviously, sampling can cause problems in applications, e.g.
in audio applications.

Theory
Given a continuous-time signal, x(t), of frequency fcont [Hz] which is sampled with sampling
frequency fs [Hz]. The Nyquist frequency fN is defined as half of the sampling frequency:

fN = fs/2

It ca be shown that if the signal frequency fcont is larger than fN, there is aliasing, which implies
that the resulting discrete-time signal, xs, gets a frequency, fdisc, which is smaller than the signal
frequency fcont. Figure 1 shows the relation between fdisc and fcont.

Figure 1

From the figure one observation is that fdisc is equal to the difference fs - fcont if fcont is
between fN and fs.

Tasks
1. Select fcont and fs so that there is no aliasing (cf. Figure 1). Run the simulator. Is it
confirm that there is no aliasing?
2. Select fcont and fs so that there is aliasing (e.g. fcont = 0.5 and fs = 0.6 Hz), cf. Figure 1.
Calculate from Figure 1 the resulting frequency fdisc (of the discrete-time signal). Run the
simulator. Do you observe aliasing? If so, what is the frequency fdisc? Is the observation
in accordance with the calculation?
3. What is fdisc if fcont is equal to the Nyquist frequency? Run the simulator. Is the result

2 di 3 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/aliasing/index.php

confirmed?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/lowpass_filter/index.php

Lowpass Filter
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: lowpass_filter.zip (unzip, and open lowpass_filter.exe)

Aims
The aims of this simulator are:

Demonstrate how a time-constant filter attenuates sinusoidal signals (noise)


Demonstrate how a time-constant filter attenuates random signal (random noise)

Motivation
Lowpass filters are frequently needed in practical application based in some processing of
measurements. This is because all practical measurements are noisy. Typically the noise is
approximately a random signal. The filter is used to attenuate the noise.

One very important application is in a control system. The process measurement (temperature,
level, pressure, speed etc.) always contains some noise. If the noise is not attenuated it will
propagate through the controller and cause abrupt (noisy) variations in the control signal, causing

1 di 4 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/lowpass_filter/index.php

excessive wear of the actuator (pump, valve, motor).

The filter algorithm given above is relatively simple, but still it is probably the most commonly
used filter algorithm in practical application.

Description of the system that is simulated


Input signals to the filter

A discrete-time first order filter is simulated. The input signal to the filter consists of three additive
terms:

A sinusoidal signal
A random signal (white noise)
A constant (or bias)

Each of these signals can be deactivated (removed). The (total) input and the output signals are
plotted in real time in a chart. Also, the amplitude gain plot (Bode plot) of the filter is plotted.

The filter function

The filter is a discretized version of a continuous-time time-constant filter given by the following
s-transfer function:

H(s) = Y(s)/U(s) = 1/(Tfs+1)

The user can select the following filter parameters:

The filter time-constant, Tf [s]


The filter (and the simulator) time-step, h [s]

The filter algorithm that is implemented in the simulator is given by the following difference
equation:

y(tk) = (1-a)*y(tk-1) + a*u(tk) (Eq. 1)

where tk is the discrete point of time at time index k. Hence, tk-1 means the previous discrete point
of time. y is the filter output, and u is the filter input.

In general the filter parameter a can be set directly. In this simulator Eq. 1 is developed by
discretizing a continuous-time filter. The derivation is shown in detail in filter_algorithm.pdf. There
it is shown that

a = h/(Tf + h) (Eq. 2)

For the filter given by Eq. 1 to be stable, a must be between 0 and 1.

Frequency response

The amplitude gain of the frequency response of a filter expresses how a sinusoid is attenuated
through the filter. In the simulator the amplitude gain of the filter is plotted. The amplitude gain is
calculated from the z-transfer function of Eq. 1. This transfer function found by taking the
z-transform of Eq. 1, and it is

2 di 4 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/lowpass_filter/index.php

Hf(z) = Y(z)/U(z) = az/[z-(1-a)] (Eq. 3)

The amplitude gain is calculated as the absolute value of Hf(z) when z = ejwh where w is the
frequency [rad/s] and h [s] is the sampling interval. j is the imaginary unit. In the simulator the
Bode.vi function in LabVIEW is used to calculate and plot the amplitude gain in a Bode diagram.

The relation beween the time-constant Tf and the filter bandwidth fb [Hz] for Hf(z) is rather
complicated. However, if the sampling time h is relatively small (less than 1/5 of Tf) the following
relation holds (approximately):

fb [Hz] ~ 1/(2*pi*Tf) (Eq. 4)

How random noise is propagated through the filter

It is useful to know how the filter attenuates random noise. The attenuation can be expressed as the
ratio between the standard deviation of the filter output and the standard deviation of the filter
input, hence "standard deviation gain", Ksigma (sigma is the greek character symbol for standard
deviation). In random_noise_attenuation.pdf it is shown that

Ksigma = sqrt(a/(2-a)) (Eq. 5)

where a is given by Eq. 2.

Tasks
1. Manually adjusted input: The only input in this subtask is u3 (hence set the amplitude of
the sinusoid to zero and the amplitude of the random noise to zero). Adjust u3 arbitrarily for
various time-constants Tf. How does the relation between the output and the input (u3)
depend on Tf? More specifically, is the filtering stronger or looser as Tf. is increased? In
particalular, what is the relation between the output and the input signal if the input signal is
constant?
2. Sinusoidal input: Set u3 (manual input) and u2 (random input) to zero. Set the amplitude of
the sinusoid to 1 and the frequency to (say) 0.2 Hz.
a. Observe how the amplitude attenuation through the filter depends (qualitatively) on Tf
by looking at the simulated responses. Is this observation in accordance with the
amplitude gain Bode?
b. Set Tf to one specific value, say 0.5 s. The corresponding bandwidth fb [Hz] of the
filter can be found by comparing the input and output signals. Find "experimentally"
the bandwidth by adjusting the frequency of the input signal so that the amplitude of
the output is 1/sqrt(2) = 71% of the amplitude of the input signal. Is this
"experimental" bandwidth in accordance with the theoretical bandwidth as given by
Eq. 4? Finally, is the experimental bandwidth in accordance with the bandwidth that
you can fins from the Bode plot?
3. Random input: Set u1 (sinusoid) and u2 (manual input) to zero. Set Tf to one specific
value, say 0.5 s. Set the maximum random amplitude B to 1.
a. Observe how the noise attenuation through the filter depends (qualitatively) on Tf by
looking at the simulated responses. Is the filtering (the attenuation or smoothing)
stronger with large Tf or with small Tf?
b. Assume that you want to find Tf so that Ksigma is 0.2, i.e. the filter attenuates the noise
5 times (with respect to the standard deviations, as explained above). Find Tf
experimentally so that Ksigma = 0.2. What is the theoretical Ksigma (it is caclulated and

3 di 4 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/lowpass_filter/index.php

displayed on the simulator)? Are these Ksigma values very different?


4. "Ideal" measurement signal plus random noise: Assume that the input to the filter
consists of a sum an "ideal" measurement signal and random noise. Is there any drawback of
having a filter with very strong filtering related to the transfer of the ideal measurement
signal through the filter? Demonstrate your answer by a proper simulation!

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

4 di 4 23/05/2019, 18:26
TechTeach: SimView http://techteach.no/simview/filters/index.php

Filter Types
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: filters.zip (unzip, and open filters.exe)

Description of the system to be simulated


This simulator simulates the following types of signal filters:

lowpass filter
highpass filter
bandstop filter
bandpass filter

You can select among these filter types. You can adjust the corner frequencies and the order while
the simulator runs. The input signal is a sinusoid of which you can adjuste the amplitude and the
frequency, and the filter response (output) is plotted in the same diagram. In addition the amplitude
gain function of the frequency response is plotted. In other words, both time domain and frequency
domain properties are shown.

1 di 3 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/filters/index.php

Aims
The aims of the tasks below are demonstrate characteristics of various filters by showing both time
domain and frequency domain properties.

Motivation
Filters are used to attenuate (ideally: remove) certain frequency commponents of a signal. For
example, lowpass filters are used to attenuate high frequent noise in a measurement signal.

Tasks
The tasks below assumes that the simulator runs. Initially, you can use the default choices for filter
topology, which is Butterworth, and the default choice of filter order. The input signal amplitude
can be set to U = 1.

1. Lowpass filter: The filter bandwidth or corner frequency can be set to fb = 100Hz.
a. Explain from the amplitude gain function A(f) that the filter performs lowpass
filtering.
b. Change the signal freqency f continuously. Does the time response confirm the
lowpass characteristic of the filter (qualitatively)?
c. Set the signal freqency to a fixed value, e.g. f = 100Hz. What is the amplitude gain at
this frequency as seen in the Bode plot? Is this result confirmed by the time response?
d. Select a filter order larger than the default value. How does the filtering properties
depend on the filter order (observe both the amplitude function and the time response).

2. Highpass filter: Set the filter corner frequency to fc = 100Hz.


a. Explain from the amplitude function A(f) that the filter performs highpass filtering.
b. Change the signal freqency f continuously. Does the time response confirm the
highpass characteristic of the filter (qualitatively)?
c. Select a filter order larger than the default value. How does the filtering properties
depend on the filter order (observe both the amplitude function and the time response).

3. Bandstop filter: Set the lower corner frequency to 100Hz and the upper corner frequency to
400Hz.
a. Explain from the amplitude function A(f) that the filter performs bandstop filtering.
b. Change the signal freqency f continuously. Does the time response confirm the
bandpass characteristic of the filter (qualitatively)?
c. Select a filter order larger than the default value. How does the filtering properties
depend on the filter order (observe both the amplitude function and the time response).

4. Bandpass filter: Set the lower corner frequency to 100Hz and the upper frequency to 400Hz.
a. Explain from the amplitude gain function A(f) that the filter performs bandstop
filtering.
b. Change the signal freqency f continuously. Does the time response confirm the
bandpass characteristic of the filter (qualitatively)?

2 di 3 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/filters/index.php

c. Select a filter order larger than the default value. How does the filtering properties
depend on the filter order (observe both the amplitude function and the time response).

[SimView] [TechTeach]

Updated 27 August 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/spectral_analysis/index.php

Spectral Analysis
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: spectral_analysis.zip (unzip, and open spectral_analysis.exe)

Description of the simulated system


There are several functions or algorithms for calculation of spectral information. One widely
used function is the power spectral density (PSD), which is the square of the mean absolute
value of the discrete-time Fourier transform (DFT) of the signal:

PSDx(f) = (|DFTx|/N)2

where f is the frequency in Hz. f is actually a discrete frequency given by

fk = df*k

1 di 3 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/spectral_analysis/index.php

where k is a frequency index: k = 0,..,N-1, where N is the number of samples of the time series
(signal) x. The frequency resolution or frequency increment df is

df = fs/N

where fs is the sampling frequency [Hz] given by

fs = 1/Ts

where Ts is the sampling interval.

PSD (and DFT) gives spectral information only for the frequency range from 0 up to the
Nyquist frequency fN defined as half the sampling frequency:

fN = fs/2

PSD also gives spectral information in the frequency range larger than fN, i.e. from fN to fs, but
this information is equal to the spectral information for the frequency range from 0 to fN - but
mirrored.

Since DFT, and hence the PSD, is calculated from a number of samples of the signal x random
noise in the signal is averaged, and hence the effect of such noise on the calculation of PSD is
averaged (out). This implies that the PSD is able to show the spectral contents of very noisy
signals.

In the simulator the signal x for which the PSD is calculated, is a sum of the following four
signals: Two sinusoids, x1 and x2, a uniformly distributed random signal r, and a bias (constant
signal) of value B:

x = x1 + x2 + r + B

The random component may represent measurement noise.

What is the PSD of a sinusoid and of a constant signal (both are components of the signal x
used in the simulator)? It can be shown that a sinusoid of amplitude A and frequency f1 have
PSD of value

A2/4

at the frequency f1 (and the same value at the mirrored frequency fs - f1), and zero PSD at other
frequencies. This can be used to calculate the amplitude and the frequency of an assumed
sinusoid. Thus, a sinusoid appears as a spike at frequency f1 in a PSD plot).

It can also be shown that a constant signal of value B has PSD value B2 at frequency 0 and PSD
value 0 at other frequencies.

In the simulator PSD is calculated using the LabVIEW function Power Spectrum PtByPt
(Point-by-point).

Motivation
Spectral analysis is used to show the frequency - or spectral - contents of a signal. One
important appliaction is detection of vibrations of machine bearings.

2 di 3 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/spectral_analysis/index.php

Tasks
Run the simulator. Unless otherwise stated the random signal r can be suppressed (by setting
the maximum amplitude R equal to 0). Also the bias can be suppressed (with B = 0).

1. Detection of freuqncy components: Choose by yourself the amplitude and the


frequency of each of the two sinusoidal signal components. Are these two components
indicated clearly by the PSD plot? What are the frequecies and amplitudes as seen from
the PSD plot? Are the PSD results correct?

2. Detection of a bias (constant signal): Select a value of B different from zero, e.g. B =
0.5. Is the bias indicated by the PSD plot? Does the PSD plot give correct information
about the B value?

3. The impact of random noise: As Task 1, but add a significant (large) noise component,
r. For example, you can set R equal to the largest amplitude of the two sinusoids (you can
choose these amplitudes yourself). Is the PSD plot able to detect the two sinusoids? How
does the ability of the PSD for expressing the frequency components depend on the
number of samples, N?

4. Note: Aliasing! As you probably know, cf. the aliasing simulator a signal of frequency
fsignal larger than the Nyquist frequency is aliased to a frequency falias which is equal to
the difference between the signal frequency fsignal and the sampling frequency fs, i.e.

falias = fs - fsignal

If the PSD is calculated from the resulting (aliased) signal the PSD will of course indicate
the frequency of this signal, and not the frequency of the original signal.

Let the signal x1 have frequency 8Hz (you can suppress the signals x2 and r and also the
bias). Set the sampling frequency to 10Hz (i.e. the sampling interval is 0.1s). According
to the facts presented above (in this subtask), what is the falias? Is this result confirmed by
the PSD plot?

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

3 di 3 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/correlation/index.php

Correlation
Snapshot of the front panel of the simulator:

What is needed to run the the simulator? Read to get most recent information!
Tips for using the simulator.
The simulator: correlation.exe . The simulator runs immediately after the download by
clicking Open in the download window. Alternatively, you can first save a copy of the exe-
file on any directory (folder) on your PC and then run the exe-file, which starts the simulator.

Description of the system to be simulated


The user can generate a signal x(n) as sum of a constant (or bias) and a random signal. The auto
correlation of x(n) is calculated in real time based on a number of samples (of historical data)
defined by the user.

The user can also introduce a lag L [samples] between signals. The cross correlation of the signal
and the delayed signal is computed.

Aims

1 di 2 23/05/2019, 18:27
TechTeach: SimView http://techteach.no/simview/correlation/index.php

The aims of this simulator is as follows:

How the correlation function works


How the correlation function represents random signals
How the cross correlation function represents a time delay between random signals

Motivation
The autocorrelation of a signal can be used to express the random character of a signal.

The cross correlation can be used to detect a time delay between two signals.

Tasks
Initially, choose

non-normalized correlation
zero lag between the signals (time series)

1. Auto correlation of a constant signal: Let x(n) be a constant.


a. Use a non-normalized correlation function. What is the value of the correlation Rx(0)?
Could you have calculated Rx(0) in advance?
b. Can you from the shown Rx(L) in the simulator determine which kind of correlation
the correlation function implemented in LabVIEW implements? (Is there avaraging,
i.e. division by number of samples N? Is there a compensation in the correlation
function for large L-values?)

2. Auto correlation of a random signal: Let x(n) be a pure random signal with zero mean.
a. Does the form of the correlation function Rx(L) indicate that the signal is ransom (with
zero bias)?
b. Use a normalized correlation function Rx. Describe the difference between this Rx and
the non-normalized correlation?
c. Does Rx clearly express the dandomness of a signal if the number of samples of the
signal of which the correlation function is calculated, is small?
d. Select non-normalized correlation. Read off the energy of x from the correlation
function.

3. Correlation of lagged random signals: Let x(n) be a random signal with zero mean.
Introduce some lag in the signal. Use non-normalized correlation. The correlation is now
being calculated between x(n) and x(n-L).
a. In which way is the lag expressed by the correlation function? (You may try with
different lags.)

[SimView] [TechTeach]

Updated 2 September 2017. Developed by Finn Haugen. E-mail: finn@techteach.no.

2 di 2 23/05/2019, 18:27

Вам также может понравиться