## 8 Verification of the EPS Control Algorithm  
In this section, two control algorithms, namely, the PID control algorithm and the proposed loop-shaping control algorithm, are applied to control the assist motor in the assistance mode of the EPS. To implement this in real time for the EPS system, the continuous time model in the Laplace s domain must be transferred to a discrete time model in the z domain. The setup procedure of the control algorithm includes three steps:  
1. Establish the new model based on MATLAB/Simulink and configure the RTI interfaces, including the common I/O, PWM and AD modules. 2. Establish the control algorithm model for the EPS system, filter the collected analogue signals and compile and generate dSPACE executable SDF files. 3. Build the new experimental project in the Control Desk software of dSPACE. The generated SDF files are downloaded into the real-time dSPACE card via the Ethernet network. Figure 28: EPS test bench. Figure 27: Block diagram of the verification experiment platform for the EPS control algorithm. Finally, the overall EPS frame system is controlled in real time via the control panel of Control Desk. _Case 1. PID control algorithm_  
For the PID control algorithm, the trial-and-error method is utilized to design the I and P parameters, and the D parameter is set to 0. When the parameters P and I are adjusted, a step target current is given to the control system, and thereafter, the P value is adjusted to make the actual current value slightly higher than the target current value but without too large an overshoot. The actual current reaches the target current and then undergoes a certain attenuation, which indicates that the control requirements cannot be met solely by adjusting the P value; the I value must also be adjusted. While adjusting the I value, the P value must also be adjusted accordingly. This conflict is avoided by iteratively adjusting P and I until the demanded control effect is achieved. When the target torque of the motor is less than 15 N\(\cdot\)m, P is 0.054 and I is 0.0006. _Case 2. Proposed loop-shaping control algorithm_  
As previously discussed, The SRIV algorithm has the highest estimation accuracy, which is used to obtain a nominal model for the EPS system. The structure [3 4 0] is the model of EPS system \(G=\frac{-1.138\times 10^{11}s^{2}+2s+0.4}{3s^{4}+278.51s^{3}+1.1692\times 10^{9 5}+2.937\times 10^{9}s+2\times 10^{10}}\) based on the identification experiment and the controller is K, as shown in Figure 23. However, this model is not absolutely accurate. The EPS system needs the controller to enhance the stability of the EPS system. Hence, from the above analysis of the controller design, the loop-shaping controller design procedure is summarized in four main steps:  
**Step 1:** Select a pre-compensator \(W_{1}\) and post-compensator \(W_{2}\). These two shaping functions are added to generate the shaped plant \(G_{\mathrm{s}}\), which is written as follows:  
\[G_{\mathrm{s}}=W_{2}GW_{1} \tag{35}\]  
In SISO systems, the weighting function \(W_{1}\) and \(W_{2}\) can be chosen as  
\[W_{1}=9,05\frac{s+956}{s+0.32}\text{ and }W_{2}=1 \tag{36}\]  
where \(W_{2}\) can be chosen as a constant, since the effect of sensor noise is negligible. In this method, the shaped plant is formulated as normalized co-prime factor, which separates the shaped plant \(G_{\mathrm{s}}\) into normalized nominator \(N_{\mathrm{s}}\) and denominator \(M_{\mathrm{s}}\) factors. If the shaped plant \(G_{\mathrm{s}}=N_{\mathrm{s}}M_{\mathrm{s}}^{-1}\), the perturbed plant is written as  
\[G_{\mathrm{\Delta}}=\left(N_{\mathrm{s}}+\Delta_{\mathrm{N}\mathrm{s}}\right) \left(M_{\mathrm{s}}+\Delta_{M\mathrm{s}}\right)^{-1} \tag{37}\]  
where \(\Delta_{\mathrm{N}\mathrm{s}}\) and \(\Delta_{M\mathrm{s}}\) are stable and unknown, representing the uncertainty satisfying \(\left\|\Delta_{\mathrm{N}\mathrm{s}},\Delta_{M\mathrm{s}}\right\|\leq\varepsilon\), \(\varepsilon\) is the uncertainty boundary called the stability margin.