## Appendix B  
Since it is necessary to obtain a discrete equation of integer order for real-time implementation, the Oustaloup filters described in the paper are used. The Tustin transformation is also used for the transition from continuous to discrete representation. Since the transfer functions of the controllers are usually of very high order (usually more than 30), this implies a real-time implementation of a recursive control law over a number of stages, at least equal to the highest order of the discrete transfer functions of the respective controllers, which can become prohibitive in terms of real-time implementation on a low-cost controller. The problem can be overcome either by using a high-cost controller or by obtaining a lower-order discrete transfer function (usually between 7 and 9) that can be implemented on a low-cost controller. The lower order transfer function is obtained from the very-high-order transfer function by a method of equating properties in both the time and frequency domains, using quadratic error criteria. In terms of numerical implementation by simulation or in real-time, the problem is to approximate fractional FO transfer functions in a given frequency range \((\omega_{b},\omega_{h})\) and order \(N\) with an integer-order transfer function to obtain an integer-order difference equation that can be directly implemented in a simulation program or an embedded system. This allows Oustaloup recursive filters to be used with \(s^{7};\ 0<\gamma<1\)[15; 16; 41].  
A variant of the Oustaloup filter that gives a good accurate conversion is given by Equation (16), where the usual parameter values are \(b=10\) and \(d=9\).  
\[s^{\alpha}\approx\left(\frac{d\omega_{h}}{b}\right)^{\alpha}\left(\frac{ds^{2 }+b\omega_{h}s}{d(1-\alpha)s^{2}+b\omega_{h}s+d\alpha}\right)G_{p} \tag{16}\]  
where  
\[G_{p}=K\prod\limits_{k=-N}^{N}\frac{s+\omega_{k}^{\prime}}{s+\omega_{k}};\ \ \omega_{k}= \left(\frac{b\omega_{h}}{d}\right)^{\frac{\alpha+2k}{2N+1}};\ \omega_{k}^{\prime}= \left(\frac{d\omega_{b}}{b}\right)^{\frac{\alpha-2k}{2N+1}} \tag{17}\]  
For real-time implementation in an embedded system, it is necessary to obtain the equivalent transfer function of integer order of the transfer function of the FOPI-type speed controller expressed in Equation (53) in fractional form. The form of the equivalent transfer function in the discrete variable \(z\) of integer order can be implemented as a recursive equation. The Oustaloup filter is used to approximate the fractional-order transfer function with a continuous-integer-order transfer function. This is carried out using the FOMCON toolbox for Matlab in the frequency range \(\omega=[10^{-2}\); \(10^{3}]\) rad/s, which contains the common frequencies for the presented application.  
Figure 11 shows the equivalent transfer function form achieved in the \(s\)-domain.  
The equivalent \(z\)-domain transfer function is obtained using the Tustin substitution. The form of the discrete transfer function obtained is shown in Figure 12.  
Similar to the case of the FOPI speed controller using the Oustaloup \(zpk\) filter, the integer order results for the TID controller are shown in the following figures. Therefore, the continuous form is shown in Figure 13, and the discrete form is shown in Figure 14.  
Using the Oustaloup \(zpk\) filter, the integer order results for the FO-Lead-Lag-type speed controller are shown in in the following figures. Therefore, the continuous form is shown in Figure 15 and the discrete form is shown in Figure 16.  
Figure 14: Discrete transfer functions of TID speed controller for PMSM-SCS, based on DTC strategy at constant flux.