Manuscript Offprint
arXiv:2610.08112Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
Highlights
• Benchmarking the tracking–regeneration trade-off under a unified EV energy model.
• Preview observation + energy-based reward close 76% of NMPC’s energy gap.
• Same change improves tracking: (m).
• 0/30 failures over LHS initial conditions; Wilcoxon , .
• Policy transfers in simulation experiments to unseen tracks, road grade, and a tire-dynamics plant.
Closing the Regenerative-Energy Gap in Learned Path Following: Preview-Augmented Reinforcement Learning versus NMPC for Electric Vehicles in the Frenet Frame
Mohamed Sabaa , Mostafa Emam
Computer Science Department, Najran University, Najran, Saudi Arabia
Institute of Applied Mathematics and Scientific Computing, University of the Bundeswehr Munich, Neubiberg, 85579, Germany
ARTICLE INFO
Keywords:
Electric Vehicles
Frenet Frame
Nonlinear Model Predictive Control
Proximal Policy Optimization
Reinforcement Learning
Regenerative Braking
Preview Control
Curriculum Learning
ABSTRACT
Path-following control strategies typically follow the bi-objective optimization dilemma: minimizing deviations from a reference path while maintaining smooth speed profiles. The latter objective is especially relevant for Electric Vehicles (EVs), since their limited driving range can be extended by recovering energy through regenerative braking, a feature that has not yet been sufficiently studied in the literature. In this work, we perform a comparative analysis of four controllers under one common Frenet frame-based kinematic vehicle model, utilizing a validated energy model (VT-CPEM) with explicit regenerative braking. Herein, we implement the following controllers: Nonlinear Model Predictive Control (NMPC), Proximal Policy Optimization (PPO), gain-scheduled Ackermann state-feedback baseline (PID-SF), and a Stanley geometric baseline. To satisfy real-time requirements, we implement the NMPC using JIT-compiled CasADi. Moreover, we train the PPO using traditional straight and S-curve tracks, after which we successfully transfer the unmodified policy to unseen tracks, including: an ISO 3888-1 lane-change, a chicane, randomly-generated parameterized-splines, and a graded road. In addition, the policy transfers to a dynamic single-track vehicle model with linear tires, zero-shot with an acceptable initial performance, which was optimized after brief fine-tuning. Thereby, we demonstrate that our PPO is readily transferable to more comprehensive vehicle models. We conclude with a performance analysis of developed controllers and discuss ideas for future work.
1. Introduction
Among its advantages, Autonomous Driving (AD) is pursued because an estimated 94% of crashes are attributable to driver (i.e., human) error, and as it promises to extend personal mobility to individuals unable to drive themselves Paden et al. (2016). Electric vehicles (EVs) are increasingly becoming the platform of choice for this transition, yet they remain constrained by limited driving range, which makes accurate, real-time estimation and management of energy consumption during travel a first-order design requirement rather than an afterthought Ding et al. (2024).
The decision-making pipeline of a self-driving vehicle is commonly decomposed into route planning, behavioral decision-making, motion planning, and local feedback control Paden et al. (2016); Wu et al. (2024); Zhao et al. (2024). This paper addresses the last layer. Herein, a reference path and a path-parameterized reference speed trajectory are assumed to be provided by an upstream planner, where the developed controllers are tasked with computing steering-rate and longitudinal-acceleration/deceleration commands in real-time, with the objective of minimizing tracking errors while adhering to actuator bounds. To meet strict real-time requirements, path-following controllers typically decouple these dynamics, addressing longitudinal and lateral tracking independently or sequentially. However, due to the nonholonomic nature of EVs, the resulting control commands are suboptimal Paden et al. (2016); Liu et al. (2021). Moreover, the performance evaluation benchmarks predominately focus on tracking errors without reporting energy metrics, excluding a fundamental criterion for the deployment of EVs Liu et al. (2021); Lee and Yim (2023). This work intends to address this research gap by: (i) accommodating the path-following problem with coupled dynamics, (ii) satisfying strict real-time requirements, and (iii) providing a comprehensive analysis covering both tracking errors and energy-consumption metrics. Thereby, we establish a theoretical foundation and provide practical benchmarking results for future studies investigating real-time, energy-aware path-following controllers with coupled dynamical models.
Corresponding author
444307237@nu.edu.sa (M. Sabaa); mostafa.emam@unibw.de (M. Emam)
ORCID(s): 0009-0007-8963-7460 (M. Sabaa); 0000-0003-4942-1183 (M. Emam)
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 1 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
2. Literature Review
Nonlinear model predictive control (NMPC) has emerged as a central framework for path-following in AD applications, owing to its explicit handling of multi-variable vehicle dynamics, constraints, and performance objectives within a receding-horizon optimization setting Rawlings et al. (2017). Recent works highlight the continued relevance of MPC-based controllers, in particular due to its ability to integrate trajectory tracking, constraint satisfaction, and robustness considerations into a unified formulation Stano et al. (2023); Zhao et al. (2024). For example, Belkebir et al. (2026) addressed real-time path tracking by integrating path-following and curvature-aware velocity tracking objectives into a unified NMPC cost function, solving the resulting optimization problem with CasADi/IPOPT for real-time feasibility. Beyond nominal tracking, other studies focused on operation near the limit of handling, where accurate prediction of tire and vehicle dynamics is critical. For instance, Fu et al. proposed an NMPC strategy with stable limit handling, while Domina and Tihanyi developed an LTV-MPC formulation for path-following at the handling limits Fu et al. (2022); Domina and Tihanyi (2022). Reiter et al. demonstrated the importance of coordinate and model representations, showing that Frenet-Cartesian formulations can improve NMPC-based obstacle avoidance and tracking performance in AD contexts Reiter et al. (2023). Consequently, these contributions emphasize that NMPC is particularly well-suited for safe path-following when both geometric accuracy and dynamic feasibility are required Rawlings et al. (2017); Stano et al. (2023).
Contrary to traditional methods, Reinforcement learning (RL) provides a data-driven alternative for vehicle control, offering a flexible approach to situations where hand-crafted control laws are costly to tune across varying driving conditions. Early works demonstrated that RL and deep learning can be effectively utilized for lateral control in AD applications, motivating further research into learning-based path-following controllers Li et al. (2019), with subsequent studies focusing on policy learning, employing deep deterministic approaches and reward-shaping strategies tailored to autonomous racing and trajectory tracking Hess and Ljungbergh (2021); Evans et al. (2021). More recently, RL has been combined with model-based control, for instance through MPC demonstrations or stochastic MPC structures to enhance stability and sample efficiency Wu et al. (2025); Zarrouki et al. (2024). In addition, Frenet-frame formulations have been adopted to simplify trajectory learning and improve geometric interpretability in autonomous driving tasks Yoon et al. (2024). Survey studies further highlight the increasing relevance of RL-based methods for AD behavior planning; however, these methods remain heavily reliant on careful design of reward functions, adequate choice of training data, and effective integration with safety-oriented fallback conventional controllers Wu et al. (2024).
Curriculum Learning (CL) naturally complements RL by structuring the training process from simpler to more complex driving tasks, thereby improving convergence and policy robustness Bengio et al. (2009). In AD applications, CL has been implemented in staged training regimes for learning lane-keeping and maneuvering under increasingly challenging conditions Anzalone et al. (2021). Furthermore, Bécsi proposed RRT-guided experience generation to bias exploration toward informative trajectories for autonomous lane keeping, interpreting this as a curriculum-like mechanism for accelerating RL training Bécsi (2024). These works indicate that curriculum design is particularly valuable in RL-based vehicle control, where direct end-to-end learning from scratch is often inefficient and unstable.
With the increasing adoption of EVs, researchers began to investigate energy-aware vehicle control strategies, since electrified powertrains inherently integrate energy efficiency as an essential component of motion planning and control. Fiori et al. developed and validated a power-based energy consumption model, establishing a foundation for incorporating energy terms into control and planning objectives Fiori et al. (2016). More recent studies have utilized this approach to refine control actions, such as optimal regenerative braking strategies that consider braking intention and enhance energy recuperation Tang and Zhang (2024). Furthermore, NMPC-based approaches have been extended to accommodate safety and stability requirements while adhering to the dynamics of EVs Liu et al. (2024). At the planning level, energy-efficient hybrid MPC and trajectory optimization, incorporating energy-model-aware design, indicate that trajectory generation algorithms can achieve balanced behavior between travel efficiency, drivability, and energy consumption Ding et al. (2024); Tian et al. (2025). Collectively, these developments highlight that energy awareness is becoming an essential design criterion in AD control, particularly for EVs.
As previously mentioned, path-following controllers typically do not explicitly include an energy model, limiting the driving range and negatively impacting the adoptability of EVs. Moreover, energy-aware controllers generally prioritize longitudinal or velocity control, thereby limiting an accurate representation of the consumed energy due to suboptimal lateral behavior. A notable exception is the work of Tian et al. (2025), which addresses energy-aware trajectory optimization by generating feasible quintic candidate trajectories within the Frenet frame and, subsequently,
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 2 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
refining them through an online nonlinear programming (NLP) step to enhance fuel efficiency. However, since the approach relies on candidate generation, it offers no guarantees regarding optimality nor robustness. Furthermore, the study does not report solution times, raising questions regarding its real-time applicability.
Table 1
Comparative overview of representative control and planning methods discussed in this section.
| Research and Scope | Vehicle Model | Control Strategy | Energy Model | Experiments |
|---|---|---|---|---|
| Fu et al. (2022): Path tracking at handling limits | Nonlinear vehicle dynamics with tire-force, load-transfer, and adhesion effects | NMPC | - | HIL and simulation using CarSim. |
| Domina and Tihanyi (2022): Automated path following near handling limits | Linear time-varying vehicle model considering steering dynamics | LTV-MPC | - | Simulation-based using MATLAB. |
| Reiter et al. (2023): Obstacle avoidance and path following | Kinematic vehicle model in combined Cartesian/Frenet coordinate representation | NMPC | - | Simulation-based using ACADOS. |
| Belkebir et al. (2026)Curvature-aware path tracking with embedded NMPC | Augmented kinematic model in Frenet frame | NMPC with curvature-aware speed and Lyapunov terminal cost | - | Simulation using CARLA and embedded timing with CasADi on Raspberry Pi 5 and Xavier AGX. |
| Li et al. (2019): Vision-based lateral control | TORCS / VTORCS simulator with a perception-to-control pipeline | RL + deep learning perception | - | Simulator-based training and evaluation using VTORCS; compared against LQR, MPC. |
| Hess and Ljungbergh (2021): Longitudinal and lateral path following | Custom kinematic bicycle model | DDPG | - | Simulation-based using PyTorch. |
| Evans et al. (2021): Autonomous racing local planning | Kinematic vehicle model (scaled F1/10th) | RL with reward design | - | Simulation-based using OpenAI-Gym. |
| Wu et al. (2025): Lateral control | Time-invariant continuous dynamic linear model | DRL with MPC-PID demonstration | - | Simulator-based using CARLA. |
| Zarrouki et al. (2024): Motion control under uncertainty | Dynamic nonlinear single-track model | RL-driven adaptive Stochastic NMPC | - | Simulation-based using TUM-CONTROL framework. |
| Yoon et al. (2024): Trajectory learning in the Frenet frame | Frenet-frame road geometry for curved/urban scenarios | RL-based trajectory learning | - | Simulation-based using Gazebo and ROS. |
| Anzalone et al. (2021): Autonomous driving in simulation | CARLA simulator; end-to-end driving policy | Reinforced curriculum learning + DRL | - | Simulator-based using CARLA. |
| Fiori et al. (2016): EV energy-consumption modeling | Power-based EV energy consumption model | - | Same as vehicle model | Evaluated on actual EVs, including Nissan Leaf and Tesla model S. |
| Tang and Zhang (2024): Regenerative braking control | EV braking, load, and battery-SoC-dependent recovery model | Deterministic (flowchart-based) analytical braking strategy | Same as vehicle model | HIL and simulation using dSPACE ASM Suite. |
| Ding et al. (2024): Energy-efficient velocity planning | Kinematic vehicle model with motion forces and passive energy recovery | Hybrid controller using Dynamic- and Quadratic-Programming | Same as vehicle model | Simulation-based using Matlab, Carsim, and Prescan. |
| Tian et al. (2025): Energy-aware trajectory optimization | Frenet polynomial trajectories with differentiable fuel model | EMATO: online NLP/BVP over quintic Frenet candidates | Differentiable fuel-rate model | Simulation-based on custom sedan and truck models. |
The remainder of this work is structured as follows:
-
We start with presenting our fundamental vehicle model; a coupled kinematic vehicle model in the Frenet frame, providing a compact yet adequate basis for longitudinal–lateral path-following control.
-
Using this model, we develop and compare four control strategies: (i) an NMPC controller implemented with JIT acceleration via CasADi and tuned using Latin Hypercube Sampling (LHS), (ii) an RL-PPO controller with preview information and an energy-aware reward designed through five-phase CL, (iii) a PID-SF controller based on Ackermann state feedback and tuned with pole placement, and (iv) a Stanley-geometric baseline with a proportional inner loop and a longitudinal PI law shared with PID-SF.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 3 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
-
Afterwards, we perform a dedicated comparative study of the RL-PPO reward design, including the five CL phases, to quantify its influence on learning and closed-loop behavior. Similarly, we discuss the policy transferability and undertaken measures to enhance robustness against noise and unmodelled disturbances.
-
We conduct an energy analysis for our developed controllers, reporting the overall energy consumption and the amount of successfully recovered energy through regenerative braking.
-
For a more comprehensive evaluation, we simulate our controllers on a dynamic single-track plant and across standardized tracks, including an additional LQR baseline for reference.
• Finally, we summarize our findings and present our ideas for future work.
3. System Formulation
Having specified the scope of this work, we now construct the shared mathematical framework, upon which our controllers operate. Herein, three components interact by design: the kinematic model defines vehicle motion in the Frenet frame, the velocity profile imposes a curvature-aware speed demand, and the energy model converts that demand into a scalar quantity, which is comparable across the different controllers.
3.1. Kinematic Vehicle Model
Compared to the Cartesian representation, the Frenet coordinate system Werling et al. (2010) describes vehicle motion relative to a reference path, decomposing the position into traversed arclength along the path and signed lateral deviation from it, taken positive to the left of the path. More formally, let be a reference path parameterized by arclength, e.g., using a natural cubic spline. The vehicle state is defined as , with the arclength (m), lateral deviation (m), heading error (rad), front-wheel steering angle (rad), and longitudinal speed (ms) with respect to the travel direction Reiter et al. (2023). The reference path is characterized by its curvature (m), and the vehicle is actuated through the controls , where (rad s) and (ms) denote the steering-rate and acceleration commands, respectively. The model dynamics are given by:
where (m) denotes the wheelbase. For real- and discrete-time systems, (1)–(4) are typically discretized and computed using fourth-order Runge–Kutta integration, e.g., with a sampling time of (s). Moreover, the model dynamics are only valid when the projection unto the reference path is unique and the denominator in (1) remains separated from zero. These conditions are explicitly verified and guaranteed during the construction phase of reference paths for training and evaluation purposes, where we enforce:
with the numerical safety guard , which is typically sufficient for urban scenarios. For example, the extreme corridor failure boundary max (m) on the benchmark S-curve with (m ) yields a maximum value of , confirming that no division-by-zero singularity occurs prior to episode termination. For coordinate-transformation, we implement a Newton-method-based minimization function to identify and uniquely transform between Cartesian and Frenet coordinates. Furthermore, to preserve the validity of the no-slip kinematic assumption, we define a curvature-aware upper bound on the vehicle's longitudinal velocity derived from:
with the maximum lateral acceleration . To simplify the control problem, (6) is enforced as a minimization objective rather than a hard constraint; therefore, we include as a reporting metric across our training and validation scenarios to prove that no constraint violations occur.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 4 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
3.2. Reference Velocity Generation
For the given reference path, we define the curvature-aware reference speed as:
augmenting the work of Belkebir et al. (2026) and employing a moving-average filter with a three-step window to suppress spline-derivative noise. Here, ensures that does not exceed the maximum allowed lateral acceleration when operating at the dynamic limits; the regularization term (m) prevents division by zero on straight segments. Furthermore, we adopt a smooth terminal stopping profile with , which emphasizes the comfort deceleration limit (ms ) until reaching standstill at the end of path, i.e., at . Note that the terminal ramp contributes the largest proportion of sustained negative power recovered by the energy model, thereby serving as the dominant source of regenerative energy fractions reported in subsequent sections of this study.

Figure 1: Reference velocity and curvature on an S-curve. The terminal deceleration ramp drives regenerative energy recovery.
3.3. Electric Energy Model
We utilize VT-CPEM Fiori et al. (2016) for determining the required traction power and recoverable energy fraction. Here, the road-load force is given by:
where the parameters are delineated in Table 2, yielding the required wheel power . A consistent battery-side power boundary can be written as:
with the traction (drivetrain) efficiency and energy-recovery efficiency . Notably, Fiori et al. (2016) define as a deceleration-dependent feature, which we assume here to be constant to disentangle dependencies and reduce the computational burden on the real-time NMPC. We amend this through a sensitivity analysis over a comprehensive range of values, which we later explain in Section 5.5.
The auxiliary power represents energy consumed by vehicle electronics, infotainment systems, and internal ECUs. This variable is significantly affected by operating conditions, such as temperature, battery state, and currently active electronic components, rendering it challenging to incorporate into simulation studies Kropiwnicki and Gawlas (2023). In our case, we primarily focus on different controller energy requirements; specifically, reduces to the
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 5 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
energy consumed by a simulative ECU computing the control commands. Using the discretization sampling time , we define the energy quantities as:
with the traction energy , the recovered energy , the controller energy requirement summed over solving steps, and the total consumed energy . Since the energy split depends strictly on the sign of mechanical wheel power rather than vehicle acceleration, gentle decelerations, where traction force remains positive due to aerodynamic drag and rolling resistance, are correctly assigned to and excluded from regenerative recovery . Note that is typically negligible for the quasi-instantaneous controllers (PPO and PID-based), yet it is comparatively higher for the optimization-based NMPC. Nevertheless, we retain it as a fairness safeguard rather than a discriminator.
4. Controller Design
Table 2 Complete Parameter List.
| Symbol | Value | Description |
|---|---|---|
| Vehicle (adopted from VT-CPEM Fiori et al. (2016)) | ||
| 1500 (kg) | Mass | |
| 4.0 (m) | Wheelbase | |
| 0.30 | Drag coefficient | |
| 2.2 (m²) | Frontal area | |
| 0.01 | Rolling resistance | |
| 1.225 (kg m) | Air density | |
| 0.65 | Regen efficiency (constant, cf. Section 5.5) | |
| 5 (W) | Embedded ECU power draw (estimated) | |
| Dynamic model (Section 5.14) | ||
| 3000 (kg m) | Yaw inertia | |
| 2.0, 2.0 (m) | Axle distances from CoG | |
| 80 (kN rad) | Cornering stiffness Rajamani (2012) | |
| State and input bounds | ||
| [-5, 5] (m) | Lateral deviation | |
| [-, ] (rad) | Heading error | |
| [-0.6, 0.6] (rad) | Steering angle | |
| [0, 8] (ms) | Speed | |
| [-0.4, 0.4] (rad s) | Steering rate | |
| [-2.5, 2.5] (ms) | Acceleration | |
| Reference velocity profile (7) | ||
| 8.0 (ms) | Maximum speed | |
| 2.5 (ms) | Lateral acceleration limit | |
| 3.0 (ms) | Longitudinal deceleration limit | |
| 0.1 (s) | Discretization (sampling) period | |
| NMPC | ||
| 50 | Number of horizon (prediction) points | |
| 10, 100, 1 | Lateral, heading, speed weights | |
| 1, 1 | Steering and acceleration weights | |
| Gain-Scheduled Full-State Feedback PID-SF | ||
| 3.0, 19.0, 9.0 | Lateral gains computed at (ms) | |
| 1.0, 0.02 | Longitudinal gains | |
| Stanley Hoffmann et al. (2007) | ||
| 1.0, 1.0, 5.0 | Cross-track, softening, inner loop | |
| PPO Raffin et al. (2021) | ||
| 0.99, 0.95 | Discount, GAE | |
| , batch | 0.2, 256 | Clip range, mini-batch |
| network, | [256, 256], 310 | MLP layers, Adam LR |
| 5, 15, 30 (m) | Preview lookahead distances, cf. Section 4.4 | |
| seeds | {42, . . . , 51} | Ten training seeds |
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 6 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
4.1. NMPC
Our first strategy represents the optimal control approach, which is dedicated to identifying the best control inputs (as determined by a predefined objective function) for a feasible problem. Consequently, this approach guarantees an optimal solution, albeit often at the cost of increased computational resources. At each step , the solver tries to find the controls that minimize the objective function:
Each term is normalized by the square of its own bound, so that the five cost components are dimensionless and comparably scaled; in other words, we utilize the effective weights . Here, , are the bound sets of Table 2 and is the RK4 discretization of (1)–(4). We employ a horizon of steps, yielding a time of 5 (s), and solve the problem with IPOPT Wächter and Biegler (2006) with a maximum number of iterations max_iter = 20 to respect the real-time requirements. Critically, the closed-loop plant is the same nonlinear Frenet model used by every other controller, such that no controller possesses a model advantage.
4.1.1. Warm-Starting
To further accelerate the NMPC solving time, we initialize IPOPT with the shifted solution from the previous solution step, thereby reducing the required iterations and solve time, on average, from 124.4 (ms) to 90.6 (ms), i.e., a speedup. Note that warm-starting biases the solver towards the previous plan, which may be undesired in the case of highly-dynamic environments Rawlings et al. (2017); however, it is practical and justified in our application.
4.2. Gain-Scheduled Full-State Feedback (PID-SF)
The second approach follows traditional error-correction control techniques Yang et al. (2020), where we split the control law into two independent longitudinal speed and lateral deviation stabilizers. For lateral control, we linearize the nonlinear system dynamics (2)–(4) at a constant speed , such that, for small values of , on a locally straight path, the lateral error dynamics become:
with the control law . Consequently, we get the characteristic polynomial:
which, using pole-placement methods to identify the poles , yields:
For and , we get the lateral gain , heading gain , and steering gain . Note that the gains must be adequately scaled to preserve the constant-speed linearization coefficients of (13), in which we adaptively compute:
where the clamp avoids unboundedly-increasing controls as . Finally, we improve the handling at curved paths (cf. Paden et al. (2016)) by defining the kinematic steering reference , with:
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 7 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
and, thereby, amend the control law to become:
We record that the closed-loop matrix of the constant-speed linearized model is Hurwitz-stable , albeit with a degraded performance within the active clamping region ; this is sufficient for our application, since the active clamping region is dominated by the terminal deceleration profile and steering control is herein unsubstantial. Nevertheless, we acknowledge that is a local result, i.e., not a proof of global stability for the nonlinear, curvature-varying, saturated system.
For longitudinal control, we employ a PI-controller, with:
with the gains , , which we utilize across all evaluation scenarios. Fig. 2 demonstrates that the unit step response comfortably settles from (m), (ms ) to (m) within 2.90 (s).
PID-SF Step Response ( , )

Figure 2: PID-SF unit step response on the kinematic model .
To summarize, we use the independently-computed control laws (16), (17) in our gain-scheduled full-state feedback controller (PID-SF), with the gain parameters defined in Table 2.
4.3. Stanley Geometric Baseline
Third, we implement the widely deployed Stanley geometric controller Hoffmann et al. (2007) for a comprehensive evaluation. Here, we modify the lateral control law to become:
where we tuned to accommodate our Frenet frame representation. Specifically, the original Stanley formulation measures cross-track error at the front axle, while d represents lateral deviation at the rear axle; this is amended by tuning the parameter with a linear dependency to . Moreover, we adopt the longitudinal PI from our PID-SF with the same gains for a fair comparison.
4.4. PPO with Preview Observation and Energy Reward
Our fourth and final strategy represents learning-based methods, namely Reinforcement Learning (RL) using Proximal Policy Optimization (PPO). Here, we utilize two observation vectors, denoted base and preview, with two base and energy-augmented rewards; they are thoroughly explained in the upcoming sections.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 8 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
4.4.1. Observation Vector(s)
For the base observation, we have the eight-dimensional normalized vector:
where is the peak realized curvature across a given reference path, a constant precomputed value from the path profile. Note that the last two terms , are essential to identify the terminal stopping phase, which facilitate the appropriate deceleration and subsequent halt before .
During our experiments, we identified a fundamental deficit of purely reactive learned control. Specifically, with a strictly local observation, a step-level reward cannot anticipate a deceleration ramp several seconds ahead. Therefore, the base PPO controller fared significantly worse than the NMPC owing to its predictive characteristics. We amend this in the preview variant, which augments (20) with upcoming curvatures and reference speeds at multiple lookahead distances (m), yielding:
where the preview arclengths are clipped to , such that, near the end of path, the previewed values decay to zero and the agent observes the stopping ramp several seconds before reaching it.
Why preview substitutes for a horizon: The NMPC stage cost (11a) inherently accommodates future along its prediction horizon, which cannot be directly covered by . By selecting a finite number of representative lookahead distances , inferred from the operating velocity range , we enable the policy to replicate the NMPC predictive behavior, thereby shifting the lookahead burden from online optimization to offline learning. Moreover, the residual gap reported in Section 5.1 is consistent with a finite preview window of 30 (m) 3.75 (s) at compared to the NMPC horizon 5 (s), together with value-function approximation error.
4.4.2. Reward Design
In addition to the normalized observation (base and preview) vectors, we have the dimensionless reward:
where the first term exclusively rewards forward progression, with . Here, we utilize an out-of-bounds penalty exactly once at the terminal step of an episode that leaves the permissible driving corridor (m), subsequently terminating the episode and flagging it as a failure; the indicator is therefore non-zero only on that terminal step. Furthermore, we apply a penalty of 0.5 when the normalized speed error exceeds 0.25 to enhance velocity tracking Hess and Ljungbergh (2021).
The reward term e incorporates energy-aware driving, where it distinguishes the two reward variants:
where is the mechanical wheel power. Note that is functionally identical to the acceleration penalty already present in (22), so in the simplified variant the two terms combine and the effective weight on is ; with the Phase-4 values of Table 14 this is 0.45 rather than the nominal 0.15. The simplified variant is therefore not energy-aware in any physical sense: because it penalises irrespective of sign, it discourages the very deceleration from which energy is recovered. By contrast is signed, so braking yields a negative contribution and is rewarded. This distinction is what the second axis of the ablation isolates. The energy variant penalizes net battery draw and promotes regeneration, since a wasteful accelerate-then-brake cycle loses of the energy it produces. Per-phase reward weights are listed in Appendix A.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 9 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
4.4.3. Five-Phase Curriculum
To adequately handle our coupled dynamics, we adopt a five-stage curriculum-learning strategy, thereby reducing learning difficulty by separating speed regulation from curved-path tracking. Here, we sequentially introduce:
-
Phase 0 trains longitudinal control on a straight track with , (m), enabling the policy to learn proper acceleration and deceleration profiles, in addition to stopping at the end of path.
-
Phase 1 introduces the S-curve with small offsets, so that the policy learns the interdependency of longitudinal and lateral dynamics, as well as reacts to small perturbations.
-
Phases 2-3 apply gradually increasing initial-condition disturbances and observation perturbations to consolidate vehicle control.
-
Phase 4 introduces the energy optimization reward (penalty) for improving energy-aware decision making.
Table 3 summarizes the curriculum schedule; the impact of each phase is later discussed in Section 5.13.
Table 3 Five-Phase Curriculum Schedule.
| Phase | Objective | Steps | Description |
|---|---|---|---|
| 0 | Longitudinal control | Straight line (), speed tracking | |
| 1 | Lateral control | S-curve, lateral introduction (m) | |
| 2 | Longitudinal + Lateral | Refining controls of coupled dynamics | |
| 3 | Disturbance recovery | (m), applied | |
| 4 | Energy optimization | Refining controls with respect to energy |
Total: 450 k steps; five seeds (42–46).
5. Experimental Results
For a fair comparison, all controllers share the same nonlinear plant, energy model, and compute the same controls. The employed tracks for training and primary evaluation are: (i) a 200 (m) straight line for Phase 0 and (ii) an S-curve with (m), (m) for all subsequent phases. For evaluation only, we utilize the tracks: (i) an ISO 3888-1 double lane-change (m), (ii) a chicane with (m), and (iii) 20 random splines that are explained in Section 5.9. The baseline initial condition is , and runs either successfully terminate at the end of path when (m), or terminate as a failure when (m).
5.1. The Regenerative-Energy Gap and How Far Preview Closes It
Table 4 and Fig. 3 report the ablation over the two proposed PPO adaptations for observations and rewards, trained with the primary seed under an identical budget. The base policy recovers only of the traction energy against the NMPC's . The augmented preview independently enhances this result to , i.e., closing of the gap, while the energy-based reward independently improves it to , i.e., closing of the gap. By combining both strategies with extended preview observation and energy-aware reward, we achieve an energy recovery of , thereby approaching the NMPC performance by ; the two adaptations are essentially constructive. Moreover, we highlight that this combination significantly improves tracking from the base (m) to (m), as depicted in Fig. 3. This is a marginally worse result than the preview with (m), which is mitigated by the significant improvement in energy recovery. Accordingly, we adopt this configuration preview+energy in all subsequent experiments.
5.2. Tracking, Energy and Solving Time
Table 5 and Fig. 4 summarize the closed-loop performance at the benchmark initial condition.
Orientation Tracking Accuracy. In addition to lateral deviation, Fig. 5 illustrates the heading error across all four controllers. The preview-augmented policy achieves smooth orientation tracking comparable to NMPC, dampening transient yaw oscillations without inducing late-corner overshoot.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 10 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles


Figure 3: Closing the regenerative-energy gap. Left: regenerated fraction for the four ablation variants against the NMPC reference; annotations highlight the share of the gap closed. Right: the same variants in the tracking–energy plane, signifying that preview improves both objectives simultaneously.
Table 4
2×2 ablation of the two proposed changes (primary seed, S-curve, benchmark IC). Gap closed is measured against NMPC's regenerative fraction: preview 27%, energy-reward 46%, both 76%. Energies are at the single benchmark IC; means differ compared to Table 8.
| Variant | Preview observation | Energy reward | RMSE (m) | Regen (%) |
|---|---|---|---|---|
| base | ✕ | ✕ | 0.459 | 9.3 |
| preview | ✓ | ✕ | 0.310 | 23.1 |
| energy-reward | ✕ | ✓ | 0.398 | 32.7 |
| preview+energy | ✓ | ✓ | 0.314 | 47.9 |
| NMPC (reference) | - | - | 0.474 | 59.9 |
Table 5
Main Results (S-curve, ). Energies in kJ; solve time in ms. Speedups are relative to the JIT-compiled NMPC, cf. Section 5.3. The do-mpc timings are: mean 117.6, p95 149.5, max 164.5. The compiled solver was executed for timing analysis only; its energy figures are omitted because it solves the identical optimal control problem and its trajectory deviation (0.453 vs. 0.474) differs only by solver tolerance.
| Controller | RMSE (m) | (kJ) | (kJ) | (kJ) | Solving time (ms) | Speedup |
|---|---|---|---|---|---|---|
| NMPC (do-mpc) | 0.474 | 41.69 | 24.95 | 16.79 | 117.6 | - |
| NMPC (compiled) | 0.453 | - | - | - | 16.3 | 1× |
| PPO (preview+e) | 0.314 | 49.76 | 23.85 | 25.92 | 0.407 | 40× |
| PID-SF | 1.155 | 57.76 | 24.74 | 33.02 | 0.065 | 251× |
| Stanley | 1.666 | 57.72 | 25.24 | 32.48 | 0.088 | 185× |
Control Effort and Actuator Bounds. Fig. 6 confirms that both NMPC and the learned preview policy operate strictly within the actuator constraints (rad ) and (ms). PID-based controllers suffer from control oscillations, while the learned policy produces smooth control profiles that preserve actuator longevity.
Dynamic Handling Limits and Kinematic Feasibility. To verify physical limits under the kinematic bicycle assumption, Fig. 7 reports the instantaneous lateral acceleration for all controllers. Owing to curvature preview and smooth steering rates, the PPO policy remain strictly below the feasible handling limit (ms) throughout the maneuver, which the NMPC provides by design. In contrast, the tracking overshoot of PID-SF and
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 11 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles


NMPC 0.474 m
PPO (preview + energy) 0.314 m
PID-SF 1.155 m
Stanley 1.666 m
Figure 4: Lateral deviation on the S-curve for the four controllers at the benchmark initial condition. Legend values are the RMSE of the plotted tracks.
Heading Error

Figure 5: Heading error on the S-curve for the four controllers at the benchmark initial condition. NMPC and PPO preview+energy maintain smooth orientation tracking, while PID-SF and Stanley exhibit considerable oscillations.
Stanley forces sharp steering corrections at high speed, causing peak lateral accelerations to exceed feasible limits and violating the no-slip assumption.
5.3. Real-Time Feasibility: Interpreted versus Compiled NMPC
Reported RL-versus-NMPC speedups are strongly implementation-dependent, so we quantify the effect directly. The do-mpc/IPOPT combination yields a solution, on average, in 117.6 (ms), albeit with p95 149.5 (ms), and maximum 164.5 (ms). Therefore, it violates the desired budget (ms) on a non-trivial fraction of steps. Re-implementing the identical optimal control problem in pure CasADi with JIT-compiled callbacks and warm-starting the controller significantly reduces the solution times to a mean of 16.3 (ms), p95 24.6 (ms), and maximum 30.6 (ms), which comfortably respects the real-time requirements. Consequently, we report all speedups against the compiled solver: the learned policy with 0.407 (ms) is 40× faster than a state-of-the-art NMPC implementation, rather than three orders of magnitude faster than an interpreted one. Even though this weakens the computational argument for learned control, it retains the energy and robustness arguments.
5.4. Energy Analysis
Fig. 8 demonstrates the energy breakdown. Owing to its predictive behavior, NMPC anticipates the terminal ramp and plans the deceleration optimally, recovering (kJ), i.e., 59.9% of , and achieving the total consumed energy (kJ). In comparison, the preview policy recovers only 47.9%, yielding a consumption of (kJ). The residual gap is consistent with the finite preview window and value approximation error.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 12 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles

Figure 6: Control inputs on the S-curve: steering rate (left) and longitudinal acceleration (right). Both NMPC and PPO strictly respect actuator bounds without high-frequency oscillations.

Figure 7: Kinematic lateral acceleration on the S-curve. The black dashed line marks the dynamics handling limit .
discussed in Section 4.4. A hybrid variant that hands longitudinal control to the analytic stopping ramp inside the terminal zone was also evaluated and produced worse results with (kJ), indicating that the policy has learned a better stopping profile than the analytic override.
5.5. Sensitivity to Regeneration Efficiency
Since we adopted as a constant simplification of the deceleration-dependent efficiency, we recompute for to analyze the sensitivity of our policy to different values of . Here, scales linearly in ; therefore the analysis does not require additional simulations; the controller ranking by remains unaffected.
Table 6
(kJ) versus regeneration efficiency .
| Controller | |||
|---|---|---|---|
| NMPC | 22.55 | 16.79 | 11.04 |
| PPO | 31.42 | 25.92 | 20.42 |
| PID-SF | 38.73 | 33.02 | 27.31 |
| Stanley | 38.30 | 32.48 | 26.65 |
5.6. Pareto-Frontier Analysis for NMPC Weight Tuning
Here, we analyze the behavior of the selected (default) NMPC weights. Our defaults follow the common strategy of weighting the safety-critical states an order of magnitude above the control-effort terms, the practice adopted by Fu et al. (2022), rather than being tuned to a specific behavior. Sampling weight vectors by LHS McKay et al.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 13 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles

Figure 8: Energy breakdown per controller. Percentages show regenerative fraction . NMPC achieves the highest recovery at 59.9%, while the preview policy only reaches 47.9%.
(1979) in -space () yields the nine Pareto-optimal configurations illustrated in Fig. 9 and Table 7. The best-tracking configuration reaches (m) at (kJ), while the best-energy configuration reaches 15.84 (kJ) at 0.719 (m). This is an expected behavior due to the interdependency of both objectives. Our analysis concludes that the default weights yield an acceptable compromise between path following and energy recovery, confirming the validity of standardized practices without necessitating exhaustive objective-weight tuning.
Table 7
Extremes of the NMPC weight Pareto front ( LHS, nine non-dominated configurations).
| Configuration | |||||||
|---|---|---|---|---|---|---|---|
| Best tracking | 76.50 | 100.75 | 6.00 | 0.81 | 0.80 | 20.59 | |
| Best energy | 4.33 | 239.75 | 0.95 | 4.95 | 3.32 | 0.719 | |
| Default | 10.0 | 100.0 | 1.0 | 1.0 | 1.0 | 0.474 | 16.79 |

Figure 9: Pareto-frontier analysis for the NMPC weights with LHS. The selected (default) configuration approaches the frontier, exhibiting an acceptable outcome without exhaustive tuning.
5.7. Statistical Validation ( LHS) and Seed Variance
Since a single initial condition cannot establish superiority, we evaluate all controllers across varying initial conditions sampled by LHS with (m), (rad), and (ms). Here, the preview policy attains (m) against NMPC's (m). Furthermore, we report a Wilcoxon
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 14 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
signed-rank test () alongside the unpaired Mann–Whitney result (); here, Cohen's indicates a significant impact, and against PID-SF. As previously recorded, neither NMPC nor PPO ever leave the permissible driving corridor, whereas the classical baselines failed on 5/30 and 4/30 runs, respectively. Across ten training seeds the policy attains (m) with 0/10 failures, confirming the result is not a seed artifact. The achieved results are summarized in Table 8 and Fig. 10.
Table 8
Statistical results over LHS initial conditions, which differ from the single-IC values of Table 5. Wilcoxon signed-rank (paired), PPO < NMPC: ; Cohen's . Speedups here are relative to the interpreted do-mpc solver; check Section 5.3 for the compiled comparison.
| Controller | RMSE (m) | (kJ) | Speedup | Failures |
|---|---|---|---|---|
| NMPC | 1× | 0/30 | ||
| PPO | 0/30 | |||
| PID-SF | 5/30 | |||
| Stanley | 4/30 |

Figure 10: Tracking accuracy over LHS initial conditions (mean std, failure counts annotated). Wilcoxon ; Cohen's .
5.8. Generalization to Unseen Tracks
The policy successfully transfers without retraining, achieving (m) on the ISO 3888-1 lane-change and 0.189 (m) on the chicane, both of which are within the 1 (m) corridor and with a lower error than the training S-curve; this is an expected result since these tracks have a more lenient curvature profile. We emphasize an honest reading of Table 9: NMPC and Stanley track these two low-curvature tracks more accurately than the policy. However, our claim, which this data supports, is that the policy generalizes safely and without failure off-distribution, not that it necessarily dominates. Results are summarized in Table 9 and Fig. 11.
Table 9
Multi-track evaluation. The policy is not retrained on any evaluation track.
| Controller | S-curve (m) | ISO 3888-1 (m) | Chicane (m) |
|---|---|---|---|
| NMPC | 0.474 | 0.112 | 0.135 |
| PPO (zero-shot) | 0.314 | 0.197 | 0.189 |
| PID-SF | 1.155 | 0.198 | 0.451 |
| Stanley | 1.666 | 0.124 | 0.141 |
5.9. Random-Track Generalization
For a more comprehensive evaluation, we analyze the controllers' response over a family of 20 randomly generated cubic splines with curvature capped at (). Here, the policy successfully completes all 30 tracks with (m) without a single failure; its variance across tracks is the lowest of the learned-versus-classical comparison, while NMPC remains the most accurate.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 15 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles

Figure 11: Zero-shot evaluation on the ISO 3888-1 double lane change. The policy was trained only on the S-curve; no retraining was performed.
Table 10
Generalization over 30 unseen random splines with (m). All controllers, including NMPC, are evaluated on all 30 tracks.
| Controller | Tracks | RMSE (m) | Failures |
|---|---|---|---|
| NMPC | 30 | 0.163 0.038 | 0/30 |
| PPO | 30 | 0.256 0.032 | 0/30 |
| Stanley | 30 | 0.304 0.426 | 1/30 |
| PID-SF | 30 | 0.375 0.101 | 0/30 |
5.10. Road-Grade Robustness
Relaxing the flat-road assumption of (8), we impose in both the plant and the energy model while all controllers retain the flat-road profile, i.e., the grade acts as an unmodelled disturbance. Here, the policy is essentially unaffected with (m) compared to 0.314 (m) flat, while NMPC degrades moderately with (m) compared to 0.474 (m) as its internal model omits the grade term. Similarly, PID-SF degrades to (m).
5.11. Sensor Noise Robustness
Table 11 reports sensitivity to Gaussian observation noise at evaluation time, where Phase 3 training applies matched randomization at . Performance is unchanged up to the training noise level, where the policy is marginally better at than the noise-free case, with compared to 0.314 (m). This is consistent with the matched randomization acting as a regularizer. The policy degrades sharply only beyond , which is outside the accuracy of typical sensing hardware as depicted below.
For comparison, production automotive GNSS achieves 0.1–0.2 (m) lateral accuracy under RTK-fixed conditions Reid et al. (2019), i.e., after normalization by , while automotive-grade MEMS IMUs report heading errors of 1°–3° Gonzalez and Dabove (2019), i.e., .
Table 11
Observation-noise robustness. Values are mean std over five independent noise realizations of the same trained policy; the zero standard deviation at reflects the deterministic policy. This differs from the five training seeds of Section 5.7.
| RMSE (m) | |
|---|---|
| 0.000 | 0.314 0.000 |
| 0.010 | 0.308 0.008 |
| 0.020 | 0.369 0.031 |
| 0.050 | 1.549 0.546 |
| 0.100 | 2.015 0.337 |
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 16 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
5.12. Predictive Safety Filter
Since a learned policy inherently does not have a constraint guarantee, we add a minimally invasive projection filter as follows: candidate steering rates are evaluated by a short forward rollout of the kinematic model, where the admissible candidate closest to the policy's proposal is applied. On the set, the filter is effectively insignificant with a filtered response of (m) compared to an unfiltered response of 0.387 (m). Similarly, every aforementioned result remain essentially unaffected. However, under deliberately extreme initialization conditions up to 4.2 (m), it intervenes frequently but does not eliminate all corridor violations. Therefore, we present it as a practical projection filter and not a formal safety certificate, for which a control-barrier formulation may be necessary.
5.13. Curriculum Ablation: Tracking-Neutral, Energy-Critical
In Table 12, we train four schedules under an identical budget to analyze the conventional reading of curriculum benefits. Tracking is essentially insensitive to the schedule: all four variants lie within 0.067 (m) of one another, where the no-curriculum variant still exhibits an acceptable behavior. On the contrary, the curriculum drives energy-aware control: the full schedule reduces the energy requirements to (kJ), which is less than half of the required energy by the no-curriculum variant 63.65 (kJ). Phase 4, in which the energy term is activated after the tracking skill is established, is the primary source of this outcome. Therefore, the curriculum may be regarded as energy-critical and tracking-neutral in this problem, rather than as a general accelerator of tracking performance.
Table 12
Curriculum ablation ( steps each). Ranking is by since tracking is effectively unaffected, i.e., tracking spread across variants is 0.067 (m), while energy spread is 36.8 (kJ).
| Var. | Description | RMSE (m) | (kJ) |
|---|---|---|---|
| A | Full (Ph. 0→1→2→3→4) | 0.379 | 26.89 |
| B | Phase 1 only | 0.332 | 58.10 |
| C | Phases 1+2 only | 0.312 | 47.51 |
| D | Phase 2 only (no curriculum) | 0.323 | 63.65 |
5.14. Validation with a Dynamic Single-Track Model
The kinematic model neglects tire slip, which is the principal threat to the external validity of the preceding results. We therefore repeat the benchmark on a dynamic single-track plant with linear tires, a state vector and the standard force balance Rajamani (2012):
with parameters in Table 2 and slip angles clipped at 0.12 (rad) to keep the linear tire assumption valid. In addition, we accommodate the more nuanced lateral dynamics by integrating the plant with ten RK4 sub-steps per control period.
Dynamic baseline comparison The analysis of controllers designed primarily for a kinematic model on a dynamic plant may be insufficient; hence, we introduce a standard dynamic-model baseline Rajamani (2012), i.e., an LQR on the lateral error state with speed-scheduled gains obtained from the algebraic Riccati equation, curvature feed-forward, partnered with a conditional integral term that is only engaged once the transient terms have decayed. Here, a unit step response starting at (m), (ms) settles within 1.6 (s) with an overshoot of 0.02 (m), and a steady-state error of 0.012 (m).
The results demonstrated in Table 13 and Fig. 12 support the following claims:
-
The policy transfers: It is applied zero-shot to a plant it never saw and completes the path at 0.473 (m). Moreover, fine-tuning steps elevate its performance to 0.273 (m) with peak lateral acceleration 3.48 (ms) inside the linear-tire regime.
-
Qualitative ordering of the kinematic study survives: NMPC retains the highest regeneration (68.6%) and the classical kinematic-designed baselines degrade, while at this higher speed the fine-tuned policy becomes the most
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 17 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
Table 13
Dynamic single-track validation with linear tires, (kN rad), (ms). All runs reach the end of path. NMPC retains its kinematic internal model and operates under plant–model mismatch, a nominal case in practice.
| Controller | RMSE (m) | (kJ) | Regen (%) | Status |
|---|---|---|---|---|
| PPO fine-tuned (100 k) | 0.273 | 25.56 | 48.9 | ok |
| LQR (dynamic model) | 0.438 | 29.30 | 46.0 | ok |
| PPO zero-shot | 0.473 | 25.00 | 48.0 | ok |
| NMPC (kinematic model) | 0.560 | 13.69 | 68.6 | ok |
| PID-SF (kinematic design) | 0.740 | 30.10 | 44.7 | ok |
| Stanley (re-tuned) | 2.008 | 25.06 | 52.2 | ok |
accurate controller, overtaking the dynamic LQR whose gains are synthesised at (ms) and therefore detune as speed rises.
- Results are bounded: The study is valid for (ms) and (rad). A nonlinear tire model with slip-dependent regenerative torque limits, such as Pacejka, is deferred to future work.

Figure 12: Lateral deviation on the dynamic single-track plant with linear tires and (ms). The fine-tuned policy tracks second only to the purposefully-designed dynamic LQR, while remaining within the linear-tire regime (ms).
6. Discussion
What the trade-off actually looks like. The analysis this paper set out to make paints an asymmetric picture. An optimizer with an explicit horizon converts the terminal ramp into recovered energy more effectively than a reactive policy (59.9% against 9.3% for the naive policy), which is a structural consequence of what each controller can observe, not of the training budget. Supplying the policy with a 30 (m) preview and an energy-aware reward recovers three quarters of that deficit at no cost in tracking, rather with an improvement in performance. This is our paper's central quantitative claim.
Why preview also improves tracking. Previewed curvature anticipates lateral demand, which is exactly the information a feed-forward term supplies to a classical controller. The improvement from to (m) is therefore not only expected, but also informative: it confirms the interdependency of the two objectives.
When NMPC remains preferable. NMPC enforces state and input constraints explicitly and retains the highest regenerative fraction on both the kinematic and dynamic plants. Across our evaluated controllers, it yields the least deviations on unseen low-curvature tracks, cf. Tables 9 and 10. Moreover, a JIT compiled solver provenly satisfies strict real-time requirements, as discussed in Section 5.3. The case for the learned policy is therefore not dominance but a rather yielding comparable or better accuracy under disturbance, zero failures, insensitivity to road grade, and a computational margin that relieves constrained hardware in AD applications.
On curriculum-learning. At equal budgets, phase ordering has no significant impact on tracking, yet more than halves the net consumed energy, cf. Table 12. We attribute this to positioning of Phase 4, where an energy term
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 18 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
introduced before the tracking skill exists competes with it, while the same term applied to a competent policy refines the speed profile and, therefore, reduces energy consumption.
Limitations. In this work, we acknowledge the following limitations: (i) All achieved results stem from numerical simulations. The dynamic study in Section 5.14 mitigates this issue, yet does not completely rectify it; hardware-in-the-loop validations remain necessary. (ii) The dynamic study highlights the limitations of the kinematic assumption. When pushing the vehicle to the maximum speed envelope ( ) on the dynamic plant, the lateral accelerations exceed the linear tire regime, rendering both NMPC and PPO unstable ( ). This emphasizes that future migration into the nonlinear regime (e.g., using Pacejka tire models) is critical, specifically since the stability logic blends regenerative torque down near the friction limit, which is a coupling not captured by (8). (iii) is constant rather than deceleration-dependent, which we attempted to address in our sensitivity analysis in Section 5.5, yet honestly report here. Finally, (iv) the proposed safety filter is a projection heuristic, not a safety guarantee.
7. Conclusion
In this work, we set out to provide a comprehensive analysis of vehicle controllers for energy-and velocity-aware path following. We proposed a kinematic vehicle model, for which we implemented four control methods following classical, optimal, and learning-based strategies. Moreover, we extended our developed controllers to accommodate a single-track vehicle model with linear tires, implementing a baseline LQR for a fair comparison. For our RL-based PPO controller, we summarize our findings as follows:
-
The structural deficit is real. With a purely local observation, a learned policy recovers 9.3% of consumed energy, whereas NMPC recovers 59.9%.
-
This deficit can be largely rectified without an online optimizer. A 30 (m) preview of curvature and reference speed together with a VT-CPEM energy-based reward successfully raised recovery to 47.9% – 76% of the identified energy gap, while improving tracking from (m) to 0.314 (m); the two metrics are essentially complementary.
-
The advantage is robust, not incidental. (m) against NMPC's (m) over LHS initial conditions (Wilcoxon , ), 0/30 failures, and (m) in ten seeds.
-
It generalizes. ISO 3888-1 lane-change 0.197 (m), chicane 0.189 (m), 30 random splines (m) with 0/30 failures, and near-invariance to a road grade.
-
It survives tire dynamics. On a dynamic single-track plant, the policy transfers zero-shot with (m), reaching 0.273 (m) after brief fine-tuning, ahead of a properly designed dynamic LQR at 0.438 (m). Here, NMPC still retains the highest energy regeneration.
-
Real-time claims are proven. A compiled NMPC with JIT acceleration via CasADi meets the real-time budget (s). Nevertheless, the learned policy remains faster than a real-time NMPC.
-
The curriculum is energy-critical, not tracking-critical. At equal budget, schedules differ by 0.067 (m) in tracking but by 36.8 (kJ) in net energy.
Future work follows directly: (i) A longer or learned preview horizon with a recurrent value function to close the residual gap 24%, (ii) a nonlinear tire model with slip-dependent regenerative limits, (iii) a control-barrier formulation to replace the projection filter with a certificate, (iv) validation on a high-fidelity simulator and/or on actual hardware, and (v) addressing high-level control objectives, such as obstacle avoidance and reference trajectory generation.
A. Per-Phase Reward Weights
Table 14 lists the weights of (22) for each curriculum phase, so that the reward is fully reproducible. Symbols map to the implementation as , , , , , and . The energy term is deliberately inactive until Phase 4 to adequately establish the path- and velocity- tracking skills first. Section 5.13 explains how this ordering renders the schedule energy-critical.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 19 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
Table 14
Reward weights of (22) by curriculum phase. An additional penalty of 0.5 is applied whenever the normalized speed error exceeds 0.25 Hess and Ljungbergh (2021), and is applied once at the terminal step of a failed episode.
| Phase | |||||||
|---|---|---|---|---|---|---|---|
| 0 (longitudinal, straight) | 0.3 | 0.3 | 1.0 | 0.02 | 0.8 | 0.10 | 0.0 |
| 1 (lateral introduction) | 0.8 | 1.2 | 0.5 | 0.05 | 0.3 | 0.05 | 0.0 |
| 2 (stopping, full path) | 0.8 | 1.2 | 0.8 | 0.05 | 0.3 | 0.05 | 0.0 |
| 3 (disturbance recovery) | 1.0 | 1.5 | 0.5 | 0.10 | 0.4 | 0.05 | 0.0 |
| 4 (energy optimization) | 0.6 | 1.0 | 0.5 | 0.10 | 0.5 | 0.15 |
CRediT Author Statement
Mohamed Sabaa: Conceptualization, Methodology, Software, Formal analysis, Investigation, Visualization, Writing – original draft. Mostafa Emam: Conceptualization, Methodology, Software, Supervision, Validation, Writing – review & editing.
Declaration of Competing Interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Funding
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.
Data Availability
The simulation code, trained policies, and the scripts that reproduce every table and figure in this paper are openly available at https://github.com/mohamedkamalsabaa/Regenerative-Energy-in-Learned-Path-Following. The archive includes the companion notebook, the exported figure data, and the plotting script, so all reported results can be regenerated from a single execution. The do-mpc framework is available at https://www.do-mpc.com and Stable-Baselines3 at https://stable-baselines3.readthedocs.io.
Acknowledgements
The authors thank the developers of do-mpc, CasADi, and Stable-Baselines3 for their open-source contributions.
References
Anzalone, L., Barra, S., Nappi, M., 2021. Reinforced curriculum learning for autonomous driving in CARLA, in: Proc. IEEE ICIP, pp. 3318–3322. doi:10.1109/ICIP42928.2021.9506673.
Bécsi, T., 2024. RRT-guided experience generation for reinforcement learning in autonomous lane keeping. Scientific Reports 14. doi:10.1038/s41598-024-73881-z.
Belkebir, T., Belkebir, H., Mansouri, A., 2026. Real-time embedded nmpc for autonomous vehicle path tracking with curvature-aware speed adaptation and sensitivity analysis. Automation 7. doi:10.3390/automation7020044.
Bengio, Y., Louradour, J., Collobert, R., Weston, J., 2009. Curriculum learning, in: Proc. ICML, pp. 41–48. doi:10.1145/1553374.1553380.
Ding, F., Luo, X., Li, G., Tew, H.H., Loo, J.Y., Tong, C.W., Bakibillah, A., Zhao, Z., Tao, Z., 2024. Energy-efficient hybrid model predictive trajectory planning for autonomous electric vehicles, in: 2024 IEEE International Conference on Systems, Man, and Cybernetics (SMC), pp. 1263–1269. doi:10.1109/SMC54092.2024.10831081.
Domina, Á., Tihanyi, V., 2022. LTV-MPC approach for automated vehicle path following at the limit of handling. Sensors 22, 5807. doi:10.3390/s22155807.
Evans, B., Engelbrecht, H.A., Jordaan, H.W., 2021. Reward signal design for autonomous racing, in: Proc. 20th ICAR, pp. 455–460. doi:10.1109/ICAR53236.2021.9659438.
Fiori, C., Ahn, K., Rakha, H.A., 2016. Power-based electric vehicle energy consumption model: Model development and validation. Applied Energy 168, 257–268. doi:10.1016/j.apenergy.2016.01.097.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 20 of 21
Energy-Aware Path Following: Comparative Analysis of Reinforcement Learning and NMPC for Electric Vehicles
Fu, T., Zhou, H., Liu, Z., 2022. NMPC-based path tracking control strategy for autonomous vehicles with stable limit handling. IEEE Transactions on Vehicular Technology 71, 12499–12510. doi:10.1109/TVT.2022.3196315.
Gonzalez, R., Dabove, P., 2019. Performance assessment of an ultra low-cost inertial measurement unit for ground vehicle navigation. Sensors 19, 3865. doi:10.3390/s19183865.
Hess, G., Ljungbergh, W., 2021. Deep deterministic path following. arXiv:2104.06014.
Hoffmann, G.M., Tomlin, C.J., Montemerlo, M., Thrun, S., 2007. Autonomous automobile trajectory tracking for off-road driving: Controller design, experimental validation and racing, in: Proc. American Control Conference (ACC), pp. 2296–2301. doi:10.1109/ACC.2007.4282788.
Kropiwnicki, J., Gawlas, T., 2023. Evaluation of the energy efficiency of electric vehicle drivetrains under urban operating conditions. Combustion Engines doi:10.19206/ce-169492.
Lee, J., Yim, S., 2023. Comparative study of path tracking controllers on low friction roads for autonomous vehicles. Machines 11, 403. doi:10.3390/machines11030403.
Li, D., Zhao, D., Zhang, Q., Chen, Y., 2019. Reinforcement learning and deep learning based lateral control for autonomous driving [application notes]. IEEE Computational Intelligence Magazine 14, 83–98. doi:10.1109/MCI.2019.2901089.
Liu, H., Zhang, L., Li, S., et al., 2024. A safety requirements' adaptive NMPC strategy for electric vehicle stability control. IEEE Transactions on Transportation Electrification 10, 3991–4005. doi:10.1109/TTE.2023.3312397.
Liu, J., Yang, Z., Huang, Z., et al., 2021. Simulation performance evaluation of pure pursuit, stanley, LQR, MPC controller for autonomous vehicles, in: Proc. IEEE RCAR, pp. 1444–1449. doi:10.1109/RCAR52367.2021.9517448.
McKay, M.D., Beckman, R.J., Conover, W.J., 1979. A comparison of three methods for selecting values of input variables. Technometrics 21, 239–245. doi:10.2307/1268522.
Paden, B., Cáp, M., Yong, S.Z., Yershov, D., Frazzoli, E., 2016. A survey of motion planning and control techniques for self-driving urban vehicles. IEEE Transactions on Intelligent Vehicles 1, 33–55. doi:10.1109/TIV.2016.2578706.
Raffin, A., Hill, A., Gleave, A., Kanervisto, A., Ernestus, M., Dormann, N., 2021. Stable-baselines3: Reliable reinforcement learning implementations. Journal of Machine Learning Research 22, 1–8.
Rajamani, R., 2012. Vehicle Dynamics and Control. Springer. doi:10.1007/978-1-4614-1433-9.
Rawlings, J.B., Mayne, D.Q., Diehl, M., 2017. Model Predictive Control: Theory, Computation, and Design. 2 ed., Nob Hill Publishing.
Reid, T.G.R., Pervez, N., Ibrahim, U., Houts, S.E., Pandey, G., Alla, N.K., Hsia, A., 2019. Standalone and rtk gnss on 30,000 km of north american highways, in: Proceedings of the 32nd International Technical Meeting of the Satellite Division of The Institute of Navigation (ION GNSS+ 2019), Institute of Navigation. pp. 2135–2158. doi:10.33012/2019.16914.
Reiter, R., Nurkanovic, A., Frey, J., Diehl, M., 2023. Frenet–Cartesian model representations for automotive obstacle avoidance within nonlinear MPC. European Journal of Control 74, 100847. doi:10.1016/j.ejcon.2023.100847.
Stano, P., Montanaro, U., Tavernini, D., et al., 2023. Model predictive path tracking control for automated road vehicles: A review. Annual Reviews in Control 55, 194–236. doi:10.1016/j.arcontrol.2022.11.001.
Tang, M., Zhang, X., 2024. Optimal regenerative braking control strategy for electric vehicles based on braking intention recognition. IEEE Transactions on Vehicular Technology 73, 3378–3392. doi:10.1109/TVT.2023.3327298.
Tian, Z., Xia, L., Shi, W., 2025. Emato: Energy-model-aware trajectory optimization for autonomous driving, in: 2025 IEEE International Conference on Robotics and Automation (ICRA), pp. 9682–9688. doi:10.1109/ICRA55743.2025.11127833.
Wächter, A., Biegler, L.T., 2006. On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming. Mathematical Programming 106, 25–57. doi:10.1007/s10107-004-0559-y.
Werling, M., Ziegler, J., Kammel, S., Thrun, S., 2010. Optimal trajectory generation for dynamic street scenarios in a frenét frame, in: 2010 IEEE International Conference on Robotics and Automation, IEEE. pp. 987–993. doi:10.1109/robot.2010.5509799.
Wu, C., Kirchner, S., Purschke, N., Knoll, A.C., 2025. Autonomous vehicle lateral control using deep reinforcement learning with MPC-PID demonstration, in: Proc. IEEE IV Symposium, pp. 2317–2324. doi:10.1109/IV64158.2025.11097527.
Wu, J., Huang, C., Huang, H., Lv, C., Wang, Y., Wang, F.Y., 2024. Recent advances in reinforcement learning-based autonomous driving behavior planning: A survey. Transportation Research Part C: Emerging Technologies, 104654 doi:10.1016/j.trc.2024.104654.
Yang, X., Xiong, L., Leng, B., Zeng, D., Zhuo, G., 2020. Design, validation and comparison of path following controllers for autonomous vehicles. Sensors 20, 6052. doi:10.3390/s20216052.
Yoon, S., Kwon, Y., Ryu, J., Kim, S., Choi, S., Lee, K., 2024. Reinforcement-learning-based trajectory learning in Frenét frame for autonomous driving. Applied Sciences 14, 6977. doi:10.3390/app14166977.
Zarrouki, B., Wang, C., Betz, J., 2024. Adaptive stochastic nonlinear MPC with look-ahead deep reinforcement learning for autonomous vehicle motion control, in: Proc. IEEE/RSJ IROS, pp. 12726–12733. doi:10.1109/IROS58592.2024.10801876.
Zhao, J., Zhao, W., Deng, B., Wang, Z., Zhang, F., Zheng, W., Cao, W., Nan, J., Lian, Y., Burke, A.F., 2024. Autonomous driving system: A comprehensive survey. Expert Systems with Applications, 122836 doi:10.1016/j.eswa.2023.122836.
M. Sabaa and M. Emam: Preprint submitted to Elsevier
Page 21 of 21