Keywords

1 Introduction

Inverted pendulum, an inherently non-linear and unstable system, has always been a topic of interest for control engineers since many decades. It has been a classical benchmark problem for designing, testing and evaluating contemporary control techniques. Inverted pendulum finds uses in military and space application, such as space shuttles and missiles, where there is requirement to maintain a precise vertical orientation.

Conventional PID controllers have been in use for a very long time. They have proved to be efficient controllers, providing satisfactory response at a very moderate cost. The evidence of their popularity lies in the fact that even today, 90% of the industry employs PID controller, one of the most popular conventional controller. PID controllers have been able to provide efficient output when tuned appropriately. However, conventional controllers fail to serve the purpose when the plant is non-linear and uncertain. This has led the scholars to search for alternative solutions.

For the past three decades lots of research has been reported on in the intelligent controllers. One of the most important outcomes of this research has been fuzzy logic control. It tries to mimic the process of human decision making based on ‘if-else’ logic. Fuzzy logic controller (FLC) is seen as the most suitable option to replace the conventional PID as it provides an easier option of implementing rules that resemble instructions given by a human operator. However, fuzzy logic lacks the capability to predict future data and take necessary actions. This aspect can be incorporated into the plant by using a grey predictor (GP).

Grey system theory was first introduced by Professor Deng Julong [17]. A system can be defined with a color that represents the amount of clear information about that system. For instance, a system can be called as “black box”, if its internal characteristics or mathematical equations that describe its dynamics are completely unknown. On the other hand, if the description of the system is completely known, it is named as a white system. Similarly, a system that has both known and unknown information is defined as a grey system. In real life, every system can be considered as a grey system because there are always some uncertainties associated with the physical systems.

The use of fractional order calculus in the field of control engineering is another interesting development that has taken place over the last several years. Fractional order calculus has been used to define chaotic systems accurately. It allows description and modeling of a real system more accurately than the classical integer order calculus methods. When fractional order calculus is used as a part of the controller, its action resembles that of adding more tuning knobs to the controller, which helps in the generation of the desired response.

Good works have been reported on intelligent fractional controllers and grey prediction, but their combined potential appears to be underexplored. This has been the main motivation for this chapter, which aims to investigate GP based fractional order fuzzy PD (FOFPD) controller. In this chapter, a fractional order fuzzy PD controller with grey predictor (FOFPD-GP) has been implemented on a moving cart inverted pendulum. The performance of the FOFPD-GP has been compared with fuzzy PD (FPD), fuzzy PD with grey predictor (FPD-GP) and FOFPD for settling time when an impulse disturbance is given at the controller output. The gains of the controllers were tuned with the help of inbuilt optimization tool genetic algorithm (GA). Later, the pendulum was subjected to impulse and sinusoidal disturbances, and the disturbance rejection capabilities of the controllers were investigated by comparing the Integral of Absolute Error (IAE) and Integral of Square Error (ISE) values.

This chapter is organized as follows: Following the introduction in Sect. 1, a brief literature survey in Sect. 2 related to the proposed study has been presented. In Sect. 3, a complete description of the moving cart inverted pendulum is given. Fractional order calculus and its implementation on a controller as Oustaloup’s recursive approximation (ORA) are described in Sect. 4. In Sect. 5, GP and its mathematical model are described. Subsequently, mathematical model of FPD, design and implementation of FPD, FOFPD, FPD-GP and FOFPD-GP controllers are described with the help of block diagrams and their corresponding Simulink diagrams in Sect. 6. Finally, results for settling time of investigated controllers and their comparison on robustness have been presented in Sect. 7 followed by the conclusion and future scope in Sect. 8.

2 Literature Survey

As already has been mentioned above, the popularity of PID is due to its ease of implementation, cost effectiveness and its ability to provide a satisfactory response. Large numbers of PID variants have been developed to suit the needs of verities of the plants. Azar and Serrano presented an internal model control plus PID tuning procedure for cascade control systems based on the gain and phase margin specifications of the inner and outer loop [2]. Azar and Serrano also developed PI loop shaping control design implementing a describing function to find the limit cycle oscillations and the appropriate control gains, thus showing the stabilization of cart-pendulum system with the proposed control scheme [6]. However, conventional controllers do not give successful results when used with non-linear plants. A survey on classical PID as well as fuzzy PID (FPID) controllers has been presented by Kumar et al. where it was realized that classical PID controllers are effective for linear systems but not suitable for nonlinear systems [21]. Consequently, the focus has been shifted from conventional to intelligent control.

For the last four decades, with the advent of soft computing, it has become possible to implement relatively complex control structures with ease. There have been numerous successful attempts for control using intelligent control systems [9]. Among the different intelligent techniques, fuzzy logic was proposed by Zadeh [45,46,47,48,49,50,51] and FLC was initially proposed by Mamdani [27, 28]. Meghni et al. presented a second-order sliding mode and FLC for optimizing energy management [29]. Giove et al. used fuzzy logic to prevent dialysis hypotensive episodes [15]. Wang et al. presented an observer-based adaptive fuzzy neural network controller with supervisory mode for a certain class of higher order unknown non-linear dynamic systems [44]. An implementation in industries, for the first time, was presented by King and Mamdani for a complex dynamic and poorly defined system [20]. Nour et al. modeled a non-linear inverted pendulum on Simulink and implemented PID controller and FLC on it [32]. It was observed that FLC provided a better control action than PID controller. A similar trend was noticed in the works of Prasad et al. and Tyagi et al. [23, 40]. Kumar et al. proposed a new formula-based fuzzy PI controller and the effectiveness of the controller was assessed by controlling outlet flow concentration of a nonlinear non-thermic catalytic continuous stirred-tank reactor [22]. Boulkroune et al. presented an interesting work dealing with adaptive fuzzy control-based function vector synchronization between two chaotic systems with both, unknown dynamic disturbances and input nonlinearities [12]. In another stimulation work, Boulkroune et al. used a fuzzy adaptive controller for a fractional order chaotic system with uncertain dynamics to realize a practical projective synchronization [11]. However, fuzzy wasn’t predictive in nature as mentioned above, thus, it gave way to GP.

GP theory distinguished with its ability to deal with systems that have partially unknown parameters. With the use of grey system mathematics (for instance, grey equations and grey matrixes) it is possible to generate meaningful information using little poor data. GP has ability to predict the future outputs of a system by using recently obtained data [19]. Over the last two decades, grey system theory has been developed rapidly and caught the attention of researchers with its successful real-time practical applications. It has been applied to analysis, modeling, prediction, decision making and control of various systems such as social, economic, financial, scientific and technological, agricultural, industrial, transportation, mechanical, meteorological, ecological, geological, medical, military, etc. [18]. GP has been used with sliding mode control of higher order non-linear systems and non-linear liquid level systems [42]. In both these cases, it was observed that using a GP along with the sliding mode and fuzzy controller independently, the response of the system improved. This showed superior performance of the GP.

Some of the areas of application of advanced intelligent systems in modeling and control of multi-disciplinary complex processes are electronic, chemical, mechanical, and aerospace, as explained by Azar and Vaidyanathan [7, 8]. Azar and Zhu presented quality works on control of non-linear, uncertain and coupled systems like robot arms, internal combustion engines etc. using sliding mode control tuned by GA [10]. Zhu and Azar also presented different soft computing methods for management of waste, wind-up control and application in biomedical systems [52]. Azar and Serrano presented soft computing method for wind-up control [5]. Azar and Serrano also devised an adaptive sliding mode consisting of a sliding mode control law with an adaptive gain, making the controller more flexible and reliable than other sliding mode control algorithms and nonlinear control strategies, for a furuta pendulum [3]. Mekki et al. highlighted the benefits of sliding modes when applied to the field of fault tolerant control [30]. Azar and Serrano proposed a novel approach for the dead beat control of multivariable discrete time systems [4]. Azar presented an adaptive neuro-fuzzy inference system as a novel approach for post-dialysis urea rebound prediction [1].

Another development in control engineering has been that of the fractional order control systems which make use of fractional order calculus. Fractional order calculus was described as a paradox from which useful results can be obtained. It has been used to describe systems, especially chaotic systems, and provide an effective control structure [16, 38]. Fractional controller helps in providing intermediate options to the plant. Ghoudelbourk et al. implemented a fractional pitch angle controller in a wind turbine to tap maximum energy in wind power generation [14]. FOFPD and fractional order fuzzy PI have (FOFPI) been used in cascaded loops for speed control of highly non-linear hybrid electric vehicle [24]. Recently, Sharma et al. investigated a fractional order fuzzy PID (FOFPID) on a two-link planar rigid robotic manipulator. The resulting response was seen to outperform fuzzy PID (FPID), fractional order PID (FOPID) and conventional PID [41].

The survey presented above shows that lots of work has been done on intelligent fractional controllers and grey prediction, but their combined utility appears to be underexplored. Thus the aim of the chapter is to investigate the GP based FOFPD controller and check its effectiveness against the potential counterparts.

3 Problem Formulation and Plant Model

This section presents the problem formulation and mathematical model of the considered moving cart inverted pendulum system along with its respective initial conditions and system parameters. Before delving into designing a controller for the plant, one needs to have an accurate mathematical model that can be replicated.

3.1 Inverted Pendulum

An inverted pendulum is a pendulum that has its centre of mass above its pivot point. Whereas a pendulum is stable when hanging downwards, an inverted pendulum is in its unstable equilibrium position when upright. Even a slight disturbance from its upright position can bring the pendulum down, so it requires active control. There are various kinds of inverted pendulums that are used in the research field by scholars, such as moving cart inverted pendulum and multiple segmented inverted pendulums on a cart. Another platform is a two wheeled balancing inverted pendulum having the ability to spin on the spot offering a great deal of manoeuvrability.

A moving cart inverted pendulum has been used in this chapter. One of the main reasons for its choice is its wide practical applications such as rocket launchers, hover boards, etc. The pendulum is maintained at a desired reference angle by changing the position of the cart, so effectively it is a form of stabilization control. In this chapter, a reference angle of 1° has been considered for positioning the pendulum. For the purpose of effective control, it is necessary to understand the dynamics of the moving cart pendulum system, which can be done by deriving the mathematical model of the pendulum.

3.2 Mathematical Modeling

The moving cart inverted pendulum under investigation is shown in Fig. 1[13, 33]. It consists of a rod free to move about the pivot in the x-axis. The mass of the cart is M, the mass of the rod is m, the length of the rod is 2l, x is the displacement of the cart from the origin, the angle of the rod with the perpendicular at the pivot is θ and u is the control force acting on the cart so as to the reference angle. The surface is taken to be frictionless and the mechanical joint is assumed to be smooth.

Fig. 1
figure 1

A moving cart inverted pendulum

Figure 2 shows the free body diagram of the plant from which the non-linear dynamics of the system are derived. Both the forces H and V are internal forces which the pivot and rod exert on each other whenever the rod is subjected to any disturbance. H is the horizontal force acting on both the rod and the pivot but in opposite directions. Similarly, V is the vertical force acting on rod and pivot but in the opposite directions.

Fig. 2
figure 2

Free body diagram of an inverted pendulum

Net torque about the end of the rod not pivoted is,

$$ I*{\ddot{\theta}} = V*l*sin\theta - H*l*cos\theta $$
(1)

where I is the moment of inertia of the rod about the rod’s end.

Force balancing in the x-direction for the rod,

$$ m\frac{{d^{2} (x + l\,*\,sin\theta )}}{{dt^{2} }} = H $$
(2)

Force balancing in the y-direction for the rod,

$$ m\frac{{d^{2} (l\,*\,cos\theta )}}{{dt^{2} }} = V - mg $$
(3)

Force balancing in the x-direction for the cart,

$$ M\frac{{d^{2} x}}{{dt^{2} }} = u - H $$
(4)

Using Eqs. 2 and 4,

$$ M*{\ddot{ x}} = u - \{ m{\ddot {x}} + m\,*\,l\,*\,({\ddot{\theta}}cos\theta - {\dot{\theta}}^{2} sin\theta )\} $$
(5)
$$ {\ddot x}(M + m) = u - m*l*({\ddot{\theta}}cos\theta - {\dot{\theta}}^{2} sin\theta ) $$
(6)

Putting value of \( {\ddot x} \) from Eq. 6 in Eq. 4,

$$ H = u - M(\frac{{u + ml({{\dot{\uptheta} }}^{2} \,{ \sin }\,\uptheta - {{\ddot{\uptheta} }}\,{ \cos }\,\uptheta)}}{M + m}) $$
(7)
$$ H = \frac{{mu - Mm*l*\left( {{{\dot{\uptheta} }}^{2} \,{ \sin }\,\uptheta - {{\ddot{\uptheta}}}\,{ \cos }\,\uptheta} \right)}}{M + m} $$
(8)

Force balance in y-direction of the rod,

$$ V - mg = - m{\mkern 1mu} \,\,*\,\,{\mkern 1mu} l\,\,{\mkern 1mu} *\,\,{\mkern 1mu} (\dot{\theta }^{2} sin\theta + \ddot{\theta }{\mkern 1mu} cos\theta ) $$
(9)
$$ V = m\left\{ {g - l\,*\,\left( {\dot{\theta }^{2} sin\theta + \ddot{\theta }{\mkern 1mu} cos\theta } \right)} \right\} $$
(10)

Using values of H and V from Eqs. 8 and 10 respectively and subsequently putting in Eq. 1,

$$ I\ddot{\theta } = m\left\{ {g - l\left( {\dot{\theta }^{2} sin\theta + \ddot{\theta }{\mkern 1mu} cos\theta } \right)} \right\}l\,\,*\,\,sin\theta - l\,\,*\,\,cos\theta \left\{ {\frac{{mu - Mm\,\,*\,\,l\left( {\dot{\theta }^{2} sin\theta - \ddot{\theta }{\mkern 1mu} cos\theta } \right)}}{M + m}} \right\} $$
(11)

Using the value of moment of inertia,

$$ I = \frac{{m\left( {2\,\,*\,\,l} \right)^{2} }}{3} = \frac{{4m\,\,*\,\,l^{2} }}{3} $$
(12)
$$ \frac{{{{\ddot{\uptheta} }}}}{ml}\left( {\frac{{4ml^{2} }}{3} + ml^{2} \,{ \sin }^{ 2}\uptheta - \frac{{Mml^{2} \,{ \cos }^{2}\uptheta}}{M + m}} \right) = \left( {\begin{array}{l} {g\,{ \sin }\,\uptheta - \frac{{u\,{ \cos }\,\uptheta}}{M + m} - l{{\dot{\uptheta} }}^{2} \,{ \sin }\,\uptheta\,{ \cos }\,\uptheta} \\ { + \frac{{M*l*{ \cos }\,\uptheta\,{ \sin }\,\uptheta\left( {\dot{\uptheta}}^{2} \right)}}{M + m}} \\ \end{array} } \right) $$
(13)
$$ \ddot{\theta }\,*\,l\,*\,\left( {\frac{4}{3} - \frac{{mcos^{2} \theta }}{M + m}} \right) = gsin\theta + cos\theta \left( {\frac{{ - u - m\,*\,l\,*\,\dot{\theta }^{2} sin\theta }}{M + m}} \right) $$
(14)
$$ \ddot{\theta } = \frac{{gsin\theta + cos\theta \left( {\frac{{ - u - m\,*\,l\,*\,\dot{\theta }^{2} sin\theta }}{M + m}} \right)}}{{l\,*\,\left( {\frac{4}{3} - \frac{{mcos^{2} \theta }}{M + m}} \right)}} $$
(15)

As can be clearly seen from Eq. 15, the dynamics of the plant is non-linear and a suitable controller is required to maintain the pendulum at a certain position. In this study, the value of m is 1 kg, M is 2 kg and l is 1 m.

4 Fractional Order Calculus

The mention of fractional calculus can be dated back to 1695, when L’ Hôpital commented on the ‘meaning of derivatives with non-integer order’ as “It will be an apparent paradox from which one day useful consequences will be derived”. For a few centuries, the development of fractional calculus has been in theory, but with the advent of high computational devices, it can be utilized in effective control of complex plants. Fractional derivatives describe memory and hereditary properties in an extremely appropriate manner. This is the main advantage of fractional order derivatives when compared with integer-order models, in which such effect is neglected.

The use of fractional order calculus for the purpose of control emerged with Bode [31]. Bode presented an elegant solution to robust design problem where it was desired to have the closed loop performance invariant to changes in the amplifier gain. He came up with fractional order integrator with transfer function \( G\left( s \right) = \left( {\frac{{\upomega_{cg} }}{s}} \right)^{\alpha } \), known as Bode’s ideal transfer function where \( \upomega_{cg} \) is the gain crossover frequency. Fractional calculus is a generalization of integration and differentiation to a non-integer order fundamental operator \( {}_{a}D_{t}^{r} \), where a and t are the limits of the operation. The continuous integro-differential operator is defined as:

$$ {}_{a}D_{t}^{r} = \left\{ {\begin{array}{*{20}l} {\frac{{d^{r} }}{{dt^{r} }},\;R\left( r \right) > 0} \hfill \\ {1,\;R\left( r \right) = 0} \hfill \\ {\int\limits_{a}^{t} {\left( {d\uptau} \right)^{ - r} ,\;R\left( r \right) < 0} } \hfill \\ \end{array} } \right. $$
(16)

where r is the order of the operation, generally \( r \in R \), but r could also be a complex number.

The three equivalent forms of the fractional integro-differential most commonly used are the Grunwald-Letnikov (GL) definition, the Riemann-Liouville (RL) and the Caputo definition. The GL definition is given as:

$$ {}_{a}D_{t}^{r} f\left( t \right) = { \lim }_{h \to 0} h^{ - r} \sum\limits_{j = 0}^{{\left[ {\frac{t - a}{h}} \right]}} {\left( { - 1} \right)^{j} \left( \begin{aligned} r \hfill \\ j \hfill \\ \end{aligned} \right)f} \left( {t - jh} \right), $$
(17)

where [.] means the integer part.

The RL definition is given as:

$$ {}_{a}D_{t}^{r} f\left( t \right) = \frac{1}{{\Gamma \left( {n - r} \right)}}\frac{{d^{n} }}{{dt^{n} }}\int\limits_{a}^{t} {\frac{{f\left(\uptau \right)}}{{\left( {t -\uptau} \right)^{r - n + 1} }}} d\uptau $$
(18)

where \( (n - 1 < r < n) \) and \( \Gamma (.) \) is the Gamma function.

The Caputo definition can be written as:

$$ \upomega_{z,1} =\upomega_{L} \sqrt\upeta $$
(19)

for \( (n - 1 < r < n) \). The initial conditions for the fractional order differential equations with the Caputo derivatives are in the same form as for the integer-order differential equations.

The most usual way of making use, both in simulations and hardware implementations, of transfer functions involving fractional powers of ‘s’ is to approximate them with usual (integer order) transfer functions with a similar behaviour [35,36,37]. So as to perfectly mimic a fractional transfer function, an integer transfer function would have to include an infinite number of poles and zeroes. Oustaloup’s approximation makes use of recursive distribution of poles and zeros to obtain series of rational functions whose frequency response fit the frequency response of the irrational function within specific frequency band. This method, also known as ORA is defined as follows for frequency band of \([{\omega_l}; {\omega_h}]\).

$$ s_{{[\upomega_{l} ,\upomega_{h} ]}}^{\uplambda} = k\prod\limits_{n=1}^{N} {\frac{{1 + \frac{S}{{\upomega_{z,n} }}}}{{1 + \frac{S}{{\upomega_{p,n} }}}}} $$
(20)
$$ \upomega_{z,1} =\upomega_{L} \sqrt\upeta\,, $$
(21)
$$ {\begin{array}{*{20}l} {\upomega_{p,n} =\upomega_{z,n}\upalpha,} \hfill n=1 \ldots N,\\ {\upomega_{z,n + 1} =\upomega_{p,n}\upeta},\hfill n=1 \ldots N-1,\\ \end{array} }$$
(22)
$$ \upalpha = \left( {\frac{{\upomega_{h} }}{{\upomega_{l} }}} \right)^{{\frac{\uplambda}{N}}} $$
(23)
$$ \upeta = \left( {\frac{{\upomega_{h} }}{{\upomega_{l} }}} \right)^{{(1 -{\uplambda})} /{N}} $$
(24)

where k is a constant that should be chosen such that the magnitude of the approximate shall have unity gain (0 dB) at 1 rad/s. N represents the number of poles and zeros which should be chosen beforehand. Large value of N permits good approximation but increases the computational complexity. On the other hand, small value results in simpler approximation but could cause appearance of ripple in gain and phase behavior. Low and high frequencies band limitations could avoid the use of infinite numbers of rational transfer function besides limiting the high frequency gain of the derivative effect [44].

5 Grey Predictor

GP is employed when there is a lack of information about the system model. It extracts present and past information from a plant to generate future values in order to minimize the error. In real life, due to noise that arises from both the inside and outside of the system (and the limitations of our cognitive abilities), the information one perceives about that system is always uncertain and limited in scope [19]. One of the characteristics of grey system is the construction of model with small amount of data. Grey prediction models can be used to predict the future values of the system with high accuracy.

5.1 GP Model

The main task of grey system theory is to extract realistic governing laws of the system using available data. This process is known as the generation of the grey sequence. It is argued that even though the available data of the system, which generally consists of white numbers, is too complex or chaotic, it always contains some governing laws. If the randomness of the data obtained from a system is somehow smoothed, it is easier to derive any special characteristics of that system. For instance, the sequence that represents the speed values of a motor might be given as:

$$ Q\left( 0 \right) = \left( {820,840,835,850,890} \right) $$
(25)

It is obvious that the sequence does not have a clear regularity. If accumulating generation is applied to original sequence, \( Q\left( 1 \right) \) is obtained which has a clear growing tendency [25].

$$ Q\left( 1 \right) = \left( {820,1660,2495,3345,4235} \right) $$
(26)

As one plots the data points from Eq. 25 which represents the speed values of a motor, a random graph as shown in Fig. 3 with no definite pattern or future growing tendency, is obtained.

Fig. 3
figure 3

The original data set

As data points of accumulated data are plotted from Eq. 26, a graph as shown in Fig. 4 is obtained. This graph has a clear growing tendency and gives more information about the system than the original data set.

Fig. 4
figure 4

The accumulated data set

5.2 GM (n, m) Model

In grey systems theory, GM (n, m) denotes a grey model, where n is the order of the difference equation and m is the number of variables. Although various types of grey models can be mentioned, most of the previous researchers have focused their attention on GM (1, 1) model for their predictions because of its computational efficiency. It should be noted that in real time applications, the computational burden is the most important parameter after performance [18].

5.2.1 GM (1, 1) Model

GM (1, 1) type of grey model is the most widely used in literature and is pronounced as “Grey Model First Order One Variable”. This model is a time series forecasting model. The differential equations of the GM (1, 1) model have time-varying coefficients. In other words, the model is renewed as the new data becomes available to the prediction model. The GM (1, 1) model can only be used in positive data sequences [19]. In this chapter, an inverted pendulum plant with reference angle more than 0° is used, so that the value of \( \theta \) is never negative. Hence, the GM (1, 1) model can be used to forecast the position of the pendulum.

In order to smooth the randomness, the primitive data obtained from the system to form a GM (1, 1) it is subjected to an operator named accumulating generation operation (AGO) [19]. The differential equation (i.e. GM (1, 1)) thus evolved is solved to obtain the n-step ahead predicted value of the system. Finally, using the predicted value, the inverse accumulating operation (IAGO) is applied to find the predicted values of original data [18].

5.2.2 Mathematical Modeling of GP

Consider a single input and single output system. Assuming that the time sequence \( Q^{(0)} \) represents the output of the system

$$ Q^{(0)} = (q^{(0)} (1),q^{(0)} (2), \ldots q^{(0)} (m)),\;m \ge 4 $$
(27)

where \( Q^{(0)} \) is a non-negative sequence and m is the sample size of the data. This sequence is then subjected to AGO to obtain the sequence, \( Q^{(1)} \). Through Eq. 28, it can be observed that \( Q^{(1)} \) is monotone increasing

$$ Q^{(1)} = (q^{(1)} (1),q^{(1)} (2), \ldots q^{(1)} (m)),\;m \ge 4 $$
(28)

where \( q^{(1)} (j) = \sum\limits_{i = 1}^{j} {q^{(0)} (i),\;j = 1,2,3, \ldots m} \)

This shows that each term in the \( Q^{(1)} \) sequence is actually a cumulated sum of all the terms from the beginning till that term.

The mean sequence \( W^{(1)} \) of \( Q^{(1)} \), is defined as:

$$ W^{(1)} = (w^{(1)} (1),w^{(1)} (2), \ldots w^{(1)} (m)) $$
(29)

where \( w^{(1)} (j) \) terms in Eq. 29 are actually the mean values of adjacent data terms, which can be obtained as shown in Eq. 30,

$$ w^{(1)} (j) = 0.5q^{(1)} (j) + 0.5q^{(1)} (j - 1),j = 2,3, \ldots ,m $$
(30)

The least square estimate sequence of the grey difference equation of GM (1, 1) is defined as follows:

$$ q^{(0)} (j) + cw^{(1)} (j) = v $$
(31)

The whitening equation is therefore written as follows:

$$ \frac{{dq^{(1)} (t)}}{dq} + cq^{(1)} (t) = v $$
(32)

In Eq. 32, \( [c,v]^{T} \) is a sequence of parameters that can be found from Eq. 33:

$$ [c,v]^{T} = (O^{T} O)^{ - 1} O^{T} P $$
(33)

where,

$$ P = [q^{(0)} (2),q^{(0)} (3), \ldots q^{(0)} (m)]^{T} $$
(34)
$$ O = \left( {\begin{array}{*{20}c} { - w^{(1)} (2)} & 1 \\ { - w^{(1)} (3)} & 1 \\ \vdots & \vdots \\ { - w^{(1)} (n)} & 1 \\ \end{array} } \right) $$
(35)

The solution of \( q^{(1)} (t) \) at time k is obtained as follows:

$$ q_{z}^{(1)} (j + 1) = [q^{(0)} (1) - \frac{v}{c}]e^{ - cj} + \frac{v}{c} $$
(36)

To obtain the predicted value of the primitive data at time (j + 1), IAGO is used to establish the grey model as shown in Eq. 37:

$$ q_{z}^{(0)} (j + 1) = [q^{(0)} (1) - \frac{v}{c}]e^{ - cj} (1 - e^{c} ) $$
(37)

The parameter ‘−c’ in the GM (1, 1) model is called ‘development coefficient’ and gives information about the development of states. The parameter ‘v’ is called the ‘grey action quantity’ which reflects changes in the data that have arisen because of being derived from the background values [18].

GM (1,1) Rolling Model:

GM (1,1) rolling model is based on the forward data sequence to build the GM (1,1). For instance, using q(0)(j), q(0)(j+1), q(0)(j+2) and q(0)(j+3), model predicts the value of the next point q(0)(j+4). In the next step, the first point is always shifted to the second. It means that q(0)(j+1), q(0)(j+2), q(0)(j+3) and q(0)(j+4) are used to predict the value of q(0)(j+5). This procedure is repeated till the end of the sequence and the method is called rolling check. GM (1,1) rolling model is used to predict the long continuous data sequences such as the output of a system, price of a specific product, trend analysis for finance statements, social parameters, etc. In this chapter, GM (1,1) rolling model is used to predict the future outputs of the moving cart inverted pendulum system [10].

6 Integer/Fractional Order FPD Controller with/without GP

This section introduces the integer and fractional order FLC design and its implementation. For this task, initially the FPD controller is described along with its mathematical equations and block diagram in Sect. 6.1. Following this, in Sect. 6.2, FOFPD controller is introduced by replacing the integer order derivative with a fractional order derivative and its application model is explained. Sections 6.3 and 6.4 describe the way GP is combined with FPD and FOFPD controllers in order to transform them into FPD-GP and FOFPD-GP controllers respectively. The membership functions, rule base, inference mechanism and defuzzification technique which have been used in the operation of all the four controllers are elaborated in Sect. 6.5.

6.1 FPD Controller

The standard equation of a conventional PD controller in time domain is defined as:

$$ u_{PD} \left( t \right) = K_{p}^{{\prime }} \left[ {e\left( t \right) + T_{d} \dot{e}\left( t \right)} \right] $$
(38)

or

$$ u_{PD} \left( t \right) = \left[ {K_{p}^{{\prime }} e\left( t \right) + K_{d}^{{\prime }} \dot{e}\left( t \right)} \right] $$
(39)

where \( K_{p}^{{\prime }} \) is the proportional constant, \( T_{d} \) is the derivative time constant, \( K_{d}^{{\prime }} \) is the derivative gain, \( u_{PD} (t) \) is the output of PD controller, \( e(t) \) is error.

In discrete form, Eq. 39 can be written as:

$$ u_{PD} \left( k \right) = \left[ {K_{\text{p}}^{{\prime }} e\left( k \right) + K_{\text{d}}^{{\prime }} r\left( k \right)} \right] $$
(40)

where \( r\left( k \right) = (e\left( k \right) - e(k - 1))\,/\,T \) is the rate of change of error and T is the sampling period.

Now, the FPD controller can be designed based on the discrete form of the conventional PD controller as given in Eq. 40. The inputs to the FPD controller are error \( e\left( k \right) \) and rate of change of error \( r\left( k \right) \) and the output is \( u_{FPD} \left( k \right) \) [39].

$$ u_{FPD} \left( k \right) = K_{upd} \varvec{D}_{F} \left\{ {\varvec{F}_{F} \left[ {K_{p} e\left( k \right),K_{d} r\left( k \right)} \right]} \right\} $$
(41)

Equation 41 gives the control action of a FPD controller, where \( K_{p} \) and \( K_{d} \) are the scaling factors of the inputs and \( K_{upd} \) is the scaling factor of the defuzzified output. \( \varvec{F}_{F} \) refers to the fuzzification of inputs and \( \varvec{D}_{F} \) refers to the defuzzification of the fuzzified output. The implementation of the FPD controller can be shown through a block diagram in Fig. 5.

Fig. 5
figure 5

Block diagram of FPD controller

6.2 FOFPD Controller

When fractional calculus is implemented in conjunction with FPD controller, a better response can be expected than a conventional FPD. This can be attributed to the fact that the FOFPD controller would be less sensitive to the parametric variations of the system due to an extra degree of freedom. In terms of mathematical variations from the FPD controller, the \( \frac{d}{dt} \) term in Eq. 39 would be replaced by \( \frac{{d^{\uplambda} }}{{dt^{\uplambda} }} \) where \( \uplambda \in (0,1) \). The block diagram in Fig. 6 shows the design of the FOFPD controller.

Fig. 6
figure 6

Block diagram of FOFPD controller

As can be observed from Fig. 6, putting back \( \uplambda = 1 \) would result in FPD controller. The actual FOFPD controller has been realized using a transfer function which employs ORA as discussed earlier in Sect. 3. The Simulink model implementing the same is shown in Fig. 7.

Fig. 7
figure 7

Simulink model of FOFPD controller on inverted pendulum

6.3 FPD-GP Controller

The GP designed for the inverted pendulum uses data terms obtained from previous four samples to predict the future value. This helps in minimization of error and consequently, in a better transient response. GP is positioned in the feedback path of the FPD controller. Hence, the error received by FPD controller is more or less similar to the error which would have resulted in the next sample time in absence of GP. Thus, in a way, GP can be said to have accelerated the error detection process and help in the error reduction a step ahead. GP was implemented with the help of ‘Interpreted MATLAB function’. The above working can be demonstrated using a block diagram shown in Fig. 8.

Fig. 8
figure 8

Block diagram of FPD-GP controller

6.4 FOFPD-GP Controller

FOFPD-GP controller is constructed by juxtaposition of FOFPD controller and GP. It combines the advantages of fractional calculus and GP, i.e. the fractional part compensates for the dynamical instabilities of the plant and makes the response more robust, while the GP helps in prediction of future values which the controller can act upon and reduce the error. The block diagram in Fig. 9 clearly depicts the entire setup.

Fig. 9
figure 9

Block diagram of a FOFPD-GP controller

The practical realization of the FOFPD-GP controller using a Simulink model can be shown in Fig. 10.

Fig. 10
figure 10

Simulink model of FOFPD-GP controller on inverted pendulum

6.5 Framework of Fuzzy Controllers

A typical FPD controller consists of the arrangement shown in Fig. 11.

Fig. 11
figure 11

Block diagram of a FPD controller

The membership functions and their universes of discourse need to be designed depending upon the plant model. Following this, the rule base must be defined for all the possible combination of inputs. Fuzzy inference would then map the given inputs into output according to the rule base. Finally, a suitable defuzzification technique is required to convert the fuzzy output signal into a crisp control signal, which is made available to the plant input. The fuzzy logic used for all the controllers in this study is identical.

6.5.1 Membership Functions

Seven membership functions have been used for both the inputs and the output. Membership functions for error and rate of change of error are same and defined in the range \( -\uppi\,/\,2 < e(k)\,/\,r(k) <\uppi\,/\,2 \) as shown in Fig. 12. The reason for choice of this universe of discourse is accredited to the fact that outside this range, the pendulum rod falls down and needs different control techniques like swing up control to get back to its unstable equilibrium position.

Fig. 12
figure 12

Input membership functions for error and rate of change of error

Membership function for output is defined in the range \( - 15 < u < 15 \) as shown in Fig. 13. Asymmetric membership functions are selected instead of the usual symmetric ones because of the fact that the practical range of angle θ never exceeds \( 5^{ \circ } \) and for error larger than this value, the system becomes less dynamic. Therefore, the membership functions close to the \( 0^{ \circ } \) mark are spaced close to each other so as to provide better sensitivity and more amplification [26].

Fig. 13
figure 13

Output membership functions

6.5.2 Rule Base

In the matrix form, the rules are defined in Table 1. The reasoning behind the rule base can be explained by taking a particular case as an example, if the error and rate of change of error are NB and NM respectively, this suggests that the current output is at a very large distance from the reference and moving away from it at a considerable speed. Therefore, PB is required to bring the output back close to reference position [37].

Table 1 Rule table

6.5.3 Inference Engine and Defuzzification Method

The inference method used in the above analysis for all the controllers is Mamdani’s max-min inference process.

Defuzzification refers to the process of converting the fuzzy output signal to a crisp non-fuzzy value. It is done because fuzzy values cannot be directly used for actuators applications. The defuzzification technique employed in this study is centroid method. Mathematically, it’s given as

$$ z^{*} = \frac{{\int {\mu_{C} \left( z \right)\,\cdot\,z\,dz} }}{{\int {\mu_{C} \left( z \right)\,dz} }} $$
(42)

7 Results and Discussions

Application of FPD and FPD-GP controller on an inverted pendulum aims to control the rod at the reference position when an impulse disturbance is given. However, in order to further reduce the settling time, a transfer function employing ORA is used to convert FPD and FPD-GP into FOFPD and FOFPD-GP controllers respectively. A comparative study for settling time is demonstrated for the four abovementioned controllers and their controller gains tuned through GA are presented in Sect. 6.1. The error and control signal comparisons for all the controllers have also been shown. Further, all the controllers are subjected to sinusoidal disturbances at plant input and plant output individually for their robust testing. This study has been presented in Sects. 6.2 and 6.3. The performance of FOFPD and FOFPD-GP controller is found to be more efficient than FPD and FPD-GP controller respectively with significant reduction in settling time.

7.1 Optimization of Controllers

The gains and the fractional order exponent (for FOFPD and FOFPD-GP), used in the controllers are tuned for their optimum performance in the given bounds for all the controllers used in the chapter. The tuning is done using GA which is available as an inbuilt optimization tool in MATLAB. Three gains (K p , K d and K upd ) and the fractional order exponent λ (in case of FOFPD and FOFPD-GP) are tuned. The parameters’ settings used for tuning are shown in Table 2.

Table 2 Various parameters values for GA

The gains are tuned so as to produce minimum settling time. A pulse of width 10 ms and amplitude 100 N is applied at 1 s to the plant at the controller output, which disturbs the plant from its initial position. The best fitness plots for all the four types of controllers are shown below.

The convergence plot in Fig. 14 comes out to be smooth and becomes almost constant after 15 generations.

Fig. 14
figure 14

Convergence plot for FPD

From Fig. 15, it can be observed that there are only minor variations after 10 generations. However, the graph settles completely only towards the latter part.

Fig. 15
figure 15

Convergence plot for FOFPD

Figure 16 depicts the plot that is monotonically decreasing and more or less settles around 20th generation.

Fig. 16
figure 16

Convergence plot for FPD-GP

The graph in Fig. 17 shows that the plot for mean fitness settles very late to the best fitness plot (around 25th generation). However, the major fall occurs by the 10th generation only.

Fig. 17
figure 17

Convergence plot for FOFPD-GP

From the above convergence plots, it can be observed that the mean fitness value settles very close to the best value and continues to be stable till the last generation. The exact settling time and tuned gains’ values for various controllers are listed in Table 3.

Table 3 Tuned gains and obtained settling time values for the controllers

The reference set point tracking responses for all the investigated controllers are shown in Fig. 18 for the case when an impulse was given at the controller output.

Fig. 18
figure 18

Set point tracking responses of controllers

As it can be observed from Fig. 18, the settling time obtained from FOFPD-GP is minimum as compared to all the other controllers. Also, the undershoot is least for FOFPD-GP controller, thereby demonstrating its effectiveness in maintaining the pendulum angle at reference position. The corresponding error and the control signal comparisons for all the controllers are shown in Figs. 19 and 20.

Fig. 19
figure 19

Error comparison for all the controllers

Fig. 20
figure 20

Control signal comparison for all the controllers

It can be observed from Fig. 19, that the error signals of FOFPD and FOFPD-GP controllers come out to be smaller in amplitude and tend to settle earlier than the error signal of their integral counterparts, FPD and FPD-GP. Also, it can be clearly seen that the error for FOFPD-GP comes out to be the least.

As it is visible in Fig. 20, the control signals for FOFPD and FOFPD-GP are smoother and faster than FPD and FPD-GP respectively. This dominant performance of the control signals is responsible for better overall settling time response of the fractional controllers. Again, FOFPD-GP outperformed all the other controllers.

Further, the controllers developed, with their tuned gains, were subjected to various disturbances at different points to test their robustness and disturbance rejection capabilities. The following subsections present the relevant investigations.

7.2 Disturbance at Controller Output

This disturbance is analogous to a vibrating cart which has inverted pendulum mounted on cart. For the same, a sinusoidal disturbance was given at the controller output, D1 at time 0 s. Now, additionally; an impulse signal at 1 s was introduced as shown in Fig. 5. The impulse given at time t = 1 s has a pulse width of 10 ms and amplitude 100 N. The sinusoidal disturbance was varied in two different ways. First, the frequency was kept constant and the amplitude was varied, then the amplitude was kept constant and frequency was varied. IAE and ISE values were calculated for all the four responses obtained from different controllers. In all the cases, the tuned values of gains computed earlier were used. Firstly, a sinusoidal signal with constant amplitude and varying frequencies was given as a disturbance. The amplitude of the signal is taken to be 5 N. A plot for responses of FOFPD-GP, FPD-GP, FOFPD and FPD controllers when sine disturbance of frequency 50 rad/s and an impulse at t = 1 s is given is shown in Fig. 21 as a sample case study.

Fig. 21
figure 21

Disturbance rejection study for sinusoidal disturbance of 5 N and 50 rad/s

It can be observed from Fig. 21 that the response obtained for FOFPD-GP is the most robust as it doesn’t oscillate from its mean position as much as responses of other controllers. Therefore, the IAE and ISE values are also found to be lower for FOFPD-GP controller. The IAE and ISE values for constant amplitude and varying frequencies are shown in Table 4.

Table 4 Performance analysis: Disturbance of constant amplitude and varying frequency at D1

Again, it can be confirmed from Table 4 that the addition of fractional components improves the response by a significant factor. FOFPD-GP outperformed FPD-GP, FOFPD and FPD controllers as its IAE and ISE values for all the considered frequencies came out to be lowest.

Next, a sinusoidal signal with constant frequency and varying amplitude was applied. The frequency of the sinusoidal disturbance was taken to be 100 rad/s. Comparative plot depicting responses of FOFPD-GP, FPD-GP, FOFPD and FPD controllers for amplitude 6 N and frequency 100 rad/s is shown in Fig. 22 as a typical study.

Fig. 22
figure 22

Disturbance rejection study for sinusoidal disturbance of 6 N and 100 rad/s

It can be observed from Fig. 22 that the response obtained for FOFPD-GP is most robust, as its amplitude variations are very less in response to sinusoidal signal. Therefore, the IAE and ISE values are also lowest for FOFPD-GP. Table 5 shows the IAE and ISE values for constant frequency and varying amplitudes.

Table 5 Performance analysis: disturbance of constant frequency and varying amplitude at D1

As can be clearly noted from Table 5, the controllers with fractional derivatives performed considerably better than those without fractional components. FOFPD-GP outperformed FPD-GP, FOFPD and FPD controllers as its IAE and ISE values for all the frequencies came out to be lowest.

7.3 Disturbance at Plant Output

Referring to Fig. 5, a sinusoidal disturbance was added to the plant output at D2 to further analyze the relative performances of the investigated controllers. The sinusoidal disturbance was given at t = 1.5 s for 1 time period and it was varied in two ways in line with the previous case i.e. frequency and amplitude one at a time. In all the cases, the tuned values of gains computed earlier were used.

First, a sinusoidal signal with varying amplitudes and constant frequency was given as a disturbance. The frequency of the signal was taken to be 2πrad/s. Controller outputs for amplitude 5π/180 rad and frequency 2πrad/s are shown in Fig. 23 as a sample case study.

Fig. 23
figure 23

Disturbance rejection study for sinusoidal disturbance of 5π/180 rad and 2π rad/s

It can be observed from Fig. 23 that the response obtained from FOFPD-GP is the least unwavering, as it doesn’t oscillate from its mean position as much as the response of other controllers. Therefore, the IAE and ISE values also come out to be lowest for FOFPD-GP. Table 6 shows the IAE and ISE values of the controllers for the case of constant frequency and varying amplitudes.

Table 6 Performance analysis: disturbance of constant frequency and varying amplitude at D2

Table 6 again confirms that controllers with fractional components outperformed the controllers with integer derivatives and FOFPD-GP offers the best response among all the controllers.

Next, amplitude of the sinusoidal disturbance is taken to be π/180 rad/s. Controller outputs for amplitude π/180 rad and frequency π rad/s are shown in Fig. 24.

Fig. 24
figure 24

Disturbance rejection study for sinusoidal disturbance of π/180 rad and π rad/s

Again, it is revealed from Fig. 24 that the response obtained from FOFPD-GP is more robust, as it doesn’t oscillate from its mean position as much as the response of FPD-GP, FOFPD and FPD controllers. Therefore, the IAE and ISE values are also lowest for FPD-GP. Table 7 compares the IAE and ISE values for constant amplitude and varying frequencies:

Table 7 Performance analysis: disturbance of constant amplitude and varying frequency at D2

As can be proved from Table 7, FOFPD-GP and FOFPD controllers perform considerably better than their integer counterparts, FPD-GP and FPD respectively. Further, it is to be noted from Table 7, that FOFPD-GP outperformed FPD-GP, FOFPD and FPD controllers.

8 Conclusions and Future Scope

Fractional Order Fuzzy PD with Grey Predictor (FOFPD-GP), Fuzzy PD with Grey Predictor (FPD-GP), Fractional Order Fuzzy PD (FOFPD) and Fuzzy PD (FPD) controllers were successfully implemented and compared on a moving cart inverted pendulum. The simulations were done using Simulink on MATLAB. Initially, an impulse disturbance was given to the plant model for which the plant was tuned for minimum settling time using inbuilt optimization tool Genetic Algorithm. It was observed that the settling time of FOFPD-GP was improved from FPD by 2.88 times, from FPD-GP by 2.11 times and FOFPD by 2 times. Based on these facts, it is deduced that FOFPD-GP controller outperformed the other controllers under investigation.

Further, when sinusoidal disturbances were given at plant input and plant output, it was noted that the Integral of Absolute Error (IAE) and Integral of Square Error (ISE) values for FOFPD-GP came out to be better than FOFPD, FPD-GP and FPD for both the disturbances when the amplitude was kept constant and frequency was varied or when frequency was kept constant and amplitude was varied. Overall FOFPD-GP offered better responses than FOFPD, FPD-GP and FPD controllers in all the investigated cases for the moving cart inverted pendulum.

As a future scope, effectiveness of other inference mechanisms, different membership functions, defuzzification methods and other control varieties of fuzzy control schemes may be explored for moving cart inverted pendulum or such complex plants. Additionally, new and advanced and optimization techniques can also be applied to further effectively tune the control gains.