Nonlinear MPC Solver Code Generation for Faster Constraint Updates
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for generating solver code for nonlinear model predictive controllers are lengthy, complex, and prone to errors, requiring significant development time and effort, especially for systems like autonomous vehicles.
Innovation Solution
A method for automatically generating solver code by receiving an optimal control problem code, discretizing and linearizing it according to user preferences, and populating a solver template to produce executable code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If solver code is written manually for nonlinear model predictive controllers, then the code can be customized and optimized for specific control problems, but the development time becomes very lengthy and the code becomes extremely complicated and error-prone
Solution Approach 1:
The patent introduces an automatic code generation system that acts as an intermediary between the control problem specification and the solver code. This system automatically translates high-level problem descriptions into optimized solver code, eliminating the need for manual code writing while ensuring accuracy through systematic translation rules and optimization algorithms.
Solution Approach 2:
The code generation system enables the control problem specification to self-generate the solver code automatically. By providing problem parameters, constraints, and objectives, the system autonomously produces optimized solver code without requiring expert manual intervention, thereby reducing development time while maintaining reliability.
2Adaptability or versatility
If solver code is written manually to handle specific control constraints and objectives, then the code can be precisely tailored to the problem, but the code length and complexity increase significantly
Solution Approach 1:
The patent segments the solver code generation into distinct modular components: problem specification, constraint handling, objective function formulation, and code synthesis. Each component processes specific aspects of the control problem independently, allowing precise customization while keeping the overall code structure organized and manageable rather than monolithic and complex.
Solution Approach 2:
The code generation system provides universal templates and frameworks that can handle various types of control problems, constraints, and objectives through a unified approach. This allows the system to adapt to different specific problems while reusing common code structures, thereby reducing overall complexity while maintaining problem-specific customization capabilities.
3Adaptability or versatility
If manual changes are made to solver code to add constraints or modify parameters, then the control problem can be adjusted, but many lines of code must be modified and debugging delays increase
Solution Approach 1:
The system performs preliminary action by automatically generating complete, optimized solver code from high-level problem specifications before any execution or debugging is needed. This upfront automatic generation ensures that constraints and parameters are correctly implemented from the start, eliminating the need for subsequent manual code modifications and extensive debugging.
Solution Approach 2:
The code generation system incorporates feedback mechanisms that allow users to specify desired constraints and parameters at the problem specification level. The system then automatically adjusts and regenerates the solver code to reflect these changes, providing a feedback loop that simplifies modification efforts while maintaining adaptability to different control requirements.
Data Source
AI summary
Systems and methods for automatically generating solver code for a nonlinear model predictive controller are disclosed. In one embodiment, a method of automatically generating solver code for a nonlinear model predictive control solver includes receiving an optimal control problem code, wherein the optimal control problem code represents an optimal control problem comprising a cost function, one or more constraints, and a continuous time model representing dynamics of a system. The method further includes receiving a discretization method preference, a linearization point preference, and a parameter specification, and encoding the optimal control problem into an optimization problem by discretizing the optimal control problem according to the discretization method preference, and linearizing the optimal control problem according to the linearization point preference. The method further includes generating the solver code from the optimization problem.


