1 Introduction

Nowadays, improving energy efficiency is essential in selecting power-train systems because of environmental protection requirements and the reduction of greenhouse gas emissions. This requirement has led to using PMSMs instead of induction motors IMs with much lower efficiency. On the other hand, the increasingly mature magnet manufacturing technology has made permanent magnets with high magnetic field density more and more popular. These favorable conditions have allowed PMSMs to be preferred in high-quality electric drive systems in civil and industrial applications and are becoming increasingly popular.

PMSM controllers often use vector control in their applications to increase the electromagnetic torque per ampere ratio. Two commonly used vector control methods are Direct Torque Control (DTC) (Hidouri and Lassaad 2010) and Field Oriented Control (FOC) (Yesilbag and Ergene 2014). The speed control loop uses traditional Proportional-Integral (PI) controller to adjust the electromagnetic torque (through the q-axis current) in the vector control method.

In nonlinear control systems, the curve representing the relationship between the output of the control object and the input control signal will be linearized around the operation point (Rudnicki 2019; Miguel-Espinar et al. 2020). At this point, PI regulators are applied to control the system. With the PI parameters selected corresponding to the specific operating condition the speed control efficiency is maintained at the optimal condition. However, when applied them to PMSM speed control, a highly nonlinear object, the quality of PMSM speed control will be degraded when the reference speed or load torque is changed (Liu et al. 2019). This problem needs to be overcome and improved in variable-speed PMSM drive systems.

Several methods have been proposed to calibrate the PI controller parameters or replace the PI controller with intelligent ones to solve the performance degradation problem. The fact is that intelligent control methods have been introduced to improve the efficiency of PMSM speed control, such as using a Fuzzy Controller (FC) (Hoai et al. 2020; Jin et al. 1617), Neural Network controller (Ghamri et al. 2020; Aguilar-Mejía et al. 2021), sliding control (Gao et al. 2019; Qian et al. 2018), predictive control (Yu et al. 2022; Fei et al. 2019). New intelligent control methods enhance the efficacy of PMSM velocity control compared to conventional FOC-PI control methods. Then PMSM-drive systems have constantly been applied in different fields with different power levels; more studies are focusing on PMSM speed control as to improve system stability and increase the fast and stable PMSM speed response under various operating conditions.

In recent years the Fuzzy PI algorithm represents a reasonable choice to solve the problem of adapting the time-varied PMSM parameters when the working point of the PMSM changes. This algorithm has proven robust adaptability when applied to nonlinear control methods (Fogel 2016; Mendel et al. 2014). The Fuzzy-based control algorithm obtains the advantage that it needs not to rely on the accurate description of the controlled object and then not be sensitive to changes in plant coefficients. The fact is that it is characterized by its fast and robust responses regarding to the changing working conditions of the investigated system (Hongwei and Penglong 2020).

Related to the problem of improving the efficiency of PMSM velocity regulation, some studies on fuzzy-based applications to PMSM control have been published recently. There were many ways to apply fuzzy-based approaches to improve the PMSM speed control efficiency. In the studies (Bouzeria et al. 2015; Alsayed et al. 2019; Tomer and Dubey 2016), the PMSM speed controller using traditional PI was replaced by the Fuzzy-PI speed controller. These studies show that the control quality significantly increases, which depends not only on the speed deviation but also on the speed rate variation. However, the control values change only slowly when there is a rapid and unexpected change in the control speed when the working condition changes.

Fuzzy PI controllers with control parameters Kp and Ki are suggested directly from the Fuzzy Logic (FC) (Ünsal and Aliskan 2022; Duong et al. 2018; Gu et al. 2020). With this control principle, the range of values of control parameters Kp and Ki will be more comprehensive and flexible than fuzzy-∆-PID controller. The flexibility in adjusting control parameters Kp and Ki allows the controller to respond to significant changes in working conditions and minimize output speed fluctuations when the PMSM speed reaches the reference speed.

Fuzzy Control Parameters (FCP) ensure control quality (Singh and Thongam 2019). Select FCP values are as essential as Membership Function (MF) and fuzzy rules (Li et al. 2005). Many studies have been proposed to determine optimized FCP values as to improve control quality for Fuzzy PI controllers, such as Genetic Algorithm (GA) (Tsai and Chang 2015), Particle Swarm Optimization (PSO) (Boukhalfa et al. 2019), and Differential Evolution Algorithm (DEA) (Ochoa et al. 2020). The FCP values obtained through the optimization algorithms have improved the control quality compared with the conventional trial and error method selection. Recently the Jaya Optimization Algorithm (JOA) was proposed in 2016 by Venkata Rao (Venkata Rao 2016). Up to now, JOA and JOA's improved versions, including the Modified MJA, have proven very effective in optimization problems through recent research results (Zhang et al. 2021; Zitar et al. 2022; Huy Anh et al. 2019).

Inspired by the PMSM speed control results above-mentioned and to further improve the control quality and the practical efficiency regarding applying Fuzzy PIs to PMSM speed control, this paper proposes an advanced optimal fuzzy PI controller in which the number and the shape of fuzzy MF input variables and the gain of controller parameters Kp and Ki are all optimized by Modified Jaya (MJA) optimization algorithm. The experimental results of the optimal fuzzy-PI PMSM velocity regulation show that the proposed control algorithm obtains perfect performance compared to the conventional PI control and the optimal Fuzzy PI proposed in the study (Ünsal and Aliskan 2022).

The simulation results and experimental results show that the method proposed in this paper possesses the following advantages: (1) reducing the speed overshoot when the working conditions change, (2) reducing the settling time for transients, and (3) reducing the error PMSM speed to the reference speed. The proposed control method is compared with the PMSM speed control method based on the Fuzzy PI controller proposed in Ünsal and Aliskan (2022) and the PMSM speed control method based on the traditional FOC-PI controller.

The rest of this paper is divided into 5 Sections: Sect. 2 introduces the PMSM motor model and PMSM speed control based on the FOC approach. Section 3 presents the PMSM speed control using the proposed optimal Fuzzy PI controller. Section 4 introduces the MJA-based FCP optimization results and the proposed PMSM speed control simulation results. Section 5 presents an experimental model of PMSM speed control and the experimental results of the proposed control method. Section 6 is the conclusions.

2 Modeling and Speed Control PMSM According to the Fuzzy PI Control Method

2.1 PMSM Modeling

Based on (Kim et al. 2016), the PMSM model expression in the d-q referential co-frame is illustrated as (1) and (2) respectively.

$$v_{d} = R_{s} .i_{d} + L_{d} \frac{{{\text{d}}i_{d} }}{{{\text{d}}t}} - \omega_{e} L_{q} i_{q}$$
(1)
$$v_{q} = R_{s} .i_{q} + L_{q} \frac{{{\text{d}}i_{q} }}{{{\text{d}}t}} + \omega_{e} L_{d} i_{d} + \omega_{e} \lambda_{{{\text{pm}}}}$$
(2)

With, \(\omega_{e}\) represents the electrical angular velocity;\(L_{d}\), \(L_{q}\) denote the d- & q-axis inductance; \(\lambda_{{{\text{pm}}}}\) represents the magnetized flux magnitude.

Re-arranging (1, 2), the d- and q-axis current components are expressed in (3) and (4), respectively.

$$\frac{{{\text{d}}i_{d} }}{{{\text{d}}t}} = \frac{1}{{L_{d} }}\left( {v_{d} - R_{s} .i_{d} + \omega_{e} L_{q} i_{q} } \right)$$
(3)
$$\frac{{{\text{d}}i_{q} }}{{{\text{d}}t}} = \frac{1}{{L_{q} }}\left( {v_{q} - R_{s} .i_{q} - \omega_{e} L_{d} i_{d} - \omega_{e} \lambda_{{{\text{pm}}}} } \right)$$
(4)

According to Kim et al. (2016), the PMSM electrical torque will be defined as,

$$T_{e} = \frac{3}{2}.P\left( {\lambda_{{{\text{pm}}}} i_{q} + \left( {L_{d} - L_{q} } \right).i_{q} i_{d} } \right)$$
(5)

The electromagnetic torque is redefined as (6) for Surface-mounted permanent magnet synchronous motor (SPMSM), with Ld = Lq. Then the electromagnetic torque depends only on the stator q-axis current as follows,

$$T_{e} = \frac{3}{2}.P.\lambda_{{{\text{pm}}}} .i_{q}$$
(6)

The PMSM rotor acceleration value is determined in (7):

$$\frac{{\text{d}}}{{{\text{d}}t}}\omega_{m} = \frac{1}{J}\left( {T_{e} - T_{L} - F\omega_{m} } \right)$$
(7)

In which:

\(J\): The moment of inertia of the PMSM.

\(F\): PMSM friction parameter.

\(\theta\): Rotor angular position.

\(T_{m}\): Shaft torque value.

\(\omega_{m}\): PMSM rotor mechanical speed.

2.2 PMSM Velocity Control Using FOC Approach

By separating the torque and magnetization functions in PMSM motors, the FOC technique permits to control of the torque-generating components of the stator flux independently, which leads to the widespread use of FOC in various motor-drive applications, including the application of high-efficiency motors (Adeoye et al. 2019). The FOC control plant comprises an outer velocity loop, two current loops (internal loop), and a space vector pulse width modulation (SVPWM) inverter. In this system, the loops all use traditional PI control.

The SVPWM-controlled voltage source inverters (VSI) fed PMSM are widely used in numerous industrial applications. The SVPWM is a more sophisticated technique for generating a fundamental sine wave that provides a higher voltage to the PMSM. The main advantage of the SVPWM technique is that the switching losses are low, low output harmonic distortions compared with the conventional sinusoidal PWM (SPWM) (Boussak and Jarray 2006; Khlaief et al. 2014).

The PMSM control method based on flux direction belongs to the vector control group, first proposed in 1970 by F. Blaschke when applied to induction motor IM control. A few years later, this new FOC control method was perfectly completed and presented in Pyrhönen et al. (2016). The schematic diagram of the FOC is shown in Fig. 1.

Fig. 1
figure 1

Principle of PMSM motor control by FOC method

3 Proposed Advanced Optimal Fuzzy PI PMSM Speed Controller

3.1 Fundamentals of PI-FOC Control

PI control represents a classical controller with two adjustment coefficients, scale factor (Kp) and integral factor (Ki). The primary controller input is the difference between the reference value r(t) and the actual output value y(t) of the controlled object. The input/output relation of the PI scheme is described as the following:

$$u(t) = K_{P} .e(t) + K_{I} \int {e(t){\text{d}}t}$$
(8)

The error e(t) is defined as:

$$e(t) = r(t) - y(t)$$
(9)

For the controlled object to have a better static and dynamic response, it is necessary to adjust the Kp and Ki parameters in the PI controller. The PI control model is shown in Fig. 2:

Fig. 2
figure 2

Block diagram of PI controller model

3.1.1 Proportional component (K p)

Control and reduce deviations by regulating the plant to the desired bias. The Kp plays the role of speeding up the plant convergence. The bigger this coefficient is, the quicker the plant convergence becomes. In this case, the plant shows easy to be over-shoot. Otherwise, if the proportional Kp seems tiny, the plant tuning accuracy is dramatically reduced, the system responding duration is more extended, and the dynamic system behavior is worse.

3.1.2 Integral component (K i)

This component is applied to remove steady-state errors and ameliorate the transient erroneous level of the plant. The unchanged integrated duration calculates the power of the integral bond. It is important to note that if Ki is chosen too big, the system stability will be strongly affected.

It is necessary to note that the PI coefficient configuration plays a decisive role in PI control. The fact is that the classical PI coefficients keep unchanged values. Then these coefficients cannot account for the trade-off of PMSM dynamic and static requirements regarding noise reduction.

3.2 The PMSM Velocity Control Using Advanced Optimal Fuzzy PI Controller

Due to the disadvantage of traditional PI control, it is impossible to modify the PI parameters during the working process, but fuzzy control can improve the control system's performance. This paper sets e (speed error) and ec (error rate) as input parameters. A fuzzy control diagram is shown in Fig. 3. After replacing the traditional PI controller using a fuzzy-PI scheme in a velocity regulation loop, The PMSM velocity regulation principle using a fuzzy-PI scheme is illustrated in Fig. 4.

Fig. 3
figure 3

Schematics of Fuzzy PI Control

Fig. 4
figure 4

PMSM velocity regulation principle using proposed optimal Fuzzy-PI controller

The membership function of input and output is shown in Figs. 5 and 6, respectively. Tables 1 and 2, respectively, show the fuzzy rule of Kp and Ki values in the relationship between speed error and input PMSM speed error variation.

Fig. 5
figure 5

Optimum input Membership function

Fig. 6
figure 6

Optimum output Membership function MF

Table 1 Fuzzy rule base of Kp
Table 2 Fuzzy rule base of Ki

4 Proposed Modified Jaya Algorithm (MJA)

4.1 Classical Jaya Optimization Algorithm (JOA)

The JOA, first introduced by Venkata Rao (2016), belongs to the global search-based swarm algorithm. This method develops the notion of focusing on searching for the optimum global result instead of local ones. Moreover, the algorithm is too easy to implement because it requires only population parameters, including the number of particles and generations.

Suppose that the goal is to find individuals with \(n\) variables that satisfy some definite fitness function minimum. Let \({\text{NP}}\) represents the number of individuals in a population. The following steps are suggested to implement the JOA algorithm:

Step 1: Randomly generate a population of candidates. Create an \(X_{G}\) matrix of size \({\text{NP}}\, \times \,n\). XG is called the population of the Gth iteration in the JOA algorithm. The \(X_{G}\) matrix has the representation as in (10). At this time, the sub-matrix \(X_{i,j,G} = [x_{i,1} ,x_{i,2} ,...,x_{i,n} ]\) in the matrix is defined as the i-th individual of the population at the Gth loop. In order to ensure that the values of each element in the individual are within the bounds of the search space, the parts The elements of the initial population are randomly generated according to (11) with \(x_{j}^{L}\) and \(x_{j}^{U}\) being the lower and upper bounds of the j-th element (\(j = 1,2, \ldots ,n\)).

$$X_{G} = \left[ {\begin{array}{*{20}c} {x_{1,1} } & {x_{1,2} } & \cdots & {x_{1,n} } \\ {x_{2,1} } & {x_{2,2} } & \cdots & {x_{2,n} } \\ \vdots & \vdots & \ddots & \vdots \\ {x_{{{\text{NP}},1}} } & {x_{{{\text{NP}},2}} } & \cdots & {x_{{{\text{NP}},n}} } \\ \end{array} } \right]$$
(10)
$$x_{i,j} = x_{j}^{L} + {\text{rand}}\;[0,1].\left( {x_{j}^{U} - x_{j}^{L} } \right)$$
(11)

Step 2: Calculate the objective function of each individual. Let the objective function value of the instance \(X_{i,j,G}\) be \(F(X_{i,j,G} )\). Perform NP calculation of the value \(F(X_{i,j,G} )\) corresponding to the individual \(X_{i,j,G}\).

Step 3: Identify instances \(X_{{{\text{best}},G}}\) and \(X_{{{\text{worst}},G}}\). To find the individual whose objective function is minimal, among the obtained values of F(Xi,j,G), choose the individual with the minimum value of F(Xi,j,G) as the best value and denote this instance as \(X_{{{\text{best}},G}}\). Similarly, choose the instance with the maximum value of \(F(X_{i,j,G} )\) as the worst value and denote this instance as \(X_{{{\text{worst}},G}}\).

Step 4: Create mutant populations. A \(Y_{G}\) matrix of the same size as the \(X_{G}\) matrix is generated and is called a mutant population. Each element of this matrix is identified by (12) and and \(x_{{{\text{worst}},j,G}}\) are the value of the jth element of instances \(X_{{{\text{best}},G}}\) and \(X_{{{\text{worst}},G}}\). The \(+ {\text{rand}}\;[0,1].\left( {x_{{{\text{best}},j,G}} - \left| {x_{i,j} } \right|} \right)\) operator allows the mutant to advance to the predictive search area that is better for the best individual in the population. In contrast, the \(\, - {\text{rand}}\;[0,1].\left( {x_{{{\text{worst}},j,G}} - \left| {x_{i,j} } \right|} \right)\) operator allows the mutant to move further away from the predictive search range as it moves towards the worst individual in the population.

$$\begin{aligned} y_{i,j} = & x_{i,j} + {\text{rand}}\;[0,1].\left( {x_{{{\text{best}},j,G}} - \left| {x_{i,j} } \right|} \right) \\ & \;\; - {\text{rand}}\;[0,1].\left( {x_{{{\text{worst}},j,G}} - \left| {x_{i,j} } \right|} \right) \\ \end{aligned}$$
(12)

In order to ensure that the obtained values of the elements in the \(Y_{G}\) matrix are in the predefined search space, the correction operation for values outside the search area is applied, as shown in (13).

$$y_{i,j} = \left\{ {\begin{array}{*{20}c} {x_{j}^{L} + \left| {x_{j}^{L} - y_{i,j} } \right|} & {{\text{if}}\,x_{j}^{L} > y_{i,j} } \\ {x_{j}^{U} - \left| {x_{j}^{U} - y_{i,j} } \right|} & {{\text{if}}\,x_{j}^{U} < y_{i,j} } \\ {y_{i,j} } & {{\text{otherwise}}} \\ \end{array} } \right.$$
(13)

Step 5: Calculate the objective function of each individual in the mutant population. Let the objective function value of the instance \(Y_{i,j,G}\) be \(F(Y_{i,j,G} )\). Perform NP calculation of the value \(F(Y_{i,j,G} )\) corresponding to the NP individual \(Y_{i,j,G}\) respectively.

Step 6: Select new populations. The new population is selected based on the selection of the best individuals of each position, respectively, between the Gth and Gth mutant populations. The selection principle is presented as a conditional Eq. (14).

$$X_{i,G + 1} = \left\{ \begin{array}{ll} Y_{i,j,G} &{\text{if}}\quad\;F\left( {Y_{i,j,G} } \right) <F\left( {X_{i,j,G} } \right) \hfill \\ X_{i,j,G}&{\text{otherwise}} \hfill \\ \end{array} \right.$$
(14)

Step 7: Check that the termination criterion is satisfied. The program is stopped if the given maximum number of iterations is reached or the best value is found that satisfies the specified optimum. After this step, if the conditions are met, the program will update the data and terminate the program. Otherwise, it goes to the next iteration by repeating steps 3 to 6.

The JOA algorithm flowchart is shown in Fig. 7.

Fig. 7
figure 7

Flowchart of Jaya optimization algorithm (JOA)

4.2 Proposed Modified JOA (MJA)

An essential advantage of JOA is that the algorithm contains no correction factors, as shown in (12). That means that JOA does not need to define optimal parameters for all objective functions. As a result, the algorithm has maximum simplicity in application. However, the failure to distinguish between the best and worst instance of movement makes the algorithm may not converge. MJA is proposed to improve convergence when correcting the movement direction of mutants by providing additional algorithm parameters.

Computationally, the mutant is defined by Eq. (15) instead of Eq. (12) as in JOA. In which parameters C1 and C2 are selected appropriately for different optimization problems.

$$\begin{aligned} y_{i,j} = & x_{i,j} + C_{1} .{\text{rand}}\;[0,1].\left( {x_{{{\text{best}},j,G}} - \left| {x_{i,j} } \right|} \right) \\ & \; - C_{2} .{\text{rand}}\;[0,1].\left( {x_{{{\text{worst}},j,G}} - \left| {x_{i,j} } \right|} \right) \\ \end{aligned}$$
(15)

4.3 Implementation of Objective Function in FCP Optimization

An FC always consists of fuzzification, fuzzy rules, an inference engine and defuzzification stages. Fuzzy rules and inference engine are two components that show the correlation between input and output based on the expert experience of control objects. The fuzzification and defuzzification components play an important role because they are the conversion protocol between the fuzzy computing environment and the non-fuzzy environment. The problem of determining the gain coefficients of the fuzzification and defuzzification components is mainly done by trial and error method according to expert experience. Correcting the gain parameters (called FCP) by trial and error makes determining these parameters time-consuming and often falls into local optimum extremes with low efficiency.

To help improve the efficiency of optimal FCP searching task, MJA is applied. In the Fuzzy PI-based PMSM speed control method, the MJA is responsible for determining the \([k_{e} ,k_{de} ,k_{0p} ,k_{0i} ]\) values in the Fuzzy PI controller, as shown in Fig. 3. Thus, each individual will have four elements.

The ITAE index is the objective function in the FCP optimization problem of the Fuzzy PI controller. Intending to improve the PMSM speed response to the reference speed, the best instance is the one that minimizes the ITAE index. As suggested in Reda et al. (2018); Du et al. 2018; Hadi and Ibraheem Apr. 2021), the mathematical equation used to determine the ITAE index is shown in (16).

$${\text{ITAE}} = \int_{0}^{\infty } {t\left| {e(t)} \right|{\text{d}}t}$$
(16)

5 Optimizing the Fuzzy Controller Parameters (FCP)

5.1 Building a PMSM Speed Control Model

The FCP is optimized by the offline optimization method. A simulation model on Matlab software was built as to implement this method. There are three main blocks in the PMSM speed controller model: the control block, the inverter block and the PMSM block, as shown in Fig. 8.

Fig. 8
figure 8

PMSM speed control simulation using optimal Fuzzy-PI speed controller

Table 3 shows the PMSM parameters used in the simulation. This is the parameter of the MSMA082A1B; the Panasonic manufacturer provides this parameter. This PMSM has a built-in 2500 ppr (Pulses per Round) encoder to achieve an accurate speed measurement.

Table 3 PMSM coefficients

5.2 Optimal Results of FCP Values Based on MJA Used in PMSM Speed Control

The MJA-based FCP determination program is executed multiple times to evaluate convergence. The parameters of the MJA program in FCP optimization are listed in Table 4.

Table 4 Parameter values of MJA

The result of the best objective function value through iterations of different executions is shown in Fig. 9. The resulting zoom range after 45 iterations in Fig. 9 shows that the algorithm has ensured the ability to converge when the results obtained are close to the same of the iterations (see Table 5).

Fig. 9
figure 9

Convergence process of the objective function using the Modified Jaya Algorithm (MJA)

Table 5 Optimal FCP results using MJA

5.3 Simulation Results of PMSM Speed Control Using the Optimal Fuzzy PI

The simulation results of PMSM speed control are shown in the figures below. In these figures, the symbol "PI" indicates the speed control method based on the traditional PI speed controller. The symbol "Fuzzy PI" indicates the speed control method based on the Fuzzy PI speed controller suggested in Ünsal and Aliskan Apr. (2022). The symbol "Optimal Fuzzy PI" indicates the speed control method based on the Fuzzy PI speed controller through which the FCP parameters are optimally identified by MJA.

The results of PMSM motor speed response with different speed control methods are shown in Fig. 10. It was found that both methods were effective in tracking the desired reference speed in a steady state. When falling into the transient state, when the load torque or reference speed changes, the speed control method using the Fuzzy PI controller will respond better than the PI controller-based speed control method.

Fig.10
figure 10

Speed response of PMSM motor under different working conditions

Fig. 11 shows the motor speed response results when the operating conditions change. Fig. 11a shows the PMSM motor speed response results as the reference speed increases. The overshoot when the reference speed increases of PI, Fuzzy PI, and Optimal Fuzzy PI control methods is 3.8, 1.8, and 0.8 rad/s, respectively. After overshooting the PI, Fuzzy PI, and Optimal Fuzzy PI methods, the time to steady state is 0.05, 0.11, and 0.15 s, respectively. Thus, the data shows that optimizing the FCP parameter improves the PMSM speed control efficiency rather than the trial-and-error method for the Fuzzy PI controller and the traditional PI set. Similarly, Fig. 11b shows the PMSM motor speed response results as the reference speed increases. Overshoot and time to steady state after overshoot in Fig. 11b show the effectiveness of the proposed Optimal Fuzzy PI control method compared with two control methods, PI and Fuzzy PI, used as a comparison.

Fig.11
figure 11

Speed response (zooming) of PMSM motor under different working conditions

Fig. 11c, d show the PMSM speed when the load torque changes. Based on the obtained results, it is found that the Fuzzy PI controller gives better tracking results than the control method using the traditional PI controller. In addition, the speed response result of the Optimal Fuzzy PI control method is also better than that of the Fuzzy PI control method.

The performance measures of the control methods are shown in Table 6. The ITAE values of Optimal Fuzzy PI, Fuzzy PI, and standard PI are 1.327, 3.317, and 4.172, respectively. It can be commented that the speed control quality of the proposed method is better than that of the Fuzzy PI, and both methods of applying the Fuzzy PI controller give much better results than the Traditional PI controller. The IAE and ISE standards also produce similar figures in Table 6.

Table 6 Comparative performance measures in the varied reference PMSM speed mode

In addition to the ITAE index, the IAE and ISE indexes are also used to evaluate the obtained speed control results comprehensively. As suggested in Reda et al. (2018); Du et al. 2018; Hadi and Ibraheem Apr. 2021), the equation used to determine the IAE and ISE indexes is shown in (17) and (18), respectively.

$${\text{IAE}} = \int_{0}^{\infty } {\left| {e(t)} \right|{\text{d}}t}$$
(17)
$${\text{ISE}} = \int_{0}^{\infty } {e^{2} (t){\text{d}}t}$$
(18)

6 Experimental Results on the PMSM Drive Model

6.1 Introduction of Experimental Model

The principle of PMSM velocity control based on an advanced Fuzzy PI controller implemented on the Texas Instruments TMS320F28379D microcontroller is shown in Fig. 12. The signals input to the controller include: (1) signals current signal from the current sensor, (2) the rotor angular position signal from the encoder mounted coaxially with the PMSM rotor shaft, and (3) the reference speed of the PMSM. Based on the input data, the MCU outputs pulse data that controls the six transistors of the voltage source inverter (VSI). The microcontroller has a carrier frequency of PWM, which is 10 kHz, and the signal sampling period of the sensors is ten kbps.

Fig.12
figure 12

The PMSM speed control principle based on the proposed advanced Fuzzy PI controller

The load of the PMSM experimental model is a permanent magnet synchronous generator (PMSG) with the same parameters as the PMSM motor used for control experiments. A resistor connected to the output of the stator windings in the PMSG is proposed, as shown in Fig. 13, to change the load torque during PMSM speed control. With the switches K1, K2 and K3 in series, in which K1, K2connected in parallel with resistors R1 and R2, respectively. The motor load torque will increase with pure resistors as the number of resistors connected in series is reduced (decreased equivalent resistance at the generator output).

Fig.13
figure 13

The flexible load structure of PMSM driving system

The PMSM speed control program based on the Fuzzy PI controller is shown in Fig. 14. This figure shows the corresponding blocks included in the schematic diagram in Fig. 12. Fig. 15 shows the results of building an experimental setup according to the suggestions above. Based on this model, the speed control results with different algorithms are executed and recorded via data communication with the computer.

Fig.14
figure 14

PMSM speed control program based on Fuzzy PI implemented on TMS320F28379D MCU

Fig.15
figure 15

Experiment model of PMSM speed control

6.2 Experimental Results of PMSM Speed Control Based on Fuzzy PI Controller

In this paper, the comparative PMSM speed control experiment results between the proposed Optimal Fuzzy PI control method with other Fuzzy PI (Ünsal and Aliskan 2022), and traditional PI control method (Lakhe et al. 2021) will be fully tested. The optimal parameters of the PI controller in the current control loop and speed control loop of the above control methods are set as shown in Table 7.

Table 7 Optimal parameter of control loops

After the execution, the speed, current, and voltage results obtained from the PMSM motor are recorded by the MCU and transferred to the PC via IPC communication.

The PMSM rate response results when operating conditions change are shown in Fig. 16. Generally, when the reference speed or load torque changes the PMSM speed after the transient will stabilize at the selected reference speed. However, as the load torque increases, the motor speed fluctuates accordingly.

Fig.16
figure 16

Experimental Speed response of PMSM motor under different working conditions

Experiment with changes in load torque and reference speed during operation. The results are shown in the figures below. At t = 35 s, the motor speed is raised from 150 to 500 rpm, and the resulting response to speed overshoot when the reference speed changes of the control methods are shown in Fig. 17a. By filtering out speed measurement noise, the Over-speed results of the control methods PI, Fuzzy PI, and Optimal Fuzzy PI are 15 rad/s, five rad/s, and three rad/s, respectively. The time from overshoot until the PMSM speed stabilizes at the reference speed of PI, Fuzzy PI, and Optimal Fuzzy PI control methods are 6, 4, and 2 s, respectively. The results show that the tracking efficiency of the proposed "Optimal Fuzzy PI" control method is better than that of the PI and Fuzzy PI. Fig. 17b shows the PMSM rate response when the reference rate drops. Heavy loads lead to large speed fluctuations. The results show that the control method "Optimal Fuzzy PI" is less volatile and stable faster than the two other control methods.

Fig.17
figure 17

Zoom out of experimental speed response of PMSM motor under different working conditions

Figures 17c, d show the PMSM speed response when the load torque changes abruptly. The results in Fig. 17c show that the Optimal Fuzzy PI control method takes 0.3 s to regain the reference speed when the load is increased, while the two Fuzzy PI and PI control methods must take 1.5 s to stabilize at the reference speed. The same result is shown in Fig. 17d when the load torque is reduced.

Performance measures of the control method methods are shown in Table 8. The ITAE values of Optimal Fuzzy PI, Fuzzy-PI, and PI are 1179, 1266, and 1321, respectively. It can be commented that the speed control quality of the Optimal Fuzzy PI is better than that of the Fuzzy-PI method, and both methods of applying the Fuzzy PI controller give much better results than the traditional PI controller. The IAE and ISE standard indices also produce similar results.

Table 8 Comparative performance measures in the PMSM speed control experiment

The resulting d-axis and q-axis currents of the stator are shown in Fig. 18. The current of the proposed control method has less undulation in a steady state and changes rapidly with speed or load torque change. The result shows the Fuzzy control algorithm's high efficiency when responding quickly during transients and maintaining stability during setup.

Fig.18
figure 18

Stator current when the working condition changes

The q-axis voltage supplied to the stator windings during speed control when the operating conditions change is shown in Fig. 19. The voltage at the steady state of the control methods is the same. The voltage at the transient region is different with and without applying the Fuzzy controller in the speed control loop. The difference shows that the traditional PI controller must sacrifice efficiency in the transient state to stabilize during the steady state.

Fig.19
figure 19

The q-axis voltage supplied to the stator when the working condition changes

7 Conclusions

This paper proposes a method of PMSM speed control using the new advanced Fuzzy PI control by applying the Fuzzy PI controller in combination with determining the FCP values of this controller by the MJA. The speed control results are verified experimentally on the experiment test setup. When applying a Fuzzy PI controller, the experiment test results show that the proposed control method has a faster and more stable response to variable load torque and/or variable reference speed than the Fuzzy PI and conventional PI-FOC control methods. The ITAE, IAE, and ISE indices have proved that the proposed Optimal Fuzzy PI control method obtains quite better performance than the Fuzzy PI and Conventional PI control methods used for comparison. This paper has contributed a method to optimize the FCPs in the FC controller. The contribution is essential in improving the quality of PMSM speed control using intelligent control technique. The intelligent control problem in PMSM speed control still needs further studies, such as real-time optimization for control coefficients to improve control quality.