Permanent Magnet Synchronous Motor (PMSM) Speed Response Correction Using Fuzzy-PID Self-Tuning Controller Under Sudden and Gradual Load Variation

: The development and improvement of the control of electric motors has drawn the researchers' attention to the implementation of all types of controllers in motors, especially the permanent magnets, because of advantages such as high-power density in lower volumes, lower losses, higher efficiency, high speed performance range and etc. in comparison with other motors, as well as extensive use in the industries including robotics, military, medical


Introduction
The discovery of magnetic materials and their creation with high energy density led to the development of machines with a PM excitation field in the 1950s.In this type of machine, magnetic materials are used instead of the coil in the rotor.On the other hand, the advancement of the semiconductor and rectifier switches in the early 1990s led to the replacement of electrical commutators instead of mechanical commutators.These two developments led to the development of permanent magnetism [1].Magnet motors are permanent electrical machines that are widely used in low-power motor control applications such as robotics, military applications, adjustable speed drives, and medical devices [2,3].Permanent magnet motors have better performance in higher efficiency conditions, higher torque at lower speeds, higher power density, lower maintenance, and lower noise compared to other motors [4,5].The most important problem with permanent magnet motors is that they require a sophisticated control system.This causes sensitivity of the system parameters of the permanent magnet synchronous motor drives in different applications with load variations.Since these changes are an undesirable characteristic in the excitation system of permanent magnet motors, accuracy in controlling speed or position, against parametric changes or load disturbances is important.Regarding this problem, the parameters of the controller should be changed instantly and continuously [6].There are two methods for implementation of different models of Fuzzy-PID Self-Tuning Controller Under Sudden and Gradual Load Variation controlling permanent magnet motors including vector control and direct torque control (DTC) [7].In the vector control strategy, the responses of the permanent state and the transient state are controlled.In direct torque control, the goal is precise control of the torque, the speed control as well as the transient state control are less studied [8]. Figure 1 shows the speed control of the permanent magnet motor.Hall Effect sensors determine switching at any moment with taking into account the position of the rotor, the speed and winding current error, as well as maintaining the reference speed constant even at the moment of load change and oscillation [9].Permanent magnet motors usually have an internal or external position sensor to detect the position of the rotor.In the drive of the permanent magnet motors, there is a three-phase inverter, a position sensor and a speed controller.The motor position detection sensors are used to obtain the most suitable switching modes by the vector control method to illuminate the semiconductors in the inverter circuit [10].In recent years, advanced control techniques such as adaptive control, sliding mode control and self-regulating PID controllers have been used to solve the problem of proper control in transient conditions [11].
Designing and implementing of all these control methods require an accurate mathematical model of the stimulation system, which is actually a very difficult task to achieve.The use of intelligent computing methods, such as fuzzy control, is an attractive solution in controlling the speed of drivers [12,13].In some methods [14], a fuzzy Q scheme is proposed in which the fuzzy rule database consists of 8 rules.
For fuzzy inputs, only two linguistic attributes, far and near, are considered.According to the material in this study, fuzzy logic is used to control the speed of a permanent magnet motor, whose rotor position is used by Hall Effect sensors mounted on the stator Figure 1.

The Mathematical Model of Permanent Magnet Synchronous Motor
In the modeling of permanent magnet motor, core saturation and coil leakage inductance, vortex flow and hysteresis losses are neglected, and the magnetic potential in the air gap is distributed uniformly sinusoidal [15]: Voltage Equations: Flux linkage Equations: Replacing equations 3 and 4 in equations 1 and 2: The combination of equations 5 and 6 in the form of a matrix: Electric torque equation: Mechanical torque equation: The relationship between base and rotor speeds: In the equations, ω r is the rotor's base speed and ω m is the speed of the rotor.

A. PID controller
Using a PID controller is a good way to correct the error between the measured variable and the reference value.The optimum control system has a small rise time, a small settling time, a small overshoot time, and little steady state failure.The equation of this control is as the equation ( 12) [16]: Where K p is the factor of proportionally, K i is the integral coefficient and K d is the derivative coefficient.

B. Fuzzy-PID Controller
Fuzzy logic is a suitable tool for solving various problems in the real world to tolerate errors and noise in data, which are unavoidable in real-world problems.The fuzzy controllers are divided into four sections, two of which perform the transformation process: fuzzification, database, deductive motor, defuzzification Figure 2 [17].The fuzzy system is used to set the , , and coefficients to control the PID during changing the system parameters.Fuzzy-PID controller inputs are error and error derivative or error variation ( ⁄ ) which is shown in Figure 3.A nonlinear transformation of error and error derivative for PID coefficients is made by fuzzy inference system and the values of PID coefficients are obtained by the fuzzy system [18].
Fuzzy control changes the three coefficients of , and to achieve the appropriate conditions.Fuzzy membership functions have two inputs and three outputs, their values are classified into seven ranges (NB, NM NS, Z, PS, PB, PM) [12].The fuzzy membership functions in the fuzzy editor toolbox is shown in Figure 4.According to a set of rules, the relationship between input and output of fuzzy control can be illustrated using the knowledge available in designing control systems.The proper choice of rules and the number of possible states play an important and essential role in the controller response, and in the absence of the correct selection, they are not only improved, but also the responses are much less favorable.These rules are chosen in Table 1.
The output of the fuzzy rules is the speed and angle of rotation of the motor.For fuzzy inference, Sugeno fuzzy inference engine is used [19].Therefore, we use equation 13 to estimate the speed: In equation 13, is the rate of fire of rule i.

Modeling
More detailed models for checking the performance of the motor in a sudden and gradual load with PID control and FPID are shown in Figures 5 and 6.The speed of the motor is compared by sending feedback paths at the reference speed with the help of the comparator linked to the PID and the FPID.The output of the control outputs the required command to determine the status of the inverter keys.the inverter keys are switched on according to the command signal and based on the vector control method.The output of the inverter circuit feeds the motor.The electromagnetic torque parameters and the rotor speed are measured from the motor output.Simulation has been carried out under various operating conditions, including the moment of launching and loading and removing it.

Setting PID Coefficients
Many controllers of permanent magnet synchronous motors in industrial applications have adopted the constant coefficients method for PID, which works well under certain operating conditions, but its performance degrades in other conditions.Additionally, proper PID coefficients are usually obtained by using time-consuming test and error methods.For this system, the proper coefficients are obtained by using the Ziegler-Nichols open-loop method and have more favorable transient response compared to other methods.

Simulation Result with FPID
Simulation has been carried out in two cases of sudden load removal and gradual load removal.Thus, at the time t = 0 to t = 0.1 seconds, the motor starts at idle conditions.With a sudden change in torque of 3Nm at time t = 0.1 seconds and sudden removal at t = 0.4 seconds, while in gradual load change from t = 0.1 to t = 0.2, the load torque increased linearly from 0Nm to 3Nm and then the load is held constant at 3Nm during t = 0.2 to t = 0.3.Additionally, from t = 0.3 to t = 0.4, the load eases from 3Nm to zero.The response curves with PID control for sudden and gradual load change are shown in Figures 7 and 8     Simulation Result with NFPID In this simulation, the Ziegler-Nichols PID control coefficients which are shown Figure 11 is optimized and applied to the system.The response curves with the NFPDI controller for the sudden load and gradual load changes are shown in Figures 12  and 13, respectively.
Force and thrust force for the proposed and prototype vernier PM machines, respectively.

Conclusion
In this paper, suitable membership functions for the use of fuzzy controller for controlling the speed of the permanent magnet synchronous motor engine were proposed for two different methods, and the results were presented and for comparison and analysis of the motor with FPID and NFPID learning controllers when the engine is exposed to sudden load changes, as well as gradual load variations with constant velocity, have been investigated.Based on the data of tables 2, 3 and 4 on the time parameters of the deposition, the rate of heave and overshoot in the case of sudden load changes in both FPID controllers has been improved and there is no change in the permanent mode response of the system.Additionally, it performs better in terms of gradually removing load.Therefore, the behavior and characteristics of the motor are improved with the NFPID controller.

Figure 1 .
Figure 1.Speed control scheme for permanent magnet synchronous motor.

Figure 2 .
Figure 2. Block diagram of a system under a fuzzy controller.

Figure 3 .
Figure 3.The block of FPID Controller Diagram.

Figure 5 .
Figure 5. Block diagram of the PID controller for PMSM motor.

Figure 6 .
Figure 6.Block diagram of the FPID controller for PMSM motor.
respectively, and the response curves with FPID control for sudden and gradual load change are shown in Figures 9 and 10, respectively.

Figure 11 .
Figure 11.Block diagram of RBF Fuzzy-Q learning with Sugeno.

Figure 12 .Figure 13 .
Figure 12.System Specifications with RBF Fuzzy-Q learning controller under sudden load conditions.a) speed Response, b) three-phase flow response, c) torque Response.

Table 2 .
Results of the response speed for the sudden and gradual load with PID controller.

Table 3 .
Results of the response speed for the sudden and gradual load with FPID controller.

Table 4 .
Results of the response speed for the sudden and gradual load with NFPID learning controller.