Eco-Driving Optimal Controller for Autonomy Tracking of Two-Wheel Electric Vehicles

)e eco-driving profiles are algorithms able to use additional information in order to create recommendations or limitation over the driver capabilities.)ey increase the autonomy of the vehicle but currently their usage is not related to the autonomy required by the driver. For this reason, in this paper, the eco-driving challenge is translated into two-layer optimal controller designed for pure electric vehicles.)is controller is oriented to ensure that the energy available is enough to complete a demanded trip, adding speed limits to control the energy consumption rate.)emechanical and electrical models required are exposed and analyzed.)e cost function is optimized to correspond to the needs of each trip according to driver behavior, vehicle, and traject information. )e optimal controller proposed in this paper is a nonlinear model predictive controller (NMPC) associated with a nonlinear unidimensional optimization. )e combination of both algorithms allows increasing around 50% the autonomy with a limitation of the 30% of the speed and acceleration capabilities. Also, the algorithm is able to ensure a final autonomy with a 1.25% of error in the presence of sensor and actuator noise.


Introduction
e growing presence of electric vehicles in the market caused an accelerated development of hardware and software in order to build more attractive vehicles to customers. Even when electric vehicles still have challenges to overcome such as the charge time, autonomy, standardization of charge process, charge stations, or recycling process, one of those aspects highlighted by its effect over the autonomy is the balance between ecological driving profile and performance. At the moment, the driver is in charge to make the balance between both according to the amount of autonomy that is required [1]. However, there are some tools able to improve the capabilities of the driver to estimate the autonomy of the vehicle according to his current actions. e two most representatives are the driving alerting system and the eco-driving profiles optimizer [2]. e driving alerting system is an algorithm able to considerate external variables for updating the estimated autonomy value. is kind of algorithms requires the same set of data and dynamic models as other Advanced Driver Assistance Systems (ADAS) already implemented in the market [3]. e dynamic models required are the longitudinal vehicle data and battery model. According to the external current data about weather, road, traffic, and so forth, the acceleration profile is estimated based on the historical data set of acceleration profiles in the same conditions. e acceleration profile is translated to a power demand and it is sent to the SoC (state of charge) estimator. e SoC estimator uses the power demand profile and the battery dynamic model to determine if there is enough energy to complete the travel or not.
External information required by the driving alerting system is as follows: (i) Terrain parameters.
(v) Speed limits. ese parameters allow determining the capability of the driver to follow the speed reference.
In [4][5][6], all information is obtained from different sources such as Google Maps and Wunderground.com to make a historical data based range estimation. is is one of the most simple algorithms proposed to evaluate the current travel configuration to make a realistic autonomy estimation. e data based estimator proposed in [6] does not use traffic behavior and it is not able to distinguish the mean speed proposed by different users. In other words, it is not able to use the historical data of the driver behavior. Even when the algorithm has those limitations, it is able to reduce the estimation error of the autonomy in function of weather/ road conditions. is algorithm showed a reduction of the autonomy estimated from 12% to 64% in some weather conditions; this reduction could not be estimated by the other contemporaneous algorithms. is result depends on the conditions of each travel.
e data based estimator proposed in [5] is able to increase the number of variables used in order to contemplate the drive profile and the traffic conditions but due to the number of possible combinations between them, there is a computational time limitation that makes it impossible to continue reducing the autonomy uncertainty.
As was mentioned before, the possibility to estimate the range opens the possibility to quantify the efficiency of the road and the driver actions. In consequence, the "ecodriving profiles optimizers" appear. Such algorithm is capable to use the information analyzed by the driving alerting system in order to find the optimal way to reduce the overall energy consumption. It proposes driving limitations over speed or acceleration commands to ensure that the trip will be completed. e driving mode where those limitations are active is called the "eco mode." e internal combustion and electric vehicles are sensitive to speed commands optimizations but the electric vehicles show the highest potential with a range improvement of 18% in front of the 7% achieved by internal combustion vehicles with same speed commands optimizations [7]. at is due to the fact that the proportions of losses caused by heat and friction in internal combustion engines are not comparable with the electric vehicle losses due to the same phenomenon. In other words, the power chain is more efficient in electric vehicles than in internal combustion vehicles; then the efficiency of electric vehicles is more sensitive to losses due to external factors like speed profile.
Due to this potential, in parallel to the autonomy estimators, the speed profile optimizers appear. For example, in [8], a macroscopic representation of the energetic behavior is used to feed a fuzzy controller. e objective of this controller is to evaluate the external parameters of the travel and the battery state of charge (SoC) to determine when it is possible to extend the range. e controller manipulates the speed/acceleration limitations through the drive mode options: dynamic (sport), economic, or eco-dynamic (eco mode). As a result, even when power chain losses and gear losses are not considered, the "adaptive operation mode" proposed by the fuzzy controller was able to increase the range around a 10%.
Fuzzy controllers are sensitive to rules description. For this reason, a controller that uses the nonlinear model of the mechanical and electrical behavior of an electric vehicle can improve the resolution of the control signal. For example, in [9], an optimal control is formulated. is paper takes five models into account: the model of longitudinal dynamics of the vehicle, the motor/inverter model based on efficiency maps obtained by FEA (finite element analysis), the model of auxiliary power consumption sources, the hydraulic brakes model, and the battery model. e dynamic programming algorithm cost function proposed has three components: the power of the battery, the time required by the travel, and the smoothness of speed profile. Besides, there are two constant values that have to be proposed by the user in order to achieve a balance between the travel duration and the smoothness of speed profile. e algorithm was able to save 14.8% of the SoC in a trip of 19 km with a combination of urban and highway speed profiles.
is algorithm is an offline approach; then a higher quantity of SoC can be saved if a closed-loop controller is proposed due to the fact that the controller would be able to react to external disturbances in real time. en, compilation time has to be considered. e dynamic programming requires segmentation of the complete problem in order to divide the optimal problem into easy-to-solve subproblems. e number of subproblems (n) and the number of possible states (N) in each subproblem will describe the complexity of the solution O(n, N). en, two options can be explored to deal with the dynamic problem complexity. On one hand, the amount of subproblems (n) required to bring resolutions to the algorithm can be optimized. For example, in [10], the quantity of energy saved is compared to the number of traject segmentations (n) to find the optimal value of segmentation required. On the other hand, the number of possible states in each subproblem (N) is reduced in order to keep acceptable balance between complexity and resolution.
is analysis can be extended to other kinds of optimal controllers; for example, in [11], the same energy management problem is boarded but a simplification of the battery model is proposed to avoid the relationship between the internal resistance and the open-circuit voltage with the state of charge. As a consequence, the dynamics of the state of charge can be ignored in each subproblem using average values of internal resistance and open-circuit voltage.
is approximation achieves reduction between 80% and 95% in the compilation time without affecting more than 1% of the quantity of energy spent along the trip when the algorithm is applied. e potential of the eco-driving made with offline optimization like the one presented previously is reduced by the inconvenience of an offline technique. e openloop optimization does not take into account the disturbances that could appear along the traject such as traffic and lights. For this reason, a closed-loop technique like the technique presented in [10] is explored. In this paper, a hybrid vehicle's energy management is optimized along two types of speed profiles: new European driving cycle (NEDC) and urban dynamometer driving schedule (UDDS). A bilevel MPC is proposed in order to reduce computational time and to simplify the hybrid optimal problem. In the external loop, a Krylov subspace method is introduced to optimize the velocity trajectory and to improve computational efficiency at the same time. In the internal loop, an explicit solution of the optimal torque as a result of an energy split between both energy sources and the gear shift schedule is proposed by Pontryagin's minimum principle and combination of numerical methods. Even when the energetical results are not comparable between this paper and the latest papers presented due to the hybrid nature of the vehicle, this paper allows determining the feasibility of online techniques. Besides, the comparison made in the paper between offline technique and the online technique allows determining that the closed-loop method proposed is able to save the same quantity of energy as the open-loop technique but it is also able to take the disturbances into account. For this reason, only closed-loop techniques are able to bring those results from simulations to real products in market.
is paper presents an eco-driving optimizer with a closed-loop architecture oriented to two-wheel electric vehicles because the dimensions of those ones cause the strictest balance between the battery size and vehicle performance. In Section 2, the theoretical mechanical and electrical models required for the controller synthesis are introduced. In Section 3, the power demand profiles required to obtain a comparable test are mentioned and explained. In Sections 4 and 5, the open-loop optimal controller proposed and its extension to closed-loop technique are exposed. In Section 6, a sensibility test is presented to ensure the behavior of the closed-loop controller proposed and, also, an additional optimization is introduced to ensure that the weights from cost function are well synchronized according to the amount of autonomy required by driver. In Section 7, the results obtained by the controller are presented and finally, in Section 8, conclusions and future work are presented.

Mechanical Model.
In [12], initial studies about the mechanical requirements of the dynamic model such as the number of states required to represent the energy consumption are presented.
is section represents the conclusions of this initial study and the connection of mechanical study with the electrical concepts. is paper considers an urban speed profile; for this reason, slippage over a longitudinal axis can be omitted [13]. As a result of this hypothesis, the angular speed of each wheel can be omitted as a new state and the longitudinal movement will not depend on the relationship of longitudinal speed and its equivalent angular speed [14]. It will be the result of the summation of forces along the x-axis; also, lateral dynamics are omitted to focus on energetic requirements. In Figure 1, the road considerations and the forces involved are reported. Applying Newton's second law for motion along the x-axis, the longitudinal dynamic is described as follows: where R wf , F roll , F aer x , F w,s , and β are the effective radius of rear wheel, roll resistance, aerodynamic force associated with x-axis, weight, slope angle, and bank angle.

Forces Involved in Energy
Losses. According to [15], the most relevant opposite forces to the longitudinal movement in a vehicle are the following: (i) Aerodynamic force.
(iii) Slope of the road. (a) Aerodynamic force: it can be expressed as where ρ, C d , A f , _ x, V wind , and α air are the air density, drag coefficient, front area, vehicle speed, wind speed, and the angle between air and vehicle direction. In average conditions, aerodynamic force can cause between 20% and 40% of energy expenses in a motorcycle depending on the motorcycle chassis, the speed of air, and the angle between vehicle speed and airspeed [16]. e aerodynamic force has to be separated by its influence in x-axis and y-axis. ose magnitudes will depend on the angle between wind direction and vehicle speed vector direction.
(b) Rolling resistance force: it can be expressed as where μ 0 , μ 1 are two friction coefficients of the road, F z is the normal force of the vehicle, and θ s is the slope of the road. e friction coefficients of the road depend on the state of the road. For example, a new asphalt is [0.01, 0.008] and the frozen asphalt is [0.001, 0.00082]. is variation of coefficient can cause an error of 15% of the autonomy estimation [16]. e motorcycle is a multibody platform; then there is a load exchange between the front frame and rear frame caused by acceleration and brakes profile. However, a peak normal force is considered to calculate the rolling resistance force due to the fact that the frequencies of the normal force transference are faster than energetic dynamics.
(c) Slope of the road: when the road presents a slope by a medium or long distance, the load exchange cannot be ignored. In this case, the load exchange does not have a dynamic but it creates a weight component in x-axis and y-axis, which affects the forward and lateral movement dynamic. e equation that describes this effect is where m and g are the mass and gravity.

Motor Losses.
ere exist many kinds of motors and each kind exhibits particular characteristics that make it useful for a particular industrial usage. For the electric vehicle industry, electric motors require attributes such as low Journal of Advanced Transportation maintenance cost, simple design, high efficiency, and relievable control techniques with the minimum additional electronic devices.
Between the synchronized motor and induction motors, the synchronized motor is highlighted due to its lack of speed variance faceto load changes and its high efficiency in low and medium speeds. ose characteristics caused the most used electric motors in the transportation industry to be the synchronized motors due to the fact that they can be easily controlled in a profitable way. In a particular way, the BLDC (Brushless Direct Current) motors are used due to the fact that they improve the torque to weight ratio, reduce even more the maintenance cost, and allow increasing even more the efficiency values in comparison to brushed motors [17]. e BLDC motor efficiency behavior can determine the optimal operation point of the electric vehicle. In order to propose an optimal point as an optimization objective, a theoretical analysis of the steady-state efficiency is presented. In a BLDC motor, the efficiency in steady state can be defined as where η is the efficiency and it is defined as the relationship of the output power (P out ) over the input power (P in ) of the system. e output power is described by the mechanical power obtained by the motor, in other words, the product between the electromagnetical torque (T e ) and the angular speed of the motor (W s ). e input power is described as the output power plus the losses of the motor. In the motor, the losses will be P lcu , P lfe , and P lmag . ey are the Joule losses (also called iron losses), the core losses, and the magnetic losses in rotor magnets.

Magnetic Losses.
e magnetic losses caused by eddy current loss in the permanent magnets of brushless machines are usually neglected [18]. Since the fundamental air gap field usually rotates in synchronism with the rotor and time harmonics in the current waveform in the winding distribution are generally small, P lmag ≈ 0.

Joule Losses.
e Joule losses are the losses caused by the resistivity of the cooper in winding. When a current crosses a conductor material, the resistivity of the material is opposed to this current movement. As a result, heat is produced and part of the electrical power is dissipated. ey can be expressed as [19,20] where ρ cu , D o , D i , B g , B t , B j , K fill , K fe , p, L, L ew , K w , and K sp are the copper resistivity (Ohm.m), the stator outer diameter (m), the stator inner diameter (m), the air gap flux density (T), the flux density in stator tooth (T), the flux density in stator yoke (T), the slot filling factor, the lamination factor, the number of pole pairs, the stator lamination length (m), the length of end-winding (m), the fundamental winding factor, and the fundamental current density (A/m), which can be expressed in terms of load torque "T l ." where α pm is the half of mechanical magnet angle.

Core Losses.
Core losses appear in a magnetic core due to alternating magnetization as a consequence of the nonperfect synchronization between electrical and magnetic fields. ey are the sum of the hysteresis losses (due to the difference between magnetization rate and demagnetization rate) and the eddy current losses (due to Faraday's law effect over lamination motor structure caused by magnetic fields). e core losses are defined as [21] P lfe � P l e dd y oke + P l t + P l t t , (8) where P l e dd y oke , P l t , and P l t t are the losses in rotor yoke due to eddy current and losses in tooth body and tooth tip caused by hysteresis and eddy current. ey can be expressed as P l e dd y oke � n y f p where n y , f, p, R y m ean , and A ry are the number of rotor yokes, frequency, number of poles pairs, mean radius of the rotor yoke, and the area of the rotor yoke face. ρ Fe , μ Fe , B i , B tott , and α tott are resistivity and the mean permeability of the rotor yoke material, the magnitude of the ith harmonic of the armature flux density wave, the peak value of flux density at the tooth or the tooth tip, and the mean pole transition angle in electrical radians. Finally K h , α, β, and K e are constants obtained from the curve fitting of core loss data measured with sinusoidal excitation. is representation requires three lookup tables, the magnetic flux density as a function of stator current measured in the stator yoke, the rotor yoke, and the air gap.

Inverter Losses.
Losses caused by the semiconductors inside the inverter appear on each current flux case: (i) Conduction: when the current is going from drain to source along the drain-source resistance (ii) Blocking: when a minimum part of the conduction current is able to cross along the blocking diode (iii) Switching: when the gate starts to be excited or stops Since the current that is able to cross the blocking diode is minimum, this power loss is neglected. ose losses can be classified into two cases ( Figure 2) [22]. e first one is when the current goes from power source to motor (Id). In this case, the losses per semiconductor are expressed as where R ds on , I d , W sw m os o n , W sw m os o ff , and f sw are the drainsource on resistance, the drain current, the energies that are dissipated along the rise and fall of time caused by internal capacitances, and the switching frequency.
e second case is when the current goes from motor to power source (If ). In this case, the losses per semiconductor are expressed as e conduction losses along the diode are described by the power consumed by the voltage drop (U D o ) across the diode during the saturation regime and diode resistance (R D ) due to the reverse current through the diode (I f ).

Battery Losses.
A battery model with enough capability to represent the state of charge (SoC) dynamic is shown in Figure 3 [23].
VoC, R o , C 1 , and R 1 are the open-circuit voltage (a function of SoC), the series resistance, and the RC components that describe the frequency response. e states of this model are the RC voltage U 1 and the SoC. e input is the current and the output is the output voltage U L . e mathematical equations that represent the circuit shown previously are In order to obtain realistic data, parameters obtained from LIR18650 2600 mAh lithium battery cell are used and ideal serial/parallel relationship from [24] is used to obtain the model parameters of a 45Ah 72v battery.
Finally, the lithium battery pack model is shown in Figure 4. N s and N p are the numbers of series and parallels required to complete the pack.  Journal of Advanced Transportation e losses in the battery will be caused by the power dissipated by the resultant serial resistance and the voltage on the resultant RC circuit.

Power Demand Profiles
Power demand profiles are strongly related to drive cycles considered. A drive cycle is a set of speed data, which tries to represent a common speed profile for an average vehicle under certain characteristics. It is currently used to compare the pollution emission between different vehicles. We take into account the fact that the power demand will be the translation of the drive cycle (speeds values) to the amount of energy required by the electric vehicle to follow that reference. is translation will depend on electrical characteristics of the vehicle and the external forces acting over the vehicle (Section 2) because those elements will describe the energy losses and the torque requirements on each step of time. In this paper, for example, a 72v, 50Ah battery was selected to feed the electronic devices; also, the motor has a nominal power of 3 kW. ose electrical characteristics and the travel characteristics of the road such as wind speed, wind direction, or slope will determine the amount of power required for tracking a speed profile described by a drive cycle. It is important to note that the different properties of the electric vehicle such as the weight, the front area, or the power devices capabilities will be required to do the translation between the speed reference (drive cycle) and the power demand profile.
ere are two kinds of drive cycles: In all cases, the external conditions such as wind speed and slope profile are the same to keep the results comparable. In the case of slope profile, realistic data obtained from Google Maps in a traject from Paris to Brussels were used.

Open-Loop Controller
e first approach of an optimal controller is an open-loop controller.
e controller assumes that the state x 1 is completely known and there is not any noise. en, in this case, the GPS signal is not required.

Dynamic Model.
e EV is modeled as a particle along a unidimensional axis. e motion of the vehicle is the result of the sum of forces applied on the body and only the longitudinal forces were considered. e model used to describe the system's dynamics is _ where states are x � d v e ; v(t) is the vehicle's longitudinal speed, d(t) is the travel distance, and e(t) is the energy. e input is u � T; T describes traction and braking torque. F l describes the uncontrolled inputs (looses).
Eff(x 2 , T)) represent the geometrical abstraction of the motor efficiency lookup table measured.

State and Control Constraints.
ere are two constraints in the optimal control: (i) e physical constraints describe the maximum quantity of force able to be made by the mechanical structures: (ii) e design constraints that describe the feasible region of the model states. If the states are outside this feasible region, the behavior cannot be replicated by the vehicle in a real test. ese are Constraint (19) limits the feasible region of x 1 and also it avoids an overdamped behavior. Constraint (20) is related to physical restriction of electric motor described in (18). Finally, constraint (21) is a physical limitation of the quantity of energy available in the battery.

Boundary Conditions.
Boundary conditions describe the main objective of the optimal problem. In this case, the main objective is to come from position "A" (which is the initial condition equal to zero) to position "B" which is represented by x 1f . Also, the initial value of the vehicle speed is zero and the final value of x 2 is fixed; that is,

Cost Function.
us, the complete optimal problem is min J(x) e cost function of the optimal problem described in (23) uses three terms. e first term (24) searches the optimization of the energy consumed by motor. e second term (25) is in charge to ensure that the rate of energy consumed is adequate to complete the travel with the energy available, and the last term is the speed tracking. e last term (26) is not modified because it represents driver control capacity over the vehicle and it will not be modified in the optimization level.
In (23), _ x � f(x, u) is represented by (16). Also, β 1 and β 2 are the weights required to increase or reduce the impact of the efficiency over the cost function. Specifically, β 1 is used to normalize the energy state and make it comparable with speed state, and β 2 is the additional weight of efficiency component to guide the cost function.
is last term is obtained from the relationship between (8) and (9). ese figures allow calculating a quantity of energy required per kilometer according to each β 2 value to ensure that the autonomy is the amount of distance required from the beginning. e quantity of energy required per kilometer is called energy estimation coefficient.

Closed-Loop Controller
As sensors, actuators, and external disturbances cause error over the open-loop controller reference tracking, and the closed-loop controller is required to reduce their impact.
In this case, an NMPC (nonlinear model predictive controller) is proposed. is NMPC has a prediction horizon N p � 10 and a control horizon N c � 10 (equivalent to 10 s).
ose values are chosen to keep a balance between the compilation time and the time required to obtain a significant information from trip requirements. e main objective of the cost function is to complete the travel. For this reason, two kinds of feedback signals are included: energy control feedback signal and energy estimation feedback signal.
(i) e energy estimation feedback signals are the data required to verify energy estimation coefficient on each iteration of the NMPC. is information is composed by the energy and distance state data from the system with noise. (ii) e energy control feedback signals are the data required by the NMPC to estimate the behavior of the system along the prediction horizon. ese data are composed by three states of the system with noise.
e NMPC is a discrete controller. For this reason, it needs a discrete system model: x k+1 � f(x, T, k) is a discrete version of the model represented by (16), and we have NMPC is described in Algorithm 1 also, in Figure 5, the flux of data is represented. e eco-driving controller is composed of three main elements, the NMPC required to balance the autonomy and the capability of the driver to follow a speed reference and the two blocks required to find the β 2 value: the β 2 optimization and energy estimation coefficient block. e NMPC requires the offline data described in Tables 1 and 2, the initial states, the speed reference, and the road slope value to propose the optimal torque value.
is value is added to the actuators noise (N a ) and the result is used by the longitudinal vehicle dynamic block to update the states values. When the measurement data are ready; the sensor noise (N s ) is added to the states values and they are returned to NMPC and energy estimation coefficient block. e energy estimation coefficient block takes into account the distance required by the driver (D req ) and the current state (x 1 ) after a period of time equivalent to the prediction horizon to determine the energy estimation coefficient (ϵ e c ) required to complete the trip. Finally the β 2 optimization block uses this coefficient to optimize the β 2 value and adjust the energy rate consumption and the process is replicated until the travel is completed. e mechanical vehicle characteristics are shown in Table 1. e electrical vehicle characteristics are shown in Table 2.

Sensitivity Analysis of Eco-Driving Balance
As described in algorithm (1) and equations (23), the cost function requires a weight β 2 . is parameter will determine the preference of the eco-driving algorithm between the most constrained speed profile and the least constrained speed profile.
is test will help to determine the range of parameter β 2 to verify that the effect of the variation of this parameter is the correct one. In other words, the behavior of the cost function is logical with the variation made. Also, the test aims to determine the characteristic of the nonlinear unidimensional optimization required in block called "β 2 optimization." In order to represent the results, the variables chosen are as follows: (i) e speed signal: the minimum, maximum, and average values of the speed signal will determine the limitation proposed by the optimal controller.
(ii) e efficiency of the motor: since a geometrical representation of the motor efficiency is included inside the cost function, the augmentation of the parameter β 2 must increase the efficiency or at least keep it constant in the highest efficiency values speed/torque region.
(iii) e energy signal: this is the variable required to measure the results of the controller. Its reduction will be defined by the β 2 parameter. (iv) e autonomy expected: in order to represent the final results of the controller, the cost of each kilometer is used to estimate a final autonomy obtained with each β 2 value.
e speed profiles presented in Section 3 are used to compare the behavior of the variables efficiency, speed, energy, and autonomy when the β 2 value is variated. All speed profiles have been divided into two versions, medium-(shown first) and low-speed versions, in order to analyze the results in each situation. In order to make all tests comparable, the objective is to cover a distance of 10 km. Also, since in the cost function the β 2 value can increase the weight of the efficiency components without reducing the weight of speed follow, the β 2 value does not have a range between 0 and 1 necessarily. e range evaluated in this test is from 0 to 5 in order to find where the results are stable and justify the final β 2 range. e average speed is shown in Figure 6. In this figure, the average speed (y-axis) is evaluated on each speed profile, while the β 2 value is variated (x-axis) in order to verify the effect of this coefficient variation. ere are two figures about average speed because all speed profiles are divided into their urban traject components and rural traject components. e β 2 value augmentation causes a preference of the controller by the optimal speed values in relationship with the amount of torque made on each step. is is the reason why the average speed of all speed profiles comes to a value close to 7 (m/s) in high rural profile components, with the high-speed values still being present in the optimized speed profile, and this is why even when the average speed decreases, it is higher than the average speed in rural components where the number of stops and low-speed values are present. In other words, the maximum values are reduced and minimum speed values are augmented to keep the average speed value close to the optimal value. Also, the feasible speed zone around the optimal value is reduced when the β 2 value is augmented. e efficiency value obtained is shown in Figure 7. In this figure, the separation between urban traject components and rural traject components is used to illustrate in which situation the augmentation of β 2 coefficient is efficient or if it is 8 Journal of Advanced Transportation not. As can be seen, in high-speed values, β 2 variation causes a strong positive effect due to the fact that the high-speed values have a stronger effect over total motor efficiency than low-speed values. On the contrary, in the low-speed version of the speed profiles (in the most of cases), the average speed is as close to the optimal speed value that β 2 variation does not have a significant effect. e energy value required to cover a traject of 10 kilometers with each speed profile is shown in Figure 8. Since the average efficiency has increased, the amount of energy required decreased.
is analysis is important to determine the energy estimation coefficient required to optimize β 2 . After a period of time equal to the prediction horizon, the energy estimation coefficient value is checked in order to optimize it, if it had changed by external noise effect. en, the initial energy estimation coefficient is compared to the energy estimation coefficient required to complete the travel and a new β 2 value oriented to reduce the difference between both is found by optimization. From this analysis, it can be highlighted that the β 2 value presents a nonlinear function without local optimal points. is analysis aims to choose a unidimensional optimization methodology and then the algorithm required to solve the problem. e energy value and the final distance (10 kilometers) allow predicting the autonomy under those conditions. It is shown in Figure 9. e efficiency in Figure 7 shows that the biggest potential of the algorithm is in high-speed profiles but the information of autonomy values obtained in lowspeed profiles will be used as a limitation due to traffic regulation. In low-speed profiles, the highest autonomy variation is obtained from 0 to 2.5. Also, the speed variation proposed if the β 2 value is superior to 2.5 cannot be followed BEGIN Choose the initial states of the vehicle system. Introduce autonomy required (D req ). Gather information required for optimization from three sources: vehicle, rider and digital devices. Calculate energy estimation coefficient required to complete the travel η e c . Find the β 2 value required to complete the trip. Choose the initial states of the system. Solve optimal problem 25.    Journal of Advanced Transportation in normal traffic conditions. For this reason, in electric vehicles outside of an autonomous environment, the β 2 range will be from 0 to 2.5.
In conclusion, the algorithm is able to obtain improvements of more than 50% of the autonomy of the vehicle with limitations around 30% of maximum and minimum speed values. Even when the speed profile proposed by the controller cannot be used in all traffic situations, a β 2 value from 0 to 2.5 is able to improve the autonomy in a realistic situation. Also, the usability of this algorithm can be extended to the study of behavior composed by autonomous vehicles in order to reduce speed profile limitations. e energy per kilometer is a coefficient able to represent the efficiency required by the driver in order to complete travel; then it is used to find the balance between eco-driving and free driving. Finally, due to the nonlinear function that describes the energy per kilometer does not have suboptimal points, a unidimensional algorithm focusing on compilation time can be used.

Results
e experiment represented in Figure 10 consists of recreating an urban driving mission profile along a trip. e driver is in charge to propose the autonomy required and the energy per kilometer is calculated. e speed profile chosen is the NREL Class 6 drive cycle developed by Smith Newton from NREL Labs [25] because it was designed for light electric vehicles in an urban environment. e speed profile was repeated until the objective distance is completed by the vehicle.
It is important to note that only the motor losses are taken into account by the controller but the battery, driver, and motor losses are used to represent the real behavior. e controller does not take into account the battery and driver losses because those losses are proportional to the speed. In consequence, their minimization would cause the critical speed reduction of the vehicle. e disturbance is a uniformly distributed signal. It is added to the torque signal proposed by the controller to represent the actuator noise; in this context, it will determine the error between the speed profile estimated and the speed profile proposed by the driver due to firelights, changes of direction, or other external causes. As a result of this analysis, the errors between the autonomy estimated required by the driver and the autonomy estimated obtained are compared. e maximum value of the actuator noise is 10% of the maximum torque value. Also, uniformly distributed signal that is not correlated with the last one represents the measurement noise. Its maximum value is 1% of the maximum possible values of states. e autonomy values demanded by the driver along the test presented were from 17 km to 160 km even when the vehicles with similar characteristics are designed for autonomies between 80 km and 100 km according to the user manual. e initial SoC was from 20% to 100%. e controllers were able to complete the travel with a maximum error of distance of 1.25%; the autonomy required is always not greater than 90% of the autonomy estimated with the greatest value of β 2 and without noise on the initial estimation. Table 3 explores the optimization of speed profile in three β 2 regions: "MaxA," "MaxNA," and "Min." "MaxA" means the maximum β 2 value admitted by the algorithm; then β 2 � 5. "MaxNA" means the maximum β 2 value admitted by the algorithm after the sensitivity analysis. is value allows keeping some control by the driver over the speed value; then β 2 � 2. "Min" means the minimum β 2 value admitted by the algorithm; then β 2 � 0. In other words, energetical optimization is not made. As can be seen, the algorithm is able to increase the autonomy over a 60% without taking away all control from the driver over the speed profile. In a hypothetic situation where it is not important to keep some control over the vehicle because the external obstacles are perfectly controlled (such as an environment of fully autonomous vehicles), the theoretical autonomy optimization increases significantly.
In order to explore a specific case, a trip of 100 km with a Class 2 urban speed profile is proposed. e current SoC of the vehicle is 80%; it means the vehicle is able to cover around 60 km without any optimization and 141 km if the vehicle totally ignores the speed profile proposed by the driver and it goes at its optimal speed value (β 2 � β 2 max ).
With β 2 � 1.6250, the internal controller (NMPC) is able to increase the autonomy of the vehicle around a 66%, keeping a correlation of 68% between the speed profile proposed by the driver and the one proposed by the controller (Figure 11). e speed profile proposed by the controller tends to avoid minimum and maximum speed values of the speed profile proposed by the driver by an acceleration limitation. As result, the mean value of the vehicle and the torque required along the travel are closer to the optimal values according to the electric motor characterization. In real implementation, some stops could be required by the driver. It would cause an error in the estimation of energy required by kilometer; this is why the external controller is required. In this experiment, the external controller is limited to reduce the noise added to simulate the measured error and the unexpected variation between the speed profile described by the driver and the speed profile contemplated on the estimation.    As can be seen in Figure 12, the disturbances caused by mistaken measures or mistaken actuator signals cause an error in the energy estimation. Since this algorithm helps to determine the β 2 coefficient required to complete the travel, the estimated β 2 tends to be higher or lower than the required β 2 coefficient due to the effect of disturbances in the estimation. Consequently, a limitation that is not required is imposed over the speed profile. For this reason, the external controller checks the energy required per kilometer in order to ensure that the estimation is coherent with the last one (calculated in the last sample time). As can be seen in Figure 13, in the case where the energy per kilometer is significantly different in comparison to the last one, the controller takes the difference between both signals to correct the β 2 value in two steps: (i) Recover the energy lost in the last mistaken estimation with a stronger limitation (ii) Recalculate the optimal β 2 coefficient with the new energy per kilometer measure to minimize the speed limitation   e resultant β 2 signal describes an overdamped behavior with a peak of 103.5% of the final value. e stabilization time is 4 iteration steps and it is important to note that each iteration corresponds to 1000 seconds. Finally, the vehicle was able to complete the travel with a final SoC of 0.06% and a final autonomy error of 0.1% (100 meters). e travel time simulated was 3.8 hours, and the simulation time of both control loops does not exceed the 35% of the sample time on each case. is β 2 coefficient active correction method ensures that the autonomy estimation is as close as possible to the one estimated initially ( Figure 14).

Conclusions and Future Work
In this paper, an online approach of eco-driving speed profiles optimizer is presented; this optimizer is composed of an NMPC and it proposes a dynamic speed limitation based on the distance required by the driver. is speed limitation proposed by the controller is able to save twice the amount of energy in comparison to closed-loop approaches present in the state of the art thanks to the fact that even when the dynamic system required by the NMPC is oriented to the fast compilation, and it takes into account the motor efficiency behavior. Besides, the dynamic system for estimations takes into account the battery and inverter efficiency behavior as well as thermal behavior. Also, it counts with a second optimization loop to minimize the effect of external perturbations caused by traffic, mistaken measures, or mistaken control signals over these energy-saving capabilities. e developed controller increases the autonomy from 15% to around 50% (according to speed profile proposed by the driver) by a limitation of speed and acceleration (keeping the speed and acceleration values lower than 70% of the maximum values proposed by the driver); but the most important approach of this algorithm is the fact that, due to the external optimization loop, it probed to use the speed optimization to ensure an autonomy error between the autonomy estimated and the autonomy obtained lower than 1.25% without taking into consideration the initial SoC but with the condition that the autonomy required is lower than 90% of the autonomy estimated with the maximum value of β 2 in the initial estimation. is approach aims to ensure the capability of the vehicle to finish travel even when facing variable conditions. In order to ensure the usability of the developed algorithm in realistic traffic situations, three statements were explored. First, the weight related to the eco-driving behavior is limited according to the results of a sensibility test but the range of β 2 coefficient can be extended to the study of behavior composed by autonomous vehicles. Second, the freedom of the driver is never compromised; then the optimized speed profile is not imposed and the differences between the speed profile proposed by the driver and the optimized speed profile are considered as noise to the energy estimation coefficient algorithm. Finally, external optimization is updated with a sample time comparable to the prediction horizon to ensure that the balance coefficient (β 2 ) is optimal to complete the travel with the minimum speed limitation even when mistaken measures and actuator signals could be present. However, the algorithm will require an additional step of speed profile identification to ensure the results present in this paper and even when some test is proposed in this paper, an extended traffic conditions test has to be performed to ensure that the internal and the external optimization behaviors are coherent in all possible situations.
Data Availability e external data used (such as books, journal, or conference papers) to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.