Bulletin of Electrical Engineering and Informatics

Received Mar 15, 2022 Revised May 29, 2022 Accepted Jun 14, 2022 Permanent magnet synchronous motor (PMSM) speed control is generally done using flux-oriented control, which uses conventional proportionalintegral (PI) current regulators, but still remain the problem of calculating the coefficients of these regulators, particularly in the case of control hybridization, the development of artificial intelligence has simplified many calculations while giving more accurate, and improved results, this paper presents and compares the performance of the flux oriented control (FOC) of a PMSM powered by pulse width modulation (PWM) using PI regulator, fuzzy logic control (FLC) and adaptive neuro-fuzzy inference system (ANFIS), in this work we present another approach of a neuro ANFIS using the hybrid combination of fuzzy logic and neural networks. This ANFIS is a very powerful tool and can be applied to various engineering problems. To make up for the deficiency of fuzzy logic controller. To understand the performance, characteristics, and influence of each controller on the system response, we use MATLAB/Simulink to model a PMSM (0.5 kW) powered by a three-phase inverter and controlled by the FOC, FOC-FLC, and FOCANFIS.


INTRODUCTION
Proportional integral derivative (PID) controllers meet more than 90% of industrial needs and the number of controllers installed in industries and vehicles.Unfortunately, despite the experience gained over the years, the values are chosen for the parameters P, I, and D are not always satisfactory, nor adapted to the process to be regulated, especially in the case of the hybridization of commands [1].At the beginning of the 1990s and to provide simple but more efficient adjustment rules than those of Ziegler-Nichols [2], Åström and his collaborators analyzed the dynamic behavior of a large number of processes.This analysis led to the establishment of tables used to calculate the parameters P, I, and D from simple measurements [3]- [7].
Because of its simple structures, high efficiency, low inertia and high power density, permanent magnet synchronous motor (PMSM) is implemented as variable speed drives in automotive and aircraft industries [4].The non-linear coupling between its winding current and the rotor speed [5] complicates motorization design.The principle of the vector control for the PMSM, is to make a decoupling between the different state variables to make the system linear, and requires several PI-type regulators in the decoupling phase, the classic regulators PI always give better results for a speed adjustment but the major disadvantage of its regulators remain the sensitivity for the changes of the parameters of the machine [6].

1893
The principle of a PI regulator is to provide a control signal u(t) taking into account the evolution of the output signal y(t) for the setpoint w(t) [8] and eliminates the static error using the integrator term [1].In the literature, [9]- [12] one can find many different approaches related the tuning of PI controllers including the tuning rules in [8] and the manual tuning method explained in [13].Fuzzy logic was proposed and introduced by Zadeh [14] to model natural language and to account for the vagueness of the knowledge that we humans manipulate daily through the notion of fuzzy sets or fuzzy subsets; thus, generalizing the algebra of classical set theory.Arriving on the industrial market in the mid-1980s, artificial neural networks have greatly benefited from the computing capacities offered by modern computers.Development environments have emerged, allowing engineers to develop full-scale applications [15].
An adaptive neuro-fuzzy inference system or adaptive network-based fuzzy inference system (ANFIS) is a kind of artificial neural network that is based on Takagi-Sugeno fuzzy inference system.The technique was developed in the early 1990s [16].Since it integrates both neural networks and fuzzy logic principles, it has potential to capture the benefits of both in a single framework.Its inference system corresponds to a set of fuzzy IF-THEN rules that have learning capability to approximate nonlinear functions [17], [18].Hence, ANFIS is considered to be a universal estimator.In the literature, one can find many different approaches related to the control of PMSM speed; some of the techniques offered include fuzzy control, neural networks, and genetic algorithms, but note the absence of ANFIS in these works despite the importance the simplicity and the improvement in the response of the PMSM especially in the field of electric vehicles.
To overcome such problems, there have been considerable research efforts to integrate fuzzy logic control (FLC) and artificial neural networks (ANNs) for developing what is known as adaptative neuro-fuzzy inference systems.The fusion of the two approaches, which can enlarge their individual strengths and overcome their drawbacks, will produce a powerful representation of flexibility and numerical processing capability.We have proposed in this article the application of a hybrid approach combining neural and fuzzy technologies called ANFIS.For the organization of this paper, we started with section 1 the modeling of PMSM and the section 2 we explain the principle of the flux oriented control-proportional-integral (FOC-PI), FOC-FLC, FOC-ANFIS used and in the last part (results and discussion) we make a comparison between the three controllers to validate the robustness of the ANFIS and optimize the error found with PI and FLC and eliminate harmonics in torque, current, and decrease response time.

METHOD 2.1. Mathematical model of PMSM
Figure 1 presents an equivalent circuit of PMSM in the d-q axis.The stator voltage equation in the d-q reference.The dq modeling approach is chosen to derive the mathematical model of the PMSM under study [17]. (1) Where: V sd , V sq : the stator voltage (d-q reference) Id, Iq: the currents in the d-q frame ω : the electrical rotor speed, λd , λq : the flux linkage Tem: the electromagnetic torque Np: the number of pole pairs Rs: the stator resistances

FOC strategy
Classical FOC control structure Figure 2 is used to achieve higher dynamic performance in PMSM control.The basic idea of FOC method is to use suitable coordinate system to realize independent torque and flux control.Where the external loop is intended for controlling the speed of the rotor, and the internal loop is  [18] the rotor flux can be controlled by the real part of the stator current Isd.By applying the corresponding coordinate transformation and forcing Iq to be zero.It is possible to conclude from ( 6) and ( 7) that the vector of current of the stator Is can be divided into two components in the rotational coordinate system and on the basis of the position of the flux of the rotors θs, the component producing the flux Isd with a constant time τ and the component producing the couple Isq [19]. ..  . (7) where: Lm: the mutual inductances Rr :the rotor resistances

FLC strategy
The fuzzy control has the same purpose as a control carried out in classic automatic, that is to say the automatic management of a process, according to a given instruction, and by action on the variables which describe the process [18].The fuzzy logic controller is an algorithm for converting a linguistic control strategy based on human expertise into an automatic control strategy described by a set of fuzzy control rules of the type.The design of the FLC goes through four main distinct stages, as shown in Figure 3

Adaptive neuro-fuzzy inference system strategy
Neural networks based on the definition of a fuzzy controller and its parts, and referring to Sugeno approach in the inference mechanism, [21] ANFIS is used as a fuzzy neural network which is equivalent to Sugeno fuzzy logic model.First-order Sugeno fuzzy model which has two input x, y, and an output z is analyzed to figure out the fuzzy inference system in ANFIS.100 rules which are commonly used in rule sets are shown in for first order Sugeno fuzzy model.The NFLC is trained to refine its parameters adaptively using the error backpropagation learning algorithm (EBP) [22], [23].
To select the network architecture, it is required to determine the numbers of inputs, outputs, hidden layers, and nodes in the hidden layers; this is usually done by trial and error [24] Therefore, one hidden layer, with six nodes, was adopted as one of the best suitable topologies for neural networks [25], [26].The ANFIS network uses, on the one hand, a fuzzy coalescence algorithm on the data set to partition the input space.It also uses a backpropagation learning algorithm to simplify conclusions and eliminate irrelevant input variables [27].Figure 4 depicts Sugeno's fuzzy model's core inference principle.Sugeno's fuzzy model has an ANFIS counterpart, which is depicted in Figure 5.The principle of the ANFIS algorithm is as shown in: in the case of 2 linguistic input variables x and y and an output f, and the rule base contains n-type rules, the ANFIS algorithm is : i) if x is A1 and y is B1 with i=1:n then Z1=p1x+q1y+r1, ii) x and y are the input variables, iii) A1, B1 fuzzy sets, iv) f: the output of all defuzzification neurons, and v) p1, q1, and r1 are parameters of the consequence of rule i determined during the learning process [28].
Figure 4.The architecture of the ANFIS strategy [29] Figure 5. Identification test bench Layer 1: contains as many neurons as there are fuzzy subsets in the inference system represented.Each neuron calculates the degree of truth of a particular fuzzy subset by its transfer function [20], [30].
Layer 3: normalizes the degree of rule activation.Each neuron in this layer is a circle neuron denoted N. The ith neuron calculates the ratio between the ith rule weights and the sum of all the rule weights.This operation is called weight normalization.
Layer 4: this layer's i the node output is a linear function of the third layer's i the node output and the ANFIS input signals.
Layer 5: is represented by a single node at which the sum of the signals coming from layer 4 is carried out [31].

FOC of the PMSM with PI controller
In this part and before studying the machine used, we used the test bench to identify the parameters of the PMSM Figure 3 [25].Figure 6 shows the simulation results of the PMSM with a voltage inverter without control.The purpose of this simulation is to validate the adopted model of the machine, and to analyze the behavior when the PMSM is powered through the voltage inverter.
The PMSM in the transient state, the speed of rotation reaches the nominal value 1,000 rpm in a response time of approximately (0.2 s).The maximum torque on starting takes peaks then stabilizes at zero because there is no load, which leads to a high current inrush.Using MATLAB/Simulink to model and simulate the performance of the proposed FOC technique with PI for PMSM and their parameters which are presented in Table 1 in the simulation the PI controller gains were set to =2.22 and =280.

FOC of the PMSM with FLC controller
In the second step we compare the three commands to have the performance of each controller FOC-FLC and FOC-ANFIS.Figure 8 present the response of the FOC-FLC controller for the PMSM, our model is simulated with a reference speed equal to 510 rpm and the torque reference fixed at 0 Nm (no load).The idea of this article is based on a simple modification with important results in the decoupling block of the FOC which generates the reference voltages Vdreg and Vqreg.With a speed regulation loop, which makes it possible to generate the current reference Iq.From the desired quantities We will adjust the stator currents by a PI regulator, with Vdreg is the voltage at the current regulator output Id and Vqreg is the voltage at the current regulator output Iq.We will replace the PI regulators with a fuzzy logic controller shows in Figure 8.The fuzzy labels in Table 2: negative big (NG), negative medium (NM), negative small (NS), zero (Z), positive small (PS), positive medium (PM), and positive big (PG) and we used membership functions of triangular type, as shown in Figure 9.
According to the Figure 10 we notice the reduction of the torque and current ripples by using the FOC-FLC with a good dynamic and static response of speed, with a transient regime faster than that of the classic FOC-PI.It follows the steady-state reference with less oscillation and the torque perfectly follows its steadystate reference.

FOC of the PMSM with ANFIS controller
We will replace the PI regulators with a ANFIS shows in Figure 11, the characteristics of ANFIS used are represented in the Table 3.When compared to previous results (conventional FOC and FOC-FLC) with FOC-ANFIS in Figure 12 show that a very fast torque response with a significant reduction in ripples makes it possible to have a speed response that is very fast and without overshoot, without any static error, and without vibration at the machine level.To confirm the simulation results, we made a comparison between the THD of the three controllers as shown in the Table 4 to show the influence of each controller and see the importance of FOC-ANFIS compared to FOC-PI and FOC-FLC.

CONCLUSION
In this work we present a comparison between different advanced approaches in the control of permanent magnet synchronous machines FOC-PI, FOC-FLC, and FOC-ANFIS according to the results obtained from the integration of FLCs and ANNs to develop control adaptive neuro-fuzzy inference system.This article presents a continuity and improvement of another work.we wasted a lot of time adjusting the coefficients of the fuzzy controller with the parameters of the PI regulator, because the fuzzy controller logic is one of the controllers does not require a precise model of the system to be controlled.With research i tested the FOC when i replaced the PI regulators with the FLC and ANFIS and we found good results as you have seen in the performance compared to the traditional FOC of PMSM which creates more ripples, from the obtained results and the THD we confirmed that the neural networks filter out the noise, this approach well suited for detecting and diagnosing faults online with stability.This point and very interesting in our application especially in the field of electric vehicles, these harmonics are leakage currents which pose major problems, especially when talking about electromagnetic compatibility in the traction chain which is one of the current problems major in electric vehicles.

Figure 3 .
Figure 3. Block diagram of fuzzy logic controller

Figure 6 . 1897 Figure 7
Figure 6.Performance of PMSM powered by an inverter

Figure 7 .
Figure 7. Simulation results of FOC-PI controller for PMSM

Figure 9 .Figure 10 .
Figure 9. Membership functions type of input and output variables

Table 2 .
Seven classes command rules table for controlling the speed

Table 3 .
Summary of ANFIS technique