# A Risk-Sensitive Intelligent Control Algorithm for Servo Motor Based on Value Distribution
## 5 Experiment and Analysis
### Comparison Experiment for Control Performance  
To fairly compare the control performance, all comparison algorithms have to use the same control target in each control task. The total length of each test was 10,000 time steps, and each control algorithm repeated the process under 10 identical random seeds. When testing, we calculated the mean absolute error (MAE), and used it to measure the control accuracy.  
In this work, the random seed is set to 0, and the control performances of each algorithm on the six tasks are shown in Figure 10, where the vertical coordinate represents the actual value of speed or torque, and the horizontal coordinate represents time steps. The blue lines represent the reference control targets, while other lines represent the control results of different algorithms, respectively. The smaller the gap, the stronger the ability of the algorithm to control the motor operating with the set target; on the other hand, the larger the gap, the weaker this ability. By measuring the gap between the actual running state and the target, we can roughly see the difference in the control effect among various algorithms. Moreover, the mean and standard deviation of the MAE in tests based on 10 different random seeds are shown in Table 2.  
As shown in Figure 10a,c,e, the performance of all the control methods is similar in the torque control mode. This may be because the response speed of the current loop is fast, and all algorithms can achieve torque control well, so there is no significant performance difference between different algorithms. From Figure 10b,d,f, it can be clearly seen that the actual speed controlled by the proposed algorithm is close to the target speed, which shows that our algorithm has certain advantages on the three speed control tasks. Since the response of speed control is slow, the performance difference between algorithms may be caused by the changes in the control trajectory. The proposed risk-sensitive algorithm uses target trajectory coding to reduce the servo error to the target trajectory. Therefore, it can quickly adjust the running speed of the motor and respond to the change.  
Table 2 shows that the mean absolute error of the proposed algorithm is smaller than others in both torque control mode and speed control mode. However, it has a larger standard deviation in some cases. This indicates that the proposed algorithm is less stable than others in individual tasks.  
In conclusion, the proposed risk-sensitive intelligent control algorithm is not only safe, but its control performance is also better than the other comparison algorithms in general.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Control Task** & **TD3-SI** & **TD3-DVI** & **DDPG-SI** & **DDPG-DVI** & **RESAC** & **Ours** \\ \hline TC-ExtExDc & 0.029 \(\pm\) 0.002 & 0.021 \(\pm\) 0.006 & 0.022 \(\pm\) 0.004 & 0.035 \(\pm\) 0.006 & 0.016 \(\pm\) 0.002 & 0.016 \(\pm\) 0.003 \\ SC-ExtExDc & 13.509 \(\pm\) 1.351 & 16.785 \(\pm\) 1.262 & 14.827 \(\pm\) 1.316 & 18.949 \(\pm\) 1.401 & 12.60 \(\pm\) 1.229 & 11.995 \(\pm\) 1.137 \\ TC-PMSM & 0.320 \(\pm\) 0.014 & 0.474 \(\pm\) 0.016 & 0.312 \(\pm\) 0.012 & 0.434 \(\pm\) 0.019 & 0.308 \(\pm\) 0.014 & 0.302 \(\pm\) 0.011 \\ SC-PMSM & 29.591 \(\pm\) 4.053 & 38.271 \(\pm\) 4.231 & 32.670 \(\pm\) 4.122 & 43.365 \(\pm\) 5.032 & 25.590 \(\pm\) 3.653 & 23.946 \(\pm\) 3.059 \\ TC-SeriesDc & 0.035 \(\pm\) 0.004 & 0.048 \(\pm\) 0.002 & 0.045 \(\pm\) 0.003 & 0.029 \(\pm\) 0.004 & 0.013 \(\pm\) 0.002 & 0.013 \(\pm\) 0.003 \\ SC-SeriesDc & 12.478 \(\pm\) 1.133 & 19.503 \(\pm\) 1.231 & 18.549 \(\pm\) 1.393 & 21.798 \(\pm\) 1.538 & 11.251 \(\pm\) 1.513 & 8.466 \(\pm\) 1.020 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Mean and standard deviation of control error.