Section 2 System Dynamics

#### **Chapter 3**

## Research and Application of PID Controller with Feedforward Filtering Function

*Biao Wang and Shaojun Lin*

#### **Abstract**

Most of the existing differential methods focus on the differential effect and do not make full use of the differential link's filtering effect of reducing order and smoothing. In Proportion Integral Differential (PID) control, the introduction of differential can improve the dynamic performance of the system. However, the actual differential (containing differential gain) will be subject to the impact of high-frequency noises. Therefore, this paper proposes a differential with filtering function, which has weak effect on noise amplification, and strong effect on reducing order and smoothing. Firstly, a discrete differentiator was constructed based on the Newton interpolation, and the concept of "algorithm bandwidth" was defined to ensure the differential effect. Then, the proposed algorithm was used to design a new PID controller with feedforward filtering function. In the experiments, the proposed PID controller is applied to a high-performance hot water supply system. The result shows that the system obtains better control quality. It verifies that the proposed PID controller has a feedforward filtering function and can effectively remove high-frequency noise.

**Keywords:** Newton interpolation, algorithm bandwidth, the discrete differentiator, PID controller, feedforward filtering

#### **1. Introduction**

As Proportion Integral Differential (PID) control is widely used in industrial control, engineering applications, and other fields [1, 2], a problem in Proportion Integral Differential (PID) control cannot be ignored: the introduction of differential signals can improve the dynamic characteristics of the system, but it is also easy to introduce high-frequency interference [3], the insufficiency of the differential term is especially obvious when the error perturbation is abruptly changed. The feedforward control can generate a compensation amount in advance according to the magnitude of the disturbance after the disturbance occurs and before the controlled variable has changed, thereby eliminating the influence of the disturbance on the controlled variable. Therefore, a filter or feedforward link is generally added to the PID control system to improve the system performance, but this makes the system structure more complicated.

The existing differentiation method focuses on the differential function of the differential link, but involves less on the filtering function of the differentiator.

Although the differential link has the function of order reduction, harmonics will appear at the same time as the order reduction. If it is not smoothed, the control effect is not ideal when applied to the actual control system. Therefore, it is necessary to design a PID controller with filtering function that has weak effect on noise amplification and strong reduction and smoothing effect.

In the current methods of extracting input differential signals, wavelet [4] and neural network [5] rely on system models or may amplify noise. In recent years, sliding mode algorithms have been used to design differentiators or filters, but there is a problem of chattering elimination [6–8]. Literature [9] realized a dither-free sliding mode differentiator, which constructed discrete differential based on backward Euler, but the algorithm parameter adjustment is more complicated. Tracking differentiator (TD) can quickly track the input signal [3], but its more parameters increase the difficulty of application in practice [10, 11]. The structure of fractional differential is generally more complicated. For example, the fractional differential in literature [12] is implemented with a complex combination structure of low-pass, high-pass, and band-pass filter functions.

Numerical differentiation [13–16] approximates the function value of the unknown objective function at certain points based on the information of the known finite discrete sampling points. According to the literature, numerical differentiation mainly includes: finite difference type [17], polynomial interpolation type [13, 15], regularization method [18, 19], and undetermined coefficients [20]. Among them, the commonly used method is finite difference, but its effect is not very ideal for the high-frequency noise existing in the measurement process [21].

In view of the above problems, due to the advantages of Newton interpolation that it is convenient to calculate a large number of interpolation points, this paper constructs a "discrete differentiator" based on the equidistant Newton interpolation polynomial [22]. The proposed differentiator can realize the effect of differential and filter, so it can replace the strategy of "controller and filter" in some application. Compared with the existing Gaussian filtering [23], Kalman filtering [23–25], and Wiener filtering [25] schemes, the proposed discrete differentiator has a simple structure, and it is easy to implement.

Then this article gives a simulation example, using the discrete differentiator as the differential link in PID control, applied to the hot water temperature supply system, and compared with the control effect of the feedforward and feedback compound control (using the traditional PID controller) strategy. The results show that the PID controller simplifies the structure of the system. Even if it does not have the feedforward link, it still has the feedforward filtering function. It overcomes the negative factors of the differential link in the traditional PID controller that amplify the noise and produce side effects. The system has obtained better control quality.

#### **2. A numerical differential algorithm based on Newton's interpolation**

The distribution of sampling points for many problems in practical engineering is often equidistant. Eq. (1) shows that the algorithm based on the equally spaced forwarddifference Newton's interpolation polynomials only utilizes the previous sampling points. Therefore, the "on-line" control can be achieved. Namely, the differential of the point *<sup>y</sup>*<sup>0</sup> is estimated from the target-function's values of *<sup>y</sup>*0, *<sup>y</sup>*�<sup>1</sup>, *<sup>y</sup>*�<sup>2</sup>, … , *<sup>y</sup>*�*<sup>k</sup>* at the moment of the current period *t*<sup>0</sup> and previous periods*t*<sup>0</sup> � Δ*t*, *t*<sup>0</sup> � 2Δ*t*, … , *t*<sup>0</sup> � *k*Δ*t*.

$$\hat{\mathcal{Y}}(u) = \mathcal{Y}\_0 + u \Delta \mathcal{Y}\_{-1} + \frac{1}{2!u(u+1)\Delta \mathcal{Y}\_{-2}} + \frac{1}{3!u(u+1)(u+2)\Delta \mathcal{Y}\_{-3}} + \dots \tag{1}$$

*Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

Eq. (1) gives the Newton's interpolation function based on equal interval, and we introduce variable *u* ¼ ð Þ *t* � *t*<sup>0</sup> *=*Δ*t* (Δ*t* is the sample step) to simplify the interpolation function.

When *t* ¼ *t*0ð Þ *u* ¼ 0 , the first derivative of the Newton's interpolation polynomial has the form in Eq. (2):

$$j'(t\_0) = \frac{1}{\Delta t} \left( \Delta \mathbf{y}\_{-1} + \frac{\Delta^2 \mathbf{y}\_{-2}}{2} + \frac{\Delta^3 \mathbf{y}\_{-3}}{3} + \frac{\Delta^4 \mathbf{y}\_{-4}}{4} + \dots + \frac{\Delta^5 \mathbf{y}\_{-5}}{5} + \frac{\Delta^6 \mathbf{y}\_{-6}}{6} + \frac{\Delta^7 \mathbf{y}\_{-7}}{7} + \dots \right) \tag{2}$$

Δ*<sup>m</sup>* is forward differential operator, Eq. (2) provides various forms of Δ*<sup>m</sup>*:

$$\begin{aligned} \Delta y\_{-1} &= y\_0 - y\_{-1} \\ \Delta^2 y\_{-2}/2 &= \frac{1}{2} \left( y\_0 - 2y\_{-1} + y\_{-2} \right) \\ \Delta^3 y\_{-3}/3 &= \frac{1}{3} \left( y\_0 - 3y\_{-1} + 3y\_{-2} - y\_{-3} \right) \\ \Delta^4 y\_{-4}/4 &= \frac{1}{4} \left( y\_0 - 4y\_{-1} + 6y\_{-2} - 4y\_{-3} + y\_{-4} \right) \\ \Delta^5 y\_{-5}/5 &= \frac{1}{5} \left( y\_0 - 5y\_{-1} + 10y\_{-2} - 10y\_{-3} + 5y\_{-4} - y\_{-5} \right) \\ \Delta^6 y\_{-6}/6 &= \frac{1}{6} \left( y\_0 - 6y\_{-1} + 15y\_{-2} - 20y\_{-3} + 15y\_{-4} - 6y\_{-5} + y\_{-6} \right) \end{aligned} \tag{3}$$

The numerical differential algorithm formulas involving two to seven sampling points can be obtained from Eq. (2). **Table 1** lists the equally spaced forwarddifference formula based on the first derivative of the Newton's interpolation.

The closed-loop system's bandwidth is determined by the cutoff frequencyω*<sup>c</sup>* on the amplitude-frequency characteristics of the open-loop system. This band range is necessary to ensure that the numerical differential algorithm's accuracy meets the system requirements. Therefore, this paper defined the concept of the "algorithm bandwidth." It refers a range in which the frequency characteristics of the ideal differential and the proposed differentiator are basically consistent or the maximum frequency limit when the differential accuracy of the ideal differential and the proposed method are basically equal.

The algorithm bandwidth is calculated by comparing the frequency characteristics of the proposed method and the ideal differential. Therefore, we can get two


**Table 1.** *The equally spaced forward-difference formula with 2–7 sampling points.* values of algorithm bandwidth, which are respectively in the sense of amplitudefrequency characteristics and phase-frequency characteristics.

For the convenience of description, the following contents of this paper will replace the numerical differential algorithm with the differentiator filter. For a differentiator filter when two sampling points are adopted, we will replace it with the two-point differentiator filter.

The standard for judging the effect of the proposed differentiator mainly considers the following three aspects:


The most significant is the transmission coefficient of differentiator filter. When a differentiator filter is similar to an ideal differential in the high-frequency characteristic, it would amplify high-frequency noises. Nevertheless, this factor is undesirable when it occurs in practical applications.

In section III, we compared the proposed differentiator with the ideal differential and the actual differential by analyzing their frequency characteristics. Besides, the frequency characteristics of the above differentiators are calculated by Laplace Fourier transforms.

#### **3. The discrete differentiator**

#### **3.1 The design of discrete differentiator**

For the ideal differential, its transfer function and amplitude-frequency characteristics, and phase-frequency characteristics are in Eq. (4).

$$W(j\omega) = K\_d \bullet j\omega$$

$$|W(j\omega)| = K\_d \bullet \alpha$$

$$\mathfrak{q}(\alpha) = +\pi/2\tag{4}$$

*Kd* in Eq. (4) is the transfer coefficient of the differential link. Without losing generality, we suppose that *Kd* ¼ 1.

A differentiator filter can be constructed by Eq. (2) using a first derivative of the Newton's interpolation polynomials. Eq. (5) gives the two-point differentiator:

$$\hat{y}'(n\Delta t) = \frac{[y(n\Delta t) - y((n-1)\Delta t)]}{\Delta t} = f(n\Delta t) \tag{5}$$

Applying Laplace transform and Fourier transforms to Eq. (5), we can get transfer function of the two-point differentiator in Eq. (6).

$$\begin{aligned} W^\* \left( j\omega \Delta t \right) &= \frac{F^\* \left( j\omega \right)}{Y^\* \left( j\omega \right)} = \frac{\left( 1 - \exp \left( -j\omega \Delta t \right) \right)}{\Delta t} \\\\ &= \frac{\left[ 1 - \cos \left( \omega \Delta t \right) + j \bullet \sin \left( \omega \Delta t \right) \right]}{\Delta t} \end{aligned} \tag{6}$$

*Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

Substituting the real part and the virtual part of Eq. (6) into Eq. (7) and the frequency characteristics of the two-point differentiator filter will be obtained:

$$\mathcal{L}(\boldsymbol{\alpha}) = 2\mathbf{0} \bullet \lg\left(\frac{\sqrt{\text{Re}^2 + \text{Im}^2}}{\Delta t}\right)$$

$$\boldsymbol{\varrho}(\boldsymbol{\omega}) = \text{arctg}\left(\frac{\text{Im}}{\text{Re}}\right) \tag{7}$$

The amplitude-frequency characteristics and the phase-frequency characteristics of the two-point differentiator filter are given in Eq. (8) and Eq. (9) by calculating Eq. (7). The calculation process is not difficult, so I will not explain it in detail here.

$$|W^\*\left(j\omega\Delta t\right)| = 2 \bullet \frac{\sin\left(\frac{\alpha\Delta t}{2}\right)}{\Delta t} \approx \omega\tag{8}$$

$$\begin{split} \mathbf{q}(\alpha\Delta t) &= \operatorname{rect}\left[\frac{\sin\left(\alpha\Delta t\right)}{\left(1-\cos\left(\alpha\Delta t\right)\right)}\right] \\ &= \operatorname{rect}\left[\frac{\operatorname{ctg}\left(\omega\Delta t\right)}{2}\right] \end{split} \tag{9}$$

It should be noted that the amplitude-frequency characteristics of the proposed method and the ideal differential should be basically the same.

The algorithm bandwidth of the two-point differentiator filter is the frequency range when the frequency characteristics of the two-point differentiator and the ideal differential are consistent within a specific precision range. From now on, algorithm bandwidth also refers to this upper-frequency limit.

In terms of the amplitude-frequency characteristics, we can get the estimation of algorithm bandwidth in Eq. (10) through Eq. (8). That is the algorithm bandwidth of the two-point differentiator filter in the sense of amplitude-frequency characteristics.

$$
\omega \le \frac{1}{\Delta t} \tag{10}
$$

The phase of ideal differential is þπ*=*2, so the phase of a two-point differentiator filter should be þπ*=*2, too. Making Eq. (9) φð Þ¼ *ω*Δ*t* arctg ctg ½ �¼þ ð Þ *ω*Δt *=*2 π*=*2, we can get the algorithm bandwidth in the sense of phase-frequency characteristics in Eq. (11). Note that the ideal solution of φð Þ¼ *ω*Δ*t* arctg ctg ½ �¼þ ð Þ *ω*Δt *=*2 π*=*2 is 0 and Eq. (11) is an approximate solution to satisfy the above relationship.

$$
\omega \le \frac{0.1}{\Delta t} \tag{11}
$$

Similarly, the frequency characteristics and algorithm bandwidth of the *n*-point differentiator (*n* =2,3,4,5,6,7) based on the first derivative of the Newton's interpolation can be obtained by using the method described above. The transfer function of the three-point discrete differentiator to the seven-point discrete differentiator is shown in **Table 2**.

#### **3.2 The frequency characteristics of discrete differentiator**

Next, we will compare the proposed differentiator with ideal differential and the actual differential by analyzing their frequency characteristics. We give the


**Table 2.**

*The transfer function of the three-point discrete differentiator to the seven-point discrete differentiator.*

simulation of the proposed method with various sampling points and the sample step Δ*t* to analyze the effect of the sampling points and the sample step on a differentiator filter.

We give the simulation of the amplitude-frequency characteristics and phase-frequency characteristics of the differentiator filters and ideal differential in **Figure 1**. The differentiator filters respectively adopt 2, 3, 4 sample points and their sample step are all 0.1 second. Therefore, transfer functions of the two-discrete differentiator, the three-discrete differentiator and the four-discrete differentiator are <sup>1</sup>�*e*�*jw* <sup>∙</sup> <sup>0</sup>*:*<sup>1</sup> <sup>0</sup>*:*<sup>1</sup> , <sup>3</sup>�4*e*�*jw* <sup>∙</sup> <sup>0</sup>*:*1þ*e*�*jw* <sup>∙</sup> <sup>0</sup>*:*<sup>2</sup> <sup>2</sup> <sup>∗</sup> <sup>0</sup>*:*<sup>1</sup> , <sup>11</sup>�18*e*�*jw* <sup>∙</sup> <sup>0</sup>*:*1þ9*e*�*jw* <sup>∙</sup> <sup>0</sup>*:*2�2*e*�*jw* <sup>∙</sup> <sup>0</sup>*:*<sup>3</sup> <sup>6</sup> <sup>∗</sup> <sup>0</sup>*:*<sup>1</sup> .

From the result, it can be seen that the cutoff frequency ω*<sup>c</sup>* of the ideal differential and the discrete differentiators is 1 rad/s. The ideal differential is a linear function of +20 dB per ten times the frequency, and the output amplitude increases with the increase of input frequency. Therefore, it would amplify the noise in the high-frequency region because its amplitude increases with the increase of the frequency. Whereas amplitude of the proposed differentiators with 2, 3, 4 sample points does not increase with the increase of the frequency, and it is finally stable. The four-point discrete differentiator has a 36.2 dB maximum amplitude, threepoint discrete differentiator has a 32 dB maximum amplitude, two-point discrete differentiator has a 26.9 dB maximum amplitude.

We obtain *ω*≤1*=*Δ*t* ¼ 10rad*=*s and *ω*≤ 0*:*1*=*Δ*t* ¼ 1rad/s (Δ*t* ¼ 0*:*1s) by Eq. (10). Namely, for the two-point differentiator, algorithm bandwidth in the sense of amplitude-frequency characteristics and phase-frequency characteristics is respectively 10 rad/s and 1 rad/s. It can be seen in **Figure 1**, the amplitude-frequency characteristic of the proposed method is consistent with the ideal differential in the region of 0 rad-10 rad/s, and the phase-frequency characteristic of the proposed method is consistent with the ideal differential in the region of 0 rad–1 rad/s which confirms Eq. (10).

#### **3.3 Influence of parameters the sampling step Δ***t* **and sampling points** *n* **on the filtering effect of the discrete differentiator**

In order to study the Influence of parameter the sampling step Δ*t* on the filtering effect of the discrete differentiator, we give some simulations. **Figure 2** shows the frequency characteristics of the two-point differentiator filter based on the sample step Δ*t* ¼ 0*:*1s and Δ*t* ¼ 1s.

In **Figure 2**, the cutoff frequency ω*<sup>c</sup>* of the discrete differentiators is 1 rad/s. In the high-frequency region, the blue curve has a smaller amplitude compared with the green curve. The two-point discrete differentiator with Δ*t* ¼ 0*:*1s has a 26.9 dB *Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

**Figure 1.** *Frequency characteristic of ideal differential and the differentiator filters when sample step is 0.1 s (*Δ*t* ¼ 1s*).*

maximum amplitude, and the two-point discrete differentiator with Δ*t* ¼ 1s has a 5.5 dB maximum amplitude. It indicates that when the sample step Δ*t* takes the larger value, the differentiator filter becomes weaker for the high-frequency noise amplification. Therefore, we should take Δ*t* (the sampling time) as large as we can, but Δ*t* could not be too large, or it would affect the accuracy and stability of the differentiator.

**Figures 3** and **4** shows the Nyquist diagram of the differentiator filter with 2–7 points differentiator filter. We can infer that the high-frequency transmission coefficient increases as the number of sampling points in the algorithm increases. Furthermore, the two-point differentiator has the maximum error and minimum transmission coefficient in the high-frequency region. Oppositely, the seven-point differentiator has the minimum error in algorithm bandwidth and the maximum transmission coefficient in the high-frequency region.

Besides, in **Figures 3** and **4**, when the number of sampling points exceeds 4, it is observed that the root locus of the differentiator filter appears on the left side of the **s** domain. The differentiator filter constructed at this time does not conform to the characteristics of the differential link. In addition, adopting too many sampling points will increase the algorithm complexity.

Therefore, the proposed differentiator takes up to four sampling points. It is not recommended to increase the number of sampling points for differentiator filters.

As the ideal differential could not be synthesized in practical scenes, the ideal differential does not exist. The actual differential generally has certain inertia so it can be realized in series with the ideal differential. Another essential feature of discrete differentiation is that the maximum transfer coefficient (gain) of the

**Figure 2.** *Frequency characteristic of the two-point differentiator filters when sample step is 1 s (*Δ*t* ¼ 1s*) and 0.1 s (*Δ*t* ¼ 0*:*1s*).*

**Figure 3.** *Root locus of the proposed differentiator with 2–4 points.*

differentiator is subject to the bandwidth limit. Eq. (12) gives transfer function of an actual differential.

$$W\_d(j\alpha) = \frac{j\alpha}{(1 + T\_d j\alpha)}\tag{12}$$

*Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

**Figure 4.** *Root locus of the proposed differentiator with 2–7 points.*

*Td*- the equivalent time constant of the actual differential link. We can obtain *Td* by the following relationship: the modulus of the actual differential link in Eq. (12) should be equal to that of the differentiator filter when ω ! ∞ .

Eq. (13) gives the transfer function of two-point differentiator filters, three-point differentiator filters, and four-point differentiator filters:

$$W^\*\left(j\omega\right) = \frac{\left(1 - \exp\left(-j\omega\Delta t\right)\right)}{\Delta t}$$

$$W^\*\left(j\omega\right) = \frac{\left(3 - 4\exp\left(-j\omega\Delta t\right) + \exp\left(-2j\omega\Delta t\right)\right)}{2\Delta t}$$

$$W^\*\left(j\omega\right) = \frac{\left(11 - 18\exp\left(-j\omega\Delta t\right) + 9\exp\left(-2j\omega\Delta t\right) - 2\exp\left(-3j\omega\Delta t\right)\right)}{6\Delta t} \tag{13}$$

While *ω* ! ∞, the modulus of the actual differential is as follows:

$$|\mathcal{W}\_d(j\alpha)| = \frac{|\alpha|}{\sqrt{\mathbf{1} + (T\_d\alpha)^2}} = \frac{\alpha}{(T\_d\alpha)} = \mathbf{1}/T\_d\tag{14}$$

For the two-point differentiator filter, its modulus can be got as the following relation when *ω* ! ∞:

$$|W^\*\left(j\alpha\Delta t\right)| = \frac{2}{\Delta t} \bullet \sin\left(\frac{\alpha\Delta t}{2}\right) = \frac{2}{\Delta t} \tag{15}$$

Make Eq. (14) equal to Eq. (15), we can get Eq. (16):

$$\frac{2}{\Delta t} = \frac{1}{T\_d} \tag{16}$$

Calculate the solution of Eq. (16) and get Eq. (17):

$$T\_d = \frac{2}{\Delta t} \tag{17}$$

In the same way, we can find the relation between *Td* and Δ*t* when the actual differential link corresponds to the three-point differentiator filter and four-point differentiator filter.

$$T\_d = \frac{\Delta t}{k}, \qquad (k = 4, 6.667) \tag{18}$$

In order to evaluate the effect of differentiator filters more effectively, the frequency characteristic of the differentiator filter is compared with the frequency characteristic of the actual differential link.

The differentiating time constant of the actual differential link is 0.25 s, which corresponds to the three-point differentiator filter when Δ*t* ¼ 1s, the frequency characteristics of both are given in **Figure 5**.

It can be seen from the figure that the two-point discrete differentiator and the actual differential have the same maximum of 12 dB amplitude, so the proposed discrete differentiator can realize the effect of suppressing noise like the actual differentiator. The continuous simulation of the discrete algorithm in the highfrequency domain can be analyzed on the transfer coefficient of the differentiator filter so that the possible noise on the signal transmission path after the control device can be determined to a great extent.

With the improvement of microprocessor control equipment performance, the existing control equipment has high sampling frequency and high processing speed. Implementing discrete differential algorithms on these devices can achieve the same effect as continuous algorithms. When the differential link of the PID controller is realized by the differentiator filter and the continuous differentiator, the frequency characteristics of the two are close.

While constructing the differentiator filter Δ*t* through the first derivative method of Newton's interpolation, we find it that the disturbance suppression effect of the differentiator filter on the high-frequency noise is more evident when the number of sampling points is smaller, and the sample step is larger. The differentiator filter has the best high-frequency noise suppression ability when two sampling points are selected, and the maximum allowable sample step *Δt* is selected. It should be noted that when the selected sampling points are small, the differential accuracy of the constructed differentiator filter will be reduced.

The standard deviation estimates of the input and output random signals of the actual and differentiator filters under different noise are given in **Table 3**. Where the sample step of the differentiator filter is 1 second (Δ*t* ¼ 1s). The equivalent time constant *Td* of the actual differentiator is 1*=k T*ð Þ *<sup>d</sup>* ¼ 1*=k* .

In **Table 3**, comparing with the actual differential, the output of the proposed method had smaller standard deviation under different noise. There are three common types of noise: normal distribution noise, white noise, and uniform distribution noise.

Normal distribution noise also calls Gaussian noise, which is a kind of noise whose probability density function obeys Gaussian distribution. Common Gaussian noise includes fluctuation noise, cosmic noise, thermal noise, shot noise, and so on. The three noises are very common, and it is convenient to quantify and evaluate the effect of the algorithm.

White noise is a random signal with constant power spectral density. In other words, the power spectral density of this signal is the same in each frequency band. Because white light is mixed with monochromatic light of various frequencies (colors), the property of this signal with flat power spectrum is called "white," and this signal is also called white noise.

#### *Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

**Figure 5.** *Frequency characteristics of the actual differential when Td* ¼ 0*:*25s *and the three-point differentiator filter when* Δ*t* ¼ 1s*.*


#### **Table 3.**

*Standard deviation (SD) of the actual differential and the proposed method.*

Uniformly distributed noise is a kind of noise whose probability density function obeys uniform distribution. Uniform distribution is one of the important distributions in probability and statistics.

We give the algorithm effect under these three noises in order to verify the adaptability and robustness of the algorithm. It shows that the algorithm can deal with them effectively for common noises and the differential accuracy of the

differentiator filter is higher than that of the actual differential, and the differential effect is better.

In combination with the previous article, it is concluded that when taking the maximum allowable sample step Δ*t*, the two-point differentiator, three-point differentiator, and four-point differentiator filter based on the Newton's interpolation have higher differential accuracy in the algorithm bandwidth and smaller transmission coefficient in the high-frequency region when compared with the actual differentiator. Therefore, the differentiator filter can effectively suppress the high-frequency interference.

#### **4. The experiment and result analysis**

We apply the proposed method in the high-performance hot water supply systems. The system belongs to the closed-loop system, and the controlled variable is temperature. The system consists of the following parts: comparator, PID controller, three-position relay, actuator, heat exchanger, and temperature sensor. The transfer function and parameters of the high-performance hot water supply system are also given in **Figure 6**.

In **Figure 6**, the three-position relay is a relay with dead zone characteristics. The dead zone width is determined by the deviation of the actual water temperature from the water temperature setting value.

Then we should consider the method of adjusting the parameters of the PID controller. In the proposed algorithm, the differential link in the PID controller is realized by the differentiator filter and the actual differential. Next, the specific method of adjusting PID controller parameters is introduced.

To reduce the system's sensitivity to high-frequency noise, the differentiator filter in the PID controller would adopt an increased sample step Δ*t*, which is calculated by Eq. (10).

For an actual differential whose transfer function is *Wd*ðÞ¼ *s kds=*ð Þ *Td* þ 1 , according to Eq. (18), *Td* is got by Eq. (11). Moreover, k = 2, 4, 6.667, respectively corresponds to the coefficient of two-point differentiator filters, three-point differentiator filters, and four-point differentiator filters.

After adopting the ideal differential in PID controller, a filter is added (*Ts* of the filter is the same as the time constant *Td* of the inertia link), and the effect of the control system is the same as that of the PID controller using the actual differential.

For the convenience of description, PID1 refers to the PID controller designed by the actual differentiator, and PID2 refers to the PID controller designed by the discrete differentiator with 2–4 points. Besides, the only difference between PID1 and PID2 is their differential link that PID1 adopted the actual differential link and PID2 adopted the proposed discrete differential link.

**Figure 6.** *The high-performance hot water supply system.*

#### *Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

**Table 4** shows the relative error of the modulus and phase of the system when the PID controller adopted the differentiator filter with 2–4 points and the actual differentiator at the cutoff frequency of the system, which are compared with the ideal differentiator.

**Table 4** indicates that the phase-frequency characteristics of the proposed differentiators have the smaller relative error and slight distortion near the cutoff frequency, which illustrates that it can meet the system requirements for transient quality.

Then we give several simulations to analyze the effect of the proposed PID controller in the high-performance hot water supply system, where the system applied PID1 and PID2 respectively. **Figure 7** shows the amplitude-frequency and phase-frequency characteristics of the PID controllers of the high-performance hot water supply system, where the differential link structure of the PID controllers is defined as follows:

#### 1.PID1-PID controller with the actual differential link.

2.PID2-PID controller with the discrete differential with an increased sample step.

The PID controllers in above were applied in high-performance hot water supply system. The results of the system's frequency characteristics were shown in **Figure 8**.

From **Figures 7** and **8**, it can be seen that the system with the differentiator filters has the more remarkable effect of high-frequency attenuation than the system with the actual differentiators near the frequency *<sup>ω</sup><sup>n</sup>* <sup>¼</sup> *<sup>n</sup>* <sup>∙</sup> <sup>2</sup>*<sup>π</sup>* <sup>Δ</sup>*<sup>t</sup>* , *n* ¼ 1, 2, 3 … , where *n* is an integer.

Next, the PID control strategy with the proposed differentiator and the feedforward-feedback control strategy were adopted in the above highperformance hot water supply system. **Figure 9** shows the simulation structure of the second strategy: feedforward-feedback control system. In which, the selected noise is a 2 KHz pulse signal with amplitude 5, and the PID controller is a traditional PID in the form of continuous time. The pulse signal was selected as system noise instead of the band-limited white noise because feedforward cannot overcome unmeasurable noise. Besides, the pulse signal can be regarded as sudden interference such as industrial interference caused by high-frequency electrical equipment and hot water consumption in the hot water supply system, which can represent the actual random system interference. In order to highlight the effectiveness of the proposed differentiator, the noise of the scheme in **Figure 6** keeps up with feedforward-feedback control strategy.


#### **Table 4.**

*The relative error of the differentiator filter with 2–4 sampling points and the actual differentiator.*

**Figure 7.** *Frequency characteristics of PID controller with the actual differential and the three-point differentiator.*

**Figure 8.** *Frequency characteristics of open-loop hot water supply system.*

*Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

**Figure 9.** *The simulation structure of the feedforward-feedback control system.*

As mentioned above, PID 1 refers to the PID controller with the actual differential and PID2 refers to the PID controller with the discrete differentiator. The comparison simulations of the PID control strategy with the proposed differentiator, the actual differentiator and the feedforward-feedback control strategies are given in **Figure 10**. PID1 adopted the three-point discrete differentiator with Δ*t* ¼ 1s. The parameters in PID1 are *Kp* ¼ 3,*Ki* ¼ 1,*Kd* ¼ 0*:*05. The parameters in PID2 are *Kp* ¼ 3,*Ki* ¼ 0*:*5,*Kd* ¼ 0*:*05.

It can be seen from the figure that the algorithm has less overshoot and oscillation compared with the feedforward-feedback control strategy and strategy 1, and the system finally reached a steady state of 50°C. The results proved that the PID realized by the discrete differential can achieve higher control quality than the feedforward-feedback compound control. This algorithm realizes the filtering effect of high-frequency noise in the high-performance hot water supply system even without the feedforward filtering link. Therefore, the structure of the highperformance hot water supply system could be simplified by introducing the proposed PID controller.

**Figure 11** shows the effect diagram of the high-performance hot water supply system with a PID controller to adjust the hot water setting temperature step by step without external interference. Curve 1 corresponds to the system effect when the PID controller's differential is an actual differential. Curve 2 corresponds to the system effect when the PID controller's differential link adopts the three-point discrete differentiator with an increasing sample step with Δ*t* ¼ 1s.

In **Figure 11**, the temperature is between 56.99°C and 57°C, and the time is from 400 seconds to 1000 seconds. The amplitude error is within 5%, and the system is in a stable state that the water temperature can meet the demand of people's life. Furthermore, the result indicates that the effect of the system with an actual

**Figure 10.** *Comparison of the results of the three methods.*

**Figure 11.** *Water temperature control effect with the proposed method and the actual differential.*

differential in the PID controller is consistent with the system's effect while introducing the two-point differentiator filter with an increased sample step in the PID controller. It shows that the proposed algorithm can ensure that the system's transient response is not overshot.

**Table 5** shows the standard deviation estimation of the input and output of the system under the different noise *f*, in which the PID controllers adopt the actual differential and the proposed differential.

The standard deviation estimation of the input and output of the continuous system (PID controller with actual differential) and the PID controller with the proposed differential is very similar. And when the four-point differentiator is adopted, the output standard deviation of the system is smaller than that of the system with actual differential. In addition, we have got the conclusion that the number of sampling points of the proposed method cannot exceed 4 in **Figures 3** and **4**. It shows that when the number of sampling points is 4, the differential error is the smallest and the control effect is the best.

The three-position relay with the dead zone characteristic can reduce the number of actuator actions and suppress the continuous small oscillations due to the quantization of the output of the PID controller and, at the same time, it simplifies the structure of the amplifier (heat exchanger) in the system.

However, the stability and control quality in such a nonlinear system depend on the relationship between �*a* and �*B* . Next, we will introduce how to get the relationship.

The description function (harmonic linearization coefficient) of the relay with dead zone characteristics is shown in Eq. (19):

$$K(A) = \frac{\sqrt{1 - \left(a/A\right)^2} \bullet 4B}{\pi A}, (A \ge a) \tag{19}$$


*Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

#### **Table 5.**

*The standard deviation of the output of the proposed new PID controller designed by the discrete differentiators with 2–4 sampling points in the high-performance hot water supply system.*

In Eq. (19), *A* is the amplitude of input harmonic signal. *a* is the dead zone width �*a* and *B* is relay response level �*B*.

In the dead zone relay, *K A*ð Þ would take the peak when <sup>¼</sup> ffiffi 2 <sup>p</sup> <sup>∙</sup> *<sup>a</sup>*. The peak of *K A*ð Þ is given in Eq. (20).

$$K(A) = 0.673 \bullet \frac{B}{a} \tag{20}$$

The dead zone width *a* take �0*:*5 (*a* ¼ �0*:*5), we can get the relay response level *B* in Eq. (21) through the relation *K A*ð Þ≤1 and (20):

$$B \le 0.785 \tag{21}$$

**Table 6** lists the number of actions of the control device under white noise interference. PID controllers in the system respectively adopt the proposed differentiator and the actual differential, the system with the former one has smaller operation times of equipment. And as the number of sampling points in the algorithm increases, the number of actions of the control equipment also increases.


m*—action number of the control equipment in the high-performance hot water supply system under white noise. control equipment 1—control equipment with the traditional PID.*

*control equipment 2—control equipment with the proposed PID designed by the discrete differentiators with 2–4 sampling points.*

**Table 6.**

*The action number of the control equipment which applied the PID controller designed by the discrete differentiators with 2–4 sampling points in the high-performance hot water supply system under white noise.*

#### **5. Conclusions**

Aiming at the problem that differential link would introduce the high-frequency interference while improving the dynamic characteristics of the system, this paper proposes a numerical differential algorithm based on the equally-spaced Newton interpolation. Then, a discrete differentiator was constructed by and proposed the concept of "algorithm bandwidth" to ensure the accuracy of the effect of differential. Subsequently, the impact of the number of sampling points and the sampling step on the performance of the "discrete differentiator" was studied. It is concluded that the differentiator filter has the best differential accuracy and the strongest antinoise ability for high-frequency noise when 2–4 sampling points and maximum allowable sample step are selected. Then, we designed a new PID controller based on a discrete differentiator. In order to verify the proposed PID controller's effect, some numerical simulations were given to verify its filtering effect. The results demonstrated that the disturbance introduced by high-frequency noises could be suppressed without extra filtering operation. Finally, we given an actual case of the high-performance hot water supply system, which adopted the cascade control scheme, and the temperature controller of the system applied the proposed PID controller. The results show that the PID controller designed by this algorithm has a feedforward filtering function even if the control system did not have a complex feedforward link or add an additional filter to suppress the high frequency noise in the system. At the same time, the introduction of the three-position relay effectively decreases the number of actuator actions. Compared with the traditional PID controller, the proposed PID controller with the discrete differentiator can achieve the effect of signal differentiation faster with a smaller mean square error, that is, it reaches the effect of "differentiation and filtering."

#### **Acknowledgements**

We want to thank to Zheng Liu for kind suggestions in the early version of this manuscript. The authors gratefully acknowledge the financial support of the Key Fund of Natural Science Foundation of Shaanxi Province (2019JLZ-06) and Key Project of Ministry of Industry and Information Technology of the People's Republic of China (2018-470).

#### **Conflict of interest**

We declare that we do not have any commercial or associative interest that represents a conflict of interest in connection with the work submitted. No potential conflict of interest was reported by the authors.

*Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

### **Author details**

Biao Wang\* and Shaojun Lin The School of Electronics and Control Engineering, Chang'an University, Xi'an, China

\*Address all correspondence to: wangbiao@chd.edu.cn

© 2022 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

### **References**

[1] Beerens R, Bisoffi A, Zaccarian L, Heemels W, Nijmeijer H, van de Wouw N. Reset integral control for improved settling of PID-based motion systems with friction. Automatica. 2019; **107**:483-492. DOI: 10.1016/j. automatica.2019.06.017

[2] Yu H, Guan Z, Chen T, Yamamoto T. Design of data-driven PID controllers with adaptive updating rules. Automatica. 2020;**121**:109185. DOI: 10.1016/j.automatica.2020.109185

[3] Schuhmann T, Hofmann W, Werner R. Improving operational performance of active magnetic bearings using Kalman filter and state feedback control. IEEE Transactions on Industrial Electronics. 2011;**59**:821-829. DOI: 10.1109/TIE.2011.2161056

[4] Bruce LM, Li J. Wavelets for computationally efficient hyperspectral derivative analysis. IEEE Transactions on Geoscience and Remote Sensing. 2001; **39**:1540-1546. DOI: 10.1109/36.934085

[5] Poznyak AS, Yu W. Robust asymptotic neuro-observer with time delay term. International Journal of Robust and Nonlinear Control: IFAC-Affiliated Journal. 2000;**10**:535-559. DOI: 10.1109/ISIC.2000.882893

[6] Alwi H, Edwards C. An adaptive sliding mode differentiator for actuator oscillatory failure case reconstruction. Automatica. 2013;**49**:642-651. DOI: 10.1016/j.automatica.2012.11.042

[7] An H, Fidan B, Wu Q, Wang C, Cao X. Sliding mode differentiator based tracking control of uncertain nonlinear systems with application to hypersonic flight. Asian Journal of Control. 2019;**21**:143-155. DOI: 10.1002/ asjc.1932

[8] He S, Wang J, Lin D. Composite guidance laws using higher order sliding mode differentiator and disturbance observer. Proceedings of the Institution of Mechanical Engineers, Part G: Journal of Aerospace Engineering. 2015;**229**: 2397-2415. DOI: 10.1177/09544100 15576365

[9] Kikuuwe R, Pasaribu R, Byun G. A first-order differentiator with firstorder sliding mode filtering. IFAC-PapersOnLine. 2019;**52**:771-776. DOI: 10.1016/j.ifacol.2019.12.056

[10] Feng J, Wang W, Chen Y. An improved tracking-differentiator filter based on Taylor's formula. Optik. 2018; **158**:1026-1033. DOI: 10.1016/j.ijleo.2017. 12.198

[11] Wang G, Wang B, Zhao N, Xu D. A novel filtering method based on a nonlinear tracking differentiator for the speed measurement of direct-drive permanent magnet traction machines. Journal of Power Electronics. 2017;**17**: 358-367. DOI: 10.6113/JPE.2017.17.2.358

[12] Bertsias P, Psychalinos C. Differentiator based fractional-order high-pass filter designs. In: 2018 7th International Conference on Modern Circuits and Systems Technologies (MOCAST); 5-7 May 2018; Thessaloniki, Greece: IEEE; 2018. pp. 1-4. DOI: 10.1109/MOCAST43348.2018

[13] Hildebrand FB. Introduction to Numerical Analysis. Courier Corporation; 2nd ed. New York: Dover Publications; 1987. 669 p.

[14] Bazán FS, Bedin L. Filtered spectral differentiation method for numerical differentiation of periodic functions with application to heat flux estimation. Computational and Applied Mathematics. 2019;**38**:165. DOI: 10.1007/s40314-019-0968-4

[15] Chapra SC, Canale RP. Numerical Methods for Engineers. *Research and Application of PID Controller with Feedforward Filtering Function DOI: http://dx.doi.org/10.5772/intechopen.101618*

Boston: McGraw-Hill Higher Education; 2010

[16] Schmitz G, Christiansen O. Gaussian process regression to accelerate geometry optimizations relying on numerical differentiation. The Journal of Chemical Physics. 2018; **148**:241704. DOI: 10.1063/1.5009347

[17] Zill D, Wright WS. Advanced Engineering Mathematics; 5th ed. US: Jones & Bartlett Learning; 2012. 1020 p.

[18] Chen B, Zhao Z, Li Z, Meng Z. Numerical differentiation by a Fourier extension method with super-order regularization. Applied Mathematics and Computation. 2018;**334**:1-10. DOI: 10.1016/j.amc.2018.04.005

[19] King JT, Murio DA. Numerical differentiation by finite-dimensional regularition. IMA Journal of Numerical Analysis. 1986;**6**:65-85. DOI: 10.1093/ imanum/6.1.65

[20] Liu Y, Sun H, Yin X, Xin B. A new Mittag-Leffler function undetermined coefficient method and its applications to fractional homogeneous partial differential equations. Journal of Nonlinear Sciences and Applications. 2017;**10**:4515-4523. DOI: 10.22436/ jnsa.010.08.43

[21] Abdulghafor R, Turaev S. Consensus of fractional nonlinear dynamics stochastic operators for multi-agent systems. Information Fusion. 2018;**44**: 1-21. DOI: 10.1016/j.inffus.2017.11.003

[22] Carnicer JM, Khiar Y, Peña JM. Optimal interval length for the collocation of the Newton interpolation basis. Numerical Algorithms. 2019;**82**: 895-908. DOI: 10.1007/s11075-018- 0632-x

[23] Yang Y, Liang Y, Pan Q, Qin Y, Wang X. Gaussian-consensus filter for nonlinear systems with randomly delayed measurements in sensor

networks. Information Fusion. 2016;**30**: 91-102. DOI: 10.1016/j.inffus.2015. 12.003

[24] Chen Y, Qi G, Li Y, Sheng A. Diffusion Kalman filtering with multichannel decoupled event-triggered strategy and its application to the opticelectric sensor network. Information Fusion. 2017;**36**:233-242. DOI: 10.1016/ j.inffus.2016.12.004

[25] Manju B, Sneha M. ECG denoising using Wiener Filter and Kalman Filter. Procedia Computer Science. 2020;**171**: 273-281. DOI: 10.1016/j.procs.2020. 04.029
