# Energy Consumption Prediction for 3-RRR PPM through Combining LSTM Neural Network with Whale Optimization Algorithm

Authors: Yin Gao; Ke Chen; Hong Gao; Hongmei Zheng; Lei Wang; Ping Xiao
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

In the process of minimizing the energy consumption of a 3-RRR planar parallel manipulator (3-RRR PPM) and even general parallel kinematic manipulators, obtaining optimal results usually depends on particular functional relation between the instantaneous position of the moving platform and the kinetic time, which is called a displacement model (DM). Nevertheless, it is likely that although the movement time and path of a moving platform are the same, different amounts of energy are consumed for different DMs of the moving platform. To address this, a method of using long short-term memory neural network (LSTM-NN) instead of a complex theoretical model to predict the energy consumption of a 3-RRR PPM was presented. Subsequently, inverse dynamic equations of 3-RRR PPM were established based on the Newton–Euler method and solved using QR decomposition. Meanwhile, energy consumption between any two points in workspace of the 3-RRR PPM was programmed to provide the LSTM-NN with abundant precise training data. In view of time-varying characteristics of energy consumption prediction, the network architecture was developed based on the principle of LSTM-NN, and root-mean-square error (RMSE) was taken as the loss function. After acquiring training data, the RMSE of the LSTM-NN reached 0.00041 using whale optimization algorithm (WOA) with no need for the gradient of the loss function, so the lack of solving precision in training LSTM-NN was effectively improved. Finally, two different DMs of a moving platform with the same path and movement time were chosen to compare the total energy consumption of the 3-RRR PPM from the simulations, predictions, and experiments. The results showed that the relative error between predicted and experimental data was less than 2.50%. Therefore, the energy consumption prediction based on the LSTM-NN will be useful for achieving the intelligent application of 3-RRR PPMs.


---

## Body

## 1. Introduction

The use of 3-RRR planar parallel manipulators (PPMs) has grown recently. For example, when micron or even nanoscale accuracy is required, micromotion platforms using 3-RRR PPMs are widely employed as microforce sensors for the positioning of samples in a scanning electron microscope. Moreover, PPMs can be applied as parallel robots to conduct operations such as pick-and-place operations and precision machining [1, 2].Research on 3-RRR PPMs has mainly focused on the kinematics and working modes [2], performance analysis and optimization [3, 4], collision-free workspace determination [5], workspace analysis [6–11], singularity analysis and avoidance [2, 3, 12–15], and dynamics and experimental verification [16–19]. In recent years, many scholars have focused on energy consumption and optimization in the robotics industry, including the field of unmanned aerial vehicles (UAVs) [20–25], due to increasing concerns about the energy crisis.In one report [20], electromechanical models were derived for serial or parallel pick-and-place manipulators, and the energy-optimal trajectories were reasonably calculated. In another study [21], the optimization problem of the consumed energy for a 3-RRR PPM was examined, and the link and platform masses were treated as variables. The actuator power consumption was used as the objective function to examine the effects of kinematic, geometric, and dynamic constraints. The particle swarm optimization (PSO) method was proposed to minimize the energy consumption efficiently. In fact, for any parallel kinematic manipulator (PKM), to accomplish the assigned task and minimize the consumed time and expended energy simultaneously, trajectory planning is a very complex problem involving functional optimization. In one study [22], the objective function and constraint conditions of this optimization problem were modeled based on the dynamics of a general motor-driven PKM, and a novel constrained multiobjective genetic algorithm (MOGA) was presented to solve the multiobjective optimization problem.However, when the optimization problem was solved by the PSO method, spiral-shaped Cartesian trajectories were used for the positional motion of the moving platform [21]. Although the optimal results minimized the expended energy, the instantaneous position of the moving platform was restricted by the curvilinear equation. Thus, the instantaneous velocities and accelerations of the moving platform and the optimal energy consumption of a 3-RRR PPM were under the restrictions of these curvilinear equations. Similarly, a B-spline function was applied to generate the path function between the defined points [22]. Although the optimal results minimized the expended energy at μ = 0, the instantaneous position of the moving platform was under the restrictions of the B-spline function, and the instantaneous velocities and accelerations of the moving platform and optimal energy consumption of the PKM were restricted. For example, when two walkers travel along the same path, even if the total time they take is equal, the energy consumption is different because of their different instantaneous velocities.In this paper, the relationship between the instantaneous position of a moving platform and the kinetic time was defined as a displacement model (DM), and the relationship between the instantaneous velocity of the moving platform and kinetic time was defined as a velocity model (VM). The optimal energy consumption under a particular DM and VM was then cleverly derived [21, 22]. However, it could not be guaranteed that smaller energy consumption could be obtained for the same motion time and path when the DM or VM of the moving platform was changed.Therefore, it is necessary to predict the energy consumed when the 3-RRR PPM passes through a given path (or planned path) with different DMs or VMs for the same travel time. Recently, with the development of artificial intelligence, supervised learning methods, such as back propagation neural network (BPNN), recurrent neural networks (RNN), and LSTM-NN, have been widely used for the energy consumption prediction of mobile robots or unmanned aerial vehicles (UAVs) [23–25], gait generation [26], cycle time forecasting of wafer lots during the wafer manufacturing [27], welding process prediction [28, 29], in the medical field [30–33], human activity detection from untrimmed videos [34], advertising viewability prediction [35], and prediction of sea surface temperature (SST) [36].To address the scarcity of empirical data and relying on kinematics models, a dynamic power model to evaluate the power consumption of skid-steer mobile robots (SSMRs) was demonstrated based on the slip parameters of the solved differential equations [23]. For UAV surveillance systems, on the one hand, the energy consumption was efficiently predicted via an elastic net regression using Sklearn [24]. On the other hand, an adaptive neural network (ANN) controller was developed using a K-agglomerative clustering method with adaptive weights and varied learning rates to tackle the optimal path planning and disturbance rejection control [25]. The architecture of a fully connected recurrent neural network (FCRNN) was used to address the gait generation problem of a three-dimensional biped robot, and a novel weight optimization approach called the advanced multiobjective continuous ant colony optimization (AMO-CACO) was presented [26]. To forecast the short-term cycle time of wafer lots during wafer manufacturing, a bilateral LSTM-NN was proposed [27]. A Gaussian process regression (GPR) method was proposed to predict the real-time welding process [28], and to apply experiences and skills of human welders to intelligent control and to better maintain desired precision and consistency, an intelligent controller using the neurofuzzy model was designed in automated gas tungsten arc welding process [29]. Because an LSTM-NN is capable of learning long-term dependencies [30], for the past few years, LSTM-NN applied in the medical domain have achieved fairly good results. For example, a semantic-containing double-level embedded Bi-LSTM model (SCDE-Bi-LSTM) was presented for the semantic matching of questions and answers in the Chinese medical field [31]. In one study [32], the problem of clinical relation extraction was examined. First, the features in the sentence sequence were captured through a bidirectional LSTM network. Second, the syntactic context for the target entities was captured through a convolutional neural network and Bi-LSTM network. Finally, the relationships between target entities were classified through a fully connected layer. A bidirectional LSTM network-based method was proposed to extract drug-drug interactions from a large amount of valuable biomedical literature [33]. Two different convolutional neural networks were combined with a BLSTM, and a bidirectional recurrent neural network model was used to efficiently solve the problems of human activity detection from untrimmed videos [34]. Bidirectional LSTM networks, an encoder-decoder structure, and residual connections were combined to tackle the prediction problem of advertising viewability [35].However, in the process of training supervised networks such as BPNN and RNN, the gradient disappearance or gradient explosion probably occurs due to calculation of the loss function’s gradient. Further, LSTM-NN is propitious to modeling long-term dependencies, in which there is overfitting, while strong prediction capability and low likelihood of overfitting are characteristic of Adaptive Boosting (AdaBoost). Therefore, a method to combine LSTM-NN and AdaBoost was presented to predict the short and midterm daily SST [36]. Actually, the overfitting in LSTM-NN is the problem, which makes it difficult to satisfy the required solving precision in essence. In optimizing LSTM-NN’s loss function through conventional gradient descent method, the lack of solving precision is also the bottleneck problem of LSTM-NN prediction. Although the lack of precision had varying degrees of improvement by the some improved gradient methods such as Adagrad, AdaDelta, Adam, and RMSProp, the gradient of loss function was still calculated in these methods [37]. In other words, to calculate the gradient of loss function, the partial derivatives of loss function to each independent variable (i.e., the weights of LSTM-NN) are needed, so the calculation is extremely complicated due to the numerous weights, and the running efficiency and solving precision of the corresponding solving program still need to be further improved. On the contrary, WOA as a metaheuristic optimization algorithm does not involve in calculating the gradient of loss function in optimizing LSTM-NN’s loss function and has been proven to be an effective method with wonderful convergence for solving optimization problems [38–40]. For this purpose, WOA was proposed to train LSTM-NN.In summary, during optimization of the energy consumption of 3-RRR PPMs, to prevent the omission of smaller energy consumption by depending on a particular DM of a moving platform as described above, it is necessary to use trained supervised learning networks instead of complex theoretical models to predict the energy consumption of 3-RRR PPMs. In view of the time-varying characteristics of the energy consumption prediction and to avoid the inherent weaknesses of lack of solving precision in training LSTM-NN, a method for the energy consumption prediction of 3-RRR PPMs through combining principle of LSTM-NN with WOA is proposed in this paper.In the following, the inverse dynamics of the 3-RRR PPM are modeled by Newton–Euler method and solved using QR decomposition; additionally, the energy consumption between any two points in workspace of the 3-RRR PPM is programmed in Section2. Then, in Section 3, the architecture of LSTM-NN is designed and the RMSE is taken as the loss function; after that, the LSTM-NN is trained by the WOA. In Section 4, after the equipment of energy consumption experiment for the 3-RRR PPM is introduced, two different DMs of a moving platform under the same path and movement time are chosen to compare total energy consumption of the 3-RRR PPM under circumstance of simulation, prediction, and experiment, respectively. Finally, the conclusion is provided in Section 5.


## 2. Dynamics and Energy Consumption of 3-RRR PPM

### 2.1. Inverse Kinematic Modeling

A 3-RRR PPM, as depicted in Figure1, is composed of a base, active bars, passive bars, and a moving platform. The base and the moving platform are two triangles with the vertices Ai and Ci, respectively, and the active bars AiBi are linked to the base at point Ai through hinges. Furthermore, one end of each passive bar BiCi is linked to the active bar at point Bi through hinges, and the other end is linked to the moving platform at point Ci through hinges. In this paper, i = 1, 2, and 3.Figure 1
Details of kinematic parameters for 3-RRR PPM.Taking the intersection pointo of the three medians of the triangle A1A2A3 as the origin of the coordinates, a global coordinate system oxy is established such that the x-axis is parallel to A2A3. Taking the intersection point G7 of the three medians of the triangle C1C2C3 as the origin, the local coordinate system G7x′y′, which is fixed to the moving platform C1C2C3, is established such that the x′-axis is parallel to C2C3. θ denotes the rotation angle of the x-axis relative to the x′-axis (anticlockwise is defined as the positive direction). a, b, and c denote the lengths of the three sides A1A2, A2A3, and A3A1 of triangle A1A2A3. Likewise, the lengths of the three sides C1C2, C2C3, and C3C1 of triangle C1C2C3 were denoted as d, e, and f, respectively.In Figure2, the mass distribution of each bar is assumed to be homogenous, and the centers of mass are Gi and Gi+3. The moving platform’s center of mass is G7. G7 (x, y) denotes the coordinates of point G7 in the global coordinate system. It is supposed that the moving platform’s position point G7 moves with time t ∈ [t0, tn] in workspace of the 3-RRR PPM, expressed as follows:(1)x=f1t,y=f2t,t∈t0,tn.Figure 2
Schematic representation of dynamic modeling of 3-RRR PPM.The acceleration of the centroid point of the moving platform is then expressed as follows:(2)aG7=aG7xaG7y=x¨y¨,and the moving platform’s angular acceleration is as follows:(3)αG7=θ¨.In the global coordinate systemoxy, the coordinates of points Ai and Ci are (xAi, yAi) and (xCi, yCi), respectively. The local coordinates of points CαG7=θ¨i in the local coordinate system G7x′y′ are (xCi′, yCi′). The transformation formulas of the moving and static coordinates of the spatial mechanism for the points Ci in the global coordinate system are as follows:(4)oCi=xCiyCi=xy+cosθ−sinθsinθcosθxCi′yCi′.The lengths of barsAiBi are li, and the lengths of bars BiCi are l4, l5, and l6. Furthermore, the rotation angles of the active bars AiBi relative to the positive x-axis are θi. Therefore, point Bi’s coordinates (xBi, yBi) in the global coordinate system can be calculated as follows:(5)oBi=xBiyBi=xAi+licosθiyAi+lisinθi,The coordinates of the centroid pointGi are(6)oGi=xGixxGiy=12xAi+xBiyAi+yBi.The centroid pointGi’s acceleration is(7)aGi=aGixaGiy=x¨Giy¨Gi.The coordinates of centroid pointGi+3 are(8)oGi+3=xGi+3xxGi+3y=12xCi+xBiyCi+yBi.The centroid pointGi+3’s acceleration is(9)aGi+3=aGi+3xaGi+3y=x¨Gi+3y¨Gi+3.Based on vector algebra, the following equation can be obtained by the connection relation of the 3-RRR PPM’s bars:(10)BiCi=oG7+G7Ci−oAi+AiBi=oCi−oBi.Likewise,(11)BiCi⋅1,0=li+3cosθi+3.The angular velocities of the passive barsBiCi are(12)θi+3=arccosBiCi⋅1,0li+3.The angular accelerations of the passive barsBiCi are(13)αGi+3=θ¨i+3.Likewise,(14)BiCi⋅BiCi=li+32.The kinematic equation of the 3-RRR PPM can be achieved based on (14):(15)θi=2arctanNi±Ni2+Mi2−Ki2Mi+Ki,where(16)Mi=x+xci′cosθ−yci′sinθ−xAi,Ni=y+xci′sinθ+yci′cosθ−yAi,Ki=Mi2+Ni2+li2−li+322li.Meanwhile, the condition that (15) has real solutions is as follows:(17)Ni2+Mi2≥Ki2,Therefore, the angular velocities of the active barsAiBi are(18)ωi=θ˙i,and the angular acceleration of the active bars AiBi is(19)αi=θ¨i.


### 2.2. Condition of Singularity Avoidance

The following equation can be obtained by differentiating both ends of (14) [2]:(20)Φyx•⋅y•θ•=Φzθ1•⋅θ2•⋅θ3•⋅,where the diagonal matrix Φz is as follows:(21)Φz=l1M1sinθ1−N1cosθ1000l2M2sinθ2−N2cosθ2000l3M3sinθ3−N3cosθ3.The coefficient matrixΦy, which is also called a discriminant matrix of the singularity, is defined as follows:(22)Φy=l1cosθ1−M1l1sinθ1−N1l1sinθ1−N1M1+xA1−x−l1cosθ1−M1N1+yA1−yl2cosθ2−M2l2sinθ2−N2l2sinθ2−N2M2+xA2−x−l2cosθ2−M2N2+yA2−yl3cosθ3−M3l3sinθ3−N3l3sinθ3−N3M3+xA3−x−l3cosθ3−M3N3+yA3−y.If the determinant det (Φy) of matrix Φy is 0, it is called a II-type singularity [2]. This paper is only concerned with II-type singularities, and the conditions for which a singularity will not occur are defined as follows:(23)detΦy≠0.


### 2.3. Dynamics Modeling and Energy Consumption

#### 2.3.1. Inverse Dynamics Modeling of 3-RRR PPM

The combined external force acting on the moving platform can be always expressed as the principal vector through the center of mass and the main torque, denoted asFe and Me, respectively. τi denotes the driving moment on the active bar AiBi. The inverse dynamics problem can be described as follows. When the dimensional parameters of the 3-RRR PPM, the movement rule of the position and orientation of the moving platform with time, the principal vector Fe, and the main torque Me are known, the change of the driving torque τi with time can be derived.Based on the Newton–Euler method, the inverse dynamics modeling process of the 3-RRR PPM is described as follows. The internal forces acting on the pointsCi and Bi are decomposed into Fcix, Fciy, FBix, and FBiy along the x- and y-axes of the global coordinate system.As shown in Figure2, taking the moving platform C1C2C3, the passive bars BiCi, and the active bars AiBi as the research objects, the dynamics of the 3-RRR PPM based on the Newton–Euler method are modeled as follows.Equation (24) can be deduced for the moving platform C1C2C3:(24)∑i=13FCix+Fex=FG7x,∑i=13FCiy+Fey=FG7y,−FC1xy−yC1+FC2xy−yC2+FC3xy−yC3+FC1yx−xC1−FC2yx−xC2+FC3yx−xC3=MG7−Me.FG7 is the inertial force of the moving platform, defined as follows:(25)FG7=FG7xFG7y=−mG7aG7xaG7y,where [aG7x, aG7y]T is given by (2) and mG7 and MG7 are the mass and moment of inertia of the moving platform. MG7 is defined as follows:(26)MG7=−JG7αG7,where αG7 is given by (3) and JG7 is the rotational inertia of the moving platform relative to the center of mass:(27)JG7=mG72d3+e3+f3+3defd+e+f.In a similar way, (28) can be deduced for the passive bars BiCi:(28)FBix−FCix=FGi+3x,FBiy−FCiy=FGi+3y,−FBixyGi+3−yBi−FCixyGi+3−yCi−FBiyxGi+3−xBi−FCiyxGi+3−xCi=MGi+3.FG(i+3) represents the inertial forces of the passive bars BiCi:(29)FGi+3=−mGi+3aGi+3xaGi+3y,where [aG(i+3)x, aG(i+3)y]T is given by (9) and mG(i+3) and MG(i+3) are the masses and moments of inertia of the passive bars BiCi. MG(i+3) are defined as follows:(30)MGi+3=−JGi+3αGi+3,where αG(i+3) is given by (13) and JG(i+3) denotes the rotational inertia of the passive bars BiCi relative to their own centers of mass:(31)JGi+3=mGi+3li+3212.Finally, the following equation can be deduced for the active barsAiBi:(32)FBix+FGix=0,−FBiy+FGiy=0,FBixlisinθi−FBiylicosθi−2τi=−2MGi.FGi represents the inertial forces of the active bars AiBi:(33)FGi=−mGiaGixaGiy,where [aGix, aGiy]T is given by (7) and mGi and MGi are the masses and the moments of inertia of the active bars AiBi. MGi is defined as follows:(34)MGi=−JGiαi,where αi is given by (19) and JGidenotes the rotational inertia of the active bars AiBi relative to their own centers of mass:(35)JGi=mGili212.There are 15 unknown variables:Fcix, Fciy, FBix, FBiy, and τi and 21 equations including (24), (28), and (32). These are represented as follows:(36)x=x1x2...x15=FC1xFC2xFC3xFC1yFC2yFC3yFB1xFB2xFB3xFB1yFB2yFB3yτ1τ2τ3T.Finally, the 21 equations mentioned above can be transformed into a matrix equation:(37)Ax=B,where the matrices A and B are presented in Appendix. QR decomposition [41], which was performed in MATLAB using the function “mldivide” (matrix left division), can be used to solve for x ∈ ℝ15×1 in (37).


#### 2.3.2. Energy Consumption between Any Two Points in Workspace of 3-RRR PPM

There are infinite trajectory curves that correspond to (1) between any two points in the workspace of the 3-RRR PPM. The energy consumption in the time interval [t0, tn] from t0 to tn is calculated as follows:(38)Et=∫t0t∑i=13τiωidt,t∈t0,tn,in which ωi can be obtained by the inverse kinematic equation (see (15)) of the 3-RRR PPM and is given in detail in (18). Furthermore, τi can be obtained by solving (37).Therefore, the energy consumption for the 3-RRR PPM can be calculated by a numerical method. Different singularity-free paths, which satisfy (17) and (23), are selected in the workspace of 3-RRR PPM, assuming that each path corresponded to a running time t ∈ [t0, tn] of the moving platform and(39)tn−t0=T.The interval [t0, tn] is divided into n equal parts, with each time interval Δt = T/n. Different values of the n + 1 groups can be obtained from the solution of (37), and the program flowchart to calculate the energy consumption of the 3-RRR PPM is shown in Figure 3.Figure 3
Program flowchart to calculate the energy consumption of 3-RRR PPM.


## 2.1. Inverse Kinematic Modeling

A 3-RRR PPM, as depicted in Figure1, is composed of a base, active bars, passive bars, and a moving platform. The base and the moving platform are two triangles with the vertices Ai and Ci, respectively, and the active bars AiBi are linked to the base at point Ai through hinges. Furthermore, one end of each passive bar BiCi is linked to the active bar at point Bi through hinges, and the other end is linked to the moving platform at point Ci through hinges. In this paper, i = 1, 2, and 3.Figure 1
Details of kinematic parameters for 3-RRR PPM.Taking the intersection pointo of the three medians of the triangle A1A2A3 as the origin of the coordinates, a global coordinate system oxy is established such that the x-axis is parallel to A2A3. Taking the intersection point G7 of the three medians of the triangle C1C2C3 as the origin, the local coordinate system G7x′y′, which is fixed to the moving platform C1C2C3, is established such that the x′-axis is parallel to C2C3. θ denotes the rotation angle of the x-axis relative to the x′-axis (anticlockwise is defined as the positive direction). a, b, and c denote the lengths of the three sides A1A2, A2A3, and A3A1 of triangle A1A2A3. Likewise, the lengths of the three sides C1C2, C2C3, and C3C1 of triangle C1C2C3 were denoted as d, e, and f, respectively.In Figure2, the mass distribution of each bar is assumed to be homogenous, and the centers of mass are Gi and Gi+3. The moving platform’s center of mass is G7. G7 (x, y) denotes the coordinates of point G7 in the global coordinate system. It is supposed that the moving platform’s position point G7 moves with time t ∈ [t0, tn] in workspace of the 3-RRR PPM, expressed as follows:(1)x=f1t,y=f2t,t∈t0,tn.Figure 2
Schematic representation of dynamic modeling of 3-RRR PPM.The acceleration of the centroid point of the moving platform is then expressed as follows:(2)aG7=aG7xaG7y=x¨y¨,and the moving platform’s angular acceleration is as follows:(3)αG7=θ¨.In the global coordinate systemoxy, the coordinates of points Ai and Ci are (xAi, yAi) and (xCi, yCi), respectively. The local coordinates of points CαG7=θ¨i in the local coordinate system G7x′y′ are (xCi′, yCi′). The transformation formulas of the moving and static coordinates of the spatial mechanism for the points Ci in the global coordinate system are as follows:(4)oCi=xCiyCi=xy+cosθ−sinθsinθcosθxCi′yCi′.The lengths of barsAiBi are li, and the lengths of bars BiCi are l4, l5, and l6. Furthermore, the rotation angles of the active bars AiBi relative to the positive x-axis are θi. Therefore, point Bi’s coordinates (xBi, yBi) in the global coordinate system can be calculated as follows:(5)oBi=xBiyBi=xAi+licosθiyAi+lisinθi,The coordinates of the centroid pointGi are(6)oGi=xGixxGiy=12xAi+xBiyAi+yBi.The centroid pointGi’s acceleration is(7)aGi=aGixaGiy=x¨Giy¨Gi.The coordinates of centroid pointGi+3 are(8)oGi+3=xGi+3xxGi+3y=12xCi+xBiyCi+yBi.The centroid pointGi+3’s acceleration is(9)aGi+3=aGi+3xaGi+3y=x¨Gi+3y¨Gi+3.Based on vector algebra, the following equation can be obtained by the connection relation of the 3-RRR PPM’s bars:(10)BiCi=oG7+G7Ci−oAi+AiBi=oCi−oBi.Likewise,(11)BiCi⋅1,0=li+3cosθi+3.The angular velocities of the passive barsBiCi are(12)θi+3=arccosBiCi⋅1,0li+3.The angular accelerations of the passive barsBiCi are(13)αGi+3=θ¨i+3.Likewise,(14)BiCi⋅BiCi=li+32.The kinematic equation of the 3-RRR PPM can be achieved based on (14):(15)θi=2arctanNi±Ni2+Mi2−Ki2Mi+Ki,where(16)Mi=x+xci′cosθ−yci′sinθ−xAi,Ni=y+xci′sinθ+yci′cosθ−yAi,Ki=Mi2+Ni2+li2−li+322li.Meanwhile, the condition that (15) has real solutions is as follows:(17)Ni2+Mi2≥Ki2,Therefore, the angular velocities of the active barsAiBi are(18)ωi=θ˙i,and the angular acceleration of the active bars AiBi is(19)αi=θ¨i.


## 2.2. Condition of Singularity Avoidance

The following equation can be obtained by differentiating both ends of (14) [2]:(20)Φyx•⋅y•θ•=Φzθ1•⋅θ2•⋅θ3•⋅,where the diagonal matrix Φz is as follows:(21)Φz=l1M1sinθ1−N1cosθ1000l2M2sinθ2−N2cosθ2000l3M3sinθ3−N3cosθ3.The coefficient matrixΦy, which is also called a discriminant matrix of the singularity, is defined as follows:(22)Φy=l1cosθ1−M1l1sinθ1−N1l1sinθ1−N1M1+xA1−x−l1cosθ1−M1N1+yA1−yl2cosθ2−M2l2sinθ2−N2l2sinθ2−N2M2+xA2−x−l2cosθ2−M2N2+yA2−yl3cosθ3−M3l3sinθ3−N3l3sinθ3−N3M3+xA3−x−l3cosθ3−M3N3+yA3−y.If the determinant det (Φy) of matrix Φy is 0, it is called a II-type singularity [2]. This paper is only concerned with II-type singularities, and the conditions for which a singularity will not occur are defined as follows:(23)detΦy≠0.


## 2.3. Dynamics Modeling and Energy Consumption

### 2.3.1. Inverse Dynamics Modeling of 3-RRR PPM

The combined external force acting on the moving platform can be always expressed as the principal vector through the center of mass and the main torque, denoted asFe and Me, respectively. τi denotes the driving moment on the active bar AiBi. The inverse dynamics problem can be described as follows. When the dimensional parameters of the 3-RRR PPM, the movement rule of the position and orientation of the moving platform with time, the principal vector Fe, and the main torque Me are known, the change of the driving torque τi with time can be derived.Based on the Newton–Euler method, the inverse dynamics modeling process of the 3-RRR PPM is described as follows. The internal forces acting on the pointsCi and Bi are decomposed into Fcix, Fciy, FBix, and FBiy along the x- and y-axes of the global coordinate system.As shown in Figure2, taking the moving platform C1C2C3, the passive bars BiCi, and the active bars AiBi as the research objects, the dynamics of the 3-RRR PPM based on the Newton–Euler method are modeled as follows.Equation (24) can be deduced for the moving platform C1C2C3:(24)∑i=13FCix+Fex=FG7x,∑i=13FCiy+Fey=FG7y,−FC1xy−yC1+FC2xy−yC2+FC3xy−yC3+FC1yx−xC1−FC2yx−xC2+FC3yx−xC3=MG7−Me.FG7 is the inertial force of the moving platform, defined as follows:(25)FG7=FG7xFG7y=−mG7aG7xaG7y,where [aG7x, aG7y]T is given by (2) and mG7 and MG7 are the mass and moment of inertia of the moving platform. MG7 is defined as follows:(26)MG7=−JG7αG7,where αG7 is given by (3) and JG7 is the rotational inertia of the moving platform relative to the center of mass:(27)JG7=mG72d3+e3+f3+3defd+e+f.In a similar way, (28) can be deduced for the passive bars BiCi:(28)FBix−FCix=FGi+3x,FBiy−FCiy=FGi+3y,−FBixyGi+3−yBi−FCixyGi+3−yCi−FBiyxGi+3−xBi−FCiyxGi+3−xCi=MGi+3.FG(i+3) represents the inertial forces of the passive bars BiCi:(29)FGi+3=−mGi+3aGi+3xaGi+3y,where [aG(i+3)x, aG(i+3)y]T is given by (9) and mG(i+3) and MG(i+3) are the masses and moments of inertia of the passive bars BiCi. MG(i+3) are defined as follows:(30)MGi+3=−JGi+3αGi+3,where αG(i+3) is given by (13) and JG(i+3) denotes the rotational inertia of the passive bars BiCi relative to their own centers of mass:(31)JGi+3=mGi+3li+3212.Finally, the following equation can be deduced for the active barsAiBi:(32)FBix+FGix=0,−FBiy+FGiy=0,FBixlisinθi−FBiylicosθi−2τi=−2MGi.FGi represents the inertial forces of the active bars AiBi:(33)FGi=−mGiaGixaGiy,where [aGix, aGiy]T is given by (7) and mGi and MGi are the masses and the moments of inertia of the active bars AiBi. MGi is defined as follows:(34)MGi=−JGiαi,where αi is given by (19) and JGidenotes the rotational inertia of the active bars AiBi relative to their own centers of mass:(35)JGi=mGili212.There are 15 unknown variables:Fcix, Fciy, FBix, FBiy, and τi and 21 equations including (24), (28), and (32). These are represented as follows:(36)x=x1x2...x15=FC1xFC2xFC3xFC1yFC2yFC3yFB1xFB2xFB3xFB1yFB2yFB3yτ1τ2τ3T.Finally, the 21 equations mentioned above can be transformed into a matrix equation:(37)Ax=B,where the matrices A and B are presented in Appendix. QR decomposition [41], which was performed in MATLAB using the function “mldivide” (matrix left division), can be used to solve for x ∈ ℝ15×1 in (37).


### 2.3.2. Energy Consumption between Any Two Points in Workspace of 3-RRR PPM

There are infinite trajectory curves that correspond to (1) between any two points in the workspace of the 3-RRR PPM. The energy consumption in the time interval [t0, tn] from t0 to tn is calculated as follows:(38)Et=∫t0t∑i=13τiωidt,t∈t0,tn,in which ωi can be obtained by the inverse kinematic equation (see (15)) of the 3-RRR PPM and is given in detail in (18). Furthermore, τi can be obtained by solving (37).Therefore, the energy consumption for the 3-RRR PPM can be calculated by a numerical method. Different singularity-free paths, which satisfy (17) and (23), are selected in the workspace of 3-RRR PPM, assuming that each path corresponded to a running time t ∈ [t0, tn] of the moving platform and(39)tn−t0=T.The interval [t0, tn] is divided into n equal parts, with each time interval Δt = T/n. Different values of the n + 1 groups can be obtained from the solution of (37), and the program flowchart to calculate the energy consumption of the 3-RRR PPM is shown in Figure 3.Figure 3
Program flowchart to calculate the energy consumption of 3-RRR PPM.


## 2.3.1. Inverse Dynamics Modeling of 3-RRR PPM

The combined external force acting on the moving platform can be always expressed as the principal vector through the center of mass and the main torque, denoted asFe and Me, respectively. τi denotes the driving moment on the active bar AiBi. The inverse dynamics problem can be described as follows. When the dimensional parameters of the 3-RRR PPM, the movement rule of the position and orientation of the moving platform with time, the principal vector Fe, and the main torque Me are known, the change of the driving torque τi with time can be derived.Based on the Newton–Euler method, the inverse dynamics modeling process of the 3-RRR PPM is described as follows. The internal forces acting on the pointsCi and Bi are decomposed into Fcix, Fciy, FBix, and FBiy along the x- and y-axes of the global coordinate system.As shown in Figure2, taking the moving platform C1C2C3, the passive bars BiCi, and the active bars AiBi as the research objects, the dynamics of the 3-RRR PPM based on the Newton–Euler method are modeled as follows.Equation (24) can be deduced for the moving platform C1C2C3:(24)∑i=13FCix+Fex=FG7x,∑i=13FCiy+Fey=FG7y,−FC1xy−yC1+FC2xy−yC2+FC3xy−yC3+FC1yx−xC1−FC2yx−xC2+FC3yx−xC3=MG7−Me.FG7 is the inertial force of the moving platform, defined as follows:(25)FG7=FG7xFG7y=−mG7aG7xaG7y,where [aG7x, aG7y]T is given by (2) and mG7 and MG7 are the mass and moment of inertia of the moving platform. MG7 is defined as follows:(26)MG7=−JG7αG7,where αG7 is given by (3) and JG7 is the rotational inertia of the moving platform relative to the center of mass:(27)JG7=mG72d3+e3+f3+3defd+e+f.In a similar way, (28) can be deduced for the passive bars BiCi:(28)FBix−FCix=FGi+3x,FBiy−FCiy=FGi+3y,−FBixyGi+3−yBi−FCixyGi+3−yCi−FBiyxGi+3−xBi−FCiyxGi+3−xCi=MGi+3.FG(i+3) represents the inertial forces of the passive bars BiCi:(29)FGi+3=−mGi+3aGi+3xaGi+3y,where [aG(i+3)x, aG(i+3)y]T is given by (9) and mG(i+3) and MG(i+3) are the masses and moments of inertia of the passive bars BiCi. MG(i+3) are defined as follows:(30)MGi+3=−JGi+3αGi+3,where αG(i+3) is given by (13) and JG(i+3) denotes the rotational inertia of the passive bars BiCi relative to their own centers of mass:(31)JGi+3=mGi+3li+3212.Finally, the following equation can be deduced for the active barsAiBi:(32)FBix+FGix=0,−FBiy+FGiy=0,FBixlisinθi−FBiylicosθi−2τi=−2MGi.FGi represents the inertial forces of the active bars AiBi:(33)FGi=−mGiaGixaGiy,where [aGix, aGiy]T is given by (7) and mGi and MGi are the masses and the moments of inertia of the active bars AiBi. MGi is defined as follows:(34)MGi=−JGiαi,where αi is given by (19) and JGidenotes the rotational inertia of the active bars AiBi relative to their own centers of mass:(35)JGi=mGili212.There are 15 unknown variables:Fcix, Fciy, FBix, FBiy, and τi and 21 equations including (24), (28), and (32). These are represented as follows:(36)x=x1x2...x15=FC1xFC2xFC3xFC1yFC2yFC3yFB1xFB2xFB3xFB1yFB2yFB3yτ1τ2τ3T.Finally, the 21 equations mentioned above can be transformed into a matrix equation:(37)Ax=B,where the matrices A and B are presented in Appendix. QR decomposition [41], which was performed in MATLAB using the function “mldivide” (matrix left division), can be used to solve for x ∈ ℝ15×1 in (37).


## 2.3.2. Energy Consumption between Any Two Points in Workspace of 3-RRR PPM

There are infinite trajectory curves that correspond to (1) between any two points in the workspace of the 3-RRR PPM. The energy consumption in the time interval [t0, tn] from t0 to tn is calculated as follows:(38)Et=∫t0t∑i=13τiωidt,t∈t0,tn,in which ωi can be obtained by the inverse kinematic equation (see (15)) of the 3-RRR PPM and is given in detail in (18). Furthermore, τi can be obtained by solving (37).Therefore, the energy consumption for the 3-RRR PPM can be calculated by a numerical method. Different singularity-free paths, which satisfy (17) and (23), are selected in the workspace of 3-RRR PPM, assuming that each path corresponded to a running time t ∈ [t0, tn] of the moving platform and(39)tn−t0=T.The interval [t0, tn] is divided into n equal parts, with each time interval Δt = T/n. Different values of the n + 1 groups can be obtained from the solution of (37), and the program flowchart to calculate the energy consumption of the 3-RRR PPM is shown in Figure 3.Figure 3
Program flowchart to calculate the energy consumption of 3-RRR PPM.


## 3. LSTM-NN Applied to Energy Consumption Prediction of 3-RRR PPM

### 3.1. Architecture of LSTM-NN and Acquisition of Training Data

For a running timet ∈ [t0, tn] of the moving platform, n + 1 time steps (j−1) Δt (j = 1, 2, …, n + 1) are marked as t(j−1). The input vector xtk of the LSTM-NN includes nine components, that is, the position (x, y) corresponding to (1), the orientation angle θ of the moving platform, the external forces (Fex, Fey), and the torque Me corresponding to (24) on the moving platform.The dimensionality of the input data of the network was 6. The corresponding input components were also divided inton + 1 groups of data, expressed by a right superscript (k), that is, input vector xtk ∈ ℝ6, at time step tk (k = 1, 2, …, n−1):(40)xtk=xk,yk,θk,FG7xk,FG7yk,MekT.The output vectorhtk of the LSTM-NN included six components, that is, the angular velocity ωi (i = 1, 2, 3) and the driving torque τi (i = 1, 2, 3) of the three active bars. The corresponding output components are also divided into n + 1 groups of data, expressed by a right superscript (k), that is, output vector htk ∈ ℝ6, at time step tk (k = 1, 2, …, n−1):(41)htk=ω1k,ω2k,ω3k,τ1k,τ2k,τ3kT.The corresponding input and output are recorded asxt(j−1) ∈ ℝ6 and ht(j−1) ∈ ℝ6 (j = 1, 2, …, n + 1), respectively. By combining the characteristics of the 3-RRR PPM energy consumption prediction problem and the basic principle of the LSTM-NN [27, 30–36], the network architecture corresponding to xt(k−1), xtk, xt(k+1) and ht(k−1), htk, ht(k+1) (k = 1, 2, …, n −1) is shown in Figure 4.Figure 4
Architecture of the LSTM-NN.ht(k−1), htk, and ht(k+1) correspond to the output of the hidden layer at time steps t(k−1), tk, and t(k+1) (k = 1, 2, …, n−1), respectively. Furthermore, Ct(k−1), Ctk, and Ct(k+1) correspond to the cell state at time steps t(k−1), tk, and t(k+1) (k = 1, 2, …, n−1), respectively, and htk and Ctk are defined as follows [27, 30, 36]:(42)ftk=σWf⋅htk−1,xtk+bf,(43)itk=σWi⋅htk−1,xtk+bi,(44)C˜tk=tanhWC⋅htk−1,xtk+bC,(45)Ctk=ftk∗Ctk−1+itk∗C˜tk,(46)otk=σWo⋅htk−1,xtk+bo,(47)htk=otk∗tanhCtk,where ∗ is the elementwise multiplication between two vectors and [ht(k−1), xtk] ∈ ℝ6+6 is the concatenation of vectors ht(k−1) and xtk:(48)htk−1,xtk=htk−1xtk.ftk, itk, and otk are the outputs of the forget gate, input gate, and output gate at timestep tk (k = 1, 2, …, n−1); Wf ∈ ℝ6 × (6+6), Wi ∈ ℝ6 × (6+6), WC ∈ ℝ6 × (6+6), and WO ∈ ℝ6 × (6+6) are the corresponding weight matrices; and bf ∈ ℝ6, bi ∈ ℝ6, bC ∈ ℝ6, and bO ∈ ℝ6 are the corresponding bias weights.σ (⋅) and tanh (⋅) are the elementwise sigmoid and tanh functions, respectively, defined as follows:(49)σz=11+e−z,(50)tanhz=ez−e−zez+e−z.


### 3.2. Loss Function and Training of LSTM-NN Based on WOA

The root-mean-square error between the predicted and target values is expressed by the loss functionelossw⟶, whose arguments are Wf ∈ ℝ6 ×(6+6), Wi ∈ ℝ6 × (6+6), WC ∈ ℝ6 × (6+6), WO ∈ ℝ6 × (6+6), bf ∈ ℝ6, bi ∈ ℝ6, bC ∈ ℝ6, and bO ∈ ℝ6. These arguments are expressed as a vector w⟶ with 312 elements:(51)w⟶=w1w2…w312,(52)elossw⟶=∑j=1n+1htj−1−h˜tj−12n+1,in which h˜tj−1 is the prediction vector calculated through the input value xt(j−1) (j = 1, 2, …, n + 1) based on (42)–(47), and ht(j−1) is the target vector.In 2016, the WOA was proposed [38], and it has since been widely used [39, 40]. The WOA was used to optimize (52), which is also called the fitness function. The WOA is a mathematical model of the whale hunting process based on three different strategies: encircling the prey, the bubble-net attacking method, and searching for prey, and the iterative algorithm can be classified into three strategies depending on the conditions [38–40].The first strategy is called encircling prey whenp<0.5 and A⟶< 1, in which p∈0,1 is a random number, and the corresponding iterative equations are as follows [38, 39]:(53)D⟶=C⟶⋅w∗⟶t−w⟶t,w⟶t+1=w∗⟶t−A⟶⋅D⟶,A⟶=2a⟶⋅r⟶−a,⟶C⟶=2⋅r.⟶Here, t is the current iteration, A⟶ and C⟶ are coefficient vectors, w⟶ is the position vector in (52), w∗⟶ is the best position vector detected so far, | | is the absolute value, is the elementwise multiplication, a⟶ is linearly decreased from 2 to 0 throughout the iterative process, and r⟶ is a vector whose values are randomly generated in [0, 1].The second strategy is called the bubble-net attacking method whenp>0.5, and the corresponding iterative equations are as follows [38, 40]:(54)w⟶t+1=w∗⟶t−w⟶t⋅ebl⋅cos2πl+w∗⟶t,in which b is a constant that defines a logarithmic spiral shape, and l ∈ [−1, 1] is a random number.The third strategy is called searching for prey whenp<0.5 and A⟶ ≥ 1, and the corresponding iterative equations are as follows [38]:(55)D⟶=C⟶⋅wrand⟶−w⟶t,w⟶t+1=wrand⟶−A⟶⋅D⟶,in which wrand⟶ is a random position vector chosen from the current population.The iterative termination condition is as follows due to the nonnegative loss function of (52):(56)t≥Imaxorelossw⟶≤5e−4,in which Imax is the maximum number of iterations.LettingImax = 150, b = 1, a program based on the flowchart in Figure 5 was run, and the minimum of the loss function elossw⟶ was 0.00041 when the number of iterations was 97.Figure 5
Program flowchart to train the LSTM-NN for the energy consumption prediction of a 3-RRR PPM.


## 3.1. Architecture of LSTM-NN and Acquisition of Training Data

For a running timet ∈ [t0, tn] of the moving platform, n + 1 time steps (j−1) Δt (j = 1, 2, …, n + 1) are marked as t(j−1). The input vector xtk of the LSTM-NN includes nine components, that is, the position (x, y) corresponding to (1), the orientation angle θ of the moving platform, the external forces (Fex, Fey), and the torque Me corresponding to (24) on the moving platform.The dimensionality of the input data of the network was 6. The corresponding input components were also divided inton + 1 groups of data, expressed by a right superscript (k), that is, input vector xtk ∈ ℝ6, at time step tk (k = 1, 2, …, n−1):(40)xtk=xk,yk,θk,FG7xk,FG7yk,MekT.The output vectorhtk of the LSTM-NN included six components, that is, the angular velocity ωi (i = 1, 2, 3) and the driving torque τi (i = 1, 2, 3) of the three active bars. The corresponding output components are also divided into n + 1 groups of data, expressed by a right superscript (k), that is, output vector htk ∈ ℝ6, at time step tk (k = 1, 2, …, n−1):(41)htk=ω1k,ω2k,ω3k,τ1k,τ2k,τ3kT.The corresponding input and output are recorded asxt(j−1) ∈ ℝ6 and ht(j−1) ∈ ℝ6 (j = 1, 2, …, n + 1), respectively. By combining the characteristics of the 3-RRR PPM energy consumption prediction problem and the basic principle of the LSTM-NN [27, 30–36], the network architecture corresponding to xt(k−1), xtk, xt(k+1) and ht(k−1), htk, ht(k+1) (k = 1, 2, …, n −1) is shown in Figure 4.Figure 4
Architecture of the LSTM-NN.ht(k−1), htk, and ht(k+1) correspond to the output of the hidden layer at time steps t(k−1), tk, and t(k+1) (k = 1, 2, …, n−1), respectively. Furthermore, Ct(k−1), Ctk, and Ct(k+1) correspond to the cell state at time steps t(k−1), tk, and t(k+1) (k = 1, 2, …, n−1), respectively, and htk and Ctk are defined as follows [27, 30, 36]:(42)ftk=σWf⋅htk−1,xtk+bf,(43)itk=σWi⋅htk−1,xtk+bi,(44)C˜tk=tanhWC⋅htk−1,xtk+bC,(45)Ctk=ftk∗Ctk−1+itk∗C˜tk,(46)otk=σWo⋅htk−1,xtk+bo,(47)htk=otk∗tanhCtk,where ∗ is the elementwise multiplication between two vectors and [ht(k−1), xtk] ∈ ℝ6+6 is the concatenation of vectors ht(k−1) and xtk:(48)htk−1,xtk=htk−1xtk.ftk, itk, and otk are the outputs of the forget gate, input gate, and output gate at timestep tk (k = 1, 2, …, n−1); Wf ∈ ℝ6 × (6+6), Wi ∈ ℝ6 × (6+6), WC ∈ ℝ6 × (6+6), and WO ∈ ℝ6 × (6+6) are the corresponding weight matrices; and bf ∈ ℝ6, bi ∈ ℝ6, bC ∈ ℝ6, and bO ∈ ℝ6 are the corresponding bias weights.σ (⋅) and tanh (⋅) are the elementwise sigmoid and tanh functions, respectively, defined as follows:(49)σz=11+e−z,(50)tanhz=ez−e−zez+e−z.


## 3.2. Loss Function and Training of LSTM-NN Based on WOA

The root-mean-square error between the predicted and target values is expressed by the loss functionelossw⟶, whose arguments are Wf ∈ ℝ6 ×(6+6), Wi ∈ ℝ6 × (6+6), WC ∈ ℝ6 × (6+6), WO ∈ ℝ6 × (6+6), bf ∈ ℝ6, bi ∈ ℝ6, bC ∈ ℝ6, and bO ∈ ℝ6. These arguments are expressed as a vector w⟶ with 312 elements:(51)w⟶=w1w2…w312,(52)elossw⟶=∑j=1n+1htj−1−h˜tj−12n+1,in which h˜tj−1 is the prediction vector calculated through the input value xt(j−1) (j = 1, 2, …, n + 1) based on (42)–(47), and ht(j−1) is the target vector.In 2016, the WOA was proposed [38], and it has since been widely used [39, 40]. The WOA was used to optimize (52), which is also called the fitness function. The WOA is a mathematical model of the whale hunting process based on three different strategies: encircling the prey, the bubble-net attacking method, and searching for prey, and the iterative algorithm can be classified into three strategies depending on the conditions [38–40].The first strategy is called encircling prey whenp<0.5 and A⟶< 1, in which p∈0,1 is a random number, and the corresponding iterative equations are as follows [38, 39]:(53)D⟶=C⟶⋅w∗⟶t−w⟶t,w⟶t+1=w∗⟶t−A⟶⋅D⟶,A⟶=2a⟶⋅r⟶−a,⟶C⟶=2⋅r.⟶Here, t is the current iteration, A⟶ and C⟶ are coefficient vectors, w⟶ is the position vector in (52), w∗⟶ is the best position vector detected so far, | | is the absolute value, is the elementwise multiplication, a⟶ is linearly decreased from 2 to 0 throughout the iterative process, and r⟶ is a vector whose values are randomly generated in [0, 1].The second strategy is called the bubble-net attacking method whenp>0.5, and the corresponding iterative equations are as follows [38, 40]:(54)w⟶t+1=w∗⟶t−w⟶t⋅ebl⋅cos2πl+w∗⟶t,in which b is a constant that defines a logarithmic spiral shape, and l ∈ [−1, 1] is a random number.The third strategy is called searching for prey whenp<0.5 and A⟶ ≥ 1, and the corresponding iterative equations are as follows [38]:(55)D⟶=C⟶⋅wrand⟶−w⟶t,w⟶t+1=wrand⟶−A⟶⋅D⟶,in which wrand⟶ is a random position vector chosen from the current population.The iterative termination condition is as follows due to the nonnegative loss function of (52):(56)t≥Imaxorelossw⟶≤5e−4,in which Imax is the maximum number of iterations.LettingImax = 150, b = 1, a program based on the flowchart in Figure 5 was run, and the minimum of the loss function elossw⟶ was 0.00041 when the number of iterations was 97.Figure 5
Program flowchart to train the LSTM-NN for the energy consumption prediction of a 3-RRR PPM.


## 4. Simulation, Prediction, and Experimental Verification

### 4.1. Experimental System to Test the Energy Consumption of 3-RRR PPM

As depicted in Figure6, the testing system based on the field bus technology mainly included a 3-RRR PPM, a servo control system, and a signal detection system. In the Windows operating system, the linkage of the three servo motors was achieved using Visual C++. The servo control system was mainly composed of a computer, central control unit (i.e., center control board–PCI bus, I/O board–local I/O board, and servo control board), three servo motor drivers, an encoder, and three servo motors. The RS-485 serial bus standard was adopted.Figure 6
Testing system of energy consumption for the 3-RRR PPM. (a) Equipment of energy consumption experiment. (b) Partial enlarged detail of the 3-RRR PPM.The servo motors and matched drivers were a TSC06401C2NL/TSTA20C type. Furthermore, the center control board and torque/speed sensor were PPCI-L112 and JN338-2VE types, respectively. To add an external force to the moving platform, the pointG8 with coordinates (q1, q2) was taken on the base, a spring with elastic coefficient K and free length l0 was connected between point G8 on the base and point G7 on the moving platform, and the main torque Me was equal to zero. According to Hooke’s law, the principal vector Fe through the center of mass of the moving platform can be expressed as follows (G7G8 > l0):(57)Fe=FexFey=Kq1−x2+q2−y2−l0q1−x2+q2−y2q1−xq2−y.


### 4.2. Examples and Discussion

#### 4.2.1. Example 1

The dimensional parameters of the 3-RRR PPM were assigned the following values:a = 0.0531 m, b = 0.0919 m, c = 0.1083 m, d = 0.0439 m, e = 0.0481 m, f = 0.0289 m, l1 = 0.0190 m, l2 = 0.0140 m, l3 = 0.0160 m, l4 = 0.0350 m, l5 = 0.0340 m, and l6 = 0.0540 m. The cross-sectional size of each bar was 0.015 × 0.005 m2, and the bar’s material was an aluminum alloy with a density of 2.7 × 103 kg/m3. The mass of each bar is as follows: mG1 = 0.00385 kg, mG2 = 0.00284 kg, mG3 = 0.00324 kg, mG4 = 0.00709 kg, mG5 = 0.00689 kg, mG6 = 0.01094 kg, and mG7 = 0.02454 kg. Furthermore, l0 = 0.015 m, K = 5, q1 = 0.070 m, and q2 = 0.070 m.The orientation angleθ of the moving platform was equal to −0.1047 rad, and the trajectory of the moving platform’s center was a semiellipse:(58)x=0.01cosωt,y=0.025+0.008sinωt,ω=π/T,t∈0,T.LettingT = 10 s, based on the relationship between the moving platform displacement and time t expressed in (58), the angular velocities and torques of the active bars and the energy consumption of the 3-RRR PPM were compared between the simulation, prediction, and experiment.The simulation curves, which are colored blue, were obtained using the program flowchart to calculate the energy consumption of the 3-RRR PPM described in Section2.3.2. The prediction curves, which are colored green, were obtained from the training and forecasting based on the LSTM-NN described in Section 3. Finally, the experimental data, which are colored red, were obtained as described in Section 4.1. At the beginning of the experiment, the initial angular displacements of the three active bars were 0.4896, 0.2212, and 0.4081 rad.The three active bars’ angular velocitiesωi and driving torques τi and the 3-RRR PPM’s energy consumption E(t) for t ∈ [0, 10] from the simulation, experiments, and predictions are shown in Figures 7, 8, and 9, respectively.Figure 7
Comparison of the simulated, experimental, and predicted data for the three active bars’ angular velocitiesωi.Figure 8
Comparison of the simulated, experimental, and predicted data for the three active bars’ driving torquesτi.Figure 9
Comparison of the simulated, experimental, and predicted data for the 3-RRR PPM’s energy consumption (E) (t) with t ∈ [0, 10].


#### 4.2.2. Example 2

According to the definition of the displacement model (DM) for the moving platform of the 3-RRR PPM in Section1, the DM of the moving platform corresponding to (58) is shown in Figure 10(a). For the same movement time and path, another DM of the moving platform is shown in Figure 10(b).Figure 10
Comparison of different DMs under the same path and movement time. (a) DM of the moving platform corresponding to (58). (b) DM of the moving platform corresponding to Example 2.
(a)(b)LettingT = 10 s, the semielliptical path of the moving platform’s center and the other conditions, such as the dimensional parameters of 3-RRR PPM, the cross-sectional size of each bar, the bar material, and the orientation angle of the moving platform, were the same as those in Example 1. Only x(t) and y(t) of the moving platform’s center changed with time t ∈ [0, T], as depicted in Figure 10(b).Similarly, in the beginning of the experiment, the initial angular displacements of three active bars were still 0.4896, 0.2212, and 0.4081 rad. The three active bars’ angular velocitiesωi and driving torques τi and the 3-RRR PPM’s energy consumption E(t) with t ∈ [0, 10] were considered under the moving platform’s DM, as depicted in Figure 10(b). The simulation, experiment, and prediction results were compared, and the corresponding graphs are shown in Figures 11, 12, and 13.Figure 11
Comparison of simulated, experimental, and predicted data for three active bars’ angular velocitiesωi for the DM shown in Figure 10(b).Figure 12
Comparison of the simulated, experimental, and predicted data for three active bars’ driving torquesτi for the DM shown in Figure 10(b).Figure 13
Comparison of the simulated, experimental, and predicted data for 3-RRR PPM’s energy consumption (E) t with (t) ∈ [0, 10] for the DM shown in Figure10(b).


#### 4.2.3. Discussion

By integrating the data shown in Figure9, the total energy consumption of the 3-RRR PPM from the simulation, experiment, and prediction was determined to be 7.6652 × 10−4, 8.1086 × 10−4, and 7.9228 × 10−4 J, respectively. The relative error between the predicted and simulated data was 3.36%, and that between the predicted and experimental data was 2.29%.Likewise, by integrating the data in Figure13 and using the moving platform’s DM depicted in Figure 10(b), for the same movement time and path, the total energy consumption for the simulation, experiment, and prediction of the 3-RRR PPM was determined to be 7.4845 × 10−4, 8.0186 × 10−4, and 7.8695 × 10−4 J, respectively. The relative error between the predicted and simulated data was 5.14%, and that between the predicted and experimental data was 1.86%.By comparing the DM of (58) with the DM of Figure 10(b), the total energy consumption of the latter was slightly lower. Therefore, when the motion time and path were the same, different DMs of the moving platform resulted in different energy consumption.


## 4.1. Experimental System to Test the Energy Consumption of 3-RRR PPM

As depicted in Figure6, the testing system based on the field bus technology mainly included a 3-RRR PPM, a servo control system, and a signal detection system. In the Windows operating system, the linkage of the three servo motors was achieved using Visual C++. The servo control system was mainly composed of a computer, central control unit (i.e., center control board–PCI bus, I/O board–local I/O board, and servo control board), three servo motor drivers, an encoder, and three servo motors. The RS-485 serial bus standard was adopted.Figure 6
Testing system of energy consumption for the 3-RRR PPM. (a) Equipment of energy consumption experiment. (b) Partial enlarged detail of the 3-RRR PPM.The servo motors and matched drivers were a TSC06401C2NL/TSTA20C type. Furthermore, the center control board and torque/speed sensor were PPCI-L112 and JN338-2VE types, respectively. To add an external force to the moving platform, the pointG8 with coordinates (q1, q2) was taken on the base, a spring with elastic coefficient K and free length l0 was connected between point G8 on the base and point G7 on the moving platform, and the main torque Me was equal to zero. According to Hooke’s law, the principal vector Fe through the center of mass of the moving platform can be expressed as follows (G7G8 > l0):(57)Fe=FexFey=Kq1−x2+q2−y2−l0q1−x2+q2−y2q1−xq2−y.


## 4.2. Examples and Discussion

### 4.2.1. Example 1

The dimensional parameters of the 3-RRR PPM were assigned the following values:a = 0.0531 m, b = 0.0919 m, c = 0.1083 m, d = 0.0439 m, e = 0.0481 m, f = 0.0289 m, l1 = 0.0190 m, l2 = 0.0140 m, l3 = 0.0160 m, l4 = 0.0350 m, l5 = 0.0340 m, and l6 = 0.0540 m. The cross-sectional size of each bar was 0.015 × 0.005 m2, and the bar’s material was an aluminum alloy with a density of 2.7 × 103 kg/m3. The mass of each bar is as follows: mG1 = 0.00385 kg, mG2 = 0.00284 kg, mG3 = 0.00324 kg, mG4 = 0.00709 kg, mG5 = 0.00689 kg, mG6 = 0.01094 kg, and mG7 = 0.02454 kg. Furthermore, l0 = 0.015 m, K = 5, q1 = 0.070 m, and q2 = 0.070 m.The orientation angleθ of the moving platform was equal to −0.1047 rad, and the trajectory of the moving platform’s center was a semiellipse:(58)x=0.01cosωt,y=0.025+0.008sinωt,ω=π/T,t∈0,T.LettingT = 10 s, based on the relationship between the moving platform displacement and time t expressed in (58), the angular velocities and torques of the active bars and the energy consumption of the 3-RRR PPM were compared between the simulation, prediction, and experiment.The simulation curves, which are colored blue, were obtained using the program flowchart to calculate the energy consumption of the 3-RRR PPM described in Section2.3.2. The prediction curves, which are colored green, were obtained from the training and forecasting based on the LSTM-NN described in Section 3. Finally, the experimental data, which are colored red, were obtained as described in Section 4.1. At the beginning of the experiment, the initial angular displacements of the three active bars were 0.4896, 0.2212, and 0.4081 rad.The three active bars’ angular velocitiesωi and driving torques τi and the 3-RRR PPM’s energy consumption E(t) for t ∈ [0, 10] from the simulation, experiments, and predictions are shown in Figures 7, 8, and 9, respectively.Figure 7
Comparison of the simulated, experimental, and predicted data for the three active bars’ angular velocitiesωi.Figure 8
Comparison of the simulated, experimental, and predicted data for the three active bars’ driving torquesτi.Figure 9
Comparison of the simulated, experimental, and predicted data for the 3-RRR PPM’s energy consumption (E) (t) with t ∈ [0, 10].


### 4.2.2. Example 2

According to the definition of the displacement model (DM) for the moving platform of the 3-RRR PPM in Section1, the DM of the moving platform corresponding to (58) is shown in Figure 10(a). For the same movement time and path, another DM of the moving platform is shown in Figure 10(b).Figure 10
Comparison of different DMs under the same path and movement time. (a) DM of the moving platform corresponding to (58). (b) DM of the moving platform corresponding to Example 2.
(a)(b)LettingT = 10 s, the semielliptical path of the moving platform’s center and the other conditions, such as the dimensional parameters of 3-RRR PPM, the cross-sectional size of each bar, the bar material, and the orientation angle of the moving platform, were the same as those in Example 1. Only x(t) and y(t) of the moving platform’s center changed with time t ∈ [0, T], as depicted in Figure 10(b).Similarly, in the beginning of the experiment, the initial angular displacements of three active bars were still 0.4896, 0.2212, and 0.4081 rad. The three active bars’ angular velocitiesωi and driving torques τi and the 3-RRR PPM’s energy consumption E(t) with t ∈ [0, 10] were considered under the moving platform’s DM, as depicted in Figure 10(b). The simulation, experiment, and prediction results were compared, and the corresponding graphs are shown in Figures 11, 12, and 13.Figure 11
Comparison of simulated, experimental, and predicted data for three active bars’ angular velocitiesωi for the DM shown in Figure 10(b).Figure 12
Comparison of the simulated, experimental, and predicted data for three active bars’ driving torquesτi for the DM shown in Figure 10(b).Figure 13
Comparison of the simulated, experimental, and predicted data for 3-RRR PPM’s energy consumption (E) t with (t) ∈ [0, 10] for the DM shown in Figure10(b).


### 4.2.3. Discussion

By integrating the data shown in Figure9, the total energy consumption of the 3-RRR PPM from the simulation, experiment, and prediction was determined to be 7.6652 × 10−4, 8.1086 × 10−4, and 7.9228 × 10−4 J, respectively. The relative error between the predicted and simulated data was 3.36%, and that between the predicted and experimental data was 2.29%.Likewise, by integrating the data in Figure13 and using the moving platform’s DM depicted in Figure 10(b), for the same movement time and path, the total energy consumption for the simulation, experiment, and prediction of the 3-RRR PPM was determined to be 7.4845 × 10−4, 8.0186 × 10−4, and 7.8695 × 10−4 J, respectively. The relative error between the predicted and simulated data was 5.14%, and that between the predicted and experimental data was 1.86%.By comparing the DM of (58) with the DM of Figure 10(b), the total energy consumption of the latter was slightly lower. Therefore, when the motion time and path were the same, different DMs of the moving platform resulted in different energy consumption.


## 4.2.1. Example 1

The dimensional parameters of the 3-RRR PPM were assigned the following values:a = 0.0531 m, b = 0.0919 m, c = 0.1083 m, d = 0.0439 m, e = 0.0481 m, f = 0.0289 m, l1 = 0.0190 m, l2 = 0.0140 m, l3 = 0.0160 m, l4 = 0.0350 m, l5 = 0.0340 m, and l6 = 0.0540 m. The cross-sectional size of each bar was 0.015 × 0.005 m2, and the bar’s material was an aluminum alloy with a density of 2.7 × 103 kg/m3. The mass of each bar is as follows: mG1 = 0.00385 kg, mG2 = 0.00284 kg, mG3 = 0.00324 kg, mG4 = 0.00709 kg, mG5 = 0.00689 kg, mG6 = 0.01094 kg, and mG7 = 0.02454 kg. Furthermore, l0 = 0.015 m, K = 5, q1 = 0.070 m, and q2 = 0.070 m.The orientation angleθ of the moving platform was equal to −0.1047 rad, and the trajectory of the moving platform’s center was a semiellipse:(58)x=0.01cosωt,y=0.025+0.008sinωt,ω=π/T,t∈0,T.LettingT = 10 s, based on the relationship between the moving platform displacement and time t expressed in (58), the angular velocities and torques of the active bars and the energy consumption of the 3-RRR PPM were compared between the simulation, prediction, and experiment.The simulation curves, which are colored blue, were obtained using the program flowchart to calculate the energy consumption of the 3-RRR PPM described in Section2.3.2. The prediction curves, which are colored green, were obtained from the training and forecasting based on the LSTM-NN described in Section 3. Finally, the experimental data, which are colored red, were obtained as described in Section 4.1. At the beginning of the experiment, the initial angular displacements of the three active bars were 0.4896, 0.2212, and 0.4081 rad.The three active bars’ angular velocitiesωi and driving torques τi and the 3-RRR PPM’s energy consumption E(t) for t ∈ [0, 10] from the simulation, experiments, and predictions are shown in Figures 7, 8, and 9, respectively.Figure 7
Comparison of the simulated, experimental, and predicted data for the three active bars’ angular velocitiesωi.Figure 8
Comparison of the simulated, experimental, and predicted data for the three active bars’ driving torquesτi.Figure 9
Comparison of the simulated, experimental, and predicted data for the 3-RRR PPM’s energy consumption (E) (t) with t ∈ [0, 10].


## 4.2.2. Example 2

According to the definition of the displacement model (DM) for the moving platform of the 3-RRR PPM in Section1, the DM of the moving platform corresponding to (58) is shown in Figure 10(a). For the same movement time and path, another DM of the moving platform is shown in Figure 10(b).Figure 10
Comparison of different DMs under the same path and movement time. (a) DM of the moving platform corresponding to (58). (b) DM of the moving platform corresponding to Example 2.
(a)(b)LettingT = 10 s, the semielliptical path of the moving platform’s center and the other conditions, such as the dimensional parameters of 3-RRR PPM, the cross-sectional size of each bar, the bar material, and the orientation angle of the moving platform, were the same as those in Example 1. Only x(t) and y(t) of the moving platform’s center changed with time t ∈ [0, T], as depicted in Figure 10(b).Similarly, in the beginning of the experiment, the initial angular displacements of three active bars were still 0.4896, 0.2212, and 0.4081 rad. The three active bars’ angular velocitiesωi and driving torques τi and the 3-RRR PPM’s energy consumption E(t) with t ∈ [0, 10] were considered under the moving platform’s DM, as depicted in Figure 10(b). The simulation, experiment, and prediction results were compared, and the corresponding graphs are shown in Figures 11, 12, and 13.Figure 11
Comparison of simulated, experimental, and predicted data for three active bars’ angular velocitiesωi for the DM shown in Figure 10(b).Figure 12
Comparison of the simulated, experimental, and predicted data for three active bars’ driving torquesτi for the DM shown in Figure 10(b).Figure 13
Comparison of the simulated, experimental, and predicted data for 3-RRR PPM’s energy consumption (E) t with (t) ∈ [0, 10] for the DM shown in Figure10(b).


## 4.2.3. Discussion

By integrating the data shown in Figure9, the total energy consumption of the 3-RRR PPM from the simulation, experiment, and prediction was determined to be 7.6652 × 10−4, 8.1086 × 10−4, and 7.9228 × 10−4 J, respectively. The relative error between the predicted and simulated data was 3.36%, and that between the predicted and experimental data was 2.29%.Likewise, by integrating the data in Figure13 and using the moving platform’s DM depicted in Figure 10(b), for the same movement time and path, the total energy consumption for the simulation, experiment, and prediction of the 3-RRR PPM was determined to be 7.4845 × 10−4, 8.0186 × 10−4, and 7.8695 × 10−4 J, respectively. The relative error between the predicted and simulated data was 5.14%, and that between the predicted and experimental data was 1.86%.By comparing the DM of (58) with the DM of Figure 10(b), the total energy consumption of the latter was slightly lower. Therefore, when the motion time and path were the same, different DMs of the moving platform resulted in different energy consumption.


## 5. Conclusions

In the research and development of a new type of robot, a prototype is developed until the industrial application of the new type robot is fully realized. The data derived using the theoretical modeling combined with numerical solutions of the theoretical model can also train a supervised learning network, because field data sources are scarce. The trained neural network can be applied to the online intelligent control of a new type of robot.Combining an LSTM-NN with the WOA can help to avoid the inherent weaknesses of gradient disappearance or gradient explosion in other supervised networks, such as BPNN and RNN, when solving time-varying prediction problems. In addition, this approach can also replace theoretical complex dynamics models. In this paper, the RMSE of the trained LSTM-NN was 0.00041, and the relative error between predicted and experimental data was less than 2.50%. The results showed that the energy consumption prediction based on the LSTM-NN can meet the requirements of engineering applications. For the same movement time and path, different DMs of the moving platform resulted in different VMs and energy consumption.



---

*Source: 6590397-2020-05-26.xml*