qpoases - Online Active Set Strategy for Fast Linear MPC

Similar documents
Real-Time Optimization for Fast Nonlinear MPC: Algorithms, Theory, and Applications

Outline 19/3/ Introduction. 2. Current Status of qpoases. 3. Future Developments

An Algorithm for Multi-Parametric Quadratic Programming and Explicit MPC Solutions

Explicit Model Predictive Control by A. Bemporad Controllo di Processo e dei Sistemi di Produzione A.a. 2008/09 1/54

ACADO TOOLKIT - AUTOMATIC CONTROL AND DYNAMIC OPTIMIZATION

Optimal Control Techniques for Dynamic Walking

Nonlinear Programming

Further Results on Multiparametric Quadratic Programming

On the Complexity of Explicit MPC Laws

Approximate nonlinear explicit MPC based on reachability analysis

ACADO Code Generation tool

Programming, numerics and optimization

CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm. Instructor: Shaddin Dughmi

Linear methods for supervised learning

Unconstrained Optimization Principles of Unconstrained Optimization Search Methods

Real-time MPC Stability through Robust MPC design

IN the last decade embedded Model Predictive Control

Linear Machine: A Novel Approach to Point Location Problem

MODEL predictive control (MPC) is continuously

Controlling Hybrid Systems

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm

Outline. CS38 Introduction to Algorithms. Linear programming 5/21/2014. Linear programming. Lecture 15 May 20, 2014

Computation of the Constrained Infinite Time Linear Quadratic Optimal Control Problem

The Facet-to-Facet Property of Solutions to Convex Parametric Quadratic Programs and a new Exploration Strategy

Piecewise Quadratic Optimal Control

Efficient On-Line Computation of Constrained Optimal Control

Explicit MPC in Mechatronics Industry:

A Globally Convergent Primal-Dual Active-Set Framework for Large-Scale Convex Quadratic Optimization

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Robotics: Science and Systems

Lecture 7: Support Vector Machine

Outline. Robust MPC and multiparametric convex programming. A. Bemporad C. Filippi. Motivation: Robust MPC. Multiparametric convex programming

Chapter II. Linear Programming

Efficient Mode Enumeration of Compositional Hybrid Models

Solving Optimal Control Problems with ACADO Toolkit

Research Article Towards Online Model Predictive Control on a Programmable Logic Controller: Practical Considerations

Infinite Time Optimal Control of Hybrid Systems with a Linear Performance Index

Ellipsoid Algorithm :Algorithms in the Real World. Ellipsoid Algorithm. Reduction from general case

On the facet-to-facet property of solutions to convex parametric quadratic programs

Embedded Optimization for Mixed Logic Dynamical Systems

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited.

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

LECTURE 13: SOLUTION METHODS FOR CONSTRAINED OPTIMIZATION. 1. Primal approach 2. Penalty and barrier methods 3. Dual approach 4. Primal-dual approach

Department of Mathematics Oleg Burdakov of 30 October Consider the following linear programming problem (LP):

CasADi tutorial Introduction

What's New In Gurobi 5.0. Dr. Edward Rothberg

Efficient implementation of Constrained Min-Max Model Predictive Control with Bounded Uncertainties

CS675: Convex and Combinatorial Optimization Spring 2018 Consequences of the Ellipsoid Algorithm. Instructor: Shaddin Dughmi

Pattern Recognition Technique Based Active Set QP Strategy Applied to MPC for a Driving Cycle Test

Lesson 17. Geometry and Algebra of Corner Points

A Survey on Explicit Model Predictive Control

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017

Linear programming and duality theory

Linear Programming Problems

Mathematical Programming and Research Methods (Part II)

Second Order SMO Improves SVM Online and Active Learning

Optimization Methods. Final Examination. 1. There are 5 problems each w i t h 20 p o i n ts for a maximum of 100 points.

Convex Optimization. Lijun Zhang Modification of

Kernel Methods & Support Vector Machines

Selected Topics in Column Generation

Artificial Intelligence

California Institute of Technology Crash-Course on Convex Optimization Fall Ec 133 Guilherme Freitas

MATHEMATICS II: COLLECTION OF EXERCISES AND PROBLEMS

A Dual Variant of. Benson s Outer Approximation Algorithm. for Multiple Objective Linear Programs

Stochastic Separable Mixed-Integer Nonlinear Programming via Nonconvex Generalized Benders Decomposition

An Optimized Linear Model Predictive Control Solver for Online Walking Motion Generation

The Ascendance of the Dual Simplex Method: A Geometric View

Introduction to Machine Learning

COMS 4771 Support Vector Machines. Nakul Verma

Reverse Search for Parametric Linear Programming

15. Cutting plane and ellipsoid methods

Math 5593 Linear Programming Lecture Notes

Introduction. Linear because it requires linear functions. Programming as synonymous of planning.

A Short SVM (Support Vector Machine) Tutorial

CONLIN & MMA solvers. Pierre DUYSINX LTAS Automotive Engineering Academic year

KNITRO NLP Solver. Todd Plantenga, Ziena Optimization, Inc. US-Mexico Workshop on Optimization January 2007, Huatulco, Mexico

Linear Programming. Linear Programming. Linear Programming. Example: Profit Maximization (1/4) Iris Hui-Ru Jiang Fall Linear programming

Convex Programs. COMPSCI 371D Machine Learning. COMPSCI 371D Machine Learning Convex Programs 1 / 21

Convex Optimization. Erick Delage, and Ashutosh Saxena. October 20, (a) (b) (c)

Hybrid Model Predictive Control Application Towards Optimal Semi-Active Suspension

Support Vector Machines.

Constrained optimization

qpoases User s Manual

Fast, Large-scale Model Predictive Control by Partial Enumeration

Primal Dual Schema Approach to the Labeling Problem with Applications to TSP

Lecture 15: Log Barrier Method

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Gate Sizing by Lagrangian Relaxation Revisited

Support Vector Machines. James McInerney Adapted from slides by Nakul Verma

Linear Programming. Course review MS-E2140. v. 1.1

Shiqian Ma, MAT-258A: Numerical Optimization 1. Chapter 2. Convex Optimization

Linear Optimization and Extensions: Theory and Algorithms

Optimization of Design. Lecturer:Dung-An Wang Lecture 8

Globally Convergent Primal-Dual Active-Set Methods with Inexact Subproblem Solves

Perceptron Learning Algorithm

Inverse KKT Motion Optimization: A Newton Method to Efficiently Extract Task Spaces and Cost Parameters from Demonstrations

Simplex Algorithm in 1 Slide

Towards a practical simplex method for second order cone programming

Integer Programming ISE 418. Lecture 7. Dr. Ted Ralphs

RELATIVELY OPTIMAL CONTROL: THE STATIC SOLUTION

Transcription:

qpoases - Online Active Set Strategy for Fast Linear MPC Moritz Diehl, Hans Joachim Ferreau, Lieboud Vanden Broeck, Jan Swevers Dept. ESAT and Center of Excellence for Optimization in Engineering OPTEC K.U. Leuven, Belgium joint work with Hans Georg Bock, Interdisciplinary Center for Scientific Computing, Univ. Heidelberg, Germany

Linear MPC (or QP subproblems in NMPC) For linear dynamic system linear constraints quadratic cost only quadratic program (QP) needs to be solved:

Linear MPC = parametric QP Eliminate states via condensing, obtain smaller scale quadratic program (QP) in variables (assumption: H positive definite) QP depends on via affine functions and

Karush-Kuhn-Tucker (KKT) Conditions

Parametric QP Solution Structure Define set of feasible parameters : Well known: THEOREM: Set is convex, and can be partitioned into polyhedral critical regions each corresponding to a different working set. QP solution on each region is affine in

Sketch of Proof for Polyhedral Critical Regions Check KKT conditions for fixed working set : 1. g, b affine: then, affine, because solution of linear system: 2., affine, therefore are linear constraints on that define polyhedral critical region in

Explicit MPC: Precalculate Everything Idea: Compute control on all critical regions in advance (Bemporad, Borrelli, Morari, 2002). Pro: MPC in microsecs. possible Contra: problem size limited Example: 50 variables, lower and upper bounds: 3 50 =10 23 possible critical regions. Prohibitive.

Online Active Set Strategy (qpoases) Combine Explicit and Online MPC compute affine solution only on current critical region go on straight line from old to new problem data ( convex! ) solve each QP on path exactly (keep primal-dual feasibility)! need to change working set only at boundaries of critical regions

How to compute each step? determine change in b and g,, solve KKT system choose steplength maximal such that still holds for all inactive (primal) constraints, and for all active dual variables: Set with and

How to change working set? add or remove constraints to/from working set when crossing borders of critical regions use null space approach, keep QRfactorization of active constraint matrix, and Cholesky factorization of projected hessian: each working set change costs only O(n 2 ) flops, exactly as one QP iteration in efficient QP solvers!

Extra difficulty: linear independence often violated during homotopy, often redundant constraints become active and cause degeneracy example of three active constraints in 2-D:

How to deal with degeneracy? Without linear independence, KKT system becomes unsolvable! Addition of degenerate constraints must be avoided. Remedy [Best 1996]: before adding extra row solve auxiliary system to if s=0, linear dependence is detected, and helps to find a constraint from that can be removed

Summary of qpoases Algorithm

Real-Time Variant of qpoases Algorithm Limit number of active set changes per sampling time: lag behind, if too many changes necessary deliver solution of some problem between old and new make good for lag in later problems

Infeasibility treatment P convex: QP on path infeasible <=> new QP infeasible Stop at last feasible QP, wait for better posed problems

Infeasibility treatment P convex: QP on path infeasible <=> new QP infeasible Stop at last feasible QP, wait for better posed problems Fortunately: new QP feasible <=> full path is feasible, and strategy works again

qpoases: Open Code by Hans Joachim Ferreau qpoases: open source C++ code by Hans Joachim Ferreau http://www.kuleuven.be/optec/software/qpoases

Application to Chain of Masses 10 balls connected by springs, No. 1 fixed 3-D velocity of ball No. 10 controlled: 2nd order ODE for other balls: Force according to Hooke s law strongly nonlinear: Together: 57 nonlinear ODEs, chaotic system

After disturbance, chain crashes into wall

MPC controller shall avoid crashing into wall first half of MPC horizon linearize system at steady state choose 200 ms sampling time predict 80 samples: 3 x 80 = 240 degrees of freedom bounds (up/lo): 2 x 240 = 480 state constraints that avoid hitting the wall: 9 x 80 = 720 Note: large QP with ~1 MB data

MPC respects bounds and state constraint

Compare four QP strategies Standard solver (QPSOL), cold start QPSOL, warm start Online Active Set Strategy (qpoases), full convergence qpoases, real-time variant with at most 10 QP Iterations Note: Explicit MPC cannot be applied due to problem size

Number of QP Iterations (Working Set Changes)

Number of QP Iterations (Working Set Changes)

Number of QP Iterations (Working Set Changes)

Number of QP Iterations (Working Set Changes)

Performance of Online Active Set Strategy Number of QP working set changes 3-5 times lower than for QPSOL with warm starts Can limit maximum number without much suboptimality Additionally: QPSOL often even needs Phase1 LP Iterations qpoases needs no new matrix factorizations CPU times compare even more favourably...

CPU Time Comparison: qpoases Factor 10 Faster

OPTEC Fast MPC Group (Electrical and Mechanical Engineering)

Time Optimal MPC: a 100 Hz Application Quarter car: oscillating spring damper system MPC Aim: settle at any new setpoint in in minimal time Two level algorithm: MIQP 6 online data 40 variables + one integer 242 constraints (in-&output) use qpoases on dspace CPU time: <10 ms Lieboud Van den Broeck in front of quarter car experiment

Setpoint change without control: oscillations

With LQR control: inequalities violated

With Time Optimal MPC

Time Optimal MPC: qpoases Optimizer Contents

Time Optimal MPC: a 60 Hz Application Overhead crane MPC Aim: settle at any new setpoint in in minimal time Two level algorithm: MIQP 6 online data 40 variables + one integer 242 constraints (in-&output) use qpoases on dspace CPU time: <10 ms Lieboud Van den Broeck

qpoases: open code, but direct industrial funding Hoerbiger: MPC of Large Bore Gas Engines for US Pipeline Compressors IPCOS: Efficient QP for Process Control

qpoases running on Industrial Control Hardware (20 ms)

Conclusions Linear and Nonlinear MPC need reliable QP solution Explicit MPC prohibitive for nontrivial problem dimensions Online Active Set Strategy (qpoases) is one order of magnitude faster than conventional QP with warmstarts Linear MPC in khz range realizable even for larger QPs Time Optimal MPC interesting alternative to tracking