## 4 Real-Time Implementation and Experimental Set-Up
### Real-Time PMSM-SCS Based on DTC Strategy Using Variable Flux  
Similarly to what was presented in the previous subsection, in this subsection we present the real-time experimental tests carried out for the case of the sensorless PMSM control system based on the DTC strategy, where the flow is variable and is provided by the two controllers of type SMC and FOSMC. By imposing the same series of steps on the reference speed of the PMSM rotor, the graphs obtained for the parameters of interest are presented, to highlight the control performance.  
The real-time speed evolution for PMSM sensorless control based on DTC strategy in the case of variable flux using the SMC-type controller is shown in Figure 23a and in the case of using the FOSMC-type controller is shown in Figure 23b. In this case, using integer- and fractional-order SMC-type controllers, it is observed that the overshoot is practically zero and the settling time is 34.5 ms and 33.9 ms, respectively.  
The real-time evolution of the flux reference and estimated flux for the PMSM-SCS based on the DTC strategy using the FOSMC-type controller is shown in Figure 24.  
The real-time evolution of the stator currents \(i_{a}\) and \(i_{b}\) is shown in Figure 25a for the case where the SMC-type controller is used, and in Figure 25b for the case where the FOSMC-type controller is used.  
Figure 23: Real-time speed evolution for PMSM-SCS based on variable-flux DTC strategy: (**a**) SMC-type controller; (**b**) FOSMC-type controller.  
Figure 22: Graphical representation of the FD of real-time speed signal for the PMSM-SCS, based on DTC strategy for the constant-flux case: (**a**) PI-EOA controller; (**b**) FOPI controller.  
The graphical representation of the FD of the real-time speed signal for the PMSM-SCS based on the DTC strategy in the case of variable flux is shown in Figure 26. Thus, Figure 26 shows the FD of the real-time speed signal when using the SMC-type controller, and Figure 26 shows the FD of the real-time speed signal when using the FOSMC-type controller.  
The results of the experimental tests carried out in real time are summarized in Table 3, both for using a constant flux and for using a variable flux for the sensorless PMSM control system, based on the DTC strategy. The superior performance of SMC-type controllers compared to classical PI-type controllers is observed, as well as the preservation of this hierarchy when using fractional calculus. It should be noted that in real-time, PI-type controllers have better performance in terms of response time, but not in terms of overshoot, settling time, speed-signal ripple and FD of the controlled signal. It should also be noted that the ripple of the speed signal is lower in real time than in numerical simulations, because the number of samples is 1000 in the first case and 10,000 in the second.  
Figure 26: Graphical representation of the FD of the real-time speed signal for the PMSM-SCS based on DTC strategy for the case of variable flux: (**a**) SMC-type controller; (**b**) FOSMC-type controller.  
Figure 24: Real-time evolution of flux reference and estimated flux for PMSM-SCS based on DTC strategy using FOSMC-type controller.  
Regarding the FD of the speed signal, the hypothesis that a better performing controller implies a higher FD value is verified. It should be noted that, in the case of real-time implementations, if the embedded system's computing power is insufficient, it is possible that complex control algorithms that perform better in numerical simulations than classical PI-type algorithms may give opposite results. In the case presented in this article, the development platform offers superior computational power, so that a biunivocity between the performance obtained in numerical simulations and the real-time implementation was achieved. In this case, FO-type controllers offer improvements over integer-type controllers, with the best performance offered by FOSMC-type controllers.