1 Introduction

The control problem of uncertain complex nonlinear systems is one of the biggest challenges of the control engineering. Fortunately, the advanced control system theory has gained a huge progress in the past decades to deal with this issue as testify the big number of publications, where some recent literature can be found in (Seo et al. 2007; Jovanovic 2002; Feki 2003; Hua et al. 2005; Nejati et al. 2012; Kaddissi et al. 2005; Majd and Mobayen 2015; Mobayen 2015a, b, c, d; Mobayen and Tchier 2016; Poursafar et al. 2010; Ghaffari et al. 2013; Akhtar and Bernstein 2005; Babaei and Salamci 2014; Gomez-Ortega et al. 2001; Bernard and Kuntze 1999; Ge et al. 2001; Poursamad and Markazi 2009; Khazaee et al. 2017; Fu et al. 2016; Cui et al. 2017). Effectively, depending on the system complexity, many techniques have been proposed; feedback linearization control (Seo et al. 2007; Jovanovic 2002), adaptive feedback control (Feki 2003; Hua et al. 2005), backstepping control (Nejati et al. 2012; Kaddissi et al. 2005), sliding mode control (SMC) (Majd and Mobayen 2015; Mobayen 2015a, b; Mobayen and Tchier 2016), model predictive control (Poursafar et al. 2010; Ghaffari et al. 2013), composite nonlinear feedback control (CNF) (Mobayen 2015c, d), model reference adaptive control (Akhtar and Bernstein 2005; Babaei and Salamci 2014), intelligent control (Gomez-Ortega et al. 2001; Bernard and Kuntze 1999) and adaptive controls based on the universal approximators (fuzzy systems and neural networks) (Ge et al. 2001; Poursamad and Markazi 2009; Khazaee et al. 2017; Fu et al. 2016; Cui et al. 2017).

Despite the enormous progress of the control theory, the classical proportional integral derivative (PID) control remains the most commonly control technique in the industry (Astrom et al. 1995). This popularity is attributed to the controller’s simple and universal structure familiar to operators, its effectiveness in a wide range of operation conditions, its low cost and ease of implementation.

In order for a PID controller to work well it needs to be adequately tuned, such as the closed loop system behaves in specified desired way quickly and precisely. Many techniques have been proposed in literature to this end. Some traditional methods have been used for many decades ago. In empirical methods like Ziegler–Nichols (Astrom et al. 1995; Ziegler and Nichols 1942), the parameters are calculated based on the system step response experiment and predefined tables. In frequency domain design methods (Astrom et al. 1995), given a model of the system to control, the controller’s parameters are calculated analytically or by using frequency plotting in order to meet a set of frequency specifications such as phase margin and gain margin for good stability robustness. Time-domain design methods (Astrom et al. 1995; Zhang et al. 2002) are to satisfy the requirement of some temporal performance indices such as the integral squared error (ISE) or the integral time absolute error (ITAE), etc.

To enhance the capabilities of classical PID parameter tuning techniques, several intelligent approaches have been proposed in recent literature (Lu et al. 2010; Srikanth and Chandra 2012; Andromeda et al. 2012; Chiou et al. 2012; Ercin and Coban 2011; Ma 2009; Hanifah et al. 2013; Knoop and Pérez 1994). Genetic algorithms (GA) (Lu et al. 2010; Srikanth and Chandra 2012), particle swarm optimization (PSO) (Andromeda et al. 2012; Chiou et al. 2012), bees algorithm (BA) (Ercin and Coban 2011), and ant colony optimization (ACO) (Ma 2009; Hanifah et al. 2013).

The role of the entire above mentioned methods is to find fixed values of the PID controller parameters which will be kept unchanged when the control system is operating while satisfying a set of specifications. Unfortunately, such designed controllers cannot give good performances when the system under control operates on multiple setpoints, its dynamics is unknown, or exhibit changing parameters.

In order to cope with these classes of systems, it is highly suitable to increase the capabilities of PID controllers by adding new features. Some approaches have been proposed in literature. The gain scheduling techniques (Knoop and Pérez 1994; Yesil et al. 2004) are used when the system exhibits distinct operating ranges. An appropriate mechanism is used such as the controller switch between a set of controller parameter values. The fuzzy supervisors (Soyguder et al. 2009; Babulu and Kumar 2012; Lai et al. 2016; Juang et al. 2008) are used to adjust the PID controller parameters according to the error between the setpoint and the controlled signal by means of a set of linguistic rules and a fuzzy logic inference system.

To further extend the PID control performance for unknown systems or systems that the dynamics change over time, additional PID control that involves parameters online adjustments are needed, which is adaptive PID control (Huang et al. 2002; Mizumoto et al. 2009; Yu 2006; Kumar et al. 2016; Al-zohairy and Salem 2016a, b; Yu et al. 2007; Guo et al. 2009; Der Chang et al. 2003; Eslami et al. 2006; Tamura and Ohmori 2006, 2007; Shen et al. 2014; Boubakir et al. 2011). The case of adaptive PID control for MIMO systems has been studied in (Yu et al. 2007; Guo et al. 2009; Al-zohairy and Salem 2016b; Der Chang et al. 2003; Eslami et al. 2006; Tamura and Ohmori 2006, 2007; Shen et al. 2014; Boubakir et al. 2011). In (Yu et al. 2007; Guo et al. 2009), the authors have used indirect scheme. First, a neural network (NN) is used to approximate the plant dynamics, where the learning task is carried out by the Extended Kalman Filter (EKF). Then, the PID control parameters’ adaptation is done using the Lyapunov design method such as to minimize the squared tracking error. The disadvantage of this approach is the complexity of the NN adaptation using the EFK. In (Al Zohairy and Salem 2016b; Der Chang et al. 2003; Eslami et al. 2006), the authors have proposed a direct adaptation approach of the PID controller parameters by using a NN whose parameters are adjusted by the gradient descent-based algorithm. The absence of the stability demonstration and the non guarantee of the closed-loop variables boundedness make these results questionable. In (Tamura and Ohmori 2006, 2007), the authors propose a MIMO PID adaptive control law for a class of linear system under certain restrictive assumptions. The adaptation law is derived using the Lyapunov’s stability theorem.

In (Shen et al. 2014; Boubakir et al. 2011), the authors propose a self-tuning PID controller for a class of nonlinear MIMO systems, in which the PID controller parameters are adjusted online by using the gradient decent method.

The present work aims to improve the adaptive PID controller in (Shen et al. 2014; Boubakir et al. 2011) by the introduction of a fuzzy system to estimate the PID control gains to deal with a class of disturbed MIMO nonlinear systems with unknown dynamics and dead-zone input nonlinearities.

The main advantage of the proposed approach over the existing fuzzy adaptive control techniques in literature (Poursamad and Markazi 2009; Khazaee et al. 2017; Fu et al. 2016; Cui et al. 2017) with the present problem is that the proposed control scheme in this paper combines the advantages of the classical PID control and the advanced adaptive control, namely the simple universal structure familiar to industrial operators of the former and the good performance with complex systems of the latter.

The main contributions of this work are as follows: (i) According to the universal approximation theorem discussed by Wang (1994), using the fuzzy system in this paper guarantees that the approximation error is of the order of the modeling error. In fact, the introduction of this fuzzy system in this paper allows canceling the restrictive assumptions about the approximation error in (Shen et al. 2014; Boubakir et al. 2011). (ii) In order to overcome these drawbacks related to the use of \(\sigma\)-modification in the adaptive law (Shen et al. 2014; Boubakir et al. 2011), in the present work we have introduced the \(e\)-modification concept. (iii) The proposed control scheme deal with a large class of MIMO systems; disturbed and unknown dynamics and dead-zone type input nonlinearities. (iv) A comparative study is carried out between the proposed approach with \(\sigma\)-modification adaptation law, the proposed approach with \(e\)-modification adaptation law and the adaptive fuzzy control law developed in (Cui et al. 2017).

The paper is organized as follows: Section 2 presents the problem formulation; the class of the MIMO systems under study is presented and the control objective is defined. In Sect. 3 the proposed fuzzy PID control scheme is presented; the adaptation law is given and stability of the whole system is analyzed. Section 4 shows simulation results with two systems; a two-link manipulated robot and a quadrotor. Section 5 concludes the paper.

2 Problem formulation and ideal control law

2.1 Problem formulation

Consider the class of uncertain nonlinear MIMO systems represented by the following differential equations:

$$\begin{array}{*{20}c} {y_{1}^{{\left( {r_{1} } \right)}} = f_{1} \left( x \right) + \sum\limits_{j = 1}^{p} {g_{1j} \left( x \right)N_{j} (u_{j} ) + \delta_{1} \left( t \right)} } \\ \vdots \\ {y_{p}^{{\left( {r_{p} } \right)}} = f_{p} \left( x \right) + \sum\limits_{j = 1}^{p} {g_{pj} \left( x \right)N_{j} (u_{j} ) + \delta_{p} \left( t \right)} } \\ \end{array} ,$$
(1)

where \(x = \left[ { y_{1} ,\dot{y}_{1} , \ldots ,y_{1}^{{\left( {r_{1} - 1} \right)}} , \ldots , y_{p} , \dot{y}_{p} , \ldots , y_{p}^{{\left( {r_{p} - 1} \right)}} } \right]^{T}\) is the overall state vector, which is assumed available for measurement. \(u = \left[ {u_{1} , \ldots ,u_{P} } \right]\) is the control input vector, \(y = \left[ {y_{1} , \ldots ,y_{P} } \right]\) is the output vector. \(f_{i} \left( x \right), g_{ij} \left( x \right), \left( { i, j = 1, \ldots , p} \right)\) are unknown nonlinear functions. \(N\left( u \right) = \left[ {N_{1} \left( {u_{1} } \right), \ldots ,N_{p} (u_{P} } \right)]\) is the dead-zone type inputs’ nonlinearities vector which is considered unknown. \(\delta = [\delta_{1} \left( t \right), \delta_{2} \left( t \right), \ldots , \delta_{p} \left( t \right)]\) is the vector of bounded disturbances; we suppose here \(\left| {\delta_{i} \left( t \right)} \right| \le \delta_{i}^{*}\), where \(\delta_{i}^{*}\) is a positive constant (\(i = 1, \ldots , p\)).

We can write the system (1) in a compact form as

$$y^{\left( r \right)} = f\left( x \right) + G\left( x \right)N\left( u \right) + \delta ,$$
(2)

where \(y_{ }^{{\left( {r_{ } } \right)}} = \left[ {y_{1}^{{\left( {r_{1} } \right)}} \ldots y_{p}^{{\left( {r_{p} } \right)}} } \right]^{T}\), \(f\left( x \right) = \left[ {f_{1} \left( x \right) \ldots f_{p} \left( x \right)} \right]^{T}\), \(G\left( x \right) = \left[ {\begin{array}{*{20}c} {g_{11} \left( x \right)} & \cdots & {g_{1p} \left( x \right)} \\ { \vdots } & \ddots & \vdots \\ {g_{p1} \left( x \right)} & \cdots & {g_{pp} \left( x \right)} \\ \end{array} } \right].\)

The objective is to design the control law \(u\left( t \right)\) to force the output \(y\) tracking of a specified desired trajectory \(y_{d}\), with ensuring the boundedness of all variables in the closed-loop system.

Throughout this paper we make the following assumptions:

2.2 Assumption 1

Suppose that the matrix \(G\left( x \right)\) is symmetric strictly positive and it is limited by two positive constants \(g_{0}\) and \(g_{1}\) as \(0 < g_{0} I_{p} \le G\left( x \right) < g_{1} I_{p}\), where \(I_{p}\) is the \(p \times p\) identity matrix.

2.3 Assumption 2

Each desired trajectory \(y_{di}\) \(\left( {i = 1, 2, \ldots ,p} \right)\) is a known bounded function of time with bounded known derivatives, and \(y_{di}\) is supposed \(r_{i}\)-times differentiable.

Let us define the tracking errors as

$$\begin{array}{*{20}c} {e_{1} \left( t \right) = y_{d1} \left( t \right) - y_{1} \left( t \right)} \\ \vdots \\ {e_{p} \left( t \right) = y_{dp} \left( t \right) - y_{p} \left( t \right)} \\ \end{array}$$
(3)

and the filtered tracking errors as

$$\begin{array}{*{20}c} {s_{1} \left( t \right) = \left( {\frac{d}{dt} + \lambda_{1} } \right)^{{r_{1} - 1}} e_{1} \left( t \right), \, \lambda_{1} > 0} \\ \vdots \\ {s_{p} \left( t \right) = \left( {\frac{d}{dt} + \lambda_{p} } \right)^{{r_{p} - 1}} e_{p} \left( t \right),\, \lambda_{p} > 0.} \\ \end{array}$$
(4)

Since the equality \(s_{i} \left( t \right) = 0\) means that the tracking error \(e_{i} \left( t \right)\) and all its derivatives decrease exponentially to zero (Slotine and Li 1991), it is sufficient to design a control law that ensures \(s_{i} \left( t \right) \to 0, i = 1, \ldots , p\).

The time derivative of the filtered tracking errors can be written as follows:

$$\begin{array}{*{20}c} {\dot{s}_{1} = v_{1} - f_{1} \left( x \right) - \sum\limits_{j = 1}^{p} {g_{1j} \left( x \right)N_{1} (u_{1} ) - \delta_{1} \left( t \right)} } \\ \vdots \\ {\dot{s}_{p} = v_{p} - f_{p} \left( x \right) - \sum\limits_{j = 1}^{p} {g_{pj} \left( x \right)N_{j} (u_{j} ) - \delta_{p} \left( t \right)} } \\ \end{array} ,$$
(5)

where

$$\begin{array}{*{20}c} {v_{1} = y_{d1}^{{\left( {r_{1} } \right)}} + \beta_{{1, r_{1} - 1}} e_{1}^{{\left( { r_{1} - 1} \right)}} + \ldots + \beta_{1, 1} \dot{e}_{1} } \\ \vdots \\ {v_{p} = y_{dp}^{{\left( {r_{p} } \right)}} + \beta_{{p, r_{p} - 1}} e_{p}^{{\left( { r_{p} - 1} \right)}} + \ldots + \beta_{p, 1} \dot{e}_{p} } \\ \end{array}$$
(6)

with \(\beta_{i, j} = \frac{{\left( {r_{i} - 1} \right)!}}{{\left( {r_{i} - j} \right)!\left( {j - 1} \right)!}}\,\lambda_{i}^{{r_{i} - j}} , i = 1, \ldots ,p, \,j = 1, \ldots ,r_{i} - 1.\)

Let us denote

$$s = \left[ {s_{1} \ldots s_{p} } \right]^{T} ,\;v = \left[ {v_{1} \ldots v_{p} } \right]^{T} .$$

By substituting in Eq. (6) we find

$$\dot{s} = v - f\left( x \right) - G\left( x \right)N\left( u \right) - \delta \left( t \right).$$
(7)

2.4 Actuator nonlinearities

The output of the each dead-zone nonlinearity can be expressed as follows (Wang et al. 2004; Su et al. 2003):

$$N_{i} (u_{i} ) = a_{i} u_{i} + b_{i} \left( t \right),\;{\text{for}}\;i = 1,2, \ldots ,p,$$
(8)

where \(a_{i}\) is a positive constant gain, and \(b_{i} \left( t \right)\) is a nonlinear function bounded by a positive constant \(b_{i}^{*}\) (\(\left| {b_{i} \left( t \right)} \right| \le b_{i}^{*}\)).

Now, we denote

$$b\left( t \right) = \left[ {b_{1} \left( t \right), b_{2} \left( t \right), \ldots \ldots .., b_{p} \left( t \right)} \right],$$
$$b^{*} = \left[ {b_{1}^{*} , b_{2}^{*} , \ldots \ldots .., b_{p}^{*} } \right] ,$$
$$A = {\text{daig}}\left[ {a_{11} , a_{22} , \ldots .., a_{\text{pp}} } \right].$$

From this notation the actuator nonlinearity vector \(N\left( u \right)\) can be written as

$$N\left( u \right) = Au + b\left( t \right),$$
(9)

where the diagonal matrix \(A\) is positively defined.

We note that \(b\left( t \right)\) is treated here as bounded disturbances.

2.5 Ideal control law

By using (9) the dynamic of the system can be rewritten as

$$\dot{s} = v - f\left( x \right) - G\left( x \right)Au - G\left( x \right)b\left( t \right) - \delta \left( t \right)$$
(10)

If the nonlinear functions \(f\left( x \right)\) and \(G\left( x \right)\) are known and the tow bounded function \(b\left( t \right)\) and \(\delta \left( t \right)\) exist and also known, the following nonlinear ideal control law \(u_{ }^{*}\)

$$u^{*} = \left( {G_{A} \left( x \right)} \right)^{ - 1} \left( { - f\left( x \right) + v + ks + k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) - d\left( {x,t} \right)} \right)$$
(11)

can achieve the control goal, where \(G_{A} \left( x \right) = G\left( x \right)A\), \(d\left( {x,t} \right) = G\left( x \right)b\left( t \right) + \delta \left( t \right)\), \(k = diag\left[ {k_{1} , \ldots ,k_{p} } \right]\), \(k_{0} = diag\left[ {k_{01} , \ldots ,k_{0p} } \right]\) and \(\tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) = \left[ {\tanh \left( {\frac{{s_{i} }}{{\varepsilon_{0} }}} \right), \ldots ,\tanh \left( {\frac{{s_{p} }}{{\varepsilon_{0} }}} \right)} \right]^{T}\) with \(k_{i}\) and \(k_{0i}\) are positive constants and \(\varepsilon_{0}\) is a small positive constant.

To analyze the closed loop stability dynamics, we apply the ideal control law (11) to (10) where we obtain

$$\dot{s} = - ks - k_{0} \tanh\left( {\frac{s}{{\varepsilon_{0} }}} \right).$$
(12)

From the Eq. (12), one can conclude that \(s_{i} \to 0\) \(\left( {i = 1,2, \ldots p} \right)\) when \(t \to \infty\); this implies that \(e_{i}\) \(\left( {i = 1,2, \ldots p} \right)\) and all its derivatives up to \(r_{i} - 1\) converge to zero in finite time.

But unfortunately, the ideal control (11) is not feasible because the nonlinear functions \(d\left( {x,t} \right)\), \(f\left( x \right)\) and \(G\left( x \right)\) are supposed unknown.

In order to overcome this problem, in this work one propose to approximate the ideal control (11) by a decentralized universal PID control law, where the control gains are adjusted online by mean of a fuzzy system.

3 Adaptive fuzzy PID control scheme

3.1 Control law

As we have up mentioned, when \(f\left( x \right)\), \(G\left( x \right)\) and \(d\left( {x,t} \right)\) are unknown, we assume that each element of the ideal control vector \(u_{ }^{*} = \left[ {u_{1}^{*} , \ldots ,u_{p}^{*} } \right]\) can be approximated by a fuzzy PID controller given by

$$u_{i} = u_{{PID_{i} }} = K_{Pi} e_{i} \left( t \right) + K_{Ii} \int \limits_{0}^{t} e_{i} \left( \tau \right)d\tau + K_{Di} \frac{{de_{i} \left( t \right)}}{dt},\; i = 1,2, \ldots ,p.$$
(13)

where \(K_{{{\text{P}}i}}\) is proportional gain, \(K_{{{\text{I}}i}}\) is integral gain and \(K_{\text{Di}}\) is derivative gain. \(e_{i} \left( t \right) = y_{{{\text{d}}i}} - y_{i}\) is the tracking error, \(\frac{{de_{i} \left( t \right)}}{dt}\) is the differential tracking error and \(\int \nolimits_{0}^{t} e_{i} \left( \tau \right)d\tau\) is the integral tracking error.

These control inputs can also be written in a compact form as follows:

$$u_{{{\text{PID}}_{i} }} = E_{i}^{T} K_{{{\text{PID}}_{i} }} ,$$
(14)

where \(E_{i} = \left[ {\varvec{e}_{{\varvec{i}{\mathbf{1}}}} ,\varvec{ e}_{{\varvec{i}{\mathbf{2}}}} ,\varvec{ e}_{{\varvec{i}{\mathbf{3}}}} } \right]^{T} = \left[ {e_{i} , \int \nolimits_{0}^{t} e_{i} \left( \tau \right)d\tau ,\frac{{de_{i} }}{dt}} \right]^{T}\) and \(K_{{{\text{PID}}_{i} }} = \left[ {K_{{{\text{P}}_{i} }} , K_{{{\text{I}}_{i} }} , K_{{{\text{D}}_{i} }} } \right]^{T}\).Or, equivalently

$$u_{PID} = E^{T} K_{PID} ,$$
(15)

where \(u_{PID} = \left[ {u_{{PID_{1} }} , u_{{PID_{2} }} , \ldots , u_{{PID_{p} }} } \right]^{T}\), \(E^{T} = diag\left[ {E_{1}^{T} , E_{2}^{T} , \ldots , E_{p}^{T} } \right]\) and \(K_{PID} = \left[ {K_{{PID_{1} }} , K_{{PID_{2} }} , \ldots , K_{{PID_{p} }} } \right]\).

Each gains vector \(K_{{{\text{PID}}_{i} }}\) of the PID control \(u_{{{\text{PID}}_{i} }}\) is identified by a zero order Takagi–Sugeno (TS) fuzzy system. The fuzzy system inputs are the tracking error \(\varvec{e}_{{\varvec{i}{\mathbf{1}}}} = e_{i}\), the integral error \(\varvec{e}_{{\varvec{i}{\mathbf{2}}}} = \int \nolimits_{0}^{t} e_{i} \left( \tau \right)d\tau\) and the derivative error \(\varvec{e}_{{\varvec{i}{\mathbf{3}}}} = \frac{{de_{i} \left( t \right)}}{dt}\), and the output is the gains’ vector \(K_{{PID_{i} }}\). We define \(M_{k}\) fuzzy sets \(F_{ij}^{k}\), for each input \(\varvec{e}_{{\varvec{ij}}}\) (\(i = 1,2, \ldots ,p, j = 1,2,3\), \(k = 1, \ldots , M_{ij}\)). The fuzzy system rule base is constructed by the collection of the IF–THEN rules \(R_{i}^{l}\) of the form

$$R_{i}^{l} :{\text{IF}}\, \varvec{e}_{{\varvec{i}{\mathbf{1}}}} \,\,{\text{is}}\,\, G_{{\varvec{i}{\mathbf{1}}}}^{l} \,{\text{and}}\, \varvec{e}_{\varvec{i}} is G_{{\varvec{i}{\mathbf{2}}}}^{l} \,{\text{and}}\, \varvec{e}_{{\varvec{i}{\mathbf{3}}}} \,{\text{is}}\, G_{{\varvec{i}{\mathbf{3}}}}^{l} \, {\text{THEN}}\, K_{{{\text{P}}i}} \,{\text{is}}\, c_{{{\text{P}}i}}^{l} \,{\text{and}} \,K_{{{\text{I}}i}} \,{\text{is }}\,c_{{{\text{I}}i}}^{l} \,{\text{and}}\, K_{{{\text{D}}i}} ,$$
$${\text{is}}\, c_{Di}^{l} ,$$

where \(G_{ij}^{l} \in \left\{ {F_{ij}^{1} , \ldots , F_{ij}^{{M_{ij} }} } \right\}\), \(l = 1, \ldots ,N.\) \(c_{Pi}^{l} , , c_{Ii}^{l}\) and \(c_{Di}^{l}\) are the crisp outputs of the \(l\)-th rule.

By using the algebraic product implication and the average sum inference method, the fuzzy system outputs, namely the PID control parameters are calculated by

$$\begin{aligned} K_{Pi} = \frac{{\sum\nolimits_{l = 1}^{N} {\mu_{i}^{l} c_{Pi}^{l} } }}{{\sum\nolimits_{l = 1}^{N} {\mu_{i}^{l} } }} \hfill \\ K_{Ii} = \frac{{\sum\nolimits_{l = 1}^{N} {\mu_{i}^{l} c_{Ii}^{l} } }}{{\sum\nolimits_{l = 1}^{N} {\mu_{i}^{l} } }} \hfill \\ K_{Di} = \frac{{\sum\nolimits_{l = 1}^{N} {\mu_{i}^{l} c_{Di}^{l} } }}{{\sum\nolimits_{l = 1}^{N} {\mu_{i}^{l} } }}, \hfill \\ \end{aligned}$$
(16)

where \(\mu_{i}^{l} = \prod\nolimits_{j = 1}^{3} {\mu_{{G_{ij}^{l} }} \left( {e_{ij} } \right)} ,\) \(\mu_{{G_{ij}^{l} }} \in \left\{ {\mu_{{F_{ij}^{1} }} , \ldots ,\mu_{{F_{ij}^{{M_{ij} }} }} } \right\}\) and \(\mu_{{F_{ij}^{k} }} \left( . \right)\) is the membership function of the fuzzy set \(F_{ij}^{k} .\)

By using the following notation

$$w_{i}^{l} = \frac{{\mu_{i}^{l} }}{{\mathop \sum \nolimits_{l = 1}^{N} \mu_{i}^{l} }}, l = 1,2, \ldots ,N$$

\(w_{i} = \left[ {w_{i}^{1} , \ldots , w_{i}^{N} } \right]^{T}\); \(c_{Pi} = \left[ {c_{Pi}^{1} , \ldots , c_{Pi}^{N} } \right]^{T}\); \(c_{Ii} = \left[ {c_{Ii}^{1} , \ldots , c_{Ii}^{N} } \right]^{T}\); \(c_{Di} = \left[ {c_{Di}^{1} , \ldots , c_{Di}^{N} } \right]^{T}\).

The fuzzy system (16) can be written in the following matrix form:

$$\left\{ {\begin{array}{*{20}c} {K_{Pi} = w_{i}^{T} c_{Pi} } \\ {K_{Ii} = w_{i}^{T} c_{Ii} } \\ {K_{Di} = w_{i}^{T} c_{Di} } \\ \end{array} } \right.$$
(17)

Or equivalently

$$K_{{{\text{PID}}i}} = \left[ {\begin{array}{*{20}c} {K_{{{\text{P}}i}} } \\ {K_{{{\text{I}}i}} } \\ {K_{{{\text{D}}i}} } \\ \end{array} } \right] = W_{i}^{T} c_{i} ,$$
(18)

where \(\it \it \it c_{i} = \left[ {c_{{{\text{P}}i}} \,c_{{{\text{I}}i}} \,c_{{{\text{D}}i}} } \right]^{T} ,\) and \(W_{i} = {\text{diag}}\left[ {w_{i} , w_{i} , w_{i} } \right]\).

In this paper, the proposed method assumes that the structure of the TS fuzzy system is specified in advance by the user. The user needs to specify the universe of discourse of each input variable, the number and type of membership functions for each input variable. However, the parameter vector \(c_{i}\) of the conclusion part of TS fuzzy system should be calculated online by an adaptation law in order to meet the desired specifications.

By replacing the gains vector (18) in the PID controller (14) we get

$$u_{{{\text{PID}}_{i} }} = E_{i}^{T} W_{i}^{T} c_{i} ,$$
(19)

which we call fuzzy PID controller.

Let us now denote \(u_{PID} = \left[ {u_{{PID_{1} }} ,u_{{PID_{2} }} , \ldots , u_{{PID_{p} }} } \right]\), \(E^{T} = diag\left[ {E_{1}^{T} , \ldots , E_{p}^{T} } \right]\), \(W = diag\left[ {W_{1}^{T} , \ldots , W_{p}^{T} } \right]\) and \(c = \left[ {c_{1} , \ldots , c_{p} } \right]^{T}\) is the matrix of the adjustable parameters.

Thus, the final MIMO PID control law that is applied to the system (1) is

$$u = u_{PID} = E^{T} Wc$$
(20)

Unlike (Shen et al. 2014; Boubakir et al. 2011), in this work, based on the universal approximation property of fuzzy systems (Su et al. 2003), the MIMO fuzzy PID control \(u\) is able to approximate the unknown ideal control \(u^{*}\), with a certain approximation error \(\varepsilon\) limited by a positive constant \(\varepsilon_{0}^{ }\) (\(\left| \varepsilon \right| < \varepsilon_{0}\)); therefore, the restrictive assumption about this error in (Shen et al. 2014; Boubakir et al. 2011) is removed.

Therefore, the unknown ideal control \(u^{*}\) can be written as

$$u^{*} = E^{T} Wc^{*} + \varepsilon ,$$
(21)

where \(\varepsilon_{ } = \left[ {\varepsilon_{1} , \ldots , \varepsilon_{p} } \right]^{T}\) is the approximation error and \(c^{*} = \left[ {c_{1}^{*} , \ldots , c_{p}^{*} } \right]^{T}\) is the unknown optimal values of \(c\).

3.2 Adaptive law of the fuzzy PID control

Recall that the goal is to approximate the unknown ideal control (21) to achieve the control system desired performance. To this end, the fuzzy PID control (20) is used to estimate this ideal control, where consequent parameters vector \(c\) of the fuzzy system is estimated online using an adaptation law. In this work, the gradient descent method is used; this method allows generating the vector \(c_{ }\) by decreasing the error between the unknown ideal control (21) and the fuzzy PID control (20), which is defined as follows:

$$e_{u} = u^{*} - u$$
(22)

Using (20) and (21), (22) becomes

$$e_{u} = u^{*} - E^{T} Wc = E^{T} W\tilde{c} + \varepsilon ,$$
(23)

where \(\tilde{c} = c^{*} - c\) is the parameters’ estimation error vector.

Adding and subtracting \(G_{A} \left( x \right)u^{*}\) to the right-hand side of (10), we obtain the error equation governing the closed-loop system

$$\dot{s} = v - f\left( x \right) - G_{A} \left( x \right)u - d\left( {x, t} \right) + G_{A} \left( x \right)u^{*} - G_{A} \left( x \right)u^{*}$$
(24)

Using (11) and (23), (24) becomes

$$\dot{s} = - ks - k_{0} \tan h\left( {\frac{s}{{\varepsilon_{0} }}} \right) + G_{A} \left( x \right)e_{u}$$
(25)

To obtain a suitable adaptive law for the parameter \(c\), one considers the minimization of the quadratic cost function (Shen et al. 2014; Wang et al. 2004) given by

$$J\left( c \right) = \frac{1}{2}\left( {u^{*} - E^{T} Wc} \right)^{T} G_{A} \left( x \right)\left( {u^{*} - E^{T} Wc} \right)$$
(26)

By applying the gradient descent method for the cost function (26), we obtain

$$\dot{c} = - \eta \nabla_{\varvec{c}} J\left( c \right),$$
(27)

where the gradient of \(J\left( c \right)\) is given by

$$\nabla_{\varvec{c}} J\left( c \right) = \frac{\partial J\left( c \right)}{\partial c} = - W^{T} EG_{A} \left( x \right)e_{u}$$
(28)

Therefore, Eq. (27) becomes

$$\dot{c} = \eta W^{T} EG_{A} \left( x \right)e_{u}$$
(29)

By extracting the value of the vector \(G_{A} \left( x \right)e_{u}\) from (25), we get

$$\dot{c} = \eta W^{T} E\left( {\dot{s} + ks + k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) } \right)$$
(30)

In order to improve the performance of robustness in the presence of approximation errors, one needs to modify the adaptation law (29). Therefore, first as Shen et al. (2014) and Boubakir et al. (2011), we modify it by using the \(\sigma\)-modification concept initially developed by Ioannou and Kokotovic (Ioannou and Sun 1996; Ioannou and Kokotovic 1983) as follows:

$$\dot{c} = \eta W^{T} EG_{A} \left( x \right)e_{u} {-}\eta \sigma c,$$
(31)

where \(\sigma\) is a design positive constant.

Unfortunately, there are some performance-related disadvantages to using the \(\sigma\)-modification term, when the error \(e_{u}\) becomes very small, and the adaptive law (31) becomes approximately as \(\dot{c} \approx {-}\eta \sigma c\). Hence, the parameters have a tendency to return to the origin, that is, they “unlearn” the gain values that caused the tracking error to become small, and also the parameters estimation error \(\tilde{c}\) do not converge to zero.

As shown in the simulation results below, in the presence of unexpected and unmatched disturbances, the adaptation PID control gains based on \(\sigma\)-modification diverge and go away from their ideal values (absence the disturbances).

Second, in order to overcome these drawbacks, one proposes to use the \(e\)-modification concept proposed by Narendra and Annaswamy (1987). The principal idea of this method’s is to replace the constant gain \(\sigma\) in (31) by a certain term linearly proportional to the error, such as \(\left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|\). The wisdom of using this term is that it converges to zero when the error \(e_{u}\) converges to zero. The adaptation law (29) with \(e\)-modification becomes

$$\dot{c} = \eta W^{T} E\,G_{A} \left( x \right)e_{u} {-}\eta \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|c,$$
(32)

where \(G_{A} \left( x \right)e_{u} = \dot{s} + ks + k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right)\) and \(\varvec{v} = \left[ {\sigma , \ldots , \sigma } \right]^{T}\) is the constant vector of dimension \(n\).

Figure 1 shows the block diagram of the proposed adaptive fuzzy PID control system.

Fig. 1
figure 1

Block diagram of the fuzzy adaptive PID control

To verify the effectiveness of this control law, in the next section, one analyzes the stability of closed-loop system.

3.3 Stability analysis

The goal of this section was to demonstrate that the control law (20) with adaptation laws (32) guarantees the boundedness of all the signals in the closed-loop system and the convergence of the tracking error to an adjustable region, by using the Lyapunov method.

Theorem 1

Consider the system given by (1) and the fuzzy PID control law defined by (20). Suppose that Assumptions 1 and 2 hold, and the fuzzy system parameters \(c\) are updated using the adaptation law (32). Then, the estimation error \(\tilde{c} \in L_{\infty }\), and the error \(e_{u}\) is of order of \(\varvec{||v||}^{2}\) and \(\varepsilon_{0}\) in the mean square sense.

Proof

Let us consider the following positive function:

$$V_{1} = \frac{1}{2\eta }\tilde{c}^{T} \tilde{c}$$
(33)

its time derivative is written

$$\dot{V}_{1} = - \frac{1}{\eta }\tilde{c}^{T} \dot{c}$$
(34)

Substituting (32) into (34), get that

$$\dot{V}_{1} = - \tilde{c}^{T} \left( {W^{T} EG_{A} \left( x \right)e_{u} - c\left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|} \right),$$
(35)
$$\dot{V}_{1} = - \left( {e_{u}^{T} - \varepsilon^{T} } \right)G_{A} \left( x \right)e_{u} + \tilde{c}^{T} c\left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|.$$
(36)

By using the inequality

$$\tilde{c}^{T} c \le - \frac{1}{2}||\tilde{c}||^{2} + \frac{1}{2} ||c^{*} ||^{2} ,$$
(37)

Equation (36) becomes

$$\dot{V}_{1} \le - \left( {e_{u}^{T} - \varepsilon^{T} } \right)G_{A} \left( x \right)e_{u} - \frac{1}{2}||\tilde{c}||^{2} \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right| + \frac{1}{2}||c^{*} || ^{2} \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|.$$
(38)

Because \(\varepsilon\) is bounded, it is obvious that there exists a certain constant \(\varepsilon_{1}\) that can achieve the inequality \(\left| {\varepsilon^{T} G_{A} \left( x \right)e_{u} } \right| \le \left| {\varepsilon_{1} \varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right| = \left| {\varepsilon_{1} ||\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|;\) therefore, (38) can be rewritten as

$$\dot{V}_{1} \le - e_{u}^{T} G_{A} \left( x \right)e_{u} - \left( { - \left| {\varepsilon_{1} } \right| + \frac{1}{2}||\tilde{c}||^{2} - \frac{1}{2} ||c^{*} ||^{2} } \right)\left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|.$$
(39)

It is clear that for \(\frac{1}{2} ||\tilde{c}||^{2} \ge \frac{1}{2}||c^{*} ||^{2} + \left| {\varepsilon_{1} } \right|,\) or \(\frac{1}{2\eta }||\tilde{c}||^{2} \ge \frac{1}{2\eta } ||c^{*} ||^{2} + \frac{1}{\eta}\left| {\varepsilon_{1} } \right|,\) i.e., for \(V_{1} \ge V_{0} \triangleq \frac{1}{\eta }\left( {\frac{1}{2} ||c^{*} ||^{2} + \left| {\varepsilon_{1} } \right|} \right),\) we have \(\dot{V}_{1} \le 0\), which shows the boundedness of \(V_{1}\), that means also the boundedness of the parameters’ estimation error vector \(\tilde{c}\), i.e., \(\tilde{c} \in L_{\infty }\).

Let us now examine the estimation error \(||e_{u} ||\).

The inequality (38) can be written as follows:

$$\dot{V}_{1} \le - e_{u}^{T} G_{A} \left( x \right)e_{u} + \varepsilon \left( x \right)^{T} G_{A} \left( x \right)e_{u} - \frac{1}{2} ||\tilde{c}||^{2} \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right| + \frac{1}{2} ||c^{*} ||^{2} \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right|.$$
(40)

One can easily prove the following inequalities:

$$- e_{u}^{T} G_{A} \left( x \right)e_{u} + \frac{1}{2}|| c^{*} ||^{2} \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right| \le - \frac{1}{2}e_{u}^{T} G_{A} \left( x \right)e_{u} + \frac{1}{8} ||c^{*} ||^{4} \varvec{v}^{T} G_{A} \left( x \right)\varvec{v} ,$$
(41)
$$\varepsilon^{T} G_{A} \left( x \right)e_{u} \le \frac{1}{4}e_{u}^{T} G_{A} \left( x \right)e_{u} + \varepsilon^{T} G_{A} \left( x \right)\varepsilon$$
(42)

Applying (41), (42) into (40) gives

$$\dot{V}_{1} \le - \frac{1}{4}e_{u}^{T} G_{A} \left( x \right)e_{u} - \frac{1}{2} ||\tilde{c}||^{2} \left| {\varvec{v}^{T} G_{A} \left( x \right)e_{u} } \right| + \frac{1}{8} ||c^{*} ||^{4} \varvec{v}^{T} G_{A} \left( x \right)\varvec{v} + \varepsilon^{T} G_{A} \left( x \right)\varepsilon .$$
(43)

Since \(c^{*}\) is assumed bounded here and \(||\varepsilon ||\, \le \varepsilon_{0}\), we can define a positive constant \(M\psi\) as

$$M\psi = { \sup }\left( {\frac{1}{8} ||c^{*} ||^{4} \varvec{v}^{T} G_{A} \left( x \right)\varvec{v} + \varepsilon^{T} G_{A} \left( x \right)\varepsilon } \right).$$
(44)

By replacing \(M\psi\) defined in (44), and by defining a positive constant \(a_{N}\) such that \(a_{N}=||A||\), (43) can be rewritten as

$$\dot{V}_{1} \le - \frac{{a_{N}g_{0}}}{4}||e_{u}^{2} || + M\psi .$$
(45)

Because \(V_{1} \in L_{\infty }\), we can integrate both sides of (45) as follows:

$$\mathop \int \limits_{t}^{t + T} ||e_{u} ||^{2} dt \le \frac{4}{{a_{N} g_{0} }}M\psi T + \frac{4}{{a_{N} g_{0} }}\left( {V_{1} \left( t \right) - V_{1} \left( {t + T} \right)} \right).$$
(46)

On pose \(m_{1} = \frac{4}{{a_{N} g_{0} }}\hbox{max} \left( {\frac{{a_{N} g_{1} }}{8}||c^{*} ||^{4} , a_{N} g_{1} } \right)\) and \(m_{2} = \frac{4}{{a_{N} g_{0} }}sup_{t} \left( {V_{1} \left( t \right) - V_{1} \left( {t + T} \right)} \right)\), therefore, (46) becomes

$$\mathop \int \limits_{t}^{t + T} ||e_{u}^{2} ||dt \le m_{1} \left( {\varvec{||v||}^{2} + \varepsilon_{0}^{ 2} } \right)T + m_{2} ,$$
(47)

Equation (47) implies that \(||e_{u} ||\, \in S\left( {\varvec{||v||}^{2} + \varepsilon_{0}^{2} } \right)^{ }\).

Theorem 2: Consider the system (1) and suppose that the assumptions 1–2 are satisfied; then, the control law defined by (20) and (32) guarantees the following properties:

  1. (i)

    The solution of the closed-loop error system decreases exponentially to an adjustable region.

  2. (ii)

    When the approximation error converges to zero (\(\varepsilon\) disappears), by setting \(\sigma = 0\), one can prove that \(\lim_{t \to \infty } ||s||\left( t \right) = 0,\), i.e., \(e_{i} \left( t \right) \to 0\) as \(t \to \infty\), for \(i = 1, \ldots p\).

Proof (i)

Let us analyze the stability by choosing the following Lyapunov function:

$$V = \frac{1}{2}s^{T} s + \frac{1}{2\eta }\tilde{c}^{T} \tilde{c} = \frac{1}{2}s^{T} s + V_{1} .$$
(48)

Its time derivative is

$$\dot{V} = s^{T} \dot{s} + \dot{V}_{1} .$$
(49)

Substituting (25) into (49), we get

$$\dot{V} = - s^{T} ks - s^{T} k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) + s^{T} G_{A} \left( x \right)e_{u} + \dot{V}_{1}$$
(50)

Using the following inequality

$$s^{T} G_{A} \left( x \right)e_{u} \le \frac{1}{4}e_{u}^{T} G_{A} \left( x \right)e_{u} + s^{T} G_{A} \left( x \right)s$$
(51)

allows to write (50) in the following form:

$$\dot{V} = - s^{T} ks - s^{T} k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) + \frac{1}{4}e_{u}^{T} G_{A} \left( x \right)e_{u} + s^{T} G_{A} \left( x \right)s + \dot{V}_{1}$$
(52)

By using the inequality \(\dot{V}_{1}\) represented by (43) into (52) we get

$$\begin{aligned} \dot{V} \le - & s^{T} \left( {k - G_{A} \left( x \right)} \right)s - s^{T} k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) - \frac{1}{2} ||\tilde{c}||^{2} \left| {v^{T} G_{A} \left( x \right)e_{u} } \right| \\ + \frac{1}{8} ||c^{*} ||^{4} v^{T} G_{A} \left( x \right)v + \varepsilon^{T} G_{A} \left( x \right)\varepsilon . \\ \end{aligned}$$
(53)

Assuming that the gains \(k_{i}\) are chosen such that \(k_{i} > g_{1} a_{N} , i = 1, \ldots p\), and setting \(\gamma = 2min_{1 \le i \le p} ( k_{i} - g_{1} a_{N} )\); therefore, (53) can be written as

$$\dot{V} \le - \frac{1}{2}s^{T} \gamma s + M\psi$$
(54)

We can conclude that \(\dot{V} \le 0\) if \(\frac{1}{2}||s\left( t \right)||^{2} \ge \frac{1}{\gamma }M\psi\), or equivalently \(V \ge \frac{1}{\gamma }M\psi + V_{1}\) since \(V_{1}\) is bounded, therefore, according to a standard Lyapunov theorem we conclude that the signals \(s\) and \(\tilde{c}\) in the closed-loop system are bounded and \(V\) is also bounded.

By integrating both sides of (54), we obtain

$$\int \limits_{t}^{t + T} ||s||^{2} dt \le \frac{2}{\gamma }M\psi T + \frac{2}{\gamma }\left( {V\left( t \right) - V\left( {t + T} \right)} \right).$$
(55)

Because \(V \in L_{\infty }\), the filtered tracking error \(s\) will converge exponentially to the residual set \(\varOmega_{s} = \left\{ {s|s \le \sqrt {\frac{2}{\gamma }M\psi } } \right\},\) i.e., \(\left| {s_{i} } \right|\) converges to \(\sqrt {\frac{2}{\gamma }M\psi }\) as \(t \to \infty\).

So, it is enough to choose the appropriate values of \(k_{i} , \sigma ,\eta\), to make \(\sqrt {\frac{2 }{\gamma }M\psi }\) small as possible. Status \(w = \sqrt {\frac{2}{\gamma }M\psi }\) exists \(T\) such that \(||s\left( t \right)||\; \le w\) for \(t > T;\) this implies that \(||e_{i}^{j} \left( t \right)||\; \le 2^{j} \lambda_{i}^{{j - r_{i} + 1}} w\), \(j = 0, \ldots , r_{i} - 1\), \(i = 1, \ldots , p\), we can conclude that all drives of the tracking error converge to an adjustable region.

Proof (ii):

When \(\varepsilon = 0\) and by assuming that \(\sigma = 0\), \(\left| {v^{T} G_{A} \left( x \right)e_{u} } \right| = 0\), (52) can be written as

$$\dot{V} = - s^{T} ks - s^{T} k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right) + s^{T} G_{A} \left( x \right)s.$$
(56)

Using the expression of \(\gamma\) we get

$$\dot{V} \le - \frac{1}{2}s^{T} \gamma s.$$
(57)

Integrating both sides of (57) yields

$$V\left( {t + T} \right) - V\left( t \right) \le - \frac{\gamma }{2}\mathop \int \limits_{t}^{t + T} ||s^{2} ||dt.$$
(58)

Equation (58) can be rewritten as

$$\mathop \smallint \limits_{t}^{t + T} ||s^{2} ||dt \le \frac{2}{\gamma }\left( {V\left( t \right) - V\left( {t + T} \right)} \right).$$
(59)

Because \(V\left( t \right) \in L_{\infty }\), it follows that \(s \in L_{2}\), we have \(\dot{s} \in L_{\infty }\) (all the variables of (25) are bounded); consequently \(s \in L_{2} \cap L_{\infty }\) and \(\dot{s} \in L_{\infty }\). By using Barbalat’s Lemma (Khalil 1996), we conclude that \(\mathop {\lim }\nolimits_{t \to \infty } ||s_{i} \left( t \right) ||= 0\), which implies that \(\mathop {\lim }\nolimits_{t \to \infty } e_{i} = 0\).

Remark

It is clear that the control law is PID type, without any robustifying term. However, the term \(k_{0} \tanh \left( {\frac{s}{{\varepsilon_{0} }}} \right)\) in the adaptive law (32) plays the role of a robustifying term.

4 Simulation results

In order to test the effectiveness of the proposed MIMO adaptive fuzzy PID control law, we have taken care to choose two simulation examples which present a big challenge for the control community: a two-link rigid robot manipulator and a quadrotor. For both systems, the proposed approach is tested with and without the presence of the disturbances and dead-zone inputs’ nonlinearities. Moreover, a comparative study is carried out to illustrate the superiority in terms of robustness of the proposed approach with the \(e\)-modification adaptation law over the proposed approach with \(\sigma\)-modification adaptation law, on the one hand, and over the adaptive fuzzy control proposed developed in (Cui et al. 2017) on the other hand.

4.1 Example 1: two-link rigid robot manipulator

The dynamical model of the two-link rigid robot manipulator is given by (Eslami et al. 2006; Tamura and Ohmori 2007):

$$\left[ {\begin{array}{*{20}c} {P_{11} } & {P_{12} } \\ {P_{21} } & {P_{22} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\ddot{q}_{1} } \\ {\ddot{q}_{2} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} { - h\dot{q}_{2} } & { - h(\dot{q}_{1} + \dot{q}_{2} )} \\ {h\dot{q}_{1} } & 0 \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\dot{q}_{1} } \\ {\dot{q}_{2} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {u_{1} } \\ {u_{2} } \\ \end{array} } \right],$$
(60)

where

$$P_{11} = a_{1} + 2a_{3} \cos \left( {q_{2} } \right) + 2a_{4} \sin \left( {q_{2} } \right),$$
$$P_{12} = P_{21} = a_{2} + a_{3} \cos \left( {q_{2} } \right) + a_{4} \sin \left( {q_{2} } \right),$$
$$P_{22} = a_{2} ,\;h = a_{3} \sin \left( {q_{2} } \right) - a_{4} \cos \left( {q_{2} } \right),$$

with

$$a_{1} = I_{1} + m_{1} l_{c1}^{2} + I_{e} + m_{e} l_{ce}^{2} + m_{e} l_{1 }^{2} , a_{2} = I_{e} + m_{e} l_{ce}^{2} ,$$
$$a_{3} = m_{e} I_{1} l_{ce} cos\delta_{e} \quad a_{3} = m_{e} I_{1} l_{ce} sin\delta_{e} .$$

In this simulation, we use the flowing parameter values:

$$m_{1} = 1, m_{e} = 2, I_{1} = 1, I_{c1} = 0.5, I_{ce} = 0.6, I_{1} = 0.12, I_{e} = 0.25, \delta_{e} = 30^{^\circ } .$$

Let \(y = [q_{1} ,\;q_{3} ]^{T} ,\;u = [u_{1} ,\;u_{2} ]^{T} ,\;x = [q_{1} ,\;q_{2} ,\;q_{3} ,\;q_{4} ]^{T}\) and \(f\left( x \right) = \left[ {\begin{array}{*{20}c} {f_{1} \left( x \right)} \\ {f_{2} \left( x \right)} \\ \end{array} } \right] = - P^{ - 1} \left[ {\begin{array}{*{20}c} { - h\dot{q}_{2} } & { - h\left( {\dot{q}_{1} + \dot{q}_{2} } \right)} \\ {h\dot{q}_{1} } & 0 \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\dot{q}_{1} } \\ {\dot{q}_{2} } \\ \end{array} } \right],\)

$$G\left( x \right) = \left[ {\begin{array}{*{20}c} {g_{11} } & {g_{12} } \\ {g_{21} } & {g_{22} } \\ \end{array} } \right] = P^{ - 1} = \left[ {\begin{array}{*{20}c} {P_{11} } & {P_{12} } \\ {P_{21} } & {P_{22} } \\ \end{array} } \right]^{ - 1} .$$

With the matrix \(P\) is positive definite, this leads to the matrix \(G\left( x \right)\) defined by \(G\left( x \right) = P^{ - 1}\) is also positive definite.

Then, the system (60) can be written as

$$\ddot{y} = f\left( x \right) + G\left( x \right)N(u).$$
(61)

The control goal is to force the robot manipulator to track the following desired references \(y_{d1} \left( t \right) = sin\left( t \right)\) and \(y_{d2} \left( t \right) = cos\left( t \right)\).

For that, we use two adaptive fuzzy PID controllers \(u_{1}\) and \(u_{2}\). The gains of each PID controller are approximated by a fuzzy system as presented in Sect. 2. For the each input one uses three membership functions (shown in Fig. 2) defined by

$$\it \it \mu_{{F_{ij}^{1} }} = \left\{ {\begin{array}{*{20}c} {1\quad\qquad\qquad {\text{if}}\, e_{ij} > \varepsilon_{ij} } \\ {\left| {\cos \left( {\frac{\pi }{{2\varepsilon_{ij} }}e_{ij} + \frac{\pi }{2}} \right)} \right|, {\text{if}}\, 0 \le e_{ij} \le \varepsilon_{ij}} \\ {0\quad\qquad\qquad {\text{if}}\, e_{ij} < 0} \\ \end{array} } \right.$$
$$\it \it \mu_{{F_{ij}^{2} }} = \left\{ {\begin{array}{*{20}c} {0 \quad\qquad\qquad{\text{if}}\, e_{ij} < - \varepsilon_{ij} } \\ {\left| {\cos \left( {\frac{\pi }{{2\varepsilon_{ij} }}e_{ij} } \right)} \right|,\, {\text{if}} - \varepsilon_{ij} \le e_{ij} \le \varepsilon_{ij} } \\ {0\quad\qquad\qquad {\rm{if}}\, e_{ij} > \varepsilon_{ij} } \\ \end{array} } \right.$$
$$\mu_{{F_{ij}^{3} }} = \left\{ {\begin{array}{*{20}c} {1\quad\qquad\qquad{\text{if}}\, e_{ij} < - \varepsilon_{ij} } \\ {\left| {\cos \left( {\frac{\pi }{{2\varepsilon_{ij}}}e_{ij} + \frac{\pi }{2}} \right)} \right|,\,{\text{if}} - \varepsilon_{ij} \le e_{ij} \le 0} \\ {0 \quad\qquad\qquad{\text{if}}\, e_{ij} > 0} \\ \end{array} ,} \right.$$

where \(i = 1,2.\, j = 1,2,3\). \(\varepsilon_{11} = 1, \varepsilon_{12} = 0.5, \varepsilon_{13} = 1.5\). \(\varepsilon_{21} = 1,\varepsilon_{22} = 0.5, \varepsilon_{23} = 1.5\).

Fig. 2
figure 2

The membership function

In the simulation, we use \(\lambda_{1} = 2\),\(\lambda_{2} = 2\),\(k = diag\left[ {7, 7} \right],\) \(k_{0} = daig\left[ {10, 10} \right],\) \(\sigma = 0.01, \varepsilon_{0} = 0.01, \eta = 8\).

The dead-zone used here is presented as (Wang et al. 2004)

$$N(u_{i} ) = \left\{ {\begin{array}{*{20}c} {m_{ri} \left( {u_{i} - b_{ri} } \right)} & {for} & { u_{i} \ge b_{ri} } \\ 0 & {for} & {b_{li} < u_{i} < b_{ri} } \\ {m_{li} \left( {u_{i} - b_{li} } \right)} & {for} & {u_{i} \le b_{li} } \\ \end{array} } \right.$$

For the two inputs we consider similar dead zones with the following parameters: \(m_{ri} = m_{li} = 1\), \(b_{li} = - 3.5\) and \(b_{ri} = 3.5\). (\(i = 1, 2\)). The robot initial conditions are \(x\left( 0 \right) = \left[ { - 0.25\,\, 0\,\, 0.25 \,\,0} \right]^{T}\) and \(\dot{x}\left( 0 \right) = \left[ {0\,\, 0\,\, 0\,\, 0} \right]^{T}\). The nonlinear functions \(f\left( x \right)\) and \(G\left( x \right)\) are supposed completely unknown. All the initial parameters of the fuzzy system are set to zero.

The first case: The simulations results are done without adding the disturbances and dead-zone inputs’ nonlinearities. The results are illustrated by Figs. 3, 4, 5, 6, 7, 8.

Fig. 3
figure 3

The position of link 1

Fig. 4
figure 4

The position of link 2

Fig. 5
figure 5

Evolution of the PID control gains \(u_{1}\) (\(K_{P1} ,K_{D1} ,K_{I1}\))

Fig. 6
figure 6

Evolution of the PID control gains \(\varvec{u}_{{\mathbf{2}}} \;(\varvec{K}_{{\varvec{P}{\mathbf{2}}}} ,\varvec{K}_{{\varvec{D}{\mathbf{2}}}} ,\varvec{K}_{{\varvec{I}{\mathbf{2}}}})\)

Fig. 7
figure 7

Control signals \(\varvec{u}_{{\mathbf{1}}}\) and \(\varvec{u}_{{\mathbf{1}}}^{*}\)

Fig. 8
figure 8

Control signals \(\varvec{u}_{{\mathbf{2}}}\) and \(\varvec{u}_{{\mathbf{2}}}^{*}\)

From Figs. 3 and 4, we can see that the actual trajectories quickly converge to the desired trajectories. Figures 5 and 6 illustrate the effectiveness of the used method; the PID control gains reach their true values very rapidly compared to the adaptive method. Figures 7 and 8 show the ideal control signals and the proposed PID control signals without adding \(\delta_{i} \left( t \right)\) and dead-zone inputs’ nonlinearities; we find that the error between them is small, thanks to universal approximation of fuzzy systems.

The second case: The simulations are done in the presence of the disturbances and dead-zone inputs’ nonlinearities which are defined above. A Gaussian noise with variance 0.002 and mean zero is added to all the states’ measurements. The simulations are done using alternatively the \(\sigma\)-modification and the \(e\)-modification robustification terms in adaptive law. The results are presented by Figs. 9, 10, 11, 12, 13, 14.

Fig. 9
figure 9

The position of link 1 in presence the disturbances and the dead-zone inputs’ nonlinearities

Fig. 10
figure 10

The position of link 2 in the presence of disturbances and dead-zone inputs’ nonlinearities

Fig. 11
figure 11

Evolution of the PID control gains \(\varvec{u}_{{\mathbf{1}}}\) with the \(\varvec{e}\)-modification

Fig. 12
figure 12

Evolution of the PID control gains \(\varvec{u}_{{\mathbf{2}}}\) with the \(\varvec{e}\)-modification

Fig. 13
figure 13

Evolution of the PID control gains \(\varvec{u}_{{\mathbf{1}}}\) with the \(\varvec{\sigma}\)-modification

Fig. 14
figure 14

Evolution of the PID control gains \(\varvec{u}_{{\mathbf{2}}}\) with the \({\varvec{\upsigma}}\)-modification

Figures 9 and 10 show clearly that using the both conceptions (\(\sigma\)-modification and \(e\)-modification) in the adaptive law leads to adequate tracking until the presence of disturbances and dead-zone. However, as we can see in Figs. 11, 12, 13, 14, unlike the \(\sigma\)-modification conception, the \(e\)-modification keeps the adaptation parameters of the PID control uniformly bounded and force them to stay nearly their ideal values shown in Figs. 5 and 6. And also, the \(e\)-modification can relatively reduce the oscillations induced by the presence of disturbances.

Tables 1 and 2 present a quantitative comparative study between our approach and the designed adaptive fuzzy control law in (Cui et al. 2017) with and without presence of disturbances, respectively. The results show the superiority of our approach (the fuzzy PID control with \(e\)-modification) against the criteria IAE (Integral Absolute Error), ISE (Integral Squared Error) and IAU (Integral Absolute Input).

Table 1 IAE, ISE and IAU of the proposed method and that of (Zhang et al. 2002) without the presence of disturbances and dead-zone inputs’ nonlinearities
Table 2 IAE, ISE and IAU of the proposed method and that of (Zhang et al. 2002) with the presence of the disturbances

Example 2: Stabilization of a quadrotor

The quadrotor is a small Unmanned Aerial Vehicle (UAV) with four propellers actuated by DC motors mounted on the end of two perpendicular arms. A basic diagram is shown in Fig. 15.

Fig. 15
figure 15

Quadrotor configuration

Each rotors pair of the same arm rotates in same direction: one pair rotates clockwise, while the other rotates counter clockwise. The quadrotor moves by adjusting the angular velocity of each rotor.

One considers the dynamical model of quadrotor in (Bouabdallah 2007) given by

$${\dot{\text{x}}}_{1} = {\text{x}}_{2}$$
$${\dot{\text{x}}}_{2} = {\text{x}}_{4} {\text{x}}_{6} {\text{a}}_{1} - {\text{x}}_{4} {\text{a}}_{2} \varOmega_{\text{r}} + {\text{b}}_{1} {\text{u}}_{1}$$
$${\dot{\text{x}}}_{3} = {\text{x}}_{4}$$
$${\dot{\text{x}}}_{4} = {\text{x}}_{2} {\text{x}}_{6} {\text{a}}_{3} + {\text{x}}_{2} {\text{a}}_{4} \varOmega_{\text{r}} + {\text{b}}_{2} {\text{u}}_{2}$$
$${\dot{\text{x}}}_{5} = {\text{x}}_{6}$$
$${\dot{\text{x}}}_{6} = {\text{x}}_{2} {\text{x}}_{4} {\text{a}}_{5} + {\text{b}}_{3} {\text{u}}_{3}$$
$${\dot{\text{x}}}_{7} = {\text{x}}_{8}$$
$${\dot{\text{x}}}_{8} = \left( {{ \cos }\left( {{\text{x}}_{1} } \right){ \sin }\left( {{\text{x}}_{3} } \right){ \cos }\left( {{\text{x}}_{5} } \right) + { \sin }\left( {{\text{x}}_{1} } \right){ \sin }\left( {{\text{x}}_{5} } \right)} \right){\text{b}}_{4} {\text{u}}_{4}$$
$${\dot{\text{x}}}_{9} = {\text{x}}_{10}$$
$${\dot{\text{x}}}_{10} = \left( {{ \cos }\left( {{\text{x}}_{1} } \right){ \sin }\left( {{\text{x}}_{3} } \right){ \cos }\left( {{\text{x}}_{5} } \right) - { \sin }\left( {{\text{x}}_{1} } \right){ \cos }\left( {{\text{x}}_{5} } \right)} \right){\text{b}}_{4} {\text{u}}_{4}$$
$${\dot{\text{x}}}_{11} = {\text{x}}_{12}$$
$${\dot{\text{x}}}_{12} = - {\text{g}} + { \cos }\left( {{\text{x}}_{3} } \right){ \cos }\left( {{\text{x}}_{1} } \right){\text{b}}_{4} {\text{u}}_{4} ,$$

where \(x_{1} = \phi\) and \(x_{2} = \dot{\phi }\) are, respectively, the roll angle and corresponding angular velocity; \(x_{3} = \theta\) and \(x_{4} = \dot{\theta }\) are, respectively, the pitch angle and corresponding angular velocity; \(x_{5} = \psi\) and \(x_{6} = \dot{\psi }\) are, respectively, the yaw angle and corresponding angular velocity; \(x_{7} = X\), \(x_{9} = Y\), and \(x_{11} = Z\) are the Cartesian position coordinates and \(x_{8} = \dot{X}\), \(x_{10} = \dot{Y}\), and \(x_{12} = \dot{Z}\) are the corresponding velocities, respectively.

$$\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {u_{1} } \\ {u_{2} } \\ {u_{3} } \\ \end{array} } \\ {u_{4} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 \\ b \\ { - d} \\ \end{array} } \\ b \\ \end{array} } & {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} { - b} \\ 0 \\ d \\ \end{array} } \\ b \\ \end{array} } & {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\begin{array}{*{20}c} 0 \\ { - b} \\ { - d} \\ \end{array} } \\ b \\ \end{array} } & {\begin{array}{*{20}c} {\begin{array}{*{20}c} b \\ 0 \\ d \\ \end{array} } \\ b \\ \end{array} } \\ \end{array} } \\ \end{array} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\varOmega_{1}^{2} } \\ {\varOmega_{2}^{2} } \\ {\varOmega_{3}^{2} } \\ \end{array} } \\ {\varOmega_{4}^{2} } \\ \end{array} } \right]$$

\(\varOmega_{r} = - \varOmega_{1} + \varOmega_{2} - \varOmega_{3} + \varOmega_{4}\) is the sum of rotor angular velocities.

$$a_{1} = \frac{{I_{y} - I_{z} }}{{I_{x} }};a_{2} = \frac{{J_{r} }}{Ix};a_{3} = \frac{{I_{z} - I_{x} }}{{I_{y} }};a_{4} = \frac{{J_{r} }}{{I_{y} }};a_{5} = \frac{{I_{x} - I_{y} }}{{I_{z} }}; b_{1} = \frac{l}{{I_{x} }};b_{2} = \frac{l}{{I_{y} }};b_{3} = \frac{1}{{I_{z} }};b_{4} = \frac{1}{m}.$$

The values of the parameters in the state space model are given by Table 3 (Bouabdallah 2007).

Table 3 The quadrotor model parameters

The control objective here is to stabilize angles and height of the quadrotor. That is, four decentralized fuzzy adaptive PID controllers which have the same structure of controller used in the first example. However, the structural parameters are chosen as follows: \(\lambda_{1} = 4\) ,\(\lambda_{2} = 3\) ,\(\lambda_{3} = 3\) , \(\lambda_{4} = 2,\) \(k = diag\left[ {5, 7, 7, 7} \right],\) \(k_{0} = daig\left[ {20, 10, 11, 10} \right],\) \(\sigma = 0.01, \varepsilon_{0} = 0.01, \eta = 8\).

And the fuzzy system parameters are \(\varepsilon_{11} = 1, \varepsilon_{12} = 0.5, \varepsilon_{13} = 1.5\). \(\varepsilon_{21} = 1, \varepsilon_{22} = 0.5, \varepsilon_{23} = 1.5\), \(\varepsilon_{31} = 1, \varepsilon_{32} = 0.5, \varepsilon_{33} = 1.5\), \(\varepsilon_{41} = 1, \varepsilon_{42} = 0.5, \varepsilon_{43} = 1.5\).

We consider similar dead zones for the four inputs which have the same structure as the first example with the following parameters: \(m_{ri} = m_{li} = 1\), \(b_{li} = - 2.5\) and \(b_{ri} = 2.5\). (\(i = 1,2, \ldots 4).\)

The initial states of the quadrotor are \(\varphi \left( 0 \right) = 0.5 rad\), \(\theta \left( 0 \right) = - 0.5 rad\), \(\psi \left( 0 \right) = - 0.5 rad\), \(Z\left( 0 \right) = 0\,m\).

The desired angles and height \(\varphi_{d} = 0 rad\), \(\theta_{d} = 0 rad\), \(\psi_{d} = 0 rad\), and \(Z_{d} = 10\,m\).

The simulation results with and without the disturbances and the dead-zone inputs’ nonlinearities are illustrated by Figs. 16, 17, 18, 19 and 20.

Fig. 16
figure 16

The simulation results without the presence of disturbances and dead-zone inputs’ nonlinearities a the roll angle: b the pitch angle: c the yaw angle: d the height

Figures 16, 17 show, respectively, the system outputs and the evolution of the corresponding PID control gains in the nominal system (without disturbances and without inputs nonlinearities) while Fig. 18 shows the system outputs in the presence of disturbances (a Gaussian noise with variance 0.002 and mean zero is added to all the states’ measurements) with both the adaptation laws and Figs. 19, 20 show the evolution of the corresponding PID control gains.

Fig. 17
figure 17

Evolution of the PID control gains. a The control \(\varvec{u}_{{\mathbf{1}}}\): b the control \(\varvec{u}_{{\mathbf{2}}}\): c the control \(\varvec{u}_{{\mathbf{3}}}\): d the control \(\varvec{u}_{{\mathbf{4}}}\)

Fig. 18
figure 18

Simulation results with the presence of disturbances and dead-zone inputs’ nonlinearities: a the roll angle. b the pitch angle. c the yaw angle. d the height

Fig. 19
figure 19

Evolution of the PID control gains with the \(\varvec{e}\)-modification. a The control \(\varvec{u}_{{\mathbf{1}}}\): b the control \(\varvec{u}_{{\mathbf{2}}}\): c the control \(\varvec{u}_{{\mathbf{3}}}\): d the control \(\varvec{u}_{{\mathbf{4}}}\)

Fig. 20
figure 20

Evolution of the PID control gains with the \({\varvec{\upsigma}}\)-modification. a The control \(\varvec{u}_{{\mathbf{1}}}\): b the control \(\varvec{u}_{{\mathbf{2}}}\): c the control \(\varvec{u}_{{\mathbf{3}}}\): d the control \(\varvec{u}_{4}\)

One sees clearly that that the outputs’ trajectories converge quickly to the desired values even with presence of the disturbances and inputs’ nonlinearities. As in the previous example, the results illustrate the effectiveness and the advantages of the control law using \(e\)-modification adaptation law compared to the control law using \(\sigma\)-modification adaptation law, namely the PID control gains are bounded and go to their ideal values, and the oscillations induced by the presence of disturbances are reduced.

5 Conclusion

In this work, we have proposed an adaptive fuzzy PID control scheme for a class of MIMO unknown nonlinear systems. An adaptive fuzzy system has been used to approximate the parameters of the PID control. A gradient decent adaptation law, augmented by introducing the \(e\)-modification robustification term, is used to minimize the error between the PID control and the unknown ideal control. The Lyapunov stability analysis proves the convergence of the tracking error to acceptable region in the neighborhood of zero and the boundedness of all signals in the closed-loop system. The simulations of the proposed control scheme, performed on a two-link manipulator robot model, show the effectiveness of the method.

6 Future recommendation

As in the most previous works, although the stated objectives of this research have been achieved, this work can be improved and extended to deal with other control problems. So the proposed future recommendations are as follows:

  1. (i)

    Developing this control law for uncertain underactuated mechanical systems (UMS) with dead-zone input.

  2. (ii)

    Developing this control law for uncertain underactuated mechanical systems (UMS) with unknown control direction.

  3. (iii)

    Introducing an observer for this control law to overcome the unavailability problem of state variables.