Hamiltonian Decomposition for Online Implementation of Model Predictive Control

Total Page:16

File Type:pdf, Size:1020Kb

Hamiltonian Decomposition for Online Implementation of Model Predictive Control Hamiltonian Decomposition for Online Implementation of Model Predictive Control A thesis submitted to the University of Manchester for the degree of Doctor of Philosophy in the Faculty of Science and Engineering 2018 Eduardo N. Poupard Supervised by Prof. William P. Heath School of Electrical and Electronic Engineering Contents 1 Introduction 17 1.1 Background and motivation . 17 1.2 Statement of originality and thesis outline . 18 1.2.1 Part I . 19 1.2.2 Part II . 19 1.2.3 Part III . 21 1.2.4 Additional work . 22 1.2.5 Mathematical tools . 22 I Unconstrained Optimal Control Problem 23 2 Free-final State Optimal Control Problem 24 2.1 Continuous-time analysis . 24 2.1.1 Problem formulation . 24 2.1.2 Two-point boundary-value problem . 25 2.2 Discrete-time analysis . 26 2.2.1 Problem formulation . 27 2.2.2 Two-point boundary-value problem . 28 3 Linear Quadratic Regulator 29 3.1 Finite-horizon formulation . 29 3.1.1 Linear system of equations . 31 3.2 Solution via Riccati equation . 32 3.2.1 Derivation via linear system of equations . 33 3.3 Solution via eigenvalue decomposition . 34 3.3.1 Receding horizon control implementation . 37 3.3.2 The case of A being singular . 38 4 LQ Tracking Problem 41 4.1 Finite-horizon formulation . 41 4.1.1 Linear system of equations . 42 4.2 Solution via Riccati equation . 43 4.2.1 Derivation via linear system of equations . 44 4.3 Solution via eigenvalue decomposition . 46 4.3.1 Receding horizon control implementation . 49 2 II Constrained Optimal Control Problem 52 5 Model Predictive Control Framework 53 5.1 Fundamentals . 54 5.1.1 Sparse formulation . 55 5.1.2 Necessary conditions . 57 5.2 Interior point method . 57 5.2.1 Primal-dual interior point algorithm . 58 5.2.2 Mehrotra's predictor-corrector algorithm . 59 6 Newton system factorization 62 6.1 General system decomposition . 62 6.1.1 Hamiltonian decomposition . 64 6.2 Riccati recursion method . 66 6.2.1 Algorithm . 68 6.2.2 Numerical example . 69 6.3 Eigenvalue factorization method . 70 6.3.1 Algorithm . 70 6.4 Splitting method implementation . 72 6.4.1 Algorithms . 74 6.4.2 Numerical experiment . 75 7 Fast Hamiltonian/GMRES solver 79 7.1 Incomplete LU factorization . 80 7.1.1 Tailor-made preconditioners . 80 7.2 Companion-like matrix . 83 7.2.1 Algorithm . 86 7.2.2 Recursion sequence structure on the companion-like matrix . 87 7.2.3 Nonsingular matrix ZN guarantee . 88 7.2.4 Flop count . 89 7.2.5 Direct method comparison . 90 7.3 GMRES method application . 91 7.3.1 Convergence . 92 7.3.2 Algorithm . 94 7.3.3 Flop count . 94 7.4 Numerical experiments . 96 7.4.1 Experiment 1: Feasibility . 96 7.4.2 Experiment 2: Convergence verification under rounding errors . 97 7.4.3 Experiment 3: Convergence subject to different horizons . 99 7.4.4 Experiment 4: Comparison . 100 7.4.5 Experiment 5: Numerical issue . 102 7.5 The case of A being singular . 105 7.5.1 Formulation . 105 7.5.2 Numerical example . 106 7.5.3 Eigenvalue trajectories . 108 3 7.5.4 Convergence experiment . 109 8 Conclusions of part I and II 112 8.1 Comments on novel methods (part I) . 112 8.2 Further work on novel methods (part II) . 113 8.2.1 On the splitting methods . 113 8.2.2 On the Hamiltonian recursion solver . 113 8.2.3 On the Hamiltonian/GMRES solver . 114 III Embedded Model Predictive Control 115 9 Festo AG & Co.KG Collaboration 116 9.1 The Company . 116 9.2 Why Model Predictive Control (MPC)? . 117 9.2.1 MPC offered by major control-systems vendors . 118 9.3 Programmable Logic Controller platform (PLC) . 120 9.3.1 Embedded MPC on PLCs . 120 9.3.2 Comparison between different PLC platforms . 121 9.3.3 Some commercial embedded APC software for PLCs . 122 10 Optimization Solver Engine 123 10.1 Tracking and Disturbances Framework on MPC . 123 10.1.1 Coordinate transformation and steady-state target problem . 124 10.1.2 Dynamic regulation problem . 125 10.1.3 Constant disturbances and zero offset . 125 10.2 Case Study: Flotation-Cell System . 127 10.2.1 Single-tank model . 128 10.3 Numerical experiment: Flotation-cell system . 130 10.3.1 Control design objective and settings . 131 10.3.2 Simulation . 133 10.4 Optimization Code Generation . 136 11 Hardware-in-the-loop Test (HIL) 138 11.1 PLCs Test Rig . 138 11.1.1 HIL test diagram . 139 11.2 Industrial experiment 1: Flotation-cell system . 140 11.2.1 Feasibility of the Hamiltonian recursion method . 140 11.2.2 Hamiltonian Recursion vs. Riccati Recursion . 143 11.3 Industrial experiment 2: Continuous stirred tank reactor (CSTR) . 146 11.3.1 Control design objective and settings . 147 11.3.2 Simulation . 149 11.3.3 Real-time controller test . 151 12 Conclusions of part III 153 12.1 Further work . 153 4 A Relevant code for parts II and III 155 A.1 HQ preconditioner function . 155 A.2 D~hqr companion-like matrix recursion function . 157 A.3 D~hqr companion-like vector recursion function . 159 A.4 HR preconditioner function . 160 A.5 Application of GMRES method for companion-like matrix D~hqr ....... 161 A.6 S-Function for Flotation-cell system . 163 A.7 S-Function for Continuous stirred tank reactor (CSTR) . 165 B Double-tank model 167 54; 359 words 5 List of Figures 1.1 Layout of the novel contribution presented in part II, and its place within the Model Predictive Control (MPC) framework. 21 3.1 Computation of gain matrix P1 for the receding horizon control on the LQR. Comparison between the Riccati equation (red) and the eigendecomposition approach from Algorithm 3.2 (blue). 38 4.1 Computation of gain matrix P1 and gain vector π1 for the receding hori- zon control on the LQ tracking problem. Comparison between the Riccati equation (red) and the eigendecomposition approach from Algorithm 4.2 (blue). 51 6.1 Simulation with MPC controller using the Riccati recursion method. 69 6.2 Comparison of the computational time during the simulation of the online part of the MPC controller using the Riccati recursion and eigenvalue method. 76 6.3 Convergence of a naive implementation of the splitting method on system (6.23). The number of iterations on the splitting method was set at i = 30. Each line represents a vector whose length is the number of k−iterations of the Mehrotra's algorithm (Algorithm 5.1). The elements of the vector correspond to the residual norm after i−iterations. 78 7.1 Relative error corresponding to the optimal solution vector, p = [x; u; λ, µ, t], during a closed-loop MPC simulation on a second order plant. The x axis corresponds to the sample time t. The y axis represents the interior-point iterations, k. The relative error (z axis) is computed by ρ = kpcom − prick1=kprick1 at each (t; k)........................... 90 7.2 Comparison of the computational time during the simulation of the MPC controller on system (7.1) between the Hamiltonian recursion (blue) and the Riccati recursion (red) methods. 91 7.3 MPC simulation for the oscillating-masses example with nx = 40 states using the Hamiltonian/GMRES solver within an interior-point algorithm. First plot shows the evolution of the states xk subject to constraints, with initial conditions xk = 3:5 for the displacements, and xk = 0 for the veloci- ties. Second plot shows the profile of the control inputs subject to constraints. 97 6 7.4 Convergence of the Hamiltonian/GMRES solver for the oscillating-masses example with nx = 40 states..
Recommended publications
  • Model Predictive Control Toolbox for Use with MATLAB®
    Model Predictive Control Toolbox For Use with MATLAB® Alberto Bemporad Manfred Morari N. Lawrence Ricker User’s Guide Version 2 How to Contact The MathWorks: www.mathworks.com Web comp.soft-sys.matlab Newsgroup [email protected] Technical support [email protected] Product enhancement suggestions [email protected] Bug reports [email protected] Documentation error reports [email protected] Order status, license renewals, passcodes [email protected] Sales, pricing, and general information 508-647-7000 Phone 508-647-7001 Fax The MathWorks, Inc. Mail 3 Apple Hill Drive Natick, MA 01760-2098 For contact information about worldwide offices, see the MathWorks Web site. Model Predictive Control Toolbox User’s Guide © COPYRIGHT 1995-2005 by The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro- duced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions.
    [Show full text]
  • Model Predictive Control on Open Water Systems
    Model Predictive Control on Open Water Systems Model Predictive Control on Open Water Systems Proefschrift ter verkrijging van de graad van doctor aan de Technische Universiteit Delft, op gezag van de Rector Magnificus prof. dr. ir. J.T. Fokkema, voorzitter van het College voor Promoties, in het openbaar te verdedigen op maandag 26 juni 2006 om 12:30 uur door Peter-Jules VAN OVERLOOP werktuigkundig ingenieur geboren te Bergen op Zoom Dit proefschrift is goedgekeurd door de promotoren: Prof. ir. R. Brouwer Prof. ir. O.H. Bosgra Samenstelling promotiecommisie: Rector Magnificus, voorzitter Prof. ir. R. Brouwer, Technische Universiteit Delft, promotor Prof. ir. O.H. Bosgra, Technische Universiteit Delft, promotor Dr. S. Dijkstra, Technische Universiteit Delft Prof. dr. ir. N.C. van de Giesen, Technische Universiteit Delft Dr. A.J. Clemmens, United States Department of Agriculture Prof. dr. ir. A.C.P.M. Backx, Technische Universiteit Eindhoven Prof. dr. ir. G.S. Stelling, Technische Universiteit Delft © 2006 P.J. van Overloop and IOS Press All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, without prior permission from the publisher. ISBN:1-58603-638-6 Keywords: operational water management, model predictive control, real time control, automation, centralized control, open water systems, irrigation, drainage, hydro-dynamic modeling. Published and distributed by IOS Press under the imprint Delft University Press Publisher & Distributor Distributor in the USA and Canada IOS Press IOS Press, Inc. Nieuwe Hemweg 6b 4502 Rachael Manor Drive 1013 BG Amsterdam Fairfax, VA 22032 Netherlands USA Fax: +31-20-687 0019 fax: +1-703-323 3668 Email: [email protected] e-mail: [email protected] LEGAL NOTICE The publisher is not responsible for the use which might be made of the following information PRINTED IN THE NETHERLANDS Model Predictive Control on Open Water Systems P.J van Overloop Summary Human life depends on water daily, especially for drinking and food production.
    [Show full text]
  • Model Predictive Control Toolbox for Use with MATLAB®
    Model Predictive Control Toolbox For Use with MATLAB® Alberto Bemporad Manfred Morari N. Lawrence Ricker Getting Started Version 2 How to Contact The MathWorks: www.mathworks.com Web comp.soft-sys.matlab Newsgroup [email protected] Technical support [email protected] Product enhancement suggestions [email protected] Bug reports [email protected] Documentation error reports [email protected] Order status, license renewals, passcodes [email protected] Sales, pricing, and general information 508-647-7000 Phone 508-647-7001 Fax The MathWorks, Inc. Mail 3 Apple Hill Drive Natick, MA 01760-2098 For contact information about worldwide offices, see the MathWorks Web site. Getting Started with the Model Predictive Control Toolbox © COPYRIGHT 2004-2005 by The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro- duced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions.
    [Show full text]
  • Linear MPC • Linear Time-Varying and Nonlinear MPC • Quadratic Programming (QP) and Explicit MPC • Hybrid MPC, Stochastic MPC, Data-Driven MPC
    Model Predictive Control Alberto Bemporad imt.lu/ab Course page: http://cse.lab.imtlucca.it/~bemporad/mpc_course.html Course structure • Basic concepts of model predictive control (MPC) and linear MPC • Linear time-varying and nonlinear MPC • Quadratic programming (QP) and explicit MPC • Hybrid MPC, stochastic MPC, data-driven MPC • Numerical examples: – MPC Toolbox for MATLAB (linear/explicit/parameter-varying MPC) – Hybrid Toolbox for MATLAB (explicit MPC, hybrid systems) For additional background on linear systems and numerical optimization: http://cse.lab.imtlucca.it/~bemporad/intro_control_course.html http://cse.lab.imtlucca.it/~bemporad/optimization_course.html "Model Predictive Control" - © A. Bemporad. All rights reserved. 2/132 Model Predictive Control: Basic Concepts Model Predictive Control (MPC) optimization prediction model algorithm model-based optimizer process set-points inputs outputs r(t) u(t) y(t) measurements simplified likely Use a dynamical model of the process to predict its future evolution and choose-------------------- the “best” control action a good "Model Predictive Control" - © A. Bemporad. All rights reserved. 3/132 Model Predictive Control (MPC) • Goal: find the best control sequence over a future horizon of N steps past future r(t) N−1 y X k predicted outputs k y − k2 k u − k2 min W (yk r(t)) 2 + W (uk ur(t)) 2 uk k=0 manipulated inputs s:t: xk+1 = f(xk; uk) prediction model yk = g(xk) t t+k t+N umin ≤ uk ≤ umax constraints ymin ≤ yk ≤ ymax x0 = x(t) state feedback numerical optimization problem t+1 t+1+k t+N+1 • At each time t: – get new measurements to update the estimate of the current state x(t) – solve the optimization problem with respect to fu0; : : : ; uN−1g ∗ – apply only the first optimal move u(t) = u0, discard the remaining samples "Model Predictive Control" - © A.
    [Show full text]