Manipulator Trajectory Control Combined with Moving Average Filtering Algorithm

To solve the problem of abnormal angular velocity and angular acceleration in manipulator trajectory motion controlled by quintic spline interpolation algorithm, a manipulator trajectory control algorithm combined with moving average filtering algorithm was proposed. Based on the quintic spline interpolation algorithm, the moving average filtering algorithm was used to clean the abnormal data under the quintic spline interpolation. And the recursive forward dynamics model based on joint space motion was used to design the trajectory motion control of the manipulator. The simulation results show that the manipulator trajectory control algorithm combined with the moving average filtering algorithm has strong constraint ability of diagonal velocity and angular acceleration, and 67% of the maximum velocity and maximum acceleration of the joint axis of the designed manipulator trajectory are significantly reduced, and the curve is smoother.


Introduction
In the environment of rapid development of intelligence, robotic arms have been developed to a considerable extent in various fields [1][2][3]  smoothly over [4.5]. Segmented linear interpolation has good stability and curve convergence, but the smoothness of the curve cannot be guaranteed; Bessel curve [6] does not satisfy the second-order derivative continuity and the interpolation curve does not pass through the path point; B spline interpolation [7] has an interpolation curve that satisfies the second-order derivative continuity but also does not pass through the path point; polynomial interpolation [8] requires certain constraints to be configured in each segment interval, and when the number of nodes is too The calculation is more complicated when the number of nodes is too large, where the acceleration mutation phenomenon exists in the three-sample interpolation, and the five-sample interpolation curve is smooth and does not have the mutation value, but there is still deviation.
In [9], Zhang Liangan et al improved the flexibility and stability of the robotic arm, however, the automation and accuracy of the robotic arm was low, and the footprint was large. Liu Bao and Di Xin [8] reduced the residual vibration of the joint axis using cubic spline trajectory planning, but the pulsation was discontinuous. Li J [10] utilized a spline function and an improved genetic algorithm to solve the problem of generating singular structure points in motion ， as well as improved the local optimum problem, but the reliability of the results was poor. A new adaptive control method for a multi-joint flexible robotic arm was proposed by Rahmani B et al. in [11], which solved the trajectory tracking problem by using stable inverse control of the robotic arm dynamics.
Van Pham C et al. focused on the problem of tracking control manipulator with radial basis function neural network periodic motion and predetermined trajectory of the control dual linkage at joint position, and proposed a robust adaptive control method based on radial basis function neural network in [12]. Generally, some defects exist in the approaches mentioned above, such as the non-smooth motion of the robotic arm, incoherent acceleration trajectories and discontinuous pulses. Therefore, this paper proposes a robotic arm trajectory control algorithm combined with sliding average filtering algorithm, which is used to effectively reduce the joint angular acceleration jumps and achieve smoother angular velocity and angular acceleration curves.
The two adjacent points are then treated as the start and end points of a trajectory, which satisfies equation (2). 12 20 Equation (3) can be obtained by taking equation (2) into equation (1), which gives the trajectory of the robot arm under the five spline interpolation algorithm. 2

Improved five spline interpolation algorithm
The sliding average filtering algorithm has a strong adaptive capability and excellent suppression of anomalous data. It can obtain the arithmetic average of a set of windowed data, namely the filtered data set, by sliding the window back and forth along the time series.
Set the width of the sliding window to N, if 3 Improved robot arm trajectory control algorithm

Joint space motion
The six-degree-of-freedom robot arm is used as an objective, and a motion model for a fixed robot arm is established in the coordinate system Set the space vector as n R   , the end joint node vector as n b r R  , and the two vectors satisfy: where   f  denotes a differentiable non-linear function.
By transforming the three-dimensional coordinates into two-dimensional coordinates, the position of the end-effector is assumed to be   , e e X Y , the joint space is assumed to be   1 2 ,   , and the length of each section of the linkage is assumed to be 1, the position mapping relationship from the joint space to the operation space can be obtained, which is shown in equation (6).
The structure and parameters of the fixed robotic arm are known, and the D-H parameters of the six degree of freedom robotic arm are shown in Table 1.

Improvement of joint space motion of robotic arm
The joint axes are biased during the motion of the robot arm and the angles, angular velocity and angular acceleration [14] datasets are generated. Then, the datasets of angle, angular velocity and angular acceleration are cleaned using the sliding average filtering algorithm described above.
Assuming the angle and angular velocitie of the robotic arm joints is      ， . The joint moment  is calculated from the joint acceleration   , which can also be used to address the joint acceleration for the next stage of motion by forward dynamics [15][16][17].
The algorithm for calculating the forward dynamics of the system consists of three processes: forward recursion, reverse recursion, and again forward recursion. These processes traverse all connecting rods in turn according to the principle of depth-first, reverse depth-first, and the depth-first [18]. Equations Where denotes the i-th joint, denotes the i-th

4.1.Sliding average filtering amplitude and frequency response simulation and analysis
Assuming that the input signal is a continuous function, Where   f x and   y t is the input and output respectively, and 0 T is the length of sliding filter.
For the sliding average filter amplitude-frequency response, assuming the filter period is 0 T , and the input signal is Taking equations (12) and (13) into equation (11) and calculating the amplitude of the input signal as The response of the sliding average filtered amplitude and frequency is shown in Figure 1.

4.3.Simulation results and analysis of joint space motion of robot arm before and after improvement
According to the simulation and analysis of the five times spline interpolation algorithm before and after the above improvement, it can be seen that the advantages of the five times spline interpolation algorithm combined with the sliding average filtering algorithm to clean the data are now applied to the joint space motion of the robot arm, and the simulation results of the joint space motion before and after the improvement are shown in Figure 3.     According to the data in Table 3, it can be seen that the angular acceleration also has a slight increase in the minimum value and a general decrease in the maximum value, with an increase of 48.5% in the minimum value and a decrease of 62.4% in the maximum value.