Model Predictive Direct Torque Control and Fuzzy Logic Energy Management for Multi Power Source Electric Vehicles

This paper proposes a novel Fuzzy-MPDTC control applied to a fuel cell battery electric vehicle whose traction is ensured using a permanent magnet synchronous motor (PMSM). On the traction side, model predictive direct torque control (MPDTC) is used to control PMSM torque, and guarantee minimum torque and current ripples while ensuring satisfactory speed tracking. On the sources side, an energy management strategy (EMS) based on fuzzy logic is proposed, it aims to distribute power over energy sources rationally and satisfy the load power demand. To assess these techniques, a driving cycle under different operating modes, namely cruising, acceleration, idling and regenerative braking is proposed. Real-time simulation is developed using the RT LAB platform and the obtained results match those obtained in numerical simulation using MATLAB/Simulink. The results show a good performance of the whole system, where the proposed MPDTC minimized the torque and flux ripples with 54.54% and 77%, respectively, compared to the conventional DTC and reduced the THD of the PMSM current with 53.37%. Furthermore, the proposed EMS based on fuzzy logic shows good performance and keeps the battery SOC within safe limits under the proposed speed profile and international NYCC driving cycle. These aforementioned results confirm the robustness and effectiveness of the proposed control techniques.


Introduction
The use of electric vehicles (EVs) in the transportation sector has become a necessity in the last decade to deal with the energy crisis and environmental pollution problems, as they offer many advantages such as high efficiency, no carbon dioxide emissions, low maintenance, and no pollution [1]. EVs are mainly composed of fuel cells, supercapacitors, and batteries for the energy supply and storage part, as well as an electric motor for the traction part. As it is known, achieving the best performance EVs, requires an adapted EMS, to effectively regulate the flow of power between the different sources [2]. High-efficiency electric motors assisted by high-accuracy controllers are also still needed [3].
A proton exchange membrane fuel cell (PEMFC) is a promising source used to power vehicles due to its small size, low operating temperature, fast start-up, and high efficiency [4]. To overcome the drawback of slow dynamic response and to implement energy recovery, it is necessary to integrate energy storage sources, such as a supercapacitor and/or a Li-ion battery [5,6]. EMS is very important to manage energy allocation effectively, and its choice should be deeply investigated. In this context, several methods in the recent literature have been studied and evaluated, such as optimization methods, filter-based methods, controller methods, and rule-based methods. Optimization-based strategies that include Model Predictive Control [7], Grey Wolf Optimizer [8], Particle Swarm Optimization [9], etc, have been investigated in order to deal with complex management objectives (efficiency, cost, lifetime, etc). On the other hand, these strategies are complex and impose an important computation burden. Further filter-based EMSs can be found in the literature, including Low-Pass filters [10], and Wavelet Transform [11]. The filter-based management strategy aims to divide the required power into high-and low-frequency power as this strategy can improve the lifetime of the PEMFC stack. Nevertheless, the performance of the two EMSs depends strongly on the design of the filter which is a complicated task to be performed. Controller methods such as Backstepping [12], Passivity Control [13], Proportional-Integral Control [14], Sliding Control [15], etc, can obtain an exact calculation of the reference while taking into account the losses of the system. Rule-based strategies are mainly Fuzzy Logic, Artificial Neural Network [16], and State Machine [17]. Fuzzy logic-based EMS is widely used in fuel cell hybrid power systems [18][19][20][21][22]. This technique has the advantage to provide high performance and supporting imprecise system modeling. For these reasons, this technique is adopted in the current work.
Permanent magnet synchronous motors are widely considered the best type of electric motors that can be used to drive EVs. This is due primarily to their high efficiency, high power density, lightweight, and wide speed range [23]. With proper torque control, they can easily meet all of the vehicle requirements. Many torque control strategies, such as Field-Oriented Control (FOC) and Direct Torque Control (DTC), have been extensively researched in the literature [24,25]. DTC has a simple control structure and provides a fast dynamic torque response [26]. However, because it is based on hysteresis comparators, this technique has some drawbacks such as important torque, flux ripples, and variable switching frequency. Many methods have been proposed to mitigate these drawbacks. In [27], the authors proposed a strategy named Space Vector Modulation DTC (SVM-DTC) based on a constant switching frequency, and the results showed good performance. However, this strategy requires a precise design of the PI controller and system parameters. In [28], a multilevel inverter was used, which increases the number of voltage vectors. The simulation results indicated good performances by reducing torque and flux ripples. Nevertheless, issues with complexity and switching losses appeared. Fuzzy logic and artificial neural networks are also used as artificial intelligence controllers [29,30]. Authors in [31][32][33][34] have proposed a Model Predictive Direct Torque Control strategy that is based on predicting the control variables such as flux and torque while minimizing the error of the predicted control variables; this improves control accuracy while maintaining the control system's simplicity.
To cope with the aforementioned challenges and improve EV, two control strategies are proposed in this work. The first one is based on fuzzy logic, applied to the Li-ion battery-PEMFC hybrid power system. The second one is based on torque predictive control applied to the PMSM. Results obtained using Matlab/Simulink and those obtained using a RT LAB simulator have clearly shown the effectiveness of the proposed control techniques under different driving modes (cruising, acceleration, idling, and regenerative braking). In order to properly situate this work, the main contributions made through this paper are:

•
An adequate EMS strategy based on fuzzy logic control is developed to ensure vehicle propulsion power and to regulate efficiently the energy flow of the power sources. • A model predictive direct torque control strategy is proposed to control the vehicle traction machine with the objective of minimizing torque and flux ripples and ensuring satisfactory speed tracking. • A detailed physical model of the EV (the vehicle dynamics system, the electric power system, and control system) is established under Matlab/Simulink environment.
• Real-time simulation using the RT LAB platform is performed to confirm the obtained simulation results.
The results obtained using Matlab/Simulink as well as the experimental ones obtained using the RT LAB simulator are presented, and the main conclusion of this work summarizes and proves proposed strategies.

Electric Vehicle Description and Modeling
The EV general configuration is shown in Figure 1. It consists of a hydrogen tank with a flow regulator, a PEMFC stack as a primary power source, a Li-ion battery as a secondary power source, a PMSM, and a control system. The entire VE system's construction can be divided into two parts: tained using the RT LAB simulator are presented, and the main conclusion of this work summarizes and proves proposed strategies.

Electric Vehicle Description and Modeling
The EV general configuration is shown in Figure 1. It consists of a hydrogen tank with a flow regulator, a PEMFC stack as a primary power source, a Li-ion battery as a secondary power source, a PMSM, and a control system. The entire VE system's construction can be divided into two parts: On the sources side, the flow rate regulator adjusts the power of the PEMFC stack and regulates the pressure of the hydrogen flow. The PEMFC stack is connected to the DC bus voltage via a unidirectional in-current DC-DC boost converter to DC bus voltage. The excessive electricity generated by the PEMFC stack is used to charge the battery. The Liion battery is connected to the DC bus voltage via a bidirectional DC-DC buck-boost converter to recover the braking energy and supply power.
On the traction side, PMSM of 50 kW rated power, fed by a two-level inverter, converts the electric power coming from the two power sources into mechanical power.
The control system integrates the control of both traction machine and power sources.  On the sources side, the flow rate regulator adjusts the power of the PEMFC stack and regulates the pressure of the hydrogen flow. The PEMFC stack is connected to the DC bus voltage via a unidirectional in-current DC-DC boost converter to DC bus voltage. The excessive electricity generated by the PEMFC stack is used to charge the battery. The Li-ion battery is connected to the DC bus voltage via a bidirectional DC-DC buck-boost converter to recover the braking energy and supply power.
On the traction side, PMSM of 50 kW rated power, fed by a two-level inverter, converts the electric power coming from the two power sources into mechanical power.
The control system integrates the control of both traction machine and power sources.

Fuel-Cell Model
The voltage of the PEMFC stack V FC is given by [18,35]: where V FC and I FC are the voltage and current of the PEMFC stack, respectively, R is the internal resistance, E OC is the open circuit voltage, i 0 is the exchange current, N, A and T d are the cells number, the tafel slope, and the response time, respectively. E OC , i 0 and A are given by: where K C and E N are the voltage constant at nominal condition of operation and Nernst voltage respectively, z is the number of moving electrons (z = 2), F, R, k, h and T are the Faraday's constant, the ideal gas constant, the Boltzmann's constant, the Planck's constant and the temperature of operation respectively, ∆G is the activation energy barrier, and α is the charge transfer coefficient. The PEMFC stack includes hydrogen controller and oxygen controller, which regulate the flows rate of H 2 and O 2 , respectively. The utilization rates of H 2 and O 2 are calculated as: where P f uel and P air are the absolute supply pressure of fuel and absolute air, respectively, V f uel and V air are the fuel flow rate and the air flow rate, respectively, x% and y% are the percentage of H 2 in the fuel and O 2 in the oxidant, respectively. The parameters of the used PEMFC stack are given in Table 1.

Battery Model
Li-ion batteries are used in this work due to their high energy density, high efficiency, and long lifetime when compared to other battery types such as (NiCd, lead-acid, or NiMH) [36].
The Li-ion battery voltage can be calculated using two different equations [36,37].
where R, K, Q, E 0 , it, i * , A and B are the Li-ion battery internal resistance, the polarization constant, the Li-ion battery capacity, the Li-ion battery constant voltage, the actual Li-ion battery charge, the filtered Li-ion battery current, the exponential zone amplitude, and the exponential zone time constant inverse, respectively. The Li-ion battery state of charge can be determined using Equation (10).

Permanent Magnet Synchronous Motor Model
The mathematical model of PMSM in the d-q rotor reference frame can be expressed as follows in Equations (11) and (12) [23]: where the totalized flux φ sd and φ sq are given by: The electromagnetic torque expression is given by Equation (15): The PMSM mechanical equation is given by: The estimations of the torque, flux, and the load angle can be expressed by the following set of equations: Motor parameters [38] are summarized in Table 2.

Vehicle Dynamics System
The dynamic model of the electrical vehicle is depicted in Figure 2. The entire mechanical part (longitudinal vehicle dynamics, viscous friction, differential, tires, and reduction gear) of the vehicle dynamic system is modeled by Souleman Njoya Motapon and Louis-A. Dessaint [35]. The longitudinal vehicle dynamics block takes into account body mass, aerodynamic drag, and weight distribution between axles. Meanwhile, wind speed and road inclination are not considered in this model.

Energy Management Strategy
To satisfy the load power demand and to ensure an efficient power distribution of the electric vehicle power system, an appropriate EMS is required [2]. These objectives can only be met by controlling the power response of each energy source according to the load The parameters of the used vehicle [38] are given in Table 3.

Energy Management Strategy
To satisfy the load power demand and to ensure an efficient power distribution of the electric vehicle power system, an appropriate EMS is required [2]. These objectives can only be met by controlling the power response of each energy source according to the load demand. We used a fuzzy logic control-based EMS because it is flexible, efficient, and works well without exact mathematical models.

Input and Output Parameters
The inputs parameters of the fuzzy logic controller are the Li-ion battery state-ofcharge SOC and the load power (Pload) obtained by multiplying the motor speed and the required motor torque, and the output parameter is the reference power of the fuel cell, as illustrated in Figure 3. demand. We used a fuzzy logic control-based EMS because it is flexible, efficient, a works well without exact mathematical models.

Input and Output Parameters
The inputs parameters of the fuzzy logic controller are the Li-ion battery statecharge SOC and the load power (Pload) obtained by multiplying the motor speed and t required motor torque, and the output parameter is the reference power of the fuel ce as illustrated in Figure 3.
The fuzzy set for Li-ion battery SOC is divided into "Low" (L), "Medium" (M), a "High" (H). The fuzzy set for Pload is also divided into "Negative" (N), "Very Low" (V L, M, H, "Very High" (VH), indicating the power demand from low to high levels. T fuzzy set for Pfc is classified as "Zero" (ZE), VL, L, M, H, VH. The gap between (ZE) a (VL) of Pfc in Figure 4c is the fuel cell system's low-efficiency zone (including the cooli fan, humidifier, and other accessories), therefore the PEMFC stack should not operate this range. The triangular and trapezoidal membership functions (MFs) are used in th case as shown in Figure 4. The choice of the triangular and trapezoidal shapes is to redu the variations in the generated power reference.  The fuzzy set for Li-ion battery SOC is divided into "Low" (L), "Medium" (M), and "High" (H). The fuzzy set for Pload is also divided into "Negative" (N), "Very Low" (VL), L, M, H, "Very High" (VH), indicating the power demand from low to high levels. The fuzzy set for Pfc is classified as "Zero" (ZE), VL, L, M, H, VH. The gap between (ZE) and (VL) of Pfc in Figure 4c is the fuel cell system's low-efficiency zone (including the cooling fan, humidifier, and other accessories), therefore the PEMFC stack should not operate in this range. The triangular and trapezoidal membership functions (MFs) are used in this case as shown in Figure 4. The choice of the triangular and trapezoidal shapes is to reduce the variations in the generated power reference.
(VL) of Pfc in Figure 4c is the fuel cell system's low-efficiency zone (including the cooling fan, humidifier, and other accessories), therefore the PEMFC stack should not operate in this range. The triangular and trapezoidal membership functions (MFs) are used in this case as shown in Figure 4. The choice of the triangular and trapezoidal shapes is to reduce the variations in the generated power reference.

Fuzzy Inference Rules
The fuzzy logic rules corresponding to this energy management are designed and presented in Table 4. The choice of the rules is according to the desired operation on the PEMFC stack. For example, when the SOC of the Li-ion battery is low and the power demanded by the vehicle is very high, then the power that the PEMFC stack must provide will be very high. In the same way, the PEMFC stack provides a power that is lower than the power demand when the Li-ion battery is highly charged because in this case, the Li-ion battery must be solicited to reduce it to a medium charge in order to take advantage of the energy recovery from braking. Based on this general idea, the choice of these rules remains arbitrary according to the desired functioning, while respecting the response time of the two sources. The SOC of the Li-ion battery should be maintained between 30% and 80%. This procedure prevents deep discharging and overcharging, which can reduce the lifespan of a Li-ion battery. The fuzzy rules surface is shown in Figure 5. face is shown in Figure 5. The proposed fuzzy logic controller uses the Mamdani inference centroid method for defuzzification [36]. Table 4. Energy management fuzzy logic rules.

DC Bus Voltage Regulation and PEMFC Stack Converter Control
The electrical energy sources used to supply the EV must be we converters by regulating their currents and/or output voltages. The c to the energy sources control the output power and voltage [39]. The r bus voltage and the control of the PEMFC stack power are presented stack and Li-ion battery are, respectively, connected to the DC bus vi bidirectional DC-DC converters. The power management block gen current * which has to be limited in a slope in order to respect the to the PEMFC stack dynamics. A PI controller is used to control the P by adjusting the current to its reference value * . The Li-ion battery r The proposed fuzzy logic controller uses the Mamdani inference procedure, with the centroid method for defuzzification [36].

DC Bus Voltage Regulation and PEMFC Stack Converter Control
The electrical energy sources used to supply the EV must be well controlled via the converters by regulating their currents and/or output voltages. The converters connected to the energy sources control the output power and voltage [39]. The regulation of the DC bus voltage and the control of the PEMFC stack power are presented in Figure 6. PEMFC stack and Li-ion battery are, respectively, connected to the DC bus via unidirectional and bidirectional DC-DC converters. The power management block generates the reference current I * FC which has to be limited in a slope in order to respect the constraints related to the PEMFC stack dynamics. A PI controller is used to control the PEMFC stack power by adjusting the current to its reference value I * FC . The Li-ion battery regulates the DC bus voltage by tracking the reference voltage V DC_re f . A double PI regulation loop is used to maintain the DC bus voltage close to its reference and to control the Li-ion battery power. . A double PI regulation loop is used to maintain the DC bus voltage close to its reference and to control the Li-ion battery power.

Model Predictive Direct Torque Control
The model predictive direct torque control strategy basic principle is to predict the system future behavior over time using the PMSM model [33]. This strategy is used to control both the flux and torque of the PMSM in the EV system. The numerical implementation of the MPDTC algorithm for PMSM in the EV can be divided into two steps.
Step 1 is to predict the controlled variables, and the second step is to select the voltage vector to be applied in the next sampling time. To determine the best voltage vector to use in the next sampling time, a cost function is constructed. The optimal voltage vector is chosen based on the objectives with the minimum error, resulting in reduced ripples. In MPDTC, the controlled variables are predicted using Forward Euler approximation [40].
The block diagram and the flowchart of MPDTC are illustrated in Figures 7 and 8.

Model Predictive Direct Torque Control
The model predictive direct torque control strategy basic principle is to predict the system future behavior over time using the PMSM model [33]. This strategy is used to control both the flux and torque of the PMSM in the EV system. The numerical implementation of the MPDTC algorithm for PMSM in the EV can be divided into two steps.
Step 1 is to predict the controlled variables, and the second step is to select the voltage vector to be applied in the next sampling time. To determine the best voltage vector to use in the next sampling time, a cost function is constructed. The optimal voltage vector is chosen based on the objectives with the minimum error, resulting in reduced ripples. In MPDTC, the controlled variables are predicted using Forward Euler approximation [40].
The block diagram and the flowchart of MPDTC are illustrated in Figures 7 and 8. . A double PI regulation loop is used to maintain the DC bus voltage close to its reference and to control the Li-ion battery power.

Model Predictive Direct Torque Control
The model predictive direct torque control strategy basic principle is to predict the system future behavior over time using the PMSM model [33]. This strategy is used to control both the flux and torque of the PMSM in the EV system. The numerical implementation of the MPDTC algorithm for PMSM in the EV can be divided into two steps.
Step 1 is to predict the controlled variables, and the second step is to select the voltage vector to be applied in the next sampling time. To determine the best voltage vector to use in the next sampling time, a cost function is constructed. The optimal voltage vector is chosen based on the objectives with the minimum error, resulting in reduced ripples. In MPDTC, the controlled variables are predicted using Forward Euler approximation [40].
The block diagram and the flowchart of MPDTC are illustrated in Figures 7 and 8.

Current Prediction
Stator current prediction can be expressed in discrete time steps using Equations (20) and (21) where is the sampling time.

Flux and Torque Predictions
Stator flux prediction in d-q frame is expressed using Equations (22)-(24) shown below: Based on the predicted current and flux, the electromagnetic torque is calculated using Equation (25)

Current Prediction
Stator current prediction can be expressed in discrete time steps using Equations (20) and (21) [41]: where T s is the sampling time.

Flux and Torque Predictions
Stator flux prediction in d-q frame is expressed using Equations (22)-(24) shown below: Based on the predicted current and flux, the electromagnetic torque is calculated using Equation (25):

Cost Function Minimization
The cost function includes absolute torque and flux error values; this function is chosen so that the voltage vector chosen produces the best flux and torque control. The cost function is defined as follows: where T * e is the reference values of torque, φ * s is the reference values of stator flux, T e (k + 1) is the predicted values of torque, φ s (k + 1) the predicted values of stator flux, and γ is the weighting factor.

Time Delay Compensation
The voltage vector selected at time (k) will be applied at time (k + 1) with a delay of one-step. Because the sampling time is very small, this deteriorates the system performance. Therefore, a compensation of the delay time must be performed to improve the system performance. Therefore, the prediction by two steps ahead (k + 2) will be considered. The prediction of the stator currents at time (k + 2) can be expressed using Equations (27) and (28) [31,42]: The cost function g can be extended by adding the current magnitude limitation to avoid overcurrent. This term is defined as follows in Equation (29) [32]: The total cost function g of MPDTC with compensation of the computation time delay is given as:

Simulation Results and Discussion
In order to evaluate EV efficacy and to test the dynamic performance of the proposed strategies, numerical simulations in MATLAB/Simulink environment have been performed. A driving cycle under different operating modes is proposed as shown in Figure 9.   Figure 10a, it is noticed that the variation of the stator current dynamics corresponds to the changes in the acceleration. The zoom shows that the stator current is perfectly sinusoidal. In Figure 10b, it is clearly seen that the vehicle speed depends on the variation of the pedal acceleration. Figure 10c shows the behavior of the electromagnetic torque, where it can be seen that the measured torque perfectly follows the reference torque even when the trajectories change abruptly with a good ripple, demonstrating the effectiveness of the MPDTC technique used on the system. In Figure 10d, it can be seen that the measured stator flux follows its reference with good precision during all trajectories with a good ripple.    Figure 10a, it is noticed that the variation of the stator current dynamics corresponds to the changes in the acceleration. The zoom shows that the stator current is perfectly sinusoidal. In Figure 10b, it is clearly seen that the vehicle speed depends on the variation of the pedal acceleration. Figure 10c shows the behavior of the electromagnetic torque, where it can be seen that the measured torque perfectly follows the reference torque even when the trajectories change abruptly with a good ripple, demonstrating the effectiveness of the MPDTC technique used on the system. In Figure 10d, it can be seen that the measured stator flux follows its reference with good precision during all trajectories with a good ripple.     Figure 10a, it is noticed that the variation of the stator current dynamics corresponds to the changes in the acceleration. The zoom shows that the stator current is perfectly sinusoidal. In Figure 10b, it is clearly seen that the vehicle speed depends on the variation of the pedal acceleration. Figure 10c shows the behavior of the electromagnetic torque, where it can be seen that the measured torque perfectly follows the reference torque even when the trajectories change abruptly with a good ripple, demonstrating the effectiveness of the MPDTC technique used on the system. In Figure 10d, it can be seen that the measured stator flux follows its reference with good precision during all trajectories with a good ripple. To check the MPDTC performances in a comparative way, and to shed light on the obtained results, a comparison between the proposed MPDTC and the conventional DTC was made and is presented in Table 5, Figures 11a,b and 12a,b. The electromagnetic torque zoom is presented in Figure 11. A reduction of 54.54% in torque ripples was observed compared to conventional DTC. Figure 12 depicts the stator flux zoom. An improvement of 77% compared to conventional DTC can be seen.  To check the MPDTC performances in a comparative way, and to shed light on the obtained results, a comparison between the proposed MPDTC and the conventional DTC was made and is presented in Table 5, Figures 11a,b and 12a,b. The electromagnetic torque zoom is presented in Figure 11. A reduction of 54.54% in torque ripples was observed compared to conventional DTC. Figure 12 depicts the stator flux zoom. An improvement of 77% compared to conventional DTC can be seen.
The fast Fourier transform (FFT) analyses of phase current and THD calculation for the proposed MPDTC and conventional DTC are presented in Table 5 and Figure 13a,b. The THD of MPDTC is 1.45%, which is lower than that of conventional DTC which is 3.13%, which presents an improvement of 53.37%. The simulation results presented in Table 5 confirm the performance of the proposed MPDTC is superior to that of conventional DTC. To check the MPDTC performances in a comparative way, and to shed light on the obtained results, a comparison between the proposed MPDTC and the conventional DTC was made and is presented in Table 5, Figures 11a,b and 12a,b. The electromagnetic torque zoom is presented in Figure 11. A reduction of 54.54% in torque ripples was observed compared to conventional DTC. Figure 12 depicts the stator flux zoom. An improvement of 77% compared to conventional DTC can be seen.
The fast Fourier transform (FFT) analyses of phase current and THD calculation for the proposed MPDTC and conventional DTC are presented in Table 5 and Figure 13a,b. The THD of MPDTC is 1.45%, which is lower than that of conventional DTC which is 3.13%, which presents an improvement of 53.37%. The simulation results presented in Table 5 confirm the performance of the proposed MPDTC is superior to that of conventional DTC. The fast Fourier transform (FFT) analyses of phase current and THD calculation for the proposed MPDTC and conventional DTC are presented in Table 5 and Figure 13a,b. The THD of MPDTC is 1.45%, which is lower than that of conventional DTC which is 3.13%, which presents an improvement of 53.37%. The simulation results presented in Table 5 confirm the performance of the proposed MPDTC is superior to that of conventional DTC.   Figure 14a depicts the Li-ion battery SOC. It can be clearly observed that the Li-ion battery SOC decreases slightly from 60% to 58.7% between [0 s, 13 s], then the Li-ion battery SOC increases until it reaches 59.4%, after absorbing the braking Energy. The DC bus voltage of the electric vehicle is depicted in Figure 14b. It can be seen that the measured voltage is well regulated to its reference (500 V) regardless of load demand. The zoom shows an overshoot in DC bus voltage of (5 V), this allows us to say that the DC bus voltage control is satisfactory.  Figure 14a depicts the Li-ion battery SOC. It can be clearly observed that the Li-ion battery SOC decreases slightly from 60% to 58.7% between [0 s, 13 s], then the Li-ion battery SOC increases until it reaches 59.4%, after absorbing the braking Energy. The DC bus voltage of the electric vehicle is depicted in Figure 14b. It can be seen that the measured voltage is well regulated to its reference (500 V) regardless of load demand. The zoom shows an overshoot in DC bus voltage of (5 V), this allows us to say that the DC bus voltage control is satisfactory.  Figure 15 shows the power distribution of the electric vehicle under different driving modes with an initial Li-ion battery SOC of 60% for the EMS based on fuzzy logic. When the vehicle is accelerating, the Li-ion battery alone powers the vehicle until t = 2 s. From 2 s to 4 s, the power demand increases slightly, the PEMFC stack begins to operate, providing a significant portion of the driving power, and the Li-ion acts as a secondary power source. From 4 s to 8 s the power demand decreases, the PEMFC stack provides no power,  Figure 15 shows the power distribution of the electric vehicle under different driving modes with an initial Li-ion battery SOC of 60% for the EMS based on fuzzy logic. When the vehicle is accelerating, the Li-ion battery alone powers the vehicle until t = 2 s. From 2 s to 4 s, the power demand increases slightly, the PEMFC stack begins to operate, providing a significant portion of the driving power, and the Li-ion acts as a secondary power source. From 4 s to 8 s the power demand decreases, the PEMFC stack provides no power, and the Li-ion battery alone powers the vehicle. From 8 s to 13 s the power demand is higher, the PEMFC stack is the primary power source, and the Li-ion battery becomes a secondary source, with the Li-ion battery SOC generally declining. From 13 s to 14 s no power is demanded, and the Li-ion battery and the PEMFC stack provide no power. From t = 14 s the regenerative braking mode starts, the Li-ion battery absorbs the kinetic braking energy and the motor acts as a generator.
source. From 4 s to 8 s the power demand decreases, the PEMFC stack provides no power, and the Li-ion battery alone powers the vehicle. From 8 s to 13 s the power demand is higher, the PEMFC stack is the primary power source, and the Li-ion battery becomes a secondary source, with the Li-ion battery SOC generally declining. From 13 s to 14 s no power is demanded, and the Li-ion battery and the PEMFC stack provide no power. From t = 14 s the regenerative braking mode starts, the Li-ion battery absorbs the kinetic braking energy and the motor acts as a generator. Figure 16 shows the performance of the electric vehicle under different driving modes and battery states of charge. In Figure 16a, the initial Li-ion battery SOC is high (SOC = 80%); in this situation, the Li-ion battery provides a significant portion of the driving power, and the PEMFC stack only operates when the power demand becomes high, to protect the Li-ion battery from overcharging and keep the SOC in a relatively low level. In Figure 16b, the initial Li-ion battery SOC is low (30%); in this situation, the PEMFC stack is configured to generate more power than the engine power. To charge the Li-ion battery to acceptable levels, and to protect the Li-ion battery from deep discharges, the Liion battery only discharges in high acceleration to supplement the power demand. Figures 15 and 16 clearly show that the EMS based on fuzzy logic ensures a convenient power flow and gives good performance with the changes in driving conditions, and battery states of charge.  Figure 16 shows the performance of the electric vehicle under different driving modes and battery states of charge. In Figure 16a, the initial Li-ion battery SOC is high (SOC = 80%); in this situation, the Li-ion battery provides a significant portion of the driving power, and the PEMFC stack only operates when the power demand becomes high, to protect the Li-ion battery from overcharging and keep the SOC in a relatively low level. In Figure 16b, the initial Li-ion battery SOC is low (30%); in this situation, the PEMFC stack is configured to generate more power than the engine power. To charge the Li-ion battery to acceptable levels, and to protect the Li-ion battery from deep discharges, the Li-ion battery only discharges in high acceleration to supplement the power demand.

Driving Cycle Test
The New York City Cycle (NYCC) driving cycle is adopted to analyze the performance of the proposed EMS based on fuzzy logic. Three different scenarios are defined to test the performance of EV under different states of charge of the Li-ion battery. The three scenarios are as follows: Scenario 1: the initial SOC of the Li-ion battery is 60% when starting. Scenario 2: the initial SOC of the Li-ion battery at startup is 80%. Scenario 3: the initial SOC of the Li-ion battery is 30%.

Driving Cycle Test
The New York City Cycle (NYCC) driving cycle is adopted to analyze the performance of the proposed EMS based on fuzzy logic. Three different scenarios are defined to test the performance of EV under different states of charge of the Li-ion battery. The three scenarios are as follows: Scenario 1: the initial SOC of the Li-ion battery is 60% when starting. Scenario 2: the initial SOC of the Li-ion battery at startup is 80%. Scenario 3: the initial SOC of the Li-ion battery is 30%. Figure 17 shows the power curves for the PEMFC stack, Li-ion battery, motor, and Li-ion battery SOC in scenario 1. It can be seen in Figure 17a, that the PEMFC stack does not operate in the low power range [0-5 kW] and becomes active in the high power demand where the efficiency of the PEMFC system is relatively high. The Li-ion battery is configured to provide all the charging power in the low power demand range, assist the fuel cell in the high power demand range, and absorb the braking energy when the vehicle decelerates. The final SOC value of the Li-ion battery in this scenario is 59.5%, as seen in Figure 17a.   Figure 18 shows the power curves and the SOC of the Li-ion battery in the second scenario. As seen in Figure 18a, the Li-ion battery is regulated to provide a large amount of power to protect it from overcharging, and the PEMFC stack intervenes in the high power demand. The Li-ion battery SOC decreases from 80% to 74% as shown in Figure 18b.   Figure 19a shows the power curves in the third scenario. The fuel cell is operated to provide power for the load and charge the Li-ion battery to protect it from deep discharges. The Li-ion battery SOC increases from 30% to 46.5%, as shown in Figure 19b.  The results show that the proposed energy management strategy based on fuzzy logic is robust and could improve the efficiency of the PEMFC stack, mainly because this proposed EMS makes the PEMFC stack operate in the high-efficiency region.

Real-Time Platform Using RT-LAB
The real-time simulation of the proposed control is implemented in this section using the discrete real-time simulator, the RT LAB platform. Figure 20a depicts the real-time simulation bench set up in the LTII laboratory of Bejaia, which consists of the following components: (1) a host PC, (2) an OP5700 real-time digital simulator, (3) a HIL controller and data acquisition interface OP8660, and (4) a digital oscilloscope. As it is shown in Figure 20b, the first step toward real-time simulation is the model separation. The EV system is split into computation and console blocks. Blocks that contain computations such as energy management strategy, MPDTC, vehicle dynamics, motor and power sources models are placed on the computation subsystem, which is constituted of a master (SM) bloc highlighted with red dashed lines and a slave (SS) block. Scopes and constants are placed in the console block. In RT-LAB, each computation subsystem is assigned to a different core. In other words, each subsystem is coded in C and built for execution among its processors using Mathworks code generator Real-Time-Workshop (RTW) [43]. After compilation, the code is loaded into target OP5700 via TCP/IP protocol and executed via parallel processing. Finally, all observations in display blocks are monitored and displayed on the digital oscilloscope via I/O channels.
A real-time simulation was performed after the EV simulation system was decomposed and adapted for use in the RT LAB platform.
In order to evaluate the two techniques proposed in this work, namely the MPDTC on the motor side, and the EMS based on fuzzy logic on the source side, a driving cycle under different operating modes has been applied ( Figure 9). Figures 21-24 present experimental results of the two techniques proposed. The results obtained using a discrete real-time simulator RT LAB are very close to the simulation results with the same remarks previously mentioned in the simulation results. Experimental results prove the effectiveness of the proposed control techniques. ferent core. In other words, each subsystem is coded in C and built for execution among its processors using Mathworks code generator Real-Time-Workshop (RTW) [43]. After compilation, the code is loaded into target OP5700 via TCP/IP protocol and executed via parallel processing. Finally, all observations in display blocks are monitored and displayed on the digital oscilloscope via I/O channels.
A real-time simulation was performed after the EV simulation system was decomposed and adapted for use in the RT LAB platform. In order to evaluate the two techniques proposed in this work, namely the MPDTC on the motor side, and the EMS based on fuzzy logic on the source side, a driving cycle under different operating modes has been applied ( Figure 9).

Conclusions
In this paper, the authors focused on improving the performance of an EV by introducing a Fuzzy-MPDTC-based control. This control is divided into two parts: The first part is dedicated to the control of the traction machine by introducing a MPDTC technique for PMSM control. The second part proposes a fuzzy logic-based EMS for the electric vehicle power system. To evaluate these techniques, a driving cycle under different operating modes has been proposed. The main conclusions are listed as follows. On the motor side, several objectives are achieved by applying a predefined cost function, the electro-

Conclusions
In this paper, the authors focused on improving the performance of an EV by introducing a Fuzzy-MPDTC-based control. This control is divided into two parts: The first part is dedicated to the control of the traction machine by introducing a MPDTC technique for PMSM control. The second part proposes a fuzzy logic-based EMS for the electric vehicle power system. To evaluate these techniques, a driving cycle under different operating modes has been proposed. The main conclusions are listed as follows. On the motor side, several objectives are achieved by applying a predefined cost function, the electro-

Conclusions
In this paper, the authors focused on improving the performance of an EV by introducing a Fuzzy-MPDTC-based control. This control is divided into two parts: The first part is dedicated to the control of the traction machine by introducing a MPDTC technique for PMSM control. The second part proposes a fuzzy logic-based EMS for the electric vehicle power system. To evaluate these techniques, a driving cycle under different operating modes has been proposed. The main conclusions are listed as follows. On the motor side, several objectives are achieved by applying a predefined cost function, the electromagnetic torque response follows its reference with small ripple values, a 54.54% improvement compared to the classical DTC; the current ripple is reduced and the reference tracking is ensured. On the sources side, the fuzzy logic-based EMS provides robust performance under various battery states of charge and rapid variation in power demand. Real-time simulation results were obtained using a discrete real-time simulator; the RT LAB platform confirmed the effectiveness and robustness of the proposed control techniques.