Speed control of an SPMSM using a tracking differentiator-PID controller scheme with a genetic algorithm

In this paper, a tracking differentiator-proportional integral and derivative (TD-PID) control scheme is proposed to control the speed of a surface mount permanent magnet synchronous motor (SPMSM). The TD is used to generate the necessary transient profile for both the reference and the output speed, which are compared with each other to produce the error signals that feed into the PID controller. In addition to the TD unit parameters, the PID controller’s parameters are tuned to achieve the optimum new multi - objective performance index, comprised of the integral of the time absolute error (ITAE), the absolute square of the control energy signal (USQR), and the absolute value of the control energy signal (UABS) and utilizing a genetic algorithm (GA). A nonlinear model of the SPMSM is considered in the design and the performance of the proposed TD-PID scheme was validated by comparing its performance with that of a traditional PI controller in a MATLAB environment. Different case studies were tested to show the effectiveness of the proposed scheme, results including peak overshoot, energy consumption, control signal chatter, and 30% improvement in the OPI, with variable reference speeds, load torque, and parameters uncertainties. Illustrate the proposed scheme's success compared with PI controller.


INTRODUCTION
Recent innovations have allowed permanent magnet synchronous motors (PMSM) drives to be progressively are used in a wide assortment of industrial and power applications, including robotics, computer peripherals, customisable-speed drives, electric vehicles, electric aircraft, and wind turbines [1]. This mechanism offers numerous advantages, including simplicity, easy maintenance [2,3], robustness, low cost, and high efficiency [4,5]. Previously, PMSMs have mostly replaced induction and DC motors. They are sometimes favoured over induction motors to eliminate rotor winding, which leads to reduced heat emissions and thus allows for a fully enclosed design [6]. PMSMs are not easy to control, however, and temperature changes can influence PMSMs parameters, leading to variations in the operation of PMSM systems: temperature differentials can cause up to a ±20 change in flux linkage and up to ±200% variance in resistance [7].
Many researchers utilized conventional control strategies or developed new strategies to control a wide range of systems, some of these controllers are: linear quadratic gaussian (LQG) controller, it concerns a linear system driven by additive white Gaussian noise, there is perhaps problematic in implementation of 1729 this controller when the dimension of the model state is large [8]. H∞ techniques have a favourable position over classical control techniques [9][10][11][12], hindrances of H∞ techniques incorporate understanding the level of mathematical are required to apply them successfully and the demand a fairly good model of the system to be controlled, the resulting of the controller is only optimal concerning the commanded objective function, in terms of the common performance criteria used to estimate controllers such as settling time, energy expended, etc. it fails to realize the best controller, nonlinearity of the system such as saturation are overall not deal well. Author [13] presented the effectiveness of fuzzy PID controller to control the speed and dynamic of the framework, the planned controller utilized algorithm (dual-mode switching) which is capable of adjusting to the effect of interference. Fractional order PID (FOPID) controller is used instead of PID controller in [14][15][16], where integral-derivative order integer turns to fractional. The author in [14] utilizes a new tuning scheme where tuning-parameters are decreased, demonstrated better performance comparing with CRONE controller and the traditional one. While [16] nonlinear-neural fractional-order proportional-integralderivative (NNFOPID) used a new neural-network (NN) nonlinear and linear activation functions of neurons in the hidden and output layers (NNFOPID), Nevertheless, there is non-linear control such as piecewise affine PI (PA-PI) and data-driven PID (DD-PID) in order to overcome the nonlinearity problem of the system [17,18], in these methodologies, the controller employs a database that contains a set of PID parameters to updated adaptively. Whereas author in [19] introduce an enhancement to conventional PID by suggested an improved-nonlinear-state error-feedback controller (INLSEF), while the researchers in [20] proposed more robust and effective nonlinear-PID (NLPID) controller and showed the effectiveness of this method compared with the linear PID (LPID) in terms of speed, control energy, and steady-state error. Other else [21] suggested a nonlinear adaptive controller neuroendocrine-PID (NEPID) control the procedure of this engine demonstrated that the system is steady convergence. The picked control methodology is based on adaptive objective function with an appropriate data-driven control scheme. The author in [22] developed an optimal control solution based on the Riccati equation that was applied to a PMSM. Robustness in the face of variation of load disturbances, stability, even regulation, and energy consumption reductions were given as the main reasons for the development of this control solution. When the author compared the proposed controller and conventional cascaded controls, an improvement of 10% in energy efficiency in the transient response was observed; however, the. Author did not address the parameter variation issues arising in the PMSM. Similarly, [23] proposed a speed controller using an autotuning PI (ATPIC) scheme to cope with nonlinearities, changes in the moment of inertia, and torque disturbances in PMSM systems. The authors set both the proportional and integral terms to be changeable and continuously based on the current process trend; the results were then presented in parallel with those for traditional PI controls [23]; however, variable speeds and parameter uncertainties are not discussed.
In [24], a mathematical model of a field-oriented PMSM was developed and simulated, with two type of controllers (hysteresis and PI) thus being developed to make the PMSM work with both constant torque and flux weakening regions. While [24] did not mention the effect of parameter variations in the PMSM, [25] developed a precise PI controller whereby the system can implement better tracking by means of a simple feed forward term. This controller was proposed by the authors as offering best performance where a PMSM is under load torque and where there are model parameters variations. The study in [26] proposed a further new control strategy for a PMSM, with an adaptive PI controller used based on a modification of more traditional just-in-time learning (IJITL). A comparison was thus made between the proposed controller, an RLS-based adaptive PI controller, and a traditional PI controller. Another new fuzzy control rule was proposed in [27], and this was used to design a PI controller for PMSM systems; compared with traditional PI controllers, the proposed controller offered an adjustable proportion factor that could be changed online to track the desired speed. Different cases such as parameter uncertainties in the system and variable speed applied on the PMSM were not taken into consideration, however.
In [28], a real time speed control was proposed for wind turbine applications. The traditional PI controller was used to control the current loop and the speed loop for the PMSM, and the authors examined results for different speed values in different steps in separate simulations. Variable speed references in one simulation were not taken into account in addition to system parameter uncertainties and torque loads where their effects were not presented in any test linear quadratic regulator (LQR) controller was proposed to control a linearized mathematical model of PMSM in [29]. The authors compared the proposed optimal controller's results with those of the classical PID controller within a MATLAB/Simulink environment. Torque load effect were shown in the simulation, validating the proposed controller; however, the variable speed and system uncertainties are not investigated. There are more complicated control options such as [30,31].
The main contribution of the current paper is a new PMSM control strategy based on developing the classical (PI) controller by adding a differentiator term and a nonlinear tracking differentiator to refine transient accuracy and to decrease the control's energy consumption. To develop a more advanced control strategy, a multi-objective optimisation was carried out to identify the optimal parameters, and a new multiobjective performance index is thus proposed. This is a combination of the individual performance indices, the integral time absolute error (ITAE), the square of the control signal (USQR), and the absolute value of the control signal (UABS). Genetic algorithms (GA) is chosen as the optimization method to tune the parameters of the proposed controller due to its ability to avoid local optimal solutions as compared to the other modern optimization methods such as: simulated annealing, particle swarm optimization (PSO), ant colony optimization (ACO).
This paper discusses the development of a tracking differentiator-proportional integral derivative (TD-PID) speed control for PMSM systems which was designed to reach a zero steady state error and to reduce overshoot and settling times. This strategy operates by minimising a multi-objective function using a genetic algorithm (GA), whereby the controller parameters are tuned. The controller of PI, the TD-PID, has four or five tuning parameters that can be are tuned utilising the proposed GA, which is categorized as an evolutionary algorithm suitable for searching for a global solution. Three main operators are used at each stage to develop the next generation from the current one; these are selection, crossover, and mutation [32,33]. The GA is utilised to optimise (minimise) the proposed multi-objective OPI [34], which is an aggregate function combining an objective function, the integral of the time absolute error (ITAE), the square of the control signal (USQR), and the absolute value of the control signal (UABS) for both the speed and current loops. This ensures both control robustness and the stability of the closed loop PMSM system throughout the control procedure. To confirm the efficacy of the proposed strategies, a MATLAB environment was used to develop a simulation system. The dynamic performance of the system was then examined under variable speed, parameter variations, and sudden change in torque of the PMSM system. The effectiveness of the TD-PID technique was shown in the results of such simulation.
Some issues have not been discussed or studied in the previous literature, such as variable speed reference signals, system parameter uncertainties, and load torque disturbances. These were thus studied and investigated more deeply during the development of the proposed control strategy, which makes use of both TD tracking capabilities and the PID controller. This strategy aims to control the PMSM speed based on the abilities of both TD and PID to track reference speed and to reach stability more rapidly.
The rest of this paper is arranged as follows: section 2 describes the fundamental principles of the PMSM model for the speed controller, and section 3 illustrates the basic ideas underlying tracking differentiator (TD) tracking and differentiating reference speeds. The simulations and results are outlined in section 4 to prove the efficacy of the proposed control, and the final section offers a conclusion.

OVERVIEW OF THE PMSM MODEL
PMSM is a significant class of electric machines in which rotor magnetisation is created by connecting permanent magnets to a rotor. As they are used in various applications, numerous mathematical models have been proposed for development purposes, such as the abc-model and the two axis dq-model. The latter has, however, become the most broadly used model in PMSM engineering controller design due to its simplicity. The dq-model transforms stationary symmetrical AC values to DC ones in a rotating reference frame that offers additional convenience to control system design. Based on dq reference frame theory, the SPMSM consists of a surface-mount rotor magnetic circuit structure that requires no damper winding; thus, L d = L q = L, and by using the i d = 0 vector control method outlined in [35], the mathematical model of the PMSM can be developed as in equations (1) to (4) [36]: where ω is the electrical rotor speed; R is the stator resistance; L d andL q represent the inductance of the direct and quadrature axes; k m is the permanent magnet flux; n p is the number of pole pairs; andi d andi q are the daxis and q-axis stator currents, respectively. Thus, where J is the moment of inertia of the PMSM system; T L is external load torque; B is the rotor friction coefficient; ωis the rotor mechanical speed; and θ is the rotating angle. In (1) and (2) represent the current equations, while (3) is the mechanical torque equation. In three-phase reference, the PWM pulse generator and inverter create a system that rotates once and then reverses. The PMSM controller utilises a cascade control loop structure containing a speed loop and two current loops, as shown in Figure 1.

PROPOSED SPEED CONTROL SCHEME (TD-PID)
The general equation of a traditional PI can be described using The propose equation for the PID is thus ǔ = k p e ω 1 + k i ∫ e ω 1 dt + k d e ω 2 In (5) and (6), u and ǔ are the control signals, k p is the proportional gain, k i is the integral gain, and k d is the derivative gain. The proposed control scheme consists of two main parts, the inner current loops and the speed loop, The current loops are made possible by the use of PI controllers for i d and i q , as demonstrated in (5). This allows definition of the current tracking errors as where e d and e q are the tracking errors of the direct and quadrature currents, respectively, while i d ref and i q ref are thereference signals of the direct and quadrature currents, respectively. The block diagram for the control scheme as shown in Figure 1 demonstrates that the proposed control scheme is TD-PID based on utilising TD and PID in the speed control loop, as in (6), and using two PIs for the speed loop. Using the new tracking differentiator proposed by [37] offers a particularly good response, as this achieves smooth tracking and arrives at reference signal more rapidly. By combining the tracking differentiator with the speed loop, the tracking differentiator becomes dependent on the hyperbolic tangent function: where ω 1 tracks inputω ref and ω 2 tracks the derivative of input ω ref . The parameters α, β, γ, and R should be controlled so that 0<α<1, β>0, γ>0, and R>0 to ensure a suitable design emerges. The band-limiting effect is very clear for this type of TD, reducing fluctuations in the steady state for both output signal ω 1 and state-  (11) e ω 2 = ω 2 − ω 2f (12) where e ω 1 is the tracking error of the speed, e ω 2 is the tracking the derivative error, and ω 1f and ω 2f track the feedback speed ω and the derivative of ω f , respectively, for the TD of the feedback speed loop. TD has been tuned separately by using GA in order to obtain parameters α, β, γ and R. These parameters are optimised using a mean square error (MSE) performance index. To obtain the optimum values for these controller parameters, a multi-objective function is used to tune the controller parameters of both traditional PI controllers and the proposed TD-PID controller by applying a GA to the PMSM system. The search algorithm GA is a weighted coefficient of controller output, which produces performance indices as illustrated in (13) and (14): where, In addition, t f is the final time of simulation and a 1i , a 2i , and a 3i are weighting factors that satisfy the relationship a 1i + a 2i + a 3i =1. These describe the relative significance of one objective as compared to the others, and their estimations are thus selected to ensure fairness and equity between all chosen objective functions. The same applies to the weighting a ì. To guarantee that objectives have identical qualities, b 1i , b 2i , and b 3i are normalising values added to the performance index; these are managed likewise by the tuning algorithm. Where a specific objective has an extremely low value, while the subsequent one has a value that is extremely high, the tuning algorithm should prioritise the most elevated one value, causing the other to have little reflection within the system. The block diagram in Figure 2 demonstrates the methods used for the TD-PID controller, whereas Figure 3 shows the tuning process used in this paper.

SIMULATION AND RESULTS
The PMSM control system was implemented in a MATLAB/Simulink environment and the results from the proposed TD-PID controller were compared with those of a traditional PI controller. The parameters used for PMSM are shown Table 1 these were used in both the traditional (PI) and proposed (TD-PID) control system testing. For the proposed control scheme TD, parameters α, β, γ, and R were obtained as shown in Table 2 with a view to obtaining the best tracking results. These values were based on OPI utilising the integral of the absolute error to minimise system settling time and rising time and adding a penalty for overshoot along with another objective function utilising the square of the control signal. To reduce the energy used by the controller USQR performance index must be used, and to minimise the chattering in the control signals UABS performance index must be used. The values determined for the weighting factors were a 1i = a 2i =a 3i =1/3 and a ì= 1/2 for i=ω, d, while The values of the controller parameters after the tuning process was carried out are listed in Table 3, where K P is the proportional gain, K I is the integral gain, and K D is the derivative gain. The optimum values of OPI after GA tuning, based on the performance indices with ω ref as the motor reference speed applied at 3.000 rpm at t=0 s for 0.3 s, are given in Table 4. The first simulation results applied when both the speed and the load were constant, so that the motor was run under load torque conditions of 3.18 Nm with a constant speed of 3,000 rpm. Figure 4 to Figure 10 show comparisons between the proposed control scheme (TD-PID) and traditional control (PI) under these conditions. Figure 4 illustrates the speed of response of both controllers, clearly showing that TD-PID control follows the command speed closely, with zero overshoot. It can be noticed that in Figure 5, the electromagnetic torque of the motor of the traditional controller shows higher rates of chattering and a double peak overshoot, unlike the proposed scheme, when loaded at t=0 sec, while the speed errors demonstrated in Figure 6 and Figure 7 show the speed control signal differential. 1735 Figure 8 shows the three phase currents. Park's reverse transformation was applied to obtain these currents, which are steady except at the beginning of the process. The three phase current shows a higher ripple in this early period in traditional PI as compared with that seen with the proposed controller.
The d and q components of the stator current and their controller signals (u d , u q ) are illustrated in Figure 9 and Figure 10. In the field oriented control method, during loading, only the q-axis current i q increases in order to generate the necessary torque. The principle of the FOC is achieved by keeping i d equal to zero as i q either increases or decreases to generate the necessary torque. In Figure 9, the i q of the traditional PI controller is seen to take twice the time of that of the proposed TD-PID controller, while the value of Id must be zero for constant torque operation. The initial i of the traditional PI is five times that of the TD-PID controller, and Figure 9 related to control signal responses, shows that the control signal of i q in traditional PI is far too high, almost seven times that of the proposed TD-PID. It also takes a long time to stabilize, with about 0.05 s settling time, in contrast to PID-TD with a control signal of not more than 0.025 s. The i control signal of TD-PID also demonstrates less chattering and peaking compare with the traditional control.  Three cases studies were modelled. Case study 1 shows a motor is running with variable speed, while Case study 2 examines a change in the PMSM parameters of about ±200% and ±20% in resistance and inductance, respectively. Case study 3 then examines a sudden change in the torque of the PMSM of about ±10%.

Case study 1
In this case, the simulation was created to model the PMSM with variable speed and constant load. Simulation results are thus given at a rated load torque of 3.18 Nm and speeds of 2.500 rpm, 1.500 rpm and  3.000 rpm at t=0.1 and 2 sec, respectively. Figure 11 to Figure 16 show a comparison of the results for the proposed control scheme (TD-PID) with those of the traditional control (PI) in response to variable speed. Figure 11 shows that variation of speed with time creates higher overshoots when starting with 2.500 rpm at t=0 sec, with this overshoot being equal to 6.96 % for the traditional and 0.64% for the proposed controllers; then, when at t=1 sec a speed of 1.500 rpm is applied, the overshoot for these controllers becomes 1.992% and 0.72%, respectively, while the overshoot at a speed change to 3.000 rpm at t=2 sec are 4.8% for the traditional and 0.63%for the proposed controller. The numerical results of the ITAE, USQR and UABS performance indices for the two control schemes types are listed in Table 5.
Analysis of the results provided in Table 5, illustrates a definite increase in the ITAE which is gained by the proposed TD-PID scheme. This increment reflected on disappearing the peak overshoots and making the time response of the speed smoother as compared to the traditional PI controller, as can be seen in Figure 11. At the same time, a huge reduction in energy consumption (USQR) has been presented by the proposed controller which reduces the energy consumption to half of the one obtained by the classical PI controller. Furthermore, Figure 12 displays the electromagnetic torque of the motor. The starting torque of the traditional control is higher than in the steady state condition. The electromagnetic torque is the same as the load torque under the steady state condition, while the torque produced by the traditional PI controller shows higher oscillation and torque ripple whenever the speed changes. The electromagnetic torque of the motor at the starting speed changes at t=0.     Figure 15 and Figure 16 illustrate the d and q components of stator current and their controller signals, the u d and u q currents, for the traditional PI controller and proposed TD-PID controller, respectively. Notably, the qd current response remains the same as in the previous case when the speed is variable. Where i remains at zero, i q increases in order to generate the necessary torque, and the proposed TD-PID utilises less current to reach the required speed, however.

Case study 2
In this case, the behaviour of the PMSM under certain parameter changes was examined for sub-case1; while the PMSM was rotating at constant speed of 3.000 rpm, the stator resistance was changed by ±200%, equal to 1.67 ohm. At t=1, the resistance decrease was about 200%, with a corresponding increase at t=2. Figure 17 shows that the TD-PID was able to regulate the required speed faster than the conventional PI, while Figure 18 demonstrates the speed error and Figure 19 shows the stator current controllers' d and q components. For sub-case2, the control systems of the PMSM were tested under ±20% changes in stator inductance, which are equal to 0.894 mH, with the changes applied, as in sub-case1, at t=1 s and t=2 s. Figure 20 illustrates that the inductance effect at that speed is approximately identical to that in sub-case1, with the TD-PID control strategy showing transient duration when stator inductances increase at t=1 s and decrease at t=2 s with smaller response curve fluctuations of speed and better recovery capabilities than the traditional PI control. The dq current control signals produced by the traditional PI controller have higher rates of chattering phenomena and ripple, as seen in Figures 19 and Figure 21. The proposed control scheme is less affected by these variations based on the results presented earlier. It is thus clear that the proposed method offers improved performance in terms of speed tracking. The numerical results of the ITAE, USQR, and UABS performance indices for the two control schemes are listed in Table 6 and Table 7, where the advantages of the proposed scheme are reflected as compared to the conventional scheme. Both Table 6 and Table 7 results reveal that a nearly 20% reduction in the total OPI has been obtained using the proposed control scheme. This reduction in the OPI achieved by a small increment in the ITAE performance index in addition to a large decrement in the USQR one, while the UABS has been attained a small decrement due to its small value as compared to the USQR value.

Case study 3
In this case, the motor was run at 3.000 rpm. At t=1 s, and t=2 s, a torque change of ±10% over the reference torque load was applied. Thus, 2.962 Nm was applied to the motor shaft at t=1 s, being removed at t = 1.1 s; when the external load was applied, the speed of the motor rose to about 3.002 rpm. At t=2 s, a load torque of 3.5 Nm was applied and again removed suddenly after 0.1 s; the speed of the motor then reduced to about 2.998 rpm. Figure 22 shows that while neither system was observed, as there was no observer function, the traditional PI shows a peak overshoot and more chatter phenomena while TD-PID curve displays a smoother response without a peak overshoot, furthermore, This conclusion can be verified by observing the ITAE, USQR and UABS values of both schemes as listed in Table 8. The OPI value is reduced by approximately 25% in the TD-PID scheme. Figure 22 shows a comparison of the speed responses from the traditional (PI) and the proposed (TD-PID) controllers under these variations in torque load conditions; the speed error of PMSM before and after the external load was applied and then removed are shown in Figure 23.

CONCLUSION
This paper offers an improvement to the performance of the traditional PI controller based on a proposed TD-PID controller, which is applied to the speed loop controller, with a PI used as the current loop controller for PMSM. For SPMSM, a GA provides a way to identify the optimal parameters of both the traditional PI controller and the TD-PID controller by facilitating tuning. The simulation results indicate that the proposed solution is reliable in terms of the speed control of the PMSM under various scenarios. The TD-PID controller significantly reduces the energy of the control signal, with the difference being clearly seen inthe result figures for constant speed and variable speed. The tables of comparisons use the indices USQR and UABS, and these indicate that TD-PID has faster speed responses, less chattering, and no overshoot. The new structure with the proposed TD-PID thus achieves fast pinpointing and smooth tracking of the reference signal and demonstrates a stronger anti-interference ability than the PI controller. The recognisable speed proof also shows a smaller steady-state error and less influence from variations of motor parameters. Changes in resistance and inductance for maximum and minimum range are negligible in the TD-PID controller system as compared with the traditional PI controller system, and when a variable torque load is applied, the response speed remains approximately the same. In future work, an observation must be added to estimate load torque changes (disturbance) in order to investigate this factor further.