1. Introduction
Optimizing energy consumption is a significant challenge for both research and industrial communities. In electric vehicles, this challenge is aggravated due to the limited capacity of batteries, which ultimately limits the range and attractiveness of EVs [
1]. Two current approaches to address this issue are the development of highly efficient powertrains and advancing energy use optimization techniques.
Regarding powertrains, one example is the use of multiple energy sources to reduce the limitation of the batteries [
2]. Supercapacitors, flywheels, and fuel cells can be combined with batteries to improve the energy management of EVs [
3,
4]. The development of highly efficient electric motors [
5] and powertrain optimization [
6] are also other approaches to reducing energy consumption. In [
7], for example, the authors presented the design optimization of an in-wheel permanent magnet synchronous motor to reduce the number of materials used and the weight compared to conventional motors, and in [
8], the authors optimized a permanent magnet synchronous motor with a cobalt iron core.
The second issue addressed is energy management optimization algorithms, which offer a complementary approach to mitigating the limited capacity of batteries. In [
9], an algorithm was proposed for intelligent transportation systems, utilizing an adaptive equivalent fuel consumption minimization strategy. This approach considers the battery’s state of charge and optimizes the vehicle’s start–stop function using NARX network-based velocity prediction. This method achieved fuel savings of up to 9%. In [
10], the authors proposed a path and speed optimization strategy to extend the range of an electric unmanned marine vehicle (USV) powered by batteries and photovoltaic panels. Experimental tests demonstrated that the USV could be fully powered by PV panels under low speed and wave conditions, with path and speed optimizations increasing the range by up to 25%. In [
11], an energy management strategy was proposed for hybrid electric buses considering thermal safety and degradation awareness for lithium-ion batteries, showing a mitigation of the battery aging by 34.8%. Real-time optimization techniques also play an important role in energy minimization, as shown in [
12,
13]. The authors showed that it is possible to use effective real-time cost-minimization power strategies based on model predictive control for hybrid electric vehicles.
Therefore, optimizing the driving profile is a crucial step in energy management. It must be tailored to the vehicle’s dynamics, weather, and road conditions to minimize energy consumption and maximize range while ensuring a minimum driving time. However, in a racing environment [
14], the vehicle consumes significant energy to achieve maximum speed over the given track distance. In this critical context, this research focuses on developing energy management strategies for implementation in a racing Formula Student prototype.
Formula Student is Europe’s most established educational engineering competition, challenging engineering students from the best universities around the world to conceptualize, design, build, and test electric or combustion single-seater Formula race cars according to a specific set of rules [
15]. FST Lisboa [
16] was established in 2001 and is the Formula Student team from the University of Lisbon. Throughout its history, the team has strived to keep up with the industry’s ever-growing demands and advancements, first with the transition from combustion to electric in 2010 and then with the development of the team’s first autonomous car in 2021.
Formula Student competitions are divided into static and dynamic events. The static events assess each team’s knowledge and engineering processes. The dynamic events in the EV category include the following:
Acceleration: a 75 m straight line to test the longitudinal acceleration capability.
Skidpad: two pairs of concentric circles in a figure-eight pattern to test the lateral acceleration capability.
Autocross: a single lap on a handling track with features such as hairpins, slaloms, and chicanes, approximately 1 km long.
Endurance: a roughly 22 km closed-loop circuit with characteristics such as Autocross, including a driver change at the halfway point.
Efficiency: evaluates the vehicle’s energy efficiency during the endurance event.
Endurance and efficiency events together account for 325 out of 1000 points, nearly a third of the total available points. During the testing season, the team has limited opportunities to simulate endurance events, as these tests can deplete an entire battery pack, or come close to it. Additionally, endurance events are the most challenging to perform consistently well in, requiring meticulous preparation in car reliability, driver training, and, most importantly, temperature and energy management. Being the most challenging event in last year’s FSG [
17], only 13 EV teams successfully finished the endurance event (18% out of the 70 registered and 25% out of the 52 who started altogether).
The research began with the FST Lisboa team using a simple algorithm for energy management. Recognizing the lack of a robust controller to enhance overall performance in the endurance and efficiency events, the need for a more sophisticated system became evident, motivating this research. The ultimate objective is to develop methodologies to optimize energy use, increasing confidence in successfully completing the event and enhancing point-scoring opportunities. Regarding other solutions employed by different teams, there is very little official information due to competition purposes. However, during competitions, the students share information about their solutions. For example, the TU Munich team has devised a real-time strategy tool that predicts lap times and system temperatures during an endurance race, providing valuable information to the drivers. Also, the team from RWTH Aachen has developed a simulator that takes the track layout into account and conducts an endurance simulation. It identifies specific track segments where it is more advantageous for the driver to coast rather than continuously accelerate. This information is conveyed in real time by illuminating an LED on the dashboard, prompting the driver to ease off the throttle pedal to conserve energy. In [
18], Formula Student Netherlands developed a convex optimization framework to compute the minimum-lap-time control strategy for their vehicle.
Following this topic, we propose a methodology to generate an optimized energy reference profile and implement it in real time. As such, a pre-event optimized plan is generated through a developed offline model and implemented into an energy management algorithm that adheres the actual energy deployment to what has been deemed optimal. The proposed methodology is validated on a real closed-loop track. Therefore, the core contribution of this paper is to develop a robust application of driving profile optimization to maximize the vehicle’s performance (in this case, defined by the score) during competitions in motorsport. This strategy presents two stages. First, it requires discretized detailed models of the vehicle and track, calibrated experimentally, to be used in energy optimization algorithms. Then, a real-time implementation is proposed, where the optimized driving profile is used to limit the output power from the motors while still providing the driver the control of the vehicle’s speed and maneuverability. To achieve real-time implementation, inertial measurement units and GPS measurements are used to estimate the vehicle’s real-time position. The proposed strategy is implemented in the FST12 prototype and tested and validated on a real competition track.
This work not only contributes to the Formula Student context but also resonates with the broader electric vehicle industry. As the industry continues its pursuit of energy-efficient solutions, this research underscores the importance of simulation-based optimization and real-time energy management.
2. Methods and Models
It was essential to first model the vehicle and track it to optimize energy consumption. This modeling would enable the prediction of energy usage. The methodology, summarized in
Figure 1 as a flowchart, began with defining the vehicle and track models. This step allowed for an accurate estimation of the vehicle’s energy consumption under specific track conditions. Using these models, offline energy optimization was performed to refine the speed profile, aiming to maximize points in the endurance competition. Once the “optimal” speed profile was determined, it was converted to an equivalent “optimal” energy profile due to competition restrictions (remote speed control is not permitted). In real time, an energy management algorithm estimates the energy consumption and compares it with the reference profile at the current distance traveled by the vehicle, utilizing IMU and GPS signals. A PID controller uses this error to adjust the power limitations of the motor controllers in real time, ensuring the energy driver adheres to the optimized energy profile. Special attention is given to the distance traveled estimator, as accumulated deviations could lead to incorrect operations on the track (e.g., accelerating before a turn).
2.1. FST12 Prototype
The FST12, shown in
Figure 2, is the twelfth prototype developed by FST Lisbon. This four-wheel-drive electric vehicle features a carbon-fiber-reinforced polymer monocoque chassis, a comprehensive aerodynamic package, and a custom-built 588 V high-voltage battery. Weighing 233 kg (without the driver), the prototype boasts a power-to-weight ratio of 0.757 kW/kg. It can reach a top speed of 116 km/h and accelerate from 0 to 100 km/h in under 2.5 s.
Regulations limit the total power output to 80 kW in official events [
15]. The battery pack powers four 32.5 kW permanent magnet synchronous in-wheel motors, each capable of producing up to 21 Nm of torque at speeds of up to 20,000 rpm [
19]. Upon a demanded maximum power value,
Pmax, the control unit automatically distributes individual power limitations to the forward (
) and rear (
) motors, as in (1). The division of the maximum available power between each motor (two on the front axis and two on the rear axis) is a variable that can be defined by each team while maintaining the maximum power. It was empirically decided to distribute the power as 2/3 to the rear axis and 1/3 to the front axis, based on experience from previous competitions. This distribution provided good driving and good ground adherence during accelerations:
The e-motors’ manufacturer provided an efficiency map with field weakening for different operating conditions in terms of torque and speed.
Figure 3 depicts the motor efficiency map for the case of a rear motor when
Pmax = 40 kW, and the maximum torque was
= 21 Nm. The torque–speed–efficiency map presented in
Figure 3 was used to obtain the energy power consumption from the batteries based on the required mechanical power. The motor manufacturer provided this map, and it was corrected to include the motor controller efficiency based on experimental results.
The battery pack comprised LiCO
2 cells, which individually had a nominal voltage of 3.7 V, a charged voltage condition of 4.2 V, and a typical capacity of 7.4 Ah. Assembled in a 140s2p (140 series and 2 parallel) configuration, the battery pack provided a maximum voltage of 588 V and a total theoretical energy capacity of 7.67 kWh. While the theoretical battery capacity was 7.67 kWh, the limiting value at which the vehicle can run was lower. Many factors decreased the available capacity, such as a continuous 600 W low-voltage supply for various systems.
Table 1 lists the calculations one can perform to better estimate the energy that the fully charged battery pack can deploy.
The knowledge of the available capacity is critical for the optimization process because a small deviation can cause the energy to be drained before the track is complete. Therefore, data from previous endurance runs helped confirm this value, as shown in
Table 2. With these results in mind, the maximum energy capacity was considered to be
Emax = 6.3 kWh.
Furthermore, the prototype was equipped with a Kvaser Memorator Pro 5xHS (Kvaser, Mölndal, Sweden) data logger, which allowed for the post-processing of sensory data included in the CAN communication line. Using its sensor fusion algorithms, the Xsens MTi-670 GNSS/INS (Movella Inc., Henderson, NV, USA) estimates the position, velocity, acceleration, and orientation. Integrated into the battery pack, the Isabellenhutte IVT-S-300-U3-I-CAN2-12/24 (Isabellenhutte, Dillenburg, Germany) outputs voltage, current, power, and energy measurements in real time.
The prototype also incorporated a dedicated PC to handle data processing and generate torque requests directed to the inverters. This computing unit operates internal modules and communicates via a ROS (Robot Operating System)/CAN (Controller Area Network (CAN) Protocol) protocol.
2.2. Vehicle Dynamic Model
The vehicle model built on Newtonian mechanics was based on the dynamic bicycle, dynamic load transfer, and tire models described in [
20], and using the models’ parameters previously obtained in
Appendix A from [
21]. Its geometry can be visualized in
Figure 4. The model predicts the evolution of the vehicle state vector
x = [
X,
Y,
ψ,
vx,
vy,
r]
T. Here,
X and
Y refer to the vehicle’s global position coordinates,
ψ is the vehicle’s orientation,
vx and
vy correspond to the vehicle’s longitudinal and lateral velocities, respectively, and
r is the time derivative of the vehicle’s orientation, also known as the yaw rate. The input vector contains the normalized pedal input,
p, and the wheel steering angle,
δ, described as
u = [
p,
δ]
T.
The longitudinal propulsion force provided by each of the four electric motors is given by (2), where
ηt represents the transmission’s efficiency,
GR represents the transmission’s gear ratio,
rw is the wheel’s radius,
p ∈ [−1, 1] is a normalized pedal input, and
Tmax is the programmable maximum torque value at a given motor. Additionally, the instantaneous mechanical power used to calculate energy consumption is given by the sum of all four motors (3), where
Ti and
ωi are each motor’s operating torque and angular speed, respectively. On the right side of Equation (3), the wheel’s angular speed is converted into rotations per minute (rpm). Finally,
ηpt denotes the powertrain system efficiency:
Furthermore, the grip at each tire,
FT, was estimated through individual static loads,
Fzstatic, dynamic load transfers, ∆
Fz(x or y), and downforce,
FDF, adding up to a given vertical tire load,
Fz, which saturates the traction force if under the previously generated motor force ((4) and (5)). In (4),
µx is a linear longitudinal tire coefficient and
µxs is the non-linear slope factor. In (5),
li is the tire’s axle distance to the center of gravity (CoG), and
dfi is the downforce distribution per axle:
The dynamic load transfer calculations for the longitudinal, ∆
Fzx, and lateral directions, ∆
Fzy, are described in (6), where
m is the car’s total mass,
hcog is the height of the center of gravity,
ax and
ay are the longitudinal and lateral accelerations, respectively,
L is the wheelbase, and
lw is the track dimension of the vehicle:
As such, the total longitudinal traction force of the front axle, denoted by
, is the sum of the longitudinal traction forces of both front tires. The same applies to the total longitudinal traction force of the rear axle, denoted by
. In Equation (7),
Fx represents the longitudinal forces applied on the vehicle, modeled by the sum of forces around the vehicle’s CoG, such as the electric motor propulsion, rolling, and aerodynamic forces:
To define
Fy, denoting the vehicle’s lateral force, one must employ the tire slip angle,
, definition. This angle is defined as the difference between the wheel’s steering angle,
, and the wheel’s direction of travel in (8). With the tire slip angles computed and knowing the vertical loads applied on each tire, a simplified version of the model proposed in [
22] was used to calculate the resultant lateral forces applied on each tire using (9). This application entails three coefficients to characterize the tire. Coefficient
D represents the maximum value of the lateral force for one tire,
C is a shape factor, and
B is the stiffness factor of the tire:
As such, the total lateral traction force at the front axle, denoted by
, is the sum of the lateral traction forces of both front tires. The same applies to the total longitudinal traction force of the rear axle, denoted by
. The vehicle’s total lateral force,
Fy, is given by (10). So, the continuous-time state–space equations of the dynamic bicycle model can be consulted in Equation (11):
2.3. Track Model
Figure 5 illustrates the official FSG 2023 track layout (clockwise direction) obtained from GPS sensor data. The FSG competition track has a single-lap distance of 1220 m. So, the competition defines the total lap number as 18 laps to complete the endurance event, which is worth roughly 22 km.
In the optimization problem, each track segment is considered a variable to be optimized. As a result, the program divides each lap into different track sectors. Each is characterized by a start coordinate,
Pi = (
Xi,
Yi), and an end coordinate,
Pi+1 = (
Xi+1,
Yi+1), two arbitrary points in a two-dimensional Cartesian coordinate system. Derived from the Pythagorean theorem, one calculates the respective sector distance with the Euclidean formula (12).
Figure 5 shows the track discretization points in blue dots.
To avoid a uniform track discretization, which would lead to a drop in accuracy during curves, we performed the discretization based on the maximum possible velocity at curves, defined by (17), and a sampling time of 150 ms. This resulted in a finer section discretization round the curves. The velocity on each track section was then optimized by the optimization algorithm, with a velocity lower than or equal to (17).
By discretizing the track, the vehicle dynamics must be adapted accordingly. For each step, the longitudinal velocity of the vehicle at the following step can be determined based on the current velocity and the difference in kinetic energy, as shown in (13), where
and
are the velocities at two consecutive nodes of the track,
i and
i + 1,
is the sector distance defined in (12), and
is the total force applied to the vehicle [
23]:
Assuming that the speed is constant while running through a single track sector, the vehicle’s velocity dynamic is defined by (14). Time
t is iteratively incremented by each time interval needed for the car to cross each segment,
, as shown in (15):
The vehicle’s lap time,
Tteam, relates to the last value of
tN, which is the accumulated run time after the total number of track sectors,
N. Each segment’s energy is computed by multiplying the instantaneous mechanical power (3) with the sector time,
. The sector time is variable along the track and is defined by
The vehicle’s total consumed energy,
Eteam, is calculated as (16) by accumulating all
N sector values and converting to kWh:
Physically, the car’s velocity at each sector is limited by its maximum velocity,
vtop, or the maximum allowed centripetal force,
. This is expressed in (17), where
vtop is the vehicle’s top speed,
R is the turn radius,
D is a tire coefficient that refers to the maximum lateral force in each tire, and
m is the vehicle’s mass. This equation only limits the car’s velocity to avoid sliding during curves. The selection of the braking point is performed by the optimization problem, which optimizes the speed for each track section to maximize the endurance and efficiency scores. The braking performance was carried out by considering a drop in average efficiency of 10% of the electric motors when compared with their motor mode. This was calibrated experimentally, and the comparison between the experimental measured power and the simulation ones will be shown in
Section 3.
Moreover,
R can be obtained through an iterative implementation of the Menger curvature [
24] formula. Given the Cartesian coordinates of three sequential points (
x,
y, and
z), the curvature,
C, and subsequent turn radius,
R, were calculated as (18) and (19), where
A denotes the area of the triangle spanned by
x,
y, and
z:
Note that when the track’s centerline was straight, the curvature (18) tended to zero and the radius (19) tended to infinity. In this case, the vehicle’s maximum achievable velocity,
vmax (17), was its maximum straight-line velocity,
vtop. Otherwise, its velocity would be limited by the maximum allowable lateral centripetal force, which depends on the vehicle’s mass and tire parameters.
Figure 6 depicts the resultant velocity limit values along one lap of the track.
Lastly, the steering angle,
δ, required for the vehicle to follow the track, can be determined using (20), where
L and
lw are the vehicle’s wheelbase and track width, respectively:
Note that the above steering angle obtained from GPS data does not necessarily correspond to the track’s centerline. Instead, it reflects the driver’s chosen racing line, known for being more efficient in terms of speed and energy saving.
2.4. Distance Estimation
To ensure that the energy reference setpoint is accurately aligned with the distance traveled, it is imperative to establish a dependable and precise method for odometry calculation. Given the available sensors and the preliminary results using offline simulations with logged data, the methodology chosen for continuous distance estimation during the endurance run was inertial odometry. This estimates a vehicle’s position based on measurements from inertial sensors, typically accelerometers and gyroscopes.
2.5. Optimization Problem
The ultimate goal of the optimization problem is to solve for the maximum points in the sum of the endurance and efficiency scoring. According to FSG’s rules [
15], the score for the endurance event is calculated using (21), with 25 points for finishing, and a maximum of 225 points attributed to how fast the car finishes the event, normalized to the fastest car, where
Tteam is the team’s corrected elapsed time, and
Tmax is 1.333 times the corrected elapsed time of the fastest vehicle:
Moreover, the efficiency score is calculated using (22), where a maximum of 75 points is awarded to a team depending on its efficiency factor in comparison to other teams, where
EFmin is the lowest (best) efficiency factor of all teams,
EFmax is defined as 1.5
EFmin, and
EFteam is the team’s efficiency factor, given by Equation (23), where
T is the uncorrected elapsed driving time, and
E is the energy used:
The results from the most recent competition, FSG23, published in [
17], are listed in
Table 3.
To maximize the score, considering the vehicle’s powertrain limitations to finish the event plus physical constraints, the cost function prioritizes point scoring according to (21) and (22), aiming to strike a balance between lap-time performance and energy consumption. The optimization problem is defined as follows (24), where the cost function is minimized concerning the pedal’s input state,
u =
p, and
λi are soft constraints’ weights, allowing control over two crucial soft constraints:
At each sector, the vehicle cannot exceed a maximum velocity, which is either limited by the maximum allowed centripetal force or the vehicle’s maximum velocity (25). Also, the vehicle must not exceed the maximum energy capacity of the battery pack, as, in the real event, it would result in a DNF (Did Not Finish), scoring zero points (26):
Regarding the control input,
u =
p, there are two inequality constraints, which, algebraically written, are given by the following matrices:
A simulator was developed in MATLAB 2023b to run the optimization environment (
Figure 7). It starts by initializing an app interface that asks the user to input the track layout, vehicle’s physical and powertrain parameters, and optimization parameters. After discretizing the track environment, the program simulates multiple iterations of the endurance event using the appropriate vehicle model, while optimizing the control vector with the cost function (24) to maximize the scores in both endurance and efficiency events. For this purpose, the MATLAB optimizing function
fmincon is used to find the optimal solution given the constraints or a limit of iterations. After reaching the optimal solution, an output file containing the optimized energy reference line in function of the distance is generated.
2.6. Controller Implementation
2.6.1. Endurance Energy Manager
The system takes an optimal energy reference line in function of distance as its input and continually adapts the vehicle’s maximum power constraint, denoted as
Pmax. Given the endurance distance status, this adjustment depends on whether the current energy level exceeds or falls short of the expected energy level. An error (28) is computed between the current energy level and the referenced setpoint. This depends on continuous distance estimation,
d, along the endurance event:
Then, the new vehicle’s maximum power (29),
Pmax, is computed using a simple PI controller on the error resultant from (28) to compute the power limit adjustment, which is then added to/subtracted from the initial power-limiting value,
Pinit. In (29),
Kp and
Ki are controller gains, proportional and integral, respectively. These gains are used to tune the aggressiveness of the power limit adjustments:
2.6.2. Distance Estimation Methodology
The results of running offline simulations with this measure on different endurance log samples are shown in
Table 4. As can be seen, the differences between the estimated distances and the actual ones were very close, with a deviation of less than 0.7%.
However precise, the methodology above remains susceptible to error accumulation throughout the lengthy endurance event. To address this challenge, a new system was introduced. The position validator operates by continuously monitoring distance estimates derived from inertial odometry, aligning them with expected positions on the track layout. It then validates the distance estimate by performing real-time cross-validation with the GPS outputs. The algorithm compares the expected track position with the actual GPS-derived position, computing the Euclidean distance (12) and checking if it falls within an acceptable threshold. The threshold is expressed as a maximum radius around the expected point, Rmax. In cases where the distance discrepancy exceeds this threshold (∆d > Rmax), indicating error accumulation over what is deemed acceptable, the system dynamically corrects the distance using GPS data and adjusts for the elapsed number of laps.
Using logged data from the most recent endurance event (FSG23), with the maximum acceptable discrepancy defined at
Rmax = 5 m, the position validator eliminated the accumulated residual error of the inertial odometry worth over 140 m, as seen in
Figure 8.
2.6.3. Pipeline Implementation
The controller now implemented relates to the Endurance Energy Manager, who dynamically adjusts the vehicle’s power limitation to ensure that the vehicle closely adheres to the pre-established optimal energy reference line,
Figure 9. Similar to the rest of the pipeline, the module was programmed in its own SIMULINK 2023b model, incorporating MATLAB functions. After being tested offline, the code was generated in C++ using the SIMULINK Coder built-in feature, and the target file was set appropriately. A working frequency of 10 Hz was chosen for the Endurance Energy Manager module. Finally, the C++-generated code was implemented on the team’s ROS/CAN communication pipeline. New signals were added to the CAN line, and the appropriate signal/module connections were made in the ROS communication pipeline. The module’s inputs are as follows:
IMU: 3 × 1 vector containing IMU readings (vx, vy, and ψ).
GPS: 2 × 1 vector containing GPS readings (latitude and longitude).
isaenergy: accumulated energy value, in Wh.
EMenable: turns the controller module “on/off”.
maxpwr: limits total power as a safety measure, in W.
initPL: algorithm’s initial power-limiting value, in W.
EMkp: controller’s proportional gain.
EMki: controller’s integral gain.
dprev: discretely accumulated distance value, in m.
The outputs are as follows:
EMpwrlimit: Energy Manager algorithm Pmax computation, in W.
pwrlimit: sent to the power limiter.
d: accumulated distance run by the vehicle.
eref: current energy reference setpoint, Eref(d).
4. Conclusions
This work proposed a methodology to optimize the energy use of competitive electric vehicles and implement it in a real case study. The Formula Student competition was used as an implementation case to evaluate this methodology.
The methodology first required complete vehicle characterization, involving the development of models grounded in the principles of vehicle dynamics. These models were validated, utilizing a data-driven approach to define powertrain efficiency and the battery pack’s capacity. The employed vehicle model provided a mismatch to reality of under 5% for both velocity and energy model outputs during a full racing lap around the FSG track.
An optimization-based simulation framework was established to simulate endurance runs, with the flexibility to configure key parameters, such as powertrain characteristics and the starting conditions of the run. The overall goal was to maximize the points scored according to the regulations based on the driving profile and subsequent optimal energy deployment over distance. Following this, we developed an energy management system capable of employing a low-level controller that periodically dynamically adjusts the prototype’s maximum power limitation along the run. This involved continuously monitoring the real-time error, calculated as the difference between the reference and actual energy consumed, as measured by an appropriate sensor.
The proposed methodology was validated in a real endurance run at a test track. The developed energy management control system was implemented, guided by a previously simulated optimal reference. This reference was tailored to maximize endurance and efficiency points in the new track layout relative to a normalized best score. In summary, compared to the optimal simulation, a 20 km endurance run had a total time mismatch of 1.4% and a total energy mismatch of 0.5%, leading to a discrepancy of 6.8% from the simulated and actual points prospect.
This approach, merging theoretical modeling with a data-driven perspective and testing the prototype, proved to be an efficient energy optimization method for electric vehicle applications, particularly the Formula Student endurance competitions.