Comparison of NMPC and GPU-Parallelized MPPI for Real-Time UAV Control on Embedded Hardware
Abstract
1. Introduction
1.1. Motivation
1.2. Problem Statement
- Monolithic architectures: Existing implementations usually embed the entire control logic on the flight MCU, so every time a different strategy (PID, NMPC, MPPI, …) is tested the firmware must be re-compiled and flashed. Besides hindering fair benchmarking, this approach is limited by the scarce computational budget of typical autopilot processors (e.g., STM32H7 on Pixhawk, 1–2 MB RAM), which is insufficient for NMPC and MPPI, which require hundreds if not thousands of trajectory roll-outs per step. To address these limitations, we offload the computation of both predictive controllers to a companion computer mounted onboard the UAV. This architecture enables
- (i)
- the computing power needed for real-time NMPC/MPPI;
- (ii)
- the possibility to select the controller at launch time through ROS 2 parameters instead of at compile time, thus greatly simplifying A/B comparisons.
Although the additional communication hop introduces latency overhead, this distributed architecture follows established practices in UAV control systems [13,14] and overcomes the monolithic deployments reported in [15]. The communication latency remains acceptable for the 20 ms control period used in our experiments. Moreover, when multi-node software architectures are used it is possible to use ROS node composition to overcome significant overhead [16].
1.3. Related Works
1.3.1. NMPC Implementations
1.3.2. MPPI Implementations
1.3.3. Research Gaps
1.4. Contributions
1.5. Methodology Overview
1.6. Paper Structure
2. Background
2.1. Mathematical Model of the UAV
2.2. Control Algorithms
2.2.1. UAV Dynamic Model Used in the Controllers
2.2.2. Nonlinear Model Predictive Control—NMPC
2.2.3. Model Predictive Path Integral (MPPI) Control
Algorithm 1: MPPI control update |
2.2.4. Savitzky–Golay Filter Implementation in MPPI
2.3. Key Implementation Differences
Aspect | NMPC | MPPI |
---|---|---|
Optimization | Deterministic optimal control via gradient-based methods | Stochastic optimal control through Monte Carlo sampling |
Constraints | Explicit handling of input/ state constraints within solver framework | Input constraints via sample clipping; state constraints through cost penalties |
Control Output | Smooth, locally optimal control sequence | Weighted average of noisy samples, inherently stochastic |
Computation | CPU-intensive with specialized solvers (acados) | GPU-accelerated parallel computation (JAX) |
Post- Processing | Direct implementation possible | Usually filtered (e.g., Savitzky– Golay) for output smoothing |
3. Methodology
3.1. UAV Platform
3.2. Hardware Platform: NVIDIA Jetson Orin Nano
3.3. Processor-in-the-Loop Experimental Framework
Prediction Horizon Selection
3.4. Controller Implementation and Configuration
3.4.1. NMPC Implementation
3.4.2. MPPI Implementation
3.5. Performance Evaluation Criteria
3.5.1. Tracking Performance Metrics
3.5.2. Computational Performance Metrics
- Computational performance evaluation includes the following:
- Computation Time Statistics: Mean, median, and 95th percentile execution times;
- Real-time Feasibility: Which hardware implementation meets the 20 ms constraint.
3.5.3. Test Scenarios
- 1.
- Nominal Trajectory Tracking: Three-dimensional figure-8 (lemniscate) reference trajectory under ideal conditions;
- 2.
- Robustness Evaluation: Performance under realistic sensor noise conditions;
- 3.
- Dynamic Capability: Dynamic reference trajectory switching scenarios;
- 4.
- Parameter Sensitivity: Systematic analysis of key parameter effects on performance and computational requirements.
4. Results and Analysis
4.1. Trajectory Tracking Performance
4.1.1. Nominal Conditions
- Centre: ;
- Scale: ;
- Period: (one complete figure-8 every 15 s);
- Total simulation time: s;
- Simulation step: .
Component | NMPC (N = 20) (m) | NMPC (N = 40) (m) | MPPI (m) |
---|---|---|---|
X | 0.7682 | 0.7272 (−5.3%) | 0.6126 |
Y | 0.1760 | 0.1742 (−1.0%) | 0.0901 |
Z | 0.4063 | 0.4000 (−1.6%) | 0.3039 |
Overall | 0.8866 | 0.8480 (−4.4%) | 0.6897 |
4.1.2. Noisy Conditions
Parameter | Value | Units | Description |
---|---|---|---|
Position noise (GPS) | 0.1 | m | Standard deviation of position measurements |
Velocity noise | 0.05 | m/s | Standard deviation of velocity estimation |
Attitude noise (IMU) | 1.0 | deg | Standard deviation of attitude measurements |
Angular rate noise | 2.0 | deg/s | Gyroscope measurement noise |
Measurement frequency | 100.0 | Hz | Sensor update rate |
Position bias drift | 0.001 | m/s | Position bias drift rate |
Attitude bias drift | 0.1 | deg/s | Attitude bias drift rate |
Component | Undisturbed (mm) | Noisy (mm) (degr. %) |
---|---|---|
X-axis | 28.92 | 82.72 (+186.0%) |
Y-axis | 19.60 | 65.98 (+236.6%) |
Z-axis | 83.09 | 110.93 (+33.5%) |
Total | 90.13 | 153.30 (+70.1%) |
N = 20 | N = 40 | |||
---|---|---|---|---|
Component | Clean (mm) | Noisy (mm) (degr. %) | Clean (mm) | Noisy (mm) (degr. %) |
X-axis | 577.74 | 632.13 (+9.4%) | 317.37 | 349.95 (+10.3%) |
Y-axis | 189.33 | 296.79 (+56.8%) | 117.74 | 136.51 (+15.9%) |
Z-axis | 84.42 | 113.11 (+34.0%) | 53.92 | 80.85 (+49.9%) |
Total | 613.80 | 707.43 (+15.3%) | 342.77 | 384.23 (+12.1%) |
4.1.3. Dynamic Reference Changes
4.2. Computational Performance Analysis
4.2.1. NMPC Performance
Platform | Mean | Median | 95th %ile |
---|---|---|---|
(ms) | (ms) | (ms) | |
Workstation PC (N = 20) | 0.76 | 0.74 | 0.96 |
Workstation PC (N = 40) | 1.56 | 1.48 | 1.94 |
Embedded Hardware (N = 20) | 5.76 | 5.60 | 6.69 |
Embedded Hardware (N = 40) | 10.98 | 10.38 | 13.14 |
4.2.2. MPPI Performance (CPU vs. GPU)
- Workstation Performance (CPU: Intel Ultra 7 165H/GPU: Nvidia RTX 2000)
Metric | CPU | GPU |
---|---|---|
Mean (ms) | 14.97 | 3.60 |
Median (ms) | 14.00 | 2.53 |
95th Percentile (ms) | 19.98 | 2.88 |
Meets 20 ms Target | Yes | Yes |
Speedup (Median) | — | 5.53× |
- Embedded Hardware Performance (CPU: 6-core Arm Cortex-A78AE/GPU: NVIDIA Ampere 1024 CUDA cores)
Metric | CPU | GPU |
---|---|---|
Mean (ms) | 31.02 | 26.40 |
Median (ms) | 29.15 | 17.63 |
95th Percentile (ms) | 30.71 | 18.35 |
Meets 20 ms Target | No | Yes |
Speedup (Median) | — | 1.65× |
- JIT Compilation Overhead
- Discussion on GPU Speedup
4.2.3. MPPI Parameter Sensitivity Analysis
4.3. Real-Time Feasibility Assessment
- NMPC Real-time Characteristics:
- Consistent sub-15 ms performance on Jetson Orin Nano;
- CPU-only deployment, thus not dependent on GPU acceleration;
- Predictable computational overhead with low variance;
- Excellent safety margins for real-time operation (for 50 Hz control rate).
- MPPI Real-time Characteristics:
- Requires GPU acceleration for embedded deployment;
- 17.63 ms median computation time (GPU) vs. 29.15 ms (CPU);
- Parameter-dependent performance requiring careful tuning;
- JAX JIT compilation provides significant optimization.
- Deployment Recommendations:
- 1.
- NMPC: Suitable for platforms with limited GPU capabilities and applications requiring predictable computational overhead;
- 2.
- MPPI: Requires modern embedded platforms with GPU support; optimal for tracking performance-critical applications;
- 3.
- MPPI Parameter Selection: Chosen configuration to comply with the 50 Hz computational limit (i.e., execution time below 20 ms) imposed by the PX4 hardware: 40 horizon steps, 800–1250 samples, temperature .
5. Conclusions and Discussion
5.1. Key Findings and Performance Analysis
5.2. Technical Contributions
5.3. Practical Implications
5.4. Future Research Directions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Hanover, D.; Foehn, P.; Sun, S.; Kaufmann, E.; Scaramuzza, D. Performance, Precision, and Payloads: Adaptive Nonlinear MPC for Quadrotors. IEEE Robot. Autom. Lett. 2022, 7, 690–697. [Google Scholar] [CrossRef]
- Sreenath, K.; Lee, T.; Kumar, V. Geometric control and differential flatness of a quadrotor UAV with a cable-suspended load. In Proceedings of the 52nd IEEE Conference on Decision and Control, Firenze, Italy, 10–13 December 2013; pp. 2269–2274. [Google Scholar]
- Boukabou, I.; Kaabouch, N.; Rupanetti, D. Cybersecurity challenges in UAV systems: IEMI attacks targeting inertial measurement units. Drones 2024, 8, 738. [Google Scholar] [CrossRef]
- Zhang, Z.; Zhou, Y.; Zhang, Y.; Qian, B. Strong electromagnetic interference and protection in UAVs. Electronics 2024, 13, 393. [Google Scholar] [CrossRef]
- Kamel, M.; Burri, M.; Siegwart, R. Linear vs nonlinear mpc for trajectory tracking applied to rotary wing micro aerial vehicles. IFAC-PapersOnLine 2017, 50, 3463–3469. [Google Scholar] [CrossRef]
- Carlos, B.B.; Sartor, T.; Zanelli, A.; Frison, G.; Burgard, W.; Diehl, M.; Oriolo, G. An efficient real-time NMPC for quadrotor position control under communication time-delay. In Proceedings of the 2020 16th International Conference on Control, Automation, Robotics and Vision (ICARCV), Shenzhen, China, 13–15 December 2020. [Google Scholar] [CrossRef]
- Verheijen, P.C.N.; Derkani, A.H.; Agarwal, Y.A.; Lazar, M.; Goswami, D. Multilevel parallel GPU implementation of SQP solvers for Nonlinear MPC. In Proceedings of the 2024 European Control Conference (ECC), Stockholm, Sweden, 25–28 June 2024; pp. 2292–2298. [Google Scholar] [CrossRef]
- Williams, G.; Drews, P.; Goldfain, B.; Rehg, J.M.; Theodorou, E.A. Aggressive driving with model predictive path integral control. In Proceedings of the 2016 IEEE International Conference on Robotics and Automation (ICRA), Stockholm, Sweden, 16–21 May 2016; pp. 1433–1440. [Google Scholar] [CrossRef]
- Williams, G.; Aldrich, A.; Theodorou, E.A. Model predictive path integral control: From theory to parallel computation. J. Guid. Control Dyn. 2017, 40, 344–357. [Google Scholar] [CrossRef]
- Pravitra, J.; Ackerman, K.A.; Cao, C.; Hovakimyan, N.; Theodorou, E.A. L1-Adaptive MPPI Architecture for Robust and Agile Control of Multirotors. In Proceedings of the 2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Las Vegas, NV, USA, 24 October 2020–24 January 2021; pp. 7661–7666. [Google Scholar] [CrossRef]
- Minařík, M.; Pěnička, R.; Vonásek, V.; Saska, M. Model predictive path integral control for agile unmanned aerial vehicles. In Proceedings of the 2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Abu Dhabi, United Arab Emirates, 14–18 October 2024; pp. 13144–13151. [Google Scholar] [CrossRef]
- Vlahov, B.; Gibson, J.; Gandhi, M.; Theodorou, E.A. MPPI-Generic: A CUDA Library for Stochastic Optimization. arXiv 2024, arXiv:2409.07563. [Google Scholar] [CrossRef]
- Reinhardt, D.; Johansen, T.A. Control of fixed-wing UAV attitude and speed based on embedded nonlinear model predictive control. IFAC-PapersOnLine 2021, 54, 91–98. [Google Scholar] [CrossRef]
- Pozzan, B.; Elaamery, B.; Cenedese, A. Non-Linear Model Predictive Control for autonomous landing of a UAV on a moving platform. In Proceedings of the 2022 IEEE Conference on Control Technology and Applications (CCTA), Trieste, Italy, 23–25 August 2022; pp. 1240–1245. [Google Scholar] [CrossRef]
- Sadi, M.A.; Jamali, A.; Abang Kamaruddin, A.M.N. Optimizing UAV performance in turbulent environments using cascaded model predictive control algorithm and Pixhawk hardware. J. Braz. Soc. Mech. Sci. Eng. 2025, 47, 1–26. [Google Scholar] [CrossRef]
- Macenski, S.; Soragna, A.; Carroll, M.; Ge, Z. Impact of ROS 2 node composition in robotic systems. arXiv 2023, arXiv:2305.09933. [Google Scholar] [CrossRef]
- Turrisi, G.; Modugno, V.; Amatucci, L.; Kanoulas, D.; Semini, C. On the benefits of GPU sample-based stochastic predictive controllers for legged locomotion. In Proceedings of the 2024 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Abu Dhabi, United Arab Emirates, 14–18 October 2024; pp. 13757–13764. [Google Scholar] [CrossRef]
- Nascimento, T.; Saska, M. Embedded Fast Nonlinear Model Predictive Control for Micro Aerial Vehicles. J. Intell. Robot. Syst. 2021, 103, 74. [Google Scholar] [CrossRef]
- Elhesasy, M.; Dief, T.N.; Atallah, M.; Okasha, M.; Kamra, M.M.; Yoshida, S.; Rushdi, M.A. Non-Linear Model Predictive Control Using CasADi Package for Trajectory Tracking of Quadrotor. Energies 2023, 16, 2143. [Google Scholar] [CrossRef]
- Verschueren, R.; Frison, G.; Kouzoupis, D.; Frey, J.; van Duijkeren, N.; Zanelli, A.; Novoselnik, B.; Albin, T.; Quirynen, R.; Diehl, M. acados—A modular open-source framework for fast embedded optimal control. Math. Program. Comput. 2022, 14, 147–183. [Google Scholar] [CrossRef]
- Bradbury, J.; Frostig, R.; Hawkins, P.; Johnson, M.J.; Leary, C.; Maclaurin, D.; Necula, G.; Paszke, A.; VanderPlas, J.; Wanderman-Milne, S.; et al. JAX: Composable Transformations of Python+NumPy Programs, version 0.3.13; Google: Mountain View, CA, USA, 2018. Available online: https://github.com/jax-ml/jax (accessed on 16 August 2025).
- Mahony, R.; Kumar, V.; Corke, P. Multirotor aerial vehicles: Modeling, estimation, and control of quadrotor. IEEE Robot. Autom. Mag. 2012, 19, 20–32. [Google Scholar] [CrossRef]
- Meier, L.; Honegger, D.; Pollefeys, M. PX4: A node-based multithreaded open source robotics framework for deeply embedded platforms. In Proceedings of the 2015 IEEE International Conference on Robotics and Automation (ICRA), Seattle, WA, USA, 26–30 May 2015. [Google Scholar] [CrossRef]
- Andrejev, E.M.; Manoharan, A.; Unt, K.E.; Singh, A.K. Π-MPPI: A projection-based model predictive path integral scheme for smooth optimal control of fixed-wing aerial vehicles. IEEE Robot. Autom. Lett. 2025, 10, 6496–6503. [Google Scholar] [CrossRef]
- Kovryzhenko, Y.; Li, N.; Taheri, E. A Control System Design and Implementation for Autonomous Quadrotors with Real-Time Re-Planning Capability. Robotics 2024, 13, 136. [Google Scholar] [CrossRef]
- Jetson Orin Nano Developer Kit Getting Started Guide|NVIDIA Developer. Available online: https://developer.nvidia.com/embedded/learn/jetson-orin-nano-devkit-user-guide/index.html (accessed on 16 August 2025).
- Macenski, S.; Foote, T.; Gerkey, B.; Lalancette, C.; Woodall, W. Robot Operating System 2: Design, architecture, and uses in the wild. Sci. Robot. 2022, 7, eabm6074. [Google Scholar] [CrossRef] [PubMed]
- Controller Diagrams|PX4 Guide (Main). Available online: https://docs.px4.io/main/en/flight_stack/controller_diagrams (accessed on 16 August 2025).
Parameter | Symbol | Value |
---|---|---|
Mass | m | 2.0 kg |
Inertia (x-axis) | 0.02166 kg | |
Inertia (y-axis) | 0.02166 kg | |
Inertia (z-axis) | 0.04 kg |
Parameter | Value | Unit | ||
---|---|---|---|---|
Prediction Horizon | ||||
Control timestep () | 0.02 | |||
Prediction horizon () | 0.4 (and 0.8) | |||
Horizon steps (N) | 20 (and 40) | – | ||
Control Constraints | ||||
Thrust limits | [0.0, 40.0] | |||
Roll/pitch rate limits | [−3.0, 3.0] | |||
Yaw rate limits | [−1.5, 1.5] | |||
Solver Configuration [NMPC Specific] | ||||
QP solver | PARTIAL_CONDENSING_HPIPM | |||
Hessian approximation | GAUSS_NEWTON | |||
Integrator type | ERK | |||
NLP solver | SQP_RTI | |||
Cost Weight | Stage (Q) | Initial (Q0) | Terminal (Qe) | Control (R) |
Position | 1 × 104 | 1 × 103 | 1 | - |
Velocity | 1 × 103 | 1 × 102 | 1 × 10−1 | - |
Quaternion | 1 × 103 | 1 × 102 | 1 × 10−1 | - |
Angular rate | 1 × 101 | 1 | 1 × 10−3 | - |
Thrust | - | - | - | 2 × 10−2 |
Roll/pitch rate | - | - | - | 2 × 10−1 |
Yaw rate | - | - | - | 2 × 10−1 |
Parameter | Value | Unit | ||
---|---|---|---|---|
Prediction Horizon | ||||
Control timestep () | 0.02 | |||
Prediction horizon () | 0.8 | |||
Horizon steps | 40 | – | ||
Sampling [MPPI Specific] | ||||
Number of samples (K) | 900 | – | ||
Temperature () | – | |||
Control Constraints | ||||
Thrust limits | [0.0, 40.0] | |||
Roll/pitch rate limits | [−3.0, 3.0] | |||
Yaw rate limits | [−1.5, 1.5] | |||
Cost Weight | State (Q) | Control (R) | Control Rate () | |
Position | 5 × 103 | - | - | |
Velocity | 4 × 101 | - | - | |
Quaternion | 2 × 101 | - | - | |
Angular rate | 2 × 101 | - | - | |
Thrust | - | 2 × 10−2 | 1 × 10−3 | |
Roll/pitch rate | - | 2 × 10−1 | 1 × 10−2 | |
Yaw rate | - | 2 × 10−1 | 1 × 10−2 |
Implementation | First Computation Time (ms) |
---|---|
CPU | 704.89 |
GPU | 1800.29 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Enrico, R.; Mancini, M.; Capello, E. Comparison of NMPC and GPU-Parallelized MPPI for Real-Time UAV Control on Embedded Hardware. Appl. Sci. 2025, 15, 9114. https://doi.org/10.3390/app15169114
Enrico R, Mancini M, Capello E. Comparison of NMPC and GPU-Parallelized MPPI for Real-Time UAV Control on Embedded Hardware. Applied Sciences. 2025; 15(16):9114. https://doi.org/10.3390/app15169114
Chicago/Turabian StyleEnrico, Riccardo, Mauro Mancini, and Elisa Capello. 2025. "Comparison of NMPC and GPU-Parallelized MPPI for Real-Time UAV Control on Embedded Hardware" Applied Sciences 15, no. 16: 9114. https://doi.org/10.3390/app15169114
APA StyleEnrico, R., Mancini, M., & Capello, E. (2025). Comparison of NMPC and GPU-Parallelized MPPI for Real-Time UAV Control on Embedded Hardware. Applied Sciences, 15(16), 9114. https://doi.org/10.3390/app15169114