Trajectory Optimization and Setpoint Generation — Optimal Plans for Real-Time MPC Tracking
Public reference use case (by others): This page summarizes publicly available reference implementations and papers. Not client results of Dr. Rafal Noga.
Why This Matters (Executive Summary)
- The problem: Many industrial and energy systems operate under complex nonlinear dynamics with dozens of constraints. Solving the full optimization online in real time is either too slow or too risky for production deployment.
- The solution class: A two-stage architecture where a computationally expensive optimal control problem (OCP) is solved offline (or in a slower supervisory loop) to generate optimal trajectories or setpoint libraries, and a fast online MPC tracks these references while handling real-time disturbances.
- Measurable outcomes: Published implementations report robust trajectory solutions across full operating envelopes, improved energy yield for wind systems, tighter batch quality specs, and time-optimal flight that outperforms human pilots.
- Why it matters for operations: You get the best of both worlds — the optimality of a full NLP solution and the robustness of real-time MPC tracking — without requiring extreme compute hardware on the plant floor.
The Design Pattern Explained
The two-stage pattern separates what to do from how to do it in real time:
-
Offline trajectory optimization (the planner): A large-scale nonlinear program (NLP) is solved using tools like CasADi and IPOPT via direct collocation or multiple shooting. This stage captures the “best possible plan” for a given operating condition, respecting all safety and operational constraints. The output is a trajectory (time-varying setpoints) or a library of trajectories indexed by operating condition.
-
Online MPC tracking (the executor): A lightweight MPC runs at the plant’s control rate, tracking the reference trajectory while handling unmeasured disturbances, sensor noise, and minor model deviations. The MPC enforces real-time constraints that the planner may not have captured exactly.
Setpoint libraries and scheduling: Instead of solving one trajectory, a family of optimal trajectories is pre-computed across operating conditions (wind speeds, product grades, batch recipes) and stored as a lookup or scheduling system. This ensures the reference itself is feasible across the full operating range, with sensitivity analysis confirming robustness.
Applications & Reference Implementations
Application 1: Airborne Wind Energy — 3D Trajectory Optimization for Pumping-Cycle Kites (SkySails PN-14)
For the PN-14 airborne wind energy system, a 3D optimal-control formulation was implemented in Python with CasADi and IPOPT to compute power-cycle trajectories for variable-trim kites with rated power up to 200 kW and kite areas of 90-180 m2. The optimization handles geometrical/airspace constraints, feedback-loop performance limits, and aerodynamic/mechanical/electrical boundaries, with wind-speed-dependent initialization to avoid poor local optima. Optimal trajectories differ substantially between low and high wind speeds, and the results were used directly as time-varying setpoints for supervisory control plus performance projections for component sizing. The fast, robust convergence across the full operating range demonstrates industrial-grade trajectory optimization. 1
Application 2: BASF RECOBA — Online MPC for Complex Batch Processes
The EU-funded RECOBA project (6 million EUR, 3-year term), coordinated by BASF, targeted online MPC for complex batch processes including emulsion co-polymerization, steel, and silicon production. The approach combined new sensor technologies with process models and automation tools to enable real-time trajectory tracking during batch execution — moving from fixed schedules to model-based online optimization. The intended outcomes were producing within narrower quality specifications while following optimal trajectories in real time, with higher productivity and energy savings. This represents the industrial gold standard for batch trajectory control in the chemical sector. 2
Application 3: Economic MPC for Wind Turbines — NREL 5-MW Benchmark
A model predictive wind-turbine controller with an economics-oriented performance metric was benchmarked against a baseline controller on the NREL 5-MW reference turbine. The MPC formulation explicitly trades off power capture against structural loads and actuator wear, exploiting wind-speed forecasts for preventive control moves. Benchmark results showed improved generator-speed tracking, softer pitch utilization, better power capture, and reduced tower oscillations compared to the baseline — though with higher power fluctuations, illustrating the explicit multi-objective trade-off that MPC enables. 3
Application 4: MPCC for Time-Optimal Quadrotor Drone Racing — University of Zurich
Model Predictive Contouring Control (MPCC) was applied to quadrotor drone racing, solving time allocation online while respecting full quadrotor dynamics and individual rotor thrust constraints. Unlike classical approaches that first compute a time-optimal trajectory and then track it, MPCC handles both contouring (staying on the path) and progress (advancing quickly) in a single optimization. The approach reported faster real-flight lap times than both a standard MPC tracking a pre-computed time-optimal trajectory and a world-class professional human pilot — demonstrating that unified online trajectory optimization can outperform sequential plan-then-track architectures. 4
Application 5: Emulsion Polymerization — Online MPC Trajectory Tracking
Building on the RECOBA framework, online MPC for emulsion polymerization batch reactors demonstrated trajectory tracking where the controller adjusts feed rates, temperatures, and timing in real time to follow a pre-optimized recipe trajectory. The key challenge in polymerization is that product quality (molecular weight distribution, particle size, conversion) evolves nonlinearly along the batch, making fixed schedules suboptimal when disturbances occur. Online MPC corrects the trajectory in real time, keeping quality within specification despite raw material variability and thermal disturbances. 2
What This Means for Your Operations
The two-stage pattern is directly transferable to any DACH operation where:
- Batch processes follow recipes that could be optimized per grade/product and tracked in real time (chemicals, pharma, food, specialty materials).
- Energy systems need condition-dependent operating strategies (wind turbines, combined heat and power, energy storage scheduling).
- Robotic or mechatronic systems require complex trajectories that respect workspace, actuator, and safety constraints.
Common prerequisites:
- A dynamic model (even simplified) that captures the dominant physics.
- Defined constraint sets (safety, quality, actuator limits).
- Enough operational data to calibrate model parameters and validate margins.
- An integration path from the optimization output to the real-time control layer.
How We Deliver This (Engagement Model)
- Phase 0: NDA + data request — Collect process models, constraint definitions, historical batch/operating data, and current control architecture documentation.
- Phase 1: Fixed-scope discovery (concept + feasibility) — Map the problem to the two-stage architecture. Define the OCP formulation, select solver tools (CasADi/IPOPT or alternatives), and identify the online MPC tracking requirements. Deliver a concept document with architecture, expected benefits, and validation plan.
- Phase 2: Implementation + validation + commissioning — Build the trajectory optimizer and online tracking MPC. Compute setpoint libraries across the operating envelope. Validate against historical data and commissioning scenarios. Deploy with monitoring and safe fallback.
- Phase 3: Monitoring + training + scaling — Monitor trajectory feasibility, tracking error, and constraint activity in production. Train operators on setpoint scheduling and override procedures. Extend to additional product grades, operating conditions, or sister plants.
Typical KPIs to Track
- Trajectory tracking error (deviation from optimal reference)
- Batch quality consistency (Cpk, specification compliance rate)
- Energy yield or efficiency gain versus fixed-schedule baseline
- Constraint violation frequency and margin utilization
- Solver convergence reliability and computation time
- Operator intervention rate and manual override frequency
Risks & Prerequisites
- Model quality determines trajectory quality: If the offline optimization uses an inaccurate model, the “optimal” trajectory may be infeasible or suboptimal in practice. Validate with data.
- Local optima in NLP: Nonlinear trajectory optimization can converge to local optima. Initialization strategies, homotopy methods, and multi-start approaches mitigate this risk.
- Online tracking must be robust: The MPC tracking layer must handle disturbances that the offline planner did not anticipate. Sufficient constraint margins and disturbance rejection capability are essential.
- Integration complexity: Connecting an offline optimization pipeline to a real-time control system requires careful engineering of data flow, timing, and fallback behavior.
FAQ
Why not just solve everything online in one MPC? For many industrial problems, the full nonlinear optimization is too computationally expensive to run at the required control rate. The two-stage approach lets you use a detailed, high-fidelity model offline and a simpler, faster model online — capturing the best plan and executing it robustly.
How often do I need to recompute trajectories? It depends on how much your operating conditions change. Some systems use a pre-computed library indexed by a few key parameters (wind speed, product grade). Others recompute trajectories in a slower supervisory loop (minutes to hours) as conditions evolve.
Can I use this pattern with my existing DCS/PLC? Yes. The trajectory optimizer runs on an engineering workstation or server. Its output — time-varying setpoints — is fed to the existing control system, which tracks them using its standard MPC or PID loops. This minimizes changes to the safety-critical real-time layer.
What tools are used for trajectory optimization? CasADi (open-source modeling and automatic differentiation) with IPOPT (open-source large-scale NLP solver) is a proven, widely-used combination. Commercial alternatives exist but the open-source stack is robust and well-documented.
Book a 30-Minute Discovery Call
Ready to explore whether this pattern fits your system?
Dr. Rafal Noga — Independent APC/MPC Consultant
Fixed-scope discovery · NDA-first · DACH on-site available
Public References
Footnotes
-
“Optimization of 3-D Flight Trajectory of Variable Trim Kites for Airborne Wind Energy Production” (arXiv:2403.00382, 2024). https://arxiv.org/abs/2403.00382 ↩
-
BASF News Release, “BASF Cooperates with Partners to Introduce Online Control of Complex Batch Processes” (RECOBA, 2015). https://www.basf.com/global/en/media/news-releases/2015/03/p-15-172 ↩ ↩2
-
Schild, “Control-Oriented Modeling and Controller Design for Wind Turbines” (IAV / University of Freiburg, 2018). Lecture material on economic MPC for the NREL 5-MW reference turbine. ↩
-
Romero et al., “Model Predictive Contouring Control for Time-Optimal Quadrotor Flight” (University of Zurich RPG). https://rpg.ifi.uzh.ch/docs/Arxiv21_MPCC_Romero.pdf ↩
Related Use Cases
Interested in applying these methods?
Let's discuss how APC/MPC can deliver similar results for your operations.
Get in Touch