# The Fuzzy PI Controller for PMSM’s Speed to Track the Standard Model

Authors: Nguyen Vu Quynh
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

This paper proposes a fuzzy PI controller to control the speed of a permanent magnet synchronous motor (PMSM). The structure of the system includes the speed loop controller (SLC) and the current loop controller (CLC). The speed loop controller is the fuzzy PI and standard model (SM). The CLC includes vector control and the space vector pulse width modulation (SVPWM). It compiles two closed-loop control systems for the PMSM. This research uses a very high-speed integrated circuit hardware description language (VHDL) to implement the proposed algorithm and embed it into Matlab/Simulink for simulation. Based on the PMSM parameter, this article tests the controller’s correctness with some of the load cases by changing the combined inertia and viscous friction of rotor and load. After success in simulation, the system is tested again by experiment on the FPGA kit. The simulation and experiment results show that when the load changes, the PMSM speed is still stable. The novelty of this research is that it compares two kinds of controllers between simulation and experiment results.


---

## Body

## 1. Introduction

The PMSMs are commonly used in systems requiring high precision such as the robot and mechanical processing. However, there are many uncertainties, for example, noise, external load, and friction force. They affect the performance quality of the system. Many intelligent control techniques such as fuzzy, neural network, and genetic algorithm have been developed to cope with those problems [1–4]. They helped to control precisely the speed and position of the motor. The FPGA supplied a solution for the implementation of the algorithm. Especially, FPGA has a programmable hard-wired feature, fast calculation ability, low power consumption, and higher density. There were many types of research on intelligent controllers such as fuzzy control, sliding fuzzy control, artificial intelligence, and adaptive control based on the FPGA platform to control multiaxis robots for improving precision in machining and assembly [5–9]. The fuzzy control method is an intelligent control system, with an inference mechanism from experts’ control experience. However, obtaining fuzzy sets and optimal membership functions are not easy. To resolve this problem, the fuzzy knowledge base values were adjusted appropriately based on the feedback system parameter [10, 11]. This research proposes a drive system to overcome the slow response and tuning problems of the conventional PI speed controllers without any mathematical calculations [12, 13]. However, the aforementioned research studies do not check with the massive change of load. This research applied a fuzzy PI controller, current controller, and SVPWM for PMSM drive. The contents of the article include, firstly, the mathematical model of PMSM, SVPWM algorithm, vector control method, and fuzzy PI controller. Secondly, VHDL is used to program all systems. Finally, the article presents a simulation on Matlab/Simulink and experiment on FPGA kit results.Figure1 shows the block diagram of the proposed algorithm. The speed of the motor (ωr) is fed back to the speed loop controller to compare with the output of the standard model (SM). The fuzzy PI controller generates the signal to minimize the error between rotor speed and SM. The adjustment mechanism keeps the motor speed stable when the load changes. The three-phase stator currents (ia, ib, ic) and rotor flux angle (θe) are fed back to the current controller to calculate the generated voltage vector for SVPWM. The SVPWM generated the electric current to control three-phase inverter for providing power to the motor.Figure 1
The simulation architecture of the fuzzy PI controller for PMSM drive.


## 2. The Vector Controller Design for PMSM

### 2.1. The PMSM Mathematical Model

(1)diddt=1Ldvd−RLdid+LqLdp∗ωr∗iq,diqdt=1Lqvq−RLqiq−LdLqp∗ωr∗id−λ∗p∗ωrLq,in which Lq and Ld are the inductances on q-axis and d-axis; R is the resistance of the stator windings; iq and id are the currents on q-axis and d-axis; Vq and Vd are the voltages on q-axis and d-axis; λ is the permanent magnet flux linkage; p is the number of pole pairs; and ωr is the rotational speed of the rotor.


### 2.2. The Vector Controller

The current controller of the PMSM drive in Figure1 is based on a vector control approach. The current controller structure includes Clark, Park, inverse Park, and inverse Clark transformation, two PID controllers, and sine/cosine of flux angle. Three-phase current is fed back through vector control, enabling controlling current id≈0, which helps control the three-phase motor similar to a DC motor. The torque of the PMSM is controlled via current on the q-axis (iq). The vector control is described below.The Clark transformation converts the stationarya-b-c frame (ia, ib, ic) to stationary α-β frame (iα, iβ).(2)iαiβ=23−13−13013−13iaibic.The Park transformation converts the stationaryα-β frame (iα, iβ) to synchronously rotating d-q frame (id, iq).(3)idiq=cosθesinθe−sinθecosθeiαiβ.The inverse Park transformation converts a rotating referenced-q frame (vd, vq to stationary α-β frame (vα, vβ).(4)vαvβ=cosθe−sinθesinθecosθevdvq.The inverse Clark transformation converts a stationaryα-β frame (vα, vβ) to stationary a-b-c frame (vref1, vref2, vref3).(5)vref1vref2vref3=10−1232−12−32vαvβ.Electromagnetic moment of the motor could be calculated using the following formula:(6)Te=1.5pλ∗iq+Ld−Lqid∗iq≈Kt∗iq.The mathematical equation of the motor under the load-bearing condition is(7)dωrdt=1JmTe−Fωr−Tm,where Te is the motor torque; Jm and F are the inertia and viscous friction of rotor and load; Tm is the shaft mechanical torque; and Kt is the torque constant.


## 2.1. The PMSM Mathematical Model

(1)diddt=1Ldvd−RLdid+LqLdp∗ωr∗iq,diqdt=1Lqvq−RLqiq−LdLqp∗ωr∗id−λ∗p∗ωrLq,in which Lq and Ld are the inductances on q-axis and d-axis; R is the resistance of the stator windings; iq and id are the currents on q-axis and d-axis; Vq and Vd are the voltages on q-axis and d-axis; λ is the permanent magnet flux linkage; p is the number of pole pairs; and ωr is the rotational speed of the rotor.


## 2.2. The Vector Controller

The current controller of the PMSM drive in Figure1 is based on a vector control approach. The current controller structure includes Clark, Park, inverse Park, and inverse Clark transformation, two PID controllers, and sine/cosine of flux angle. Three-phase current is fed back through vector control, enabling controlling current id≈0, which helps control the three-phase motor similar to a DC motor. The torque of the PMSM is controlled via current on the q-axis (iq). The vector control is described below.The Clark transformation converts the stationarya-b-c frame (ia, ib, ic) to stationary α-β frame (iα, iβ).(2)iαiβ=23−13−13013−13iaibic.The Park transformation converts the stationaryα-β frame (iα, iβ) to synchronously rotating d-q frame (id, iq).(3)idiq=cosθesinθe−sinθecosθeiαiβ.The inverse Park transformation converts a rotating referenced-q frame (vd, vq to stationary α-β frame (vα, vβ).(4)vαvβ=cosθe−sinθesinθecosθevdvq.The inverse Clark transformation converts a stationaryα-β frame (vα, vβ) to stationary a-b-c frame (vref1, vref2, vref3).(5)vref1vref2vref3=10−1232−12−32vαvβ.Electromagnetic moment of the motor could be calculated using the following formula:(6)Te=1.5pλ∗iq+Ld−Lqid∗iq≈Kt∗iq.The mathematical equation of the motor under the load-bearing condition is(7)dωrdt=1JmTe−Fωr−Tm,where Te is the motor torque; Jm and F are the inertia and viscous friction of rotor and load; Tm is the shaft mechanical torque; and Kt is the torque constant.


## 3. The SVPWM Algorithm Design

The SVPWM is a control technique widely used in power electronic equipment control. The idea of the method is to create a continuous shift of the space vector equivalent of the voltage vector of the inverter on the circle orbit (Figure2). With the steady shift of the space vector on a circular orbit, the higher harmonics are removed, and the relationship between the control signal and output voltage amplitude became linear. In this article, the SVPWM technique is used to create a vector to control the inverter using IGBT power switches.Figure 2
(a) The eight primary vectors and switching patterns. (b) PWM atS3 Sector and its duty cycle.
(a)(b)The phase-to-phase voltage and the phase-to-neutral voltage of the motor:(8)VABVBCVCA=VDC1−1001−1−101abc,VANVBNVCN=13VDC2−1−1−12−1−1−12abc,in which a, b, and c are switching vectors of IGBT power electronic switches.There are six power IGBTs in the voltage-source inverter. When the upper switch is active, the corresponding lower switches must be turned off. Theremust be coordinated delay time (dead band) between the opening and closing of two switches on the same phase.The eight primary space vectors (V0,V1,V2,V3,V4,V5,V6,V7) are shown in Figure 2(a). The output voltage (Vref) is located at one of the six sectors (S1, S2, S3, S4, S5, S6) at any given time.(9)Vref=T1TUx+T2TUx+1+T0V0orV7T,where x ≠ 0, 7 and T is half of the PWM period, T0 = T − T1 − T2. For example, in the S3 sector, the output voltage can be calculated with V1 and V2 vectors (Figure 2(a)).(10)V1=2VDC3α⟶,(11)V2=VDC3α⟶+VDC3β⟶.From equations (9)–(11), the output voltage and the value of T1 and T2 can be obtained:(12)Vref=T1∗V1T+T2∗V2T=T1T2VDC3α⟶+T2TVDC3α⟶+VDC3β⟶≈Vαα⟶+Vββ⟶,T1=T3Vα−3Vβ2VDC,T2=3T∗VβVDC.Similarly, the values ofT1 and T2 at the other sectors shown in Table 1 with Tx, Ty, and Tz are(13)Tx=3T∗VβVDC,(14)Ty=T3Vα+3Vβ2VDC,(15)Tz=T−3Vα+3Vβ2VDC,with the condition T1 + T2 > T; T1 and T2 are modified as follows:(16)T1cond=T1∗TT1+T2,(17)T2cond=T2∗TT1+T2.Table 1
Time value in each section.
ValueS1S2S3S4S5S6T1TzTy−Tz−TxTx−TyT2Ty−TxTxTz−Ty−TzThe duty cycles (Taon, Tbon, Tcon) in Figure 2(b) can calculated as follows:(18)Taon=T−T1−T22=T02,(19)Tbon=Taon+T1,(20)Tcon=Tbon+T2.PWM1, PWM2, and PWM3 with the duty time atV1 and V2 and zero vector (V0 and V7) are T1, T2, and T0, respectively. The values of CMP1, CMP2, and CMP3 at each sector are shown in Table 2. For quickly determining the sector, (5) (inverse Clark transformation) is modified as follows:(21)vref1vref2vref3=10−1232−12−32vβvα.Table 2
The values of CMP1, CMP2, and CMP3 at each section.
SectionS1S2S3S4S5S6CMP1TbonTaonTaonTconTconTbonCMP2TaonTconTbonTbonTaonTconCMP3TconTbonTconTaonTbonTaonWe can determine the sectorsS1–S6 (Figure 3) according to the rule below:(22)ifVref1>0,thena=1elsea=0,ifVref2>0,thenb=1elseb=0,ifVref3>0,thenc=1elsec=0.Figure 3
The voltage values supplying for the SVPWM.The sector of SVPWM is defined by this equation: sector =a + 2b + 4c. From equations (13)–(15) and (21), we have(23)TxTyTz=3TVDCvref1−vref3−vref2.The implementation of SVPWM by VHDL can be summarized below:(i)
From the value ofVref1, Vref2, and Vref3, we determined the sector as (22).(ii)
Calculate the value ofTx, Ty, and Tz from (23).(iii)
SelectT1 and T2, in Table 1.(iv)
Calculate the duty cycle (Taon, Tbon, and Tcon) from equations (18)–(20).(v)
Select comparative value (CMP1, CMP2, and CMP3) at the duty cycles from Table 2.


## 4. Standard Model (SM)

The SM is the standard speed for PMSM. The output of the SM is increase and tangent to the set value at the input. To build the SM to meet the above requirements, we used the typical second-order system:(24)ωmsωr∗s=ωn2s2+2∗η∗ωn∗s+ωn2,where ωnandη are the natural frequency and damping ratio, respectively. Using the bilinear transformation, we obtained the discrete function in Z domain and difference equation:(25)ωmz−1ωr∗z−1=a0+a1z−1+a2z−21+b1z−1+b2z−2,ωmk=−b1∗ωmk−1−b2∗ωmk−2+a0∗ωr∗k+a1∗ωr∗k−1+a2∗ωr∗k−2,with coefficients: a0 = 0.0077, a1 = 0.0153, a2 = 0.0077, b1 = −1.6496, and b2 = 0.6803.The error between the output of SM and the rotor speed is supplied to the fuzzification and the fuzzy adjustment mechanism function of the fuzzy PI controller. Figure4 shows the SM; it does not change the rising time, zero steady-state value, and overshoot when the system is running. Figures 5 and 6 show a finite state machine (FSM) and the VHDL code to describe the SM, respectively.Figure 4
The response of the SM.Figure 5
Seven steps to implement the SM by FSM with one adder and one multiplier.Figure 6
The example of SM computation using VHDL.


## 5. Structure of Fuzzy PI Controller

The structure of the fuzzy PI controller includes fuzzification, fuzzy inference mechanism, defuzzification, fuzzy knowledge base, fuzzy adjusting mechanism, and the PI controller (Figure1).The rotor speed (ωr) is fed back to SLC for comparison with the output of SM and an error signal (e) is generated, and the signal changes over time (de). Based on the e and de signal, the fuzzy PI controller generates the signal to control the motor's speed. This signal is defuzzified and then amplified by the PID controller. When the motor had a heavy load or light load, the difference between rotor speed and output of SM increased, the fuzzy adjustment mechanism (figure 1) changes the knowledge base of the fuzzy PI controller. With this method, the motor speed is still in the balance.Fuzzy PI controller used singleton fuzzy rule, and the method of the average center solution with input linguist value includes(26)ek=ωmk−ωrk,(27)dek=ek−ek−1.In Figure7, the values e, de, and uf are the input and output of fuzzy controller. Their linguist values E and dE are (A1, A2, A3, A4, A5, A6, A7) and (B1, B2, B3, B4, B5, B6, B7), respectively. During each cycle, there are only two E and dE values that are supplied to the fuzzy PI controller (Figure 7). From the values of E and dE, based on membership functions, we can calculate the values of μAieandμBide with the formula below:(28)μAiE=Ei+1−E2,(29)μAi+1E=1−μAiE,(30)μBidE=dEi+1−dE2,(31)μBi+1dE==1−μBidE.Figure 7
The design of the fuzzy controller for PMSM drive.Membership function has the shape of the symmetrical triangle, and control rules have the form(32)ifeisAmanddeisBn,thenufisCm,n.Crisp value in the output of the fuzzy controller:(33)ufE,dE=∑n=ii+1∑m=jj+1cm,nμAnE∗μBmdE∑n=ii+1∑m=jj+1μAnE∗μBmdEΔ¯¯∑n=ii+1∑m=jj+1cm,n∗dn,m∑n=ii+1∑m=jj+1dn,m=∑n=ii+1∑m=jj+1cm,n∗dn,m,where dn,mΔ¯¯μAnE∗μBmdE and cm,n are adjustable parameters in the adaptation mechanism. Also, it can be obtained by the equations (28)–(31). Therefore, it is straightforward to obtain ∑n=ii+1∑m=jj+1dn,m=1 in (33).The purpose of the fuzzy adjustment mechanism is to create the signal to adjust the fuzzy knowledge base of the fuzzy PI controller so that the error between the speed of the rotor and the output of the SM is the smallest. We use the method of gradient descent to determine the adaptive control law for the system.Definition of instantaneous value function:(34)Jk+1=12ek+12=12ωmk+1−ωrk+12.ParameterCm,n is determined by the variation of the instantaneous value function.(35)ΔCm,nk+1=−α∂Jk+1∂Cm,nk,in which α shows the learning rate of the system.By taking Laplace and bilinear transform of (7), we obtained a discrete function in the Z domain of PMSM.(36)ωrkiq∗k=KtF1−e−FT/Jmz−11−e−FT/Jmz−1,in which T is a sampling cycle and z−1 is a stage of delay time. The equation describes the relationship between iq∗ and uf:(37)iq∗k=uik−1+Kp+Ki∗ufk,in which Kp and Ki are the coefficients of the PI controller and uf is the output function of the fuzzy PI controller.From (36) and (37), we get the function between ωr and uf:(38)ωrk=Φ∗ωrk−1+uik−2∗γ+Kp+Ki∗γ∗ufk−1,in which Φ=e−FT/Jm,γ=Kt1−Φ/F.Variation of the instantaneous value functionJ (k + 1) from (34) is(39)∂Jk+1∂Cm,nk=−α∗ek−1∂ωrk+1∂ufk∂ufk∂Cm,nk.From (35), (38), and (39), the parameters of the fuzzy PI controller Cm,n in (33) could be adjusted through the function.(40)ΔCm,nk=α∗Kp+Ki∗γ∗ek∗dm,n≈α∗Kp+Ki∗Signγ∗ek∗dm,n.


## 6. Implementation on FPGA

The proposed algorithm has been embedded in one FPGA chip. The architecture of FPGA is shown in Figure8. The FSM sequential programming technique was used to describe control algorithms. The internal circuit of the proposed algorithm includes one circuit of the SLC and one circuit of the CLC.Figure 8
The implementation of the proposed algorithm on FPGA. The FSM was used to describe the VHDL code. (a) The architecture of the FPGA-based fuzzy PI controller for PMSM drive. (b) The speed loop circuit. (c) The SVPWM architecture. (d) The vector control circuit.Figure8(a) shows the implementation of FPGA for the PMSM speed controller. CLK and CLK_40ns are the input clocks (50 MHz and 25 MHz) to supply all modules. The command speed and rotor speed (ωr∗, ωr) with 16 bit length are the input of the SLC. The three-phase currents (ia, ib, ic) and rotor flux angle (θe) with 12 bit length are the input of the CLC. The 6 PWMs are the output of SVPWM.In Figure8(b), there are 33 steps to carry out the fuzzy PI controller. The steps s0–s5 compute SM, and the steps s6-s7 calculate the rotor speed error with SM and error change. The steps s8–s11 compute the fuzzification. The step s12 looks up the fuzzy table to select four values of cm,n based on i, j obtained from s11. The steps s13–s21 compute the defuzzification function. The steps s22–s32 turn the PI and turn the fuzzy rule parameters.Figure8(c) shows the design of SVPWM with 12 kHz frequency and 1.2 μs dead band. The input of SVPWM is Vref1, Vref2, and Vref3 with 12 bit length.Figure8(d) computes the current vector controller, and it takes 24 steps. The steps s0-s1 look up the table to take the value of sine and cosine functions. The steps s2–s8 calculate the Clark and Park transformations. The PID controller turns the current on d and q-axis from step s9–s14. The steps s15–s23 calculate the inverse Park and modified inverse Clark transformations.The data type in vector control and SVPWM for PMSM is 12 bits. The data type is designed with 16 bit length for the fuzzy PI controller and SM. Each clock pulse in the FPGA is 40 ns to complete a command. There are 33 steps (1.32μs) and 24 steps (0.96 μs) to implement the SLC and the current vector controller, respectively. It does not lose any performance because the operation time of fuzzy PI with 1.32 μs is much less than the sampling time of the speed controller (2 kHz).Although the control algorithm of this research by using the fuzzy PI controller is quite complicated, using the FSM description in step-by-step order reduced the execution time of coding. The simulation was performed on Matlab/Simulink/ModelSim for adjusting and verifying the controller’s parameters and checking the accuracy of the proposed algorithm. The ModelSim software was embedded in Matlab/Simulink for simulating the whole system. The feedback signals, PMSM model, and inverter are designed on Simulink. After success in simulation, the whole VHDL code is downloaded to the FPGA board for testing again by experiment.


## 7. Simulation Work

The simulation is demonstrated in this section to confirm the effectiveness of the proposed architecture. In simulation work, five steps are used to confirm the effectiveness of the system. In the first step (Figure9), the generation of SVPWM function is firstly tested, and its block diagram includes inverse Clarke and inverse Park coordinate transformation, sin/cosine function, and SVPWM (Figure 9(a)). In Figure 9(b), the EDA simulator link for ModelSim executes the co-simulation using VHDL code, which describes the function of the block diagram in Figure 9(a). The switching frequency and dead band in SVPWM are designed with 16 kHz and 1.2 μs, respectively. The input signal iq is set to a value varying from 0.1 to 0.4, id is chosen to be zero, and the address (θe) is generated from 0 to 360° with increment by one. The PWM1–PWM6 outputs can be generated through the computation in ModelSim. Further, PWM1, PWM3, and PWM5 are serially connected to the RC circuit (R = 10 Ω, C = 47). The saddle waveform of PWMs is shown in Figure 9(c).Figure 9
The simulation system for SVPWM generation. (a) The block diagram of step 1. (b) The Simulink model of step 1. (c) The simulation result of PWM with RC circuit connection (saddle waveform).
(a)(b)(c)In step 2, the inverter and PMSM are added to step 1. A real rotor flux angle replaces the address. The block diagram of this step is shown in Figure10(a), and the Simulink model is shown in Figure 10(c). This step confirms the correctness of SVPWM on PMSM again. The rotor speed is shown in Figure 10(b), and it follows the value of iq at the input.Figure 10
Confirmation of the correctness of SVPWM on the PMSM model again. (a) The block diagram of step 2. (b) The rotor speed response. (c) The Simulink model.
(a)(b)(c)In step 3, the PI speed controller is applied to the system, and the real rotor speed is fed back to the speed controller. The block diagram of this step is shown in Figure11(a), and the Simulink model is shown in Figure 11(c). In this step, we can check the speed response of PMSM. The rotor speed can follow well the step response at the input (Figure 11(b)).Figure 11
The speed controller is applied to the system, and the real rotor speed is fed back to the speed controller. (a) The block diagram of step 3. (b) The rotor speed tracks the speed command perfectly. (c) Simulink model.
(a)(b)(c)In step 4, the three-phase stator currents are fed back and applied through Clack and Pack transformation. The results of that transformation are compared withid and iq obtained from the motor. Then, id and iq are fed back to the PI controller in the current loop to create the completed system. The block diagram of this step is shown in Figure 12(a), and the Simulink model is shown in Figure 12(b). In this step, the rotor speed also tracks the step response perfectly (Figure 12(c)). Figure 12(d) also validates the effectiveness of current vector control in Figure 1 (id≈0). The three-phase stator current is balanced (Figure 12(e)).Figure 12
The three-phase stator currents are fed back. (a) The block diagram of step 4. (b) The Simulink model. (c) The rotor speed tracks the speed command without overshoot. (d)id≈0 and the PMSM can control as DC motor. (e) The three-phase stator current balances.
(a)(b)(c)(d)(e)In step 5, the PI and fuzzy PI controllers are applied to check the overall system with three load cases. The Simulink model is shown in Figure13. The VHDL code of the SLC is embedded in the ModelSim_1 block; the VHDL code of the CLC is embedded in the ModelSim_2 block; the inverter based on IGBT and PMSM is designed on Matlab/Simulink. The fuzzy PI rule table is designed in Figure 7, and its parameters are shown in Figure 14. The learning rate is set to 0.5. The load of motor is in light-load (J = 0.000036, F = 0.00043) and heavy-load (J = 0.000324, F = 0.0039) conditions. The heavy-load condition is nine times heavier than light-load condition.Figure 13
The simulation model of the proposed algorithm on Matlab/Simulink.Figure 14
The parameters of the fuzzy PI controller.The sampling frequency of the CLC and SLC is designed with 16 kHz and 2 kHz, respectively. The clocks of 50 MHz and 12.5 MHz supply to all modules of ModelSim. The FPGA resource usage of SLC and CLC blocks is 4915 LEs (logic elements) (0 RAM bits) and 1742 LEs (196,608 RAM bits), respectively. The designed PMSM parameters are listed in Table3.Table 3
The parameters of PMSM.
ParametersValueStator resistor1.3 ΩStator inductance6.3 mHPole pairs4InertiaJ = 0.000108 kg·m2Friction factorF = 0.0013 N·m·sVoltage constant52.2 V_peak/1000 rpmTorque constant0.43169 N·m/A_peakThe article also analyzes the case that just uses the PI controller.ki and kp are designed at a normal load; the rotor speed tracks the output of SM perfectly (Figure 15(b)). The setting value of PI speed controller and PID on d-axis and q-axis is shown in Table  4. After that, the PMSM is changed to light-load and heavy-load conditions for testing. At the light-load condition, the response of rotor speed is overshot to 43 rpm and the rotor runs faster than the normal-load condition (Figure 15(a)). At the heavy-load condition, the response of rotor speed is overshot to 47 rpm and the rotor runs slower than the normal-load condition (Figure 15(c)). The error between SM and rotor speed is maximum with 393 rpm (light-load condition) and 177 rpm (heavy-load condition).Figure 15
The simulation results when the speed controller is the PI controller. (a) The light-load condition. (b) The normal-load condition. (c) The heavy-load condition.
(a)(b)(c)Table 4
The parameters of PI speed controller and PID controller ond-axis and q-axis.
ParametersValueKp speed controller4600Ki speed controller27Kp on d-axis320Ki on d-axis5Kd on d-axis10Kp on q-axis224Ki on q-axis5Kd on q-axis10The simulation results show that when using the fuzzy PI controller, the responding speed of the motor is obtained in the case of the light-load, normal-load, and heavy-load condition, and heavy-load (Figures16–18). Although the load changed very largely, the rotor speed still tracked the output of the SM very well.Figure 16
The light-load condition and the fuzzy PI controller are applied in simulation. (a) The speed response. (b) The current control.
(a)(b)Figure 17
The normal-load condition and the fuzzy PI controller are applied in simulation. (a) The speed response. (b) The current control.
(a)(b)Figure 18
The heavy-load condition and the fuzzy PI controller are applied in simulation. (a) The speed response. (b) The current control.
(a)(b)Also, from 0–0.1 s in Figure19(a), the PI controller is used to control the speed of the motor in the light-load condition. The speed response has lag and overshoot. After 0.1 seconds, the fuzzy PI controller is applied, and the rotor speed tracks the SM perfectly, without overshoot. Similar to the heavy-load condition shown in Figure 19(b), from 0–0.15 s, the PI controller is used, and from 0.15 s–0.35 s, the fuzzy PI controller is used. The simulation result shows that with the proposed algorithm, the rotor speed can track the reference model well.Figure 19
The PI and fuzzy PI controllers are applied in simulation. (a) The light-load condition. (b) The heavy-load condition.
(a)(b)


## 8. Experiment Work

After the successful simulation, we realize this code on the FPGA kit. The experimental system is shown in Figure20, and the experimental results are shown in Figure 21–23.Figure 20
The experimental system.Figure 21
The PI controller without external load (light-load condition). (a) The rotor speed. (b) The current control.
(a)(b)Figure 22
The PI controller with external load = 10 kg. (a) The rotor speed. (b) The current control.
(a)(b)Figure 23
The fuzzy PI controller with external load = 10 kg. (a) The rotor speed. (b) The current control.
(a)(b)The experimental system includes an FPGA (Cyclone IV EP4CE115F29C7N), a drive board, an encoder board, an ADC board, and a PMSM. The specifications of the motor are shown in Table3. An encoder with a resolution of 2500 pps is attached to the motor as the rotor position sensor. The inverter has three sets of IGBT power transistors, and its specifications are shown in Table 5. The Toshiba IC (TLP250) is used in the gate driving circuit of IGBT. The PWM signals from the FPGA board are the inputs of the drive board. A Nios II embedded processor is set up in FPGA to construct a SOPC environment.Table 5
The parameters of IGBT.
ParametersValueCollector-emitter voltage600 VGate-emitter voltage±20 VDC collector current (rated)25 ADC collector current in a short time (1 ms)50 AFigures21–23 show the speed step response of the motor under an external load of 0 kg or 10 kg using the PI and fuzzy PI controller. The the speed command is square waves with period of 0.5 s and magnitude variation from 0 => 400 rpm => 1000 rpm => 1400 rpm => 1000 rpm => 1400 rpm => 1000 rpm => 1400 rpm => 1000 rpm.In Figure21(a), at the light-load condition (0 kg), the speed controller is PI; the step response shows an excellent dynamic response with a rising time of 0.1 s, without overshoot, and a zero steady state. However, when heavy-load condition (10 kg) is added and the same PI controller is used, the speed dynamic response worsens and exhibits a 48 rpm overshoot in Figure 22(a). In Figure 23(a), a fuzzy PI controller is applied to solve this problem. The speed responses are highly improved without overshoot. Due to the EMI effect, the measured current in Figures 21(b), 22(b), and 23(b) have a little ripple.Nevertheless, the experiment result still shows that the measured current could track the current command well. Furthermore, it not only validates the function of the vector control but also could make the PMSM decouple. Therefore, the simulation and experiment results demonstrate the effectiveness and correctness of the proposed algorithm for PMSM.


## 9. Conclusion

The fuzzy PI controller has been studied to control the speed of PMSM. The adjustment mechanism produces a compensation signal by using (40), which is added to the fuzzy controller’s knowledge base to force the system to track the SM. The simulation and experiment results confirmed the efficiency of the proposed fuzzy PI and SVPWM for PMSM.



---

*Source: 1698213-2020-07-13.xml*