# Advanced Servo Control and AI Integration in 3-DoF Platforms for Enhanced Simulation Interactivity
## 2 Control System  
### Conventional Servo Control  
The internal controller of the servo drive adopts a proportional-integral-derivative (PID) controller, which features simple structure, convenient design, and easy adjustment advantages and is widely used in control loop design. It calculates straightforward mathematical equations. When parameters of the plant cannot be grasped or an accurate mathematical model cannot be obtained, controller design needs to be added to improve the overall system response, as shown in Figure 1. This setup includes either an angle controller or a speed controller (providing a pulse command for angle control or a joystick speed command for speed control). Due to the simulator having three degrees of freedom, servo control is employed for the roll, pitch, and yaw axes. For clarity, different axes are denoted as \(k\) in the figure. A limiter generates the necessary q-axis command \(i_{q}^{*}\), while the d-axis command is typically controlled with \(i_{a}^{*}=0\). The d-axis and q-axis current commands are then compared with the actual d-axis current \(i_{d}\) and q-axis current \(i_{q}\) to produce the corresponding voltage commands \(v_{d}^{*}\), \(v_{q}^{*}\). These voltage commands are transformed into a-b-c voltage vector commands \(v_{a}^{*}\), \(v_{b}^{*}\), \(v_{c}^{*}\) through coordinate transformation. Using Space Vector Pulse Width Modulation (SVPWM), three sets of PWM signals are generated (\(T_{a}^{+}\), \(T_{a}^{-}\), \(T_{b}^{+}\), \(T_{b}^{-}\), \(T_{c}^{+}\), \(T_{c}^{-}\)) to control the six-arm switch, which drives the servo motor via the power conversion circuit. In Figure 1, the Roll, Pitch, and Yaw represent the drivers for the roll axis, pitch axis, and yaw axis, respectively. The feedback section is divided into current, speed, and angle. Current feedback is obtained through a detection circuit that measures a-phase current \(i_{a}\) and b-phase current \(i_{b}\) via an AD converter. The c-phase current is calculated as \(i_{c}=-(i_{a}+i_{b})\) due to the three-phase balance. Coordinate transformation then provides \(i_{d}\) and \(i_{q}\) feedback for current closed-loop control. Speed feedback is derived from the encoder by reading \(\theta_{m}\) and calculating \(\omega_{m}\) through differentiation for speed closed-loop control. For angle feedback, the rotation angle \(\theta_{m}\) read from the encoder is used for angle closed-loop control. Consider the voltage equations of the servo motor's \(q\)-axis and \(d\)-axis, and expand them as follows:  
\[v_{d}=r_{s}i_{d}+L_{d}\frac{d}{dt}i_{d}-\omega_{e}L_{q}i_{q}, \tag{1}\]  
\[v_{q}=r_{s}i_{d}+L_{q}\frac{d}{dt}i_{q}+\omega_{e}L_{d}i_{d}+\omega_{e}\lambda ^{\prime}{}_{m} \tag{2}\]  
Figure 1: The previous closed-loop control system. where \(v_{d}\) and \(v_{q}\) are the \(d\)-axis and \(q\)-axis voltages, \(i_{d}\) and \(i_{q}\) are the \(d\)-axis and \(q\)-axis currents, \(r_{s}\) is the resistance of the motor, \(L_{d}\) and \(L_{q}\) are the inductances, \(\lambda_{m}\) is the flux linkage, and \(\omega_{re}\) is the electrical speed of motor. From Equation (2), it is evident that the servo motor's d-q axis voltage equations contain coupling terms: \(\omega_{e}(L_{d}i_{d}+\lambda^{\prime}{}_{m})\).