Field Oriented Control of AFPMSM for Electrical Vehicle Using Adaptive Neuro-Fuzzy Inference System (ANFIS)

 Vector control was used to improve dynamic performance of AFPMSM.  ANFIS was used to integrate the speed and torque constraints.  The approach gave great speed performance.  Results gave reduction 10% in torque ripple. Axial Flux Permanent Magnet Synchronous Motor (AFPMSM) are very attractive candidates for driving applications due to their high efficiency, high torque-to-weight ratio, high power density, small magnetic thickness, and simplicity of construction. On the other hand, AFPMSM produces undesirable torque ripple in the developed electromagnetic torque, affecting their output performance. An intelligent control method is proposed in this paper to reduce torque ripple and improve the dynamic performance of AFPMSM. The vector control, employing the Field Oriented Control (FOC) technique, was used to improve the dynamic performance of the AFPMSM. The speed and torque controllers are achieved using the decoupling method. The intelligent control was designed to improve the performance of AFPMSM obtained from PI-PSO. The Adaptive Neuro-Fuzzy Inference System (ANFIS) was used as an Intelligent controller to integrate both the speed and torque constraints in a single training procedure. Training data for ANFIS was obtained from PI-PSO with a multiobjective cost function that includes the torque ripple and speed response criteria . The approach gave great results in terms of speed performance in different operating conditions and in tracking the required speed in load and no-load. In addition, the torque ripple was reduced by 10.04% and 46.67% compared with PI-PSO and Multi-objective cost function of speed, respectively. A R T I C L E I N F O Handling editor: Ivan A. Hashim


Introduction
Most of the energy worldwide is consumed for transportation purposes, so replacing non-renewable energy resources with more sustainable energy sources is of utmost importance. Therefore, new transportation solutions have been proposed [1]. Therefore, the best solution to protecting the environment, reducing non-renewable energy resources, and achieving high efficiency in transportation applications is electric Vehicles (EVs), which have become more attractive in recent years [2]. The main component of EVs include electric motor, inverter, drivetrain, batteries, charging, as shown in Fig. 1. The performance of electric vehicles directly depends on the choice of the electric motor used because the torque transmitted to the wheels is produced by the electric motor [3]. Motors are the primary technology for EVs that convert electrical energy into the required mechanical energy. The most popular motors utilized in EVs: DC motors, induction motors, switching reluctance, permanent magnet synchronous motors, and brushless DC motors [4].
This paper focuses on the permanent magnet synchronous motor due to its features like high efficiency, high torque/volume ratio, high pull-out torque possible, high power density, smaller size, and good heat dissipation. Depending on the direction of field flux, PMSM can be divided into two categories: The flux lines in the air gap pass along the radius, this motor is called Radial flux PMSM. The flux lines in the air gap run parallel to the system shaft. This motor is called axial flux PMSM, shown in Fig. 2.
The electrical motor under study is the Axial Flux Permanent Magnet Synchronous Motor (AFPMSM). AFPMSM are becoming more attractive in many propulsion applications due to its features, which is a serious candidate for electric vehicle applications due to its easy and compact axial installation in the wheel. Its performance matches well with the requirements of electric vehicle wheel motors, more efficiency (due to field excitation losses being eliminated). reducing rotor losses significantly), high strength, and torque density. The noise and vibration they produce are less than those of conventional motors. Their air gaps are planar and easily adjustable [5]- [6].  The main disadvantage of PMSMs is non-uniformity in the torque developed (torque ripple). These torque pulses vary periodically according to the position of the rotor, and torque ripples are reflected as a speed ripple. This ripple can lead to a problem with the drive system, vibration, and noise. There are many different techniques used to reduce the torque ripple value. The first class is the perfect motor design, and the second class is the control concept to generate suitable control voltage to reduce torque ripple [8].
The motor control method is very important in the drive system. Therefore, electric motor control methods can be classified into major sections: scalar and vector control based on their control quantities. The scalar control algorithm controls only magnitudes, as the relationship among current or voltage and frequency remains constant across the speed range of the motor. So, it is the easiest way to control a PMSM [9]. To achieve higher dynamic performance and higher efficiency, vector control is shown better solution than scalar control. The Vector Control (VC) techniques control both the magnitude and flux angle. The VC strategies for PMSM are divided into two types: direct torque control and field-oriented control. Field Oriented Control (FOC) is the first technology in which the speed and torque are directly controlled by separating the stator current components (torque and magnetizing flux). The FOC technology is characterized by its ability to work with applications of high-performance motors that can run smoothly over a range of speeds, produce full torque at zero speed, and be capable of rapid acceleration and deceleration [10]. The successful implementation of a field-oriented (FOC) depended on the speed and current controllers necessary to keep the system running in steady-state to meet the motor requirement. In [11], present speed control based on ANFIS-DTC for the PMSM to drive centrifugal pump. In [12], the present PMSM system applies in electrical automation based on ANFIS. In [13], present the speed sensor-less FOC of PMSM fed by a space vector pulse width modulation. The characteristics of the PMSM are considered by a Model Reference Adaptive System (MRAS) and ANFIS. Verma e al. [14] presented the design and simulation of a modern approach to PMSM speed control using an ANFIS-based speed controller only. The results show that the ANFIS based speed controller produces a better speed response than the conventional Z-Ntuned PID speed controller.
This work proposed the AFPMSM based on FOC with ANFIS controller by decoupling control circuit under different loads and speeds conditions using three controllers (one for speed and two for current). The previous studies are controlling either for speed or with respect to torque. In this research, speed and torque are controlled in the same controller. Types and number of Memberships of the fuzzy network are selected by using the sub-clustering method. The performance of AFPMSM is investigated under different operating conditions to control speed and torque by using three controllers (one for speed and two for current).

Axial Flux Permanent Magnet Synchronous Motor
In the recent 70s and early 80s, AFM machines were first introduced. Axial flux motors are also called disk-type motors. It is an attractive alternative to traditional motors due to its pancake shape, compact manufacturing, and high power density. AFM is particularly appropriate for electric vehicles, fans, pumps, valves, flight systems, machine tools, robots, and manufacturing equipment. In the 1990s, the study of AFPMSM increased interest, primarily because of the AFPM synchronous machine construction and high efficiency of performance suitable very well into the application of drive like the electric vehicles' wheel motors [15]- [16]. The direction of field flux in AFPMSM is parallel to the rotor's mechanical shaft, which makes AFPMSM vary from other conventional electrical motors [17]. The Axial Flux Permanent Magnet Synchronous Motor (AFPMSM) has several unique features. It is usually more efficient for permanent magnets, as field excitation losses are eliminated, which greatly reduces rotor losses. AFPMSM has a small magnetic thickness, resulting in small magnetic dimensions and higher power to weight ratio [18]. These benefits give AFPM machines advantages over conventional machines for high performance and high-efficiency applications.

Mathematical Model of AFPMSM
The AFPMSM stator winding varies from the RFPMSM stator winding. However, the conventional PMSM model for AFPMSM can be used, and the difference between these is in stator parameters, such as inductors calculation. Furthermore, the Back-EMF produced by a permanent magnet and produced by an excited coil is not different. Therefore the mathematical model is similar to the radial PMSM of the permanent Axial Flux magnet synchronous motor [19].
The stator voltage equation in the d-q reference frame is given by [17]: The flux linkage equations are given by: Since the flux of the permanent magnet rotor is distributed along the d axis, the current of the d axis rotor ( ) is a constant, and the current of the q axis rotor ( ) is believed to be zero since there is no flux of rotor along with it.
Where: , are the d-axis and q-axis stator voltages, respectively. , are the d-axis and q-axis stator resistances. , are the d-axis and q-axis stator inductance. , are the d-axis and q-axis rotor currents. , are the d-axis and q-axis stator currents.
, are the total flux in the d-direction and the q-direction. is the electrical rotor speed. is the flux linkage due to the permanent magnets.
is the inductance due to permanent magnets. The matrix from equations: ... (8) The electric torque is: Since the magnetic flux linkage is a constant, the torque is directly proportional to the q axis current. The electromagnetic torque equation is given by Where : is the load torque, 1 is the friction coefficient, J is the moment of inertia, is the rotor speed (rad/sec)

Field Oriented Control (FOC)
The vector control strategies are often generally referred to as Field-Oriented Control (FOC). The FOC is also called " decoupling control " because it splits the stator current (three phases) into two components of orthogonal current with an amplitude and aligned respectively along with the quadrature and direct axis. Flux produced by one and torque produced by another. The component is responsible for the flux, while the defines the torque. Both flux and Torque are controlled separately. The AFPMSM is thus analogous to a separately excited DC machine using FOC [20]. When applying FOC to AFPMSM, the rotor flux can be selected to be fully determined by the permanent magnet flux. This means that the component is controlled to be zero. In this way, the stator current vector is perpendicular to the flux in PM. The flux of the rotor and the current of the stator are thereby decoupled. The FOC is split into three feedback loops, position loop, speed loop, and current loop. The three loops are connected in series. The current loop is the inner loop, which directly controls the torque and excitation of the PMSM [21]- [22]. The maximum torque is achieved with a given stator current value when one is fully directed along the q axis, that is, when = 0 and = . In this case, classic FOC is performed [23]. The direct axis component is also based on and the component of the quadratic axis is dependent on . The stator-voltage components and could not be regarded as separate control variables for the rotor flux and electromagnetic torque. Only if the stator voltage equations are separated will the stator currents and be controlled separately so that these stator current components are indirectly controlled via controlling the synchronous motor terminal voltages. The stator voltages equations ( and equations ) can be modified and decoupled into two components: linear and decoupling components [24].
The equations are decoupled as follows: The linear components are defined: The decoupling components are defined:

Adaptive Neuro-Fuzzy Inference System (ANFIS)
Hang introduced the concept of ANFIS in 1993, which integrates both the NN and FLC. The benefits of both controls can be accomplished in single application controls. An ANFIS is a fuzzy system that uses the concept of an Artificial Neural Network (ANN) learning technique to figure out its parameters (fuzzy sets and rules) by manipulating data examples. This hybrid mixture enables the complexities of the control system to be minimized. In ANFIS, the fuzzy inference mechanism was involved through the structure and neurons of the feed forward adaptive NN [25]- [13]. The concept of the key investigation is to utilize ANFIS to enhance the efficiency of the system and improve the controller design process. The system's design with the ANFIS controller does not require details about the internal loops, such as its controller parameters, its feedback coefficients, etc., unlike designing a system with a PI location controller, which requires the knowledge of specific details about the object [26].
The ANFIS algorithm build has five layers. Each layer contains the node using Sugeno fuzzy models. ANFIS comprises five layers, so each layer's nodes are linked by directed connections to another layer. Each node conducts a certain procedure on its incoming signals to produce a single node output. ANFIS's key goal is to evaluate the optimal values of the equivalent fuzzy inference system parameters by applying a learning algorithm. Two kinds of nodes are named adaptive and fixed nodes (square and circle symbols). The complete ANFIS architecture is shown in Figure (4). A concise overview of the five layers of the ANFIS algorithm are explained below: Two fuzzy if-then rules are taken into account for the two inputs x, y, and f output: Rule 1: if x is 1 and y is 1 then f = 1 + 1 + 1 Rule 2: if x is 2 and y is 2 then f = 2 + 2 + 2 1 , 2 , 1 , 2 are non-linear parameters and and are fuzzy membership functions. Whereas 1 , 1 , 2 , 2 and 1 , 2 are linear parameters that are the design parameters identified during the training process [27].

Simulation and results
Three controllers are utilized Adaptive Neuro-Fuzzy Inference System (ANFIS). The Sugeno fuzzy is used in the ANFIS system in this paper, where the final fuzzy inference method is optimized through the training of ANNs. Furthermore, the network is trained with a subtractive clustering algorithm, where Clustering of Data is a way of placing similar data in groups. The clustering algorithm divides the data set into several groups so that the similarity within the group is greater than between the groups. Subtractive clustering in AFINS is widely used to group and categorize data and construct models and compression of data. The overall system Simulink model of AFPMSM drive is shown in Figure (5).
Steps for ANFIS controller Training: Start MATLAB program and in the command window type the command (anfisedit), then press Enter, a new window will appear as shown in Figure (7). The data saved in the workspace of the controller in Section (4.4.1.4) are downloaded for training and simulation, then creating the shape and numbers of membership automatically by pressing the option (subclustering). The training process is run by using the following parameter: Range of influence = 0.2, Squash factor = 1.25, Accept ratio = 0.1, Reject ratio = 0.05. Pressing the button (Generate FIS), the training will start after entering into errors tolerance and epochs. Once the training is over, close the editor window and save the results obtained. This result is downloaded into the fuzzy logic console block, as shown in Figure (6). The structure of ANFIS system structure can be obtained from the press on the "structure" button shown in Figure (7), and this structure includes input and output functions and base functions, as shown in Figure (8) The rules and surface structure for speed controller are obtained by subtractive clustering can be obtained by type anfisedit in the command window and press to file, import, from file and choose the file to be trained, as shown in Figure (9).
The ANFIS done by using block consists of two inputs; error and integral of error, as shown in Figure (6).   The performance of the FOC of AFPMSM is investigated with the ANFIS controller under different operating conditions as follows: The system performance for different steps input is shown in Figure (10). The simulation results are given at variable speed, and the torque load at initial was No-load torque, and the load is applied after 1sec Figure (10 -b) shows the torque response, the input load torque at initial is no load, and the load torque (10N.m) is applied to the motor after 1sec. The average starting torque at 500rpm is approximately 45.3N.m. And after a steady-state, the motor torque ripple was approximately (15.576%), and at 250 rpm, the torque ripple (14.861%). And in figure (10-c) shows the response, which has identical performance to motor torque. The average of starting current 164Amp at 500rpm and current ripple 20%. Figure (10) s and provess the precise of the FOC technique the investigation of the direct and the quadrant stator currentswiths respect to speed and torque variation.
Also, motor performance in the accelerating and decelerating ramp response in four-quadrant modes is depicted in Figure  (11). The use parameters values of AFPMSM are illustrated in Table (1) Finally, a comparative investigation between PI-PSO, PI-PSO with multi-objective cost function of speed, PI-PSO with multi-objective cost function of speed and torque.

PI-PSO controller
The optimization process is run by using the following parameters: 1 = 2 = 1.3, W = 0.9, number of iterations = 100, and number of birds = 50.
The obtained parameters of the three PI controllers are illustrated in Table (2) in case PI-PSO.
Where, 1 , 2 , and 3 are the weighting coefficients, the max overshoot , rise time ( ) and is the integral-time square error.
The optimization process is run by using the following parameters: 1 = 2 = 1.3, W= 0.9, number of iterations =100, number of bird =50 The obtained parameters of the three PI controllers are illustrated in Table (3), in the case of PI-PSO with multi multiobjective speed function.

The multi-objective Cost function of the PI-PSO to enhance speed and torque
Multi-Objective cost function including the torque ripple criteria as well as speed response criteria, in a single fitness function as in equation : FF = α * + RF *β (21) α and β are the importance weight of the speed error and torque ripple, respectively and is the integral-time square error between the actual and desired speed The optimization process is run by using the following parameters: 1 = 2 = 1.3, W=0.9, number of iterations =50 , number of bird 10.
The obtained parameters of the three PI controllers are illustrated in Table ( 4). In case PI-PSO with the multi-objective function of torque and speed.
Speed response of AFPMSM are presented at different load s, no-load at starting and after 1sec the load is applied (10N.m), is illustrated in Figure (13). Also, table 5 records the performance constraints of the four methods.    To improve the dynamic performance of AFPMSM during different loads and speed conditions, integrating both Artificial Neural Network and fuzzy logic controller. This hybrid mixture enables the complexities of the control system to be minimized, enhances the system's efficiency, improves the controller design process, and overcomes the problem of AFPMSM nonlinearity. In this paper, the training process depends on the results of the multi-objective cost function of torque improving for the intelligent controller that combines both speed and torque good for all operating conditions. The system was tested under various operating conditions: step response, ramp response (acceleration and deceleration speed and no-load. full-load to obtain operation in four quadrants), and the stator inductance was varied. Depend on the result in Table ( 5). The ANFIS results are close to the result of MOCF of speed for criteria of speed and better than in the criteria of torque, in which torque ripple reduces by 46.67%. When compared with MOCF of speed and torque, the ANFIS results are better than in the criteria of speed, in which the constraint reduced by 39.7% and 64.28% for settling time and steady-state error, respectively. Therefore, ANFIS has integrated both methods of MOCF. In the ANFIS method, torque ripple is significantly reduced while maintaining better speed performance. The ANFIS method shows effective speed performance in different operating conditions and in tracking the required speed with load and no-load and reducing torque ripple compared with the PI-PSO controllers based on Multi-objective optimization for both speed and Torque-speed constraints.

Author contribution
All authors contributed equally to this work.

Funding
This research received no specific grant from any funding agency in the public, commercial, or not-for-profit sectors.

Data availability statement
The data that support the findings of this study are available on request from the corresponding author.

Conflicts of interest
The authors declare that there is no conflict of interest.