# Manipulator Smooth Control Method Based on LSTM-XGboost and Its Optimization Model Construction
## 4 The Stability Prediction Model of Manipulator Based on LSTM-XGboost
### Based on LSTM-XGboost Prediction Model Construction  
The most common solution to the optimal trajectory planning problem of the manipulator is to discretize the trajectory into a finite number of path points. At each path point, according to the motion state of the manipulator, the optimization variable is taken as a positive maximum or a negative maximum within the allowable range, which is the so-called optimal control theory. The optimal control theory is shown in the time-optimal trajectory planning problem of the manipulator. Under the kinematic and dynamic constraints, the maximum acceleration or maximum deceleration is selected at each path point to maximize the speed, thereby optimizing the running time of the trajectory. The running stability is manifested as the acceleration constraint in the time-optimal trajectory planning problem of the manipulator. By limiting the change rate of acceleration, the trajectory can run smoothly. The acceleration constraint usually appears in the form of a third-order Lagrange dynamic equation, but the equation is nonlinear and difficult to deal with in the optimization process, so the acceleration constraint is usually ignored in the time-optimal trajectory planning of a manipulator. However, ignoring the jerk constraint will make the acceleration mutation problem easy to occur in the planned trajectory, aggravate the vibration of the end of the manipulator, and even cause the trajectory to be unable to execute on the manipulator. Therefore, it is of great significance to properly solve the nonlinear acceleration constraint for the time-optimal trajectory planning problem of the manipulator with running stability constraint. In actual control, the dynamic model and the joint friction of the manipulator are often not accurately obtained, which poses a challenge to the trajectory tracking control accuracy of the manipulator. The high-speed smooth-motion trajectory planning of a multi-axis serial manipulator based on optimal control theory is used to calculate the maximum acceleration or maximum deceleration under acceleration and other constraints, so as to maximize the speed. However, the speed of a high-speed smooth trajectory does not always increase or decrease, but rather frequently changes between acceleration and deceleration. Therefore, in order to calculate the maximum velocity curve under acceleration and other constraints, it is very important to find the conversion point between the maximum acceleration and the maximum deceleration of the high-speed smooth motion trajectory. Before finding the conversion point between the maximum acceleration and the maximum deceleration, it is necessary to determine the feasible velocity curve corresponding to the given path. In order  
Figure 2: LSTM Method. The model comprises the input, which is a sequence of datapoints, the LSTM cell and connections. The LSTM cell is the main component of the model and has sub-components, including cell state (c\({}_{\rm t}\)), which represents the memory of the LSTM cell and stores and propagates information across different time steps; the hidden state (h\({}_{\rm t}\)), which is the output of the LSTM cell at each time step and is a summary representation of the input sequence; forget gate (f\({}_{\rm t}\)), which determines which information should be removed from the cell state; the input gate determines the information to be stored in the cell state; the output gate controls the amount of information to be passed to the next hidden state and final output. The LSTM cells are connected in a chain-like structure, whereby the output of one cell is the input of the next cell. to make the starting point speed and the end point speed of the feasible speed curve equal to the preset starting point speed and the end point speed of the given path, the maximum speed curve needs to be calculated forward and backward, respectively. In the calculation of the forward maximum speed curve, the XGboost algorithm is used to construct the 'instruction-feature index' prediction model.