SELF-TUNING CONTROLLERS
SIMULINK LIBRARY
Zlin, March 2008
Self-tuning Controller Simulink Library 2
Table of Contents
1 Introduction......................................................................................................... 4
1.1 System requirements ................................................................................................................ 4
1.2 Installation ................................................................................................................................. 4
1.3 Contact...................................................................................................................................... 4
2 How to use the library ........................................................................................ 5
3 Common controllers parts and parameters ..................................................... 6
3.1 On-line identification methods................................................................................................... 6
3.2 Computation of ultimate gain and period .................................................................................. 8
3.3 List of common controllers parameters..................................................................................... 9
4 Controllers reference........................................................................................ 10
4.1 zn2fr ........................................................................................................................................ 15
4.2 zn2br ....................................................................................................................................... 16
4.3 zn2tr ........................................................................................................................................ 17
4.4 zn2pd....................................................................................................................................... 18
4.5 zn2pi........................................................................................................................................ 19
4.6 zn2fd........................................................................................................................................ 20
4.7 zn2tak...................................................................................................................................... 22
4.8 zn2ast...................................................................................................................................... 23
4.9 zn2fpd...................................................................................................................................... 24
4.10 ba2 .......................................................................................................................................... 25
4.11 da2 .......................................................................................................................................... 26
4.12 pp2a_1 .................................................................................................................................... 27
4.13 pp2a_2 .................................................................................................................................... 29
4.14 pp2b_1 .................................................................................................................................... 31
4.15 pp2b_2 .................................................................................................................................... 33
4.16 db2w........................................................................................................................................ 35
4.17 db2s......................................................................................................................................... 36
4.18 mv2.......................................................................................................................................... 37
4.19 pp2chp..................................................................................................................................... 38
4.20 pp2lq........................................................................................................................................ 40
4.21 pp2c2dof.................................................................................................................................. 42
4.22 zn3fr ........................................................................................................................................ 44
4.23 zn3br ....................................................................................................................................... 45
4.24 zn3tr ........................................................................................................................................ 46
4.25 zn3pd....................................................................................................................................... 47
4.26 zn3pi........................................................................................................................................ 48
4.27 zn3fd........................................................................................................................................ 49
4.28 zn3tak...................................................................................................................................... 51
Self-tuning Controller Simulink Library 3
4.29 zn3ast...................................................................................................................................... 52
4.30 zn3fpd...................................................................................................................................... 53
4.31 db3w........................................................................................................................................ 54
4.32 db3s......................................................................................................................................... 55
4.33 pp3chp..................................................................................................................................... 56
4.34 pp3c2dof.................................................................................................................................. 58
Self-tuning Controller Simulink Library 4
SELF-TUNING CONTROLLERS
SIMULINK LIBRARY
1 Introduction
Self-tuning controllers Simulink library contains various discrete single input single output (SISO) controllers
that can be used to control systems of second and third order. All controllers contain on-line identification of
controlled process and thus can be used also for time varying processes.
1.1 System requirements
The library has been designed under Matlab Release 12.1 (version 6.1) and Simulink version 4.1. For
minimum and recommended system configuration see installation guide for Matlab. It is also possible to port
the library to be used in previous versions of Simulink and Matlab, but in this case some functional limitations
can occur. Dialog boxes used in library requires screen resolution at least 800x600 pixels.
1.2 Installation
Self-tuning controllers Simulink library is available in two versions:
• stcsl_std.zip – the standard version using the Matlab programming language (m-files)
• stcsl_rtw.zip – the version to be used with Real Time Workshop, using C language functions
To install the library simply unzip the appropriate file to an empty folder (for example using Winzip or
pkunzip) and than add this folder to the matlab path. There are several possible approaches of adding a
folder to the Matlab path (for example you can use path command), but the simplest way is to use the Set
Path dialog, which can be accessed through the File menu.
1.3 Contact
Prof. Ing. Vladimir Bobal CSc. (bobal@ft.utb.cz)
Ing. Petr Chalupa (
chalupa@ft.utb.cz)
Department of Control Theory
Institute of Information Technologies
Tomas Bata University in Zlin
Mostni 5139
760 01 Zlin
Czech Republic
Self-tuning Controller Simulink Library 5
2 How to use the library
The library file stcsl_std.mdl (or stcsl_rtw.mdl) contains 32 controller blocks, 20 of them can be used to
control second order systems and 12 to control third order systems. Each controller block has 3 inputs and 2
outputs. The inputs are:
• Current process input (action value) u_in,
• Current process output y
• Reference value w
The controller outputs are:
• Current action value u
• Vector of current parameter estimations of controlled process
Input u_in should be as close as possible to actual control value (input to control process) to get the most
appropriate results of the process identification. In simplest case this input is directly connected to controller
output u. This situation is shows in following model:
figure 1
Usually there are some limitations of action value in industrial applications and thus computed action value is
not the same as input to the process. This situation is shown in sample model circuit.mdl in
figure 2.
figure 2
To use blocks in your own Simulink models just copy the block from library into your model (for example
using drag and drop operation), connect appropriate input and output signals, set block parameters (for
example by double-clicking on block) and than you can start simulation. It is also possible to start with
sample model circuit.mdl and modify it to represent process you want to simulate. Controller parameters
can be divided into two groups: the parameters common to all blocks and the controller-specific parameters.
These two groups will be discussed in following two chapters.