Grey wolf optimizer algorithm based real time implementation of PIDDTC and FDTC of PMSM

Received Jun 26, 2018 Revised Nov 9, 2019 Accepted Apr 27, 2020 Meta-heuristic optimization techniques are important tools to define the optimal solutions for many problems. In this paper, a new advanced artificial intelligence (AI) based direct torque control (DTC) speed drives are optimally designed and implemented in real time to achieve a high performance permanent-magnet synchronous-motor (PMSM) drive. Grey wolf (GW) algorithms are used with the standard PID-based DTC (PIDDTC) and with the DTC with fuzzy logic (FDTC) based speed controllers. DSPACE DS1202 is utilized in the real-time implementation. MATLAB SIMULINK is used to simulate the steady-state (S.S.) and dynamic responses. The overall system is tested at different operating conditions for both simulation and practical work and all results are presented. A comparison between experimental and simulation results is performed and also a comparison between different applied intelligent techniques is introduced.

Latest AI-based control improvements have focused on optimizing probability of controller's parameters for increased performance. Such AI control procedures are used with DTC for controlling electrical machines [5][6][7], [10]. The importance of the AI is increased at the last few decades, and AI control methods are developed to improve the control performance and these systems are widely used in this period [5][6][7][8][9]. Now, optimization problems appear at many applications, which considered the main parts of human comfort assurance [11,12]. Meta-heuristic techniques mimic the natural swarms' behaviours; where there are many behaviour-techniques have been formulated. No need for mathematical model and simplicity are intelligent-controllers' core merits that are appropriate for dealing with electrical machines' nonlinearity and uncertainty [2,13]. Simulation of the swarms of birds, insects, and animals is considered a new development technique. This simulation assists the researchers to obtain global optimal value, which represents the effectiveness and accuracy [11,12]. Many procedures simulate some different swarms' hunting behaviours such as; the GW, whale, moth-flam, antlion and dragonfly algorithms. Their behaviour can be divided into searching and hunting terms, exploration phase replaces the searching term and exploitation process substitutes the hunting one [14]. The GW is inspired at 2014 by S.A. Mirjalili and others where it simulates the GW hunting behaviour. The authors categorize wolves according to their behaviour through the hunting process, where the hunting process is splitted into searching, surrounding and attacking the prey and the main wolfs categories are alpha, beta, delta, and omega [15].
Alpha-type takes the hunting-decision, beta-type takes the advisor role for the alpha-type, delta-type helps beta and alpha while hunting a prey and providing foods for all wolfs, at last, omega-type provides a support for ill, weak, and wounded members from the other three types. Delta, beta, and alpha wolves execute the searching for a prey, where these wolves are diverging from each other to search for a prey. Once a prey is founded, wolves surround it, then the attacking phase is executed as explained previously.
DTC that contains hysteresis comparators (HC) and switching tables is the common tactic to apply DTC [16] It includes flux (ψ) and torque (T) estimators, switching table and ψ and T hysteresis controllers. T and ψ errors were compared through HCs. The voltage-vector picked from the table depends on those comparators [17]. The estimators for ψ and T usually need a DC bus-voltage (Vdc) sensor and couple of current sensors. Speed sensors are not essential for the ψ and T control. In each sampling time (Ts), the inverter switching states are updated. In every sampling-interval, inverter retains its state till HC output state changes. This configuration generates high torque ripples, thus researchers tried to develop this basic configuration by means of many techniques such as utilizing more than one switching table, using another controllers instead of the HC or using advanced inverter topologies [18].
In drives, utilizing PID-controller is regarded as the standard in controlling the speed. In the conventional DTC configuration, the HCs are utilized in regulating the T and the ψ within a pre-determined control-band.
One of the developments towards improving the classical DTC performance is the space-vector pulse-width modulation DTC (SVPWM DTC) where basically PID controllers replace the HCs [18].
Lately, fuzzy logic (FL) strategy as an intelligent control (IC) technique has been used with the electrical machine controllers [2], [19].
FL based speed controller with DTC (FDTC) can be represented as an effective procedure of PMSMs speed control [20][21][22] with enhanced ψ, T ripples [23] This paper presents both the simulation and the experimental implementation of such advanced approaches for speed control applied upon PMSM. The GW intelligent swarm behaviour is used as an optimization algorithm in order to optimize all control parameters of a PID-based DTC (PIDDTC) and a FDTC. The DTC is applied using a SVPWM configuration. The optimization involves the parameters of the PID or FL speed controllers.

SYSTEM MODELLING
Direct control of T and ψ by applying an optimal voltage vector in accordance with variations among actual and reference T & ψ values, represents the DTC basic principle. The model schemed in Figure 1 presents the DTC using SVPWM. Upon measuring instantaneous I and V, the actual values of T & ψ are estimated and compared with their reference values for calculating the necessary V to drive the T and Ψ to desired values in fixed time period. Then the SVPWM synthesises the needed voltage [24]. The model presents a speed-control of a PMSM using PIDDTC or FDTC principles with the SVPWM. The data of the motor used in the study is presented in appendix 1.
Input variable for the PID-type is the error (E) while for the FL-controller one, input variables are E and the change in it (ΔE). For the FL-controller, every variable is mapped to one of the FL-sets by fuzzification process. These fuzzy sets can be divided into giant negative (GN), huge negative (HN), little negative (LN), zero (ZER), little positive (LP), huge positive (HP) and giant positive (GP). Table 1 presents the rule-base and Figures 2, 3 and 4 displays membership functions of inputs in addition to output of speed controller [25].
In this study, the key point is to minimize the objective functions, which are the summation of square of the errors between the references and actual values of the speed, T and ψ curves. The design variables are all controllers' parameters according to the controller type. For the PID controller, the design variables will be the gains Kp, Ki and Kd where for the fuzzy controllers, the adjustable system parameters can be tuned through E and ΔE and outputs gains. Constraints are the minimum lower and maximum upper limits of all controllers' parameters.   In order to minimize the objective function, GW swarm optimization algorithms is applied. Both speed, T and ψ curves should be considered during the design of the objective function. So, multi-objective function is created for this system including the summation of square of the errors for all objected curves. The main target is minimizing all the following objective functions of speed, T and ψ curves respectively.
The following equation summarizes the main target, which is minimizing the multi-objective function of the proposed curves.
Optimal Design of each curve = min f(error) The linear weighted-sum method is utilized for converting the multi-objective function into single function, where Pareto optimal-solutions of original multi-objective problems can define corresponding single objective problem as follows [26]: Optimal Design of the system = w 1 × obj1 + w 2 × obj2 + w 3 × obj3 Where: w 1 , w 2 and w 3 are corresponding objective function importance and, ∑ w i = 1 n i=1 , w i ≥ 0 , n=3.

Simulation modeling
The overall drive-system was simulated and tested at different operating conditions via Matlab-Simulink for verifying the concepts and analysis of PIDDTC and FDTC optimized by GW algorithm and to assessment these developed control algorithms. Figure 5 presents the suggested drive of the PMSM with PIDDTC and FDTC which used in simulation-phase.  The error on the speed between the actual and the reference speed commands reflects the torque reference through the speed controller and then it is input to the torque controller. The motor speed should follow the given reference and concurrently, the DTC procedure samples the stator currents that used in the ψ and T estimation. These estimated values are compared with the stator flux and torque references values respectively. The optimal voltage-signals are generated depending on these results and used in calculating the timings of the SVPWM signals [27].

Practical modeling and experimental set-up
In the experimental implementation phase, the advanced proposed algorithms are modeled and dSPACE-DS1202 is utilized for real-time implementation. The modeled systems introduce a speed control of the PMSM exploiting the PIDDTC and FDTC principles with SVPWM procedure. Figure 6 represents the scheming of the experimental set-up. The system is controlled via the DSP that loaded using Matlab software in a computer arrangement.
The PWM outputs from dSPACE DS1202 are limited with their digital outputs range which is 5 V but the required inverter PWM input equals to 15 V that means incompatibility. Thus, a level shifting circuit is developed in order to level the DSP output up to the desired level and all the level shifter PWM outputs in to the inverter is tested. In DTC the current is not controlled directly thus, an over current protection must be exist during trials to protect the experimental system during implementation this is done through the level shifter where the enable signal of the level shifter has been exploited in the protection of the motor against over speed, overheating, DC-link over voltage, overloading and high instantaneous current where it can be disconnected in case of fault thus disconnecting the motor. Figure 7 indicates the protection sequences that energize the enable of the level shifter. Also, the motor can be disconnected manually via a normally-open push-button switch.

SIMULATION AND EXPERIMENTAL RESULTS AND DISCUSSION
In this work, control parameters of the PID based or FL based speed controllers of the outer-loop and controllers of T & ψ of the DTC inner-loops were optimized by GW optimization algorithm. The previously illustrated suggested PMSM advanced drive system has been tested at different loading conditions at a reference speeds equal to 1000 rpm. when loaded with 0.550 N.M. and 1.10 N.M. with a load step change and at no load. The reference-flux amplitude (ψref) equals to 0.295560 Wb and simulation programcycle (Ts) is equal to 1 μSec. Through the scope block in Simulink, simulation results have been picked while in the experimental phase, each time dependent function (voltage, current, speed, flux, torque, …. etc.) is recorded via dSPACE Control Desk 5.5 software loaded upon a computer system.

GW based PIDDTC
In this section, a GW Based PIDDTC system is simulated and practically implemented at the reported test conditions and the responses are monitored at no load and loading conditions. Simulation and practical results -at reference speed 1000 rpm at no load and at loading -of the GW Based PIDDTC drive of PMSM are presented in tables 2 and 3.

At no load
From the no load case and with simulation, the motor speed touches its S.S. in time less than 0.43 sec. with a rise-time (trise) equals to 0.278 sec. without overshoot and with -0.025% S.S. error. While with experimental, its speed touches its S.S. in 1.22125 sec. with a trise equal to 0.33743 sec. with 6.92 % overshoot and with +0.025% S.S. error. The ψ response sustains at its reference without a S.S. error for practical or simulation.

In case of loading
From the speed response at the loading case, it is obvious that in simulation phase, the motor speed rises in a time of 0.3221 and reach to S.S.in a time equals 0.45 sec with no observed overshoot in this simulation with -0.09% S.S. error. The speed dip at loading 1.1 N.M. equals to 2.49 % of the reference speed. While with experimental, its speed rises in a time of 0.3428 and reaches to S.S.in a time equal 1.248 sec with 6.457 % overshoot and +0.023% S.S. error. The speed dip at loading 1.1 N.M. equals to 2.262 % of the reference speed. Also the ψ response sustains at its reference without S.S. error for both simulation and practical.

GW based PIDDTC
In this section, a GW Based FDTC system is simulated and practically implemented at the same reported test conditions and all the motor responses are monitored at no load and at loading condition. Simulation and practical results -at reference speed 1000 rpm at no load and at loading -of the GW Based FDTC system are presented in tables 4 and 5.

At no load
From simulating the no loading case, it is clear that the motor speed touches its S.S. in time equals 0.06 sec. and with +0.185 % S.S. error without overshoot and trise equal 0.0259 sec. while through experimental implementation, the speed S.S. time equal 0.72803 sec. and with +0.18 % S.S. error with 3.33% overshoot and a trise equal 0.3284 sec.

In case of loading
From the simulation results at the loading case, the system touches its S.S. in 0.1 sec. with zero overshoot and + 0. By comparing practical and simulation results at no load and with loading for the both GW based PIDDTC drive and GW based FDTC drives, it is apparent that owing to loading, the trise of the speed response arises. Also the S.S. error for both cases has a negligible very small value.
By comparing both simulation and practical results of the GW based PIDDTC and the GW based FDTC drives for both loading and no load cases, it can be easily extracted that the FL based controller offers a better response than the PID based one and all drives optimized by GW, can develop a high performances represented in low trise and S.S. error and also a negligible overshot. Table 6 presents a summarized result of all the GW based cases for both simulation and experimental. By comparing simulation with experimental real-time results of all proposed PMSM drives, we can clearly notice that for all proposed optimized drives, a good tracking-performance can be achieved and an enhanced performances during S.S. and starting is presented where a reduced S.S. error, a reduced trise, low ripples and small overshot can be achieved. Also a match among both results can be observed with high dynamic-performance and S.S. reaching in short time with insignificant overshot. The little difference between the simulation and practical results is due to the neglected added inertia from the motor coupling in the practical phase, where these added inertia increases the trise and the steady state time in practical more than in simulation. Finally, comparing simulation with practical shows a respectable agreement between their results with highly dynamic performances and S.S. reaching in short time.

CONCLUSION
In this paper, concept and analysis of PIDDTC and FDTC are verified. Comparison between PIDDTC and FDTC optimized by GW is performed for all loading cases in both simulation and experimental. All simulation and practical results are compared to test the performance and the agreement between them. For all the cases, it is clear that all GW optimized drives, can develop a high performance represented in low rise time and S.S. error and also a negligible overshot while the optimized FL based controllers are able to supply better performances than the optimized PID based controllers. Convergence among simulation and experimental results can be observed.