Advanced Torque Control of Interior Permanent Magnet Motors for Electrical Hypercars

: Nowadays, electric vehicles have gained significant attention as a promising solution to the environmental concerns associated with traditional combustion engine vehicles. With the increasing demand for high-performance hypercars, the need for advanced torque control strategies has become paramount. Field-Oriented Control using Current Vector Control represents a consolidated solution to implement torque control. However, this kind of control must take into account the DC link voltage variation and the variation of motor parameters depending on the magnets’ temperature while providing the maximum torque production for specific inverter current and voltage limitations. Multidimensional lookup tables are needed to provide a robust torque control from zero speed up to maximum speed under deep flux-weakening operation. Therefore, this article aims to explore the application of FOC 4D control in electrical hypercars and its impact on enhancing their overall performance and control stability. The article will delve into the principles underlying FOC 4D control and its advantages, challenges, and potential solutions to optimize the operation of electric hypercars. An electric powertrain model has been developed in the Simulink environment with the Simscape tool using a S-function block for the implementation of digital control in C-code. High-power electric motor electromagnetic parameters, derived from a Finite Element Method magnetic model, have been used in the simulation. The 4D LUTs have been computed from the motor flux maps and implemented in C-code in the S-function. The choice of FOC 4D control has been validated in the main load points of a hypercar application and compared to the conventional FOC. The final part of the research underlines the benefits of the FOC 4D on reliability, critical in motorsport applications.


Introduction
In recent years, electric vehicles (EVs) have emerged as the near future solution in transportation sustainability [1,2].Motor control technology has witnessed significant advancements over the years, enabling higher precision, efficiency, and control over electric motors [3][4][5].Among the various methods, Field-Oriented Control (FOC) using Current Vector Control (CVC) [6] has emerged as one of the most widely used methods for achieving the optimal performance in motor control systems.However, a more recent development known as FOC 4D torque control has emerged, promising even higher levels of motor control precision and efficiency.In this article, a comparative study between the conventional FOC and FOC 4D torque control [7][8][9] has been presented, exploring the differences, advantages, and potential applications of each method.By understanding the nuances of these motor control techniques, engineers and researchers can make informed decisions when designing motor control systems for a wide range of applications.First, we will provide a brief overview of Field-Oriented Control (FOC) and its basic principles.The FOC, also known as CVC-FOC, focuses on torque control via the control of the stator current vector that is implemented in the rotor rotating (d,q) frame.The d-axis current component represents the flux-producing current component, while the q-axis current component is also called as the torque-producing current component.The (d,q) reference currents must be properly generated from the torque reference.
Next, the concept of FOC 4D torque control has been introduced, a relatively new technique that takes motor control precision to a better level during parameters variation.While FOC primarily focuses on optimizing two-dimensional control (the flux and the torque of the motor), FOC 4D torque control adds two additional dimensions by considering the temperature and the DC-link voltage.This inclusion of higher-dimensional dynamics enables even finer control over motor operation, eliminating issues such as torque ripple, noise, and vibration.
A comparative analysis of FOC and FOC 4D torque control highlighting their respective strengths and weaknesses has been made.Factors such as torque control precision, motor efficiency, computational complexity, and implementation challenges will be discussed to provide a comprehensive understanding of both techniques.
Furthermore, various real-world applications where FOC and FOC 4D torque control have been applied are shown to demonstrate how the choice between the two types of torque control can significantly impact the performance and reliability of motor-driven systems in these areas.The FOC 4D has been developed from the electric motor parameters, computing the control loci for different temperatures and DC-link voltages, creating several 2D lookup tables (LUT) for the I d and I q current references depending on the torque reference and the motor speed.Then, the FOC 4D has been implemented with a C-code compatible with an inverter microcontroller.
Finally, the article summarizes the key findings of the comparative study and provides suggestions for torque control system designers' and engineers' future directions.With a thorough understanding of the benefits and limitations offered by both FOC and FOC 4D torque control, professionals in the field can make informed decisions based on specific application requirements, ensuring optimal motor performance and energy efficiency.The final part of the article aims to shed light on the differences and potential advantages of FOC and FOC 4D torque control.By exploring their underlying principles, comparative analysis, and practical applications, we aim to equip engineers and researchers with the knowledge needed to make informed decisions when designing motor control systems for diverse industrial and technological sectors.
This article starts from the electric vehicle design in [10], real-time FOC control development [11] with torque lookup tables generation [12], and the FOC 4D implementation in [13], and it aims to contribute to the literature on several relevant aspects.
The main article contributions are: • FEMM data validation for the electric drive design.

•
Detailed electric drive model with parameters variability on speed and temperature to obtain a realistic drive performance for design purposes on demanding applications.• The computation of normalized 4D lookup tables generating the I d and I q current references from the torque reference and speed feedback for the FOC 4D control.• The code implementation in C language of a FOC 4D torque control with the compatibility with inverter microcontrollers maintaining the code readability.• Traditional FOC and FOC 4D comparison under critical load points.
The research has been carried out on an electric Internal Permanent Magnets (IPMs) motor, but the proposed technique can be implemented for permanent magnet (PM) motors, e.g., Surface-Mounted Permanent Magnets (SPMs) motors and IPM motors, and for motors without magnets, e.g., induction motors and synchronous reluctance; the first ones are strongly affected by temperature because of the magnet flux variation with the temperature, and the parameters of the second ones are less dependent on temperature.For what concerns the DC-link voltage, for each type of motor, the available voltage is always crucial for the motor control for the flux-weakening locus identification.
The method proposed can be implemented in every electric vehicle, but it is more useful in demanding applications when temperature and voltage are strongly variable, so the case study chosen has been the hypercar application.

Materials and Methods
In this section, the methodology of the investigation is reported with all the tools used for the data extraction from the design of the hypercar electric motor.The motor considered is a 150 kW motor, one of the two front motors of an electric hypercar.This high-performance motor has been chosen because of the high speed and high torque reachable; with this type of motor, the proposed control method can express clearly the control usefulness during flux weakening at high speed and temperature variations on high temperature.
The IPM torque control needs flux LUTs on the d,q-axes, which means the resultant flux among the magnets' flux and the stator currents on the d-and q-axes for the optimal control, so, in the preliminary design phase, the FEMM analysis [14] is crucial for the performance evaluation in the Simscape model.Flux Linkage Maps identification is needed for the FEMM maps validation and the final experimental control implementation [15][16][17].
The motor data, used in the Simscape model, have been extracted from the FEMM model of the motor created from the output of the motor geometric design.The JMAG 21.0 tool was used for the FEMM simulation, evaluating the different geometric iterations to maximize the motor performances.The main motor design data are presented in Table 1.The main motor parameters used in the Simscape model are the stator resistance in Figure 1, the Flux Maps in Figure 2, and the maximum current.

FEMM Validation
The main FEMM outputs have been validated with a MATLAB code, comput maximum torque per speed (MTPS) and comparing the data.
The workflow is explained in Figure 3.

FEMM Validation
The main FEMM outputs have been validated with a MATLAB code, computing the maximum torque per speed (MTPS) and comparing the data.
The workflow is explained in Figure 3.Following the validation process, the electromagnetic torque has been calculated with Equation (1) [18].
where  are the pole pairs of the motor, and  and  are the motor flux linkages on the d,q-axes.
After the torque calculations, the main inverter and DC-link limitations have been applied to the calculated torque, avoiding the unfeasible torque points.
The two limitations considered are the maximum current in Equation ( 2) and the available voltage on the DC-link of Equation (3).
where  is the maximum current of the inverter design;  is the maximum voltage available to the motor side of the inverter due to the Space Vector PWM [13];  is the maximum voltage considering the safety factor of 0.9 to avoid the risk of loss of control; and  ,  , and  are, respectively, the stator current amplitude, the stator current d-axis Following the validation process, the electromagnetic torque has been calculated with Equation (1) [18].
where pp are the pole pairs of the motor, and λ d and λ q are the motor flux linkages on the d,q-axes.
After the torque calculations, the main inverter and DC-link limitations have been applied to the calculated torque, avoiding the unfeasible torque points.
The two limitations considered are the maximum current in Equation ( 2) and the available voltage on the DC-link of Equation (3).
where I MAX is the maximum current of the inverter design; V MAX is the maximum voltage available to the motor side of the inverter due to the Space Vector PWM [13]; V LI M is the maximum voltage considering the safety factor of 0.9 to avoid the risk of loss of control; and I S , I d , and I q are, respectively, the stator current amplitude, the stator current d-axis component, and the stator current q-axis component.
Having obtained every torque point compatible with the limitations, the MTPS curve has been computed and compared to the one from the FEMM analysis.In Figure 4, the torque comparison between the MTPS calculated with the analytical formula in Equation ( 1) and the one calculated with the numerical approach with FEMM software (JMAG 21.0) is shown.With a view toward implementing FOC 4D, the MTPS curve has been calc varying the temperature and the DC-link voltage.In Figure 5, the MTPS va depending on temperature is shown, and in Figure 6 can be seen the MTPS depend voltage.According to Figure 5, the reduction of the maximum available torque is due increase in temperature, because the magnet flux reduces with the increase in tempe for any kind of magnet, and this physical magnet property affects the torque gene This behavior is evident from Equation (1): if the magnet flux decreases, the total With a view toward implementing FOC 4D, the MTPS curve has been calculated varying the temperature and the DC-link voltage.In Figure 5, the MTPS variation depending on temperature is shown, and in Figure 6 can be seen the MTPS depending on voltage.With a view toward implementing FOC 4D, the MTPS curve has been calcu varying the temperature and the DC-link voltage.In Figure 5, the MTPS var depending on temperature is shown, and in Figure 6 can be seen the MTPS dependi voltage.According to Figure 5, the reduction of the maximum available torque is due increase in temperature, because the magnet flux reduces with the increase in temper for any kind of magnet, and this physical magnet property affects the torque gener This behavior is evident from Equation (1): if the magnet flux decreases, the total  creases, causing a total torque reduction [19].In Figure 6 can be seen the extension of the MTPS maximum torque per speed with the consequence of increasing the base speed of the motor due to the augm availability of a DC-link voltage with higher flux-weakening capability.

Modeling
In this section, the electric powertrain model is presented, focusing on the thre components model: The battery pack has been modeled as a constant voltage source because negligible dynamic compared to the inverter one.
The inverter model takes into account the switching dynamics and includes t ferent components, such as the voltage source, switches, and diodes, with the aim curately simulate their behavior and interactions [20].
The motor model represents the characteristics and dynamics of the electric itself.Creating an accurate motor model is essential for predicting the m performance under different operating conditions and designing efficient strategies.
The control model governs how the inverter interacts with the motor to achie desired performance objectives.This model encompasses the various control algo and strategies employed to perform the FOC 4D control.The control developed tak account the delays of the digital control at a fixed switching frequency, obtai realistic behavior.
The combination of these three models forms a comprehensive electric pow control model that enables the simulation and optimization of electric vehicle powe for high-performance applications, improving the efficiency, performance, and system behavior of electric vehicles.

Inverter Modeling
The circuital three-phase inverter model has been developed in Simscape using two voltage sources of the value of  2 ⁄ , six MOSFET switches, a According to Figure 5, the reduction of the maximum available torque is due to the increase in temperature, because the magnet flux reduces with the increase in temperature for any kind of magnet, and this physical magnet property affects the torque generation.This behavior is evident from Equation (1): if the magnet flux decreases, the total λ d decreases, causing a total torque reduction [19].
In Figure 6 can be seen the extension of the MTPS maximum torque per speed range, with the consequence of increasing the base speed of the motor due to the augmented availability of a DC-link voltage with higher flux-weakening capability.

Modeling
In this section, the electric powertrain model is presented, focusing on the three main components model: The battery pack has been modeled as a constant voltage source because of its negligible dynamic compared to the inverter one.
The inverter model takes into account the switching dynamics and includes the different components, such as the voltage source, switches, and diodes, with the aim to accurately simulate their behavior and interactions [20].
The motor model represents the characteristics and dynamics of the electric motor itself.Creating an accurate motor model is essential for predicting the motor's performance under different operating conditions and designing efficient control strategies.
The control model governs how the inverter interacts with the motor to achieve the desired performance objectives.This model encompasses the various control algorithms and strategies employed to perform the FOC 4D control.The control developed takes into account the delays of the digital control at a fixed switching frequency, obtaining a realistic behavior.
The combination of these three models forms a comprehensive electric powertrain control model that enables the simulation and optimization of electric vehicle powertrains for high-performance applications, improving the efficiency, performance, and overall system behavior of electric vehicles.

Inverter Modeling
The circuital three-phase inverter model has been developed in Simscape R2023a using two voltage sources of the value of V DC /2, six MOSFET switches, and for computational convenience, the MOSFET body diodes have been used instead of six diode blocks, as shown in Figure 7.
World Electr.Veh.J. 2024, 15, x FOR PEER REVIEW 8 of 32 computational convenience, the MOSFET body diodes have been used instead of six diode blocks, as shown in Figure 7.The inverter gate commands, p, high-switch command, and n, low-switch command, are generated from the duty cycles calculations in the PWM modulator, taking into account the dead time with the  method [21][22][23][24].This method adds and subtracts to the desired duty cycle a quantity  proportional to the  according to the following Equation (4).

𝐷𝑒𝑙𝑡𝑎𝐷 𝑓 𝐷𝑒𝑎𝑑𝑇𝑖𝑚𝑒 (4)
The  considered in this paper is 2 μs compatible with a silicon carbide (SIC) MOSFET switch.Therefore, there are two new duty cycles: • the higher   that commands the lower switch; • the lower  −  that commands the higher switch.
The Simulink model for the command's generation is presented in Figure 8, and the resulting one-leg commands are shown in Figure 9.The inverter gate commands, p, high-switch command, and n, low-switch command, are generated from the duty cycles calculations in the PWM modulator, taking into account the dead time with the DeltaD method [21][22][23][24].This method adds and subtracts to the desired duty cycle a quantity DeltaD proportional to the DeadTime according to the following Equation (4).
The DeadTime considered in this paper is 2 µs compatible with a silicon carbide (SIC) MOSFET switch.Therefore, there are two new duty cycles: • the higher (duty + DeltaD) that commands the lower switch; • the lower (duty − DeltaD) that commands the higher switch.The Simulink model for the command's generation is presented in Figure 8, and the resulting one-leg commands are shown in Figure 9.
World Electr.Veh.J. 2024, 15, x FOR PEER REVIEW 8 of 32 computational convenience, the MOSFET body diodes have been used instead of six diode blocks, as shown in Figure 7.The inverter gate commands, p, high-switch command, and n, low-switch command, are generated from the duty cycles calculations in the PWM modulator, taking into account the dead time with the  method [21][22][23][24].This method adds and subtracts to the desired duty cycle a quantity  proportional to the  according to the following Equation (4).

𝐷𝑒𝑙𝑡𝑎𝐷 𝑓 𝐷𝑒𝑎𝑑𝑇𝑖𝑚𝑒 (4)
The  considered in this paper is 2 μs compatible with a silicon carbide (SIC) MOSFET switch.Therefore, there are two new duty cycles: • the higher   that commands the lower switch; • the lower  −  that commands the higher switch.
The Simulink model for the command's generation is presented in Figure 8, and the resulting one-leg commands are shown in Figure 9.The n and p commands in Figure 9 are the simulated binary commands (1 or 0) responsible for the inverter switch states: if the p command is 1, the high switch is closed; otherwise, it is open, and in the same way, if the n command is 1, the low switch is closed; if 0, it is open.It is important not to have the overlap of the ON state of the switches on the same leg; otherwise, a short circuit occurs on the inverter leg.

Voltage behind Reactance (VBR) Motor Modeling
The motor model developed and implemented is the three-phase VBR model [18,23] described by Equation ( 5), and in Figure 10, the equivalent circuit and the Simscape implementation are shown, which include the phase resistance  , the leakage inductance  , the matrix of the incremental inductances  , , and the electromotive forces  , expressed by Equation (5).
The leakage inductance has not been considered in the model, because an esteem of the  parameter would not be accurate in the first design stage.Therefore, the resultant model inputs are  obtained by FEMM analysis,  , obtained from Equation ( 6) in which λ and λ are the motor flux maps, Equations ( 7)-( 9), and  (obtained through Equation ( 10)) and brought back to three phases with the inverse Park transform.
, −  λ  (10) The n and p commands in Figure 9 are the simulated binary commands (1 or 0) responsible for the inverter switch states: if the p command is 1, the high switch is closed; otherwise, it is open, and in the same way, if the n command is 1, the low switch is closed; if 0, it is open.It is important not to have the overlap of the ON state of the switches on the same leg; otherwise, a short circuit occurs on the inverter leg.

Voltage behind Reactance (VBR) Motor Modeling
The motor model developed and implemented is the three-phase VBR model [18,23] described by Equation ( 5), and in Figure 10, the equivalent circuit and the Simscape implementation are shown, which include the phase resistance R s , the leakage inductance L ls , the matrix of the incremental inductances [L inc,abc ], and the electromotive forces e abc , expressed by Equation (5).
The leakage inductance has not been considered in the model, because an esteem of the L ls parameter would not be accurate in the first design stage.Therefore, the resultant model inputs are R s obtained by FEMM analysis, [L inc,abc ] obtained from Equation (6) in which λ d and λ q are the motor flux maps, Equations ( 7)- (9), and e abc (obtained through Equation ( 10)) and brought back to three phases with the inverse Park transform.
e dq = L inc,dq (−ω)Ji dq + Jωλ dq (10) The Simscape model (Figure 10) performed programming the Simscape component block; it is important to notice that R s is speed-dependent, so the skin effect in windings is taken into account, guaranteeing a realistic winding behavior.
The Simscape model (Figure 10) performed programming the Simscape component block; it is important to notice that  is speed-dependent, so the skin effect in windings is taken into account, guaranteeing a realistic winding behavior.

FOC 4D Modeling
The motor control developed is summarized in the block scheme reported in Figure 11.The control needed in the automotive applications is a torque control that generates the d,q current references responsible for the motor torque.In FOC 4D, the torque reference ( * ) is needed to obtain the d,q current references ( * and  * ) from the LUTs but also the speed estimation (), the magnet temperature estimation (), and the DClink voltage measure ( ).Generating the current references, the current loops are based on the error computation as input of the PI regulators that generate the d,q voltage references (  * and  * ) and, after the saturation to the maximum available voltage, transform in the three-phase voltage references for the inverter PWM modulator [25].This control is particularly suitable for hypercar applications, because it is robust with respect to temperature and voltage variations typical of battery voltage variations depending on the State of Charge and absorbed current and motor temperature variations under frequent and strong overload operations.Figure 10 also includes the contribution of the feedforward responsible for compensating the disturbances and improving the dynamic performance [26].

FOC 4D Modeling
The motor control developed is summarized in the block scheme reported in Figure 11.The control needed in the automotive applications is a torque control that generates the d,q current references responsible for the motor torque.In FOC 4D, the torque reference (T * ) is needed to obtain the d,q current references (i d * and i q * ) from the LUTs but also the speed estimation (ω), the magnet temperature estimation (Temp), and the DC-link voltage measure (v dc ).Generating the current references, the current loops are based on the error computation as input of the PI regulators that generate the d,q voltage references (v d * and v q * ) and, after the saturation to the maximum available voltage, transform in the three-phase voltage references for the inverter PWM modulator [25].This control is particularly suitable for hypercar applications, because it is robust with respect to temperature and voltage variations typical of battery voltage variations depending on the State of Charge and absorbed current and motor temperature variations under frequent and strong overload operations.Figure 10 also includes the contribution of the feedforward responsible for compensating the disturbances and improving the dynamic performance [26].The FOC 4D requires the implementation of 4D-LUTs with a significant amount of computational resources involved, as each LUT needs to be populated with data for all possible combinations of torque, speed, voltage, and temperature.This can lead to an increased complexity of the control, but most of the computational burden is required The FOC 4D requires the implementation of 4D-LUTs with a significant amount of computational resources involved, as each LUT needs to be populated with data for all possible combinations of torque, speed, voltage, and temperature.This can lead to an increased complexity of the control, but most of the computational burden is required offline, so, during the online control, the 4D-LUTs are already stored in the memory and can be rapidly read in real time to define the references of the control algorithm in every working point of interest for the application.Therefore, the real-time FOC 4D algorithm using the 4D-LUTs needs about the same execution time of the traditional FOC, and so, it is compatible with automotive standards.The only additional requirement is a larger memory needed for saving the 4D maps, but this is not an issue because of the large memory availability in modern controllers and the small memory required by LUTs.
A MATLAB R2023a code has been developed to calculate the 4D-LUTs following the method described in [13]: maximum torque per ampere (MTPA) and maximum torque per voltage (MTPV) loci have been calculated and imposed as limits of the control together with the maximum stator current, obtaining Figure 12.The FOC 4D requires the implementation of 4D-LUTs with a significant amount of computational resources involved, as each LUT needs to be populated with data for all possible combinations of torque, speed, voltage, and temperature.This can lead to an increased complexity of the control, but most of the computational burden is required offline, so, during the online control, the 4D-LUTs are already stored in the memory and can be rapidly read in real time to define the references of the control algorithm in every working point of interest for the application.Therefore, the real-time FOC 4D algorithm using the 4D-LUTs needs about the same execution time of the traditional FOC, and so, it is compatible with automotive standards.The only additional requirement is a larger memory needed for saving the 4D maps, but this is not an issue because of the large memory availability in modern controllers and the small memory required by LUTs.
A MATLAB R2023a code has been developed to calculate the 4D-LUTs following the method described in [13]: maximum torque per ampere (MTPA) and maximum torque per voltage (MTPV) loci have been calculated and imposed as limits of the control together with the maximum stator current, obtaining Figure 12.The control loci found are in the d,q currents plane.A torque-speed map is needed for the real-time control in order to reduce, at the minimum, the computational effort in real time, obtaining the  and  currents directly from the torque and speed.
and  2D maps are shown in Figure 13, with the iso-currents curves outlined.
Referring to one torque value, it is the speed increasing the current references on the MTPA locus until the maximum current amplitude is reached.The  current is increased The control loci found are in the d,q currents plane.A torque-speed map is needed for the real-time control in order to reduce, at the minimum, the computational effort in real time, obtaining the i d and i q currents directly from the torque and speed.
i d and i q 2D maps are shown in Figure 13, with the iso-currents curves outlined.Referring to one torque value, it is the speed increasing the current references on the MTPA locus until the maximum current amplitude is reached.The i d current is increased to reach a higher speed, and consequently, the i q current needs to be reduced.In the upper-right corner, the current limit can be seen, producing unreachable points identified as not-anumber on the maps.The maximum torque mapped is 140 Nm, due to current limitations, and the maximum speed is 29,400 rpm.
World Electr.Veh.J. 2024, 15, x FOR PEER REVIEW 12 of 32 to reach a higher speed, and consequently, the  current needs to be reduced.In the upper-right corner, the current limit can be seen, producing unreachable points identified as not-a-number on the maps.The maximum torque mapped is 140 Nm, due to current limitations, and the maximum speed is 29,400 rpm.In real-time applications, the motor control is performed by a microcontroller programmed with a C-code.For the sake of control optimization, map normalization is needed in addition to the absence of the not-a-numbers on the maps.The torque normalization  follows Equation (11).In real-time applications, the motor control is performed by a microcontroller programmed with a C-code.For the sake of control optimization, map normalization is needed in addition to the absence of the not-a-numbers on the maps.The torque normalization T norm follows Equation (11).
where T e is the torque corresponding to the considered point of the map, and T max is the maximum torque that can be generated by the motor (depending on the maximum current chosen).Normalization is needed also for the speed following Equation (12).
In which n max is the motor maximum speed, n min is the minimum motor speed, n e is the speed corresponding to the considered point on the map, and i is the torque level.
Therefore, the final maps obtained for the control in the motoring operation are shown in Figure 14.In real-time applications, the motor control is performed by a microcontroller programmed with a C-code.For the sake of control optimization, map normalization is needed in addition to the absence of the not-a-numbers on the maps.The torque normalization  follows Equation (11).
where  is the torque corresponding to the considered point of the map, and  is the maximum torque that can be generated by the motor (depending on the maximum current chosen).Normalization is needed also for the speed following Equation (12).
In which  is the motor maximum speed,  is the minimum motor speed,  is the speed corresponding to the considered point on the map, and  is the torque level.
Therefore, the final maps obtained for the control in the motoring operation are shown in Figure 14.To reach the 4D FOC, the 2D maps calculation has been iterated at different temperatures and different voltages.The temperatures chosen are from −50 • C to 150 • C, compatible with automotive applications, and the voltages are from 650 V to 800 V, due to battery pack voltage variations.Therefore, the obtained normalized maps were 20 for each d-and q-axis and then interpolated for the actual working point during the real-time control.
The final goal of this research has been to simulate the real-time digital control behavior obtaining the performances reachable by the hypercar powertrain [27].Therefore, the control algorithm has been written in C and simulated in the Simulink environment with the S-function block, as can be seen in Figure 15.
The main S-function outputs are the duty cycles of each inverter leg that will produce the desired torque at the defined working point.The switch commands come from the duty cycles signals, as shown in Figure 16.The inverter dead time is simulated, delaying the commands using the DeltaD method [21].
The FOC 4D algorithm has been implemented on a state machine in order to guarantee a proper initialization of all the control variables.A block scheme of the implemented state machine is shown in Figure 17, and it is made up by:

•
Reset state: The PWM is disabled, and the duty cycles are initialized to the default value of 0.5.• Wake Up state: The DC-link voltage is checked if it is at the proper value.

•
Drive Init state: The current sensors offsets are compensated for the optimal current control.

•
Stop Motor state: The motor control is ready to start, and all the variables are initialized.

•
Go Motor state: The motor control (FOC 4D) is running.
• Error state: The motor control is off, because the drive protections have detected a fault or the emergency button has been pressed.
compatible with automotive applications, and the voltages are from 650 V to 800 V, due to battery pack voltage variations.Therefore, the obtained normalized maps were 20 for each d-and q-axis and then interpolated for the actual working point during the real-time control.
The final goal of this research has been to simulate the real-time digital control behavior obtaining the performances reachable by the hypercar powertrain [27].Therefore, the control algorithm has been written in C and simulated in the Simulink environment with the S-function block, as can be seen in Figure 15.The main S-function outputs are the duty cycles of each inverter leg that will produce the desired torque at the defined working point.The switch commands come from the duty cycles signals, as shown in Figure 16.The inverter dead time is simulated, delaying the commands using the DeltaD method [21].The main S-function outputs are the duty cycles of each inverter leg the desired torque at the defined working point.The switch comman duty cycles signals, as shown in Figure 16.The inverter dead time is si the commands using the DeltaD method [21].

•
Error state: The motor control is off, because the drive protections have detected a fault or the emergency button has been pressed.
To move from one state to another one, Human-to-Machine Interface (HMI) buttons are used, for example, for the start/stop, emergency, or control variables that trigger a state change.

Results
In this section the comparison results between the FOC and the FOC 4D control in demanding working points for the control and under fast dynamic tests are presented.It is well known that the traditional FOC is stable and with a good dynamic in the working conditions in which the LUTs are computed.

FOC Results
In this section is presented the main tests and results for the evaluation of the control stability.The tests chosen are the Accuracy Test, the Stress Test, and the MTPS Test.The results are equal for the FOC 4D and the traditional FOC when the magnets' temperature and voltage are the same as the ones considered during the LUTs computation.

Maximum Torque Per Speed (MTPS)
The MTPS Test is presented in this subsection; this test outlines the maximum torque per speed locus, so the maximum available torque for a given rotational speed.The MTPS locus has been obtained with a speed ramp from 0 to 28,000 rpm during 1 s of simulation with a fixed voltage and temperature (650 V and 100 °C).In Figure 18, the speed ramp is shown, and it is visible that, for the entire simulation, the acceleration is constant and the dynamic of the speed variation is negligible compared to the torque one.To move from one state to another one, Human-to-Machine Interface (HMI) buttons are used, for example, for the start/stop, emergency, or control variables that trigger a state change.

Results
In this section the comparison results between the FOC and the FOC 4D control in demanding working points for the control and under fast dynamic tests are presented.It is well known that the traditional FOC is stable and with a good dynamic in the working conditions in which the LUTs are computed.

FOC Results
In this section is presented the main tests and results for the evaluation of the control stability.The tests chosen are the Accuracy Test, the Stress Test, and the MTPS Test.The results are equal for the FOC 4D and the traditional FOC when the magnets' temperature and voltage are the same as the ones considered during the LUTs computation.

Maximum Torque Per Speed (MTPS)
The MTPS Test is presented in this subsection; this test outlines the maximum torque per speed locus, so the maximum available torque for a given rotational speed.The MTPS locus has been obtained with a speed ramp from 0 to 28,000 rpm during 1 s of simulation with a fixed voltage and temperature (650 V and 100 • C).In Figure 18, the speed ramp is shown, and it is visible that, for the entire simulation, the acceleration is constant and the dynamic of the speed variation is negligible compared to the torque one.The MTPS curve is shown in Figure 19 that includes the reference torque (red the actual torque (blue).Initially, the reference torque is set at 180 Nm.As soon control starts, the reference torque is properly saturated at 140 Nm, according maximum inverter current (386 Arms; see Table 1) and to the MTPA curve shown in F 12. Indeed, the motor control saturates properly the reference torque at the value The MTPS curve is shown in Figure 19 that includes the reference torque (red) and the actual torque (blue).Initially, the reference torque is set at 180 Nm.As soon as the control starts, the reference torque is properly saturated at 140 Nm, according to the maximum inverter current (386 Arms; see Table 1) and to the MTPA curve shown in Figure 12.Indeed, the motor control saturates properly the reference torque at the value that is achievable taking into account the inverter current and voltage limits.The MTPS curve is shown in Figure 19 that includes the reference torque (red the actual torque (blue).Initially, the reference torque is set at 180 Nm.As soon control starts, the reference torque is properly saturated at 140 Nm, according maximum inverter current (386 Arms; see Table 1) and to the MTPA curve shown in F 12. Indeed, the motor control saturates properly the reference torque at the value achievable taking into account the inverter current and voltage limits.The torque obtained is produced by the d,q currents (Figure 20), and the current limit in the control can be seen at the startup, avoiding overshoot when the currents the reference.The currents values are equal to the ones of the MTPA locus when the is under the base speed, and then, there is the flux weakening, so the  current dec and the  current increases.The torque obtained is produced by the d,q currents (Figure 20), and the current slope limit in the control can be seen at the startup, avoiding overshoot when the currents reach the reference.The currents values are equal to the ones of the MTPA locus when the speed is under the base speed, and then, there is the flux weakening, so the i q current decreases and the i d current increases.

Stress Test at 650 V and 100 °C
A Stress Test has been performed to evaluate the control stability.The test consi a sequence of working points alternated between motoring and regenerative braki the maximum torque in one second of simulation.In Figure 21, the torque compa between the actual torque and the reference torque can be seen.At the beginning o simulation, the torque reference is imposed, but the control needs time to initializ variables, to check the offsets, and to become ready for the motor control.After the sta the torque reference is saturated to the maximum value available, and the control s

Stress Test at 650 V and 100 • C
A Stress Test has been performed to evaluate the control stability.The test consists of a sequence of working points alternated between motoring and regenerative braking at the maximum torque in one second of simulation.In Figure 21, the torque comparison between the actual torque and the reference torque can be seen.At the beginning of the simulation, the torque reference is imposed, but the control needs time to initialize the variables, to check the offsets, and to become ready for the motor control.After the startup, the torque reference is saturated to the maximum value available, and the control starts.It is possible to note that the torque changes with an imposed ramp limit due to a ramp limit in the current control to avoid steps and consequent overshoots.A Stress Test has been performed to evaluate the control stability.The test cons a sequence of working points alternated between motoring and regenerative brak the maximum torque in one second of simulation.In Figure 21, the torque comp between the actual torque and the reference torque can be seen.At the beginning simulation, the torque reference is imposed, but the control needs time to initiali variables, to check the offsets, and to become ready for the motor control.After the st the torque reference is saturated to the maximum value available, and the control It is possible to note that the torque changes with an imposed ramp limit due to a limit in the current control to avoid steps and consequent overshoots.Figure 22 shows the i d and i q current comparisons between the reference and actual values.In particular, in the upper part, the i q current comparison outlines the alternated motoring and regenerative braking working points with positive and negative values of i q ; in the lower part of the figure, the i d current comparison shows the i d reference constant between motoring and braking and the control that follows the reference also during the current transients.

Accuracy Test
The Accuracy Test has been performed to evaluate the control precision.Th consists of a ramp with constant slew rate starting from the maximum regenerative t to the maximum motoring torque; this test has been carried out on a constant spe 1000 rpm.In Figure 23, the actual torque is compared to the reference value, w

Accuracy Test
The Accuracy Test has been performed to evaluate the control precision.The test consists of a ramp with constant slew rate starting from the maximum regenerative torque to the maximum motoring torque; this test has been carried out on a constant speed of 1000 rpm.In Figure 23, the actual torque is compared to the reference value, with an optimum precision less than a torque ripple higher in amplitude at the maximum torque than the near-zero torque.In Figure 24, the torque ripple at the maximum torque with an error of about 2% outlined but always balanced in the reference value.Figure 25 shows the  and  currents during the Accuracy Test, with the current responsible for the torque sign and the  current always negative in a IPM mot In Figure 24, the torque ripple at the maximum torque with an error of about 2% is outlined but always balanced in the reference value.In Figure 24, the torque ripple at the maximum torque with an error of about 2% outlined but always balanced in the reference value.Figure 25 shows the i d and i q currents during the Accuracy Test, with the i q current responsible for the torque sign and the i d current always negative in a IPM motor.

FOC and FOC 4D Comparison under Parameters Variation
In this section, some critical working points are reported comparing the control stability and precision with FOC 4D.

Maximum Torque Per Speed (MTPS)
In Section 4.1.1,it is clear that the FOC 4D maintains control stability during the MTPS Test as the conventional FOC does when the temperature and the DC-link voltages are near to the ones considered during the LUTs computation.
In this subsection, the conventional FOC is analyzed in critical working points in which the parameters variation affects the precision and stability of the control.The first working point is when the FOC lookup tables generated for the FOC control refer to a DClink of 750 V but the real DC-link is 650 V.This condition is usual in automotives because of the dependency of the voltage on the State of Charge (SOC).In this working point, the simulation is testing the control when the vehicle battery pack is at a low SOC.
In Figure 26, the torque behavior is reported and compared to the torque reference.It is possible to note the control problems when the speed reaches 17,000 rpm because the real DC-link is under the one set in the control, so the maximum power corresponding to a DC-link of 750 V is not reachable, and as a consequence, the actual torque cannot reach the requested value.

FOC and FOC 4D Comparison under Parameters Variation
In this section, some critical working points are reported comparing the control stability and precision with FOC 4D.

Maximum Torque Per Speed (MTPS)
In Section 4.1.1,it is clear that the FOC 4D maintains control stability during the MTPS Test as the conventional FOC does when the temperature and the DC-link voltages are near to the ones considered during the LUTs computation.
In this subsection, the conventional FOC is analyzed in critical working points in which the parameters variation affects the precision and stability of the control.The first working point is when the FOC lookup tables generated for the FOC control refer to a DC-link of 750 V but the real DC-link is 650 V.This condition is usual in automotives because of the dependency of the voltage on the State of Charge (SOC).In this working point, the simulation is testing the control when the vehicle battery pack is at a low SOC.
In Figure 26, the torque behavior is reported and compared to the torque reference.It is possible to note the control problems when the speed reaches 17,000 rpm because the real DC-link is under the one set in the control, so the maximum power corresponding to a DC-link of 750 V is not reachable, and as a consequence, the actual torque cannot reach the requested value.
The i d and i q currents report the same issue as the torque when a 1700 rpm speed is reached, according to Figure 27, highly increasing the current ripple and losing track of the references, especially for the i d current with a maximum mean error of about 30%.
The second working point analyzed is with a real DC-link higher than the value considered in the FOC LUTs computation.In this example, the physical DC-link value is 800 V and the LUTs have been computed with 750 V.
FOC and FOC 4D are compared in Figure 28.The main difference is in the base speed that is higher in the FOC 4D, because it can use the total voltage available, reaching more power, compared to the conventional FOC with a set DC-link at 750 V, limited at a lower power.The  and  currents report the same issue as the torque when a 1700 rpm speed is reached, according to Figure 27, highly increasing the current ripple and losing track of the references, especially for the  current with a maximum mean error of about 30%.The second working point analyzed is with a real DC-link higher than the value considered in the FOC LUTs computation.In this example, the physical DC-link value is 800 V and the LUTs have been computed with 750 V.
FOC and FOC 4D are compared in Figure 28.The main difference is in the base speed that is higher in the FOC 4D, because it can use the total voltage available, reaching more power, compared to the conventional FOC with a set DC-link at 750 V, limited at a lower power.The  and  currents report the same issue as the torque when a 1700 rpm speed is reached, according to Figure 27, highly increasing the current ripple and losing track of the references, especially for the  current with a maximum mean error of about 30%.The second working point analyzed is with a real DC-link higher than the value considered in the FOC LUTs computation.In this example, the physical DC-link value is 800 V and the LUTs have been computed with 750 V.
FOC and FOC 4D are compared in Figure 28.The main difference is in the base speed that is higher in the FOC 4D, because it can use the total voltage available, reaching more power, compared to the conventional FOC with a set DC-link at 750 V, limited at a lower power.In Figure 29, the i d and i q currents of the conventional FOC are reported with a base speed coherent with the one of the torque in Figure 28.
The conventional FOC has also been tested with a temperature variation during the MTPS Test.The variation of the controlled torque due to temperature variation is shown in Figure 30 with the same torque reference.The actual torque is higher if the real magnets' temperature is lower (−50 • C in the example) with respect to the one considered in the LUTs computation; vice versa, the actual torque is lower if the real magnets' temperature is higher (100 • C in the example).In Figure 29, the  and  currents of the conventional FOC are reported with a base speed coherent with the one of the torque in Figure 28.The conventional FOC has also been tested with a temperature variation during the MTPS Test.The variation of the controlled torque due to temperature variation is shown in Figure 30 with the same torque reference.The actual torque is higher if the real magnets' temperature is lower (−50 °C in the example) with respect to the one considered in the LUTs computation; vice versa, the actual torque is lower if the real magnets' temperature is higher (100 °C in the example).In Figure 29, the  and  currents of the conventional FOC are reported with a base speed coherent with the one of the torque in Figure 28.The conventional FOC has also been tested with a temperature variation during the MTPS Test.The variation of the controlled torque due to temperature variation is shown in Figure 30 with the same torque reference.The actual torque is higher if the real magnets' temperature is lower (−50 °C in the example) with respect to the one considered in the LUTs computation; vice versa, the actual torque is lower if the real magnets' temperature is higher (100 °C in the example).

Stress Test
Then, the Stress Test has been performed on the conventional FOC in two working points in which the motor temperature is different from the one set in the control.The first working point is at 100 • C and 1000 rpm, but the FOC LUTs have been computed using a temperature of 25 • C. In this case, the actual torque presents an error at the steady state, because the currents imposed have produced a lower torque due to the higher temperature of the motor magnets.In Figure 31, the torque error is visible both in motoring and braking, although the currents are well controlled, according to Figure 32.
The second working point tested is the opposite of the previous one, so a real temperature of −50 • C and the FOC LUTs computed at 25 • C. In this case, according to Figure 33, the actual controlled torque is higher with respect to the reference torque because of the lower real magnets' temperature.Also, in this case, the current references are well followed, as in Figure 34.
The last working point has been obtained changing the test speed of the Stress Test, reaching 20,000 rpm, according to Figure 35.In this configuration, the LUTs of the conventional FOC have been computed with a 750 V of DC-link but a real DC-link of 650 V.

Stress Test
Then, the Stress Test has been performed on the conventional FOC in two workin points in which the motor temperature is different from the one set in the control.The fir working point is at 100 °C and 1000 rpm, but the FOC LUTs have been computed using temperature of 25 °C.In this case, the actual torque presents an error at the steady stat because the currents imposed have produced a lower torque due to the highe temperature of the motor magnets.In Figure 31, the torque error is visible both i motoring and braking, although the currents are well controlled, according to Figure 32

Stress Test
Then, the Stress Test has been performed on the conventional FOC in two worki points in which the motor temperature is different from the one set in the control.The fi working point is at 100 °C and 1000 rpm, but the FOC LUTs have been computed using temperature of 25 °C.In this case, the actual torque presents an error at the steady sta because the currents imposed have produced a lower torque due to the high temperature of the motor magnets.In Figure 31, the torque error is visible both motoring and braking, although the currents are well controlled, according to Figure 3  The second working point tested is the opposite of the previous one, so a real temperature of −50 • C and the FOC LUTs computed at 25 • C. In this case, according to Figure 33, the actual controlled torque is higher with respect to the reference torque because of the lower real magnets' temperature.Also, in this case, the current references are well followed, as in Figure 34.
As in the MTPS, at high speed, the Stress Test has also outlined the consistent torque error and torque ripple, visible in Figure 36, and high ripple and tracking error in the i d and i q currents, shown in Figure 37.It is interesting to underline that, in motoring operation, the control stability struggles more compared to the braking operation, because the Joule losses are upstream the control thanks to the speed imposition, and so, it does not jeopardize the control stability as in the motoring operation.Instead, the FOC 4D in Figure 38 reaches the reference torque with low ripple at a steady state.The second working point tested is the opposite of the previous one, so a real temperature of −50 °C and the FOC LUTs computed at 25 °C.In this case, according to Figure 33, the actual controlled torque is higher with respect to the reference torque because of the lower real magnets' temperature.Also, in this case, the current references are well followed, as in Figure 34.The second working point tested is the opposite of the previous one, so a real temperature of −50 °C and the FOC LUTs computed at 25 °C.In this case, according to Figure 33, the actual controlled torque is higher with respect to the reference torque because of the lower real magnets' temperature.Also, in this case, the current references are well followed, as in Figure 34.As in the MTPS, at high speed, the Stress Test has also outlined the consistent torque error and torque ripple, visible in Figure 36, and high ripple and tracking error in the  and  currents, shown in Figure 37.It is interesting to underline that, in motoring operation, the control stability struggles more compared to the braking operation, because the Joule losses are upstream the control thanks to the speed imposition, and so, it does

Accuracy Test
As in FOC 4D, the last test performed has been the Accuracy Test at 1000 rpm.The conventional FOC has been tested first at 100 • C with the FOC LUTs computed at 25 • C. In Figure 39, the torque error is visible, with the actual torque always lower in amplitude compared to the torque reference because of the lower temperature causing a lower torque capability.As in the previous test, the currents are well controlled at the MTPA value (Figure 40).

Accuracy Test
As in FOC 4D, the last test performed has been the Accuracy Test at 1000 rpm.The conventional FOC has been tested first at 100 °C with the FOC LUTs computed at 25 °C.In Figure 39, the torque error is visible, with the actual torque always lower in amplitude compared to the torque reference because of the lower temperature causing a lower torque capability.As in the previous test, the currents are well controlled at the MTPA value (Figure 40).

Accuracy Test
As in FOC 4D, the last test performed has been the Accuracy Test at 1000 rpm.The conventional FOC has been tested first at 100 °C with the FOC LUTs computed at 25 °C.In Figure 39, the torque error is visible, with the actual torque always lower in amplitude compared to the torque reference because of the lower temperature causing a lower torque capability.As in the previous test, the currents are well controlled at the MTPA value (Figure 40).On the other hand, the conventional FOC has been tested with the real magnets' temperature of −50 • C and LUTs of 25 • C. The actual torque obtained is always higher in amplitude, according to Figure 41, because of the lower temperature and, so, a higher torque capability.
Also, in this case, the currents are tracked well, except for a torque ripple with the i q current with the same sign of the generated torque, and the i d is always negative (Figure 42).On the other hand, the conventional FOC has been tested with the real magnets' temperature of −50 °C and LUTs of 25 °C.The actual torque obtained always higher in amplitude, according to Figure 41, because of the lower temperature and, so, a higher torque capability.Also, in this case, the currents are tracked well, except for a torque ripple with the  current with the same sign of the generated torque, and the  is always negative (Figure 42).On the other hand, the conventional FOC has been tested with the real magnets' temperature of −50 °C and LUTs of 25 °C.The actual torque obtained is always higher in amplitude, according to Figure 41, because of the lower temperature and, so, a higher torque capability.Also, in this case, the currents are tracked well, except for a torque ripple with the  current with the same sign of the generated torque, and the  is always negative (Figure 42).The Accuracy Test results for the FOC 4D outline, in Figure 43, the actual torque following the reference value with a low ripple.

FOC and FOC 4D Comparison
In this subsection, the Root Mean Square Error ( ) torque error is computed between the actual and the reference torque to compare conventional FOC with FOC 4D in different working points.In Equation ( 13), the  formula is shown with  as the number of samples,  the actual value, and  the reference value.

FOC and FOC 4D Comparison
In this subsection, the Root Mean Square Error (RMSE) torque error is computed between the actual and the reference torque to compare conventional FOC with FOC 4D in different working points.In Equation ( 13), the RMSE formula is shown with n as the number of samples, X i the actual value, and x o the reference value.

RMSE
In Table 2, the RMSE values for the FOC 4D are reported for each test performed.The motor conditions are the same for the three tests: the DC link voltage is 650 V, and the motor magnets' temperature is 100 • C. In Table 2, not only the RMSE torque error is reported but also the RMSE current error.This choice has been taken because, during the Stress Test, the RMSE torque error is one order of magnitude higher than the other tests, but this error is not representative of the real torque control precision because of a ramp limitation on the d,q current references.Therefore, the correct way to evaluate the control precision, during the Stress Test, is to evaluate the RMSE current error.It is important to notice that is not possible to compare the RMSE current error value with the torque one, because the current amplitudes are about three times higher, so the relative errors are about the same between the torque and current.In Table 3, the RMSE torque errors of the conventional FOC are reported for the three tests performed under the same motor conditions, with a DC-link voltage of 650 V and a motor magnets' temperature of 100 • C; the same parameters are taken into account during the LUTs computation of the conventional FOC.For the Stress Test evaluation, the current RMSE error is also more meaningful for the conventional FOC.The FOC errors are practically the same as the FOC 4D when the real motor conditions that influence the torque (DC-link voltage and magnets temperature) are the same as the ones considered during the LUT computations.In Table 4, instead, some critical motor conditions for the FOC are analyzed and the RMSE error computed.For each test, four motor conditions are considered in particular: with a DC-link voltage higher and lower than the LUTs voltage and with a magnets' temperature higher and lower than the LUTs magnets' temperature.It is interesting to notice, on the temperature variation during the stress test, that the torque error is increased but the current error is the same as the FOC 4D; this is because the control can track the current references, but these references produce a different torque with respect to the one expected from LUTs.
From Tables 2-4, the FOC control has an RMSE error practically equal to the FOC 4D one when the motor conditions are the same as the ones considered for the LUT calculations.When the DC-link voltage and magnets' temperature are higher or lower, the control produces a higher tracking error.
In Table 5, the FOC 4D RMSE torque error has been averaged among the three types of tests and normalized in percentages with the FOC RMSE error.The error comparison shows the percentage of the RMSE error reduction with respect to the conventional FOC.It is clear the superiority of the FOC 4D under the four working conditions evaluated.The FOC RMSE error has been four times to six times higher with respect to the FOC 4D one.The second row of Table 5 with a 650 DC-link voltage outlines a practically diverged RMSE error because of the loss of control, not having enough DC voltage.

Conclusions
In this article, a FOC 4D torque control has been implemented and compared to a conventional FOC for electric hypercar applications.First, the motor FEMM flux maps have been validated and then used for the LUTs elaboration.
A complete control has been developed in C language compatible with real-time digital applications, and it has been integrated with a powertrain model in the Simscape Simulink environment using an inverter circuital model and a VBR motor model of an hypercar powertrain.The two control solutions have been tested and compared in the Simulink environment; the three tests considered were the MTPS Test, to evaluate the control stability at high speed, the Stress Test, to evaluate the torque and current control dynamic, and the Accuracy Test, for the control precision evaluation.The FOC 4D resulted in more stable and precise control when parameters variation occurs.In particular, the conventional FOC denotes torque error when the magnets' temperature is different from the one in which the LUTs have been computed and also in the presence of different voltages on the DC-link, causing a steady-state torque error when the speed reaches high values, meeting the voltage limit.When the DC-link voltage is higher with respect to the LUTs, the MTPS has a lower base speed underperforming the motor torque capabilities, and when the DC-link voltage is lower, there is a strong torque error at high speed, also obtaining an evident torque ripple increment.The digital real-time control simulation has been tested at 20 kHz, compatible with automotive control frequencies, obtaining a torque ripple 3 Nm in amplitude.In conclusion, the FOC 4D has obtained an RMSE error at least four times lower under the four most critical conditions considered in this work.The relative error is the maximum when the DC-link is lower than the LUTs DC-link voltage because of the loss of control.The control stability of the FOC 4D is crucial in high demand applications like hypercar or motorsport applications in which the temperature reaches high values and the voltage changes a lot under the power absorption and the battery pack SOC change.

Figure 2 .
Figure 2. Motor Flux Maps on the d,q-axes at 110 °C.

Figure 2 .
Figure 2. Motor Flux Maps on the d,q-axes at 110 • C.

Figure 9 .
Figure 9. Inverter commands with dead time for one inverter leg.

Figure 9 .
Figure 9. Inverter commands with dead time for one inverter leg.

Figure 10 .
Figure 10.Electric motor equivalent circuit with the VBR three-phase motor model (up) and the VBR motor model implementation in Simscape (down).

Figure 10 .
Figure 10.Electric motor equivalent circuit with the VBR three-phase motor model (up) and the VBR motor model implementation in Simscape (down).

Figure 13 .
Figure 13.i d (right) and i q (left) maps in the torque-speed plane (110 • C, 650 V DC ).

Figure 15 .
Figure 15.S-function block compatible with the control C file.

Figure 15 .
Figure 15.S-function block compatible with the control C file.

Figure 15 .
Figure 15.S-function block compatible with the control C file.

Figure 16 .
Figure 16.PWM modulator to compute the inverter switching commands.

Figure 17 .
Figure 17.State machine block scheme of the torque control.

Figure 17 .
Figure 17.State machine block scheme of the torque control.

16 Figure 20 .
Figure 20. and  currents in the MTPS simulation at 650 V and 100 °C.

Figure 20 .
Figure 20.i d and i q currents in the MTPS simulation at 650 V and 100 • C.

Figure 20 .
Figure 20. and  currents in the MTPS simulation at 650 V and 100 °C.

Figure 21 . 21 .
Figure 21.Torque comparison between the actual value and reference value during the Stres Figure 21.Torque comparison between the actual value and reference value during the Stress Test.

1 Figure 22
Figure 22 shows the  and  current comparisons between the reference and values.In particular, in the upper part, the  current comparison outlines the alter motoring and regenerative braking working points with positive and negative val  ; in the lower part of the figure, the  current comparison shows the  refe constant between motoring and braking and the control that follows the referenc during the current transients.

Figure 22 .
Figure 22.  (down) and  (up) current comparison between the actual value and reference during the Stress Test.

Figure 22 .
Figure 22. i d (down) and i q (up) current comparison between the actual value and reference value during the Stress Test.

Figure 23 .
Figure 23.Torque comparison during the Accuracy Test.

Figure 24 .
Figure 24.Torque ripple zoom during the Accuracy Test.

Figure 23 .
Figure 23.Torque comparison during the Accuracy Test.

Figure 23 .
Figure 23.Torque comparison during the Accuracy Test.

Figure 24 .
Figure 24.Torque ripple zoom during the Accuracy Test.

Figure 25
Figure25shows the  and  currents during the Accuracy Test, with the current responsible for the torque sign and the  current always negative in a IPM moto

Figure 24 .
Figure 24.Torque ripple zoom during the Accuracy Test.

Figure 25 .
Figure 25.Current comparison during the Accuracy Test.

Figure 25 .
Figure 25.Current comparison during the Accuracy Test.

Figure 26 .
Figure 26.Torque during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 650 V.

Figure 27 .
Figure 27.Current during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 650 V.

Figure 26 .
Figure 26.Torque during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 650 V.

Figure 26 .
Figure 26.Torque during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 650 V.

Figure 27 .
Figure 27.Current during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 650 V.

Figure 27 .
Figure 27.Current during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 650 V.

Figure 28 .
Figure 28.Torque comparison during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 800 V and the FOC 4D.

Figure 29 .
Figure 29.Current comparison during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 800 V and the FOC 4D.

Figure 28 . 32 Figure 28 .
Figure 28.Torque comparison during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 800 V and the FOC 4D.

Figure 29 .
Figure 29.Current comparison during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 800 V and the FOC 4D.

Figure 29 .
Figure 29.Current comparison during the MTPS Test of the conventional FOC with LUTs at 750 V but the physical DC-link is 800 V and the FOC 4D.

Figure 30 .
Figure 30.Torque comparison during the MTPS Test of the conventional FOC with LUTs at 25 ° but the physical magnets' temperature is 100 °C or −50 °C.

Figure 31 .
Figure 31.Torque comparison during the Stress Test of the conventional FOC with LUTs at 25 ° but the magnet temperature is 100 °C.

Figure 30 .
Figure 30.Torque comparison during the MTPS Test of the conventional FOC with LUTs at 25 • C but the physical magnets' temperature is 100 • C or −50 • C.

Figure 30 .
Figure 30.Torque comparison during the MTPS Test of the conventional FOC with LUTs at 25 but the physical magnets' temperature is 100 °C or −50 °C.

Figure 31 .
Figure 31.Torque comparison during the Stress Test of the conventional FOC with LUTs at 25 but the magnet temperature is 100 °C.

Figure 31 .
Figure 31.Torque comparison during the Stress Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is 100 • C.

Figure 32 .
Figure 32. (down) and  (up) currents comparison during the Stress Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is 100 °C.

Figure 33 .
Figure 33.Torque comparison during the Stress Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is −50 °C.

Figure 32 .
Figure 32.i d (down) and i q (up) currents comparison during the Stress Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is 100 • C.

Figure 32 .
Figure 32. (down) and  (up) currents comparison during the Stress Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is 100 °C.

Figure 33 .
Figure 33.Torque comparison during the Stress Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is −50 °C.

Figure 33 .Figure 34 .
Figure 33.Torque comparison during the Stress Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is −50 • C. World Electr.Veh.J. 2024, 15, x FOR PEER REVIEW 24 of 32

Figure 34 .
Figure 34.Currents comparison during the Stress Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is −50 • C.

Figure 34 .
Figure 34.Currents comparison during the Stress Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is −50 °C.The last working point has been obtained changing the test speed of the Stress Test, reaching 20,000 rpm, according to Figure35.In this configuration, the LUTs of the conventional FOC have been computed with a 750 V of DC-link but a real DC-link of 650 V.

Figure 35 .
Figure 35.Speed during the Stress Test of the conventional FOC.

Figure 35 .
Figure 35.Speed during the Stress Test of the conventional FOC.

Figure 36 .
Figure 36.Torque comparison during the Stress Test of the conventional FOC with LUTs at 750 V but the DC-link is 650 V at 20,000 rpm.

Figure 37 .
Figure 37. Current comparison during the Stress Test of the conventional FOC with LUTs at 750 V but the DC-link is 650 V at 20,000 rpm.

Figure 36 .
Figure 36.Torque comparison during the Stress Test of the conventional FOC with LUTs at 750 V but the DC-link is 650 V at 20,000 rpm.

Figure 36 .
Figure 36.Torque comparison during the Stress Test of the conventional FOC with LUTs at 750 V but the DC-link is 650 V at 20,000 rpm.

Figure 37 .
Figure 37. Current comparison during the Stress Test of the conventional FOC with LUTs at 750 V but the DC-link is 650 V at 20,000 rpm.

Figure 37 .
Figure 37. Current comparison during the Stress Test of the conventional FOC with LUTs at 750 V but the DC-link is 650 V at 20,000 rpm.

32 Figure 38 .
Figure 38.Torque comparison during the Stress Test of FOC 4D with a DC-link at 650 V at 20,000 rpm.

Figure 39 . 32 Figure 38 .
Figure 39.Torque comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is 100 °C.

Figure 39 .
Figure 39.Torque comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is 100 °C.

Figure 39 .
Figure 39.Torque comparison during the Accuracy Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is 100 • C.

Figure 40 .
Figure 40.Currents comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is 100 °C.

Figure 41 .
Figure 41.Torque comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is −50 °C.

Figure 40 .
Figure 40.Currents comparison during the Accuracy Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is 100 • C.

Figure 40 .
Figure 40.Currents comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is 100 °C.

Figure 41 .
Figure 41.Torque comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is −50 °C.

Figure 41 .Figure 42 .
Figure 41.Torque comparison during the Accuracy Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is −50 • C. The Accuracy Test results for the FOC 4D outline, in Figure 43, the actual torque following the reference value with a low ripple.World Electr.Veh.J. 2024, 15, x FOR PEER REVIEW 28 of 32

Figure 42 .
Figure 42.Currents comparison during the Accuracy Test of the conventional FOC with LUTs at 25 • C but the magnet temperature is −50 • C.

Figure 42 .
Figure 42.Currents comparison during the Accuracy Test of the conventional FOC with LUTs at 25 °C but the magnet temperature is −50 °C.

Figure 43 .
Figure 43.Torque comparison during the Accuracy Test of FOC 4D with the magnet temperature of −50 °C.

Figure 43 .
Figure 43.Torque comparison during the Accuracy Test of FOC 4D with the magnet temperature of −50 • C.

Table 1 .
Motor design data.

Table 2 .
RMSE torque error in the FOC 4D simulation.

Table 3 .
RMSE torque error in the conventional FOC simulation.

Table 4 .
RMSE torque error in the conventional FOC simulation during the parameters variation.

Table 5 .
RMSE torque error reduction of FOC 4D compared to the conventional FOC.