Packge that contains a list of control oriented examples
Information
Description
This sub-package contains various examples that show the usage of the library blocks.
Extends from IndustrialControlSystems.Icons.ExamplesPackage (Examples package icon).
Package Content
PID control of typical processes
Information
Description
In this examples the typical processes (contained in model
TypicalTF )
are controlled with PID regulators.
Process Trasfer function
Integrator |
Y(s) 1
---- = -----
U(s) 5s
|
Controller parameters
Parameter | Value |
Kp | 100 |
Ti | 1 |
Td | 0.1 |
N | 10 |
b | 1 |
c | 1 |

Process Trasfer function
Integrator + delay |
Y(s) 1 -1s
---- = ----- e
U(s) 5s
|
Controller parameters
Parameter | Value |
Kp | 5 |
Ti | 30 |
Td | 0.1 |
N | 8 |
b | 1 |
c | 1 |

Process Trasfer function
First Order |
Y(s) 1
---- = --------
U(s) 1 + 5s
|
Controller parameters
Parameter | Value |
Kp | 10 |
Ti | 3 |
Td | 0.8 |
N | 8 |
b | 1 |
c | 1 |

Process Trasfer function
First Order + delay |
Y(s) 1 -2s
---- = -------- e
U(s) 1 + 5s
|
Controller parameters
Parameter | Value |
Kp | 1 |
Ti | 4 |
Td | 0.2 |
N | 5 |
b | 1 |
c | 1 |

Process Trasfer function
Fast Slow |
Y(s) 1 + 5.8s
---- = --------------
U(s) (1 + 6s)(1+s)
|
Controller parameters
Parameter | Value |
Kp | 5 |
Ti | 0.8 |
Td | 0.2 |
N | 10 |
b | 1 |
c | 1 |

Process Trasfer function
Overshooting |
Y(s) 1 + 8s
---- = ---------------
U(s) (1 + 5s)(1+2s)
|
Controller parameters
Parameter | Value |
Kp | 5 |
Ti | 2 |
Td | 1 |
N | 10 |
b | 1 |
c | 1 |

Process Trasfer function
Undershooting |
Y(s) 1 - 5.5s
---- = ---------------
U(s) (1 + 5s)(1+2s)
|
Controller parameters
Parameter | Value |
Kp | 0.1 |
Ti | 2 |
Td | 5 |
N | 5 |
b | 1 |
c | 1 |

Process Trasfer function
Complex Poles |
Y(s) 1
---- = --------------------
U(s) 1 + 1.2 s + 0.025s
|
Controller parameters
Parameter | Value |
Kp | 10 |
Ti | 2.5 |
Td | 1 |
N | 10 |
b | 1 |
c | 1 |

Extends from Modelica.Icons.Example (Icon for runnable examples).
PI control of typical processes, with automatic tuning
Information
Description
In this examples the typical processes (contained in model
TypicalTF )
are controlled with PI regulators with automatic tuning. The aim of this example is to show how the automatic
tuning algorithm works with varius processes. For each trasfer function taken into account have been compared the
parameter values before and after the tuning. Also the algorith parameters are listed too. It is possible to see
that they have different values, depending on the considered example (e.g. the slope must be adapted in order to
avoid big oscillations, the percentual tolerance have to be adapted if the period of the oscillation changes,...).
The example is made of three phases:
- Set point following with default parameters,
- Automatic tuning,
- Set point following with the tuned parameters.
Process Trasfer function
Integrator |
Y(s) 1
---- = -----
U(s) 5s
|
Controller parameters
Parameter | Before | After AT |
Kp | 5 | 73.4625 |
Ti | 1 | 0.273 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 1 |
PermOxPeriodPerc | 5 |
pm | 65 |
nOxMin | 3 |

Process Trasfer function
Integrator + delay |
Y(s) 1 -1s
---- = ----- e
U(s) 5s
|
Controller parameters
Parameter | Before | After AT |
Kp | 5 | 1.067 |
Ti | 30 | 26.54 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 0.01 |
PermOxPeriodPerc | 30 |
pm | 70 |
nOxMin | 3 |

Process Trasfer function
First Order |
Y(s) 1
---- = --------
U(s) 1 + 5s
|
Controller parameters
Parameter | Before | After AT |
Kp | 5 | 71.5948 |
Ti | 1 | 0.1365 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 1 |
PermOxPeriodPerc | 5 |
pm | 65 |
nOxMin | 3 |

Process Trasfer function
First Order + delay |
Y(s) 1 -2s
---- = -------- e
U(s) 1 + 5s
|
Controller parameters
Parameter | Before | After AT |
Kp | 1 | 2.11 |
Ti | 4 | 5.1879 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 0.1 |
PermOxPeriodPerc | 5 |
pm | 65 |
nOxMin | 3 |

Process Trasfer function
Fast Slow |
Y(s) 1 + 5.8s
---- = --------------
U(s) (1 + 6s)(1+s)
|
Controller parameters
Parameter | Before | After AT |
Kp | 5 | 14.056 |
Ti | 1 | 0.1365 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 1 |
PermOxPeriodPerc | 5 |
pm | 65 |
nOxMin | 3 |

Process Trasfer function
Overshooting |
Y(s) 1 + 8s
---- = ---------------
U(s) (1 + 5s)(1+2s)
|
Controller parameters
Parameter | Before | After AT |
Kp | 5 | 17.3146 |
Ti | 1 | 0.1365 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 1 |
PermOxPeriodPerc | 5 |
pm | 65 |
nOxMin | 3 |

Process Trasfer function
Undershooting |
Y(s) 1 - 5.5s
---- = ---------------
U(s) (1 + 5s)(1+2s)
|
Controller parameters
Parameter | Before | After AT |
Kp | 0.1 | 7.69 |
Ti | 1 | 0.692 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 0.05 |
PermOxPeriodPerc | 5 |
pm | 45 |
nOxMin | 3 |

Process Trasfer function
Complex Poles |
Y(s) 1
---- = --------------------
U(s) 1 + 1.2 s + 0.025s
|
Controller parameters
Parameter | Before | After AT |
Kp | 1 | 0.548 |
Ti | 5 | 4.3 |
Automatic Tuning algorithm parameters
Parameter | Value |
slope | 0.1 |
PermOxPeriodPerc | 5 |
pm | 65 |
nOxMin | 3 |

Extends from Modelica.Icons.Example (Icon for runnable examples).
Comparison between continuous time PID and its discrete time implementations
Information
Description
In this examples are compared three PID controllers:
- Continuous time PID with two degrees of freedom
(model PID (with Ts=0) ),
- the discretised version of the continuous time PID with two degrees of freedom
(model PID ),
- and the digital implementation of the PID with two degrees of freedom in the incremental form
(model PID_2dof ).
There controllers regulates a second order process with trasfer function
Y(s) (1+15s)
---- = ----------------
U(s) (1+10s)(1+2s)
The following images show the SetPoint following and disturbance rejection without saturation
Set Point and Process Variables

Control Signals

To be noticed that the discretised version of the PID and the digital implementation of the incremental PID have
the same behaviour.
The same is not valid when the saturation is introduced. If limiting the controller action between [0,2] the
discrete time version and the digital one behave quite differently
Set Point and Process Variables

Control Signals


This difference is due to the nature of the digital implementation that is incremental, while the other two are
positional.
This problem does not appear if the Set Point reference changes soothly, switching to a ramp Set Point signal,
as shown in the following picture.
Process Variables and Control Signals with a ramp Set Point

Extends from Modelica.Icons.Example (Icon for runnable examples).
Cascade control
Information
Description
In this examples are compared two control schemes. The aim of this example is to show how classic control
strategy can be implemented with the models contained within the ControlLibrary.
The system to be controlled is composed by two dynamics: a fast one and a slow one.
The trasfer functions follow:
Fast
Y(s) 1
P1(s) = ---- = -------------
U(s) (1+0.05s)
Slow
Y(s) 1
P2(s) = ---- = -------------
U(s) (1+2s+s^2)
Two different control scheme (both using discrete dime controllers) are compared. In the first one there is one controller
that acts
directly on the fast process P1 and measures the output of the second process P2.
In the second case, there are two controllers that act respectively on the fast and slow dynamics.
The second approach is called cascade control.

The Step responce of the two scheme are listed below.

Despite for a step variation of the Set Point, the two responces (classic scheme red line, and cascade the green one) are
practically the same, this is not true when disturbances occur. It is evident that the cascade control scheme
performs better than the classic one. Below are reported the control signal of the controllers

where is evidenced the fast action of the inner control loop.
Since the controller are discrete time ones, it is important to choose the right sampling time for each loop
(external and internal one). In this case have been choosen a sampling time of 0.5 s for the outer loop, while a
sampling time of 0.01 s for the inner one.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Name | Description |
Sampling time |
Ts | Outer loop sampling time |
Ts_inner | Inner loop sampling time |
Example of cascade control with external lock
Information
Description
In this examples are compared two cascade control schemes: with and without external lock.
When two controllers are connected together in a cascade control scheme, the inner controller typically regulates the actuator, while
the outer one provides the Set Point reference for the inner one.
Since the inner controller acts on the plants, its Control Signal have to be limited, using AntiWindup. Unfortunately it is not possible for the outer
controller, to know the values for which the inner regulator saturates.
Such a problem can be voided by using the PID in its incremental form, using the Increment/Decrement lock feature, and creating
an external loop between the controllers.
If the inner regulator saturates, its satHi signal becomes true. Connecting this signal to the
forbidIncrement input of the outer controller, avoid an useless and potentially dangerous increase of its Control Signal ( that is the
Set point of the inner controller that saturated). With such a scheme a windup-like effect can be avoided.
In the following figure, the green line is the CS of the outer controller with Increment/Decrement lock, while the black one is the output of the outer
controller whitout Increment/Decrement lock.
The black line shows a windup like effect that turns in a slower reaction when the Set Point changes at time t = 30.
Set Point, Process Variables (with and without external lock) and outer control signals (with and without external lock)

inner regulators Control Signal (with and without external lock)

Extends from Modelica.Icons.Example (Icon for runnable examples).
Smith predictor controller for delayed processes
Information
Description
The aim of this example is to show how classic control strategy can be implemented with the models contained within the ControlLibrary.
The system to be controlled is a delayed second order one
Y(s) 1 -8T
P(s) = ---- = ---------------- e
U(s) (1+0.2s)(1+s)
In this case the delay is too high in order to control the process with a simple PI controller. However, the same simple
controller can be used within a more complex structure called Smith predictor. This scheme is based on the knowledge of the process
since it is a model based control strategy.
The control scheme follows, and can be replicated with the blocks contained in the library

Two different scheme have been tested. In the first scheme the Smith predictor is based on a model that is equal to the
real process (M(s) = P(s)), while in the second one the model is an approximation of the process. The step responces are reported below

The red line is the process responce without the controller action, the green line is the process controlled with the
Smith predictor (M(s) = P(s)) while the pink one is the responce of the Smith predictor with an approximate model.
Every 8 seconds (the time delay) there is an action due to the uncorrectness of the model M. However, the amplitude
of these peacks decrease with time. The control signal of the two controllers are reported below.

Extends from Modelica.Icons.Example (Icon for runnable examples).
Automatically generated Mon May 21 13:34:16 2012.