1 Introduction

The first contribution of this proposal is the online update of the gains for a PID controller which is a fundamental part due the values of the fuzzy sets of each rule are tuned using ideal values through the increase of the variables of each gain which minimize the error signal of control and still the stability for the plant response, many researches were made for improve the signal of control, between them can be found some as mentioned below.

In [1] a fuzzy controller is used to reduce the overstress that arise in the plant so as improve the speed of response. The work done in [2] considers different variables that influence directly or indirectly in the process by which different types of controllers are implemented to counter the effects of these variables. The usage of a T1 SFLS PID controller based on two fuzzy logic controllers (FLC) acting as inputs, where the PID gains are calculated using the Ziegler-Nichols are presented in both [3, 4]. It can use the simulation to make comparisons between a classic PID controller and a T1 SFLS PID controller, and also evaluate the results of both controllers and observe the differences between them. A control of a single process that uses a T1 SFLS PID and a type-2 SFLS PID is presented by [5]. In this case, three different PID controllers are obtained using a genetic algorithm (GA), named linear PID controller, T1 SFLS PID, and type-2 SFLS PID. The type-2 SFLS PID offers the best control for the application. The work done in [6] processes a type-2 FLS to control the position of an actuator in order of few millimeters, and uses the parameters with uncertainty. In [7] an interval type-2 SFLS PID controller with two inputs and one output is used for switching control. Has been presented a hybrid algorithm for interval type-1 non-singleton type-2 TSK fuzzy logic system [8] that is capable of compensate for uncertain measurements, on this algorithm is used the back-propagation (BP) method for calculate the backward pass, the error propagates backward and the antecedent parameters. In [9] is used an Interval type-1 non-singleton type-2 fuzzy logic system for control the strip head end thickness calculating the roll gap however not is presented any method for update the controller gains like Back-propagation. In [10] a fuzzy self-tuning PID Smith is proposed, the error and change of error are the inputs, which enter to the fuzzification, then to fuzzy inference based and after the parameters of PID control are obtained when add these to the gains. A Non-singleton type-1 fuzzy logic system is used like an input that update each gain of a PID controller [11] which is applied on an Atmega 2560 for controlling a stepper motor. In [12] is used a PID control and a fuzzy system for longitudinal control of an air craft where a type-1 fuzzy system and a PID controller are used for comparison.

The present work introduce a novel methodology that update the rule base of a type-1 fuzzy logic system for the gains of a PID controller through an BP algorithm with the purpose of improve the output signal.

2 Mathematical Models

The PID algorithm is able to work in a very reliable manner even when undesirable conditions occur. This thanks to the use of any information that is omitted.

The Eq. (1) shows the mathematical representation of the proposed PID version, which has already been implemented in different jobs with excellent results [13].

$$ u\left( t \right) = \frac{Ru}{Bp}*\left[ {e_{n} \left( t \right) - \frac{Td\Delta y\left( t \right)}{{Tc R_{y} }}} \right] + Int\left( t \right) $$
(1)

where \( Ru \) is the actuator range, \( Bp \) is the proportional band, \( e_{n} \left( t \right) \) is the normalized error, \( Td \) is the derivative time, \( \Delta y\left( t \right) \) is the increase output of the process, \( Tc \) is the control period, \( Ry \) is the transmitter range with which the variable is measured in physical units, \( Int\left( t \right) \) represents the integral mode in the PID algorithm. The Eq. (2) shows how to calculate the normalized error for (1) where \( y_{rf} \left( t \right) \) is the reference value, \( y_{f} \left( t \right) \) is the filtered output value. The calculation for \( Int\left( t \right) \) variable is performed using (3) where \( Int\left( {t - 1} \right) \) is the previous integral mode of the PID, \( Tc \) is the control period, \( Ti \) is the integral time. The Eq. (4) represents the mathematical model of a first order plant with one delay.

$$ e_{n} \left( t \right) = \frac{{y_{rf} \left( t \right) - y_{f} \left( t \right)}}{{R_{y} }} $$
(2)
$$ Int\left( t \right) = Int\left( {t - 1} \right) + \frac{TcRu}{TiBp}e_{n} \left( t \right) $$
(3)
$$ y\left( t \right) = k_{1} u\left( {t - p} \right) + \alpha y\left( {t - 1} \right) $$
(4)

where: \( k_{1} = \frac{KTs}{T1} \), \( u\left( {t - p} \right) \) is the signal delay, \( \alpha = e^{{ - \left( {\frac{Ts}{T1}} \right)}} \), \( y\left( {t - 1} \right) \) is the control signal with one delay time.

Type-1 FLS (5) shows the mathematical representation for the fuzzifier of the T1 SFLS where \( l \) is the number of M-rules, \( i \) is the number of singleton inputs, \( \mu \left( k \right) \) is the membership function centered at the measured input \( x_{i}^{ - l} \) and \( \sigma_{i}^{l} \) is the standard derivation. The equation for the deffuzifier is shown in (6) with this equation is calculated the output signal of the system.

$$ \mu \left( k \right) = \prod\nolimits_{i = 1}^{n} {\exp \left( { - \frac{1}{2}\left( {\frac{{x_{i}^{*} - x_{i}^{ - l} }}{{\sigma_{i}^{l} }}} \right)^{2} } \right)} $$
(5)
$$ f\left( x \right) = \frac{{\mathop \sum \nolimits_{l = 1}^{m} y^{ - l} \left( {\mathop \prod \nolimits_{i = 1}^{n} \exp \left( { - \frac{1}{2}\left( {\frac{{x_{i}^{*} - x_{i}^{ - l} }}{{\sigma_{i}^{l} }}} \right)^{2} } \right)} \right)}}{{\mathop \sum \nolimits_{l = 1}^{m} \left( {\mathop \prod \nolimits_{i = 1}^{n} \exp \left( { - \frac{1}{2}\left( {\frac{{x_{i}^{*} - x_{i}^{ - l} }}{{\sigma_{i}^{l} }}} \right)^{2} } \right)} \right)}} $$
(6)

Equations (7, 8 and 9) show how to combine the gains were entered to PID, where \( KP_{0} \) is the initial gain of the PID controller and \( \Delta KP \) is the updated gain calculated by the FLS, likewise, in (8) \( KI_{0} \) initial gain and the estimated \( \Delta KI \) and \( KD_{0} \) with \( \Delta KD \) to estimate the total derivative gain for \( KD \) is represented by (9).

$$ KP = \frac{Ru}{Bp} = KP_{0} + \Delta KP $$
(7)
$$ Ti = KI_{0} + \Delta KI $$
(8)
$$ Td = KD_{0} + \Delta KD $$
(9)

To start using the \( BP \) method begins with specifying the structure of the FLS to be implemented. Here we choose the FLS with singleton fuzzifier, center average defuzzyfier, Gaussian membership function (GMF) and the product inference engine [14]. Taking into account these factors, mathematical representation of the type-1 FLS is as (10) in which it is included the above parameters where: \( X_{i} \) is the input of the system, \( X_{i}^{l} \) is the fuzzy set and \( \sigma_{i}^{l} \) is the standard deviation. To calculate the error of the type-1 FLS the (11) is used:

$$ f\left( x \right) = \frac{{\mathop \sum \nolimits_{l = 1}^{M} y^{l} \left( {\mathop \prod \nolimits_{i = 1}^{n} \exp \left( { - \left( {\frac{{x_{i} - x_{i}^{l} }}{{\sigma_{i}^{l} }}} \right)^{2} } \right)} \right)}}{{\mathop \sum \nolimits_{l = 1}^{M} \left( {\mathop \prod \nolimits_{i = 1}^{n} \exp \left( { - \left( {\frac{{x_{i} - x_{i}^{l} }}{{\sigma_{i}^{l} }}} \right)^{2} } \right)} \right)}} $$
(10)
$$ e^{p} = \frac{1}{2}\left[ {f\left( {x_{0}^{p} } \right) - y_{0}^{p} } \right]^{2} $$
(11)

The gradient descent algorithm is used to determine the system parameters such as \( y^{ - l} \), \( x_{i}^{ - l} \), and \( \sigma_{i}^{l} \). (12) is the product of the GMF. The input of the system is passed through a product GMF operator [9] where: \( x_{oi}^{p} \) is the input of the system \( x_{i}^{l} \left( q \right) \) is the fuzzy set and \( \sigma_{i}^{l} \left( q \right) \) is the standard deviation. (12) is passed through a summation operator and a weighted summation operator to obtain the (13):

$$ z^{l} = \prod\nolimits_{i = 1}^{n} {\exp \left( { - \left( {\frac{{x_{oi}^{p} - x_{i}^{l} \left( q \right)}}{{\sigma_{i}^{l} \left( q \right)}}} \right)^{2} } \right)} $$
(12)
$$ b = \sum\nolimits_{l = 1}^{m} {z^{l} } $$
(13)

The Eq. (14) represents the sum of the product resulting from the multiplication of \( y^{l} \left( q \right) \) by \( z^{l} \) where: \( y^{l} \left( q \right) \) is the estimator and \( z^{l} \) is the product of all membership functions. The output of the fuzzy system is calculated using the (15), where the numerator is (14) and the denominator is (13).

$$ a = \sum\nolimits_{l = 1}^{m} {y^{l} \left( q \right)z^{l} } $$
(14)
$$ f = \frac{a}{b} $$
(15)

To determinate \( y^{ - l} \), it is part of the (16). From the (16) the (17) is obtained by the chain rule.

$$ y^{ - l} \left( {q + 1} \right) = y^{l} \left( q \right) - \alpha \frac{\partial e}{{\partial y^{l} }} $$
(16)
$$ \frac{\partial e}{{\partial y_{i}^{ - l} }} = \left( {f - y} \right)\frac{\partial f}{\partial \alpha }\frac{\partial \alpha }{{\partial y^{ - l} }} = \left( {f - y} \right)\frac{1}{b}z^{l} $$
(17)

Then proceeds to substituting the (17) in the (16) to obtain the (18) which represents the training algorithm for \( y^{ - l} \) for each type-1 fuzzy rule base. To determinate \( x_{i}^{ - l} \) it is part of the (19). (20) is obtained from the (19) by the chain rule.

$$ y^{ - l} \left( {q + 1} \right) = y^{ - l} \left( q \right) - \alpha \frac{f - y}{b}z^{l} $$
(18)
$$ x_{i}^{ - l} \left( {q + 1} \right) = x_{i}^{ - l} \left( q \right) - \alpha \frac{\partial e}{{\partial x_{i}^{ - l} }} $$
(19)
$$ \frac{\partial e}{{\partial x_{i}^{ - l} }} = \left( {f - y} \right)\frac{\partial f}{{\partial z^{l} }}\frac{{\partial z^{l} }}{{\partial x_{i}^{ - l} }} = \left( {f - y} \right)\frac{{y^{ - l} - f}}{b}z^{{l^{2} }} \frac{{\left( {x_{0i}^{p} - x_{i}^{ - l} } \right)}}{{\sigma_{i}^{{l^{2} }} }} $$
(20)

Once obtained the (20) proceeds to perform value substitution presented in (20), these values are substituted in (19), whereby there is obtained the (21) which represent the training algorithm for \( x_{i}^{ - l} \) of each fuzzy rule base:

$$ x_{i}^{ - l} \left( {q + 1} \right) = x_{i}^{ - l} \left( q \right) - \alpha \frac{f - y}{b}\left( {y^{ - l} \left( q \right) - f} \right)z^{{l^{2} }} \frac{{\left( {x_{0i}^{p} - x_{i}^{ - l} \left( q \right)} \right)}}{{\sigma_{i}^{{l^{2} }} \left( q \right)}} $$
(21)

To calculate \( \sigma_{i}^{l} \) the same procedure was used to calculate the (22) and (23). That is to say to the (22) that arises is applied the chain rule, the resulting equation is substituted into (22), whereby there is obtained the (23) which represents the training algorithm for \( \sigma_{i}^{l} \).

$$ \sigma_{i}^{l} \left( {q + 1} \right) = \sigma_{i}^{l} \left( q \right) - \alpha \frac{\partial e}{{\partial \sigma_{i}^{l} }} $$
(22)
$$ \sigma_{i}^{l} \left( {q + 1} \right) = \sigma_{i}^{l} \left( q \right) - \alpha \frac{f - y}{b}\left( {y^{ - l} \left( q \right) - f} \right)z^{{l^{2} }} \frac{{\left( {x_{0i}^{p} - x_{i}^{ - l} \left( q \right)} \right)^{2} }}{{\sigma_{i}^{{l^{3} }} \left( q \right)}} $$
(23)

3 Proposed Methodology

Using (1) [13], type-1 SFLS, and the \( BP \) algorithm, aFL PID controller is proposed. The implementation of each of the three SFLS [14] uses three fuzzy rules previously established for the calculation of \( \Delta KP \), \( \Delta KI \) and \( \Delta KD \), [15]. The design of these fuzzy rules represented in Table 1 depends on the process under the control. These are three important variables used to create the tuning of the three controller gains: the error (E), the change of error (EC), and the increment of the gain (\( \Delta K \)). The error and the change of error have seven fuzzy sets: NB, NM, NS, ZO, PS, PM and PB are respectively Negative Big, Negative Medium, Negative Small, Zero, Positive Small, Positive Medium, Positive Big. Each gain has a different output but the data of error and change of error are the same. Table 1 shows the fuzzy rules designed for the \( \Delta KP \) gain estimation, the fuzzy rules designed for the \( \Delta KI \) gain and the fuzzy rules designed for the \( \Delta KD \) gain. Each fuzzy rule base has an array of 49 fuzzy rules for the output signal \( \Delta KP \), \( \Delta KI \) and \( \Delta KD \) respectively.

Table 1. (a) Fuzzy Rules for \( \Delta KI \), (b) Fuzzy Rules for \( \Delta KP \), (c) Fuzzy Rules for \( \Delta KD \).

4 Results

Were trained three different controllers for compare the response of its signals with the final purpose of see the performance of the proposed methodology.

In this section, the results are shown with the implementation of the proposed T1 SFLS PID controller with the BP training where it can see the done iteration for the BP algorithm between the fuzzy inference engine (FIE) and the fuzzy rule bases (FRB), here basically the BP update the FRB which in turn update the FIE and the same procedure is done in the three gains KP, KI and KD for improve the response of the PID signal. Figure 1 shows the basic structure of the T1 SFLS PID-BP controller. The learning criterion used for the BP algorithm is \( E_{u} = 0 \), \( \Delta E_{u} = 0 \). The steady-state error (Fig. 2c) is a measure of the accuracy and performance of the proposed controller.

Fig. 1.
figure 1

Structure of T1 SFLS PID-BP.

Fig. 2.
figure 2

Comparison between (a) PID, (b) T1 SFLS PID and (c) T1 SFLS PID-BP

In the Fig. 2 the pointed line shows the response of the PID controller. As observed, occurs an overrun set by set-point. Intermittent line shows the PID singleton type-1 which apply fuzzy logic behavior, and as can be seen, an improvement is obtained in the output response. The fuzzy logic implemented in this case use the fuzzy rules generated for the gains of KP, KI and KD. And, continues line shows the response signal behavior of the PID singleton type-1 using the BP method for the online update of the fuzzy rules.

As observed in Fig. 2 the T1 SFLS PID represented by the intermittent line has a better response to the output in comparison with the PID represented by the pointed line, due the signal in T1 SFLS PID has a more low overshooting, however the response in the time and the stabilization are more slow than the PID. Now the T1 SFLS PID-BP represented for continue line shows a response in the output with the most minimal overshooting, an average stabilization and with a bad point in the maximum time in the overshooting. Table 2 shows the values obtained from the behavior of the three controllers: (a) the maximum overshooting, (b) the time in which the maximum overshooting is presented, and (c) the time in which the system stabilizes.

Table 2. Time for stabilization max overshooting, and the time for the max overshooting

5 Conclusions

According to the experimental results, the T1 SFLS PID-BP presents the better performance in comparison with the two benchmarking controllers due that have a smoother signal of response that the PID and the T1 SFLS PID controllers. This was achieved due the implementation of the mechanism to update the fuzzy rules. Further, the overshooting for the behavior of the plant is reduced until 0.3 which is much better for the control of actuators in T1 SFLS PID-BP, and the velocity of the response is faster. Although the speed is not very good in comparison with the others controller the stability in stationary state is better because it present a smaller damping.