# HCDRNN-NMPC: A New Approach to Design Nonlinear Model Predictive Control (NMPC) Based on the Hyper Chaotic Diagonal Recurrent Neural Network (HCDRNN)

Authors: Samira Johari; Mahdi Yaghoobi; Hamid R. Kobravi
Journal: Complexity
 (2022)

---

## Abstract

In industrial applications, Stewart platform control is especially important. Because of the Stewart platform’s inherent delays and high nonlinear behavior, a novel nonlinear model predictive controller (NMPC) and new chaotic neural network model (CNNM) are proposed. Here, a novel NMPC based on hyper chaotic diagonal recurrent neural networks (HCDRNN-NMPC) is proposed, in which, the HCDRNN estimates the future system’s outputs. To improve the convergence of the parameters of the HCDRNN to better the system’s modeling, the extent of chaos is adjusted using a logistic map in the hidden layer. The proposed scheme uses an improved gradient method to solve the optimization problem in NMPC. The proposed control is used to control six degrees of freedom Stewart parallel robot with hard-nonlinearity, input constraints, and in the presence of uncertainties including external disturbance. High prediction performance, parameters convergence, and local minima avoidance of the neural network are guaranteed. Stability and high tracking performance are the most significant advantages of the proposed scheme.


---

## Body

## 1. Introduction

Stewart platform is a six-degree-of-freedom parallel robot that was first introduced by Stewart in 1965 and has potential uses in industrial contexts due to its good dynamics performance, high precision, and high rigidity. The control of the Stewart platform is quite challenging due to the nonlinear characteristics of dynamic parameters and time-varying delays. Stewart platform has more physical constraints than the serial manipulators, therefore solving their kinematics and dynamics problem is more difficult, and developing an accurate model of the Stewart platform has always been a concern for researchers in this field [1].There has been a lot of research done on using the neural networks to the model nonlinear systems [2–4]. In the study of Chen et al. [5], to control nonlinear teleoperation manipulators, an RBF-neural network-based adaptive robust control is developed. As a result, the RBF neural network is used to estimate the nonlinearities and model uncertainty in system dynamics with external disturbances. To handle parameter variations, the adaptive law is developed by adapting the parameters of the RBF neural network online while the nonlinear robust term is developed to deal with estimation errors. Lu employed a NN approximator to estimate uncertain parametric and unknown functions in a robotic system in the study by Lu and Liu [6], which was subsequently used to construct an adaptive NN controller for uncertain n-joint robotic systems with time-varying state constraints. As outlined in [7], an adaptive global sliding mode controller with two hidden layers is developed. The system nonlinearities were estimated using a new RNN with two hidden layers. An adaptive sliding mode control scheme based on RBFNN-based estimation of environmental parameters on the slave side is proposed in the study by Chen et al. [8] for a multilateral telerobotic system with master-slave manipulators. The environment force is modeled generally.Changes in the structure of the neural network during the training, as well as the use of chaos theory in the neural network, have been considered to cover the behavioral diversity of nonlinear systems. In the study by Chen and Han and Qiao [9, 10], the number of neurons in the hidden layer is changed online. In the study by Han et al. [11], to optimize the NN structure, a penalty-reward method is used. Aihara presented a chaotic NN model in the study by Aihara et al. [12]. Hopfield NN is introduced in the study of Li et al. and Farjami et al. [13, 14] as a chaotic RNN with a chaotic dynamic established temporarily for searching. Reference [15] introduces a context layer that uses chaotic mappings to produce chaotic behavior in NN throughout the training phase in order to prevent local minima. Reference [16] discusses the designing of a chaotic NN by using chaotic neurons which show chaotic behavior in some of their activity areas. In this aspect, the behavior of the neurons and network will change according to the changes in the bifurcation parameters of the neurons which have mostly been inspired by biological studies. A logistic map is utilized as an activation function in the study by Taherkhani et al. [17], which iteratively generates chaotic behavior in the nodes.In the study of Dongsu and Hongbin [18], an adaptive sliding controller has been used to identify fixed unknown parameters, followed by external disturbances compensation. In the study of Ghorbani and Sani [19], a Fuzzy NMPC is introduced to handle uncertainties and external disturbances. In the study of Jin et al. [20], different parallel robots’ NN-based controlling approaches have been reviewed. The applicability of RNN, feedforward NNs, or both for controlling parallel robots has been discussed in detail, comparing them in terms of controlling efficiency and complexity of calculations.In this paper, due to the inherent delays of the Stewart platform and the design of the controller based on future changes, special attention is paid to the model predictive control. To predict the system behavior over a predefined prediction horizon, MPC approaches require a precise linear model of the under-control system. Stewart platform is inherently nonlinear and linear models are mostly inaccurate in dynamical nonlinear systems modeling. These all bring up the motivation for using nonlinear models in MPC, leading to NMPC.The most significant features of NMPCs include the following: (I) nonlinear model utilization, (II) state and input constraints consideration, (III) online minimization of appointed performance criteria, (IV) necessity of solving an online optimal control problem, (V) requirement of the system state measuring or estimation, for providing the prediction. Among universal nonlinear models, which are used for predicting the behavior of the system in future, the neural networks are significantly attractive [21, 22].The effectiveness of the NNs in nonlinear system identification has increased the popularity of NN-based predictive controllers. Nikdel [23], has presented a NN-based MPC to control a shape memory alloy-based manipulator. For nonlinear system modeling and predictive control, a multiinput multioutput radial basis function neural network (RBFNN) was employed in the study of Peng et al. [24]. The recurrent neural networks (RNN) perform well in terms of modeling dynamical systems even in noisy situations because they naturally incorporate dynamic aspects in the form of storing dynamic response of the system through tapping delay, the RNN is utilized in NMPC in the study of Pan and Wang [25], and the results show that the approach converges quickly. In the study of Seyab and Cao [26], a continuous-time RNN is utilized for the NMPC, demonstrating the method’s appropriate performance under various operational settings.In this paper, we will continue this research using the hierarchical structure of the chaotic RNNs, application to NMPC of a complex parallel robot. This paper’s contributions and significant innovations are as follows: (I) a new NMPC based on hierarchical HCDRNNs is suggested to model and regulate typical nonlinear systems with complex dynamics. (II) To overcome the modeling issues of complex nonlinear systems with hard nonlinearities, in the proposed controller, the future output of the under-control system is approximated using a proposed novel hierarchical HCDRNN. Note that the equations of motion of such systems are very difficult to solve by mathematical methods and bring forth flaws such as inaccuracy and computational expenses. (III) The weight updating laws are modified based on the proposed HCDRNN scheme, considering the rules introduced in the study of Wang et al. [15]. (IV) On the one hand, propounding the novel hierarchical structure, and on the other hand, the use of chaos in weights updating rules, significantly reduced the cumulative error. (V) The extent of chaos is regulated based on the modeling error in the proposed HCDRNN, in order to increase the accuracy of modeling and prediction. (VI) The control and prediction horizons are specified based on closed-loop control features. (VII) Weights convergence of the proposed HCDRNN is demonstrated and system stability is assured in terms of the Lyapunov second law, taking into account input/output limitations. Furthermore, the proposed controller’s performance in the presence of external disturbance is evaluated.The remainder of this work is structured as follows: Section2 describes the suggested control strategy in detail, Section 3 discusses the simulation results to validate the efficiency of the proposed method, and Section 4 discusses the final conclusions.


## 2. The Proposed Control Strategy

The MPC is made up of three major components: the predictive model, the cost function, and the optimization method. The predictive model forecasts the system’s future behavior. Based on the optimization of the cost function and the projected behavior of the system, MPC applies an appropriate control input to the process. This paper uses a novel HCDRNN as the predictive model. Moreover, to optimize the cost function, it uses a type of improved gradient method which utilizes the data predicted by the proposed HCDRNN.Figure1 shows a block diagram of the designed control system in which Rt represents the desired trajectory for the coordinates origin of the moving plane. In which, yt and ut are the outputs and inputs of the Stewart platform, y^t+1 shows the output predicted by the NN model. Finally, the optimization block extracts the control signal, ut, by minimizing the cost function using the improved gradient descent method.Figure 1
Schematic of the proposed HCDRNN-NMPC.


### 2.1. Stewart Platform

Figure2 shows the Stewart platform. All parameters and variables are the same as what Tsai used in [27].Figure 2
Schematic of Stewart platform [27].The dynamic model of Stewart platform is introduced in equation (1), which is obtained based on the virtual-work principle [27].(1)−Fz−Jp−TFp+JxTFx+JyTFy=τ¯,where Jp,Jx,andJy are the manipulator Jacobian matrices, Fp is the resultant of the applied and inertia wrenches exerted at the center of mass of the moving platform, τ¯,Fx,Fy,andFz are the vectors of input torque and forces, which are applied to the center of mass of the moving plate from the prismatic joints of the robot. For more details about the robot and its mathematical model, the interested reader can see the reference [27].


### 2.2. The Proposed Hyper Chaotic Diagonal Recurrent Neural Network

In general, the structure of the NNs may be categorized into feedforward or recurrent types. Possessing the features of having attractor dynamics and data storage capability, the RNNs are more appropriate for modeling dynamical systems than the feedforward ones [28]. Reference [15] introduces the essential concepts of the chaotic diagonal recurrent neural network (CDRNN). This study introduces an HCDRNN, the structure of which is depicted in Figure 3.Figure 3
Structure of the HCDRNN [29].The proposed HCDRNN is made up of four layers: input, context, hidden, and output. The hidden layer outputs withv-step delays are routed into the context layer through a chaotic logistic map. The following equations describe the dynamics of the HCDRNN.(2)y^t=Wotγt,γt=FSt,St=WItXt+W1Dt−a.Z1tΓ1t−1⋮WnDt−a.ZntΓnt−1,Zt+1ζZt1−Zt,where Xt∈Rm×1 and y^t∈R1×1 show the inputs and output of the HCDRNN, γt=γ1t,γit,…,γntT∈Rn×1 represents the hidden layer’s output. A set of Γit−1=γit−1…γit−vT∈Rv×1 is defined as vectors of previous steps’ values of γifori=1,2,…,n. F. shows a symmetric sigmoid activation function. Zt∈Rn×1 represents the chaotic logistic map, with Z0 as a positive random number with normal distribution. The input, context, and output weight matrices are represented as WIt∈Rn×m, WiDt∈R1×v∀i=1,2,…,n, and Wot∈R1×n, respectively. ζ∈R1×1 is the chaos gain coefficient. The degree of chaos within the HCDRNN can be adjusted by adjusting the parameter a, which ranges from 0 for a simple DRNN to close to 4 for an HCDRNN. This fact allows you to regulate the level of chaos within the NN by altering the parameter a in such a manner that the reduction in training error leads to a progressive decrease in the extent of chaos until it reaches stability. The value of the parameter a’s value could be altered as follows. As the change is exponential, the NN will rapidly converge.(3)βt=−e¯te¯t+1,a=μ0+μmax−μ0exp−βtTa,e¯t>ε,0,e¯t≤ε.where e¯t is the samples’ absolute training prediction error. The prediction error, ept, represents the difference between the system’s actual output, yt, and the output of HCDRNN, y^t.(4)ept=yt−y^t.μmax and μo represent the maximum and minimum threshold of the parameter a, respectively. Ta is the annealing parameter, and ε is the prediction error threshold. To minimize the error function, Ept, the weight update laws for the output, hidden, and context layers are based on the robust adaptive dead zone learning algorithm reported in [30].(5)Ept=12ep2t.Accordingly, weights updating laws are modified here for the proposed structure of the HCDRNN as follows [29]:


#### 2.2.1. Output Layer

Ifept<Δot then Wot+1 and Δot+1 do not change, otherwise:(6)Wot+1=Wot+2eptγtT1−γt2,(7)Δot+1=Δot+2e¯t1−γt2.


#### 2.2.2. Hidden Layer

Ifept<ΔIt then WIt+1 and ΔIt+1 do not change, otherwise:(8)WIt+1=WIt+2teptWotF′tXt1−WotF′tXt2,(9)ΔIt+1=ΔIt+2F'minte¯t1−WotF′tXt2,where F′t=1−γ2t is the first derivative of the activation function in the hidden layer and Fj′t=F′sjt,∀i=1,2,…,n, and F'mint=minF'jt≠0,∀j,t.


#### 2.2.3. Context Layer

Ifept<ΔDt then WDt+1 and ΔDt+1 do not change, otherwise ∀i=1,2,…,n:(10)WiDt+1=WiDt+2Fmin'teptWiot1−γi2tΓiTt−11−Wiot1−γi2tΓiTt−12,(11)ΔDt+1=ΔDt+2F'minte¯t1−Wiot1−γi2tΓiTt−12.In these equations, “Δot,ΔIt,ΔDt are the robust adaptive dead zones for output, hidden and context layers, respectively.”Remark 1.
TheoremsA.1, A.2, and A.3 in the appendix prove the convergence of neural network weights.Remark 2.
As illustrated below [11], it is expected that a multiinput single-output nonlinear autoregressive exogenous (NARX) model may represent the undercontrol nonlinear system utilizing the nu delayed system’s inputs and ny delayed system’s outputs.(12)yt=gyt−1,…,yt−ny,ut−1,…,ut−nu.
In this equation,g. is an unknown function.
Based on Remark1 and Remark 2, an array of Hp HCDRNNs is used to forecast the system’s behavior in a Hp-step-ahead prediction horizon after the training and weights updating operations. The structure of this HCDRNN array is depicted in Figure 4.Figure 4
Prediction ofHp-step-ahead outputs by the hierarchical HCDRNN [29].Remark 3.
Each HCDRNN in the array, as shown in Figure4, is trained independently, and its weight matrices differ from those of the other HCDRNNs. As a result, the formulation in Sections 2.2.1 to 2.2.3 should be changed based on the input-output permutation for each element of the hierarchy. Remark 1 is, however, applied to all of the HCDRNNs in the array.


### 2.3. The Proposed HCDRNN-NMPC

A finite-horizon NMPC cost function would be the same as indicated in reference [11].(13)V^t=ρ1Rt−Y^tTRt−Y^t+ρ2ΔUtTΔUt,where Rt=rt+1,rt+2,…,rt+HpT is the reference signal, Yt=yt+1,yt+2,…,yt+HpT is the system output, and Y^t=y^t+1,y^t+2,…,y^t+HpT is the predicted output through the prediction horizon. ΔUt=Δut,Δut+1,…,Δut+Hu−1T is the control signal variations during the upcoming control horizon. ρ1 and ρ2 are weighting parameters, determining the significance of the tracking error versus the control signal variation in the cost function, V^. Hp is prediction horizon and Hu is control horizon Hu<Hp. However, the equation faces the following constraints [11]:(14)Δut≤Δumax,umin≤ut≤umax,y^min≤y^t≤y^max,rt+Hp+i−y^t+Hp+i=0,∀i≥1.The control signal,Ut+1=ut+1,ut+2,…,ut+HuT, based on the improved gradient method is given below [11, 31]:(15)Ut+1=Ut+ΔUt=Ut−η∂V^t∂Ut,(16)ΔUt=ηρ11+ηρ2∂Y^t∂UtTRt−Y^t,where η>0 represents the learning rate of the control input sequence and ∂Y^t/∂Ut represents the Jacobian matrix, J, which is computed as a matrix with the dimension of Hp×Hu.(17)∂Y^t∂Ut=∂y^t+1∂ut00⋯0∂y^t+2∂ut∂y^t+2∂ut+10⋯0⋮⋮⋮⋱⋮∂y^t+Hu∂ut∂y^t+Hu∂ut+1∂y^t+Hu∂ut+2⋯∂y^t+Hp∂ut+Hu−1⋮⋮⋮⋮⋮∂y^t+Hp∂ut∂y^t+Hp∂ut+1∂y^t+Hp∂ut+2⋯∂y^t+Hp∂ut+Hu−1Hp×Hu.The Jacobian matrix,J=∂Y^t/∂Ut, can be computed based on the chain rule.(18)∂y^t+i∂ut+j=Wot+i∂γt+i∂ut+j,∀i=1,2,…,Hp,∀j=0,1,…,Hu−1,∂y^t+i∂ut+j=F′t+iWIt+i∂Xt+i∂ut+j+W1Dt+i−a.Z1t+i∂Γ1t+i−1∂ut+j⋮WnDt+i−a.Znt+i∂Γnt+i−1∂ut+j,in which, F′t+i=∂FSt+i/∂St+j=1−γ2t and ∂γt+i/∂ut+j can be computed recurrently knowing that if j=i then ∂γt+i/∂ut+j=0. It means that the computations should be completed from ∂γt+i/∂ut+i−1 to ∂γt+i/∂ut+j. Moreover, considering the structure of Xt+i, the ∂Xt+i/∂ut+j can be calculated recurrently based on equation (26).Algorithm 1 summarizes the proposed HCDRNN-NMPC scheme [29].Algorithm 1: Details of HCDRNN-NMPC scheme.
Step 1. DetermineHp and Hu, such that Hp>Hu.Step 2. GetRt, Ut, and Xt in each control step, such that:(i)
Rt=rt+1,…,rt+HpT is the desired values for Hp next steps.(ii)
Ut=ut,…,ut+Hu−1T is the last optimal sequence of the predicted control signal.(iii)
Xt is the delayed input-output vector of nonlinear system.Step 3. Predict the outputs of the system forHp next steps by the proposed HCDRNN.Step 4. CalculateJ by equation (17).Step 5. ComputeΔUt and Ut+1 by equations (15) and (16), respectively.Step 6. ApplyUt+1 as the first element of vector Ut+1 to the nonlinear system, and go back to Step 2 for the next sample time.In steps 4 and 5 of the proposed algorithm, as the number of system inputs increases, the dimensions of the Jacobian matrix increase, and the estimation error increases due to the discretizations performed in calculating the derivatives. Choosing the appropriate sampling, time is used as a solution to reduce the estimation error in this paper.


#### 2.3.1. Stability Analysis for HCDRNN-NMPC

The stability of NMPC-HCDRNN is demonstrated by considering the convergence of the model, which is proved in Remark1 and Appendix, and the fact that the neural network training is done offline.Theorem 1.
Consider the constrained finite-horizon optimal control presented by (17) and (18). Lyapunov’s second law ensures the asymptotic stability of the proposed controller due to the limited input and output amplitudes and the semidefinite negative V^˙t if the neural network weights’ convergence is proven and the predictive control law is as given in equations (19) and (20).Proof.
The constrained finite-horizon optimal control given in equation (13) can be rewritten as in (19) by rewriting the cost function along the control horizon:(19)V^t=ρ1∑i=1Hprt+i−y^t+i2+ρ2∑i=1HuΔu2t+i−1.
Ut=ut,ut+1,…,ut+Hu−1T is the optimal control sequence obtained at time t using the optimization algorithm. If Ust+1 is the suboptimal control sequence extracted from Ut and considered as Ust+1=ut+1,…,ut+Hu−1T, the suboptimal cost function V^st+1 is defined as follows:(20)V^t+1=ρ1∑i=1Hp+1rt+i−y^t+i2+ρ2∑i=1HuΔu2t+i−1.
Using the difference ofV^t and V^st+1, and assuming that et+i=rt+i−y^t+i, equation (21) is written as follows:(21)V^st+1−V^t=ρ1∑i=1Hp+1e2t+i+ρ2∑i=1HuΔu2t+i−1−ρ1∑i=1Hpe2t+i+ρ2∑i=1HuΔu2t+i−1,=ρ1e2t+Hp+1−e2t+1−ρ2Δu2t≤0.
Therefore, ifUt+1 is the optimal solution of the optimization problem time t+1 using the control law described in equation (16), it outperforms Ust+1, which is suboptimal and its cost function is smaller according to equation (22).(22)V^t+1−Vt≤V^st+1−V^t≤0.
Hence, the proof is complete.


## 2.1. Stewart Platform

Figure2 shows the Stewart platform. All parameters and variables are the same as what Tsai used in [27].Figure 2
Schematic of Stewart platform [27].The dynamic model of Stewart platform is introduced in equation (1), which is obtained based on the virtual-work principle [27].(1)−Fz−Jp−TFp+JxTFx+JyTFy=τ¯,where Jp,Jx,andJy are the manipulator Jacobian matrices, Fp is the resultant of the applied and inertia wrenches exerted at the center of mass of the moving platform, τ¯,Fx,Fy,andFz are the vectors of input torque and forces, which are applied to the center of mass of the moving plate from the prismatic joints of the robot. For more details about the robot and its mathematical model, the interested reader can see the reference [27].


## 2.2. The Proposed Hyper Chaotic Diagonal Recurrent Neural Network

In general, the structure of the NNs may be categorized into feedforward or recurrent types. Possessing the features of having attractor dynamics and data storage capability, the RNNs are more appropriate for modeling dynamical systems than the feedforward ones [28]. Reference [15] introduces the essential concepts of the chaotic diagonal recurrent neural network (CDRNN). This study introduces an HCDRNN, the structure of which is depicted in Figure 3.Figure 3
Structure of the HCDRNN [29].The proposed HCDRNN is made up of four layers: input, context, hidden, and output. The hidden layer outputs withv-step delays are routed into the context layer through a chaotic logistic map. The following equations describe the dynamics of the HCDRNN.(2)y^t=Wotγt,γt=FSt,St=WItXt+W1Dt−a.Z1tΓ1t−1⋮WnDt−a.ZntΓnt−1,Zt+1ζZt1−Zt,where Xt∈Rm×1 and y^t∈R1×1 show the inputs and output of the HCDRNN, γt=γ1t,γit,…,γntT∈Rn×1 represents the hidden layer’s output. A set of Γit−1=γit−1…γit−vT∈Rv×1 is defined as vectors of previous steps’ values of γifori=1,2,…,n. F. shows a symmetric sigmoid activation function. Zt∈Rn×1 represents the chaotic logistic map, with Z0 as a positive random number with normal distribution. The input, context, and output weight matrices are represented as WIt∈Rn×m, WiDt∈R1×v∀i=1,2,…,n, and Wot∈R1×n, respectively. ζ∈R1×1 is the chaos gain coefficient. The degree of chaos within the HCDRNN can be adjusted by adjusting the parameter a, which ranges from 0 for a simple DRNN to close to 4 for an HCDRNN. This fact allows you to regulate the level of chaos within the NN by altering the parameter a in such a manner that the reduction in training error leads to a progressive decrease in the extent of chaos until it reaches stability. The value of the parameter a’s value could be altered as follows. As the change is exponential, the NN will rapidly converge.(3)βt=−e¯te¯t+1,a=μ0+μmax−μ0exp−βtTa,e¯t>ε,0,e¯t≤ε.where e¯t is the samples’ absolute training prediction error. The prediction error, ept, represents the difference between the system’s actual output, yt, and the output of HCDRNN, y^t.(4)ept=yt−y^t.μmax and μo represent the maximum and minimum threshold of the parameter a, respectively. Ta is the annealing parameter, and ε is the prediction error threshold. To minimize the error function, Ept, the weight update laws for the output, hidden, and context layers are based on the robust adaptive dead zone learning algorithm reported in [30].(5)Ept=12ep2t.Accordingly, weights updating laws are modified here for the proposed structure of the HCDRNN as follows [29]:


### 2.2.1. Output Layer

Ifept<Δot then Wot+1 and Δot+1 do not change, otherwise:(6)Wot+1=Wot+2eptγtT1−γt2,(7)Δot+1=Δot+2e¯t1−γt2.


### 2.2.2. Hidden Layer

Ifept<ΔIt then WIt+1 and ΔIt+1 do not change, otherwise:(8)WIt+1=WIt+2teptWotF′tXt1−WotF′tXt2,(9)ΔIt+1=ΔIt+2F'minte¯t1−WotF′tXt2,where F′t=1−γ2t is the first derivative of the activation function in the hidden layer and Fj′t=F′sjt,∀i=1,2,…,n, and F'mint=minF'jt≠0,∀j,t.


### 2.2.3. Context Layer

Ifept<ΔDt then WDt+1 and ΔDt+1 do not change, otherwise ∀i=1,2,…,n:(10)WiDt+1=WiDt+2Fmin'teptWiot1−γi2tΓiTt−11−Wiot1−γi2tΓiTt−12,(11)ΔDt+1=ΔDt+2F'minte¯t1−Wiot1−γi2tΓiTt−12.In these equations, “Δot,ΔIt,ΔDt are the robust adaptive dead zones for output, hidden and context layers, respectively.”Remark 1.
TheoremsA.1, A.2, and A.3 in the appendix prove the convergence of neural network weights.Remark 2.
As illustrated below [11], it is expected that a multiinput single-output nonlinear autoregressive exogenous (NARX) model may represent the undercontrol nonlinear system utilizing the nu delayed system’s inputs and ny delayed system’s outputs.(12)yt=gyt−1,…,yt−ny,ut−1,…,ut−nu.
In this equation,g. is an unknown function.
Based on Remark1 and Remark 2, an array of Hp HCDRNNs is used to forecast the system’s behavior in a Hp-step-ahead prediction horizon after the training and weights updating operations. The structure of this HCDRNN array is depicted in Figure 4.Figure 4
Prediction ofHp-step-ahead outputs by the hierarchical HCDRNN [29].Remark 3.
Each HCDRNN in the array, as shown in Figure4, is trained independently, and its weight matrices differ from those of the other HCDRNNs. As a result, the formulation in Sections 2.2.1 to 2.2.3 should be changed based on the input-output permutation for each element of the hierarchy. Remark 1 is, however, applied to all of the HCDRNNs in the array.


## 2.2.1. Output Layer

Ifept<Δot then Wot+1 and Δot+1 do not change, otherwise:(6)Wot+1=Wot+2eptγtT1−γt2,(7)Δot+1=Δot+2e¯t1−γt2.


## 2.2.2. Hidden Layer

Ifept<ΔIt then WIt+1 and ΔIt+1 do not change, otherwise:(8)WIt+1=WIt+2teptWotF′tXt1−WotF′tXt2,(9)ΔIt+1=ΔIt+2F'minte¯t1−WotF′tXt2,where F′t=1−γ2t is the first derivative of the activation function in the hidden layer and Fj′t=F′sjt,∀i=1,2,…,n, and F'mint=minF'jt≠0,∀j,t.


## 2.2.3. Context Layer

Ifept<ΔDt then WDt+1 and ΔDt+1 do not change, otherwise ∀i=1,2,…,n:(10)WiDt+1=WiDt+2Fmin'teptWiot1−γi2tΓiTt−11−Wiot1−γi2tΓiTt−12,(11)ΔDt+1=ΔDt+2F'minte¯t1−Wiot1−γi2tΓiTt−12.In these equations, “Δot,ΔIt,ΔDt are the robust adaptive dead zones for output, hidden and context layers, respectively.”Remark 1.
TheoremsA.1, A.2, and A.3 in the appendix prove the convergence of neural network weights.Remark 2.
As illustrated below [11], it is expected that a multiinput single-output nonlinear autoregressive exogenous (NARX) model may represent the undercontrol nonlinear system utilizing the nu delayed system’s inputs and ny delayed system’s outputs.(12)yt=gyt−1,…,yt−ny,ut−1,…,ut−nu.
In this equation,g. is an unknown function.
Based on Remark1 and Remark 2, an array of Hp HCDRNNs is used to forecast the system’s behavior in a Hp-step-ahead prediction horizon after the training and weights updating operations. The structure of this HCDRNN array is depicted in Figure 4.Figure 4
Prediction ofHp-step-ahead outputs by the hierarchical HCDRNN [29].Remark 3.
Each HCDRNN in the array, as shown in Figure4, is trained independently, and its weight matrices differ from those of the other HCDRNNs. As a result, the formulation in Sections 2.2.1 to 2.2.3 should be changed based on the input-output permutation for each element of the hierarchy. Remark 1 is, however, applied to all of the HCDRNNs in the array.


## 2.3. The Proposed HCDRNN-NMPC

A finite-horizon NMPC cost function would be the same as indicated in reference [11].(13)V^t=ρ1Rt−Y^tTRt−Y^t+ρ2ΔUtTΔUt,where Rt=rt+1,rt+2,…,rt+HpT is the reference signal, Yt=yt+1,yt+2,…,yt+HpT is the system output, and Y^t=y^t+1,y^t+2,…,y^t+HpT is the predicted output through the prediction horizon. ΔUt=Δut,Δut+1,…,Δut+Hu−1T is the control signal variations during the upcoming control horizon. ρ1 and ρ2 are weighting parameters, determining the significance of the tracking error versus the control signal variation in the cost function, V^. Hp is prediction horizon and Hu is control horizon Hu<Hp. However, the equation faces the following constraints [11]:(14)Δut≤Δumax,umin≤ut≤umax,y^min≤y^t≤y^max,rt+Hp+i−y^t+Hp+i=0,∀i≥1.The control signal,Ut+1=ut+1,ut+2,…,ut+HuT, based on the improved gradient method is given below [11, 31]:(15)Ut+1=Ut+ΔUt=Ut−η∂V^t∂Ut,(16)ΔUt=ηρ11+ηρ2∂Y^t∂UtTRt−Y^t,where η>0 represents the learning rate of the control input sequence and ∂Y^t/∂Ut represents the Jacobian matrix, J, which is computed as a matrix with the dimension of Hp×Hu.(17)∂Y^t∂Ut=∂y^t+1∂ut00⋯0∂y^t+2∂ut∂y^t+2∂ut+10⋯0⋮⋮⋮⋱⋮∂y^t+Hu∂ut∂y^t+Hu∂ut+1∂y^t+Hu∂ut+2⋯∂y^t+Hp∂ut+Hu−1⋮⋮⋮⋮⋮∂y^t+Hp∂ut∂y^t+Hp∂ut+1∂y^t+Hp∂ut+2⋯∂y^t+Hp∂ut+Hu−1Hp×Hu.The Jacobian matrix,J=∂Y^t/∂Ut, can be computed based on the chain rule.(18)∂y^t+i∂ut+j=Wot+i∂γt+i∂ut+j,∀i=1,2,…,Hp,∀j=0,1,…,Hu−1,∂y^t+i∂ut+j=F′t+iWIt+i∂Xt+i∂ut+j+W1Dt+i−a.Z1t+i∂Γ1t+i−1∂ut+j⋮WnDt+i−a.Znt+i∂Γnt+i−1∂ut+j,in which, F′t+i=∂FSt+i/∂St+j=1−γ2t and ∂γt+i/∂ut+j can be computed recurrently knowing that if j=i then ∂γt+i/∂ut+j=0. It means that the computations should be completed from ∂γt+i/∂ut+i−1 to ∂γt+i/∂ut+j. Moreover, considering the structure of Xt+i, the ∂Xt+i/∂ut+j can be calculated recurrently based on equation (26).Algorithm 1 summarizes the proposed HCDRNN-NMPC scheme [29].Algorithm 1: Details of HCDRNN-NMPC scheme.
Step 1. DetermineHp and Hu, such that Hp>Hu.Step 2. GetRt, Ut, and Xt in each control step, such that:(i)
Rt=rt+1,…,rt+HpT is the desired values for Hp next steps.(ii)
Ut=ut,…,ut+Hu−1T is the last optimal sequence of the predicted control signal.(iii)
Xt is the delayed input-output vector of nonlinear system.Step 3. Predict the outputs of the system forHp next steps by the proposed HCDRNN.Step 4. CalculateJ by equation (17).Step 5. ComputeΔUt and Ut+1 by equations (15) and (16), respectively.Step 6. ApplyUt+1 as the first element of vector Ut+1 to the nonlinear system, and go back to Step 2 for the next sample time.In steps 4 and 5 of the proposed algorithm, as the number of system inputs increases, the dimensions of the Jacobian matrix increase, and the estimation error increases due to the discretizations performed in calculating the derivatives. Choosing the appropriate sampling, time is used as a solution to reduce the estimation error in this paper.


### 2.3.1. Stability Analysis for HCDRNN-NMPC

The stability of NMPC-HCDRNN is demonstrated by considering the convergence of the model, which is proved in Remark1 and Appendix, and the fact that the neural network training is done offline.Theorem 1.
Consider the constrained finite-horizon optimal control presented by (17) and (18). Lyapunov’s second law ensures the asymptotic stability of the proposed controller due to the limited input and output amplitudes and the semidefinite negative V^˙t if the neural network weights’ convergence is proven and the predictive control law is as given in equations (19) and (20).Proof.
The constrained finite-horizon optimal control given in equation (13) can be rewritten as in (19) by rewriting the cost function along the control horizon:(19)V^t=ρ1∑i=1Hprt+i−y^t+i2+ρ2∑i=1HuΔu2t+i−1.
Ut=ut,ut+1,…,ut+Hu−1T is the optimal control sequence obtained at time t using the optimization algorithm. If Ust+1 is the suboptimal control sequence extracted from Ut and considered as Ust+1=ut+1,…,ut+Hu−1T, the suboptimal cost function V^st+1 is defined as follows:(20)V^t+1=ρ1∑i=1Hp+1rt+i−y^t+i2+ρ2∑i=1HuΔu2t+i−1.
Using the difference ofV^t and V^st+1, and assuming that et+i=rt+i−y^t+i, equation (21) is written as follows:(21)V^st+1−V^t=ρ1∑i=1Hp+1e2t+i+ρ2∑i=1HuΔu2t+i−1−ρ1∑i=1Hpe2t+i+ρ2∑i=1HuΔu2t+i−1,=ρ1e2t+Hp+1−e2t+1−ρ2Δu2t≤0.
Therefore, ifUt+1 is the optimal solution of the optimization problem time t+1 using the control law described in equation (16), it outperforms Ust+1, which is suboptimal and its cost function is smaller according to equation (22).(22)V^t+1−Vt≤V^st+1−V^t≤0.
Hence, the proof is complete.


## 2.3.1. Stability Analysis for HCDRNN-NMPC

The stability of NMPC-HCDRNN is demonstrated by considering the convergence of the model, which is proved in Remark1 and Appendix, and the fact that the neural network training is done offline.Theorem 1.
Consider the constrained finite-horizon optimal control presented by (17) and (18). Lyapunov’s second law ensures the asymptotic stability of the proposed controller due to the limited input and output amplitudes and the semidefinite negative V^˙t if the neural network weights’ convergence is proven and the predictive control law is as given in equations (19) and (20).Proof.
The constrained finite-horizon optimal control given in equation (13) can be rewritten as in (19) by rewriting the cost function along the control horizon:(19)V^t=ρ1∑i=1Hprt+i−y^t+i2+ρ2∑i=1HuΔu2t+i−1.
Ut=ut,ut+1,…,ut+Hu−1T is the optimal control sequence obtained at time t using the optimization algorithm. If Ust+1 is the suboptimal control sequence extracted from Ut and considered as Ust+1=ut+1,…,ut+Hu−1T, the suboptimal cost function V^st+1 is defined as follows:(20)V^t+1=ρ1∑i=1Hp+1rt+i−y^t+i2+ρ2∑i=1HuΔu2t+i−1.
Using the difference ofV^t and V^st+1, and assuming that et+i=rt+i−y^t+i, equation (21) is written as follows:(21)V^st+1−V^t=ρ1∑i=1Hp+1e2t+i+ρ2∑i=1HuΔu2t+i−1−ρ1∑i=1Hpe2t+i+ρ2∑i=1HuΔu2t+i−1,=ρ1e2t+Hp+1−e2t+1−ρ2Δu2t≤0.
Therefore, ifUt+1 is the optimal solution of the optimization problem time t+1 using the control law described in equation (16), it outperforms Ust+1, which is suboptimal and its cost function is smaller according to equation (22).(22)V^t+1−Vt≤V^st+1−V^t≤0.
Hence, the proof is complete.


## 3. Simulation

To control the Stewart platform, HCDRNN-NMPC is used such that the upper moving plane of the platform tracks the desired trajectory. The simulations have been carried out by MATLAB software, 2015 version. To evaluate the efficiency of the control method against external disturbances, the effects of the disturbance applied to the force on one of the links of Stewart platforms have been investigated.


### 3.1. Neural Network-Based Model

To predict the behavior of the Stewart platform, input-output data of the system under different operating configurations are required. To generate the training data, the inverse dynamics of the Stewart platform are solved for several random desired trajectories, based on the algorithm presented by [27] and the parameters introduced by [32]. The applied sampling time is ts=0.01.


#### 3.1.1. Training

The general structure of the HCDRNN is designed in such a way that its inputs vector,Xt, includes the previous position of the moving plane, pxt, and the forces exerted on each link, Fit, as in equation (23), and its output vector, yt, includes the position of the moving plane as in equation (24).(23)Xt=F1t,…,F1t−nu,…,F6t,…,F6t−nu,pxt−1,…,pxt−ny,(24)yt=Pxt.The number of elements ofXt determines the number of input layer neurons. Accordingly, thirteen input nodes have been considered for six links. As the network’s output comprises three positions and three directions, separate networks should be considered for each output and, therefore, there would be six MISO networks in our case. For the aforementioned networks, a supervised learning scheme is considered to train the networks with regard to the inputs and outputs. Divided into two sets, 70% of the data were chosen for training and 30% of them for testing. At the beginning of the training of the HCDRNNs, the weight matrices are randomly valued. Tangent sigmoid is selected as the activation function, and the input-output data are normalized. The values for the NN parameters are defined as ε=0.01, Ta=0.07, μmax=4, μ0=0, μo=μI=μD=0.01, ny=2, and nu=3 as well as WI,WD,Wo,ΔI,ΔD,Δo are randomly initialized.The neural network training is done offline, but during the training, the coefficienta is adjusted online in such a way that the behavior of the Stewart platform is covered by creating chaos in the neural network structure, and as the training error decreases, its value changes such that the neural network’s chaos is decreased. Figure 5 shows the chaotic property of the HCDRNN.Figure 5
Traces of the training (a) traces of the training mean square error (MSE) and (b) traces of the coefficienta.
(a)(b)The impact of the number of hidden layer neurons on the approximation performance is studied. Table1 reports the results of this study for 7 to 43 neurons, where their performances are compared in terms of training time and MSE.Table 1
Comparison of prediction performance versus the number of hidden layer neurons.
No. of hidden layer neuronsTraining MSETraining time (sec)79.7927e−5658.28279.6511e−8978.12439.4508e−51804.05As shown in Table1, the training time increases with an increase in the number of neurons in the hidden layer. Considering the fact that the MSE value is proper when there are 7 neurons in the hidden layer, it would be more appropriate to use 7 neurons in the hidden layer for the prediction of the Stewart platform.For a sinusoidal trajectory, the results of one-step-ahead, two-step-ahead, and three-step-ahead system behavior predictions are investigated. Table2 reports the MSE of the prediction error.Table 2
MSE of prediction error for a sinusoidal trajectory.
No. of step aheadOne-step-aheadTwo-step-aheadThree-step-aheadMSE of prediction error8.9321e−81.2463e−69.7927e−5Table2 indicates a reliable prediction by the HCDRNN without any accumulated error. As a significant conclusion, it is shown that the use of chaotic context layer, besides the use of different weight matrices that were trained for each step, in the proposed hierarchical structure, overcome the error accumulation in n-step-ahead predictions.


### 3.2. The Results of HCDRNN-NMPC

In this paper, the values for the parameters are considered as follows:Hp=3, Hu=2, ρ1=0.8, ρ2=0.2, and η=0.01. The performance of the NMPC is compared with the MPC, which both are evaluated by the integral absolute error (IAE).(25)IAE=1T∑t=1TRt−Yt,where T shows the total number of samples. Some research studies are using other metrics like mean square error (MSE) and/or integral square error (ISE). Each of these metrics has drawbacks that led us to use of IAE instead. Metrics that use error squares magnify the errors greater than one and minify the errors less than one, which is not precise in robotics motion errors. Input and output signals are bounded in the intervals mentioned in equation (26).(26)0≤Fit≤16,−1.7≤Pxt≤1.2.


#### 3.2.1. Sample Trajectories

The performance of the controller to track the three paths demonstrated in sections (1), (2), and (3).(1)
A sample trajectory has been designed, which is intended to be tracked with the undercontrol Stewart platform. Trying to calculate the control signal applied to link 1, assuming that the forces exerted on other links remain fixed.(27)Pt=PxtPytPzt=−1.5+0.2sinωt0.2sinωt1.0+0.2sinωt,whereω=3 and 0≤ωt≤2π. Considering the desired trajectory for the robot’s movement and the actual trajectory on x,y,z axis, tracking error varies within the range of −5.625e−3,0.015e−3 for all three axes which are neglectable.Figure6 shows the three-dimensional path of the top plane of the Stewart platform. As found in Figure 6, the NMPC has extracted the control signal in a way that the Stewart platform’s output tracks the reference signal along three axes well. Moreover, Figure 7 shows the force exerted to link 1.As it is shown in Figure7, the control signal applied to link 1 provides for the limit needed for the forces exerted in each link.(2)
The second sample trajectory sets out to track the following two-frequency trajectory.(28)ϕx=ϕy=ϕz=0,Pt=PxtPytPzt=0.2sinω1t+0.4sinω2t0.2sinω1t1.0+0.2sinω2tm,ω1=3,ω2=2,0≤ω1t,ω2t≤2.Considering the desired trajectory for the robot’s movement and the actual trajectory onx,y,z axis, tracking error range on x,y,z axis, is reported in Table 3.Taking Table3 into consideration, it can be concluded that the tracking error varies within the range of −1.01_2.03∗e−8 for all three axes which are neglectable.Figure8 shows the three-dimensional path of the top plane of the Stewart platform, and Figure 9 shows the force exerted to link 1.As found in Figure9, the NMPC has extracted the control signal in a way that the Stewart platform’s output tracks the reference signal along three axes well. As found in Figure 9, the control signal applied to link 1 provides for the limit needed for the forces exerted in each link, assuming that the positions of other links remain unchanged.(3)
In the third sample path, which is similar to the path presented in the reference [33], to evaluate the performance of the proposed controller in tracking the paths with rapid changes, the following two-level step path has been examined.(29)ϕx=ϕy=ϕz=0,Pt=PxtPytPzt=3.5ut−ut−53ut−ut−15.3ut−ut−7cm,0≤Pxt,Pyt,Pzt≤,0≤Fit≤6.Figure 6
Tracking the three- dimensional path.Figure 7
Force exerted to link 1 (control signal).Table 3
Tracking error range onx,y,z axis for two-frequency trajectory.
AxisxyzTracking error range−1.01_2.03∗e−8−1.01_1.88∗e−6−0.79_1.05∗e−5Figure 8
Tracking the three-dimensional path.Figure 9
Force exerted to link 1 (control signal).Considering the desired trajectory for the robot’s movement and the actual trajectory onx,y,z axis, tracking error range on x,y,z axis is reported in Table 4. The three-dimensional path traveled by the Stewart platform is shown in Figure 10. The force exerted to link 1 is shown in Figure 11.Table 4
Tracking error range onx,y,z axis for two-level step trajectory.
AxisxyzTracking error range−3.2_3.5−1.8_3−5.1_5.5Figure 10
Tracking the three-dimensional path.Figure 11
Force exerted to link 1 (control signal).As shown in Figures10 and 11, due to intensive changes in the desired path, the controller made a control effort to extract the control signal in order to reach the desired path, and after reaching the desired path, the control signal did not change. The transient phase of the response is well observed in this optimal path, and as reported in Table 4, the tracking error in tracking the reference signal for x, y, and z axes changes between [−5.1–5.5], which is desired considering the severe changes of the reference and the control signal applied to link 1 satisfies the applied force’s constraint.


### 3.3. External Disturbance Rejection

The effect of external disturbance is assessed here, in the form of a pulse signal with0.4N amplitude, during 1 to 1.4 seconds, applying to another link’s force. The proposed control performance is shown in Figure 12.Figure 12
Disturbance rejection.Figure13 demonstrated the tracking error and control signal in the presence of external disturbance.Figure 13
(a) Tracking error and (b) extracted control signal in the presence of external disturbance.
(a)(b)By applying disturbance, the output is changed and a control effort is made to enhance the tracking. Some advantage of the proposed method can be the low number of oscillations in disturbance rejection, the smaller overshoot and undershoot than the initial disturbance magnitude, resulting in a more uniform output, and a significant improvement that is the smaller and more smooth control signal.


### 3.4. Simulation Results Analysis

The nonlinear model predictive controller requires high computational to extract the control signal, but because of the system’s nonlinear model, it can achieve the desired control performance with minimum error. Because the Stewart platform has unknown dynamics, the NN was used to model it. Chaos theory was used in NN to reduce and speed up control calculations, which accelerates the learning dynamics and thus solves the problem of predictive control being slow. Furthermore, involvement with local minimums is avoided by employing chaos in the neural network and increasing the order of chaos by employing more chaotic functions in the hidden layer, resulting in hyper-chaos in the proposed neural network. Table5 compares the prediction performance of the DRNN and proposed HCDRNN.Table 5
Prediction performance of the DRNN and proposed HCDRNN.
NNDRNNHCDRNNPrediction errorTrainingTestTrainingTestStep11.7545e−64.2148e−53.8214e−81.1284e−7Step27.2561e−46.7316e−39.1852e−85.6371e−7Step39.1027e−11.4111e−16.2379e−79.0141e−7Table6 compares the performance of the proposed control with the proportional-integral-derivative (PID) control [34], the sliding mode control [18], and the fuzzy NMPC [19] and DRNN-NMPC. The comparison results are recorded in terms of IAE.Table 6
IAE comparison.
Control approachPIDSliding mode controlFuzzy NMPCDRNN-NMPCThe proposed methodIAE3.2e−42.8e−54.6e−61.9e−32.9e−8The proposed method provides a minor value of IAE compared with the other method.PID controllers need a set of big gains for the proportional, integral, and derivative coefficients, and this makes the control signal highly sensitive to external disturbance so that the control signal rises to a large value with the lowest level of disturbance. However, the control inputs are bounded for factual reasons, thus, the control signal computed through the PID controller would not be applicable in practice.As demonstrated in Figure13(a), when the external disturbance is applied to the robot, tracking error has a small value in the range of −6e−4,−3e−3, which is proof of the proposed method’s high performance.


## 3.1. Neural Network-Based Model

To predict the behavior of the Stewart platform, input-output data of the system under different operating configurations are required. To generate the training data, the inverse dynamics of the Stewart platform are solved for several random desired trajectories, based on the algorithm presented by [27] and the parameters introduced by [32]. The applied sampling time is ts=0.01.


### 3.1.1. Training

The general structure of the HCDRNN is designed in such a way that its inputs vector,Xt, includes the previous position of the moving plane, pxt, and the forces exerted on each link, Fit, as in equation (23), and its output vector, yt, includes the position of the moving plane as in equation (24).(23)Xt=F1t,…,F1t−nu,…,F6t,…,F6t−nu,pxt−1,…,pxt−ny,(24)yt=Pxt.The number of elements ofXt determines the number of input layer neurons. Accordingly, thirteen input nodes have been considered for six links. As the network’s output comprises three positions and three directions, separate networks should be considered for each output and, therefore, there would be six MISO networks in our case. For the aforementioned networks, a supervised learning scheme is considered to train the networks with regard to the inputs and outputs. Divided into two sets, 70% of the data were chosen for training and 30% of them for testing. At the beginning of the training of the HCDRNNs, the weight matrices are randomly valued. Tangent sigmoid is selected as the activation function, and the input-output data are normalized. The values for the NN parameters are defined as ε=0.01, Ta=0.07, μmax=4, μ0=0, μo=μI=μD=0.01, ny=2, and nu=3 as well as WI,WD,Wo,ΔI,ΔD,Δo are randomly initialized.The neural network training is done offline, but during the training, the coefficienta is adjusted online in such a way that the behavior of the Stewart platform is covered by creating chaos in the neural network structure, and as the training error decreases, its value changes such that the neural network’s chaos is decreased. Figure 5 shows the chaotic property of the HCDRNN.Figure 5
Traces of the training (a) traces of the training mean square error (MSE) and (b) traces of the coefficienta.
(a)(b)The impact of the number of hidden layer neurons on the approximation performance is studied. Table1 reports the results of this study for 7 to 43 neurons, where their performances are compared in terms of training time and MSE.Table 1
Comparison of prediction performance versus the number of hidden layer neurons.
No. of hidden layer neuronsTraining MSETraining time (sec)79.7927e−5658.28279.6511e−8978.12439.4508e−51804.05As shown in Table1, the training time increases with an increase in the number of neurons in the hidden layer. Considering the fact that the MSE value is proper when there are 7 neurons in the hidden layer, it would be more appropriate to use 7 neurons in the hidden layer for the prediction of the Stewart platform.For a sinusoidal trajectory, the results of one-step-ahead, two-step-ahead, and three-step-ahead system behavior predictions are investigated. Table2 reports the MSE of the prediction error.Table 2
MSE of prediction error for a sinusoidal trajectory.
No. of step aheadOne-step-aheadTwo-step-aheadThree-step-aheadMSE of prediction error8.9321e−81.2463e−69.7927e−5Table2 indicates a reliable prediction by the HCDRNN without any accumulated error. As a significant conclusion, it is shown that the use of chaotic context layer, besides the use of different weight matrices that were trained for each step, in the proposed hierarchical structure, overcome the error accumulation in n-step-ahead predictions.


## 3.1.1. Training

The general structure of the HCDRNN is designed in such a way that its inputs vector,Xt, includes the previous position of the moving plane, pxt, and the forces exerted on each link, Fit, as in equation (23), and its output vector, yt, includes the position of the moving plane as in equation (24).(23)Xt=F1t,…,F1t−nu,…,F6t,…,F6t−nu,pxt−1,…,pxt−ny,(24)yt=Pxt.The number of elements ofXt determines the number of input layer neurons. Accordingly, thirteen input nodes have been considered for six links. As the network’s output comprises three positions and three directions, separate networks should be considered for each output and, therefore, there would be six MISO networks in our case. For the aforementioned networks, a supervised learning scheme is considered to train the networks with regard to the inputs and outputs. Divided into two sets, 70% of the data were chosen for training and 30% of them for testing. At the beginning of the training of the HCDRNNs, the weight matrices are randomly valued. Tangent sigmoid is selected as the activation function, and the input-output data are normalized. The values for the NN parameters are defined as ε=0.01, Ta=0.07, μmax=4, μ0=0, μo=μI=μD=0.01, ny=2, and nu=3 as well as WI,WD,Wo,ΔI,ΔD,Δo are randomly initialized.The neural network training is done offline, but during the training, the coefficienta is adjusted online in such a way that the behavior of the Stewart platform is covered by creating chaos in the neural network structure, and as the training error decreases, its value changes such that the neural network’s chaos is decreased. Figure 5 shows the chaotic property of the HCDRNN.Figure 5
Traces of the training (a) traces of the training mean square error (MSE) and (b) traces of the coefficienta.
(a)(b)The impact of the number of hidden layer neurons on the approximation performance is studied. Table1 reports the results of this study for 7 to 43 neurons, where their performances are compared in terms of training time and MSE.Table 1
Comparison of prediction performance versus the number of hidden layer neurons.
No. of hidden layer neuronsTraining MSETraining time (sec)79.7927e−5658.28279.6511e−8978.12439.4508e−51804.05As shown in Table1, the training time increases with an increase in the number of neurons in the hidden layer. Considering the fact that the MSE value is proper when there are 7 neurons in the hidden layer, it would be more appropriate to use 7 neurons in the hidden layer for the prediction of the Stewart platform.For a sinusoidal trajectory, the results of one-step-ahead, two-step-ahead, and three-step-ahead system behavior predictions are investigated. Table2 reports the MSE of the prediction error.Table 2
MSE of prediction error for a sinusoidal trajectory.
No. of step aheadOne-step-aheadTwo-step-aheadThree-step-aheadMSE of prediction error8.9321e−81.2463e−69.7927e−5Table2 indicates a reliable prediction by the HCDRNN without any accumulated error. As a significant conclusion, it is shown that the use of chaotic context layer, besides the use of different weight matrices that were trained for each step, in the proposed hierarchical structure, overcome the error accumulation in n-step-ahead predictions.


## 3.2. The Results of HCDRNN-NMPC

In this paper, the values for the parameters are considered as follows:Hp=3, Hu=2, ρ1=0.8, ρ2=0.2, and η=0.01. The performance of the NMPC is compared with the MPC, which both are evaluated by the integral absolute error (IAE).(25)IAE=1T∑t=1TRt−Yt,where T shows the total number of samples. Some research studies are using other metrics like mean square error (MSE) and/or integral square error (ISE). Each of these metrics has drawbacks that led us to use of IAE instead. Metrics that use error squares magnify the errors greater than one and minify the errors less than one, which is not precise in robotics motion errors. Input and output signals are bounded in the intervals mentioned in equation (26).(26)0≤Fit≤16,−1.7≤Pxt≤1.2.


### 3.2.1. Sample Trajectories

The performance of the controller to track the three paths demonstrated in sections (1), (2), and (3).(1)
A sample trajectory has been designed, which is intended to be tracked with the undercontrol Stewart platform. Trying to calculate the control signal applied to link 1, assuming that the forces exerted on other links remain fixed.(27)Pt=PxtPytPzt=−1.5+0.2sinωt0.2sinωt1.0+0.2sinωt,whereω=3 and 0≤ωt≤2π. Considering the desired trajectory for the robot’s movement and the actual trajectory on x,y,z axis, tracking error varies within the range of −5.625e−3,0.015e−3 for all three axes which are neglectable.Figure6 shows the three-dimensional path of the top plane of the Stewart platform. As found in Figure 6, the NMPC has extracted the control signal in a way that the Stewart platform’s output tracks the reference signal along three axes well. Moreover, Figure 7 shows the force exerted to link 1.As it is shown in Figure7, the control signal applied to link 1 provides for the limit needed for the forces exerted in each link.(2)
The second sample trajectory sets out to track the following two-frequency trajectory.(28)ϕx=ϕy=ϕz=0,Pt=PxtPytPzt=0.2sinω1t+0.4sinω2t0.2sinω1t1.0+0.2sinω2tm,ω1=3,ω2=2,0≤ω1t,ω2t≤2.Considering the desired trajectory for the robot’s movement and the actual trajectory onx,y,z axis, tracking error range on x,y,z axis, is reported in Table 3.Taking Table3 into consideration, it can be concluded that the tracking error varies within the range of −1.01_2.03∗e−8 for all three axes which are neglectable.Figure8 shows the three-dimensional path of the top plane of the Stewart platform, and Figure 9 shows the force exerted to link 1.As found in Figure9, the NMPC has extracted the control signal in a way that the Stewart platform’s output tracks the reference signal along three axes well. As found in Figure 9, the control signal applied to link 1 provides for the limit needed for the forces exerted in each link, assuming that the positions of other links remain unchanged.(3)
In the third sample path, which is similar to the path presented in the reference [33], to evaluate the performance of the proposed controller in tracking the paths with rapid changes, the following two-level step path has been examined.(29)ϕx=ϕy=ϕz=0,Pt=PxtPytPzt=3.5ut−ut−53ut−ut−15.3ut−ut−7cm,0≤Pxt,Pyt,Pzt≤,0≤Fit≤6.Figure 6
Tracking the three- dimensional path.Figure 7
Force exerted to link 1 (control signal).Table 3
Tracking error range onx,y,z axis for two-frequency trajectory.
AxisxyzTracking error range−1.01_2.03∗e−8−1.01_1.88∗e−6−0.79_1.05∗e−5Figure 8
Tracking the three-dimensional path.Figure 9
Force exerted to link 1 (control signal).Considering the desired trajectory for the robot’s movement and the actual trajectory onx,y,z axis, tracking error range on x,y,z axis is reported in Table 4. The three-dimensional path traveled by the Stewart platform is shown in Figure 10. The force exerted to link 1 is shown in Figure 11.Table 4
Tracking error range onx,y,z axis for two-level step trajectory.
AxisxyzTracking error range−3.2_3.5−1.8_3−5.1_5.5Figure 10
Tracking the three-dimensional path.Figure 11
Force exerted to link 1 (control signal).As shown in Figures10 and 11, due to intensive changes in the desired path, the controller made a control effort to extract the control signal in order to reach the desired path, and after reaching the desired path, the control signal did not change. The transient phase of the response is well observed in this optimal path, and as reported in Table 4, the tracking error in tracking the reference signal for x, y, and z axes changes between [−5.1–5.5], which is desired considering the severe changes of the reference and the control signal applied to link 1 satisfies the applied force’s constraint.


## 3.2.1. Sample Trajectories

The performance of the controller to track the three paths demonstrated in sections (1), (2), and (3).(1)
A sample trajectory has been designed, which is intended to be tracked with the undercontrol Stewart platform. Trying to calculate the control signal applied to link 1, assuming that the forces exerted on other links remain fixed.(27)Pt=PxtPytPzt=−1.5+0.2sinωt0.2sinωt1.0+0.2sinωt,whereω=3 and 0≤ωt≤2π. Considering the desired trajectory for the robot’s movement and the actual trajectory on x,y,z axis, tracking error varies within the range of −5.625e−3,0.015e−3 for all three axes which are neglectable.Figure6 shows the three-dimensional path of the top plane of the Stewart platform. As found in Figure 6, the NMPC has extracted the control signal in a way that the Stewart platform’s output tracks the reference signal along three axes well. Moreover, Figure 7 shows the force exerted to link 1.As it is shown in Figure7, the control signal applied to link 1 provides for the limit needed for the forces exerted in each link.(2)
The second sample trajectory sets out to track the following two-frequency trajectory.(28)ϕx=ϕy=ϕz=0,Pt=PxtPytPzt=0.2sinω1t+0.4sinω2t0.2sinω1t1.0+0.2sinω2tm,ω1=3,ω2=2,0≤ω1t,ω2t≤2.Considering the desired trajectory for the robot’s movement and the actual trajectory onx,y,z axis, tracking error range on x,y,z axis, is reported in Table 3.Taking Table3 into consideration, it can be concluded that the tracking error varies within the range of −1.01_2.03∗e−8 for all three axes which are neglectable.Figure8 shows the three-dimensional path of the top plane of the Stewart platform, and Figure 9 shows the force exerted to link 1.As found in Figure9, the NMPC has extracted the control signal in a way that the Stewart platform’s output tracks the reference signal along three axes well. As found in Figure 9, the control signal applied to link 1 provides for the limit needed for the forces exerted in each link, assuming that the positions of other links remain unchanged.(3)
In the third sample path, which is similar to the path presented in the reference [33], to evaluate the performance of the proposed controller in tracking the paths with rapid changes, the following two-level step path has been examined.(29)ϕx=ϕy=ϕz=0,Pt=PxtPytPzt=3.5ut−ut−53ut−ut−15.3ut−ut−7cm,0≤Pxt,Pyt,Pzt≤,0≤Fit≤6.Figure 6
Tracking the three- dimensional path.Figure 7
Force exerted to link 1 (control signal).Table 3
Tracking error range onx,y,z axis for two-frequency trajectory.
AxisxyzTracking error range−1.01_2.03∗e−8−1.01_1.88∗e−6−0.79_1.05∗e−5Figure 8
Tracking the three-dimensional path.Figure 9
Force exerted to link 1 (control signal).Considering the desired trajectory for the robot’s movement and the actual trajectory onx,y,z axis, tracking error range on x,y,z axis is reported in Table 4. The three-dimensional path traveled by the Stewart platform is shown in Figure 10. The force exerted to link 1 is shown in Figure 11.Table 4
Tracking error range onx,y,z axis for two-level step trajectory.
AxisxyzTracking error range−3.2_3.5−1.8_3−5.1_5.5Figure 10
Tracking the three-dimensional path.Figure 11
Force exerted to link 1 (control signal).As shown in Figures10 and 11, due to intensive changes in the desired path, the controller made a control effort to extract the control signal in order to reach the desired path, and after reaching the desired path, the control signal did not change. The transient phase of the response is well observed in this optimal path, and as reported in Table 4, the tracking error in tracking the reference signal for x, y, and z axes changes between [−5.1–5.5], which is desired considering the severe changes of the reference and the control signal applied to link 1 satisfies the applied force’s constraint.


## 3.3. External Disturbance Rejection

The effect of external disturbance is assessed here, in the form of a pulse signal with0.4N amplitude, during 1 to 1.4 seconds, applying to another link’s force. The proposed control performance is shown in Figure 12.Figure 12
Disturbance rejection.Figure13 demonstrated the tracking error and control signal in the presence of external disturbance.Figure 13
(a) Tracking error and (b) extracted control signal in the presence of external disturbance.
(a)(b)By applying disturbance, the output is changed and a control effort is made to enhance the tracking. Some advantage of the proposed method can be the low number of oscillations in disturbance rejection, the smaller overshoot and undershoot than the initial disturbance magnitude, resulting in a more uniform output, and a significant improvement that is the smaller and more smooth control signal.


## 3.4. Simulation Results Analysis

The nonlinear model predictive controller requires high computational to extract the control signal, but because of the system’s nonlinear model, it can achieve the desired control performance with minimum error. Because the Stewart platform has unknown dynamics, the NN was used to model it. Chaos theory was used in NN to reduce and speed up control calculations, which accelerates the learning dynamics and thus solves the problem of predictive control being slow. Furthermore, involvement with local minimums is avoided by employing chaos in the neural network and increasing the order of chaos by employing more chaotic functions in the hidden layer, resulting in hyper-chaos in the proposed neural network. Table5 compares the prediction performance of the DRNN and proposed HCDRNN.Table 5
Prediction performance of the DRNN and proposed HCDRNN.
NNDRNNHCDRNNPrediction errorTrainingTestTrainingTestStep11.7545e−64.2148e−53.8214e−81.1284e−7Step27.2561e−46.7316e−39.1852e−85.6371e−7Step39.1027e−11.4111e−16.2379e−79.0141e−7Table6 compares the performance of the proposed control with the proportional-integral-derivative (PID) control [34], the sliding mode control [18], and the fuzzy NMPC [19] and DRNN-NMPC. The comparison results are recorded in terms of IAE.Table 6
IAE comparison.
Control approachPIDSliding mode controlFuzzy NMPCDRNN-NMPCThe proposed methodIAE3.2e−42.8e−54.6e−61.9e−32.9e−8The proposed method provides a minor value of IAE compared with the other method.PID controllers need a set of big gains for the proportional, integral, and derivative coefficients, and this makes the control signal highly sensitive to external disturbance so that the control signal rises to a large value with the lowest level of disturbance. However, the control inputs are bounded for factual reasons, thus, the control signal computed through the PID controller would not be applicable in practice.As demonstrated in Figure13(a), when the external disturbance is applied to the robot, tracking error has a small value in the range of −6e−4,−3e−3, which is proof of the proposed method’s high performance.


## 4. Conclusion

This paper proposed a novel hierarchical HCDRNN-NMPC for modeling and control of complex nonlinear dynamical systems. Numerical simulations on the control of a Stewart platform are prepared to demonstrate the performance of the proposed strategy in tracking and external disturbance rejection. One of the most essential aspects of the suggested method is its hierarchical HCDRNN’s ability to accurately estimate the system’s output via a forward-moving window. The hierarchical structure enables the proposed mechanism to precisely adjust each HCDRNN for predicting the outputs of the system for only one specified sample ahead. This enhances the ability of the predictive model in adapting with variations of the complex dynamical systems. This paper provides the adaptive weight update rules for the proposed v-step delayed HCDRNN. Moreover, for determining the sequence of the control signal, an enhanced gradient optimization method is used. Results of the provided simulations and comparisons indicate superior performance of the proposed control system in tracking and removing the effect of the external disturbances. In future research studies, the effects of merging HCDRNNs instead of the hierarchical structure will be investigated, which will last to create a deep HCDRNN structure. The suggested controller’s robustness against various forms of disturbances will also be tested.



---

*Source: 1006197-2022-10-18.xml*