Nonlinear MPC Solver Code Generation for Faster Constraint Updates

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvesolver code accuracyVSAvoiddevelopment time
Core Design Contradiction:
ReliabilityVSLoss of time

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #25Self-service

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

Engineering Contradiction:
Improveproblem-specific customizationVSAvoidsolver code complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #6Universality (Multi-functionality)

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

Engineering Contradiction:
Improveconstraint modificationVSAvoidcode modification effort
Core Design Contradiction:
Adaptability or versatilityVSEase of repair

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS12208809B2Systems and methods for automatically generating solver code for nonlinear model predictive control solvers
Publication Date: 2025.01.28 TOYOTA JIDOSHA KK
  • US12208809B2 patent drawing
  • US12208809B2 patent drawing
  • US12208809B2 patent drawing

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.