Efficiency and Core Loss Map Estimation with Machine Learning Based Multivariate Polynomial Regression Model

: Efficiency mapping has an important place in examining the maximum efficiency distribution as well as the energy consumption of designed electric motors at maximum torque and speed. Performing analysis at all operating points with FEM analysis in the motor design process requires high processing costs and time. In this article, a machine learning-based multivariate polynomial regression estimation model was developed to overcome these costly processes from FEM analysis. With the proposed method, the operating points of the motors in different conditions during the design process can be predicted in advance with high accuracy. In the study, two different models are developed for efficiency map and core loss estimation of interior permanent magnet synchronous motor design. The developed models use few parameters and predict with high accuracy. Estimation models shorten the design process and offer a less complex model. Obtained results are validated by comparison with FEM analysis.


Introduction
Systems using electric motors have a large place in global energy consumption, while their CO2 emissions grow at significant rates [1]. Well-sized and optimized motor systems with all their components play a key role in reducing this negative effect. The most emphasized issue in studies of electric vehicles is how to extend the vehicle range as much as possible according to the current battery capacity and weight of the vehicle. This can only be achieved by the operation of electric vehicle components within maximum efficiency regions. The most important and energy-consuming components of electric vehicles are electric motors. While these motors provide the power/torque values required for acceleration and hill climbing, they also need to be as efficient as possible. For this reason, the efficiency map for the motors used in these vehicles or predicting these values as in the proposed method plays a key role in both more efficient and widespread use of electric vehicles. Especially with the development of power electronics components, induction motors are frequently used in variable speed applications. These motors are preferred because of their simple structure, low need for maintenance, and high efficiency at nominal operating points [2]. However, rotor copper losses and accordingly low thermal load ability are the biggest disadvantages of these motors. Especially in electric vehicle applications, motors containing magnets are often preferred [3][4][5][6]. However, interior permanent magnet synchronous motors (IPMSMs), some of the most often used motors in electric vehicles, are very popular due to their high torque density, high efficiency, wide speed range, and reluctance torque in addition to magnet torque [7,8]. Motors used in electric vehicles are operated in a wide speed-torque range. Hence, in motor selection, vehicle characteristics such as vehicle weight and aerodynamics, as well as how the vehicle is used, play a key role in determining the required speed, torque, and power values of the vehicle. In addition, whether the vehicle is a hybrid or pure electric vehicle; what is the required maximum speed, torque, and power values; what is battery capacity and voltage; whether the motor has a direct drive or a gearbox; and the cost, which is the most important factor, are other important factors affecting the selection of the motor. Efficiency class standards [9] of motors used in industry mostly test motors in constant speed applications such as pumps, fans, and compressors, and IE1, IE2, IE3, and IE4 class standards are determined for these motors [10]. There is no current regulation that determines the efficiency class of motors used in electric vehicles and motors manufactured for industrial purposes. Motor efficiency mapping is an important issue in electric motor design. This graph (efficiency map), which is given as a function of the maximum torque produced by the motor depending on the motor speed and efficiency, is crucial in determining the area where the electric motor is most efficient in different driving combinations, especially when presented with the drive cycle. In addition, parameters such as motor total losses, axis flux and current values, and copper losses are also determined within voltage and current limits [6]. However, while doing this, the current, current angle, voltage, and torque values applied to the motor windings at each operating point, as well as the rotor speed and position, can be recorded in appropriate resolution. The motor efficiency map determination is carried out experimentally, through the analytical model or by analyzing the Finite Element Model (FEM) of the motor [11]. In the experimental method, in addition to the motor shaft power, the voltages applied to the motor windings and the currents drawn can also be recorded. This is possible once the drive motor is manufactured and ready for testing. However, prototyping and testing process steps must be carried out repeatedly for improvements after experimental results. This process is both costly and time consuming. In the FEM method, time-dependent transient analysis is usually performed on the 2D or 3D model created depending on the physical dimensions, material properties, and winding structure of the motor. In this method, these analyses can be repeated for different current, current angle, and speed values. However, analysis at different operating points, especially with the FEM method, is very time-consuming in terms of both time and processor load. This situation becomes inescapable in cases such as the model being 3D, whether it contains a skew or not.
In this study, a new method is presented using machine learning based multivariate polynomial regression to eliminate these deficiencies and accelerate the process. To verify and test the developed method, the data of the IPMSM modeled with the FEM method were used, and the results obtained were presented comparatively for different velocity, current and current angle values. The estimation of motor efficiency parameters using learning algorithms has attracted considerable attention by researchers in the motor design process [12]. In recent studies, Deep learning (DL) and Neural Network (NN) methods have been used for efficiency map estimation [13,14]. The main contribution emphasized in these studies is the reduction of the design process of the modeled motor compared to the FEM method. In the proposed method, in addition to the reduction of the design process, a multivariate polynomial regression model is used, and a model that can make predictions with high accuracy using fewer model parameters has been developed.

IPMSM FEM Model and Efficiency Map Calculation
The IPMSM used in the modeling is shown in Figure 1. The analyzed motor has a power of 50 kW and a torque of 400 Nm. Detailed information about the motor is presented in Table 1 [15,16]. In the designed motor, the oil cooling system is used to prevent the winding temperature from exceeding the specified limit value. Figure 1b shows the magnetic flux density distribution at full load and rated speed. As shown in the figure, the maximum value of the stator tooth average flux density (m1) is 2.07 T, and the end of the rotor flux barrier is 2.58 T. These are oversaturated regions. However, the stator back iron section was found to be 1.51 T on average.
The flux density distribution plots provide important information for determining the motor performance. Ideally, the flux density distribution should be kept as low as possible to reduce both magnetic reluctance and core losses. Figure 1c shows the watt loss curve of JFE_Steel_35JN300 laminated steel used in the stator and rotor with respect to frequency. It is an important curve to see the effect of source frequency on motor efficiency in variable speed motors.   Two methods, known as Magneto-static FE and Transient FE, are generally used in FEM analysis. In the magneto-static method, the current values defined by considering the current density are used for excitation and the results are obtained by repeating analysis at different rotor positions. In the second method, performance graphs such as motor current and torque are obtained by stimulating the motor windings with a time dependent voltage source. Especially if the motor model is analyzed by creating a 3D model instead of a 2D model, this method offers solutions that are very close to the experimental results. However, because the model is complex and requires a high level of mesh, the solution time is quite long. Another preferred method in FEM analysis is the reference frame, where sinusoidal variables are defined as constants. In this method, flux linkage values (cross-saturation terms) in the and axes are defined by Equations (1) and (2) [17].
, , and given in the equations are the inductance values of the motor in the relevant axes, and and are the flux linkage values dependent on currents in and axes. In this case, the steady state voltages and torque expressions in the axis set are expressed by Equations (3)-(5).
and expressions given in the equations represent and axis voltages, stator winding phase resistance, electrical working speed, pole pair, and stator end winding inductance. Accurate determination of losses is very important in motor efficiency map calculations. Generally, the most dominant losses in electric motors are stator joule losses. Joule losses depend on the square of the motor current and the winding resistance. However, especially in inverter fed motors, as high frequencies are increased, temperatures increase, and losses increase due to skin effect. The change of phase resistance with temperature, skin, and proximity effects are very important for the correct calculation of stator joule losses. For the correct calculation of AC resistance in the package program used, the change of resistance at 0, 100, …, and 500 Hz supply frequencies was introduced to the program, and the effect on temperature on resistance section was activated to calculate the losses in the most accurate way. Another issue to be considered in the efficiency calculation is core losses. As it is known, core losses vary depending on the supply frequency and flux density [18]. However, the effect of hysteresis losses and harmonics in the supply voltage on the core losses should also be considered [19]. Equation (6) was used to calculate core losses [20]. With the equation presented, core losses are calculated as a function of frequency. The effect of harmonics on losses is determined. The coefficients of core losses become variable according to frequency and flux density. The correct time step size is determined according to the harmonic content.
The total core losses P is obtained according to the non-constant parameters , , and are given in Equation (6). These parameters are tabulated in a lookup table and then applied in FE using the cubic spline interpolation algorithm [20]. is the harmonic number; is the magnetic flux density related to nth harmonic, and is the source frequency. is determined automatically in Ansys maxwell tool kit program. Hysteresis, eddy, and excess loss coefficients depend on the lamination material used in the stator and rotor, respectively. Depending on the conductivity of the magnet used in magnet motors, eddy currents circulate in the magnets, and the magnitude of this current is directly proportional to the magnet volume. Segmented placement of magnets is one of the most preferred methods to reduce these losses. There are many studies on the accurate estimation of these losses [21,22]. In addition to electrical and magnetic losses, windage, friction, and stray losses are other issues to be considered in the efficiency calculation. These losses vary depending on the spindle speed, radius, and spindle length [6]. In this case, the yield expression is expressed by Equation (7).
In the presented study, an Ansys Maxwell Electrical Machine Design Toolkit was used for Efficiency map calculations. This toolkit program provides the solution to complex problems in the design of electrical machines in a short time, and its results have been tested and verified in industry [20]. With this toolkit, efficiency, torque, and other performance curves of different types of motors can be calculated and plotted. Likewise, motor core loss, solid loss, inductance, and flux linkage values together with currents can be calculated within the determined current and voltage limits. Solid loss expresses the losses of solid conductors. These losses are determined for the distribution of the eddy current density. Stranded loss is the ohmic loss caused by stranded windings. Since a stranded type conductor is defined in this study, the solid loss effect is neglected in the efficiency calculation. In the presented study, Line-Line RMS voltage is selected as the voltage control type, and the MTPA method is selected as the control strategy.

Machine Learning Based Polynomial Regression
Polynomial regression is a regression that model's components in which the relationship between an independent variable with respect to a dependent variable is not linear [23]. Polynomial regression is more suitable for prediction models, especially when the input variables have nonlinear dependence. A univariate -order polynomial regression is generally expressed in equation (8) [24]. is the input variable; is the output, and the coefficients of the polynomial model are expressed as ( , , . . . ) in dimension. Moreover, here is the bias.
If more than one variable is used in polynomial regression, it is called Multivariate Polynomial Regression [25]. The general expression of multivariate polynomial regression is given in Equation (9).
Here is the error component in the normal distribution. To explain the polynomial regression model in a more general way, its representation in matrix form is given in Equation (10).
The parameters of the polynomial model specified in the matrix form are expressed in Equation (11) as , , and , respectively.
is the inputs; is the outputs, and is the model coefficient matrix. is the number of outputs, and is the number of input variables.
The coefficient matrix used in the construction of the estimation model of the polynomial regression is calculated by the residual sum of squares method. Depending on this method, the minimum error ( ) is expressed in Equation (12).
The estimated coefficients [26] ( ) in the regression process are expressed as in Equation (13).
To obtain the polynomial regression model, the solution can be obtained through multivariate linear regression. Thus, multivariate polynomial regression also uses a linear equation to calculate the coefficients, although it calculates for the non-linear model. Depending on the multivariate linear regression model, the polynomial regression is defined in Equation (14) [6].
where is the number of input variables, and is is the degree of the equation. This expresses the general equation used in the calculation of a single output multivariate polynomial regression. The same solution can be obtained by fitting the multivariate polynomial regression model to a multivariate linear regression model.
Generalization success increases according to the degree of polynomial functions. Depending on polynomial degree, polynomial functions are grouped as quartic, cubic, quadratic, linear polynomial, and constant polynomial. Although polynomial functions are both simple and easy to compute, it has been emphasized in the literature that the preferred polynomial model has poor asymptotic, extrapolation, and interpolation properties [27,28]. Although these are the weaknesses of the relevant model, we aimed to minimize these limitations by preferring the multivariate regression model for the study.

Estimation of Efficiency and Core Loss Maps
In this study, the machine learning based multivariate polynomial regression model is used for efficiency and core loss estimation. Figure 2 shows the diagram of the proposed two models for efficiency and core loss map estimation. These developed models can estimate efficiency and core loss by training a multivariate polynomial model with the data set. Speed, gamma (current angle), and current are used for the input parameters of each model. Torque and efficiency estimation can be made with Model-1, and torque and core loss estimation can be made with Model-2. It is difficult to create an estimation model because the core loss estimation model requires a complex nonlinear model [14]. The accuracy of the core loss estimation model is important because of its impact on the design process. For this reason, two separated models have been created to make high accuracy estimations for efficiency and core loss estimations.

Models Input Parameters Input Variables Output
Model-1 Based on the general expression of the multivariate polynomial regression Equation The coefficients of the output functions , , , depending on the function ( , , ) specified in Equation (15) are given Table A1 in Appendix A.
The functions used for efficiency and core loss map predictions using Model-1 and Model-2 are associated with the motor and FEM parameters as input variables and output functions. In determining the input variables of the prediction models, the current angle (gamma) and the applied current are very important in determining the points where the maximum torque occurs according to the MTPA method. In addition, in order to calculate the efficiency in constant torque and constant power regions, all speed regions must be scanned. For this reason, these 3 parameters were selected as input parameters. The relationship between these parameters and the output parameters is also seen in the correlation coefficient matrix.
The developed estimation models are trained by using speed, gamma, current, torque, efficiency, and core loss parameters obtained from the previously designed IP-MSM FEM. The main reason why multivariate polynomial regression is preferred in the proposed method is that the training parameters used contain nonlinear components. The correlation coefficient is used to examine the relationship between the training parameters. Correlation coefficients indicate the linear relationship between parameters [29]. The coefficient of correlation measures how much the input variables affect the output variables in data analysis. In Equation (16), the coefficient of correlation ( ) is defined as: the correlation between input variable and output variable .
where n is the number of data points in the dataset; is the input variable, and is the output variable. At the same time, the coefficient of correlation gives the direction and coefficient of the linear relationship between the variables. The direction of the linear relationship is in the range [−1,1]. As the coefficient of correlation approaches 0, the linear relationship decreases. When we look at the correlation graphs in Figure 3, it is seen that they contain non-linear components.

Data Set
In the method, the model results obtained from FEM analysis are used as a data set. This data set consists of Speed, Gamma, Current, Torque, Efficiency and Core loss parameters. The whole data set consists of 3325 data for each parameter.
The distribution of each parameter of the whole dataset among each other is expressed in Figure 4. The input variables have a non-linear dependence on the distribution of the data set. Moreover, since there is a non-linear relationship between the input and output parameters, the proposed multivariate polynomial regression models are very effective for Efficiency and Core loss.  Figure 5 shows the flow diagram of the proposed method that expresses the efficiency and core loss estimation process. The data set used for training the developed models is divided into 2 parts. This division is training and test data. The whole data set consists of many "samples" of different speed values. Depending on the values of each Speed_rpm, the data are divided into 67% training and 33% test data. According to this split, 2233 training data and 1092 test data are generated for each parameter. This split value is sufficient to generate Efficiency and core loss maps. This procedure of splitting the data set has a distribution that allows the data to form an accurate prediction model.
The first part is the training set, and the other part is the test data used for model prediction. For the training of Model-1 and Model-2, 33% of the dataset is used for efficiency and core loss estimation. The remaining part is used as the training set. The training and test data are shuffled before training the models to increase the efficiency of the model. Model-1 and Model-2 are trained with polynomial regression. The results obtained from the trained model are used to generate prediction results according to the test data set. The effectiveness of the model is measured by evaluating the performance of the prediction results. In the present study, the degree of polynomial equation for the multivariate estimation model of Model-1 and Model-2 was determined as 5. This value is obtained after several experiments and is chosen for the best result. Machine learning based regression analyses for Model-1 and Model-2 are performed with python programming language based scikit-learn package. The training and testing processes of the prediction model are implemented on an 8 GB RAM computer with an 11th Gen Intel(R) Core (TM) i5-1135G7 2.4GHz CPU.

Performance Metrics
In order to evaluate the performance of the prediction results obtained from the proposed models (Model-1, Model-2), estimation performance skills are examined with regression metrics.
, MAE (Mean Absolute Error), and RMSE (Root Mean Square Error) metrics are commonly used to evaluate the results of the regression models developed in this study. The results are used in the calculation of the metrics specified in Equations (17)(18)(19); means the results, the predicted results. The general expression for (R-squared) is given in Equation (17). The metric is also called coefficient of determination [30]. This metric describes the relationship between actual results and predicted results. It specifies the variation between dependent variables and independent variables. The higher this value, the better the model [31]. The best value for is 1.
MAE gives an absolute mean measure of the errors of the estimation model [32]. Since it calculates the absolute value of the errors, it is useless in estimating the direction of the error. MEA shows the effect of outliers in the results obtained in the estimations model [33]. It also indicates how close the estimates are to the actual values. MAE is generally expressed in Equation (18). The error decreases as the MAE criterion approaches 0.
The RMSE is a metric of the square root of the mean squared error between the model predicted value and the true value [31,34]. The general expression of the RMSE is given in Equation (19). It can show the effect of estimated small-scale values on the error. A better model is obtained as the error value approaches 0 in RMSE.

Performance Evaluation of The Proposed Models
The proposed Model-1 and Model-2 for efficiency and core loss prediction are trained by machine learning based multivariate polynomial regression. The training and prediction (test) errors of the proposed models are evaluated with different performance measures such as , MAE, and RMSE. In addition, the k-Cross-Validation technique is used to evaluate the validation performance of the model.
The training and test error results of the model are presented in Table 3. , MAE, and RMSE metrics are used to evaluate the test and training error results obtained for Model-1 and Model-2. According to the metric, Model-1 and Model-2 predictions have achieved successful results with values very close to 1. The metric indicates the success of the variation between the input and output parameters of Model-1 and Model-2. According to the MAE criterion, each model obtained values close to 0 when evaluated. Thus, the models did not produce extreme values in outlier prediction results. The RMSE measure is a general indicator of the effect of small-scale errors of the estimation models on the model. Since the RMSE values are very close to 0, the prediction accuracy of the model is quite high. The k-fold Cross-Validation technique is used to validate the performance of machine learning models more effectively [35]. is usually chosen between 3 and 5. In this study, k is chosen as 5. As shown in Figure 6, cross validation divides the dataset into parts. The error of each part is calculated. The average of the calculated errors determines the validity of the model. MAE is used for error calculation.  Table 4 shows the 5-fold cross-validation scores. For , MAE, and RMSE, k fold cross-validation scores are calculated in 5 steps. The cross-validation score is determined by averaging the 5 values obtained for each metric. According to the obtained metrics, the average prediction performances of the model have high accuracy measures. The crossvalidation score calculated for Model-2 has a higher accuracy than Model-1. This is because there is a more linear relationship between the input and output parameters of Model-2. Although the cross-validation scores of the models differ, the prediction error of the proposed model is quite low compared to the training and test error.

Results of the FEM and Proposed Method
In IPMSM's FEM analysis, calculations are made according to the Maximum Torque per Ampere unit (MTPA) strategy. Torque, speed, DC Bus voltage, and the trajectory of the current are important parameters at the given operating point. However, the PWM method and switching frequency are other important parameters. With the control method used, the points where the losses are at a minimum and the efficiencies at a maximum should be determined well.
While the current angle at which the maximum torque occurs in surface mounted magnet motors is 0 degrees, for IPMSM this value varies between 0 and 90 degrees depending on the reluctance torque. For these motors, the angle at which the maximum torque occurs must first be determined. In Figure 7a, the torque curve obtained according to the current angle and the maximum value of the applied current are presented. As can be seen, the maximum torque value is 406 Nm at 50 degrees. Another aspect is the constant torque and constant power zones for this motor. In Figure 7b, 0-1194 rpm is the constant moment, and 1194-10,000 rpm is the field weakening area. Figure 8a shows the FEM efficiency map presented as a contour graph. It is seen that the motor maximum efficiency is 96% at speeds close to the corner speed. Figure 8b shows the efficiency map estimation for Model-1 trained with polynomial regression. The estimation result is in good agreement when compared with the FEM results. According to the FEM results, the estimation of the motor maximum speed shows close values. Core loss map FEM and estimation results are given in Figure 9a and b, respectively. According to the results obtained from the FEM analysis, as expected, the highest losses are closest to the maximum speed, that is, the points where the supply frequency is highest. The estimation results of Model-2 trained for core loss are in close resemblance to FEM analysis. The estimation results are of high accuracy comparable to the FEM analysis during the design process. Different parameters of speed, angle, current, core loss, and efficiency are used to develop the prediction models, which consist of training and test data. FEM and prediction compatibility for Model-1 and Model-2 of 50 different test data samples selected from these data are examined in detail.
In Figure 10. the estimated torque and efficiency match analysis with Model-1 is shown comparatively. The FEM and test data in 50 different samples estimated by Model-1 are close. Efficiency map is often used in 2D-3D FEA analyses for different speeds, different current angles, and different currents to obtain the motor performance of the motor model using parametric analysis and, accordingly, draw an efficiency map.
In variable speed motors, the fact that the source output is far from the sinusoidal waveform affects the winding resistance at high frequencies. Due to situations such as the skin effect, accurate estimation of winding resistance is very important in obtaining accurate motor performance. For this reason, the regression model uses two separate models for both core and other losses.
In this method, if the model is 3D or contains more than one stator/rotor, the analysis time is quite long. However, since the method is machine learning based, it can predict the motor performance value using less data, which saves time and resources for motor designs. The time performance of FEM and proposed models for predicting efficiency and core loss is examined. The comparison of the processing time of the prediction process with the machine learning based multivariate polynomial regression model is presented in Table 5. Thus, the time spent per process for the results obtained by FEM analysis is considerably longer than that of the proposed method.

FEM
Proposed Method 15 s 0.0203 s

Conclusions
The efficiency map in electric motors is often determined by detailed analysis based on FEM. In these analysis, losses, torque, and flux linkage values are mapped depending on the currents in the d and q axes and motor speed. The efficiency mapping time of the 2D or 3D model designed with FEM takes days. In the presented method, high accuracy efficiency map and core loss estimation are made using a polynomial regression-based model. Thus, the design process is shortened with the proposed method.
The developed method offers a less complex model than ANN, DL, or other similar learning algorithms. Models that can predict with high accuracy are created using a small number of parameters. In the design process, an important advantage is provided by predetermining the operating points of the motors under different conditions. In addition, highly accurate efficiency and core loss estimations are validated by performance metrics. The developed estimation method can be applied and modified to motor types in different topologies.

Conflicts of Interest:
The authors declare no conflicts of interest.