**2. Continuous-time and discrete PID controller**

The basic structure of conventional feedback control using PID controller is shown in Fig. 1 (Astrom et al., 1995), (Doyle et al., 1990). In this figure, the SYSTEM is the object to be controlled. The aim of control is to make controlled system output variable *yS*(*t*) follow the set-point *r*(*t*) using the manipulated variable *u*(*t*) changes. Variable *e*(*t*) is control error and is considered as PID controller input and *t* is continuous time.

Continuous-time PID controller itself is defined by several different algorithms (Astrom et al., 1995), (Doyle et al., 1990). Let us use the common version defined by (Eq. 1).

$$u(t) = K\_p \left( e(t) + \frac{1}{T\_i} \int\_0^t e(\tau) d\tau + T\_d \frac{d e(t)}{dt} \right) \tag{1}$$

Discrete PID Controller Tuning Using Piecewise-Linear Neural Network 195

Formula of discrete PID controller can be obtained by discretizing of (Eq. 1). From a purely numerical point of view, integral part of controller can be approximated by (Eq. 2) and

( ) ( 1) ( ) <sup>2</sup>

(2)

(3)

*uk uk uk* ( ) ( ) ( 1) (5)

(7)

(4)

01 2 *uk uk qek qek qek* ( ) ( 1) ( ) ( 1) ( 2) (6)

*d*

*i ei ei ed T*

*de t e k e k* ( ) ( ) ( 1) *dt T*

( ) ( 1) () () ( ) ( 1) <sup>2</sup>

For practical application, incremental form of discrete controller is more suitable. Let us

 

1

1 <sup>2</sup> <sup>1</sup> 2

*d p <sup>T</sup> q K <sup>T</sup>*

 

 

*d*

*d*

1 2

*p <sup>T</sup> <sup>T</sup> q K T T*

*p <sup>T</sup> <sup>T</sup> q K T T*

2

() 1 *Q z q qz qz P z z*

In the Z domain (Isermann, 1991), discrete PID controller has the following transfer

1 1 2 01 2 1 1

 

As well as for continuous-time PID controller, there have been introduced several methods for *q*0, *q*1, *q*2 tuning (Isermann, 1991). Most of them require mathematical model of controlled system (either first principle or experimental one) and if the system is nonlinear, the model

In next paragraph, the way how to tune discrete PID controller using Pole Assignment

*T ei ei <sup>T</sup> uk K ek ek ek T T*

0 1

1

*i i*

1

( )

has to be linearized around one or several operating points.

*k*

*t k*

 

Then, discrete PID controller is defined by (Eq. 4).

*p*

derivative part by (Eq. 3).

Then, with respect to (Eq. 4)

where 0

assume

function.

technique is described.

Fig. 1. Conventional feedback control loop

The control variable is a sum of three parts: proportional one, integral one and derivative one – see Fig. 2. The controller parameters are proportional gain *Kp*, integral time *Ti* and derivative time *Td*.

Fig. 2. Continuous-time PID controller

In applications, all three parameters have to be tuned to solve certain problem most appropriately while both stability and quality of control performance are satisfied. Many tuning techniques have been published in recent decades, some of them experimental, the others theoretically based.

As microprocessors started to set widely in all branches of industry, discrete form of PID controller was determined. Discrete PID controller computes output signal only at discrete time instants *k·T* (where *T* is sapling interval and *k* is an integer). Thus, conventional control loop (Fig. 1) has to be upgraded with zero order hold (ZOH), analogue-digital converter (A/D) and digital-analogue converter (D/A) – see Fig. 3 (*k·T* is replaced by *k* for formal simplification).

Fig. 3. Feedback control loop with discrete PID controller

Formula of discrete PID controller can be obtained by discretizing of (Eq. 1). From a purely numerical point of view, integral part of controller can be approximated by (Eq. 2) and derivative part by (Eq. 3).

$$\int\_{0}^{t} e(\tau)d\tau \approx T \sum\_{i=1}^{k} \frac{e(i) + e(i-1)}{2} \tag{2}$$

$$\frac{dc(t)}{dt} \approx \frac{c(k) - c(k-1)}{T} \tag{3}$$

Then, discrete PID controller is defined by (Eq. 4).

$$u(k) = K\_p \left( e(k) + \frac{T}{T\_i} \sum\_{i=1}^k \frac{e(i) + e(i-1)}{2} + \frac{T\_d}{T} (e(k) - e(k-1)) \right) \tag{4}$$

For practical application, incremental form of discrete controller is more suitable. Let us assume

$$
\Delta u(k) = u(k) - u(k-1)\tag{5}
$$

Then, with respect to (Eq. 4)

$$
\mu(k) - \mu(k-1) = q\_0 e(k) + q\_1 e(k-1) + q\_2 e(k-2) \tag{6}
$$

*d*

where 0

194 Introduction to PID Controllers – Theory, Tuning and Application to Frontier Areas

CONTROLLER SYSTEM *<sup>u</sup>*(*t*) *yS <sup>e</sup>* (*t*) *<sup>r</sup>*(*t*) **<sup>+</sup>** (*t*)

The control variable is a sum of three parts: proportional one, integral one and derivative one – see Fig. 2. The controller parameters are proportional gain *Kp*, integral time *Ti* and

*e*(*t*) *u*(*t*)

In applications, all three parameters have to be tuned to solve certain problem most appropriately while both stability and quality of control performance are satisfied. Many tuning techniques have been published in recent decades, some of them experimental, the

( )

*e d*

 

*d de t <sup>T</sup> dt*

0 <sup>1</sup> ( ) *t*

*i*

*T*

As microprocessors started to set widely in all branches of industry, discrete form of PID controller was determined. Discrete PID controller computes output signal only at discrete time instants *k·T* (where *T* is sapling interval and *k* is an integer). Thus, conventional control loop (Fig. 1) has to be upgraded with zero order hold (ZOH), analogue-digital converter (A/D) and digital-analogue converter (D/A) – see Fig. 3 (*k·T* is replaced by *k* for formal

CONTROLLER SYSTEM *<sup>u</sup>*(*t*) *yS <sup>e</sup>* (*t*) *<sup>r</sup>*(*t*) **<sup>+</sup>** (*t*)

DISCRETE PID

**-** A/D D/A ZOH *<sup>e</sup>*(*k*) *<sup>u</sup>*(*k*)

Fig. 3. Feedback control loop with discrete PID controller

PID

**-**

derivative time *Td*.

Fig. 1. Conventional feedback control loop

*K e*(*t*) *<sup>p</sup>*

Fig. 2. Continuous-time PID controller

others theoretically based.

simplification).

$$\begin{aligned} q\_0 &= K\_p \left( 1 + \frac{T}{2T\_1} + \frac{T\_d}{T} \right) \\\\ q\_1 &= -K\_p \left( 1 - \frac{T}{2T\_1} + \frac{2T\_d}{T} \right) \\\\ q\_2 &= K\_p \frac{T\_d}{T} \end{aligned}$$

1

*p*

2

In the Z domain (Isermann, 1991), discrete PID controller has the following transfer function.

*p*

$$\frac{Q(z^{-1})}{P(z^{-1})} = \frac{q\_0 + q\_1 z^{-1} + q\_2 z^{-2}}{1 - z^{-1}}\tag{7}$$

As well as for continuous-time PID controller, there have been introduced several methods for *q*0, *q*1, *q*2 tuning (Isermann, 1991). Most of them require mathematical model of controlled system (either first principle or experimental one) and if the system is nonlinear, the model has to be linearized around one or several operating points.

In next paragraph, the way how to tune discrete PID controller using Pole Assignment technique is described.

Discrete PID Controller Tuning Using Piecewise-Linear Neural Network 197

been introduced new technique (Doležel et al., 2011), recently. It is presented in next

According to Kolmogorov's superposition theorem, any real continuous multidimensional function can be evaluated by sum of real continuous one-dimensional functions (Hecht-Nielsen, 1987). If the theorem is applied to artificial neural network (ANN), it can be said that any real continuous multidimensional function can be approximated by certain threelayered ANN with arbitrary precision. Topology of that ANN is depictured in Fig. 6. Input layer brings external inputs *x*1, *x*2, …, *xP* into ANN. Hidden layer contains *S* neurons, which process sums of weighted inputs using continuous, bounded and monotonic activation function. Output layer contains one neuron, which processes sum of weighted outputs from

Im(*z*)

0 5 10

YS(z-1) *R*(*z*-1) *YS*(*z*-1)

<sup>1</sup>*,k*.

<sup>2</sup> R(z-1)

0 1


So ANN in Fig. 6 takes *P* inputs, those inputs are processed by *S* neurons in hidden layer and then by one output neuron. Dataflow between input *i* and hidden neuron *j* is gained by weight *w*<sup>1</sup>*j,i*. Dataflow between hidden neuron *k* and output neuron is gained by weight *w*<sup>2</sup>

Fig. 5. The effect of characteristic polynomial poles to the control dynamics

Output of the network can be expressed by following equations.

hidden neurons. Its activation function has to be continuous and monotonic.

paragraphs.

**4.1 Artificial neural network for approximation** 
