MPC-Based Reference Governors: Theory and Case Studies [1st ed.] 978-3-030-17404-0;978-3-030-17405-7

This monograph focuses on the design of optimal reference governors using model predictive control (MPC) strategies. The

306 16 3MB

English Pages XXIII, 137 [149] Year 2019

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

MPC-Based Reference Governors: Theory and Case Studies [1st ed.]
 978-3-030-17404-0;978-3-030-17405-7

Table of contents :
Front Matter ....Pages i-xxiii
Reference Governors (Martin Klaučo, Michal Kvasnica)....Pages 1-5
Front Matter ....Pages 7-7
Mathematical Preliminaries and General Optimization (Martin Klaučo, Michal Kvasnica)....Pages 9-14
Model Predictive Control (Martin Klaučo, Michal Kvasnica)....Pages 15-34
Inner Loops with PID Controllers (Martin Klaučo, Michal Kvasnica)....Pages 35-43
Inner Loops with Relay-Based Controllers (Martin Klaučo, Michal Kvasnica)....Pages 45-52
Inner Loops with Model Predictive Control Controllers (Martin Klaučo, Michal Kvasnica)....Pages 53-68
Front Matter ....Pages 69-69
Boiler–Turbine System (Martin Klaučo, Michal Kvasnica)....Pages 71-89
Magnetic Levitation Process (Martin Klaučo, Michal Kvasnica)....Pages 91-101
Thermostatically Controlled Indoor Temperature (Martin Klaučo, Michal Kvasnica)....Pages 103-112
Cascade MPC of Chemical Reactors (Martin Klaučo, Michal Kvasnica)....Pages 113-132
Conclusions and Future Research (Martin Klaučo, Michal Kvasnica)....Pages 133-135
Back Matter ....Pages 137-137

Citation preview

Advances in Industrial Control

Martin Klaučo Michal Kvasnica

MPC-Based Reference Governors Theory and Case Studies

Advances in Industrial Control Series Editors Michael J. Grimble, Industrial Control Centre, University of Strathclyde, Glasgow, UK Antonella Ferrara, Department of Electrical, Computer and Biomedical Engineering, University of Pavia, Pavia, Italy Editorial Board Graham Goodwin, School of Electrical Engineering and Computing, University of Newcastle, Callaghan, NSW, Australia Thomas J. Harris, Department of Chemical Engineering, Queen’s University, Kingston, ON, Canada Tong Heng Lee, Department of Electrical and Computer Engineering, National University of Singapore, Singapore, Singapore Om P. Malik, Schulich School of Engineering, University of Calgary, Calgary, AB, Canada Kim-Fung Man, City University Hong Kong, Kowloon, Hong Kong Gustaf Olsson, Department of Industrial Electrical Engineering and Automation, Lund Institute of Technology, Lund, Sweden Asok Ray, Department of Mechanical Engineering, Pennsylvania State University, University Park, PA, USA Sebastian Engell, Lehrstuhl für Systemdynamik und Prozessführung, Technische Universität Dortmund, Dortmund, Germany Ikuo Yamamoto, Graduate School of Engineering, University of Nagasaki, Nagasaki, Japan

Advances in Industrial Control is a series of monographs and contributed titles focusing on the applications of advanced and novel control methods within applied settings. This series has worldwide distribution to engineers, researchers and libraries. The series promotes the exchange of information between academia and industry, to which end the books all demonstrate some theoretical aspect of an advanced or new control method and show how it can be applied either in a pilot plant or in some real industrial situation. The books are distinguished by the combination of the type of theory used and the type of application exemplified. Note that “industrial” here has a very broad interpretation; it applies not merely to the processes employed in industrial plants but to systems such as avionics and automotive brakes and drivetrain. This series complements the theoretical and more mathematical approach of Communications and Control Engineering. Indexed by SCOPUS and Engineering Index. Proposals for this series, composed of a proposal form downloaded from this page, a draft Contents, at least two sample chapters and an author cv (with a synopsis of the whole project, if possible) can be submitted to either of the: Series Editors Professor Michael J. Grimble Department of Electronic and Electrical Engineering, Royal College Building, 204 George Street, Glasgow G1 1XW, United Kingdom e-mail: [email protected] Professor Antonella Ferrara Department of Electrical, Computer and Biomedical Engineering, University of Pavia, Via Ferrata 1, 27100 Pavia, Italy e-mail: [email protected] or the In-house Editor Mr. Oliver Jackson Springer London, 4 Crinan Street, London, N1 9XW, United Kingdom e-mail: [email protected] Proposals are peer-reviewed. Publishing Ethics Researchers should conduct their research from research proposal to publication in line with best practices and codes of conduct of relevant professional bodies and/or national and international regulatory bodies. For more details on individual ethics matters please see: https://www.springer.com/gp/authors-editors/journal-author/journal-author-helpdesk/ publishing-ethics/14214.

More information about this series at http://www.springer.com/series/1412

Martin Klaučo Michal Kvasnica •

MPC-Based Reference Governors Theory and Case Studies

123

Martin Klaučo Institute of Information Engineering, Automation, and Mathematics Slovak University of Technology in Bratislava Bratislava, Slovakia

Michal Kvasnica Institute of Information Engineering, Automation, and Mathematics Slovak University of Technology in Bratislava Bratislava, Slovakia

ISSN 1430-9491 ISSN 2193-1577 (electronic) Advances in Industrial Control ISBN 978-3-030-17404-0 ISBN 978-3-030-17405-7 (eBook) https://doi.org/10.1007/978-3-030-17405-7 Mathematics Subject Classification (2010): 49J15, 93C83, 93C05, 93B52 © Springer Nature Switzerland AG 2019 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

To my parents, Katarína and Branislav To my wife Katrin and my son Michal

Series Editor’s Foreword

The aim of the series Advances in Industrial Control is to fill the gap between theoretical research and practical applications in the area of control engineering, contributing to the transition into practice of the most advanced control results, and bearing in mind significant recent developments of control technology. It also promotes the dissemination of knowledge related to the modern control solutions in all sectors of industrial control, making it usable even to readers who are not experts in the specific application field. One of the distinctive features of the series Advances in Industrial Control is the large variety of control methodologies which are reviewed and discussed with reference to different kinds of industrial applications. Some of the control methodologies discussed are extremely new and are explored in terms of their advantages and limitations in industrial implementations for the first time. Others are more classical but revisited in a more up-to-date fashion, taking into account the recent technological developments that make their use in practical applications nonetheless new. The present monograph is indeed dedicated to a rather classical control topic, the so-called reference governor approach. It first appeared in the 90s in the continuous-time framework and in connection with linear dynamic systems. It was further developed and extended to more general classes of systems in the subsequent decades. A reference governor is typically used to modify the reference signal to a low-level control scheme in order to satisfy state and control constraints. Nevertheless, it can be used to generate a reference signal which satisfies some optimality requirements, or, in other cases, to improve an already-existing control system avoiding an expensive upgrade of the control infrastructure. Although the topic can be considered classical, it is treated in the book in an original and in-depth way. What differentiates the present monograph from the previous publications on the same subject is the industrial cutting. When using the reference governor approach in practice, especially in the field of complex industrial plants, it is not at all obvious how to design the governor itself. The modeling of the dynamics of the closed-loop system on which the reference governor is inserted becomes a crucial node. This is particularly true when the generation of the vii

viii

Series Editor’s Foreword

reference signal is made using optimization techniques. In fact, the approach must be implementable using the technology that is normally present in the industrial sector. It must therefore be reviewed considering computation and implementation issues. This and other aspects related to the use of the reference governor approach in industry are fully dealt with in this book. The particular attention that this book devotes to implementation and technological aspects of industrial control is confirmed by the care that has been put into developing four interesting case studies related to realistic systems: a multivariable boiler–turbine power plant, a magnetic levitation system, a residential building, and a cascade of chemical reactors. In all the cases, the authors clarify how the process performance can be significantly increased using the reference governor approach, while providing safety guarantees by design. This monograph enriches the series Advances in Industrial Control with a volume which is likely to be very useful, first of all, to students and researchers, since they will find in it a thorough tutorial overview of a classical control technique that is very effective in practice. It will also be interesting for practitioners, who will have precise indications and examples on how to transfer this approach into real industrial control situations. Like most of the books in the series Advances in Industrial Control, apart from its usefulness, it is also pleasant to read, with a fair balance between the theoretical part and the application-oriented part. Pavia, Italy

Antonella Ferrara University of Pavia

Preface

Control design for complex cyberphysical systems is a challenging task, especially when the safety and economic performance of the control system are considered. Two approaches are typically followed. The first option is to split the controlled process into subsystems, each operated by its own feedback loop, giving rise to a hierarchical composition of multiple controllers. The main issue, however, is how to configure and coordinate individual controllers such that they achieve a shared goal, such as the satisfaction of process constraints (e.g., pressures, temperatures, concentrations, voltages, currents, etc.) and optimization of the economic performance (e.g., minimization of the consumption of raw materials and heat/mass flows or maximization of the purity and the yields of products). This hierarchical direction therefore requires significant resources to be invested towards finding a suitable tuning of individual controllers and to perform extensive tests to confirm the satisfaction of the design goals. On the plus side, the control system being split into components allows individual subsystems to operate autonomously, thus providing easy maintenance and upgrade. The second option is to employ a model-based control design procedure where the process is operated by a single, centralized, control system that takes all interactions into account. On the one hand, such an approach yields a safe and economically optimal operation by design as it is based on determining the control actions by solving an optimization problem that explicitly accounts for process constraints and economic performance. On the other hand, however, the centralized nature poses significant challenges in terms of practical implementation. Specifically, the centralized control system represents a single point of failure and any disruption of the main controller can render the whole production processes inoperable. Moreover, the centralized controller requires significant implementation resources in terms of computational power and storage as to be able to calculate control moves for the whole system at once. This monograph covers a third direction, referred to as the reference governor approach. It can be viewed as an extension of the hierarchical design procedure where the control system is composed of numerous low-level feedback loops coordinated by a central model-based node. Its task is to determine, in a safe and ix

x

Preface

economically effective fashion, the setpoints for the low-level controllers. Such an arrangement provides several crucial advantages. First, safety and maximization of the economic performance are achieved by design as the selection of the setpoints is performed by solving an optimization problem that directly takes these objectives into account. Second, keeping the low-level controllers in place abolishes the single point of failure, allowing the production to continue even if there is disruption (e.g., during upgrades and maintenance) in the central node. Third, the reference governor approach is an ideal solution for retrofit applications where the aim is to improve the quality and the quantity of the production without having to invest significant resources into a costly upgrade of the control infrastructure. Last but not least, the reference governor framework allows for a separation of timescales where the central decision-maker needs can run on a longer sampling time (thus reducing the required computational resources), delegating the handling of fast dynamics to the simple low-level controllers. Several questions arise when employing the reference governor framework in practice. The first one is how to capture the inherent dynamics of the low-level controllers in a way that allows for subsequent optimization of setpoints. Conventionally, reference governor setups have only been employed when the underlying low-level controllers are linear, as is the case of PID or LQR controllers. The reason being that the subsequent calculation of optimal setpoints boils down to solving a relatively simple optimization problem (denoted as a convex problem), allowing for its real-time implementation on the existing control hardware. However, it is far from clear how to apply reference governors if the low-level regulators are not linear. This monograph provides one of the possible answers. Specifically, it shows how to formulate the search for optimal setpoints for two important classes of low-level controllers: rule-based regulators and optimization-based controllers. In the rule-based scenario, the low-level controllers are represented by finite state machines that entail heuristic switching laws, such as those conveniently used in thermostats. The second category is represented by low-level controllers that use model predictive control to determine the optimal control inputs. For either case, the monograph shows that the search for optimal setpoints boils down to solving mixed-integer optimization problems. The second question is how to formulate the central decision-making optimization problem in a way that allows it to be solved swiftly on hardware that is typically used in process automation. Two avenues are persuaded. The first one is based on pre-calculating the optimal solution of the reference governor problem off-line using parametric programming. Once available, the solution can then be encoded as a lookup table, allowing for a very fast and simple implementation in the real-time environment even on hardware with modest computational resources. To mitigate the storage requirements of parametric solutions, the lookup table can be further postprocessed to reduce its size at the expense of a slight deterioration of performance, but without sacrificing safety. The second avenue concentrates on selecting the setpoints for low-level controllers by solving an optimization problem online at each sampling instance. Here, the monograph shows various ways of

Preface

xi

achieving a formulation that is easy and fast to solve even if the underlying optimization problem features integer variables. The final question is how to demonstrate versatility and applicability of the reference governor approach. To this respect, the monograph discusses four realistic case studies. The first one, reported in Chap. 7, considers the optimization of setpoints for multiple PID controllers that control a multivariable boiler–turbine powerplant. In Chap. 8, the control of a magnetic levitation system with a single PID low-level controller is introduced. The controlled system features a fast dynamics with response times in the order of milliseconds and therefore necessitates a fast implementation of the reference governor. This is achieved by resorting to parametric solutions encoded as lookup tables. Implementation of a reference governor for a system with rule-based low-level controllers is reported in Chap. 9. The case study considers the management of thermal comfort in residential buildings where the reference governor optimizes temperature setpoints for a relay-based thermostat. Finally, the design of a reference governor for multiple optimization-based low-level controllers for a cascade of chemical reactors is discussed in Chap. 10. All case studies illustrate that with sufficient care, the process performance can be significantly increased while providing safety guarantees by design. The objectives of the monograph can be summarized as follows: • introduction to mathematical optimization problems required to determine optimal setpoints (Chap. 2), • formulation of model-based optimal decision-making problems via the model predictive control framework (Chap. 3), • description of modeling techniques for various types of low-level controllers (Chaps. 4–6), • demonstration of the versatility and applicability of the reference governor framework by means of realistic case studies (Chaps. 7–10). The reported results summarize and extend the research outcomes of the authors since 2013 that have been published in numerous peer-reviewed journals and presented at various IFAC and IEEE conferences. The monograph is structured as a step-by-step guide that allows theoreticians and practitioners alike to understand the underlying mathematical concept, to formulate reference governor solutions, and to implement them in practice. Bratislava, Slovakia

Martin Klaučo Michal Kvasnica

Acknowledgements

We want to acknowledge the financial aid of several agencies, which have supported the research covered in this book. Specifically, the authors gratefully acknowledge the contribution of the Slovak Research and Development Agency under the projects APVV-15-0007 (Optimal Control for Process Industries) and APVV-19-0204 (Safe and Secure Process Control), and the contribution of the Scientific Grant Agency of the Slovak Republic under the grant 1/0585/19 (On-Line Tunable Explicit Model Predictive Control for Systems with a Fast Dynamics). Moreover, the research was partly supported by the project ITMS 26240220084 (University Scientific Park STU in Bratislava) that was funded via the Research 7 Development Operational Programme funded by the ERDF, by the Alexander von Humboldt Foundation grant AvH-1065182-SVK (Embedded Optimal Control), and M. Klaučo would like to thank for the financial contribution from the STU in Bratislava Grant Scheme for Excellent Research Teams (Economically Effective Control of Energy Intensive Chemical Processes). We want to acknowledge also the support of our colleagues, especially Martin Kalúz, who helped with the hardware implementation and experiments covered in Chap. 8, Ján Drgoňa for insights about the thermal comfort control needed in Chap. 9, and Juraj Holaza for helping with the results discussed in Chap. 10. Our thanks also go to Miroslav Fikar, the head of the Institute of Information Engineering, Automation, and Mathematics at the Slovak University of Technology, who created a challenging and yet comfortable working environment. Bratislava, Slovakia February 2019

Martin Klaučo Michal Kvasnica

xiii

Contents

1

Reference Governors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Part I

1 4

Theory

2

Mathematical Preliminaries and General Optimization . 2.1 General Optimization Problems . . . . . . . . . . . . . . . 2.1.1 Linear Programming . . . . . . . . . . . . . . . . . 2.1.2 Quadratic Programming . . . . . . . . . . . . . . 2.1.3 Mixed-Integer Programming . . . . . . . . . . . 2.2 Solutions Techniques . . . . . . . . . . . . . . . . . . . . . . 2.2.1 Online Optimization . . . . . . . . . . . . . . . . . 2.2.2 Parametric Optimization . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

9 9 9 10 10 11 11 12 14

3

Model Predictive Control . . . . . . . . . . . . . . . . . . . . . . 3.1 Basic Model Predictive Control Formulation . . . . 3.2 MPC Formulations with Linear Prediction Models 3.2.1 Input–Output Prediction Model . . . . . . . . 3.2.2 State Space Prediction Model . . . . . . . . . 3.3 Offset-Free Control Scheme . . . . . . . . . . . . . . . . . 3.4 Reformulation to Standard Optimization Problems 3.4.1 Dense Approach . . . . . . . . . . . . . . . . . . . 3.4.2 Sparse Approach . . . . . . . . . . . . . . . . . . 3.5 Explicit MPC Concepts . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

15 15 17 18 20 21 24 25 30 32 33

4

Inner 4.1 4.2 4.3

Loops with PID Controllers . . . . . . . . . . . . . . . . Overview of the Control Scheme . . . . . . . . . . . . . . Reference Governor Synthesis for a SISO System . Reference Governor Synthesis for a MIMO System

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

35 35 35 37

xv

xvi

Contents

4.3.1 Symmetric Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.2 General MIMO Case . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38 41 43

5

Inner Loops with Relay-Based Controllers 5.1 Overview of the Control Scheme . . . . 5.2 Model of the Relay-Based Controllers 5.3 Reference Governor Synthesis . . . . . . 5.4 Mixed-Integer Problem Formulation . . References . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

45 45 45 47 48 52

6

Inner Loops with Model Predictive Control Controllers . 6.1 Overview of the Control Scheme . . . . . . . . . . . . . . . 6.2 Local MPC and MPC-Based Reference Governors . . 6.3 Reformulation via KKT Conditions . . . . . . . . . . . . . 6.4 Analytic Reformulation . . . . . . . . . . . . . . . . . . . . . . 6.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

53 53 54 58 61 63 68

71 71 73 75 76 77 79 80 88 88

Part II

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

Case Studies

7

Boiler–Turbine System . . . . . . . . . . . . . . . . . 7.1 Plant Description and Control Objectives 7.2 Plant Modeling and Constraints . . . . . . . 7.3 Modeling of the Closed-Loop System . . 7.4 Control Strategies . . . . . . . . . . . . . . . . . 7.5 MPC-Based Reference Governor . . . . . . 7.6 Direct-MPC Strategy . . . . . . . . . . . . . . . 7.7 Simulation Results . . . . . . . . . . . . . . . . 7.8 Concluding Remarks . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

8

Magnetic Levitation Process . . . . . . . . . . . . . . . . . . . . 8.1 Plant Description . . . . . . . . . . . . . . . . . . . . . . . . 8.2 Synthesis of the MPC-Based Reference Governor . 8.2.1 Transfer Function-Based Approach . . . . . 8.2.2 State Space-Based Approach . . . . . . . . . . 8.3 Experimental Results . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. 91 . 91 . 95 . 95 . 96 . 99 . 101

9

Thermostatically Controlled Indoor Temperature . 9.1 Challenges in Thermal Comfort Control . . . . . 9.2 Mathematical Background . . . . . . . . . . . . . . . 9.3 MPC-Based Reference Governor Synthesis . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . .

. . . . . . . . . .

. . . .

. . . .

103 103 104 105

Contents

xvii

9.4 Performance Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 9.5 Concluding Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 10 Cascade MPC of Chemical Reactors . . . . . . . . . . . . . . 10.1 Plant Description and Control Objectives . . . . . . . 10.1.1 Mathematical Model of the Plant . . . . . . . 10.2 Synthesis of Local MPCs . . . . . . . . . . . . . . . . . . 10.3 Synthesis of the MPC-Based Reference Governor . 10.4 Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.4.1 Centralized Control . . . . . . . . . . . . . . . . 10.4.2 Decentralized Control . . . . . . . . . . . . . . . 10.4.3 Reference Governor . . . . . . . . . . . . . . . . 10.4.4 Simulation Profiles and Comparison . . . . 10.4.5 Concluding Remarks . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

. . . . . . . . . . . .

113 113 114 120 122 124 124 126 127 128 130 132

11 Conclusions and Future Research . . . . . . . . . . . . . . . . . . . . . . . . . . 133 11.1 Discussion and Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 11.2 Future Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

List of Figures

Fig. 1.1 Fig. 1.2 Fig. 2.1 Fig. 3.1

Fig. 4.1 Fig. 4.2 Fig. 4.3 Fig. 5.1 Fig. 5.2 Fig. 6.1

Fig. 6.2

Fig. 6.3

Conceptual diagram of the optimization-based reference governor scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optimization-based reference governor scheme with a state estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Binary search tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control scheme with offset-free reference tracking properties. Here, the r(t) denotes the user-defined reference, the uH ðtÞ is optimal control action the optima solution to (3.22), the variables ym ðtÞ stand for the process measurements, and lastly the ^xe are estimates per (3.24). . . . . . . . . . . . . . . . . . . . . . . . . Closed-loop system with MPC-based reference governor control strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Block diagram of symmetric closed-loop with PID controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Block diagram of an asymmetric closed-loop with PID controllers and pre-compensator . . . . . . . . . . . . . . . . . . . . . . . Reference governor scheme with a relay-based controller . . . . Relay-based controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Block diagram of the MPC-based reference governor setup with inner MPC controllers controlling individual subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Closed-loop simulation results for the scenario with no reference governor. The plots depict, respectively, the positions of individual vehicles pi , the separation gap di between them (required to be  5 for no collision), the controlled speed yi , and the respective manipulated inputs ui . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Closed-loop simulation results for the scenario with reference governor inserted into the loop. The plots depict, respectively, the positions of individual vehicles pi , the separation gap di

..

3

.. ..

3 13

..

23

..

36

..

38

.. .. ..

42 46 46

..

54

..

65

xix

xx

Fig. Fig. Fig. Fig.

List of Figures

6.4 7.1 7.2 7.3

Fig. 7.4

Fig. 7.5

Fig. 7.6 Fig. Fig. Fig. Fig. Fig. Fig.

7.7 7.8 7.9 8.1 8.2 8.3

Fig. 8.4

Fig. Fig. Fig. Fig. Fig. Fig.

8.5 8.6 9.1 9.2 9.3 9.4

Fig. 9.5 Fig. 10.1 Fig. 10.2 Fig. 10.3 Fig. 10.4

between them (required to be greater than 5 for no collision), the controlled speed yi , and the respective manipulated inputs ui . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References wH i optimally shaped by the reference governor . . The boiler–turbine plant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reference governor setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interconnected PI controllers. Reprinted from [5], Copyright 2017, with permission from Elsevier . . . . . . . . . . . MPC-based reference governor implementation with the time-varying Kalman filter. Reprinted from [5], Copyright 2017, with permission from Elsevier . . . . . . . . . . . . . . . . . . . Measurements profiles. The green color depicts the reference signal. The pink color shows the performance of set of PI controllers, the red lines depict the performance using RG-MPC strategy, and the blue dashed lines are used for Direct-MPC setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shaped references. The green color depicts the reference signal. The blue color shows the shaped reference . . . . . . . . . Time profiles of control actions profiles . . . . . . . . . . . . . . . . . Time profile of the rates of control actions . . . . . . . . . . . . . . . Control strategies comparison . . . . . . . . . . . . . . . . . . . . . . . . . Magnetic levitation system . . . . . . . . . . . . . . . . . . . . . . . . . . . Laboratory model of magnetic levitation CE152 . . . . . . . . . . . Experimental results obtained by only using the PID controller. The desired reference is in black, measured ball displacement in blue, and min/max output constraints in red . . . . . . . . . . . . Experimental results under the reference governor. The top figure shows the desired reference (black), measured vertical displacement of the ball (blue), and output constraints (dashed red). The bottom plot shows the desired reference r in black, and the optimally shaped reference w in pink . . . . . . . . . . . . . Control by the PSD controller only . . . . . . . . . . . . . . . . . . . . Control under the reference governor . . . . . . . . . . . . . . . . . . . Reference governor scheme with a relay-based controller. . . . 7-day disturbance profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . Indoor temperature controlled only by the thermostat . . . . . . . Indoor temperature controlled by a thermostat with the setpoint optimally modulated by the reference governor . . . . . Energy savings overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . Controlled system composed of two CSTR with separator and recycle is similar to [6] . . . . . . . . . . . . . . . . . . . . . . . . . . Control scheme with centralized MPC . . . . . . . . . . . . . . . . . . Control scheme of decentralized MPC strategies . . . . . . . . . . Control scheme of the reference governor . . . . . . . . . . . . . . .

. . . .

66 67 72 73

..

76

..

78

..

81

. . . . . .

. . . . . .

82 84 85 86 92 94

..

96

. . . . . .

97 100 101 106 108 109

. . . .

. . . . . .

. . 110 . . 111 . . . .

. . . .

114 125 127 127

List of Figures

Fig. 10.5 Fig. 10.6 Fig. 10.7

xxi

Output profiles of H1 , H2 , and xb3 . Overall control performance is compactly given in Table10.3 . . . . . . . . . . . . . . . 129 Input profiles of Ff1 , Ff2 , and FR . . . . . . . . . . . . . . . . . . . . . . . . 130 Output profiles of H1 , H2 , and xb3 , controlled by the reference governor MPCr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

List of Tables

Table 7.1

Table Table Table Table

8.1 10.1 10.2 10.3

Quality criteria for various control strategies. Lower values of Ju and higher values of Jy are better. The values are normalized with respect to the PI strategy . . . . . . . . . . . . . . Parameters of the magnetic levitation plant . . . . . . . . . . . . . Process parameters and steady states . . . . . . . . . . . . . . . . . . Input constraints of the system . . . . . . . . . . . . . . . . . . . . . . . Control performance comparison . . . . . . . . . . . . . . . . . . . . .

. . . . .

. 87 . 92 . 117 . 118 . 131

xxiii

Chapter 1

Reference Governors

In hierarchical control setups, reference governors serve to coordinate multiple inner layer controllers by manipulating their setpoints as to improve the overall performance of the controlled process and guarantee its safe operation. Such an arrangement provides several crucial advantages. First, safety and maximization of the economic performance are achieved by design as the selection of the setpoints is performed by solving an optimization problem that directly takes these objectives into account. Second, keeping the inner layer controllers in place allows the production to continue even if the operation of the reference governor is interrupted for any reason. Last but not least, the reference governor approach is an ideal solution for retrofit applications where the aim is to improve the quality and the quantity of the production without having to invest significant resources into a costly upgrade of the control infrastructure. Historically, in process industries, the setpoints were calculated by solving modelbased optimization problems—commonly referred to as model predictive control (MPC)—giving raise to a multilayer control architecture. Such elaborated control schemes were first implemented in the early 80s in the petrochemical industry. One of the most cited works in the history of the model prediction control is the paper by [7], where the MPC predecessor, the dynamic matrix control (DMC), was introduced. This was one of the first scientific papers that introduced a truly optimal solution to the optimization problem stemming from the industrial needs. Here, the DMC controller was responsible for providing setpoints for primary-level controllers, like PIDs. The concept, in fact, was not new at all. A paper by [23] predates the DMC paper, but the solution to the optimization layer was done in a heuristic way. Such algorithms proved to be very effective in reducing the operating costs as well as increasing the safety of the entire plant operation [22]. Such a level of economic and safe operation is difficult to achieve using traditional control loops, which typically involve PI/PID controllers [2]. Therefore, optimization-based control strategies, such as those based on model predictive control (MPC) [20], are preferred in many areas, such as in petrochemical industries. © Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_1

1

2

1 Reference Governors

The framework of reference governors was first developed in the context of continuous-time [17] and later extended to discrete-time setups [13, 14]. Later, it has garnered significant attention mainly due to works of Bemporad, Mosca, Gilbert, and Komanovsky [3, 9, 10, 12, 16, 18] who established theoretical foundations of control-theoretical properties of reference governors, such as guarantees of closedloop stability and infinite-time constraint satisfaction, and handling of nonlinear systems. This lead to a massive adoption of the framework in a plethora of practical applications, ranging from automotive setups [1, 19], through aviation applications [6], in control of networked systems [8], and for control of fuel cells [15], to name just a few. The concept where a model-based predictive control strategy supplies setpoints for primary controller is referred to as optimization-based reference governors. Such an arrangement of control layers was studied widely by [4, 11, 21]. Results reported in these publications were oriented towards industrial applications. However, by optimizing the reference signals, the overall performance of the plant can be improved considerably [3, 10]. In this book, we follow more recent works, such as [5], and we formulate and solve the reference governor problem as an optimal control problem. This combined with utilization of off-the-shelve optimization solvers yield better performance and widen the applicability of the concept of reference governors. A conceptual diagram of the optimization-based reference governor setup is drawn in Fig. 1.1. Here, the optimization-based layer is denoted as secondary layer or the outer layer. Primary controllers, which are also referred to as inner controllers, serve to decide the control actions u that are then fed to the controlled plant. Moreover, the user-defined reference, denoted as r , enters the secondary layer and the setpoint for the primary controller is denoted as w. Its value is determined by solving an optimization problem in the upper layer. Unlike conventional MPC controllers, which optimize directly the control input u, the task of the reference governor is to optimize the reference signal w. The optimization is initialized from the current plant’s measurements y. In situations where not all plant’s variables can be directly measured, an estimator can be used as shown in Fig. 1.2. Objectives of the reference governor are to improve the tracking performance while guaranteeing, in a rigorous and certifiable fashion, plant’s safety by enforcing constraint satisfaction. These objectives are achieved by optimizing the setpoints for the primary layer of controllers. Note that in such a setup, the operator will no longer supply the setpoints directly to the primary controllers. Instead, the user-specified reference signal r is shaped by the governor as to devise an augmented reference signal w that enforces safety and optimizes performance. Such an arrangement has two key advantages. First, the setpoints for the primary layer are provided in optimal fashion and second, if the MPC-RG fails to provide the setpoint, the inner layer still maintains the stability of the operation. The reference governor is formulated as an MPC-based control strategy. The MPC-based reference governor problem can be formally stated as

1 Reference Governors

3 y

r

Optimization w

supervisory/outer layer primary/inner layer

Primary Controller

u

Plant

Fig. 1.1 Conceptual diagram of the optimization-based reference governor scheme

r



MPC-RG

Estimator

y

w

supervisory/outer layer primary/inner layer u

Primary Controllers

Plant

Fig. 1.2 Optimization-based reference governor scheme with a state estimator

min N (x N ) + W

N −1 

 (xk , yk , u k , wk )

(1.1a)

k=0

k ∈ N0N −1 ,

(1.1b)

yk = g(xk , u k ),

k ∈ N0N −1 ,

(1.1c)

u k = h(xk , wk ),

k∈

(1.1d)

u k ∈ U,

k∈

xk ∈ X ,

k∈

yk ∈ Y,

k∈

wk ∈ W,

k∈

N0N −1 , N0N −1 , N0N −1 , N0N −1 , N0N −1 ,

s.t. xk+1 = f (xk , u k ),

x0 = x(t)

(1.1e) (1.1f) (1.1g) (1.1h) (1.1i)

4

1 Reference Governors

where u ∈ Rn u , x ∈ Rn x , y ∈ Rn y are the manipulated, state, and process variables, respectively. r ∈ Rn y denotes the user-defined reference and w ∈ Rn y represents the setpoints optimized by the reference governor. Additionally, f (·) is the state-update equation governing the dynamical behavior of the controlled plant, g(·) denotes the output equation, and h(·) represents the dynamical model of the inner layer controller(s). Moreover, U, X , Y, and W are sets of appropriate dimensions that represent constraints on respective variables. Finally, N (·) and (·) are performance loss functions to be minimized. The solution to problem (1.1) yields the sequence     W = w0 , . . . , w N −1

(1.2)

over a finite prediction horizon of N discrete-time steps into the future. When implemented, the sequence enforces that input, state, and output constraints (1.1b)–(1.1g) are satisfied and the performance loss function (1.1a) is minimized. Remark 1.1 Without loss of generality, we assume that the state of the process x(t) can be directly measured at any time instant t and is available to problem (1.1) via the initial condition (1.1i). If some of the state variables cannot be directly measured, they can be estimated as illustrated in Fig. 1.2. The estimator can be designed, e.g., as a time-varying Kalman Filter as discussed in Sect. 3.3. The main challenge of formulating and solving the MPC-based reference governor problem (1.1) is how to address various types of the dynamical models of the primarylevel controllers h(·) in (1.1d). In subsequent chapters, we will show how MPC-based governors can be constructed if the primary layer consists of 1. PID controllers, discussed in Chap. 4, 2. relay-based controllers, reported in Chap. 5 3. local MPC controllers, elaborated in Chap. 6

References 1. Albertoni L, Balluchi A, Casavola A, Gambelli C, Mosca E, Sangiovanni-Vincentelli AL (2003) Hybrid command governors for idle speed control in gasoline direct injection engines. In: Proceedings of the 2003 American control conference, vol 1. IEEE, pp 773–778 2. Åström KJ, Hägglund T (2006) Advanced PID control. ISA - The instrumentation, systems, and automation society; research triangle park, NC 27709 3. Bemporad A (1998) Reference governor for constrained nonlinear systems. IEEE Trans Autom Control 43(3):415–419. https://doi.org/10.1109/9.661611 4. Bemporad A, Mosca E (1994) Constraint fulfilment in feedback control via predictive reference management. In: Proceedings of the third IEEE conference on control applications, pp 1909– 1914 5. Borrelli F, Falcone P, Pekar J, Stewart G (2009) Reference governor for constrained piecewise affine systems. J Process Control 19(8):1229–1237 6. Casavola A, Mosca E (2004) Bank-to-turn missile autopilot design via observer-based command governor approach. J Guid Control Dyn 27(4):705–710

References

5

7. Cutler CR, Ramaker BL (1979) Dynamic matrix control. In: AIChE 86th national meeting, Houston, Texas 8. Di Cairano S, Kolmanovsky IV (2010) Rate limited reference governor for network controlled systems. In: American control conference (ACC). IEEE, pp 3704–3709 9. Garone E, Cairano SD, Kolmanovsky I (2017) Reference and command governors for systems with constraints: a survey on theory and applications. Automatica 75:306–328. https:// doi.org/10.1016/j.automatica.2016.08.013, http://www.sciencedirect.com/science/article/pii/ S0005109816303715 10. Gilbert E, Kolmanovsky I (2002) Nonlinear tracking control in the presence of state and control constraints: a generalized reference governor. Automatica 38(12):2063–2073. https:// doi.org/10.1016/S0005-1098(02)00135-8, http://www.sciencedirect.com/science/article/pii/ S0005109802001358 11. Gilbert EG, Kolmanovsky I (1999) Fast reference governors for systems with state and control constraints and disturbance inputs. Int J Robust Nonlinear Control 12. Gilbert EG, Ong CJ (2011) Constrained linear systems with hard constraints and disturbances: an extended command governor with large domain of attraction. Automatica 47(2):334–340. https://doi.org/10.1016/j.automatica.2010.10.016, http://www.sciencedirect. com/science/article/pii/S0005109810004309 13. Gilbert EG, Kolmanovsky I, Tan KT (1994) Nonlinear control of discrete-time linear systems with state and control constraints: a reference governor with global convergence properties. In: Proceedings of the 33rd IEEE conference on decision and control, vol 1. IEEE, pp 144–149 14. Gilbert EG, Kolmanovsky I, Tan KT (1995) Discrete-time reference governors and the nonlinear control of systems with state and control constraints. Int J Robust Nonlinear Control 5(5):487– 504 15. Jade S, Hellström E, Jiang L, Stefanopoulou AG (2012) Fuel governor augmented control of recompression hcci combustion during large load transients. In: American control conference (ACC). IEEE, pp 2084–2089 16. Kalabic UV, Kolmanovsky IV, Gilbert EG (2014) Reduced order extended command governor. Automatica 50(5):1466–1472. https://doi.org/10.1016/j.automatica.2014.03.012, http://www. sciencedirect.com/science/article/pii/S0005109814001046 17. Kapasouris P, Athans M, Stein G, et al (1988) Design of feedback control systems for stable plants with saturating actuators 18. Kolmanovsky I, Kalabic U, Gilbert E (2012) Developments in constrained control using reference governors. IFAC Proc Vol 45(17):282–290. https://doi.org/10.3182/20120823-5NL-3013.00042, http://www.sciencedirect.com/science/article/pii/S1474667016314598. 4th IFAC conference on nonlinear model predictive control 19. Kolmanovsky I, Garone E, Di Cairano S (2014) Reference and command governors: a tutorial on their theory and automotive applications. In: American control conference (ACC). IEEE, pp 226–241 20. Maciejowski JM (2002) Predictive control with constraints. Pearson, Prentice-Hall 21. Mosca E (1996) Nonlinear predictive command governors for constrained tracking. In: Colloquium on Automatic Control, pp 55–76 22. Qin SJ, Badgwell TA (2003) A survey of industrial model predictive control technology. Control Eng Pract 11(7):733–764. https://doi.org/10.1016/S0967-0661(02)00186-7, http://www. sciencedirect.com/science/article/pii/S0967066102001867 23. Richalet J, Rault A, Testud J, Papon J (1978) Model predictive heuristic control. Automatica 14(5):413–428. https://doi.org/10.1016/0005-1098(78)90001-8, http://www.sciencedirect. com/science/article/pii/0005109878900018

Part I

Theory

Chapter 2

Mathematical Preliminaries and General Optimization

2.1 General Optimization Problems A general optimization problem is stated as min h obj (z)

(2.1a)

z

s.t. h ineq,i (z) ≤ 0, h eq, j (z) = 0,

m

∀i ∈ N1 ineq , ∀j ∈

m N1 eq ,

(2.1b) (2.1c)

where the vector z ∈ Rm denotes the optimization variable, h obj (z) is the objective function, and h ineq,i (z), h eq, j (z) are constraint functions. Scalars m ineq and m eq represent the number of inequality constraints and equality constraints, respectively. Based on the type of the objective function (2.1a) and functions h ineq,i (z), h eq, j (z), we distinguish between several classes of the optimization problems. First, we differentiate between convex and non-convex optimization problems. The main advantage of convex optimization problems over the non-convex problems is the guaranteed presence of unique global optima z  . Problems are convex, if and only if the objective function and all constraint functions are convex. Particular optimization problems are discussed in subsequent sections. For more details about any of mentioned class of optimization problems, we direct the reader to [4, 9].

2.1.1 Linear Programming When the objective function as well as the constraint functions are affine, we refer to such an optimization problem as a linear optimization problem (LP). Linear programming problems are usually written in the matrix form

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_2

9

10

2 Mathematical Preliminaries and General Optimization

min c z + d z

s.t. Aineq z ≤ bineq , Aeq z = beq ,

(2.2a) (2.2b) (2.2c)

where z ∈ Rm is the vector of optimization variables. Next, c ∈ Rm , d is a scalar, Aineq ∈ Rm ineq ×m , bineq ∈ Rm ineq , Aeq ∈ Rm eq ×m , and beq ∈ Rm ineq are constants of the LP. The LP is a convex optimization problem.

2.1.2 Quadratic Programming The quadratic optimization problem (QP) differs from the LP in the objective function. Specifically, we cast the quadratic optimization problems as follows: min z  H z + c z + d

(2.3a)

s.t. Aineq z ≤ bineq ,

(2.3b)

z

Aeq z = beq ,

(2.3c)

with the vector z ∈ Rm being the decision variable. The matrix H ∈ Rn×n determines the convexity of the optimization problem. If H  0, then the optimization problem in (2.3) is a convex problem, hence its solution converges to a unique optimum.

2.1.3 Mixed-Integer Programming Presented formulations in Sects. 2.1.1 and 2.1.2 assume that the optimization variable z is real. Here, we split the optimization variable z into a vector of real variables and a vector of binary variables, specifically,    z = z r z b ,

(2.4)

where z r ∈ Rm r , z b ∈ {0, 1}m b , and m r + m b = m. In this book, we will deal with mixed-integer (MI) optimization problems with linear constraints and with linear (MILP) or quadratic (MIQP) objective function. Formally, these MI problems can be stated as

2.1 General Optimization Problems

11

min h obj (z r , z b )

(2.5a)

z r ,z b

s.t. Aineq,r z r + Aineq,b z b ≤ bineq ,

(2.5b)

Aeq,r z r + Aeq,b z b = beq , z b ∈ {0, 1}m b

(2.5c) (2.5d)

with Aineq,r , Aineq,b , Aeq,r , and Aeq,b of real matrices of appropriate size. If the optimization problem (2.5) is cast as an MILP, then the objective function is 

h obj (z r , z b ) = cr z r + cb z b + d,

(2.6)

while for an MIQP, 



h obj (z r , z b ) = z r Hr z r + z b Hb z b + cr z r + cb z b + d.

(2.7)

By including the binary constraint (2.5d), the problem (2.5) becomes non-convex, which makes it more difficult to solve then LP/QP. Further reading material on the topic of the mixed-integer programming can be found in [5].

2.2 Solutions Techniques In this section, we briefly discuss the solutions to the aforementioned optimization problems. We will focus on the traditional optimization techniques, which are denoted as online optimization and we will elaborate on the parametric optimization as well. We will not cover the method in detail, since it is not the topic of this book.

2.2.1 Online Optimization By the term online optimization, we mean that the optimization problem is numerically solved, thus obtaining the optimal value of decision variables. The optimization problems are solved using one of the many algorithms which largely depend on formulating the KKT conditions. The best known algorithms for obtaining the optimal solution to QP and LP are the active-set method and the interior-point method. For the LP, we can employ the simplex method to find the optimum. Solving this class of optimization problems is fairly easy, and it can be done even for a large number of decision variables in reasonable time by employing state-of-the-art solvers, like GUROBI, CPLEX, and MOSEK. On the other hand, solving the MILP/MIQP is more time consuming. The brute-force way to solve MI problems is to enumerate all feasible combinations of the binary variable and then solve corresponding LP/QP via, e.g., active set. Then,

12

2 Mathematical Preliminaries and General Optimization

the optimal combination of binary variable will be chosen such that the value of the objective function is as small as possible. Since there are n b variables, the worst case scenario is to solve 2n b local LPs/QPs. However, more effective ways exist to solve the MILP and MIQP problems. Software tools like GUROBI,1 CPLEX,2 and MOSEK3 utilize methods like Branch&Bound and Branch&Cut algorithms, which allow for faster solution of the MI problem without the need of exploring all of the combinations of binary variable.

2.2.2 Parametric Optimization This section discusses the principle of parametric optimization focused on parametric programming (2.3). We will discuss the principle of the parametric optimization on the quadratic programming (2.3). Consider a quadratic programming problem1, specifically4 min z  H z + θ  F z + c z

(2.8a)

s.t. Aineq z ≤ bineq + Eθ,

(2.8b)

z

where z ∈ Rm is the vector of decision variables and θ ∈ Rn θ is a free parameter. In connection with the MPC, the θ parameter is usually an initial condition or a measurement of a process variable. Next, H , F, c, Aineq , bineq , and E are matrices and vectors of constants of appropriate sizes. Naturally, if the θ is given, the problem (2.8) translates back to the QP form in (2.3). In the parametric optimization, however, the parameter is not known a priori. Here, the solution to the problem is not a specific value z  , but an explicit function of all possible values of θ , which satisfy the constraint (2.8b). The optimal solution is denoted as z  (θ ). Once the z  (θ ) is constructed, the optimal value of the decision variable is obtained by a mere function evaluation at the given value of θ variable. Note that parametric solution and subsequent evaluation of z  (θ ) for given θ are equivalent to the online solution. The parametric formulation of the optimization problem can be extended to accommodate the quadratic objective function as well as mixed-integer cases. Depending on the structure of the original problem, the properties of the resulting z  (θ ) change. In case of LP and QP, the z  (θ ) is in the form of a continuous piecewise affine (PWA) function, while in case of the MILP and MIQP, the resulting optimizer can be discontinuous PWA function. Lemma 2.1 ([1, 2]) Consider the parametric quadratic program in (2.8). Then, the optimizer z  = κ(θ ) is a piecewise affine (PWA) function of the vector of parameters, 1 www.gurobi.com. 2 www-01.ibm.com/software/commerce/optimization/cplex-optimizer/. 3 www.mosek.com. 4 The

equality constraints can be removed from the optimization problem by taking the nullspace of the matrix Aeq and some particular solution for z in (2.2c).

2.2 Solutions Techniques

13

1

1

1

3

2 4

5

3

2 4

5

3

2

5

4

3 5 Fig. 2.1 Binary search tree

i.e.,

⎧ ⎪ ⎪ ⎨α1 θ + β1

if θ ∈ R1 .. , . if θ ∈ Rn R

(2.9)

Ri = {θ | Γi θ ≤ γi } i = 1, . . . , n R

(2.10)

κ(θ ) =

⎪ ⎪ ⎩α θ + β nR nR

where

are polyhedral regions and n R denotes the total number of regions.



In simple terms, Lemma 2.1 states that the optimal solution to (2.8) for a particular value of the parameter θ can be obtained by simply evaluating the PWA function in (2.9). This can be done in various ways. The simplest one is to use the so-called sequential search. Here, we go through each i = 1, . . . , n R , checking whether θ ∈ Ri . This can be done by testing whether Γi θ ≤ γi holds. If θ is contained in Ri , the optimal value of z  is given by z  = αi θ + βi and the procedure can be aborted. Otherwise the counter i is incremented by i = i + 1 and the next region is tested. Trivially, the runtime of such a sequential procedure is O(n R ). More efficient evaluation algorithms exist, e.g., the binary search tree procedure of [12], which is schematically depicted in the Fig. 2.1. These, however, require additional preprocessing effort. Finally, we remark that the parametric representation of the optimizer in (2.9) can be obtained off-line by applying parametric programming solvers [10], which are available, e.g., in the multiparametric toolbox [6], or in the POP toolbox [11].

14

2 Mathematical Preliminaries and General Optimization

The practical implication of the parametric solution is the ability to use techniques of the optimal control in places, where online solvers cannot be implemented. We may mention a low-level hardware like microcontrollers, which are unable to accommodate complex algorithms like active set [7]. There are however several disadvantages to the parametric programming, mainly the complexity of obtaining the parametric solution or the memory demands for storing the optimizer z  (θ ). Further reading material on this topic can be found in [1, 3, 8].

References 1. Bemporad A, Morari M, Dua V, Pistikopoulos EN (2002) The explicit linear quadratic regulator for constrained systems. Automatica 38(1):3–20. https://doi.org/10.1016/S00051098(01)00174-1 2. Borrelli F (2003) Constrained optimal control of linear and hybrid systems, vol 290. Springer, Berlin 3. Borrelli F, Bemporad A, Morari M (2017) Predictive control for linear and hybrid systems. Cambridge University Press, Cambridge. https://books.google.de/books?id=cdQoDwAAQBAJ 4. Boyd S, Vandenberghe L (2009) Convex optimization, 7th edn. Cambridge University Press, New York 5. Conforti M, Cornuejols G, Zambelli G (2014) Integer programming. Springer Publishing Company Incorporated, Berlin 6. Herceg M, Kvasnica M, Jones C, Morari M (2013) Multi-parametric toolbox 3.0. In: 2013 European control conference, pp 502–510 7. Kalúz M, Klauˇco M, Kvasnica M (2015) Real-time implementation of a reference governor on the arduino microcontroller. In: Fikar M, Kvasnica M (eds) Proceedings of the 20th international conference on process control, Slovak University of Technology in Bratislava, Slovak Chemical Library, Štrbské Pleso, Slovakia, pp 350–356. https://doi.org/10.1109/PC.2015.7169988 8. Kvasnica M (2009) Real-time model predictive control via multi-parametric programming: theory and tools. VDM, Saarbruecken 9. Nocedal J, Wright SJ (2006) Numerical optimization, 2nd edn. Springer, New York 10. Oberdieck R, Diangelakis N, Nascu I, Papathanasiou M, Sun M, Avraamidou S, Pistikopoulos E (2016) On multi-parametric programming and its applications in process systems engineering. Chemical engineering research and design 11. Oberdieck R, Diangelakis NA, Papathanasiou M, Nascu I, Pistikopoulos E (2016) POPparametric optimization toolbox. Ind Eng Chemistry Research 55(33):8979–8991 12. Tøndel P, Johansen TA, Bemporad A (2003) Evaluation of Piecewise affine control via binary search tree. Automatica 39(5):945–950

Chapter 3

Model Predictive Control

3.1 Basic Model Predictive Control Formulation The key concept of the model predictive control (MPC) strategy lies in computing optimal control actions based on a plant’s future behavior. The optimal control actions are obtained by solving an optimization problem. The optimization problem is formulated as a constrained finite-time-optimal control problem, where the objective function determines the performance and economic criteria, while the constraints represent the plant behavior, and technological and safety limitations. The MPC problem is then formulated as constrained finite-time-optimal control (CFTOC) problem, where to the finite-time frame is referred to as prediction horizon. The result of the optimization is a sequence of control actions over the entire prediction horizon. In this book, we will cover the closed-loop implementation of the MPC strategy called the receding horizon control [12]. Here, the CFTOC is repeatedly solved at every sampling instant. At each sampling instant, only the first control action from the sequence as mentioned above is applied to the system. Note that the CFTOC is initialized before resolving with the measurements obtained from the plant. The nature of optimization problems varies based on the performance criteria of the type of plant’s model. Usually, we aim to construct the CFTOC as linear or quadratic optimization problems with linear constraints. Such optimization problems can be easily solved towards global optima with state-of-the-art tools like GUROBI, CPLEX of MOSEK. This chapter will focus exactly on these types of the MPC variation. Theory and derivations presented in this chapter are inspired by the work in [10], and it is combined with findings in [17]. The general structure of the MPC problem is given as follows: min

u 0 ,...,u N −1

N (x N ) +

N −1 

 (xk , u k )

(3.1a)

k=0

s.t. xk+1 = f (xk , u k ), yk = g(xk , u k ),

k ∈ N0N −1

(3.1b)

N0N −1

(3.1c)

k∈

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_3

15

16

3 Model Predictive Control

u k ∈ U,

k ∈ N0N −1

(3.1d)

xk ∈ X,

k∈

(3.1e)

yk ∈ Y,

k∈

N0N −1 N0N −1

x N ∈ XN , x0 = x(t),

(3.1f) (3.1g) (3.1h)

where the objective function (3.1a) represents the performance criteria, while Eqs. (3.1b) and (3.1c) represent the state update and output equation in discrete time, respectively. The technological and safety constraints are represented by polyhedral sets in (3.1d)–(3.1f), which bound input, state, and output vectors, respectively, with the terminal constraint in (3.1g). The optimization problem is initialized by the state measurement as in (3.1h). Note that constraints (3.1b)–(3.1f) are enforced for the entire length of the prediction horizon. Remark 3.1 Sets U, X, Y, and XN are usually conveniently chosen as polyhedral sets, which are convex shapes represented by finitely many inequality constraints. Note, however, that the sets can also be chosen as arbitrary shapes, like ellipsoidal constraints or other non-convex constraints. Such mathematical representation of constraints may lead to non-convex optimization problems, which increase the so lution time of the optimal control problem. The optimal solution of the optimization problem (3.1) is given by a sequence of optimal control actions U  compactly defined as   U  = u 0  . . . u N −1  .

(3.2)

Recall that in the closed-loop implementation, the first control action, i.e., u 0 is applied to the system. Such an implementation follows the policy of receding horizon control [12]. The objective function (·) is expressed as a weighted p-norm, specifically (z) = Qz p ,

(3.3)

where the matrix Q is tuning factor of an appropriate size. Given the choice of the norm, the objective function is either in the form of a linear function or in the form of a quadratic function. Namely, Qz1 =

m  i=1 

|Q i z i |,

Qz2 = z Qz, Qz∞ = max (|Q i z i |) ,

(3.4a) (3.4b) (3.4c)

3.1 Basic Model Predictive Control Formulation

17

where z i represent the ith element of the vector z. If the MPC is formulated with a linear function, the weighting factor Q can be chosen as a vector instead of a matrix, if a second norm penalization is chosen. The choice of the objective function depends on the performance criteria the needs to be fulfilled. The choice of the norm in the objective function depends on the application of the MPC. A particular structure of the objective function, regardless of the choice of the norm, depends whether we focus on a regulation problem or a reference tracking problem. The basic principle of the regulation control problem is to drive the states and inputs to the origin, hence the objective function is structured as follows: N (x N ) = Q N x N  p , (xk , u k ) = Q x xk  p + Q u u k  p .

(3.5a) (3.5b)

On the other hand, when the controlled is tasked to follow a specific reference rk , the cost function is changed to N (x N ) = 0, (xk , u k ) = Q y (rk − g (xk , u k ))  p + Q du Δu k  p ,

(3.6a) (3.6b)

where the first term penalizes the deviation of the predicted output yk from the reference rk , while the second term penalizes the increments of the control action defined as Δu k = u k − u k−1 . Such an objective function would reach minimum, i.e., zero if the output is equal to the reference and the control action does not change. The terminal penalization is often removed from the objective function since the N th prediction of the state vector does not have to be equal to zero at the reference. However, if there is a need for the penalization of the terminal state, one can consider the following term: (3.7) N (x N ) = Q N (x N − xref )  p , where the vector xref is a steady-state value calculated for the reference rk . Such a term will ensure the zero value of the objective function with the terminal penalization [3].

3.2 MPC Formulations with Linear Prediction Models This section presents the formulations of MPC strategies based on linear-timeinvariant (LTI) prediction models. Moreover, we consider the limits on the input, the state, and the output vectors as polyhedra, defined as

18

3 Model Predictive Control

U = {u | MU u ≤ m U },

(3.8a)

X = {x | MX x ≤ m X }, Y = {y | MY y ≤ m Y }, XN = {x | MN x ≤ m N }.

(3.8b) (3.8c) (3.8d)

Remark 3.2 The most used type of signal bounds are box constraints, expressed as z min ≤ z ≤ z max ,

(3.9)

which in the matrix form as in (3.8a) gives    In z z max , mZ = , MZ = −In z −z max 

(3.10)

where In z is the identity matrix of size n z .



Furthermore, we will focus only on 2-norm cases of the objective function. The resulting optimization problem (3.1) with LTI-based prediction and output equations, and with polyhedral constraints as defined in (3.8) will be a quadratic programming problem [4]. This section will cover specific formulations of the MPC with a transfer function based model and state space models.

3.2.1 Input–Output Prediction Model One of the easiest ways of describing the model of a single-input-single-output (SISO) system is through a transfer function. Even though we are usually used to work with transfer functions in a continuous-time domain, here we consider the discrete-time version given by m 

H (z) =

bjz j

j=0 n+1 

, ai z

(3.11)

i

i=0

which can be easily converted to a one-step-ahead difference equation given as

3.2 MPC Formulations with Linear Prediction Models

19

⎞ ⎛ n m



1 ⎝  − y(t) = ai y t − i Ts + b j u t − ( j + 1)Ts ⎠ = a0 i=1 j=0 =

n 

m



αi y t − i Ts + β j u t − ( j + 1)Ts .

i=1

(3.12a)

(3.12b)

j=0

More involved description and derivations regarding discrete-time transfer functions can be found in [13]. Note that such a conversion is possible only if the transfer function H (z) is proper, i.e., m ≤ n. To simplify the notation, let us abbreviate the right-hand side of (3.12) by y(t + Ts ) = f y (y(t), . . . , y(t − nTs ), u(t), . . . , u(t − mTs )).

(3.13)

By considering the transfer function model, we lose the capability of limiting the state vector, thus the MPC can be formulated as min

u 0 ,...,u N −1

N (y N ) +

N −1 

io (yk , u k )

(3.14a)

i=0

yk+1 = f y (yk , . . . , yk−n , u k , . . . , u k−m ),

k ∈ N0N −1 ,

(3.14b)

N0N −1 , N0N −1 ,

(3.14c)

MU u k ≤ m U ,

k∈

MY yk ≤ m Y ,

k∈

MN y N ≤ m N , θ0 = θ (t).

(3.14d) (3.14e) (3.14f)

The problem (3.14) is initialized by vector of theta given as   θ (t) = y(t) y(t − Ts ) . . . y(t − nTs ) u(t − Ts ) . . . u(t − mTs ) .

(3.15)

which consists of the sequence of the current and past inputs and measured outputs, respectively. The specific form of the objective function depends on the type of the control problem. If we have the regulation problem, then the cost function consists of N (y N ) = Q N y N  p , io (yk , u k ) = Q x yk  p + Q u u k  p ,

(3.16a) (3.16b)

while for the case of the reference tracking problem, we simply put N (y N ) = 0, io (yk , u k ) = Q y (rk − yk )  p + Q du Δu k  p .

(3.17a) (3.17b)

20

3 Model Predictive Control

The MPC formulation for the SISO system given by a transfer function is the critical component of the MPC-based reference governor formulation used in the position control of the magnetically suspended ball, covered in Chap. 8. We must also point out that considering an input–output description of the prediction equation has several major limitations, although it has been widely used [5]. First, such a model rarely describes the dynamical behavior of the internal states of the system. Thus, we are not able to constrain these signals. Second, the length of the initial condition θ (t) in (3.15) can be of significant length, especially for higher order systems with zeros. Even though this is not a limiting factor when considering online MPC, it is a significant obstacle in solving such an optimization problem via parametric programming (see Sect. 2.2.2). Several limitations that arose by considering the difference equations as prediction model in MPC can be overcome by focusing on state space models. The MPC formulation with state space models is presented in the next section.

3.2.2 State Space Prediction Model The model predictive control based on state space model is nowadays the most used choice of the model. In fact, main theoretical advances in the field of the MPC were made focusing exactly on the state space prediction equation [10–12, 19]. We consider a discrete-time state space model expressed as x(t + Ts ) = Ax(t) + Bu(t), y(t) = C x(t) + Du(t),

(3.18a) (3.18b)

where states are denoted by x ∈ Rn x , measured signals are denoted by y ∈ Rn y and the variable u ∈ Rn u stands for the vector of manipulated variables. Next, A ∈ Rn x ×n x , B ∈ Rn x ×n u , C ∈ Rn y ×n x , and D ∈ Rn y ×n u . Variables n x , ν, and n y denote the numbers of states, inputs, and outputs, respectively. The sampling time is represented by the variable Ts . In the MPC, the prediction equation will again be a linear model, as in (3.18a), while the output equation is (3.18b). The MPC problem with the state space model is given as min

u 0 ,...,u N −1

N (x N ) +

N −1 

ss (xk , yk , u k )

(3.19a)

k=0

s.t. xk+1 = Axk + Bu k ,

k ∈ N0N −1

(3.19b)

N0N −1 N0N −1 N0N −1

(3.19c)

yk = C xk + Du k ,

k∈

MU u k ≤ m U ,

k∈

MX x k ≤ m X ,

k∈

(3.19d) (3.19e)

3.2 MPC Formulations with Linear Prediction Models

MY yk ≤ m Y ,

21

k ∈ N0N −1

MN x N ≤ m N , x0 = x(t), u −1 = u(t − Ts ).

(3.19f) (3.19g) (3.19h)

If we aim for the reference tracking problem, the objective function (3.19a) is constructed as (3.20) ss (xk , yk , u k ) = Q ry (rk − yk ) 2 + Q u (Δu k ) 2 , in which the last term is defined as Δu k = u k − u k−1 . Due to the penalization of control inputs increments, we extend the initialization of the MPC (3.19) with the term u −1 , which is required for initializations of the Δu 0 . The terminal penalization is constructed as in (3.6). The presented formulation of the MPC strategy ensures offset-free reference tracking only under assumption that the controlled process and the design model (3.19b)–(3.19c) have the same dynamic description [20]. Next section describes the case, when the model of the controlled process differs from the design model.

3.3 Offset-Free Control Scheme The case, when the design model and controlled process differ in dynamics, is called the design model mismatch. Naturally, MPC synthesized as shown in (3.19) would leave a permanent control error in tracking a nonzero reference. To remedy the situation, an integrator component needs to be incorporated in the MPC design. We present a procedure of extending the state space model with a vector of unmeasured disturbances d(t) ∈ Rn d , with constant dynamics. The number of disturbances is denoted by the variable n d . The value of the disturbance vector will then be estimated with a state estimator, in which the integrator will be present. The concept of such an offset-free MPC strategy has been theoretically studied mainly in [14–16], and widely applied in many theoretical and industrial cases [7, 8, 17, 18]. Let x(t + Ts ) = Ax(t) + Bu(t) + E x d(t), y(t) = C x(t) + Du(t) + E y d(t),

(3.21a) (3.21b)

d(t + Ts ) = d(t),

(3.21c)

be the extended state space model, where E x ∈ Rn x ×n d , and E y ∈ Rn y ×n d . Then the structure of the MPC will be changed to

22

3 Model Predictive Control

min

u 0 ,...,u N −1

N (x N ) +

N −1 

ss (xk , yk , u k )

(3.22a)

k=0

s.t. xk+1 = Axk + Bu k + E x dk ,

k ∈ N0N −1

(3.22b)

N0N −1 N0N −1 N0N −1 N0N −1 N0N −1

(3.22c)

yk = C xk + Du k + E y dk ,

k∈

dk+1 = dk ,

k∈

MU u k ≤ m U ,

k∈

MX x k ≤ m X ,

k∈

MY yk ≤ m Y , MN x N ≤ m N ,

k∈

x0 = x(t), u −1 = u(t − Ts ), d0 = d(t)

(3.22d) (3.22e) (3.22f) (3.22g) (3.22h) (3.22i)

with the same objective function as in (3.20). The unmeasured disturbances d enter into (3.21a) and (3.21b) via user-specified matrices of appropriate sizes E x , E y , respectively. The number of these disturbances can vary, depending on the controller process. Usually, as suggested by many scientific works, e.g., by [3, Chap. 13.6], the number of disturbances should coincide with the number of controller outputs. The choice of matrices E x , E y depends also on the controller process. Usually, we set the matrix E x as a zero matrix if the process does not contain unstable open-loop dynamics [20, 21]. A more involved scheme of the offset-free reference tracking concept is depicted in Fig. 3.1. Remark 3.3 The MPC formulation (3.22) can be simplified with considering the value d0 throughout the entire prediction horizon, hence the constraint (3.22d) can be removed. Beside this simplification, one can consider a dynamical model of the disturbance itself, mainly if the disturbance has oscillatory dynamics. Then, the prediction model needs to be upgraded per the model of the disturbance, specifically xd,k+1 = Ad xd,k + Bd dk , yd,k = Cd xd,k + Dd dk .

(3.23a) (3.23b)

Here, the matrices Ad , Bd , Cd and, Dd are real-valued matrices describing the dynamics of the disturbances. Now, the disturbances entering the state prediction equation  will be the output vector yd,k . To achieve the offset-free control using the MPC strategy from (3.22), the unmeasured disturbance d(t) and the initial condition x(t) have to be estimated using one of state observer techniques, like Luenberger observer or a Kalman Filter. For this purpose, we introduce an aggregated state space model, where we define xˆe =

  xˆk , dˆk

(3.24)

3.3 Offset-Free Control Scheme

r(t)

MPC

23

u (t)

xˆe (t)

Process

ym (t)

Estimator

Fig. 3.1 Control scheme with offset-free reference tracking properties. Here, the r (t) denotes the user-defined reference, the u  (t) is optimal control action the optima solution to (3.22), the variables ym (t) stand for the process measurements, and lastly the xˆe are estimates per (3.24)

where the xˆ is the estimate of the state vector of the original model in (3.19), and dˆ is the estimate of the unmeasured disturbance vector. Then, the extended state space model is given as    A Ex B , Be = , Ae = 0 I 0   Ce = C E y , De = D. 

(3.25a) (3.25b)

Then, the Luenberger observer is of the form

xe,k+1 = Ae xe,k + Be u k + L ye,k − ym,k , ye,k = Ae xe,k + De u k .

(3.26a) (3.26b)

The matrix L denotes a static observer gain. Authors in [17] suggest that the matrix L should be calculated with respect to the stochastic properties of the state and output signals, i.e., to use a static Kalman Filter. The main advantage of using the observer with a static gain is the simple structure of the estimator, hence more straightforward implementation. Naturally, if such an approach of state estimation is used in connection with a nonlinear model, the actual control performance can be negatively affected if we move away from the linearization point, at which the model in (3.21) was obtained. In order to mitigate this negative impact, we propose to use a time-varying Kalman Filter, which has better convergence properties in the broader neighborhood of the operational point. The time-varying Kalman Filter procedure consists of two phases. The first phase is the prediction phase which is followed by the update phase. In both phases, the index k|k represents the current estimate of the individual variables. The prediction phase consists of two equations, namely xˆe,k|k−1 = Ae xˆe,k−1|k−1 + Be u k ,

(3.27a)

Pk|k−1 = Ae Pk−1|k−1 Ae + Q e ,

(3.27b)

24

3 Model Predictive Control

where xˆe,k|k−1 is the predicted state estimate based on the previous time instant, and Pk|k−1 is the predicted value of the covariance matrix. The matrices Ae , Be , Ce , De are given as per (3.25). The consecutive step in the estimation algorithm is the update phase, represented by



εk = ym,k − yL − Ce xˆe,k|k−1 + De wk , Sk =

Ce Pk|k−1 Ce + Pk|k−1 Ce Sk−1 ,

Re ,

Lk = xˆe,k|k = xˆe,k|k−1 + L k εk , Pk|k = (I − L k Ce ) Pk|k−1 .

(3.28a) (3.28b) (3.28c) (3.28d) (3.28e)

Here, the estimation error εk is calculated based on the plant measurements ym,k , the linearization point yL , and the estimate in the previous sample as in (3.27a). Note that the subtraction in the first term of (3.28a) is due to zero initial conditions of the observer. The time-varying estimator gain L k is then calculated by (3.28b) and (3.28c). This gain is subsequently used to obtain the current estimate of the state variables xˆe,k|k via (3.28d). At the end of the update phase, the covariance matrix P is updated. The tuning matrix Re should be chosen with respect to the stochastic properties of the output signals. The estimates of xˆe and d can then be recovered from xˆe by (3.29) xˆk = Mx xˆe,k|k , dˆk = Md xˆe,k|k , where

  Mx = I n x 0 ,

  Md = 0 I n d .

(3.30)

Recall that n x is the number of states of the original system from (3.18), while the n d stands for number of disturbances.

3.4 Reformulation to Standard Optimization Problems One of the necessary steps in the application of the MPC is its conversion to standardized forms of optimization problems, which can be solved by general tools, like GUROBI, CPLEX, or MOSEK. This section covers the derivation of such a conversion. We review two main approaches of the reformulation. The distinguishing factor between these two approaches is the number of optimization variables. In the first approach, called the dense reformulation, we have the sequence of control actions U from (3.2) as the only optimization variables. The downside is the construction of dense matrices in the resulting optimization problem. The second approach increases the vector of decision variables with the sequence of states (outputs). The advantage

3.4 Reformulation to Standard Optimization Problems

25

of this approach is the sparsity of the matrices in the resulting optimization problem. In both cases, we focus on the 2-norm penalization in the objective function, hence the resulting optimization problem will be a quadratic optimization problem, with general formulation as in (2.3) from Sect. 2.1.2.

3.4.1 Dense Approach 3.4.1.1

MPC Based on Input–Output Model

The objective of this derivation is to reformulate the optimal control problem given in (3.14) to the matrix formulation of quadratic programming from (2.3). First, we introduce a matrix form of the prediction equation as a function of optimization variables. Let, (3.31) Y = Υy θ0 + Υu U, where matrices Υy and Υu are constructed per the prediction equation (3.14b). Namely, we exploit the structure of individual equations per the entire prediction horizon N . First, we rewrite (3.12b) to yk+1 = υy θ0 + υu U,

(3.32)

  υy = α1 . . . αn β2 . . . βm ,   υy = β1 0 . . . 0 .

(3.33a)

where

(3.33b)

Then, the matrix form of the prediction equation (3.31) reads as ⎡

α10 υy α11 υy .. .



⎥ ⎢ ⎥ ⎢ Υy = ⎢ ⎥, ⎦ ⎣ N −1 α1 υy ⎡ ⎢ ⎢ ⎢ Υu = ⎢ ⎢ ⎢ ⎣

(3.34a)

β 1N

0 β1 (α1 β1 + i=2 − 1βi ) N  N −1 − 1βi ) (α1 β1 + i=2 βi ) β1 (α12 + α1 α2 ) + (α1 β1 + i=2 .. .. . .

β1 (α1N −2 +

 N −2 i=1

αi ) + (α1 β1 +

 N −1 i=2

βi )

..

Second, we convert the objective function to the matrix form

.

0 0 β1 .. .

... ... 0 .. .

⎤ 0 0⎥ ⎥ 0⎥ ⎥. ⎥ 0⎥ ⎦

.. .. . . β1 (3.34b)

26

3 Model Predictive Control

y (R − Y ) + ΔU  Q u ΔU, Jio (U ) = (R − Y ) Q

(3.35)

where variable R denotes the aggregated vector of references, i.e.,      R = r0 , r1 , . . . , r N −1 ,

(3.36)

y and Q u are obtained by performing Kronecker products between the matrices Q weighting matrices Q x and Q u , respectively, and the identity matrix I N . The variable ΔU is defined as ⎡ ⎤ ⎡ ⎤ u 0 − u −1 Δu 0 ⎢ Δu 1 ⎥ ⎢ u 1 − u 0 ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ (3.37) ΔU = ⎢ Δu 2 ⎥ = ⎢ u 2 − u 1 ⎥ , ⎢ .. ⎥ ⎢ ⎥ .. ⎣ . ⎦ ⎣ ⎦ . u N −1 − u N −2

Δu N −1

which can be further rewritten as ΔU = ΛU + λu −1 , ⎡

where

In u 0 0 0 ⎢−In u In u 0 0 ⎢ ⎢ 0 −In u In u 0 Λ=⎢ ⎢ .. .. ⎣ 0 . . 0 0 0 0 −In u

0 0 0

(3.38) ⎡



⎤ −In u ⎢ 0 ⎥ ⎢ ⎥ ⎢ ⎥ λ = ⎢ 0 ⎥. ⎢ .. ⎥ ⎣ . ⎦ 0

⎥ ⎥ ⎥ ⎥ ⎥ 0 ⎦ In u

(3.39)

In the dense reformulation, we can remove the equality constraints by substituting terms in the objective function (3.35). The term Y is substituted with the expression in the matrix prediction equation (3.31) and the ΔU for the definition per (3.38). The matrices of the standardized quadratic objective function (2.3a) are given as follows: y Υy + Λ Q u Λ, H = Υy Q    y Υu + 2λu −1 Q u Λ, q = 2θ0 Υy Q y Υu − 2R  Q r=

y R R Q

+

 y Υy θ0 θ0 Υy Q



y Υy θ0 2R  Q

+

(3.40a) (3.40b)  u λu −1 . u −1 λ Q

(3.40c)

Lastly, we convert inequality constraints (3.14c)–(3.14d) to aggregated matrix form, as defined in (2.3b) as follows: u U ≤ m u , M

y Υy θ0 + Υu U ≤ m y , M

(3.41a) (3.41b)

3.4 Reformulation to Standard Optimization Problems

27

u and M y are Kronecker products between Mu , and My , where again the matrices M respectively, with identity matrix of size N . Hence, we define y = I N ⊗ My , M

(3.42)

x = 1 N ⊗ m x , m y = 1 N ⊗ m y . m u = 1 N ⊗ m u , m

(3.43)

u = I N ⊗ Mu , M

x = I N ⊗ Mx , M

and

Then, matrices corresponding to linear inequality constraints from (2.3b) are    u m u M , bineq = =  y Υy θ0 . m y − M M u Υu 

Aineq

(3.44)

Remark 3.4 Common practice is to exclude the terminal set (3.14e) from the MPC design. Hence, the derivations presented in this section are complete. However, if such set is considered, then     1 ⊗ my y = I N ⊗ My 0 , m y = N . (3.45) M mN 0 MN y , and Q u . In the same fashion are extended the weighting factors Q



Note that the optimization problem given by the objective function represented by the matrices in (3.40) and constraints as in (3.44) is formulated as common quadratic optimization problem initialized by the vector of initial parameters θ0 and reference trajectory R. The problem does not contain the equality constraints, since they were removed by substituting the prediction equation (3.31) into the objective function and the inequality constraints.

3.4.1.2

MPC Based on State Space Model

Similar to the previous section, we focus on the reformulation of the state space based MPC strategy to the standardized optimization problem. First, we exploit the evolution of the prediction equation (3.19b) over the entire prediction horizon N and then formulate the prediction equation in the matrix form. We define the matrix form of the prediction equation as follows: X = Ψx x0 + Γx U, Y = Ψy x0 + Γy U,

(3.46a) (3.46b)

where x0 is the initial condition, U is the vector of optimization variables, X , Y is an aggregated vector of states or outputs, respectively, given as

28

3 Model Predictive Control

     X = x0 x1 . . . x N −1 ,      Y = y0 y1 . . . y N −1 .

(3.47a) (3.47b)

The matrices Ψx , Ψy , Γx , and Γy are based on the future evolution of the state and output vectors, respectively, expressed as xk = A x0 + k

k−1 

A j Bu k−1− j ,

(3.48a)

j=0

⎧ ⎪ if k = 0 ⎪ ⎨C x0 + Du 0 k−1  yk = ⎪ C Ak x 0 + C A j Bu k−1− j + Du k if k ≥ 1 ⎪ ⎩

(3.48b)

j=0

then, ⎡ ⎢ ⎢ ⎢ ⎢ Ψx = ⎢ ⎢ ⎢ ⎣



I A A2 A3 .. .

⎥ ⎥ ⎥ ⎥ ⎥, ⎥ ⎥ ⎦

A N −1



⎤ 0 ⎢ 0⎥ ⎢ ⎥ ⎢ 0⎥ ⎢ ⎥ Γx = ⎢ , 0⎥ ⎢ ⎥ ⎢ ⎥ ⎣ 0⎦ A N −1 B A N −2 B A N −3 B · · · B 0 B AB A2 B .. .

0 0 B AB .. .

0 0 0 B .. .

0 0 0 0 .. .

(3.49)

and ⎡

C CA C A2 C A3 .. .



⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ Ψy = ⎢ ⎥ ⎥ ⎢ ⎥ ⎢ ⎦ ⎣ N −1 CA



D CB C AB C A2 B .. .

0 D CB C AB .. .

0 0 ⎢ 0 0 ⎢ ⎢ D 0 ⎢ Γy = ⎢ C B D ⎢ ⎢ .. .. ⎣ . . C A N −2 B C A N −3 B · · · C AB

⎤ 0 0⎥ ⎥ 0⎥ ⎥ . 0⎥ ⎥ ⎥ 0⎦ CB D 0 0 0 0 .. .

(3.50)

Now, we can formulate the matrix form of the objective function of the state space based MPC (3.19a) in the same fashion as the input–output case, hence y (R − Y ) + ΔU  Q u ΔU. Jss (U ) = (R − Y ) Q

(3.51)

In further derivation, we substitute for the vector Y the expression in (3.47b), thus y Γy + Λ Q u Λ, H = Γy Q  y Γu − 2R  Q y Γu + 2λu −1 Q u Λ, q  = 2x0 Ψy Q r=

y R R Q

+

 y Ψy x0 x0 Ψy Q



y Ψy x0 2R  Q

+

(3.52a) (3.52b)  u λu −1 . u −1 λ Q

(3.52c)

3.4 Reformulation to Standard Optimization Problems

29

The matrices of the standardized quadratic programming (2.3b) corresponding to the inequality constraints (3.19d)–(3.19f) are formulated as the previous section, except that here we include the state constraints. Here, we use the expression in (3.47a) to complete the aggregated matrices. Specifically, ⎤ ⎤ ⎡ u m u M x Ψx x0 ⎦ . x Γx ⎦ , bineq = ⎣m x − M = ⎣M y Ψy x0 y Γy m y − M M ⎡

Aineq

(3.53)

The optimization problem represented by the objective function in (3.52) and by the constraints (3.53) is again a quadratic optimization problem with inequality linear constraints, initialized by the vector of state measurements x(t), the previous control action u −1 , and the vector of references R. Presented matrix representation of the optimal control problem corresponds to the MPC formulation in (3.19). Recall that this MPC strategy is able to guarantee the offset-free reference tracking properties only if the design model, i.e., the prediction equation, coincides with the actual model dynamics. Otherwise, we are required to move to more robust controller, which is represented by (3.22). The conversion to QP problem follows the same principles, as depicted in the beginning of this section, except that we extend the prediction equation with a disturbance vector, as per Remark 3.3, D0 = 1 N ⊗ d0 .

(3.54)

Subsequently, the prediction equation can be stated as follows: X = Ψx x0 + Γx U + Γx,d D0 , Y = Ψy x0 + Γy U + Γy,d D0 , ⎡

where

Γd,x

⎢ ⎢ ⎢ ⎢ =⎢ ⎢ ⎢ ⎣



and

Γd,x

0 Ex AE x A2 E x .. .

0 0 Ex AE x .. .

0 0 0 B .. .

0 0 0 0 .. .

(3.55a) (3.55b) 0 0 0 0



⎥ ⎥ ⎥ ⎥ ⎥, ⎥ ⎥ 0⎦ A N −1 E x A N −2 E x A N −3 E x · · · E x

Ey C Ex C AE x C A2 E x .. .

0 Ey C Ex C AE x .. .

0 0 Ey C Ex .. .

0 0 0 Ey .. .

0 0 0 0 .. .

0 0 0 0

(3.56)



⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ =⎢ ⎥. ⎥ ⎢ ⎥ ⎢ ⎣ 0⎦ C A N −2 E x C A N −3 E x · · · C AE x C E x E y

(3.57)

30

3 Model Predictive Control

In case of the MPC extended with the disturbance modeling, the matrices of the objective function will be changed to y Γy + Λ Q u Λ, H = Γy Q      y Γu + 2D0 Γy,d u Λ, q = 2x0 Ψy Q y Γu − 2R  Q Q y Γy + 2λu −1 Q    y R + x0 Ψy Q y Ψy x0 − 2R  Q y Ψy x0 + D0 Γy,d Q y Γy,d D0 r = R Q      −2D0 Γy,d Q y Γy x0 + u −1 λ Q u λu −1 .

(3.58a) (3.58b) (3.58c)

The inequality constraints are changed as follows: ⎡

Aineq

⎡ ⎤ ⎤ u m u M x Ψx x0 − M x Γx D0 ⎦ . x Γx ⎦ , bineq = ⎣m x − M = ⎣M    m y − My Ψy x0 − My Γy D0 M y Γy

(3.59)

Recall that in this derivation, we considered the disturbance to be constant throughout the prediction. Furthermore, in the MPC extended with disturbance modeling technique, the optimization problems must be initialized with the estimate of the ˆ and the previous control action. state vector x, ˆ the estimate the disturbance d,

3.4.2 Sparse Approach This section illustrates the conversion of the MPC problem to a QP with sparse matrices. Even though the solution to the quadratic optimization problem with sparse curvature matrix can be faster compared to the previous approach, it is rarely used. The sparse approach has two downsides. First, we optimize the aggregated state vector X , output vector Y , and the aggregated control vector U . Second, we keep the equality constraints in play. The resulting QP problem is larger in terms of optimization variables and number of constraints, then in the dense approach, where we optimize directly for the control inputs. We illustrate the derivation only for the case of state space based MPC to give the reader an overview of this approach. First, we define a vector z as   U z= . (3.60) Y Recall that the vectors X , Y , and U are defined as in (3.47) and (3.2), respectively. The aggregated state space model, defined over the prediction horizon N , is then formulated without the substitutions presented in (3.48a), hence we get

3.4 Reformulation to Standard Optimization Problems







0 ⎢ ⎥ ⎢A ⎢ ⎥ ⎢ ⎢ ⎥ ⎢0 ⎢ ⎥=⎢ ⎢ ⎥ ⎢. ⎣ ⎦ ⎣ .. 0 x N −1

⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣

x0 x1 x2 .. .

y0 y1 y2 .. . y N −1

0 0 A .. . 0

0 0 0 ..

0 0 B .. . 0

⎤⎡ ⎤ ⎡ x0 0 D ⎢ x1 ⎥ ⎢ 0 0⎥ ⎥⎢ ⎥ ⎢ ⎢ ⎥ ⎢ 0⎥ ⎥ ⎢ x2 ⎥ + ⎢ 0 .. ⎥ ⎢ .. ⎥ ⎢ .. . ⎦⎣ . ⎦ ⎣ . 0 0 0 0 C 0 x N −1

⎡ C ⎥ ⎢0 ⎥ ⎢ ⎥ ⎢0 ⎥=⎢ ⎥ ⎢ .. ⎦ ⎣. ⎤

⎤⎡ ⎤ ⎡ x0 0 0 ⎢ ⎥ ⎢ 0⎥ ⎥ ⎢ x1 ⎥ ⎢ B ⎢ ⎥ ⎢ 0⎥ ⎥ ⎢ x2 ⎥ + ⎢ 0 .. ⎥ ⎢ .. ⎥ ⎢ .. . . .⎦ ⎣ . ⎦ ⎣ . 0 A 0 0 x N −1

0 0 0 ..

0 C 0 .. .

0 0 C .. .

0 0 0 .. .

31

⎤⎡ ⎤ ⎡ ⎤ u0 0 In x ⎢ ⎥ ⎢ ⎥ 0⎥ ⎥ ⎢ u1 ⎥ ⎢ 0 ⎥ ⎢ ⎥ ⎢ ⎥ 0⎥ ⎥ ⎢ u 2 ⎥ + ⎢ 0 ⎥ x0 , .. ⎥ ⎢ .. ⎥ ⎢ .. ⎥ . . .⎦ ⎣ . ⎦ ⎣ . ⎦ 0 B 0 u N −1 0

0 0 0 ..

0 0 0 ..

(3.61)

⎤⎡ ⎤ u0 0 ⎢ ⎥ 0⎥ ⎥ ⎢ u1 ⎥ ⎢ u2 ⎥ 0⎥ ⎥⎢ ⎥ (3.62) .. ⎥ ⎢ .. ⎥ ⎣ ⎦ . . ⎦ 0 0 0 D u N −1

0 D 0 .. .

0 0 D .. .

0 0 0 .. .

which is further simplified into X = Γx,x X + Γx,u U + Ψ˜ x x0 Y = Γy,x Y + Γy,u U.

(3.63a) (3.63b)

The equality constraints (3.63a) are then converted into     Γx,u I − Γx,x 0 Ψ˜ x x0 z = , Γy,u 0 I − Γy,x 0

(3.64)

which resembles the form of the standardized equality constraint in (2.3b). Moreover, the QP form of the inequality constraints (3.19d)–(3.19f) in the sparse approach reads as ⎡ ⎤ ⎡ ⎤ u 0 0 M m u ⎣ 0 M x 0 ⎦ z = ⎣m x ⎦ . (3.65) y m y 0 0 M Recall that matrices in (3.65) are defined per (3.42) and (3.43). In case of the reformulation of the objective function (3.51), we stuck the individual components of the cost function on the main diagonal of the curvature matrix and into a vector in case of the linear term. Specifically, ⎤ u Λ 0 0 Λ Q 0 0 ⎦, H =⎣ 0 y 0 0Q ⎡ ⎤ u Λ −2u −1 λ Q ⎦, 0 q = ⎣  −2R Q y ⎡



y R + u −1 λ Q u λu −1 . r = R Q

(3.66a)

(3.66b) (3.66c)

32

3 Model Predictive Control

The quadratic optimization problem obtained using the sparse reformulation procedure has (ν + n x + n y ) optimization variables, but the matrices in the definition of the QP problem are sparse. Hence, the numerical solution of the QP can be faster in some cases. Note, however, that the sparse approach is not suitable when a parametric solution to the QP is desired. Notably, in the parametric optimization, the number of optimization variables plays a vital role.

3.5 Explicit MPC Concepts Once the MPC problem is formulated as a quadratic optimization problem (QP), obtaining optimal control inputs amounts to solving the QP for a particular value of the initial condition x0 = x(t) in (3.1h). In essence, there are two ways to achieve this: the online (implicit) approach and the off-line (explicit) approach. In the online approach, the QP is solved online at each sampling instant for a particular value of x0 using numerical optimization methods. In the off-line approach, the QP is first solved for all feasibile initial conditions. By using parametric programming, the optimal solution can be obtained as a function that maps initial conditions onto optimal control inputs. Then, in online, the optimal control inputs are obtained by merely evaluating such a mapping function. It is worth emphasizing that both approaches yield the same result and are thus, from a mathematical point of view, equivalent. However, the off-line approach (see Sect. 2.2.2) offers one crucial advantage: the online evaluation of the optimal map is usually faster and simpler compared to solving the QP online. Therefore, such an approach is ideal when aiming for a fast and simple implementation of the MPC strategy to devices such as PLCs. The idea of explicit MPC as popularized mainly by [1] is to use the parametric representation of the optimal solution to (2.8) to abolish the main limitation of traditional online methods in terms of long computation times. Specifically, in explicit MPC, the idea is to replace online optimization by evaluation of the PWA solution in (2.9). If the number of regions, i.e., n R , is low (say below 100), obtaining U  (θ ) from (2.9) can be done in the range of microseconds even on a very simple implementation hardware. Recently, the topic of region-free explicit MPC has resurfaced, [9] originally suggested by [2], and hence the explicit MPC can be applied to process with larger number of parameters. Such an approach has been experimentally tested on the control of the reflux ratio in the distillation column and the findings have been published in [6]. An another, and probably even more prominent, advantage of the parametric solutions in (2.9) is that their implementation is division free. This means that identification of U  (θ ) only requires additions and multiplications. No division operations are required. This mitigates potential implementation problems, e.g., due to buffer overflow or division-by-zero scenarios. Once the explicit form of the optimal solution U  (θ ) is obtained and evaluated for a particular value of the parameter vector θ , only the first component of U  (θ ), usually denoted as u  , is implemented in the plant. Then, at the next time instant,

3.5 Explicit MPC Concepts

33

a new parameter vector θ is formed based on the updated knowledge of the plant’s states and the whole procedure is repeated ad infinitum. This approach is commonly known as the receding horizon control strategy. As s final remark, it should be mentioned that the parameter vector θ does not necessarily consist only from the state measurement. Depending on the MPC problem formulation, the parameter vector θ is extended via (3.15) by several other variables. Specifically, when offset-free tracking of references is desired, θ includes the reference values, past control inputs u(t − Ts ), as well as estimates of any disturbances.

References 1. Bemporad A, Morari M, Dua V, Pistikopoulos EN (2002) The explicit linear quadratic regulator for constrained systems. Automatica 38(1):3–20. https://doi.org/10.1016/S00051098(01)00174-1 2. Borrelli F, Baoti´c M, Pekar J, Stewart G (2010) On the computation of linear model predictive control laws. Automatica 46(6):1035–1041. https://doi.org/10.1016/j.automatica.2010.02.031, http://www.sciencedirect.com/science/article/pii/S0005109810001032 3. Borrelli F, Bemporad A, Morari M (2017) Predictive control for linear and hybrid systems. Cambridge University Press, Cambridge. https://books.google.de/books?id=cdQoDwAAQBAJ 4. Boyd S, Vandenberghe L (2009) Convex optimization, 7th edn. Cambridge University Press, New York, USA 5. Camacho EF, Bordons C (2007) Model predictive control, 2nd edn. Springer, Berlin 6. Drgoˇna J, Klauˇco M, Janeˇcek F, Kvasnica M (2017) Optimal control of a laboratory binary distillation column via regionless explicit MPC. Computers & Chemical Engineering, pp 139– 148. https://doi.org/10.1016/j.compchemeng.2016.10.003 7. Klauˇco M, Kvasnica M (2017) Control of a boiler-turbine unit using MPC-based reference governors. Appl Therm Eng 1437–1447. https://doi.org/10.1016/j.applthermaleng.2016.09. 041 8. Klauˇco M, Poulsen NK, Mirzaei M, Niemann HH (2013) Frequency weighted model predictive control of wind turbine. In: Fikar M KM (ed) Proceedings of the 19th international conference on process control. Slovak University of Technology in Bratislava, Štrbské Pleso, Slovakia, pp 347–352. https://www.uiam.sk/assets/publication_info.php?id_pub=1415 9. Kvasnica M, Takács B, Holaza J, Di Cairano S (2015) On region-free explicit model predictive control. In: 54rd IEEE conference on decision and control, vol 54, Osaka, Japan, pp 3669–3674 10. Maciejowski JM (2002) Predictive control with constraints. PEARSON Prentice-Hall, Upper Saddle River 11. Mayne DQ (2014) Model predictive control: recent developments and future promise. Automatica 50(12):2967–2986. https://doi.org/10.1016/j.automatica.2014.10.128, http://www. sciencedirect.com/science/article/pii/S0005109814005160 12. Mayne DQ, Rawlings JB, Rao CV, Scokaert POM (2000) Constrained model predictive control: stability and optimality. Automatica 36(6):789–814. https://doi.org/10.1016/S00051098(99)00214-9, http://www.sciencedirect.com/science/article/pii/S0005109899002149 13. Mikleš J, Fikar M (2007) Process modelling, identification, and control. Springer, Berlin. https://www.uiam.sk/assets/publication_info.php?id_pub=366 14. Muske KR (1997) Steady-state target optimization in linear model predictive control. In: Proceedings of the 1997 American control conference, vol 6, pp 3597–3601. https://doi.org/10. 1109/ACC.1997.609493 15. Muske KR, Badgwell TA (2002) Disturbance modeling for offset-free linear model predictive control. J Process Control 12(5):617–632. https://doi.org/10.1016/S0959-1524(01)00051-8, http://www.sciencedirect.com/science/article/pii/S0959152401000518

34

3 Model Predictive Control

16. Muske KR, Rawlings JB (1993) Model predictive control with linear models. AIChE J 39(2):262–287 17. Pannocchia G, Rawlings JB (2003) Disturbance models for offset-free model-predictive control. AIChE J 49(2):426–437 18. Prasath G, Recke B, Chidambaram M, Jørgensen JB (2010) Application of soft constrained MPC to a cement mill circuit. IFAC Proc Vol 43(5):302–307, 9th IFAC symposium on dynamics and control of process systems. https://doi.org/10.3182/20100705-3-BE-2011.00050, http:// www.sciencedirect.com/science/article/pii/S1474667016300519 19. Rawlings JB, Mayne DQ (2009) Model predictive control: theory and design 20. Shead LRE, Muske KR, Rossiter JA (2009) Adaptive steady-state target optimization using iterative modified gradient-based methods in linear non-square MPC. In: American Control Conference, 2009. ACC ’09, pp 2558–2563. https://doi.org/10.1109/ACC.2009.519829 21. Shead LRE, Muske KR, Rossiter JA (2010) Conditions for which linear MPC converges to the correct target. J Process Control 20(10):1243–1251. https://doi.org/10.1016/j.jprocont.2010. 09.001, http://www.sciencedirect.com/science/article/pii/S0959152410001812

Chapter 4

Inner Loops with PID Controllers

4.1 Overview of the Control Scheme A situation where the process is controlled primarily by a set of PID controllers is very common in the industry. This section is devoted to the mathematical modeling of such closed-loop systems which consist of a process and an inner controller in a form of a set of PID controllers. We assume that the process is described by linear state space models. Overall scheme of such a control strategy can be seen in Fig. 4.1. Depending on the particular choice of the process modeling, the structure of the MPC-RG will change. In this chapter, we will formulate the MPC-based governor control problems for three main cases. First, in the Sect. 4.2, we consider a SISO process characterized by a transfer function. Next, Sect. 4.3 is devoted to two MIMO cases.

4.2 Reference Governor Synthesis for a SISO System If the controlled system has one input and a single output, we can describe this system by a transfer function of the form G(s) =

Y (s) , U (s)

(4.1)

where U (s) represents the Laplace transform of manipulated variable u(t) in the sdomain, and the variable Y (s) is the s-domain counterpart of the output signal y(t). Consider PID controller in a form of a single transfer function R(s) =

U (s) , E(s)

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_4

(4.2)

35

36

4 Inner Loops with PID Controllers

Fig. 4.1 Closed-loop system with MPC-based reference governor control strategy

r Reference Governor

w



e

u

PIDs

Plant

y

Closed-loop system

in which E(s) is the Laplace transform of the control error e(t) defined as e(t) = w(t) − y(t). By w(t), we denote the setpoint value for the PID controller. Since we are dealing with SISO case, then w(t), e(t), u(t), y(t) ∈ R. If we apply the rules of transfer function algebra, we obtain the model of the closed-loop system given by G cl (s) =

G(s)R(s) Y (s) = . W (s) 1 + G(s)R(s)

(4.3)

In the MPC design, a discrete-time version of the model is considered, hence the transfer function G cl (s) from (4.3) is discretized. We can use z−transform to obtain the discrete-time version of G cl (s), which we will denote as Hcl (z) for a given sampling instant Ts . Furthermore, the numerator and the denominator of Hcl (z) can be written as polynomials of z, leading to m 

Y (z) j=0 = n+1 Hcl (z) =  W (z)

b j z− j .

(4.4)

ai z −i

i=0

If the discrete-time transfer function is proper, i.e., m ≤ n, we can rewrite the transfer function into a recursive definition as follows: ⎛ ⎞ n m  1 ⎝  y(t + 1) = − ai y(t − i + 1) + b j w(t − j + 1)⎠ . (4.5) a0 i=1 j=0 The model in (4.5) represents exactly the prediction equation as in Sect. 3.2.1. The MPC-based reference governor has the following form:

4.2 Reference Governor Synthesis for a SISO System

min

w1 ,...,w N

N 

37

io (yk , u k , wk )

(4.6a)

k=1

yk+1 = f y (yk , . . . , yk−n , wk , . . . , wk−m ), ymin ≤ yk ≤ ymax , θ0 = θ (t),

k ∈ N0N −1

(4.6b)

N0N −1

(4.6c) (4.6d)

k∈

with the objective function io (·) = Q ry (rk − yk ) 2 + Q rw (rk − wk ) 2 + Q wy (wk − yk ) 2 + Q dw (wk − wk−1 ) 2 .

(4.7)

Several terms extend the objective function compared to its original io in (3.16). The first term penalizes the difference between the measured output and the userdefined reference r . The second term penalizes the enforced convergence of the shaped reference. Third penalization term provides that the predicted evolution of the closed-loop system converges to the shaped reference. The last term dampens the fluctuations in the evolution of the shaped reference throughout the prediction window. The penalty matrices Q ry  0, Q rw  0, Q wy  0, and Q dw  0 allow the designer to give different priorities to individual properties of the reference governor. The vector of the initial conditions (4.6d) is, for this case, expressed as   θ = y(t) · · · y(t − nTs ) w(t − Ts ) · · · w(t − mTs ) r1 · · · r N .

(4.8)

Remark 4.1 The length of the parameter θ can be decreased by N − 1 elements once  we consider fixed reference for the length of the prediction horizon N . The transfer function based prediction equations shown as in (4.5) are suitable to use if we are dealing with SISO systems. On the other hand, some applications require the use of state space approach. The state space based modeling can be easily extended also to a MIMO case, which is covered in the next section.

4.3 Reference Governor Synthesis for a MIMO System In the modeling of the multiple-input and multiple-output (MIMO) lower level closed-loop systems, we formulate an aggregated state space model, capturing the dynamics of the PIDs as well as the linearized model of the plant. Here, we distinguish between the two cases of the MIMO loops. First, we look at the symmetric case, where the number of the PIDs is equal to the number of control inputs and the number of controlled variables. Second, we formulate the MPC-based reference governor for an asymmetric case, in which the number of manipulated variables is different from the number of process variables. Note that the topic of this chapter is

38

4 Inner Loops with PID Controllers

not to focus on the design of PIDs but to cover the modeling of the closed loops and formulate the MPC-based reference governor. In both cases, since we formulate the closed loops as state space models, the MPC-based governor will be constructed as a quadratic programming problem, as depicted in (3.22), but with more complex structure. Examples and case studies for these control strategies can be found in Chap. 7.

4.3.1 Symmetric Case In the symmetric case, visualized in Fig. 4.2, we consider that n y = n u = n w = p, where the variable p depicts the number of PID controllers. Each of the PID controllers is represented by a transfer function G r,1,..., p (s) in continuous-time domain. To obtain the state space model of the closed-loop, we first define the state vector p xr,i , i ∈ N1 , which corresponds to the internal states of the ith PID controller. Then the state space model of a single PID controllers in discrete time is defined as p

xr,i (t + Ts ) = Ar,i xr,i (t) + Br,i ei (t), i ∈ N1 , p u i (t) = Cr,i x(t) + Dr,i ei (t), i ∈ N1 ,

(4.9a) (4.9b)

where the matrices Ar,i ,Br,i ,Cr,i , and Dr,i are real-valued system matrices in continuous-time domain, the variable ei (t) is the control error of the i-th component, i.e., ei (t) = wi (t) − yi (t), and the u i (t) is the control action provided to the plant. The dimension of the system matrices depends on the structure of the PID controller. However, if we consider the simplest possible PID structure, then the

w1

Gr,1 (s)

.. . wp

.. . Gr,p (s)

y1

u1 Plant

up

y Fig. 4.2 Block diagram of symmetric closed-loop with PID controllers

.. . yp

4.3 Reference Governor Synthesis for a MIMO System

39

corresponding transfer function will be of second order. Hence, Ar,i = R2×2 ,

Br,i = R2×1 , Cr,i = R1×2 , Dr,i = R1×1 .

(4.10)

The aggregated state space model is then formulated by defining a combined state space vector      (4.11) xr = xr,1 xr,2 . . . xr, p , which reads as xr (t + Ts ) = Ar xr (t) + Br e(t), u(t) = Cr xr (t) + Dr e(t).

(4.12a) (4.12b)

Here, the matrices are Ar , Br , Cr and Dr defined as block diagonals, defined as ⎤ Ar,1 0 0 ⎥ ⎢ Ar = ⎣ 0 . . . 0 ⎦ , 0 0 Ar, p ⎡

(4.13)

and same goes for Br , Cr , and for matrix Dr . Remark 4.2 In the design of the PID controllers for MIMO systems, it is quite common to introduce summation of multiple control inputs generated by PIDs or with the control error itself. Such a control setup then leads to modification of the output equation (4.12b). In detail, we address such an arrangement of primary control layer in Chap. 7. For more theoretical details about such a control scheme, see [2,  3]). Remark 4.3 The construction of the compact state space model of the PID controllers in (4.12) can be easily extended to accommodate also polynomial controllers or PID controllers with internal filters. The resulting change will increase the number of the  states, i.e., the length of the vector xr in (4.11). In order to derive the state space model of the closed-loop system, we first formulate an open-loop model. Such a model is easily formed by combing (3.18) with (4.12), yielding a combined state vector  x=

  xr . x

(4.14)

Furthermore, the expression for u(t) from (4.12b) is inserted into the state Eq. (3.18a) and output Eq. (3.18b). Then, the state space model of the open-loop system is given as

40

4 Inner Loops with PID Controllers

 x (t + Ts ) = AOL x (t) + BOL e(t), u(t) = COL,u x (t) + DOL,u e(t), y(t) = COL,y x (t) + DOL,y e(t),

(4.15a) (4.15b) (4.15c)

where  Ar 0 , BCr A   Br , = B Dr  = Cr 0 , = Dr ,  = DCr C , 

AOL =

(4.16a)

BOL

(4.16b)

COL,u DOL,u COL,y

DOL,y = D Dr .

(4.16c) (4.16d) (4.16e) (4.16f)

Next, combining the expression for tracking error e(t) which is given as e(t) = w(t) − y(t),

(4.17)

with Eq. (4.15c) yields −1 −1   COL,y x (t) + I + DOL,y DOL,y w(t). y(t) = I + DOL,y

(4.18)

After inserting (4.17) and (4.18) into (4.15), we obtain the following matrix expressions:  −1 COL,y , ACL = AOL − BOL I + DOL,y  −1 BCL = BOL − BOL I + DOL,y DOL,y ,  −1 CCL,u = COL,u − DOL,u I + DOL,y COL,u ,  −1 DCL,u = DOL,u − DOL,u I + DOL,y DOL,u , −1  CCL,y = I + DOL,y COL,y , −1  DCL,y = I + DOL,y DOL,y ,

(4.19a) (4.19b) (4.19c) (4.19d) (4.19e) (4.19f)

which are then arranged in a familiar fashion into a full-fledged state space model of the closed-loop system of the form x (t) + BCL w(t),  x (t + Ts ) = ACL u(t) = CCL,u x (t) + DCL,u w(t), y(t) = CCL,y x (t) + DCL,y w(t).

(4.20a) (4.20b) (4.20c)

4.3 Reference Governor Synthesis for a MIMO System

41

Model in (4.20) allows us to simulate responses of the states  x (t) based on (4.20a), the evolution of the manipulated variable u(t) in (4.20b) as well as the output profile y(t) in (4.20c) given the reference w(t). Compared to the transfer function based approach in Sect. 4.2, we can easily access also control inputs. The MPC-based reference governor is cast as a constrained finite-time optimization problem min

w0 ,...,w N −1

N (x N ) +

N −1 

ss (yk , u k , wk )

(4.21a)

k=0

s.t.  xk+1 = ACL xk + BCL wk ,

k ∈ N0N −1

(4.21b)

N0N −1 N0N −1 N0N −1 N0N −1 N0N −1

(4.21c)

xk + DCL,u wk , u k = CCL,u

k∈

xk + DCL,y wk , yk = CCL,y

k∈

MU u k ≤ m U ,

k∈

MX x k ≤ m X ,

k∈

MY yk ≤ m Y , MN x N ≤ m N ,

k∈

x0 = x(t), u −1 = u(t − Ts ), w−1 = w(t − Ts ),

(4.21d) (4.21e) (4.21f) (4.21g) (4.21h) (4.21i)

with objective function defined as ss (·) = Q ry (rk − yk ) 2 + Q rw (rk − wk ) 2 + Q wy (wk − yk ) 2 + Q dw (wk − wk−1 ) 2 + Q du (u k − u k−1 ) 2 .

(4.22)

In the objective function (4.22), we penalize the control error represented by the first term. The second term of the objective function forces the optimally shaped reference wk to be close to the reference. The third term ensures that the process variables move towards the shaped reference. The two last terms of the cost function penalize oscillations in shaped reference and control actions, respectively. Note that the objective function attains its possible minimum 0, when the user-defined reference r tracks the shaped reference w and coincides with the value of the process variable y. Naturally, this can be achieved only with disturbance modeling approach with state observer.

4.3.2 General MIMO Case The characteristics of this second principal case are that the number of manipulated variables differs from the number of controlled signals. Here, we must distinguish between two scenarios. First, if n u < n y , then the system is not fully controllable. The second case is if n u > n y , then during control a problem may arise with maintaining

42

w1

4 Inner Loops with PID Controllers

Gr,1 (s)

.. . w ny

v1 .. .

Gr,ny (s)

y1

u1 T(s)

vny

.. .

Plant

unu

.. . yny

y Fig. 4.3 Block diagram of an asymmetric closed-loop with PID controllers and pre-compensator

the offset-free qualities of the control performance. However, in each of these two sub-cases, a pre-compensator must be included in the control scheme to compensate between mismatching number of control variables and manipulated variables. Such a control scheme is illustrated in Fig. 4.3. In such a scheme, the individual PID controllers do not directly provide the control action u(t). However, they provide an auxiliary control action, denoted as v(t), which is supplied to the pre-compensator. The pre-compensator filter provides the actual control action u(t). The design of the pre-compensator filter is usually realized in s-domain as proposed in [3, Chap. 3], i.e., as a set of transfer functions, generally denoted by T(s). The pre-compensator is a matrix of transfer functions given as ⎤ T1,1 (s) T1,2 (s) · · · T1,n y (s) ⎢ T2,1 (s) T2,2 (s) · · · T2,n y (s) ⎥ ⎥ ⎢ T(s) = ⎢ . ⎥. .. .. .. ⎦ ⎣ .. . . . Tn u ,1 (s) Tn u ,2 (s) · · · Tn u ,n y (s) ⎡

(4.23)

The calculation of the pre-compensator formula is not the topic of this book; however, it can be done by formulating a set of Diophantine equations and subsequently solving a set of linear equalities [1]. The matrix T(s) can be converted into one state space model, denoted as xT (t + Ts ) = AT xT (t) + BT v(t),

(4.24a)

u(t) = CT xT (t) + DT v(t),

(4.24b)

where the variable xT denotes the aggregated states vector, which originates in converting each of the single transfer function in (4.23). Variable v(t) denotes the output from individual PID controllers, while the manipulated variables provided to the system are output of this state space model (4.24b).

4.3 Reference Governor Synthesis for a MIMO System

43

To derive the model of the closed-loop system with the filter T (s), we combine the model of the filter (4.23) and the plant model (3.18). By substituting the expression in (4.24b) for u(t) in (3.18), we formulate xT (t + Ts ) = AT xT (t) + BT v(t), x(t + Ts ) = Ax(t) + B (CT xT (t) + DT v(t)) , y(t) = C x(t) + D (CT xT (t) + DT v(t)) , which can be restructured to a matrix form        xT (t + Ts ) AT 0 xT (t) BT v(t), = + B DT x(t + Ts ) BCT A x(t)   xT (t)  y(t) = DCT C + D DT v(t). x(t)

(4.25a) (4.25b) (4.25c)

(4.26a) (4.26b)

Next, we treat the model in (4.26) as the main system, which is controlled by a set of PID controllers and we can apply matrix manipulations as in (4.15)–(4.20). This procedure gives the state space model of the closed-loop system which includes the individual models of the PID controllers, the pre-compensator, and the linearized model of the plant. The MPC-based reference governor is then formulated using same principles as demonstrated in Sect. 4.3.1. Remark 4.4 The number of states in the system (4.26) can increase dramatically due to the structure of the filter T(s). Such an increase in the system states can negatively  affect the complexity of the MPC control strategy.

References 1. Kucera V (1993) Diophantine equations in controla survey. Automatica 29(6):1361–1375. https://doi.org/10.1016/0005-1098(93)90003-C 2. Mikleš J, Fikar M (2007) Process modelling, identification, and control. Springer, Berlin. https:// www.uiam.sk/assets/publication_info.php?id_pub=366 3. Skogestad S, Postlethwaite I (2005) Multivariable feedback control: analysis and design. Wiley, New York. http://books.google.dk/books?id=I6lsQgAACAAJ

Chapter 5

Inner Loops with Relay-Based Controllers

5.1 Overview of the Control Scheme Relay-based control is also known under the term on/off control or a bang–bang control. It is one of the oldest types of controllers. The operation of the relay-based controller is limited to providing either the minimum, u min , or the maximum, u max , value of the control action. These min/max values correspond to on/off states of the relay since usually the relay controller does not provide the actual control action. The change between providing either a maximum or a minimum control action value is triggered by crossing a threshold γ by the measured variable. The maximum control action is applied if the threshold value is crossed in a negative way, and minimum control action is provided in the threshold limit is crossed in a positive direction. The operation of the relay-based controller is depicted in Fig. 5.1.

5.2 Model of the Relay-Based Controllers The model of the relay based controller, represented by the finite state machine by Fig. 5.2, can be captured by introducing a binary state variable z ∈ {0, 1}. Then, z = 1 represents the “on” state, or the state when u max is applied, while the “off” state corresponds to z = 0. The dynamical evolution of the state z is given by a state equation   (5.1) z(t + Ts ) = f z z(t), y(t), w(t) , where z(t) is the current value of the binary state, y(t) is current measurement, and w(t) is the setpoint provided to the relay-based controller. The state-update function f z (·) is given by

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_5

45

46

5 Inner Loops with Relay-Based Controllers

Fig. 5.1 Reference governor scheme with a relay-based controller

r Reference Governor

w

Relay

u

x

Process

y

inner loop Fig. 5.2 Relay-based controller

⎧ ⎪1 if (z = 1 ∧ ¬ (y ≥ r + γ )) ∨   ⎨ f z z(t), y(t), w(t) = (z = 0 ∧ (y ≤ r − γ )) ⎪ ⎩ 0 otherwise

(5.2)

where the “¬” denotes the logic negation, “∧” is the logic conjunction, and “∨” stands for the logic disjunction. Once the binary state of the thermostat is available, the value of the manipulated variable provided to the process is given by  u=

u max if z = 1 u min if z = 0.

(5.3)

Note that the relay-based controller does not necessarily have to switch between u max and u min . These values may be chosen arbitrarily based on the needs of the particular technology, they even can be time dependent.

5.3 Reference Governor Synthesis

47

5.3 Reference Governor Synthesis The synthesis of the MPC-based reference governor presented in this section is adopted and generalized based on paper by [1]. The closed-loop model with a relaybased controller is given by a linear discrete-time state space model and a control law given by the binary state update Eq. (5.1). The control scheme with the inner loop is shown in Fig. 5.1. In the MPC-based design, the optimal profile of modulated references w is obtained over a prediction time frame N based on the state measurements. Specifically, the optimal sequence

   (5.4) W = w0 , . . . , w N −1 , can be obtained by solving following optimal control problem: min z (xk , yk , u k , wk )

(5.5a)

W

s.t. xk+1 = Axk + Bu k ,

k ∈ N0N −1

(5.5b)

N0N −1 N0N −1 N0N −1

(5.5c) (5.5d)

k ∈ N0N −1

(5.5f)

k ∈ N0N −1

(5.5g)

yk = C xk + Du k ,

k∈

MX x k ≤ m X ,

k∈

MY yk ≤ m Y ,  u max if z k = 1 uk = , u min otherwise.   z k+1 = f z z k , yk , wk ,

k∈

x0 = x(t), z 0 = z(t).

(5.5e)

(5.5h)

Again, the xk denotes the kth step prediction of the state vector obtained through (5.5b) based on (5.5h). The dynamical behavior of the on/off evolves according to (5.5g) and (5.5f). By employing a relay-based controller, we inherently cannot achieve a zero offset while tracking the reference. The choice of the objective function in this case depends on particular application. One of the choice is to include a term Q ry rk − yk 2 which enforces the reference tracking part, however in this case, it will result in oscillating behavior. Individual applications may require a direct penalization of the manipulated variable, Q u u k 2 since usually this signal is directly related to the energy spent to achieve the control objectives. The full structure of the objective function reads z (·) =

Q ry (rk − yk ) 2 + Q dw (wk − wk−1 ) 2 + Q rw (rk − wk ) 2 + Q wy (wk − yk ) 2 + Q u u k 2 .

(5.6a) (5.6b)

Again, the first term drives the predicted output yk towards the user-defined reference rk , while the second, third, and fourth terms condition the shaped setpoint wk , such that it does not oscillate and follow the user-defined reference. The last term penalizes

48

5 Inner Loops with Relay-Based Controllers

the manipulated variable. Note that since the control action can be switched between to actual values, penalization on control increments will not improve the behavior. Including such a term can only decrease the number of switches, thus worsening the performance. Unfortunately, the problem (5.5) cannot be immediately solved since it contains IF-THEN rules in (5.5f) and (5.5g) via (5.2). Therefore, we show that these constraints can be rewritten into a set of inequalities that are linear in the decision variables. However, since the state z is a binary variable, the entire reformulated control problem will become a non-convex mixed-integer linear problem (MILP) or quadratic problem (MIQP).

5.4 Mixed-Integer Problem Formulation First, we start by rewriting the IF-THEN rule in (5.3) to a set of logic rules [z = 1] ⇔ [u = u max ],

(5.7a)

[z = 0] ⇔ [u = u min ],

(5.7b)

where the “⇔” denotes the logic equivalence. Next, we rewrite (5.7) into a set of inequalities using propositional logic [3]. Then (5.7) holds if and only if z and u satisfy −Mi (1 − z) ≤ u i − u max,i ≤ Mi (1 − z), −Mi z ≤ u i − u min,i ≤ Mi z,

∀i ∈ Nn1 u , ∀i ∈ Nn1 u ,

(5.8a) (5.8b)

where M1,...,n u are sufficiently large scalars. The value Mi is often chosen automatically by individual software tools (like YALMIP [2] in Matlab), however if we need to choose it manually, we can adopt the following expression: Mi = max{|u min,i |, |u max,i |}, ∀i ∈ Nn1 u .

(5.9)

In order to further introduce the reader to the logic reformulation, let us show the results in z = 0, then ∀i ∈ Nn1 u , ∀i ∈ Nn1 u ,

−Mi ≤ u i − u max,i ≤ Mi , 0 ≤ u i − u min,i ≤ 0,

(5.10a) (5.10b)

which can be further expanded to  −Mi ≤ u i − u max,i ≤ Mi →

u i ≥ u max,i − Mi u i ≤ u max,i + Mi

,

(5.11a)

5.4 Mixed-Integer Problem Formulation

49

 0 ≤ u i − u min,i ≤ 0



u i ≥ u min,i u i ≤ u min,i

,

(5.11b)

enforced for i = {1, . . . , n u }. The inequalities in (5.11a) read that the value u i is bounded from the bottom by a large negative number and a large positive number from the top. But, the second set of inequalities (5.11b) points to u i = u min,i , since from the bottom and the top, the variable u i is bounded by the same expression u min,i . Same logic can be applied for the case when z = 1, but we will obtain inverted scenario compared to the (5.11), hence we will enforce logical rules in (5.7) via set of linear inequalities. The translation of the binary state equation f z (·, ·, ·) as in (5.2) starts by rewriting it again to a set of logic equivalence rules  f z (z, T, r ) =

1 if (z ∧ ¬δa ) ∨ (¬z ∧ δb ) 0 otherwise

(5.12)

where δa and δb are binary variables that indicate whether the measurement y is above the upper threshold (i.e., y ≥ w + γ ), or below the bottom threshold (i.e., y ≤ w − γ ). Specifically, [δa = 1] ⇔ [y ≥ w + γ ],

(5.13a)

[δb = 1] ⇔ [y ≤ w − γ ].

(5.13b)

Next, we rewrite (5.13) into a set of inequalities using propositional logic as done in (5.11). Lemma 5.1 ([3]) Consider the statement [δ = 1] ⇔ [g(v) ≤ 0],

(5.14)

where δ ∈ {0, 1} is a binary variable, v is a vector of continuous variables, and g(·) is any function. Then (5.14) holds if and only if δ and v satisfy g(v) ≤ M(1 − δ), g(v) ≥ ε + (m − ε)δ,

(5.15a) (5.15b)

where M is a sufficiently large scalar, m is a sufficiently small scalar, and ε > 0 is the machine precision. For the scalars M and m holds M = max (g(v))

(5.16a)

m = min (g(v)) .

(5.16b) 

50

5 Inner Loops with Relay-Based Controllers

We can apply Lemma 5.1 to (5.13a) as follows. Take v = [y  , w ] and let g(v) = w + γ − y. Then (5.13a) is equivalent to w + γ − y ≤ Ma (1 − δa ),

(5.17a)

w + γ − y ≥ ε + (m a − ε)δa .

(5.17b)

With g(v) = y − w + γ , (5.13b) is satisfied if and only if y − w + γ ≤ Mb (1 − δb ),

(5.18a)

y − w + γ ≥ ε + (m b − ε)δb .

(5.18b)

Next, we rewrite the IF condition of (5.12), i.e., (z ∧ ¬δa ) ∨ (¬z ∧ δb ), into inequalities in binary variables z, δa , and δb . Introduce the substitutions δ1 = z ∧ ¬δa ,

(5.19a)

δ2 = ¬z ∧ δb , δ3 = δ1 ∨ δ2 ,

(5.19b) (5.19c)

where δ1 , δ2 , δ3 are new binary variables. It is easy to verify that (5.19a) is equivalent to δ1 ≤ z, δ1 ≤ (1 − δa ), z + (1 − δa ) ≤ 1 + δ1 ,

(5.20a) (5.20b) (5.20c)

which uses the fact that the negation of a binary variable δa can be equivalently written as 1 − δa . Using the same approach, (5.19b) can be rewritten as δ2 ≤ (1 − z), δ2 ≤ δb , (1 − z) + δb ≤ 1 + δ2 ,

(5.21a) (5.21b) (5.21c)

which is a set of inequalities that are linear in δ2 , z, and δb . Finally, (5.19c) is equivalent to δ3 ≥ δ1 ,

(5.22a)

δ3 ≥ δ2 , δ3 ≤ δ1 + δ2 .

(5.22b) (5.22c)

Therefore, δ3 equivalently models the satisfaction of the IF condition in (5.12). Then f z (z, T, r ) in (5.2) can be rewritten as

5.4 Mixed-Integer Problem Formulation

f z (z, T, r ) = δ3 .

51

(5.23)

With (5.3) rewritten per (5.7) and f z (·, ·, ·) in (5.2) being equivalent to (5.17)– (5.23), problem (5.5) can be equivalently stated as min W

N −1

z (u k , yk , wk , rk )

(5.24a)

k=0

s.t. xk+1 = Axk + Bu k , yk = C xk + Du k ,

(5.24b) (5.24c)

u k,i ≥ u max,i − Mi (1 − z k ) u k,i ≤ u max,i + Mi (1 − z k ) u k,i ≥ u min,i − Mi z k

(5.24d) (5.24e) (5.24f)

u k,i ≤ u min,i + Mi z k wk + γ − yk ≤ Ma (1 − δa,k ),

(5.24g) (5.24h)

wk + γ − yk ≥ ε + (m a − ε)δa,k , yk − wk + γ ≤ Mb (1 − δb,k ),

(5.24i) (5.24j)

yk − wk + γ ≥ ε + (m b − ε)δb,k , δ1,k ≤ z k ,

(5.24k) (5.24l)

δ1,k ≤ (1 − δa,k ), z k + (1 − δa,k ) ≤ 1 + δ1,k , δ2,k ≤ (1 − z k ),

(5.24m) (5.24n) (5.24o)

δ2,k ≤ δb,k , (1 − z k ) + δb,k ≤ 1 + δ2,k ,

(5.24p) (5.24q)

δ3,k ≥ δ1,k , δ3,k ≥ δ2,k ,

(5.24r) (5.24s)

δ3,k ≤ δ1,k + δ2,k , z k+1 = δ3,k .

(5.24t) (5.24u)

Here, the decision variables are xk , wk , u k , all of which are continuous, along with binary variables δa,k , δb,k , δ1,k , δ2,k , δ3,k , and z k . The total number of optimization variables amounts to 5 N . We remind that the index k goes from 0 to N − 1, and constraints (5.24d)–(5.24g) are utilized for i ∈ 1, . . . , n u . It is important to note that all constraints in (5.24) are linear in the decision variables. If we set the objective function similar to (3.20), then the entire problem becomes a mixed-integer quadratic problem with linear constraints. The problem is initialized by the state measurements x0 = x(t), and the current state of the relay-based controller z 0 = z(t). As a final remark, the prediction equation in (5.24b) and (5.24c) can be extended with accordance to offset-free modeling (Sect. 3.3) in order to compensate for the effects of

52

5 Inner Loops with Relay-Based Controllers

the unmeasured disturbances. Let us again emphasize that a zero offset tracking is hardly possible due to the binary nature of the manipulated variable u. The application of the MPC-based reference governor presented in this section is addressed in Chap. 9, where a simulation-based case study involving a thermostatically controlled temperature in a building is covered.

References 1. Drgoˇna J, Klauˇco M, Kvasnica M (2015) MPC-based reference governors for thermostatically controlled residential buildings. In: 54th IEEE conference on decision and control, Osaka, Japan, vol 54 2. Löfberg J (2004) YALMIP : a toolbox for modeling and optimization in MATLAB. In: Proceedings of the CACSD conference, Taipei, Taiwan. http://users.isy.liu.se/johanl/yalmip/ 3. Williams H (1993) Model building in mathematical programming, 3rd edn. Wiley, New York

Chapter 6

Inner Loops with Model Predictive Control Controllers

6.1 Overview of the Control Scheme The objective of this section is to present a systematic and computationally a tractable way of implementing reference governors where the lower level feedback loops contain individual model predictive controllers denoted as local MPCs. In practice, local MPCs, however, are not aware of coupling relations that are only known to the reference governor. Since the local MPCs are optimization problems itself, the MPC-based reference governor is designed as a bilevel optimization problem [3]. Even though the local MPCs are in the form of convex quadratic programs, the bilevel optimization problem is a non-convex problem. The particular arrangement of the MPC-based reference governor and the local MPCs is depicted in Fig. 6.1. In this chapter, we review two approaches on how to deal with the reference governor formulations. The first approach (the Sect. 6.3) uses the Karush–Kuhn– Tucker (KKT) conditions reformulation of the inner loop optimization problem. Although these conditions are nonlinear, we show that they can be rewritten as a set of convex constraints that involve binary variables. Although the resulting problem is still non-convex, it can be solved to global optimality using off-the-shelf mixed-integer solvers. The second approach, discussed in the Sect. 6.4, is based on precomputing, off-line, the explicit solution for the local MPCs. This solution can, again, be encoded using binary variables. We review and compare these approaches on an example involving coordination of vehicle platoons (Sect. 6.5). Furthermore, in Chap. 10, we introduce a complex case study involving the control of a cascading arrangement of chemical reactors.

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_6

53

54

6 Inner Loops with Model Predictive Control Controllers



w1

MPCi=1

u1

(A, B,C, D)i=1

y1

x1

w2

MPCi=2

u2

(A, B,C, D)i=2

MPC-RG

y2

x2

.. wM

MPCi=M

uM

(A, B,C, D)i=M

yM

xM

outerlayer

inner layer

Fig. 6.1 Block diagram of the MPC-based reference governor setup with inner MPC controllers controlling individual subsystems

6.2 Local MPC and MPC-Based Reference Governors Consider a set of M linear-time-invariant models which is denoted as xi (t + Ts ) = Ai xi (t) + Bi u i (t), yi (t) = Ci xi (t) + Di u i (t),

(6.1a) (6.1b)

where xi ∈ Rn x , u i ∈ Rn u , and yi ∈ Rn y are the state, input, and output vectors of the ith subsystem, respectively. Without loss of generality, we can assume that the dimensions of all systems are identical. Each subsystem is operated such that its local constraints are satisfied: (6.2) xi ∈ Xi , u i ∈ Ui , yi ∈ Yi ,

6.2 Local MPC and MPC-Based Reference Governors

55

where Xi ⊆ Rn x , Ui ⊆ Rn u , and Yi ⊆ Rn y are polyhedral sets, and ∀i ∈ N1M . Note that for simplicity of the notation, we use sets U, X, Y, instead of notation presented in (3.8). Moreover, the individual subsystems are assumed to be coupled by coupling constraints ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ u1 y1 x1 ⎢ .. ⎥ ⎢ .. ⎥ ⎢ .. ⎥ (6.3) ⎣ . ⎦ ∈ X, ⎣ . ⎦ ∈ U, ⎣ . ⎦ ∈ Y, xM

uM

yM

where X ⊆ (X1 × · · · × X M ) ⊆ R Mn x

(6.4a)

U ⊆ (U1 × · · · × U M ) ⊆ R

Mn u

(6.4b)

.

(6.4c)

Y ⊆ (Y1 × · · · × Y M ) ⊆ R

Mn y

The overall arrangement is depicted in Fig. 6.1, where each subsystem in (6.1) is individually controlled by its own MPC feedback policy in the form Ui = arg min N,i (x Ni ) +

N −1 



ss,i xi,k , yi,k , u i,k

(6.5a)

k=0

s.t. xi,k+1 = Ai xi,k + Bi u i,k + E x,i di (t),

k ∈ N0Ni −1 ,

(6.5b)

N0Ni −1 , N0Ni −1 , N0Ni −1 , N0Ni −1 ,

(6.5c)

yi,k = Ci xi,k + Di u i,k + E y,i di (t),

k∈

xi,k ∈ Xi ,

k∈

u i,k ∈ Ui ,

k∈

yi,k ∈ Yi , xi,N ∈ XN,i ,

k∈

xi,0 = xi (t), u i,−1 = u i (t − Ts ),

(6.5d) (6.5e) (6.5f) (6.5g) (6.5h)

compactly enclosed by a formula Ui (t) = MPCi (θi (t)),

(6.6)

where θi (t) are the initial conditions of the ith controller at the time instant t, such as the state measurements xi (t), output references wi (t), etc. The MPC controllers are assumed to be designed such that they enforce satisfaction of state, input, and output constraints in (6.2) or (6.5d)–(6.5f), respectively, but they do not have any knowledge of the coupling constraints in (6.3), neither they communicate. The aim is to design an MPC-based reference governor that shapes the individual references wi for the separate inner loops MPC controller MPCi (θi (t)) in such a way that

56

6 Inner Loops with Model Predictive Control Controllers

1. the coupling constraints in (6.3) are enforced and 2. the outputs of the individual subsystems track the user-specified references r¯ = (r1 , . . . , r M ) as closely as possible. The local MPC controller Ui (t) = MPCi (θi (t)) is implemented in the receding horizon fashion, hence the (6.7) u i (t) = ΦUi (θi (t)), where Φ = [In u 0n u ×n u · · · 0n u ×n u ]. 

(6.8)

Ni −1

Note that the objective function (6.5a) has the same structure as the MPC presented in (3.20) in Sect. 3.2.2, except that here the reference is denoted by wi and is provided by the MPC-based reference governor. The optimization is performed with respect to the sequence of optimal control input Ui , which is given as     Ui = u i,0 . . . u i,Ni −1 ,

(6.9)

furthermore, all of the weighting factors Q y,i and Q u,i are positive definite matrices, hence the problem (6.5) is a strictly convex optimization problem. Remark 6.1 Note that the control problem in (6.5) can be extended with the future value of the references, so the first term in the objective function will change to

||Q y,i yi,k − wi,k ||22 .

(6.10)

Next, the model in (6.5b) and (6.5c) can be extended by disturbances in accordance with Sect. 3.3. Such a modification to the local MPC problem will result in        θi = xi,0 wi,1 . . . wi,(Ni −1) u i,−1 di,0 , which is an extended vector of initial conditions.

(6.11)  

The role of the MPC-based reference governor is to determine at each sampling instant t an optimal sequence of shaped references wi (t) for i = 1, . . . , M for the local MPC problems (6.5) such that 1. the tracking error ||ri − yi || is minimized, where the ri is user defined reference for ith system, 2. and the coupling constraints (6.3) are enforced. The MPC-based reference governor is then casted as

min

W1,...,M ,U1,...,M

M N   j=0 i=1



M,i ri, j , yi, j , wi, j ,

(6.12a)

6.2 Local MPC and MPC-Based Reference Governors

s.t.

Ui, j (θi, j ) = arg min N,i (x Ni ) +

57 N −1 



ss,i xi,k , yi,k , u i,k

(6.12b)

k=0

s.t. xi,k+1 = Ai xi,k + Bi u i,k + E x,i di (t), yi,k = Ci xi,k + Di u i,k + E y,i di (t) u i,k ∈ Ui xi,k ∈ Xi yi,k ∈ Yi xi,N ∈ XN,i u i, j

ΦUi, j (θi, j ),

(6.12c)

xi, j+1 = Ai xi, j + Bi u i, j , yi, j = Ci xi, j + Di u i, j ,

(6.12d)

x¯ j ∈ X,

(6.12f)

u¯ j

∈ U,

(6.12g)

y¯ j ∈ Y,

(6.12h)

=

(6.12e)

with (6.12b)−(6.12h) imposed for j = 0, . . . , N − 1, and (6.12b)−(6.12e) also for i = 1, . . . , M, where N is the prediction horizon of the outer MPC problem. In this case, the objective function (6.12a) enforces the reference tracking problem and and penalizes oscillations in the shaped setpoints by





M,i ri, j , yi, j , wi, j = Q y,i ri, j − yi, j 2 + Q w, j wi, j − wi, j−1 2 .

(6.13)

Including other terms like penalization of the control increments, as we propose in Sect. 4.3.1 in (4.22), is not necessary, such that these properties of are enforced in the lower level MPC (6.12b). The reference governor problem in (6.12) is coupled with individual MPC controllers via the optimally shaped references wi, j that enter (6.5) through θi, j in (6.12b) and (6.12c). The vector of initial conditions for the local MPC at the jth time step is defined as      (6.14) θi, j = xi, j wi, j u i, j−1 di,0 . The variables in the coupling constraints in (6.12f)–(6.12h) are defined as follows:     x¯ j = x1, j . . . , x M, j ,     u¯ j = u 1, j . . . , u M, j ,     y¯ j = y1, j . . . , y M, j , and the vector of optimal control sequences Ui, j reads as

(6.15a) (6.15b) (6.15c)

58

6 Inner Loops with Model Predictive Control Controllers

  Ui, j = u i, j  . . . u i, j+Ni −1  .

(6.16)

Lastly, in the MPC-based reference governor design, we allow for the prediction horizon of the governor to be different from the horizons of local MPCs. The closed-loop implementation of the MPC-based reference governor (cf. Fig. 6.1) is done in the traditional receding horizon fashion: 1. Measure (or estimate) states xi (t) of the individual subsystems;  = u i (t − Ts ), ri (the user-specified refer2. Initialize (6.12) by xi,0 = xi (t), u i,−1   = wi (t − Ts ) for i = 1, . . . , M and solve (6.12) for wi,0 (the optiences), wi,−1 mally shaped references);  as setpoints to the inner MPC controllers; 3. Feed wi,0 4. Repeat from Step 1 at the subsequent time instant. When the procedure is commenced at j = 0, any u i,−1 ∈ Ui can be chosen as the  = ri . initial value of the “previous” control action, together with wi,−1  The difficulty of solving for the shaped references wi , i = 1, . . . , M from (6.12) stems from the fact that the control sequences Ui, j in (6.12b) are given as the solution of inner optimization problems (6.5). The problem in (6.12) is thus a bilevel optimization problem, which is non-convex.

6.3 Reformulation via KKT Conditions In this section, we show how the non-convex bilevel optimization problem (6.12) can be rewritten by reformulating the inner optimization problem in (6.12b) via its Karush–Kuhn–Tucker (KKT) conditions. Consider that the inner MPC problem can be rewritten as a parametric quadratic problem as stated in (2.8), hence 1    U Hi Ui + θi Fi Ui + ai Ui 2 i s.t. G i Ui ≤ Vi + E i θi ,

min Ui

(6.17a) (6.17b)

with Ui being defined per (6.9) and for each ith subsystem holds y Γy + Λ Q u Λ, H = Γy Q ⎤ ⎡  2Ψy Q y Γu ⎢ −2 Q y Γu ⎥ ⎥ F =⎢ ⎣ 2λ Q u Λ ⎦   2Γy,d Q y Γy a = 0.

(6.18a)

(6.18b)

(6.18c)

Note that matrices in (6.18) are obtained via the dense reformulation as derived in (3.58) in Sect. 3.4.1. By considering a particular form of the objective function from

6.3 Reformulation via KKT Conditions

59

(3.51), the matrix a in (6.18c) is a zero matrix of appropriate size. We, however, include the variable a in further derivations to provide a general overview of the procedure. Moreover, different constructs of objective functions may lead to nonzero elements in a as suggested in [5, Chap. 6]. To ease the notation, henceforth we will consider a particular subsystem (6.5), and we will omit the index i. Since the QP in (6.17) is strictly convex, U  is its minimizer if and only if the primal–dual pair (U  , λ ) satisfies the KKT conditions HU  + F  θ + a + G  λ = 0, GU  − V − Eθ ≤ 0,

(6.19a) (6.19b)

λ ≥ 0, λs (G [s] U 

−V

[s]

[s]

− E θ ) = 0, ∀s ∈

(6.19c) Nn1 G ,

(6.19d)

where G [s] denotes the sth row of the corresponding matrix, n G is the number of constraints in (6.17b), and λ ∈ Rn G is the vector of Lagrange multipliers. Notice that the KKT conditions (6.19) are nonlinear due to the product between λ and U in the complementarity slackness condition (6.19d). One could straightforwardly replace Ui, j (θ ) as the optimal solution to the inner problem in (6.12b) by the corresponding KKT conditions (6.19), but then the reference governor problem (6.12) would become a nonlinear programming problem (NLP) that is difficult to solve to global optimality. Therefore we show how to formulate (6.19) as a set of linear constraints that involve binary decision variables. Although the problem will still be non-convex, it can be solved to global optimality using off-the-shelf mixed-integer solvers, such as CPLEX, GUROBI, or MOSEK. Observe that for (6.19d) to be satisfied, whenever the sth constraint is inactive, the corresponding Lagrange multiplier λs must be zero at the optimum, i.e., [G [s] U  − V [s] − E [s] θ < 0] =⇒ [λs = 0].

(6.20)

To model this logic relation, introduce binary variables δs ∈ {0, 1}, s = 1, . . . , n G , and rewrite (6.20) into [G [s] U  − V [s] − E [s] θ < 0] =⇒ [δs = 1], [δs = 1] =⇒ [λs = 0].

(6.21a) (6.21b)

Logical rules presented in (6.21) can be rewritten to a set of linear inequalities. The procedure was already described in Sect. 5.4 and in Lemma 5.1, but specifically, consider function f (z), z ∈ Rn z and an arbitrary binary variable σ . Then 1. [ f (z) < 0] =⇒ [σ = 1] if and only if f (z) ≥ Z min σ , 2. [σ = 1] =⇒ [ f (z) = 0] if and only if Z min (1 − σ ) ≤ f (z) ≤ Z max (1 − σ ), 3. [σ = 1] =⇒ [ f (z) ≤ 0] if and only if f (z) ≤ Z max (1 − σ ), with Z min ≤ min f (z) and Z max ≥ max f (z). Applying the procedure to the implication rules in (6.21), we arrive at

60

6 Inner Loops with Model Predictive Control Controllers

G [s] U  − V [s] − E [s] θ ≥ Z min,s δs , Z min,s (1 − δs ) ≤

λs

≤ Z max,s (1 − δs ),

(6.22a) (6.22b)

which for s = 1, . . . , n G are linear inequalities in U  , λ , and δs . Consider   λ = λ 1 . . . λn G ,   δ = δ1 . . . δn G ,

(6.23a) (6.23b)

then the mixed-integer formulation of the KKT conditions in (6.19) becomes HU  + F  θ + a + G  λ = 0,

(6.24a)



GU − V − Eθ ≤ 0, λ ≥ 0, GU  − V − Eθ ≥ Z min δ,

(6.24b) (6.24c) (6.24d)

λ ≥ Z min (1n G − δ), λ ≤ Z max (1n G − δ).

(6.24e) (6.24f)

Observe that (6.24e) is in fact redundant due to (6.24c) and can therefore be omitted. Then, the MPC-based reference governor problem in (6.12) can be equivalently reformulated by replacing (6.12b) with (6.24), imposed for all j = 0, . . . , N (i.e., for each step of the prediction horizon of the reference governor) and i = 1, . . . , M (i.e., for each subsystem):

min

λi, j ,δi, j ,u i, j ,wi, j

s.t.

M N −1  



M,i ri, j , yi, j , wi, j ,

(6.25a)

j=0 i=1 

Hi Ui, j + F  θi, j + ai + G i λi, j = 0,

(6.25b)

G i Ui, j

− Vi − E i θi, j ≤ 0,

(6.25c)

λi, j ≥ 0, G i Ui, j − Vi − E i θi, j ≥ Z min δi, j ,

(6.25d) (6.25e)

λi, j ≤ Z max (1n G − δi, j ),

(6.25f)

u i, j

(6.25g)

=

ΦUi, j ,

xi, j+1 = Ai xi, j + Bi u i, j , yi, j = Ci xi, j + Di u i, j ,

(6.25h)

x¯ j ∈ X,

(6.25j)

u¯ j ∈ U,

(6.25k)

y¯ j ∈ Y, δi, j ∈ {0, 1}n G,i .

(6.25l) (6.25m)

(6.25i)

6.3 Reformulation via KKT Conditions

61

Since all constraints in (6.25) are linear, and the objective function is quadratic, the reference governor problem can be formulated as a mixed-integer quadratic program M n G,i . (MIQP). The total number of binary variables is N i=1 The key limitation of solving the MIQP (6.25) is the number of binary variables. To reduce this number, one can remove redundant inequalities from the constraints in (6.17b) by solving, off-line, one linear program for each constraint, cf. [4].

6.4 Analytic Reformulation An another computationally tractable way of solving the non-convex bilevel optimization problem in (6.12) is to replace (6.12b) by the analytical solution to the inner optimization problems (6.5). Specifically, consider (6.5) which is transformed into the equivalent form (6.17). When θi in (6.17) is considered as a free parameter, the problem is a strictly convex parametric QP (pQP) that since H 0 as elaborated above. The analytical solution is in the form of a PWA function (2.9). In case of multiple local MPCs, we will obtain many PWA functions. Specifically

κi (θi ) =

⎧ ⎪ ⎪ ⎨αi,1 θi + βi,1 ⎪ ⎪ ⎩α i,n R,i θi + βi,n R,i

if θi ∈ Ri,1 .. . if θi ∈ Ri,n R,i ,

(6.26)

with n R,i denoting the number of polyhedral regions for the ith system. For more details about the explicit MPC scheme, refer to Sect. 3.5 and literature therein. Once the closed-form solutions Ui = κi (θi ) are determined for each subsystem i = 1, . . . , M, (6.12b) can be replaced by (6.26) in the following way. For each critical region of the ith closed-form solution, introduce binary variables δi,1 , . . . , δi,n R,i . Then the inclusion θi ∈ Ri,r is modeled by [δi,r = 1] =⇒ [Γi,r θi ≤ γi,r ].

(6.27)

Since the map κi is continuous and ∪r Ri,r is a convex set, the constraint n R,i 

δi,r = 1

(6.28)

r =1

enforces that, if θi ∈ Ri,r , then δi,r = 1 and the remaining variables will be zero, i.e., δi,q = 0 ∀q = r . Then [δi,r = 1] =⇒ [Ui = αi,r θi + βi,r ]

(6.29)

62

6 Inner Loops with Model Predictive Control Controllers

is optimal in (6.5). Applying the second and the third statements of Lemma 5.1 to (6.27) and (6.29) transforms these logic relations into linear inequalities involving continuous variables θi , Ui , and binary variables δi = (δi,1 , . . . , δi,n R,i ): Γi,r θi − γi,r ≤ Z max (1 − δi,r ), Z min (1 − δi,r ) ≤ Ui − αi,r θi − βi,r ≤ Z max (1 − δi,r ),

(6.30a) (6.30b)

where Z min and Z max are sufficiently small/large constants, cf. Lemma 5.1 or [16]. The inner optimization problems in (6.12b) can therefore be equivalently replaced by (6.30) together with (6.28). Then, the reference governor problem in (6.12) becomes min

δi, j,r ,wi , j

N −1  M 



M,i ri, j , yi, j , wi, j ,

(6.31a)

j=0 i=1

s.t. Γi,r θi, j − γi,r ≤ Z max (1 − δi, j,r ),

(6.31b)

Ui, j − αi,r θi, j − βi,r ≥ Z min (1 − δi, j,r ),

(6.31c)

Ui, j − αi,r θi, j − βi,r ≤ Z max (1 − δi, j,r ),

(6.31d)

1n R,i δi, j = 1, u i, j = ΦUi, j ,

(6.31e)

xi, j+1 = Ai xi, j + Bi u i, j , yi, j = Ci xi, j + Di u i, j ,

(6.31g) (6.31h)

x¯ j ∈ X,

(6.31i)

u¯ j ∈ U,

(6.31j)

y¯ j ∈ Y, δi, j,r ∈ {0, 1},

(6.31k) (6.31l)

(6.31f)

with (6.31b)–(6.31e) imposed for i = 1, . . . , M, j = 0, . . . , N − 1, and (6.31b)– (6.31d) also for r = 1, . . . , n R,i . The optimization variables in this case are the shaped references wi, j and binary variables δi, j,r . Recall that the optimally shaped reference w enters the local MPC via the vector of initial conditions θi per (6.14). Contrary to the MIQP formulation (6.25) in the previous section, where also the vector of manipulated variables Ui was also optimized, here this variable is determined explicitly solely based on the choice of δi, j,r . Next, since all constraints in (6.28), (6.30), as well as in (6.12b)−(6.12h) are linear and the objective function (6.12a) is quadratic, the augmented problem (6.31) is, again, a mixed-integer QP. Again, the key limitation of the MIQP isthe number of binary variables, which in this case it is determined by M n R,i . expression N i=1 Various complexity reduction techniques can be used to reduce the number of critical regions in the explicit maps (6.26). For instance, one can resort to optimal

6.4 Analytic Reformulation

63

region merging [6], or to clipped PWA functions [10] to reduce Ri and thus the number of binary variables in (6.31). Alternatively, one can use approximate replacements of κi in (6.26) as in [1, 2, 8, 9, 13, 14] at the expense of suboptimal performance of (6.31). Aforementioned scientific works still preserve the PWA nature of the control law. However, there is also another possibility of approximating the PWA solution of the inner optimization problem. One being the polynomial approximation [11, 12], which would change the type of constraints from mixed-integer linear constraints to polynomial constraints. The advantage of such an approximation will not only remove the necessity to consider integer constraints but also will increase the complexity of the resulting optimization problem, which will no longer be convex.

6.5 Examples Let us consider following example to show the performance of the MPC-based reference governor supervising local MPC strategies. Specifically, we consider M = 3 subsystems that represent movement of frictionless vehicles, modeled as a double integrator with a variable mass with Ts = 1:    1/m i 11 u (t), xi (t) + 0.5 /m i i 01   yi (t) = 0 1 xi (t), 

xi (t + Ts ) =

(6.32a) (6.32b)

where m i is the mass of the ith vehicle (m 1 = 1.0, m 2 = 5.0 and m 3 = 0.5, representing, e.g., a passenger car, a truck, and a motorcycle, respectively), xi ∈ R2 consists of the vehicle’s position and speed, u i represents the manipulated acceleration, and the speed of the individual vehicle is the controlled output. Each vehicle is individually controlled by its own MPC controller, represented by (6.5) with Ni = 4, Q y,i = 10, Q u,i = 1, and Xi = {xi ∈ R2 | xmin ≤ xi ≤ xmax }, Ui = {u i ∈ R | − 1 ≤ u i ≤ 1},

(6.33a) (6.33b)

Yi = {yi ∈ R | − 1 ≤ yi ≤ 1},

(6.33c)

where xmin =

    −15 50 xmax = . 1 1

(6.34)

In addition, the individual subsystems are subject to coupling constraints that are unknown to inner loop MPCs. Specifically, we require the vehicles not to collide. This constraint is translated to

64

6 Inner Loops with Model Predictive Control Controllers

X = {(x1 , x2 , x3 ) ∈ R6 | Cx x1 − Cx x2 ≥ ε, Cx x2 − Cx x3 ≥ ε},

(6.35)

where ε represents the minimal separation gap between vehicles with ε = 5 in our simulations, and Cx = [1 0]. Moreover, we assume Y = Y1 × Y2 × Y3

(6.36a)

U = U1 × U2 × U3 .

(6.36b)

The vehicles’ starting positions are assumed to be such that p1 (0) ≥ p2 (0) ≥ p3 (0) with pi = Cx xi . First, to illustrate the need for a coordinating reference governor, we have performed a closed-loop simulation starting from       5 0 −5 x1 (0) = , x2 (0) = , x3 (0) = , 0 0 0

(6.37)

where the individual subsystems are controlled by their respective MPC feedback policies (6.5) in the absence of coupling constraints. Since no reference governor is assumed in this scenario, wi = ri in (6.5a). The results for a time-varying profile of the velocity trajectories ri to be tracked are shown in Fig. 6.2. As can be observed, although the inner controllers manipulate the control inputs such that the velocity references are tracked, they violate (cf. the second subplot in Fig. 6.2) the collisionfree coupling constraints in (6.35) as they have no knowledge about them. Notice that, although inner MPC loops maintain constraints of individual subsystems in (6.33), in the absence of the reference governor, they violate the coupling constraints in (6.35) (notice that di < 5 in the second subplot) starting from the 5th simulation step and never recover. The εi quantity denotes the gap between the ith and (i + 1)th vehicle. To enforce satisfaction of (6.35), we have therefore inserted the proposed reference governor (6.12) into the loop. It was designed for N = 4, Q y,i = 10, and Q w,i = 1 for i = 1, 2, 3. The reference governor, represented by the bilevel problem (6.12), was subsequently formulated as a MIQP (6.25) per Sect. 6.3 using YALMIP [15] and solved by GUROBI. Specifically, the inner MPC problems, translated to (6.17), had n Ri = 34 for all subproblems, therefore (6.25) has 408 binary variables. The results of the closed-loop simulation starting from the same initial conditions as reported above are visualized in Fig. 6.3. Here, we can see from its second subplot that the minimal separation gap, represented by the coupling constraint (6.35), is maintained. The reference governor achieves this behavior by replacing the userspecified references ri by optimized ones (wi ), as shown in Fig. 6.4. Notice that the separation gap is kept above the safety margin (di ≥ 5) at all time due to the reference governor enforcing (6.35) by suitably modifying the velocity references, cf. Fig. 6.4. Note how wi start to diverge from user-specified setpoints ri when such a change is required to enforce the coupling constraint in (6.35) during setpoint transitions, and also between t = 10 and t = 15. Once recovered from a dangerous situation, wi

6.5 Examples

65 car3

bounds

car2

car1

pi [m]

60 40 20 0 −20 0

10

5

15

20

25

20

25

t [s] 1

2

di [m]

10 5 0 −5 0

10

5

15

t [s] ri

bounds

car3

car2

car1

yi [m s−1 ]

1 0.5 0 −0.5 −1 0

5

10

15

20

25

20

25

t [s] bounds

car3

car2

car1

ui [m s−2 ]

1 0.5 0 −0.5 −1 0

5

10

15

t [s] Fig. 6.2 Closed-loop simulation results for the scenario with no reference governor. The plots depict, respectively, the positions of individual vehicles pi , the separation gap di between them (required to be ≥5 for no collision), the controlled speed yi , and the respective manipulated inputs ui

66

6 Inner Loops with Model Predictive Control Controllers bounds

car3

car2

car1

pi [m]

60 40 20 0 −20

0

5

10

t [s] 1

15

20

25

20

25

20

25

20

25

2

di [m]

10 5 0 −5

0

5

10 bounds

t [s] ri

car3

15 car2

car1

yi [m s−1 ]

1 0.5 0 −0.5 −1

0

5

10

bounds

t [s] car3

15

car2

car1

ui [m s−2 ]

1 0.5 0 −0.5 −1

0

5

10

15

t [s] Fig. 6.3 Closed-loop simulation results for the scenario with reference governor inserted into the loop. The plots depict, respectively, the positions of individual vehicles pi , the separation gap di between them (required to be greater than 5 for no collision), the controlled speed yi , and the respective manipulated inputs u i

6.5 Examples

67

w1 [m s−1 ]

1 0.5 0 −0.5 −1 0

5

10

15

20

25

15

20

25

15

20

25

t [s]

w1 [m s−1 ]

1 0.5 0 −0.5 −1 0

5

10

t [s]

w1 [m s−1 ]

1 0.5 0 −0.5 −1 0

5

10 t [s]

Fig. 6.4 References wi optimally shaped by the reference governor

converge to ri again.The average per-sample runtime required to solve (6.25) was 0.28 s seconds with the maximum being 2.64 s. Next, we have compared the KKT-based formulation in (6.25) to the approach of Sect. 6.4 based on an analytic solution to (6.5). To do so, we have first computed the closed-form solutions κi as in (6.26) by solving the inner MPC problems (6.6) using MPT toolbox [7]. Since each subsystem assumes a different B matrix in (6.32), explicit solutions with a different number of regions were obtained. Specifically, we got R1 = 107 regions for the first subsystem’s MPC, R2 = 127 for the second, and R3 = 89 for the third. These were obtained off-line in 21.8 s. Consequently, the reference governor formulation in (6.31) had 1292 binary variables. The average per-sample runtime required to solve (6.31) at each step of the simulation was 7.9 s with the maximum being 117.3 s. Needless to say, as both (6.25) and (6.31) are equivalent to (6.12), identical simulation results were obtained.

68

6 Inner Loops with Model Predictive Control Controllers

References 1. Bakaráˇc P, Kvasnica M (2018) Approximate explicit robust model predictive control of a CSTR with fast reactions. Chem Pap https://doi.org/10.1007/s11696-018-0630-4, https://www.uiam. sk/assets/publication_info.php?id_pub=1992 2. Bakaráˇc P, Holaza J, Klauˇco M, Kalúz M, Löfberg J, Kvasnica M (2018) Explicit MPC based on approximate dynamic programming. In: 2018 European control conference. IEEE, Limassol, Cyprus, pp 1172–1177. https://www.uiam.sk/assets/publication_info.php?id_pub=1939 3. Bard JF (2010) Practical bilevel optimization: algorithms and applications, 1st edn. Springer Publishing Company, Inc., Berlin 4. Bemporad A (2015) A multiparametric quadratic programming algorithm with polyhedral computations based on nonnegative least squares. IEEE Trans Autom Control 60(11):2892– 2903 5. Borrelli F, Bemporad A, Morari M (2017) Predictive control for linear and hybrid systems. Cambridge University Press, Cambridge. https://books.google.de/books?id=cdQoDwAAQBAJ 6. Geyer T, Torrisi F, Morari M (2008) Optimal complexity reduction of polyhedral piecewise affine systems. Automatica 44(7):1728–1740 7. Herceg M, Kvasnica M, Jones C, Morari M (2013) Multi-parametric toolbox 3.0. In: 2013 European control conference, pp 502–510 8. Holaza J, Takács B, Kvasnica M (2012) Selected topics in modelling and control, Slovak university of technology press, chap complexity reduction in explicit MPC via bounded PWA approximations of the cost function, vol 8. pp 27–32. https://www.uiam.sk/assets/publication_ info.php?id_pub=1356 9. Holaza J, Takács B, Kvasnica M, Di Cairano S (2015) Nearly optimal simple explicit MPC controllers with stability and feasibility guarantees. Optim Control Appl Methods 35(6). https:// doi.org/10.1002/oca.2131 10. Kvasnica M, Fikar M (2012) Clipping-based complexity reduction in explicit MPC. IEEE Trans Autom Control 57(7):1878–1883 ˇ ˇ Fikar M (2010) Low-complexity polynomial 11. Kvasnica M, Löfberg J, Herceg M, Cirka L, approximation of explicit MPC via linear programming. In: Proceedings of the American control conference, Baltimore, USA, pp 4713–4718. https://www.uiam.sk/assets/publication_ info.php?id_pub=987 12. Kvasnica M, Löfberg J, Fikar M (2011) Stabilizing polynomial approximation of explicit MPC. Automatica 47(10):2292–2297. https://doi.org/10.1016/j.automatica.2011.08.023, https://www.uiam.sk/assets/publication_info.php?id_pub=1171 13. Kvasnica M, Hledík J, Rauová I, Fikar M (2013) Complexity reduction of explicit model predictive control via separation. Automatica 49(6):1776–1781. https://doi.org/10.1016/j.automatica. 2013.02.018, https://www.uiam.sk/assets/publication_info.php?id_pub=1378 14. Kvasnica M, Bakaráˇc P, Klauˇco M (2019) Complexity reduction in explicit MPC: a reachability approach. Syst Control Lett 124:19–26. https://doi.org/10.1016/j.sysconle.2018.12.002, https://www.uiam.sk/assets/publication_info.php?id_pub=1980 15. Löfberg J (2004) YALMIP : a toolbox for modeling and optimization in MATLAB. In: Proceedings of the CACSD conference, Taipei, Taiwan. http://users.isy.liu.se/johanl/yalmip/ 16. Williams H (1993) Model building in mathematical programming, 3rd edn. Wiley, New York

Part II

Case Studies

Chapter 7

Boiler–Turbine System

7.1 Plant Description and Control Objectives The boiler–turbine unit represents a system where fossil fuel is burned to generate steam in a drum boiler. The steam is subsequently fed into the turbine. A schematic representation of the plant is shown in Fig. 7.1. The plant features three controlled outputs and three manipulated variables, which have to be operated subject to constraints on their respective amplitudes and their slew rates. Various strategies have been proposed in the literature to control such a plant, ranging from the application of fuzzy MPC [6, 7], through data-driven approaches [11], dynamic matrix control [9], up to the application of hybrid MPC techniques [4, 10]. Although all aforementioned approaches can substantially improve the safety and profitability of the plant operation, they also assume that the existing control architecture (represented by the inner PI/PID controllers) is completely replaced by the new setup. As mentioned in the Introduction, this is not always desired by plant operators. In this book, we assume that the individual manipulated variables are controlled by a set of PI loops which, however, do not explicitly take constraints and performance objectives into account. Therefore, an optimization-based reference governor setup is proposed to improve upon these two factors. We show that the inner PI control loops can be modeled as a discrete-time linear time-invariant system. Then, we design a suitable state observer to estimate the values of the states which cannot be directly measured, as well as to estimate unmeasured disturbances. Using the model and the estimates, we then formulate the optimization problem which predicts the future evolution of the inner closed-loop system and optimizes references provided to the inner PI controllers. Offset-free tracking of output references is furthermore improved by using the concept of disturbance modeling as proposed in the Sect. 3.3. By means of this case study, we illustrate that the proposed concept has two main advantages. First, it allows keeping existing control infrastructure. Second, and more importantly, it enforces a safe and economic operation of the plant. The case study reported in this book quantifies the improvement in safety and profitability and also

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_7

71

72

7 Boiler–Turbine System FEED WATER VALVE

CONTROL VALVE

~

POWER

FUEL VALVE

Fig. 7.1 The boiler–turbine plant

compares it to the scenario where the plant is directly controlled by an MPC controller which bypasses existing PI-based control infrastructure [5]. The three manipulated variables of the boiler–turbine system are individually controlled by a set of three interconnected PI controllers as suggested by [3]. Their primary purpose is to stabilize the plant. However, they may exhibit a poor tracking performance due to the presence of constraints. Specifically, the amplitude of each control action is constrained in the (normalized) interval [0, 1]. Additionally, slew rate constraints have to be considered to guarantee a physically safe operation of the plant. Although anti-windup logic can be included into the feedback law to mitigate the influence of min/max constraints on the amplitude, dealing with slew rate constraints requires extensive controller tuning, which is a tedious procedure without any rigorous guarantees of being successful. We propose to enforce constraint satisfaction and to improve tracking performance by devising a suitable reference governor. Its purpose is to shape the references provided to individual PI controllers such that even these simple controllers achieve constraints satisfaction and desirable performance. The schematic representation of the proposed strategy is shown in Fig. 7.2. Specifically, the reference governor replaces the user-specified reference r by a shaped reference signal w in such a way that the control actions u generated by the inner PI controllers respect constraints. Moreover, the reference governor improves tracking performance by taking into account predictions of the future evolution of the inner closed-loop system such that the measured plant’s output ym converges to the user-specified reference r without a steady state offset. We show that it can be designed as an MPC-like optimization problem solution of which are the optimally shaped references w that enforce constraint satisfaction and optimize tracking performance. Subsequently, in Sect. 7.7, the performance of the proposed strategy is compared to a pure PI-based control strategy as well as to full-fledged MPC setup by means of a case study.

7.2 Plant Modeling and Constraints

73

Fig. 7.2 Reference governor setup



7.2 Plant Modeling and Constraints The mathematical model of the boiler–turbine plant was proposed in [1] as a set of three nonlinear differential equations of the form dp 9 = −0.0018u 2 p 8 + 0.9u 1 − 0.15u 3 , dt d PN 9 = (0.073u 2 − 0.016) p 8 − 0.1PN , dt 1 dρ = (141u 3 − (1.1u 2 − 0.19) p) . dt 85

(7.1a) (7.1b) (7.1c)

Here, p is the drum pressure in kg cm−2 , PN denotes the nominal power generated by the turbine in MW, and ρ is the density of the liquid in the boiler in kg m−3 . These three variables represent the three states of the system. Moreover, the model features three control inputs: u 1 is the fuel flow valve, u 2 represents the steam valve, and u 3 denotes the feed water valve. The liquid level h in the boiler, represented in m, is given as a nonlinear function of states and inputs in the form h = 6.34 · 10−3 p + 4.71 · 10−3 ρ + 0.253u 1 + 0.512u 2 − 0.014u 3 .

(7.2)

Only h, p, and PN can be directly measured. The density ρ is an internal state which can only be estimated if it is required by the control strategy. The three control inputs are subject to min/max bounds on their amplitude with 0 ≤ u i ≤ 1, i = 1, . . . , 3, where 0 represents the fully closed position and 1 stands for the fully open position. In addition, slew rate constraints must be respected as well. They are given by

74

7 Boiler–Turbine System

   du 1  −1    dt  ≤ 0.007 s , du 2 −2 s−1 ≤ ≤ 0.02 s−1 , dt    du 3  −1    dt  ≤ 0.05 s .

(7.3a) (7.3b) (7.3c)

More details about this particular nonlinear model as well as operation of the boiler– turbine unit itself can be found in [3]. The reference governor presented in this part of this book is based on a linearization of the nonlinear dynamics in (7.1), followed by conversion of the continuous-time model into the discrete-time domain. Specifically, let   x = p PN ρ − xL ,   u = u1 u2 u3 − uL,   y = p PN h − yL ,

(7.4a) (7.4b) (7.4c)

denote, respectively, the vector of states, control actions, and measured outputs, expressed as deviations from respective linearization points xL , u L , and yL . Then the linear time-invariant (LTI) approximation of the system in (7.1) in the discrete-time domain is given by x(t + Ts ) = Ax(t) + Bu(t),

(7.5a)

y(t) = C x(t) + Du(t),

(7.5b)

where Ts is the sampling time. For this purpose, we assume that Ts = 2 s. The linearization point is selected as   xL = 107.97 66.62 428.00 ,   u L = 0.34 0.69 0.44 ,   yL = 107.97 66.62 3.13 ,

(7.6a) (7.6b) (7.6c)

and corresponds to the steady state where the turbine generates 66.62 MW of power with drum pressure of 107.97 kg cm−2 , and liquid density 428.00 kg m−3 . Then, using the first-order Taylor approximation of the nonlinearities in (7.1) and by applying the forward Euler discretization, we arrive at the following matrices of the LTI model in (7.5):

7.2 Plant Modeling and Constraints

⎤ 0.9950 0 0 A = ⎣ 0.1255 0.8187 0 ⎦ , −0.0134 0 1 ⎡ ⎤ 1.7955 −0.6963 −0.2993 B = ⎣ 0.1168 25.6134 −0.0195 ⎦ , −0.0120 −2.7733 3.3200 ⎡ ⎤ 1 0 0 C = ⎣ 0 1 0 ⎦, 0.0063 0 0.0047 ⎡ ⎤ 0 0 0 ⎦. 0 0 D=⎣ 0 0.2530 0.5120 −0.0140

75



(7.7a)

(7.7b)

(7.7c)

(7.7d)

Worth noting is that the D matrix is nonzero, which is a consequence of direct feedthrough of control inputs in the output Eq. (7.2).

7.3 Modeling of the Closed-Loop System We assume that the boiler–turbine system is controlled by three interconnected PI controllers as shown in Fig. 7.3. Their coefficients, as reported by [3], are as follows: 11.119s + 0.003 , s 0.004s + 0.009 R2 (s) = , s 1.163s + 0.019 R3 (s) = . s R1 (s) =

(7.8a) (7.8b) (7.8c)

Furthermore, local gains k12 = 0.0292, k13 = 0.1344, k21 = 0.0468, k23 = 0.0875, k31 = 0.0842 and k32 = 0.0699 are introduced to improve the control performance. To deal with the technological constraints (7.3), [3] have proposed to include additional rate limiters and anti-windup in the closed-loop logic. Here, however, these constraints will be enforced by the reference governor; hence, the modeling of the closed-loop system will be done exactly in the same fashion as reported in Sect. 4.3.1. If we consider the model of the set of PI controllers as in (4.12) and the sampling time Ts = 2 s, the state space model of the PI controllers is

76

7 Boiler–Turbine System

w1



R1 (s)

u1

y1

+

k21 k12 k31 w2



R2 (s)

u2

+

Boiler– Turbine System

y2

k13 k32 k23 w3



R3 (s)

u3

+

y3

Fig. 7.3 Interconnected PI controllers. Reprinted from [5], Copyright 2017, with permission from Elsevier



Ar

Br

Cr

Dr

⎤ 100 = ⎣0 1 0 ⎦ , 001 ⎡ ⎤ 200 = ⎣0 2 0 ⎦ , 002 ⎡ ⎤ 0.0033 0 0 = ⎣ 0 0.0093 0 ⎦ , 0 0 0.0186 ⎡ ⎤ 11.1185 0.0468 0.0842 = ⎣ 0.0292 0.0040 0.0699 ⎦ . 0.1344 0.0875 1.1631

(7.9a)

(7.9b)

(7.9c)

(7.9d)

Note that the Dr is a full matrix, which is a consequence of using local gains ki j in the setup of Fig. 7.3. Next, the matrices of the closed-loop system ACL , BCL , CCL , and DCL are be evaluated in accordance with (4.19). These matrices are then used in the next section for the control strategy design.

7.4 Control Strategies In this section, we will focus on the particular controller design. First, we will design the MPC-RG strategy, where we utilize the theoretical basis from Chap. 4. This

7.4 Control Strategies

77

section is followed by design of a Direct-MPC strategy, in order to compare the difference in control performance.

7.5 MPC-Based Reference Governor The MPC-based reference governor is design based on the linearized model of boiler– turbine unit and its closed-loop representation. Moreover, in order to reject the offset and design model and process mismatch, we introduce the disturbance modeling (Sect. 3.3) to enforce the reference tracking properties. To further introduce the reader to the implementation details of the time-varying Kalman filter and the MPC-based reference governor, a complex block diagram is drawn in Fig. 7.4. The particular design model used for the MPC design as well as the Kalman filter design is of the form xk + BCL wk , xk+1 = ACL u k = CCL,u xk + DCL,u wk ,

(7.10a) (7.10b)

yk = CCL,y xk + DCL,y wk + E y dk , dk+1 = dk .

(7.10c) (7.10d)

Next, in order to design the time-varying Kalman filter (Eqs. (3.28) and (3.27)), an aggregated disturbance model is derived. Particularly, define a state vector

xˆ xˆe = ˆ , d

(7.11)

based on which the model in (7.10) is rearranged to

ACL 0 Ae = , 0 I

CCL,u 0 , Ce = CCL,y F



BCL , Be = 0

DCL,u . De = DCL,y

(7.12a) (7.12b)

The MPC-based reference governor is designed as a prediction problem over a finite horizon N and it is given by min

w0 ,...,w N −1

N −1  yk − r 2Q y + Δwk 2Q w + Δu k 2Q u

(7.13a)

k=0

s.t. xk+1 = ACL xk + BCL wk , u k = CCL,u xk + DCL,u wk , yk = CCL,y xk + DCL,y wk + E y d0 ,

(7.13b) (7.13c) (7.13d)

w3







R3 (s)

k23

k13

R2 (s)

k31

k21

R1 (s)

u3

u2

u1

MPC-based Reference Governor

+

k32

+

k12

+



ˆ x

Boiler– Turbine System

Time-varying Kalman Filter

y3

y2

y1

Fig. 7.4 MPC-based reference governor implementation with the time-varying Kalman filter. Reprinted from [5], Copyright 2017, with permission from Elsevier

w2

w1

w1

w2

w3

78 7 Boiler–Turbine System

7.5 MPC-Based Reference Governor

ymin ≤ yk ≤ ymax ,

79

(7.13e)

u min ≤ u k ≤ u max , Δu min ≤ Δu k ≤ Δu max ,

(7.13f) (7.13g)

ˆ x0 = xˆ (t), u −1 = u(t − Ts ), w−1 = w(t − Ts ), d0 = d(t).

(7.13h)

The optimization problem is initialized by the estimate of the state vector xˆ (t), and ˆ by estimate of the disturbance d(t), which can be extracted from the Kalman filter procedure via (3.30). Moreover, in the objective function (7.13a) we not only penalize the tracing error by the first term but also the fluctuations in the shaped reference Δw and the slew rates Δu. Based on that, we require the initialization variables w−1 , and u −1 .

7.6 Direct-MPC Strategy The Direct-MPC controller is designed in order to compare the MPC-RG strategy with the situation when the PI loops are substituted by the optimal controller. We assume that the manipulated variables are obtained by solving following optimization problem at each sampling instant: min

u 0 ,...,u N −1

N −1  yk − r 2Wy + Δu k 2Wu

(7.14a)

k=0

s.t. xk+1 = Axk + Bu k ,

(7.14b)

yk = C xk + Du k + E y d0 , ymin ≤ yk ≤ ymax ,

(7.14c) (7.14d)

u min ≤ u k ≤ u max, Δu min ≤ Δu k ≤ Δu max .

(7.14e) (7.14f)

Problem (7.14) is similar to (7.13), but we directly optimize the control inputs u of (7.5) instead of the shaped reference w. Moreover, the predictions are based on the model of the nominal system in (7.5). The MPC problem (7.14) can be implemented in a receding horizon fashion similarly as was described in Sect. 3.2.2. Its initial conditions, i.e., x0 and d0 , are obtained by estimation by introduction the time-varying Kalman Filter per Sect. 3.3.

80

7 Boiler–Turbine System

7.7 Simulation Results In this section, we demonstrate the performance and viability of the proposed reference governor setup in a simulation study involving the nonlinear model of the boiler–turbine system in (7.1). Three cases are considered. In the first case, the boiler is controlled solely by the interconnected PI controllers as shown in Fig. 7.3. In the second case, the references for the inner PI controllers are shaped in an optimal fashion using the reference governor described in Sect. 7.5 and in Fig. 7.4. We refer to this scenario as the MPC-RG setup. Finally, the last case considers that the plant is directly controlled by an MPC regulator, bypassing the inner PI loops. This scenario will be referred to as Direct-MPC and is discussed in Sect. 7.6, and shown in Fig. 3.1. In all three scenarios, the sampling time was set to Ts = 2 s, and problems (7.13) and (7.14) were formulated for the prediction horizon N = 30. The following tuning of penalty matrices used in (7.13a) was used:   Q y = diag [101 10−2 101 ] , −4

Q w = I3 · 10 ,

(7.15a) (7.15b)

−3

Q u = I3 · 10 .

(7.15c)

The associated Kalman filter was tuned with P0 = I9 ,

(7.16a) −4

Q e = I9 · 10 , −2

Re = I6 · 10 .

(7.16b) (7.16c)

In case of the Direct-MPC setup, represented by (7.14), we have used   Wy = diag [102 10−1 102 ] , −3

Wu = I3 · 10 .

(7.17a) (7.17b)

The tuning of the associated time-varying Kalman filter was chosen as P0 = I6 ,

  Q e = diag [101 102 101 10−1 101 10−1 ] ,   Re = diag [101 101 10−5 ] .

(7.18a) (7.18b) (7.18c)

Both optimization-based strategies were required to enforce the following constraints:   u min = 0 0 0 − u L ,   u max = 1 1 1 − u L ,

(7.19a) (7.19b)

7.7 Simulation Results

81 PI

ref

Direct-MPC

RG-MPC

p [kg cm−2 ]

108 107.98 107.96 107.94 107.92 107.9 0

25

50

75

100

125

150

125

150

125

150

t [s]

(a) Drum pressure PI

ref

Direct-MPC

RG-MPC

76

PN [MW]

74 72 70 68 66 0

25

50

75

100

t [s]

(b) Power generated by turbine PI

ref

Direct-MPC

RG-MPC

3.23

h [m]

3.19 3.15 3.11 3.07 3.03 0

25

50

75

100

t [s]

(c) Liquid level in boiler Fig. 7.5 Measurements profiles. The green color depicts the reference signal. The pink color shows the performance of set of PI controllers, the red lines depict the performance using RG-MPC strategy, and the blue dashed lines are used for Direct-MPC setup

82

7 Boiler–Turbine System ref

w1

w1 [kg cm−2 ]

108 107.98 107.96 107.94 107.92 107.9 0

25

50

100

75

125

150

t [s]

(a) Shaped reference for the drum pressure ref

w2

76

w2 [MW]

74 72 70 68 66 0

25

50

100

75

125

150

t [s]

(b) Shaped reference for the power setpoint ref

w3

3.43

w3 [m]

3.31 3.19 3.07 2.95 2.83 0

25

50

75

100

125

150

t [s]

(c) Shaped reference for the liquid level in boiler Fig. 7.6 Shaped references. The green color depicts the reference signal. The blue color shows the shaped reference

7.7 Simulation Results

83

along with constraints on the slew rate of control inputs:   Δu min = −0.014 −4 −0.1 s−1 ,   Δu max = 0.014 0.04 0.1 s−1 .

(7.20a) (7.20b)

In all simulations involving one of the MPC strategies, the respective QP optimization problems were formulated using YALMIP [8] and solved using the Gurobi solver. The first simulation scenario involves a step change in the requested generated power. Specifically, a +5 MW step change w.r.t. to the steady state PN,L = 66.62 MW is performed at time 50 s. The objective is to keep the other two controlled outputs, i.e., the pressure p and the liquid level in the drum h at their steady state values. Closed-loop simulation profiles of the controlled outputs of the boiler–turbine system under the three scenarios are shown in Fig. 7.5. As can be observed, the power output signal exhibits noticeable oscillations when the system is controlled purely by the PI controllers. On the other hand, once their respective references are shaped via the reference governor, a much smoother tracking of the power reference is achieved. Worth noting is that by employing the disturbance modeling principle, perfect tracking of the references is achieved despite the controlled system (represented by the nonlinear plant in (7.1)) being different from the prediction model (represented by the LTI system (7.5)). The corresponding profiles of the shaped references, generated by solving the QP (7.13) at each sampling instant, are shown in Fig. 7.6. Moreover, the performance of the proposed reference governor setup is almost identical to that one of the DirectMPC. A similar conclusion can be drawn from the profiles of the liquid level in the boiler. The control actions of all three control strategies are shown in Fig. 7.7 alongside its rates in Fig. 7.8. Observe that the PI controllers drastically violate the constraints. Moreover, once the MPC-based reference governor is active, the rates constraints are suddenly satisfied. As can be seen, the PI controllers are less aggressive such that they avoid hitting the constraints. The RG-MPC and Direct-MPC strategies, on the other hand, are explicitly aware of the constraints. To quantify the performance of the three discussed control strategies, we have evaluated two criteria. The first one, represented by Ju =

Nsim 1 u j (k)1 , Nsim k=1

(7.21)

quantifies the amount of energy consumed by the individual control strategy. Here, Nsim is the number of simulation steps, u(k) denotes the control action at the kth simulation step, and u(k)1 = 3j=1 |u j (k)| is the 1-norm of u(k). Similarly, Jy =

1 Nsim

 Nsim k=1

1 y(k) − r (k)1

(7.22)

84

7 Boiler–Turbine System PI

Direct-MPC

RG-MPC

1

u1 [-]

0.8 0.6 0.4 0.2 0 0

25

50

75

100

125

150

125

150

125

150

t [s] PI

Direct-MPC

RG-MPC

1

u2 [-]

0.8 0.6 0.4 0.2 0 0

25

50

75

100

t [s] PI

Direct-MPC

RG-MPC

1

u3 [-]

0.8 0.6 0.4 0.2 0 0

25

50

75

t [s] Fig. 7.7 Time profiles of control actions profiles

100

7.7 Simulation Results

85 PI

Direct-MPC

RG-MPC

0.25

u1 [-]

0.15 0.05 −0.05 −0.15 −0.25 0

25

50

75

100

125

150

125

150

125

150

t [s] PI

Direct-MPC

RG-MPC

0.1

u2 [-]

0.06 0.02 −0.02 −0.06 −0.1 0

25

50

75

100

t [s] PI

Direct-MPC

RG-MPC

0.5

u3 [-]

0.3 0.1 −0.1 −0.3 −0.5 0

25

50

75

t [s] Fig. 7.8 Time profile of the rates of control actions

100

86

7 Boiler–Turbine System

PI Direct-MPC RG-MPC with (8.15) RG-MPC with (8.23a) RG-MPC with (8.23b)

Tracking performance (higher is better)

2.2

2

1.8

1.6

1.4

1.2

1 0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Energy consumption (lower is better) Fig. 7.9 Control strategies comparison

quantifies the tracking performance. Values of these performance criteria for each of the three considered control strategies are compared graphically in Fig. 7.9. Note that the values are normalized such that the PI strategy has Ju = 1 and Jy = 1. As expected, the pure PI-based strategy exhibits the worst performance both with respect to energy consumption as well as in terms of tracking performance. This is a consequence of the conservative tuning of such PI controllers with the objective to avoid hitting constraints. The best performance is achieved by the Direct-MPC setup, since it bypasses the internal dynamics of the PI controllers. The proposed reference governor-based scheme allows the PI controller to stay as a part of the closed-loop system, but significantly improves their performance by a suitable choice of the shaped references. Specifically, compared to the pure PI strategy, RG-MPC reduces the energy consumption by 27% and improves the tracking performance by 48%. To demonstrate the effect of tuning parameters used in (7.14a), besides the baseline setup of (7.15) we have also considered two different selections of the weighting matrices:

7.7 Simulation Results

87

  Q y = diag [102 10−1 102 ] , Q w = I3 · 10−4 , Q u = I3 · 10−5 ,   Q y = diag [5 · 101 10−1 101 ] , Q w = I3 · 10−5 , Q u = I3 · 10−5 .

(7.23a) (7.23b)

The first tuning in (7.23a) puts a higher emphasis on tracking of references since the Q y matrix is ten times as large as in (7.15). Moreover, Q w and Q u were decreased by a factor of 10. The second choice in (7.23b) allows the shaped reference to follow the user-supplied reference less tightly by further decreasing Q w . As a consequence, the MPC-RG has more “freedom” in the choice of the shaped reference. In all cases, the prediction horizon N = 30 was used as was the case in the baseline scenario. The aggregated quality criteria (7.21) and (7.22) evaluated for these retuned RGMPC strategies are depicted visually in Fig. 7.9. Moreover, the concrete values of the quality criteria are reported in Table 7.1. Besides the aggregated quality criteria Ju and Jy computed per (7.21) and (7.22), respectively, the table also reports tracking the performance of the three controlled outputs. Specifically, Jy,p related to the quality with which the drum pressure reference is tracked. Similarly, Jy,PN is the quality of the tracking for the nominal power and Jy,h relates to the quality of tracking of the liquid level reference. Two main conclusions can be drawn from the results in Table 7.1. First, the best overall performance is achieved by using the tuning in (7.23a) which, however, is only marginally better than the baseline tuning of (7.15). The third alternative per (7.23b) is slightly worse with respect to output tracking and significantly worse w.r.t. energy consumption. The second conclusion is that all RG-MPC tunings provide a very good tracking quality of the nominal power PN , even compared to the Direct-MPC setup, cf. the penultimate column of Table 7.1. Specifically, with the tuning in (7.23a), the tracking quality criterion Jy,PN is only by 1.2% worse compared to Direct-MPC. Even with the tuning in (7.23b), which yields the worst tracking of the power reference, the deterioration of performance is only by 8.7%. On the other hand, by using only the PI controllers, the power tracking performance drops by 50.8% compared to Direct-MPC. Since the nominal power is considered the most important quality in practice, this demonstrates that RG-MPC can indeed significantly improve control quality even when inner PI controllers are included in the loop and can even achieve comparable results to Direct-MPC setups.

Table 7.1 Quality criteria for various control strategies. Lower values of Ju and higher values of Jy are better. The values are normalized with respect to the PI strategy Strategy

Ju

Jy

Jy,p

Jy,PN

Jy,h

PI Direct-MPC RG-MPC with (7.15) RG-MPC with (7.23a) RG-MPC with (7.23b)

1.0000 0.3874 0.7284 0.7173 0.8689

1.0000 2.0741 1.4897 1.5415 1.3494

1.0000 7.5113 0.7565 0.7652 0.7868

1.0000 2.0341 1.9189 2.0095 1.8572

1.0000 5.7237 0.1605 0.1601 0.1205

88

7 Boiler–Turbine System

7.8 Concluding Remarks In this part of the book, we have shown how to improve the safety and performance of conventional control strategies by a suitable modification of their references. This was achieved by predicting the future evolution of the closed-loop system composed of the controlled plant and a set of interconnected PI controllers. By optimizing over the future predictions, we have obtained shaped references which, when fed back to the inner controllers, lead to constraints satisfaction and improved tracking performance. The shaped references were computed by solving a convex quadratic programming problem at each sampling instant. The unmeasured states, as well as disturbances capturing the plant–model mismatch, were estimated using a time-varying Kalman filter. The case study has demonstrated that process safety and performance can indeed be significantly improved. The results of the proposed reference governor setup were also compared to a scenario where the inner controllers are bypassed and the plant is directly controlled by a model predictive control strategy. By applying optimization on top of existing PI controllers, reference governors can be viewed at as “trojan horses” for application of MPC-based strategies to plants where complete revamp of the control architecture is not desired. This reduces the cost of implementation and, most importantly, allows human operators to stay comfortable with existing control architecture. As a final note, we recognize two main areas where the MPC-RG can be further improved. The first one includes the incorporation of a more detailed prediction model, preferably a nonlinear one. This, on the one hand, would result in a further increase of control quality. On the other hand, however, computational obstacles associated with solving nonlinear optimization problems would need to be addressed. The second direction is to assume more complex inner controllers. For instance, one can assume that the coefficients of the PI controllers change based on a look-up table. This would result in a switching in the controller tuning. Such a behavior can be effectively tackled in the context of hybrid systems [2] at the expense of arriving at a more complex optimization problem.

References 1. Åström KJ, Eklund K (1972) A simplified non-linear model of a drum boiler–turbine unit. Int J Control 16(1):145–169 2. Bemporad A, Morari M (1999) Control of systems integrating logic, dynamics, and constraints. Automatica 35(3):407–427 3. Dimeo R, Lee K (1995) Boiler–turbine control system design using a genetic algorithm. IEEE Trans Energy Convers 10(4):752–759 4. Keshavarz M, Yazdi MB, Jahed-Motlagh M (2010) Piecewise affine modeling and control of a boiler–turbine unit. Appl Therm Eng 30(8–9):781–791. https://doi. org/10.1016/j.applthermaleng.2009.11.009, http://www.sciencedirect.com/science/article/pii/ S1359431109003378

References

89

5. Klauˇco M, Kvasnica M (2017) Control of a boiler–turbine unit using MPC-based reference governors. Appl Therm Eng 1437–1447. Copyright 2017, with permission from Elsevier, https:// doi.org/10.1016/j.applthermaleng.2016.09.041 6. Li Y, Shen J, Lee K, Liu X (2012) Offset-free fuzzy model predictive control of a boiler–turbine system based on genetic algorithm. Simul Model Pract Theory 26:77–95. https://doi.org/10.1016/j.simpat.2012.04.002, http://www.sciencedirect.com/science/article/ pii/S1569190X12000524 7. Liu X, Kong X (2013) Nonlinear fuzzy model predictive iterative learning control for drum-type boiler–turbine system. J Process Control 23(8):1023–1040. https://doi.org/10.1016/j.jprocont. 2013.06.004, http://www.sciencedirect.com/science/article/pii/S0959152413001261 8. Löfberg J (2004) YALMIP : a toolbox for modeling and optimization in MATLAB. In: Proceedings of the CACSD conference, Taipei, Taiwan. http://users.isy.liu.se/johanl/yalmip/ 9. Moon U, Lee K (2009) Step-response model development for dynamic matrix control of a drum-type boiler–turbine system. IEEE Trans Energy Convers 24(2):423–430. https://doi.org/ 10.1109/TEC.2009.2015986 10. Sarailoo M, Rezaie B, Rahmani Z (2012) MLD model of boiler–turbine system based on pwa linearization approach. Int J Control Sci Eng 2:88–92. https://doi.org/10.5923/j.control. 20120204.06 11. Wu X, Shen J, Li Y, K L, (2014) Data-driven modeling and predictive control for boiler–turbine unit using fuzzy clustering and subspace methods. ISA Trans 53(3):699–708. https://doi.org/10.1016/j.isatra.2013.12.033, http://www.sciencedirect.com/ science/article/pii/S0019057813002437

Chapter 8

Magnetic Levitation Process

8.1 Plant Description The mathematical model of magnetic levitation is derived from the standard physical understanding of magnetic suspension of an object. The spatial arrangement of the system is shown in Fig. 8.1, followed by a photo-capture of the experimental device. The arrangement consists of three main parts. These are metal cylinders with a winding that makes an electromagnetic coil at the top, inductive proximity sensor at the base, and ferromagnetic ball in the space between them. The arrangement considers the displacement of the ball only in the vertical axis (denoted as p). The dynamics of the ball movement is derived from a standard force equation Fa = Fg − Fm ,

(8.1)

where d2 p , dt 2 Fg = m b g, Fa = m b

Fm =

I2 K m c2 . p

(8.2a) (8.2b) (8.2c)

By the Fa , we denote the vertical acceleration force, Fg is the gravitational force, and Fm is the force of the magnetic field acting in the ball. Next, m b is the mass of the ball, g is gravitational acceleration, K m is magnetic constant, Ic is the electric current flowing through the coil. Since the practical implementation relies on inputs and outputs to be in voltage units, the input voltage applied to the coil, i.e., Uc , can be expressed as Uc = I c R c . © Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_8

(8.3) 91

92

8 Magnetic Levitation Process

Fig. 8.1 Magnetic levitation system Table 8.1 Parameters of the magnetic levitation plant Variable Unit

Value 8.4 × 10−3 9.81 −1.1132 × 103 11.107 2.29 1.40

mb g aps bps Ucs s Ups

kg ms−2 Vm−1 V V V

Ka

kgm2 s−2 V−1

1.1899 × 10−6

Similarly, the output voltage taken from the position sensor, i.e., Ups , can be expressed as a linear function of position Ups = aps p + bps .

(8.4)

Using these two substitutions and introducing a conjured coil amplifier constant Ka = hence, the model can be written as

Km , Rc2

(8.5)

8.1 Plant Description

93 2 Uc2 aps m b d 2 Ups = m g − K . b a 2 − 2b U + b2 aps dt 2 Ups ps ps ps

(8.6)

This model, however, is nonlinear in Uc and Ups , therefore a linearization around the s equilibrium Ucs and Ups where Fa = 0 was considered. Applying first-order Taylor expansion to (8.6) yields a linear dynamics of the form d2 y = k1 y + k2 u, dt 2

(8.7)

where s y = Ups − Ups

(8.8a)

u=

(8.8b)

Uc − Ucs

are the deviations of output and input voltages from the selected equilibrium point, respectively. The output deviation of the system y is in the unit of volts and it linearly represents the actual physical distance p. The constants k1 and k2 are given by k1 = 2K a

3 aps Ucs 2 s − b )3 m b (Ups ps

k2 = −2K a

,

3 aps Ucs s − b )2 m b (Ups ps

(8.9a) ,

(8.9b)

which, using the values from Table 8.1, amounts to k1 = 2250, k2 = 9538. The system in (8.7) is subsequently converted into a transfer function model via Laplace transform k2 . (8.10) G(s) = 2 s − k1 The linear dynamics captured in (8.7) can be also transformed to the state space model counterpart, specifically    0 0 1 x(t) + u(t), x(t) ˙ = k2 k1 0   y(t) = 1 0 x(t). 

(8.11a) (8.11b)

Based on the transfer function model a suitable stabilizing PID controller was found G PID (s) =

13.07s 2 + 1358s + 4.367 · 104 . s 2 + 571.4s

(8.12)

The controller in (8.12) is then converted in a discrete time state space model using Ts = 1ms. Note that the PID controller (8.12) is implemented as a PSD controller.

94

8 Magnetic Levitation Process

Fig. 8.2 Laboratory model of magnetic levitation CE152

Next, the system matrices of the closed-loop model were evaluated to ⎡

ACL

BCL CCL,u

⎤ 0.6749 −0.0355 −0.0008 −0.0000 ⎢ 0.0008 1.0000 −0.0000 −0.0000 ⎥ ⎥, =⎢ ⎣ −8.8304 49.0588 0.9727 0.0010 ⎦ −16470.9632 97772.4837 −51.6329 0.9751 ⎡ ⎤ 0.0008 ⎢ 0.0000 ⎥ ⎥ =⎢ ⎣ 0.0296 ⎦ , 56.2470   = −2418.9076 11781.9582 −7.8599 0.0000 ,

DCL,u = 7.8599,   CCL,y = −5.1447 25.0588 1.0000 0.0000 , DCL,y = 0.

(8.13a)

(8.13b) (8.13c) (8.13d) (8.13e) (8.13f)

The aggregated state space model of the closed-loop system was obtained according to Sect. 4.3.2. The actual physical system of magnetic levitation used in this work is the CE152 laboratory model, shown in Fig. 8.2. The plant consists of an electromagnetic coil energized by a power amplifier, a linear position sensor, and a ferromagnetic ball. The intensity of magnetic field is the manipulated variable and can be directly influenced by voltage electric signal in the range of 0–5 V. A measured variable is the reading of the proximity position sensor in the same 0–5 V range. This system exhibits several properties that result in interesting control design challenges. One of them is the fast dynamics of the system. The time constant of the open loop is approximately 20 ms, which indicates that a reasonable sampling rate should be chosen not less than 0.5 kHz to get high-quality measurements. In order to demonstrate the time efficiency of the proposed MPC-based reference governor strategy, an even higher sampling rate of 1 kHz has been chosen in this work. Other

8.1 Plant Description

95

challenging properties of the system are the natural instability and nonlinearity. The instability comes from the spatial arrangement of laboratory model, where the levitating object is pulled upward to the magnetic coil against the force of the gravity. This is the exact opposite of naturally stable magnetic repulsion arrangement used, e.g., by the maglev train. Moreover, the system also exhibits a strong nonlinear behavior. As it is obvious from the force balance equation, the force applied on the ball Fa is a sum of gravitational force Fg and force of the magnetic field Fm . While Fg can be considered constant with always present effect, the Fm is a quadratic function of manipulated variable (input voltage Uc ) and is present only when nonzero voltage is applied. This results in asymmetric nonlinearity, depending on the direction of ball position control.

8.2 Synthesis of the MPC-Based Reference Governor This section reviews the application of the MPC-based reference governor for the magnetic levitation process. We consider two formulations of the MPC-based reference governor design. First, the transfer function-based approach, as presented in Sect. 4.2 and then the state space-based synthesis of the MPC-based reference governor, covered by Sect. 4.3.1. In both cases, we consider the model of the closed-loop system given in s-domain as G cl (s) =

1.25 · 105 s 2 + 1.30 · 107 s + 4.17 · 108 . s 4 + 571s 3 + 1.22 · 105 s 2 + 1.17 · 106 s + 4.17 · 108

(8.14)

Based on the transfer function in (8.14), we further construct the reference governors.

8.2.1 Transfer Function-Based Approach The casting of the transfer function-based MPC-based reference governor starts by discretization the (8.14) with sampling time Ts = 2 · 10−3 s to obtain (4.4) and, more importantly, the prediction equation in (4.6b). The particular MPC-based reference governor was formulated similarly to (4.6), along with constraints on the ball’s position (8.15) ymin = 1.00 V, ymax = 2.00 V. Converting the closed-loop transfer function to the discrete time difference equation and adding the parameters of the optimization problem as in (4.8), we get the following vector of initial conditions:   θ = y0 y−1 y−2 y−3 w−1 w−2 w−3 r .

(8.16)

For this prediction model the reference governor optimization problem was then formulated for N = 3 and

96

8 Magnetic Levitation Process

Position [V]

1.8 1.6 1.4 1.2 1 0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Time [s] Fig. 8.3 Experimental results obtained by only using the PID controller. The desired reference is in black, measured ball displacement in blue, and min/max output constraints in red

dw = 1, , Q w = 1,

Q yr = 1,

(8.17)

while other tuning factors from the objective function in (4.7) were set to zero. Then, the optimization problem was converted into the parametric quadratic programming (pQP) form (2.8). Subsequently, the pQP was solved parametrically according to Lemma 2.1 using the MPT toolbox [1]. We have obtained the PWA function W  (θ ) as in (2.9), which consisted of L = 5 regions in the eight-dimensional parametric space (cf. (8.16)). As the final step, the PWA function in (2.9) was encoded as a binary search tree to increase the efficiency of the function evaluation. The memory footprint of the tree was 619 bytes and it requires 1040 µs to evaluate W  (θ ). The experiment was performed in two phases. In the first one, the vertical displacement of the ball was controlled purely by the PID controller in (8.12). The desired reference to be tracked was periodically switched between ±0.15 V around the selected equilibrium every 300 ms. The performance under the PID controller is shown in Fig. 8.3. As can be seen, the controller violates output constraints and exhibits large overshoots. To enforce constraint satisfaction, and to improve closed-loop performance, we have subsequently enabled the reference governor. As can be seen from Fig. 8.4, the reference governor significantly improves performance. Specifically, by modulating the reference provided to the PID controller just a little bit, the reference governor allows the PID controller to respect output constraints and to achieve a significantly better tracking property.

8.2.2 State Space-Based Approach The MPC-based reference governor is structured similarly to (4.21) and implemented as depicted on Fig. 4.1. The particular MPC strategy is cast as follows:

8.2 Synthesis of the MPC-Based Reference Governor

97

Position [V]

1.8 1.6 1.4 1.2 1 0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

1.6

1.8

2

Time [s]

Shaped Reference [V]

(a)Position measurements 1.8 1.6 1.4 1.2 1 0

0.2

0.4

0.6

0.8

1

1.2

1.4

Time [s]

(b) Reference shaping Fig. 8.4 Experimental results under the reference governor. The top figure shows the desired reference (black), measured vertical displacement of the ball (blue), and output constraints (dashed red). The bottom plot shows the desired reference r in black, and the optimally shaped reference w in pink

min

w0 ,...,w N −1

N −1

ss (u k , yk , wk )

(8.18a)

k=0

xk + BCL wk , s.t. xk+1 = ACL

∀k ∈ N0N −1 ,

(8.18b)

N0N −1 , N0N −1 , N0N −1 , N0N −1 , N NNc−1 .

(8.18c)

xk + DCL,u wk , u k = CCL,u

∀k ∈

yk = CCL,y xk + DCL,y wk ,

∀k ∈

MU yk ≤ m u ,

∀k ∈

MY yk ≤ m Y ,

∀k ∈

wk = w Nc −1 ,

∀k ∈

The objective function (8.18a) is given as

(8.18d) (8.18e) (8.18f) (8.18g)

98

8 Magnetic Levitation Process

ss (·) = Q ry (rk − yk ) 2 + Q dw (wk − wk−1 ) 2 + Q du (u k − u k−1 ) 2 + Q rw (rk − wk ) 2 + Q wy (wk − yk ) 2 .

(8.19)

The first term of the cost function minimizes the tracking error and forces the plants output, in this case the output voltage, to track a user-defined reference r . The second and the third terms penalize fluctuations of the optimized setpoints w and the control actions of the primary PSD controller, respectively. The fourth term accounts for the difference between reference r and shaped setpoint w, and finally, the fifth term penalizes the deviations between predicted output and shaped setpoint for the inner controller. The tuning factors Q ry , Q dw , Q du , Q rw and Q wy are positive definite matrices of suitable dimensions. The main difference between the structure in (8.18) and, e.g., (4.21) is the constraint (8.18g). This constraint represents a move blocking constraint which employs the control horizon Nc ≤ N and is used to decrease the number of degrees of freedom and thus make the problem simpler to solve. The optimization problem in (8.18) is initialized by the vector of parameters   θ = xr (t) x(t) w (t − Ts ) u (t − Ts ) r (t) ,

(8.20)

where xr (t) are the states of the inner PSD controller at time t and x(t) are the states of the plant. Moreover, w (t − Ts ) is the value of the optimized reference at the previous sampling instant, required in (8.18a) at k = 0 when w−1 = w (t − Ts ). Similarly, u (t − Ts ) is the control input generated by the PSD controller at the previous sampling instant that is used as u −1 in (8.18a). Because of (8.11), the plant’s states x(t) consist of the ball’s position y(t) and its speed. Since only the position can be directly measured, the ball’s speed is estimated by x (2) (t) =

y(t) − y (t − Ts ) . Ts

(8.21)

Remark 8.1 The speed, the state no. 2, can be also estimated employing a state observer in the form of a Kalman Filter, but experiments showed that such a crude  estimation as in (8.21) yields satisfactory results. The reference governor in a form of an MPC problem (7.13) was constructed using YALMIP [3]. The prediction horizon N set to nine samples and the control horizon Nc = 2 was used. Because of the physical constraints of the plant, the control action u was limited by u min = 0.79 V, u max = 4.79 V

(8.22)

with output constraints as in (8.15). The voltage constraints on the ball’s position in (8.15) directly translate to the physical limits of p ∈ [8.18, 9.08] mm , cf. Sect. 8.1. The weighting factors in (7.13a) were chosen as Q ry = 10−2 , Q dw = 10−3 , Q du = 1, Q rw = 0.1, Q wy = 0.1.

(8.23)

8.2 Synthesis of the MPC-Based Reference Governor

99

Once the MPC-based reference governor is structured, it is solved parametrically as reported in Sect. 3.5; hence, we obtain a PWA function in the form of

W  (θ ) =

⎧ ⎪ ⎪ ⎨α1 θ + β1 ⎪ ⎪ ⎩α θ + β nR nR

if θ ∈ R1 .. . if θ ∈ Rn R ,

(8.24)

with polyhedral regions R as in (2.10). The PWA function representing the MPCbased reference governor was obtained via MPT Toolbox [1] in 15 s on a 2.9 GHz Core i7 CPU with 12 GB of RAM. The explicit PWA representation of the optimizer W  (θ ) in (8.24) consisted of n R = 21 critical regions in a seven-dimensional parametric space, cf. (8.20). The MPT toolbox was subsequently used to synthesize the corresponding binary search tree to speed up the evaluation of the PWA function in (8.24). The total memory footprint of the binary tree was 1392 bytes. This number includes both the separating hyperplanes and the parameters of local affine feedback laws αi , βi associated with each critical region. The construction of the tree took 5 s. Particular software and hardware implementation of the MPC-based reference governor on the microprocessor chip can be found in [2].

8.3 Experimental Results Experimental results demonstrating benefits of the MPC-based reference governor are presented in this section. Two experimental scenarios are considered. In both experiments, the sampling time was chosen as Ts = 1 ms. Moreover, the reference was periodically switched between ± 0.2V (±0.18 mm) around the chosen equilibrium s = 1.4 V ( p s = 8.7 mm). point Ups The first experiment concerns controlling the vertical position of the ball solely by the PSD controller (8.12). In this experiment, constraints on the control input were enforced by artificially saturating the control actions. Naturally, the PSD controller provides no a priori guarantee of satisfying the output constraints. The experimental results are shown in Fig. 8.5. As expected, the control inputs of the PSD controller shown in Fig. 8.5b obey the limits on the control action due to the saturation. However, the output constraints are violated, as can be seen in Fig. 8.5a. Moreover, the control profile exhibits significant under- and overshoots during setpoint changes. To improve the performance, in the second experiment the MPC-based reference governor was inserted into the loop. The experimental data are visualized in Fig. 8.6. First and foremost, the reference governor shapes the reference in such a way that constraints on the controlled output (i.e., on the ball’s position) are rigorously enforced, cf. Fig. 8.6a. This is a consequence of accounting for the constraints directly in the optimization problem, cf. (8.18f). Moreover, the under- and overshoots are

100

8 Magnetic Levitation Process 2

y [V]

1.8 1.6 1.4 1.2 1 0.8 0

0.1

0.2

0.3

0.4

0.5

t [s]

(a) Measurement of the position y(t) 5

u [V]

4 3 2 1 0 0

0.1

0.2

0.3

0.4

0.5

t [s]

(b) Control action u(t) Fig. 8.5 Control by the PSD controller only

considerably reduced. This shows the potential of MPC-based reference governors to significantly improve the control performance. The improvement is due to the optimal modulation of the user-defined reference as shown in Fig. 8.6b. As can be observed, just small modifications of the reference are required to significantly improve performance. Finally, as can be observed from Fig. 8.6c, the reference governor shapes the reference in such a way that the inner PSD controller provides the satisfaction of input constraints since they are explicitly embedded in (8.18e). The evaluation of the RG feedback law (8.24), encoded as a binary search tree, took 254 µs on average. The best-case evaluation time was 243 µs while the worst case was 266 µs. These fluctuations are caused by the binary search tree not being perfectly balanced, which is an inherent property of the geometric structure of the parametric solution. As a consequence, different numbers of steps are required to evaluate the tree for different values of the parameter θ in (8.20).

References

101 2

y [V]

1.8 1.6 1.4 1.2 1 0.8 0

0.1

0.2

t [s]

0.3

0.4

0.5

(a) Measurement of the position y(t) 2

w [V]

1.8 1.6 1.4 1.2 1 0.8 0

0.1

0.2

0.3

0.4

0.5

t [s]

(b) Optimally shaped setpoint w(t) 5

u [V]

4 3 2 1 0 0

0.1

0.2

t [s]

0.3

0.4

0.5

(c) Control action u(t) of the PSD controller Fig. 8.6 Control under the reference governor

References 1. Herceg M, Kvasnica M, Jones C, Morari M (2013) Multi-parametric toolbox 3.0. In: 2013 European control conference, pp 502–510 2. Klauˇco M, Kalúz M, Kvasnica M (2017) Real-time implementation of an explicit MPC-based reference governor for control of a magnetic levitation system. Control Eng Pract 99–105. https:// doi.org/10.1016/j.conengprac.2017.01.001 3. Löfberg J (2004) YALMIP : a toolbox for modeling and optimization in MATLAB. In: Proceedings of the CACSD conference, Taipei, Taiwan. http://users.isy.liu.se/johanl/yalmip/

Chapter 9

Thermostatically Controlled Indoor Temperature

9.1 Challenges in Thermal Comfort Control The main reason to study the control approaches in connection with the thermal comfort is to decrease the astronomical energy requirements which goes to the heating, ventilation, and air conditioning (HVAC) systems. It has been reported that almost 40% of the global energy use goes to HVAC systems [12]. Therefore, it is of imminent importance to design such control systems which attain comfortable thermal conditions while minimizing the energy consumption. Several control strategies which aim at achieving such a goal have been proposed in the literature. One of the most promising approaches is represented by model predictive control (MPC), which allows to explicitly account for minimization of the energy consumption while maintaining thermal comfort criteria as presented in [10, 11], and in [3]. Suitability of the MPCbased strategies has been well-documented in several scientific publications [1, 2]. In particular, authors in [14] report that energy savings under MPC outperform those of intelligent thermostats, ranging from 17% in non-insulated buildings up to 28% in insulated ones. When we speak about the thermal comfort, we usually mean the temperature inside an office. Almost all strategies aim to achieve suitable temperature conditions while reducing the energy consumption of the heater or the AC unit. However, keeping the temperature constant does not imply that occupants of the building perceive it as the optimal scenario. In fact, there are other factors which influence perception of the thermal comfort including, but not limited to, the relative air humidity, the air movement, the clothing, or the metabolic rate. Therefore, the so-called predicted mean vote (PMV) index was introduced by [5] as an alternative way of expressing the thermal comfort, standardized in [7]. The PMV index is a complex, nonlinear relation between various building’s parameters and the perceived thermal comfort. The value of the PMV index is dimensionless and its zero value corresponds to the most comfortable conditions. Values between ±1 correspond to slightly cold/warm conditions, PMV = ±2 expresses cool/warm perception, and values above ±3 indicate unpleasantly cold/hot conditions in the building. The intriguing property of the © Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_9

103

104

9 Thermostatically Controlled Indoor Temperature

PMV index is that it can remain constant even if the indoor temperature changes, for instance, when the change of temperature is compensated by the change of air humidity. Since the PMV index is generally viewed as a superior indicator of thermal comfort, various authors have proposed to formulate MPC with the PMV index in mind [1, 2, 8]. Focusing on the PMV index requires also a significant change of the sensor layout, which can be a costly process. One of the aims of this thesis is to provide solutions, which avoid exactly the process of changing the control infrastructure. Therefore, we will look at traditional control setups in residential or office buildings where the temperature measurement is the only variable available to us. In the traditional setups, the entire control scheme consists of a single thermostat connected to central heating system or an AC unit. However, conventional thermostats are considered “dumb” since they base their decisions only on the measurements of the indoor temperature. More recently, socalled “intelligent” thermostats started to attract attention due to their ability to provide thermal comfort while mitigating the energy consumption. Examples include, but are not limited to, Nest,1 Emme2 or Ecobee.3 Compared to conventional thermostats, these advanced solutions provide higher energy savings by applying algorithms which estimate the habits of household’s occupants, especially with respect to occupancy predictions. Although promotional materials of the aforementioned solutions claim a 10%–15% reduction of the cost of heating, independent reports are more skeptical. Specifically, [6] concludes that it is difficult to claim energy savings beyond those obtainable with a conventional programmable thermostat (that has been properly programmed) combined with the provision of energy use information. Results presented in this thesis originate in [4], in which we aim to improve the behavior of the “dumb” thermostat by an MPC-based reference governor strategy. This strategy will provide an optimal setpoint to the thermostat, so the thermal comfort will be maintained while we minimize the overall energy expenditures.

9.2 Mathematical Background The validation of the proposed improvements in control of the indoor temperature involves a simulation study based on a linear-time-invariant model which employs real historical profiles of disturbances. The prediction model was obtained by zeroorder hold discretization of continuous-time model ˜ ˜ ˜ x(t) ˙ = Ax(t) + Bu(t) + Ed(t), T (t) = C x(t). 1 http://www.nest.com. 2 http://www.getemme.com. 3 http://www.ecobee.com.

(9.1a) (9.1b)

9.2 Mathematical Background

105

˜ B, ˜ E, ˜ and C were extracted from the ISE toolbox by [13] The system matrices A, ⎡

⎤ −0.020 0 0 0.020 ⎢ 0 −0.020 0.001 0.020⎥ ⎥ A˜ = 10−3 · ⎢ ⎣ 0 0.001 −0.056 0 ⎦ 1.234 2.987 0 −4.548 ⎡ ⎡ ⎤ ⎤ 0 0 0 0 ⎢ 0 ⎥ ⎢ 0 0 ⎥ ⎥ , E˜ = 10−3 · ⎢ 0 ⎥, B˜ = 10−3 · ⎢ ⎣ 0 ⎦ ⎣0.055 0 0 ⎦ 0.003 0.327 0.003 0.001  C= 0001 .

(9.2a)

(9.2b) (9.2c)

The four state variables are as follows: x1 is the floor temperature, x2 denotes the internal facade temperature, x3 is the external facade temperature, and x4 represents the indoor temperature. All states are in ◦C. The control input u is the heat flow injected into the building, often denoted as q. According to Fig. 5.2, the heat flow is either zero, i.e., u min = 0 W, or equal to u max = qmax = 4000 W. The model features three disturbances: d1 is the external temperature in ◦C, d2 is the heat generated by appliances and by the occupants of the building in W , and d3 is the heat generated by the solar radiation in W. The sampling time of Ts = 2.5 min was used.

9.3 MPC-Based Reference Governor Synthesis The upgrade in the home thermostat system consists of including an MPC-based reference governor. The particular control structure proposed is depicted in Fig. 9.1. To design the MPC-based reference governor, we adopt the control structure from (5.5). The objective function is set to N −1

uk , (9.3) z = k=0

which enforces the minimization of the spent energy to achieve comfortable temperatures inside the room. Naturally, if such a objective function would be used, the MPC-based governor will provide such reference w to the thermostat that the injected heat to the room will be u = 0 W. In the control design for thermal comfort inside residential buildings is standard practice to provide a temperature interval called comfort zone via constraints, i.e., T ∈ {w − θ, w + θ }. Hence, we will change the constraint (5.5e) to (9.4) w − θ ≤ Tk ≤ w + θ. Furthermore, we extend the prediction model in (5.5b) by state disturbances as suggested in (9.1). Finally, we modify the thermostat control law given by (5.5f) to

106

9 Thermostatically Controlled Indoor Temperature

Fig. 9.1 Reference governor scheme with a relay-based controller

r d

Reference Governor x

w

Relay

q

Building

T

inner loop

qmax if z = 1 u= 0 if z = 0.

(9.5)

Since the variable u min = 0, then the logic rule in (9.5) can be directly translated to u = zqmax ,

(9.6)

hence, the part of the MIP (5.24d)–(5.24g) will boil down to (9.6). After these particular modifications, the final structure of the MPC-based reference governor in the form on the optimal control problem is given as min

w0 ,...,w N −1

N −1

uk

(9.7a)

k=0

s.t.xk+1 = Axk + Bu k + Edk ,

(9.7b)

Tk = C xk r − θ ≤ Tk ≤ r + θ, u k = qmax z k ,

(9.7c) (9.7d) (9.7e)

wk + γ − Tk ≤ Ma (1 − δa,k ), wk + γ − Tk ≥ ε + (m a − ε)δa,k ,

(9.7f) (9.7g)

Tk − wk + γ ≤ Mb (1 − δb,k ), Tk − wk + γ ≥ ε + (m b − ε)δb,k ,

(9.7h) (9.7i)

δ1,k ≤ z k , δ1,k ≤ (1 − δa,k ), z k + (1 − δa,k ) ≤ 1 + δ1,k ,

(9.7j) (9.7k) (9.7l)

δ2,k ≤ (1 − z k ),

(9.7m)

9.3 MPC-Based Reference Governor Synthesis

107

δ2,k ≤ δb,k ,

(9.7n)

(1 − z k ) + δb,k ≤ 1 + δ2,k , δ3,k ≥ δ1,k , δ3,k ≥ δ2,k ,

(9.7o) (9.7p) (9.7q)

δ3,k ≤ δ1,k + δ2,k , z k+1 = δ3,k .

(9.7r) (9.7s)

With the decision variables xk , Tk , wk , u k , all of which are continuous, along with binary variables δa,k , δb,k , δ1,k , δ2,k , δ3,k , and z k . We remind that for the index k holds k = {0, . . . , N − 1}. Note that all constraints in (9.7) are linear in the decision variables. Moreover, the objective function (9.7a) is also linear, hence the problem (9.7) can be solved as a mixed-integer linear program. Scalars Ma , m a , Mb , Mb are chosen with respect to the Lemma 5.1. The closed-loop implementation (see Fig. 9.1) of the proposed reference governor strategy is characterized by the following steps: 1. Measure (or estimate) current values x(t) of the state variables of the building’s thermal model in (9.1) and current disturbances d(t). 2. Create an instance of (9.7) with x0 = x(t) and d0 = d(t). 3. Solve (9.7) using a MILP solver and obtain w0 , . . . , wN −1 . 4. Communicate w0 to the relay-based thermostat as its setpoint. 5. Repeat at the next sampling instant from Step 1. The MILP (9.7) can be formulated in Matlab using YALMIP [9] and solved by GUROBI, CPLEX of MOSEK.

9.4 Performance Comparison The first simulation study concerns a 1 h window from 7:00 to 8:00 on the first day for which the disturbance profile can be seen in Fig. 9.2. First, the building was controlled purely by the relay-based thermostat whose setpoint is constantly set to r = w = 21◦ C. The profile of the indoor temperature can be seen in Fig. 9.3a. The thermostat switches on and off according to the rules presented in Sect. 5.2. Throughout the 1 h window, the thermostat stays in the “on” state for 22.5 min and consumes 1.5 kW h of electricity overall, as can be seen in Fig. 9.3b. Subsequently, the reference governor was enabled and implemented according to Sect. 9.3. The simulation results are reported in Fig. 9.4. As can be seen, the reference governor modulates the reference in such a way that it allows the thermostat to keep the indoor temperature close to the r − θ boundary of the thermal comfort zone. As a consequence, less heating energy is required to satisfy the thermal comfort constraint (9.4), cf. Fig. 9.4c. Specifically, under the optimally modulated setpoint in Fig. 9.4b, the thermostat stays in the “on” state for 12.5 min and consumes 0.83 kW h of energy, hence providing significant reduction of energy consumption compared to the conventional thermostat.

108

9 Thermostatically Controlled Indoor Temperature 12

d1 [◦C]

9 6 3 0 0

1

2

3

4

Time [days]

5

6

7

6

7

6

7

(a) External temperature.

d2 [kW]

0.5

0.25

0 0

1

2

3

4

Time [days]

5

(b) Heat generated by occupancy.

d3 [kW]

1.5 1 0.5 0 0

1

2

3

4

Time [days]

5

(c) Heat due to solar radiation. Fig. 9.2 7-day disturbance profiles

The second scenario concerns a 7-day window with disturbance profiles as in Fig. 9.2. The objective here is to assess performance of the proposed strategy over a longer time span. We have performed closed-loop simulations for two cases. In the first one, the building was controlled solely by the thermostat whose setpoint was constantly w = 21 ◦C. Then, the reference governor was enabled and the simulation was repeated. Performance of both strategies is assessed by measuring the time the

9.4 Performance Comparison

109

22

T [◦C]

21.5 21 20.5 20 07:00

07:15

07:30

07:45

8:00

Time [h]

(a) Indoor temperature (blue) and the setpoint (green).

z

1

0 07:00

07:15

07:30

07:45

8:00

Time [h]

(b) Thermostat on/off state. Fig. 9.3 Indoor temperature controlled only by the thermostat

heater stays on, i.e., delivering q = qmax power. Daily savings of energy consumption obtained by modulating the reference in an optimal fashion allow to save between 9 and 17% of energy, as reported in Fig. 9.5.

9.5 Concluding Remarks This chapter presented a design on the MPC-based governor to improve the behavior of conventional thermostats. The supervising controller was designed by taking into account the switching dynamics of the thermostat as well as approximation of the thermal dynamics of the single-zone building. We have shown the transformation of the MPC-like design to the MILP.

110

9 Thermostatically Controlled Indoor Temperature 22

T [◦C]

21.5 21 20.5 20 07:00

07:15

07:30

07:45

8:00

Time [h]

(a) Indoor temperature (blue) and user-specified setpoint (green).

r [◦C]

22

20 07:00

07:15

07:30

07:45

8:00

Time [h]

(b) Modulated setpoint r.

z

1

0 07:00

07:15

07:30

07:45

8:00

Time [h]

(c) Thermostat on/off state. Fig. 9.4 Indoor temperature controlled by a thermostat with the setpoint optimally modulated by the reference governor

9.5 Concluding Remarks

111

Savings [%]

20 15 10 5 0 1

2

3

4

5

6

7

Day Number Fig. 9.5 Energy savings overview

References 1. Castilla M, Álvarez J, Berenguel M, Rodríguez F, Guzmán J, Pérez M (2011) A comparison of thermal comfort predictive control strategies. Energy Build 43(10):2737–2746. https://doi.org/10.1016/j.enbuild.2011.06.030, http://www.sciencedirect.com/science/article/ pii/S0378778811002799 2. Cigler J, Prívara S, Váˇna Z, Žáˇceková E, Ferkl L (2012) Optimization of predicted mean vote index within model predictive control framework: computationally tractable solution. Energy Build 52(0):39–49. https://doi.org/10.1016/j.enbuild.2012.05.022, http://www.sciencedirect. com/science/article/pii/S0378778812002770 3. Drgoˇna J, Kvasnica M, Klauˇco M, Fikar M (2013) Explicit stochastic mpc approach to building temperature control. In: IEEE Conference on Decision and Control, Florence, Italy, pp 6440– 6445 4. Drgoˇna J, Klauˇco M, Kvasnica M (2015) MPC-based reference governors for thermostatically controlled residential buildings. In: 54th IEEE Conference on Decision and Control, Osaka, Japan, vol 54 5. Fanger P (1970) Thermal comfort: analysis and applications in environmental engineering 6. Herter K (2010) Small business demand response with communicating thermostats: smud’s summer solutions research pilot. Lawrence Berkeley National Laboratory 7. ISO (2006) EN ISO 7730:2006: ergonomics of the thermal environment - analytical determination and interpretation of using calculation of the PMV and PPD indices and local thermal comfort criteria. ISO, Geneva, Switzerland 8. Klauˇco M, Kvasnica M (2014) Explicit mpc approach to pmv-based thermal comfort control. In: 53rd IEEE Conference on Decision and Control, Los Angeles, California, USA, vol 53, pp 4856–4861 9. Löfberg J (2004) YALMIP : a toolbox for modeling and optimization in MATLAB. In: Proceedings of the CACSD conference, Taipei, Taiwan. http://users.isy.liu.se/johanl/yalmip/ 10. Ma Y, Borrelli F, Hencey B, Coffey B, Bengea S, Haves P (2012) Model predictive control for the operation of building cooling systems. IEEE Trans Control Syst Technol 20(3):796–803 11. Oldewurtel F, Parisio A, Jones C, Gyalistras D, Gwerder M, Stauch V, Lehmann B, Morari M (2012) Use of model predictive control and weather forecasts for energy efficient building climate control. Energy Build 45:15–27

112

9 Thermostatically Controlled Indoor Temperature

12. Parry M, Canziani O, Palutikof J, van der Linden P, Hanson C (2007) Climate change 2007: impacts, adaptation and vulnerability. Intergovernmental panel on climate change 13. van Schijndel A (2005) Integrated heat, air and moisture modeling and simulation in hamlab. In: IEA Annex 41 working meeting, Montreal 14. Široký J, Oldewurtel F, Cigler J, Prívara S (2011) Experimental analysis of model predictive control for an energy efficient building heating system. Appl Energy 88(9):3079–3087. https:// doi.org/10.1016/j.apenergy.2011.03.009

Chapter 10

Cascade MPC of Chemical Reactors

10.1 Plant Description and Control Objectives We consider a plant consisting of two continuously stirred tank reactors (CSTR) and a separator in a parallel arrangement connected with product streams. Inlet streams Ff1 and Ff2 , of pure reactant A, are fed to each reactor, respectively. In the first kA

CSTR, a first-order irreversible reaction A − → B takes place to produce the desired product B. Simultaneously, in the second CSTR, the product B is lost by another kB

→ C to create a side product C. The parallel irreversible first-order reaction B − product from the first CSTR is fed into the second tank reactor. The products from the second reactor are directed to the separator. Here, the product stream is split into two outlets, the final product FD and the partial recycle flow FR . The stream FR is fully condensed and returned to the first reactor 1. It is assumed that the volatility of the component A is much higher than that of the product B and the product C, i.e., we consider α A  α B > αC . Therefore, the majority of both products is concentrated in the downstream of the separator F3 , while the distillate is rich in component A. Moreover, each tank and the separator can be heated with heating rods Q 1,2,3 , respectively. The control scheme of the cascade arrangement of the reactors and the separator is shown in Fig. 10.1. The controlled system used in this book is similar to the benchmark system given by [6]. Such a complex chemical process plant has been widely used as a benchmark model for a wide range of control approaches. Several of those scientific works include the design of distributed MPC [1, 3] or heuristic approach to the coordinated control [4, 5]. To provide concise and complete information regarding the benchmark model, we review the mathematical modeling and introduce coupling constraints, which were not considered in mentioned control approaches.

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_10

113

114

10 Cascade MPC of Chemical Reactors

FD

FR

Ff1

Ff2 H3

H1

H2

Q1

F3

F2

F1 Q2

Q3

Fig. 10.1 Controlled system composed of two CSTR with separator and recycle is similar to [6]

10.1.1 Mathematical Model of the Plant The mathematical model of the plant is combined from the individual models of the continuous stirred tank reactors and the model of the separator. Individual parameters of the entire system are reported in Table 10.1. The dynamics of the CSTR is captured by 4 states that include the level of the liquid inside the tank, denoted by H , the concentration of substances A and B, denoted by xA and xB , and with the temperature of the mixture inside the reactor T . Controlled variables are the state variables, while the manipulated variables are flow rates Ff,1 and FR and the heating provided by heating rod Q. Specifically, we define the model as follows: dH1 dt dx A1 dt dxB1 dt dT1 dt

1 (Ff1 + FR − F1 ), ρ A1 1 = (Ff1 xA0 + FR x A R − F1 xA1 ) − kA1 xA1 , ρ A1 H1 1 = (Ff1 xB0 + FR xBR − F1 xB1 ) + kA1 xA1 − kB1 xB1 , ρ A1 H1 1 = (Ff1 T0 + FR TR − F1 T1 )− ρ A1 H1 Q1 1 (kA1 xA1 ΔHA + kB1 xB1 ΔHB ) + . − Cp ρ A1 Cp H1 =

(10.1a) (10.1b) (10.1c)

(10.1d)

The second tank is represented by the same set of equations as the first CSTR (10.1), except all components related to the recycle stream are removed. The model of the second continuously stirred tank reactor is

10.1 Plant Description and Control Objectives

dH2 dt dxA2 dt dxB2 dt dT2 dt

115

1 (Ff2 + F1 − F2 ), ρ A2 1 = (Ff2 xA0 + F1 xA1 − F2 xA2 ) − kA2 xA2 , ρ A2 H2 1 = (Ff2 xB0 + F1 xB1 − F2 xB2 ) + kA2 xA2 − kB2 xB2 , ρ A2 H2 1 = (Ff2 T0 + F1 T1 − F2 T2 )− ρ A2 H2 Q2 1 (kA2 xA2 ΔHA + kB2 xB2 ΔHB ) + . − Cp ρ A2 Cp H2 =

(10.2a) (10.2b) (10.2c)

(10.2d)

Finally, the model of the separator is obtained by considering simple mass balances and enthalpy balances that exclude the chemical reaction components, hence dH3 dt dxA3 dt dxB3 dt dT3 dt

1 (F2 − F3 − FD − FR ), ρ A3 1 = (F2 xA2 − F3 xA3 − (FD + FR )xAR ), ρ A3 H3 1 = (F2 xB2 − F3 xB3 − (FD + FR )xBR ), ρ A3 H3 1 Q3 = (F2 T2 − F3 T3 − (FD + FR )TR ) + , ρ A3 H3 ρ A3 Cp H3 =

(10.3a) (10.3b) (10.3c) (10.3d)

where α A AxA3 , α A AxA3 + α B BxB3 + αC CxC3 α B BxB3 = , α A AxA3 + α B BxB3 + αC CxC3 = (1 − xA3 − xB3 ).

xAR =

(10.4a)

xBR

(10.4b)

xC3

(10.4c)

The dynamics of the separator also features 4 states and 3 manipulated variables. For each subsystem i ∈ N31 , the downstream flow rate is given by Fi = kvi



Hi

(10.5)

and the Arrhenius equations for reactants A and B are kAi

    EA EB , kBi = exp − . = exp − RTi RTi

For simplicity, the following assumptions are considered:

(10.6)

116

10 Cascade MPC of Chemical Reactors

1. We assume liquid density ρ and heat capacity Cp to be constant for the entire system. 2. Both inlet streams consist only of pure reactant A, i.e., xA0 = 1 and xB0 = 0. 3. The system (10.1)–(10.3) does not include material balance of the product C. This value can be implicitly computed via (10.4c). 4. The distillate is separated with constant ratio FD = 0.01FR , fully condensates, and preserves its temperature, i.e., T3 = TR . With the aforementioned assumptions, the system (10.1)–(10.3) was linearized around its steady state, defined in Table 10.1. Based on the first-order Taylor expansion linearization, and subsequent discretization with sample rate, Ts = 0.5 s. The final discrete-time linear time-invariant system is given by x(t + Ts ) = Ax(t) + Bu(t), y(t) = x(t),

(10.7a) (10.7b)

where the system states x ∈ R12 , outputs y ∈ R12 , and inputs u ∈ R6 are given as follows. The partial state vector corresponding to the ith component of the plant is given as ⎤ ⎡ Hi (t) ⎢xAi (t)⎥ ⎥ (10.8) xi (t) = ⎢ ⎣ xBi (t)⎦ , Ti (t) while the partial control vector is expressed as u i (t) =

Ffi , Qi

(10.9)

and finally the output is expressed as yi (t) = xi (t). Then, the aggregated vectors corresponding to plants state space model are given as ⎡

⎤ x1 (t) x(t) = ⎣x2 (t)⎦ , x3 (t) ⎡ ⎤ u 1 (t) u(t) = ⎣u 2 (t)⎦ . u 3 (t)

(10.10a)

(10.10b)

The control objective is to manipulate inputs u i (t) such that controlled outputs yi (t) will track the user-specified reference as closely as possible. Moreover, the controller has to satisfy input constraints that are defined in Table 10.2. To achieve this, three different control approaches are considered in this case study. A centralized approach, where the entire system is controlled by one complex MPC strategy. A decentralized approach, where each subsystem, i.e., each CSTR and the separator

10.1 Plant Description and Control Objectives

117

Table 10.1 Process parameters and steady states Parameter Value Units Parameters

Value

Units

m

A1

3.000

m2

0.7834

wt(%)

A2

3.000

m2

0.2110

wt(%)

A3

1.000

m2

314.054

K

ρ

0.150

kg m−3

38.440

m

Cp

25.000

kJ kg−1 K−1

0.685

wt(%)

kv1

2.500

kg m−0.5 s−1

0.304

wt(%)

kv2

2.500

kg m−0.5 s−1

314.225

K

kv3

2.500

kg m−0.5 s−1

4.666

m

xA0

1.000

wt(%)

0.3779

wt(%)

T0

313.000

0.5963

wt(%)

kA

0.100

s−1

K

kB

0.010

s−1

5.000

kg s−1

E A /R

−100.000

K

10.000

kJ s−1

E B /R

−150.000

K

0.500

kg s−1

ΔHA

−40.000

kJ kg−1

10.000

kJ s−1

ΔHB

−50.000

kJ kg−1

66.200

kg s−1

αA

10.000



10.000

kJ s−1

αB αC

1.100 0.500

− −

36.000 H1 xA1 xB1 T1 H2 xA2 xB2 T2 H3

K

xA3 xB3 314.251 T3 Ff1 Q1 Ff2 Q2 FR Q3

are controlled by their own inner MPC policy. The third control scheme is the reference governor, where a higher level MPC strategy coordinates with inner MPCs via manipulation of their references. To design the decentralized control scheme, we partition the system (10.1)–(10.3) into three separate subsystems by defining the following output–input pairs:

118

10 Cascade MPC of Chemical Reactors

Table 10.2 Input constraints of the system Parameter Lower boundary Steady state Ff1 Q1 Ff2 Q2 FR Q3

0.0 0.0 0.0 0.0 0.0 0.0

5.0 10.0 0.5 10.0 10.0 10.0

Upper boundary

Units

7.0 50.0 2.0 50.0 11.0 50.0

kg s−1 kJ s−1 kg s−1 kJ s−1 kg s−1 kJ s−1

 

y1 (t) = H1 (t) xA1 (t) xB1 (t) T1 (t) , u 1 (t) = Ff1 (t) Q 1 (t) ,  

y2 (t) = H2 (t) xA2 (t) xB2 (t) T2 (t) , u 2 (t) = Ff2 (t) Q 2 (t) ,  

y3 (t) = H3 (t) xA3 (t) xB3 (t) T3 (t) , u 3 (t) = FR (t) Q 3 (t) .

(10.11a) (10.11b) (10.11c)

Based on the dynamics in (10.1)–(10.3), we can notice that each subsystem is coupled by its successor, i.e., the ith subsystem interacts with the (i + 1)th subsystem. In order to take these dynamics into account, we define additional variables 

c1 (t) = FR (t − Ts ) xA3 (t) xB3 (t) T3 (t) ,

(10.12a)

c2 (t) = y1 (t), c3 (t) = y2 (t),

(10.12b) (10.12c)

where FR (t − Ts ) denotes the flow rate of recycle at the previous sampling instant. Distributed models of each individual subsystem are then given by xi (t + Ts ) = Ai xi (t) + Bi u i (t) + E i ci (t),

i ∈ N31 ,

(10.13a)

N31 , N31 ,

(10.13b)

ci (t + Ts ) = ci (t),

i∈

yi (t) = xi (t),

i∈

(10.13c)

where E i denotes coupling matrix. Remember that the coupling matrix E i does not have the same properties as the matrix E x in the disturbance modeling approach (3.21a). Here, the matrix E i couples partitioned systems together, and values in ci are known, compared to the case for the matrix E x , which corresponds to unmeasured disturbances. Particularly, the corresponding parts of matrices of (10.13) are given

10.1 Plant Description and Control Objectives



−0.4630 0.0000 0.0000 ⎢−0.0131 −1.0634 0.0000 A1 = ⎢ ⎣ 0.0002 0.1375 −0.9420 −4.0338 0.2200 0.0322 ⎡ ⎤ 2.2222 0.0000 ⎢ 0.0617 0.0000⎥ ⎥ B1 = ⎢ ⎣ 0.0000 0.0000⎦ , 19.3210 0.0025 ⎡ 0.0000 0.0000 0.0000 ⎢ 0.0000 0.2677 −0.0708 E1 = ⎢ ⎣ 0.0000 −0.1945 0.1404 0.0000 0.0000 0.0000

119

⎤ 0.0000 0.0001 ⎥ ⎥, −0.0001⎦ −0.9261

(10.14a)

(10.14b) ⎤ 0.0000 0.0000⎥ ⎥ 0.0000⎦ 0.6173

(10.14c)



⎤ −0.4480 0.0000 0.0000 0.0000 ⎢−0.0104 −1.0335 0.0000 0.0001 ⎥ ⎥ A2 = ⎢ ⎣−0.0012 0.1375 −0.9122 −0.0001⎦ , −3.6582 0.2200 0.0322 −0.8962 ⎡ ⎤ 2.2222 0.0000 ⎢ 0.0578 0.0000⎥ ⎥ B2 = ⎢ ⎣ 0.0000 0.0000⎦ , 18.0946 0.0023 ⎡ ⎤ 0.4630 0.0000 0.0000 0.0000 ⎢0.0094 0.8672 0.0000 0.0000⎥ ⎥ E2 = ⎢ ⎣0.0025 0.0000 0.8672 0.0000⎦ 3.7824 0.0000 0.0000 0.8672

(10.15a)

(10.15b)

(10.15c)



⎤ −3.8580 0.0000 0.0000 0.0000 ⎢ −0.3125 −13.9743 1.6542 0.0000 ⎥ ⎥, A3 = ⎢ ⎣ −0.4931 4.5463 −10.9983 0.0000 ⎦ −259.8566 0.0000 0.0000 −22.1479 ⎡ ⎤ −6.7333 0.0000 ⎢ −1.2262 0.0000⎥ ⎥ B3 = ⎢ ⎣ −0.2128 0.0000⎦ , −453.5225 0.0572 ⎡ ⎤ 1.3441 0.0000 0.0000 0.0000 ⎢ 0.1974 22.1479 0.0000 0.0000 ⎥ ⎥ E3 = ⎢ ⎣ 0.0875 0.0000 22.1479 0.0000 ⎦ . 90.5233 0.0000 0.0000 22.1479

(10.16a)

(10.16b)

(10.16c)

120

10 Cascade MPC of Chemical Reactors

Models (10.13) were derived by considering respective differential equations in (10.1)–(10.3) and setting all remaining input–output variables to their steady values. For instance, the first subsystem is defined by (10.1), where input–output variables of the second and third subsystem, i.e. (10.11b)–(10.11c), are replaced by their respective steady values defined in Table 10.1. Each subsystem was then linearized and discretized with Ts = 0.5 s. This way, system matrices Ai and Bi were devised. The coupling matrices E i were derived with the same procedure, but by considering coupling variables (10.12) instead of input–output pairs (10.11). The control objectives of this case study are divided into three parts. The first approach is a centralized control scheme, which aims to control the entire process via a single MPC feedback law. The advantage of this scheme is the ability to include entire system dynamics as well as coupling constraints directly into the optimization problem, thus achieving a well-performing controller. On the other hand, common industrial practice indicates that primary controller infrastructure cannot be changed. Hence, this serves only as a baseline comparison. The control objective is to manipulate the inputs (10.9) to attain the desired operation of the system that is given by a specific reference value. The controller has to satisfy input constraints that are defined in Table 10.2. The second approach, called the decentralized approach, is the approach of the common industrial practice, where the local MPCs are tuned in some way. This is also the case of the results presented in the paper [6], which aimed to coordinate three separate MPC strategies to improve the overall performance. The third approach, the MPC-based reference governor design, takes advantage of rigorously formulated optimal control problem that includes the behavior of the local MPCs, which are, at the end of the day, still present in the control hierarchy.

10.2 Synthesis of Local MPCs Let us consider M linear-time-invariant subsystems that are given in state space formulation xi (t + Ts ) = Ai xi (t) + Bi u i (t) + E i ci (t), i ∈ N1M , yi (t) = Ci xi (t) + Di u i (t), i ∈

N1M ,

(10.17a) (10.17b)

where xi ∈ Rn x,i , u i ∈ Rn u,i , yi ∈ Rn y,i and ci ∈ Rn c,i are state, input, output, and coupling vectors of the ith subsystem at discrete time t, respectively. We assume that all subsystems are constrained by local polyhedra as xi ∈ Xi ⊆ Rn x,i , u i ∈ Ui ⊆ Rn u,i , yi ∈ Yi ⊆ Rn y,i ,

(10.18)

that are enforced for all i ∈ N1M . Furthermore, we consider coupling polyhedral constraints between each subsystem represented by

10.2 Synthesis of Local MPCs

121

(x1 , . . . , x M ) ∈ X ⊆ X1 × · · · × X M ⊆ Rn x ,

(10.19a)

nu

(u 1 , . . . , u M ) ∈ U ⊆ U1 × · · · × U M ⊆ R ,

(10.19b)

(y1 , . . . , y M ) ∈ Y ⊆ Y1 × · · · × Y M ⊆ Rn y ,

(10.19c)

where n x = n x,1 + · · · + n x,M , n u = n u,1 + · · · + n u,M , and n y = n y,1 + · · · + n y,M represent total number of state, input, and output variables. Recall that (10.19) is a compact representation of coupling constraints presented in (6.3) and (6.4). Note that coupling variables ci are given as a combination of xi and u i , respectively. Therefore, they are implicitly included in (10.19). We assume that the ith subsystem is controlled by an MPC feedback policy similar to the offset-free formulation given by (3.22), extended with the coupling variables. Specifically, we consider Ui = arg min N,i (x Ni ) +

N −1 

  ss,i xi,k , yi,k , u i,k

(10.20a)

k=0

s.t. xi,k+1 = Ai xi,k + Bi u i,k + E i ci (t),k ∈ N0Ni −1 , yi,k = Ci xi,k + Di u i,k + di (t), xi,k ∈ Xi ,

k∈

N0Ni −1 ,

(10.20b) (10.20c) (10.20d)

u i,k ∈ Ui , yi,k ∈ Yi ,

(10.20e) (10.20f)

xi,N ∈ XN,i , xi,0 = xi (t), u i,−1 = u i (t − Ts ),

(10.20g) (10.20h)

where Ui is the optimal sequence of control actions over the prediction horizon Ni defined per (6.9). Furthermore, the MPC (10.20) is extended with the disturbance modeling approach as described in Sect. 3.3. The structure of the cost function (10.20a) is the same as in (3.20),i.e., ss (xk , yk , u k ) = Q ry (rk − yk ) 2 + Q u (Δu k ) 2 .

(10.21)

The optimization problem (10.20) is initialized in (10.20h) with a vector ⎡

⎤ xi (t) ⎢ ci (t) ⎥ ⎢ ⎥ ⎥ θi (t) = ⎢ ⎢ di (t) ⎥ , ⎣u i (t − Ts )⎦ wi (t)

(10.22)

where xi (t) is the state measurement, its estimate ci (t) is the coupling vector, di (t) is the estimate of an unmeasured plant–model mismatch disturbance, u i (t − Ts ) is the previous control action, and wi (t) is the output reference. Note that we utilize the

122

10 Cascade MPC of Chemical Reactors

disturbance modeling in the MPC design to enforce offset-free reference tracking as suggested in Sect. 3.3. To ease the notation, we enclose the optimization problem in (10.20) to (10.23) Ui = MPCi (θi (t)). Recall that the actual control input applied to the system is extracted from (10.23), per (6.8), i.e.,  = Φi MPCi (θi (t)). (10.24) u i,0 It is assumed that these controllers MPCi (θi (t)) provide satisfaction only to the constraints in (10.18). Hence, the coupling constraints (10.19) are not enforced in a systematic manner. Naturally, the tuning of the local MPCs can be of such quality that the constraints are enforced. Remark 10.1 Depending on the choice of the norm in the objective function (10.20), the optimization problem becomes a linear problem, if p ∈ {1, ∞} or a quadratic optimization problem if p = 2. Note that all constraints are linear, as specified in (10.18).  Remark 10.2 Selection of the norm has a great impact on the control performance as well as on the complexity of the MPC optimization problem. Concretely, if the Euclidean norm, i.e., p = 2, is chosen, then the number of decision variables is n u,i and the number of constraints is strictly given by (10.20b)–(10.20h). If the 1-norm is selected in (10.20), then each penalized term is rewritten by an epigraph formulation. This leads to introducing an additional (Ni (n y,i + n u,i ) + n x,i ) decision variables and twice as many constraints. If the ∞-norm is chosen in (10.20), then the same reformulation is performed and additional (2Ni + 1) decision variables and twice as many constraints are added to the optimization problem [2]. 

10.3 Synthesis of the MPC-Based Reference Governor We aim to design a centralized MPC-based reference governor controller that provides optimal setpoints wi (t) to each individual local MPC policy such that satisfaction of both local constraints (10.18) and coupling constraints (10.19) is enforced. Moreover, it is desired that all controlled outputs yi track the user-defined reference trajectory ⎡ ⎤ r1 ⎢ .. ⎥ (10.25) r =⎣ . ⎦ rM as closely as possible. Such a control scheme is depicted in Fig. 6.1. Here, the inner layer is represented by M subsystems (10.13) that are controlled by the given feedback law MPCi (θi (t)). The outer layer represents the MPC-based reference

10.3 Synthesis of the MPC-Based Reference Governor

123

governor strategy. In the sequel, we define a formulation of this outer layer controller, i.e., an optimization problem of the MPC-based reference governor. The MPC-based reference governor strategy optimizes a vector of references wi (t) that enters into each inner controller MPCi (θi (t)) as a parameter, i.e., wi (t) ∈ θi (t). The optimization is performed w.r.t. the output tracking error and penalization of the fluctuations of the shaped setpoints, hence the objective functions are constructed similar to (6.13), specifically,       M,i ri, j , yi, j , wi, j = Q y,i ri, j − yi, j 2 + Q w, j wi, j − wi, j−1 2 . (10.26) To determine the optimal shape of the setpoints wi (t), we propose to solve optimal control problem based on (6.12a), namely

min

M N  

W1,...,M ,U1,...,M

  M,i ri, j , yi, j , wi, j ,

(10.27a)

j=0 i=1

s.t. Ui, j (θi, j ) = arg min N,i (x Ni ) +

N −1 

  ss,i xi, j , yi, j , u i, j

(10.27b)

k=0

s.t. xi, j+1 = Ai xi, j + Bi u i, j + E i ci (t), yi,k = Ci xi, j + Di u i,k + E x,i di,k u i, j ∈ Ui xi, j ∈ Xi yi, j ∈ Yi xi,N ∈ XN,i ⎤ ⎡  ΦU1, j (θ1, j ) ⎥ ⎢ .. u j = ⎣ ⎦, .  ΦU M, j (θ M, j ) x j+1 = Ax j + Bu j , y j = Cx j +

Du j ,

(10.27c) (10.27d) (10.27e)

xj ∈ X

(10.27f)

u j

∈ U,

(10.27g)

y j ∈ Y,

(10.27h)

x 0 = x(t), w−1 = w(t − Ts ),

(10.27i)

where all constraints (10.27b)–(10.27h) are enforced for i ∈ N1M and for j ∈ N0N . Next, A, B, C, and D are the state space matrices of the aggregated linear system from (10.7). More details of the formulation of (10.27) can be found in Chap. 6.

124

10 Cascade MPC of Chemical Reactors

The specific implementation of the MPC-based reference governor in this case is reported as follows: 1. Obtain user-specified references ri , 2. Measure and estimate the state and disturbance vectors,  = u i (t − Ts ) and solve (10.27) to obtain the vector of 3. Select xi,0 = xi (t), u i,−1  , optimally shaped references wi,0  4. Provide the vector wi,0 as the reference to local MPC strategies MPCi (θi,0 ) as part of the vector θi,0 , 5. Repeat this procedure from the beginning at the next sample instant, i.e., at time t + Ts . The proposed algorithm can be initialized at time t = 0 by an arbitrary previous control action u i,−1 ∈ Ui , while the previous shaped reference can be chosen, e.g.,  = ri (t). as wi,−1 Notice that in order to calculate the optimally shaped references w from (10.27), we aim to send to each local MPC controller, and one needs to solve M inner optimization problems (10.27b). Therefore, the presented reference governor scheme in (10.27) is formulated as a bilevel optimization problem, which is non-convex and thus difficult to solve. The bilevel optimal control problem will be reformulated according to Sect. 6.3.

10.4 Case Study In this section, we implement proposed theoretical results in the multistage chemical reactor system that is described in Sect. 10.1. First, we introduce a centralized control approach, where the entire plant is controlled with a single MPC policy. Second, we apply a heuristic local MPC coordination control scheme, which is done following the approach of [6]. Finally, we compare the original approaches with the optimal coordination scheme enforced by employing the MPC-based reference governor (10.27).

10.4.1 Centralized Control In the centralized control approach, we aim to control the entire system with one, yet complex, MPC controller as in (10.20). Such control scheme is depicted in Fig. 6.1 in Chap. 6 (Fig. 10.2). To design this controller, first, we extend the model in (10.7) by the disturbance modeling approach (3.21), namely

10.4 Case Study

125 u1,0

CSTR1

y1

r ui,0

u2,0

MPC

CSTR2

u3,0

Separator

xˆi , dˆi

y2

y

y3

Kalman Filter

Fig. 10.2 Control scheme with centralized MPC

x(t + Ts ) = Ax(t) + Bu(t), y(t) = x(t) + d(t), d(t + Ts ) = d(t),

(10.28a) (10.28b) (10.28c)

where d(t) ∈ Rn x denotes the vector of output disturbances, the dynamics of which is constant. To observe state x(t) and disturbance d(t) vectors of the model (10.28), a Kalman Filter is design as follows:   x(t) ˆ x(t ˆ + Ts ) A 0 B + = u(t) + K (t) y(t) − yˆ (t) , ˆ ˆ 0 In y d(t) 0 d(t + Ts )    









(10.29a)



 x(t) ˆ , yˆ (t) = In x In x ˆ    d(t)

(10.29b)





K (t + Ts ) = (A P(t)A + Q ky ) ((A P(t)A + Q ky ) + Q ku )−1 ,

P(t + Ts ) = (In x − K (t + Ts ))(A P(t)A + Q ky ),

(10.29c) (10.29d)

with weighting matrices Q ky ∈ R2n x ×2n x and Q ku ∈ Rn x ×n x . Observed states x(t) ˆ ∈ nx nx ˆ R and disturbances d(t) ∈ R are updated in (10.29a). The observer gain K (t) ∈ R2n x ×n x and the covariance matrix P(t) ∈ R2n x ×2n x are updated in (10.29c) and (10.29d), respectively. We set the tuning matrices as follows: Qx 0 , Q= 0 Qd

Q x = 10 I12 ,

Q d = 103 I12 , R = I6 .

(10.30)

126

10 Cascade MPC of Chemical Reactors

The Kalman Filter was initialized with P(0) = 10 I24 and K (0) as a solution of the discrete-time Riccati equation, i.e., via solving ˆ (0)Cˆ (Cˆ K (0)Cˆ + In x )−1 Cˆ K (0) Aˆ + Q ky = 0. ˆ (0) Aˆ − K (0) − AK AK (10.31) Finally, with augmented model (10.28) and observer (10.29) in hand, the centralized MPC strategy (10.20) is constructed with weighting matrices Q y = diag(10−1 , 10−4 , 10−4 , 10−4 , 10−1 , 10−4 , 10−4 , 10−4 , 10−1 , 10−4 , 103 , 10−4 ), Q u = I6 ,

prediction horizon N = 4, and input boundaries u min , u max as in Table 10.2. The state vector x remained unconstrained. Notice that based on the chosen matrix Q y , the control objective is targeted a priori to attain desired liquid levels H1 , H2 and H3 as well as the concentration of the product B, i.e., xB3 , in the downstream F3 . Moreover, we have to emphasize that by normalizing the state variables x, the chosen weight matrices on H2 , H3 and xB3 are greater only up to two orders of magnitude.

10.4.2 Decentralized Control Each distributed subsystem, see Fig. 10.3, was controlled by its local MPC policy (10.20) with prediction model (10.13), output weighting matrices Q y,1 = Q y,2 = diag(10−1 , 10−4 , 10−4 , 10−4 ), Q y,3 = diag(10−1 , 10−4 , 103 , 10−4 ), input weighting matrices Q u,i = I4 , and the prediction horizon Ni = 4, ∀i ∈ N31 . Notice that weighting matrices were set such that the same control emphasis on H1 , H2 , H3 , and xB3 was as preserved as in the centralized control scheme. Such devised MPC strategy is initialized by the parameter vector  ) ∈ R18 , θi (t) = (xˆi (t), cˆi (t), dˆi (t), u i (t − Ts ), wi,0

(10.33)

where xˆi (t), dˆi (t) denote estimated vectors of states and disturbances, respectively, of the ith subsystem. The vector of coupling variables cˆi (t) is calculated as a combination of xˆi (t) and FR (t − Ts ), see (10.12). For the implementation ease, one centralized observer was used to estimate these vectors. The observer was introduced in Sect. 10.4.1.

10.4 Case Study

127 (xˆ1 , dˆ1 , cˆ1 , r1 )

(xˆ2 , dˆ2 , cˆ2 , r2 )

r

u1,0

MPC1

u2,0

MPC2

(xˆ3 , dˆ3 , cˆ3 , r3 )

CSTR1

CSTR2

u3,0

MPC3

CSTR3

y1

y2

y

y3

Inner-layer xˆi , dˆi , cˆi

u

Kalman Filter

Fig. 10.3 Control scheme of decentralized MPC strategies (xˆ1 , dˆ1 , cˆ1 , w1,0 )

u1,0

MPC1

CSTR1

y1

r MPC-RG

w0

(xˆ2 , dˆ2 , cˆ2 , w2,0 )

(xˆ3 , dˆ3 , cˆ3 , w3,0 )

u2,0

MPC2

u3,0

MPC3

CSTR2

CSTR3

y2

y

y3

Inner-layer xˆi , dˆi , cˆi xˆi , dˆi , cˆi

u

Kalman Filter

Fig. 10.4 Control scheme of the reference governor

10.4.3 Reference Governor In order to improve the control performance of the decentralized control scheme, we have formulated the MPC-based reference governor scheme as in (10.27) which is converted according to (6.25). All constraints U and Y were constructed according to restrictions in Table 10.2. Specifically, for the considered control setup, all local MPC policies were given as QPs with 16 constraints and 8 continuous decision variables. Therefore, the final form of the MPC-based reference governor was a MIQP with 288 continuous and 192 binary decision variables. To compute the underlying MIQP, we have selected GUROBI as the solver. The MPC-based reference governor control scheme is depicted in Fig. 10.4.

128

10 Cascade MPC of Chemical Reactors

We remind that the MPC-based reference governor scheme formulated ether via KKT approach (6.25) or explicit MPC (eMPC) approach (6.31) yields identical solution, i.e., vector of optimally shaped references wi, j , for the same initial conditions. The only differences between these techniques are their complexities and the number of decision variables, respectively. By analytically solving these controllers, for all feasible initial conditions (10.33), eMPC strategies were obtained that consisted of 1 118, 1 055, and 650 regions, respectively. The parameter vector θi (t) was not subjected to any constraints that resulted in an extensive exploration of the parametric domain. Thus, a large number of regions of all eMPC policies were obtained. The restriction of x was not considered as it was not necessary for our controlled system. Moreover, this way, each local MPC consisted of a fever number of constraints that led to a less complex KKT formulation of the reference governor scheme. With the eMPC approach, the MIQP consisted of 96 continuous and 11 292 binary decision variables. Therefore, to decrease the computation burden of the reference governor, the KKT approach was chosen for this case study.

10.4.4 Simulation Profiles and Comparison The simulation was carried out with 100 sampling steps that correspond to the time interval of [0; 50] s. The system was initialized by the state vector

x(0) = 29.16 0.81 0.19 313.99 31.14 0.71 0.28 314.15 3.78 0.42 0.56 314.17



that corresponds to the initial control vector



u(0) = 4.50 9.00 0.45 9.00 9.00 9.00 . The reference value r (t) was changed at 5 s to the steady state given in Table 10.1. Moreover, a disturbance of the first control input Ff1 was considered at time 24.5 s, where it attained its maximal value for the duration of five sample instants, i.e., for 2.5 s. The control performances of the centralized, decentralized, and reference governor schemes are depicted in Figs. 10.5 and 10.6. Concretely, the dynamics of the controlled variables H1 , H2 and xB3 are shown in Fig. 10.5, while the flow rates control actions Ff1 , Ff2 and FR are provided in Fig. 10.6.1 These profiles were selected due to chosen weighting matrices in local MPC strategies. Finally, for convenience, the vector of shaped references w(t) is depicted in Fig. 10.7, where we can notice how the reference governor modified the user-specified reference r (t) based on the measurements x(t). of all remaining control actions Q i for i ∈ N31 are omitted as all heat exchangers are oversized, thus values of these control actions changed only slightly with a first-order dynamics.

1 Profiles

10.4 Case Study

129 r(t)

MPCc

MPCd

MPCr

H1 [m]

44 40 36 32 28 0

10

20

H2 [m]

r(t)

t [s]

MPCc

30

MPCd

40

50

40

50

MPCr

42 40 38 36 34 32 30 0

10

20

r(t)

t [s] MPCc

30

MPCd

MPCr

0.65

xB3 [m]

0.63 0.61 0.59 0.57 0.55 0

10

20

t [s]

30

40

50

Fig. 10.5 Output profiles of H1 , H2 , and xb3 . Overall control performance is compactly given in Table 10.3

The control performance of all schemes is compactly reported in Table 10.3. Specifically, we have applied the integral of the error squared (ISE) criterion for comparison. Moreover, the suboptimality Δ of each criterion was calculated w.r.t. the “nominally” performing centralized control scheme. Based on the ISE criterion, we can deduce that the reference governor has improved the control performance of the decentralized scheme by more than 11%. This improvement can be also noticed, e.g., in Fig. 10.5, where the overshoots of both liquid levels H1 and H2 have been mitigated. On the other hand, the concentration xB3 was not improved due to strong coupling dynamics of the controlled system. For convenience, the average computation time of the reference governor was 0.04 s and the maximal one was 0.06 s, which is the well below used sampling rate of Ts = 0.5 s. The computations were performed on a personal computer with Core i5 2.5 GHz processor machine, with 8 GB of RAM and on Matlab 2018a.

130

10 Cascade MPC of Chemical Reactors

Ff1 [kg s−1 ]

MPCc

MPCd

MPCr

Boundaries

30

40

7 6 5 4 3 2 1 0 0

10

20

MPCc

t [s]

MPCd

MPCr

Boundaries

30

40

MPCr

Boundaries

30

40

50

Ff2 [kg s−1 ]

2 1.5 1 0.5 0 0

10

20

t [s] MPCc

MPCd

50

FR [kg s−1 ]

11 10 9 8 0

10

20

t [s]

50

Fig. 10.6 Input profiles of Ff1 , Ff2 , and FR

10.4.5 Concluding Remarks This chapter addressed the problem of improving control performance of decentralized MPC strategies via designing an additional control layer that is known as an MPC-based reference governor scheme. We proposed an approach of how to efficiently formulate such higher hierarchical controller. Specifically, based on exploiting strict convexity, all local MPC strategies were substituted by its corresponding KKT conditions that represent necessary and sufficient replacement. Since it is an equivalent reformulation of the optimization problem, this technique preserves optimality and leads to an MPC reference governor scheme formulated as a MIP, which can be solved efficiently by using state-of-the-art solvers. Applicability of the proposed control scheme was demonstrated using a known benchmark, represented by two tank reactors and a separator [6]. The aim was to

10.4 Case Study

131 w(t)

MPCr

r(t)

H1 [m]

44 40 36 32 28 0

10

20

H2 [m]

w(t)

t [s]

30

40

50

40

50

MPCr

r(t)

42 40 38 36 34 32 30 0

10

20

w(t)

t [s]

30

MPCr

r(t)

0.65

xB3 [m]

0.63 0.61 0.59 0.57 0.55 0

10

20

t [s]

30

40

50

Fig. 10.7 Output profiles of H1 , H2 , and xb3 , controlled by the reference governor MPCr Table 10.3 Control performance comparison Control Scheme ISE Centralized Decentralized Reference governor

· 104

7.2 8.1 · 104 7.3 · 104

Δ ISE [%] 0.0 11.8 1.2

control all states to their respective user-specified references by manipulating inflow rates and power of heat exchangers. To achieve this, local MPC strategies were designed to control each subsystem. Subsequently, reference governor was devised to enhance control performance of these inner controllers by optimally shaping setpoints of these local MPCs. Proposed strategy increased the control performance of the decentralized scheme by more than 11%. We note that such performance enhancement can have a significant economic impact, especially in the industrial field.

132

10 Cascade MPC of Chemical Reactors

Needless to say, the downside of the proposed control scheme is additional computational and memory requirements. However, all computations of the reference governor can be carried out on an off-the-shelf device such as an industrial personal computer or even a server machine.

References 1. Berkel F, Caba S, Bleich J, Liu S (2018) A modeling and distributed mpc approach for water distribution networks. Control Eng Pract 81:199–206. https://doi.org/10.1016/j.conengprac.2018. 09.017, https://www.scopus.com/inward/record.uri?eid=2-s2.0-85053828032&doi=10.1016 %2fj.conengprac.2018.09.017&partnerID=40&md5=a2a9fdd773ae5496b217dcc72537b0ca 2. Boyd S, Vandenberghe L (2009) Convex optimization, 7th edn. Cambridge University Press, New York 3. Köhler J, Müller MA, Allgöwer F (2019) Distributed model predictive control–recursive feasibility under inexact dual optimization. Automatica 102:1 – 9, https://doi.org/10.1016/j.automatica. 2018.12.037, http://www.sciencedirect.com/science/article/pii/S0005109818306447 4. Moscoso-Vasquez H, Monsalve-Bravo G, Alvarez H (2014) Model-based supervisory control structure for plantwide control of a reactor-separator-recycle plant. Ind. Eng. Chem. Res. 53(52):20,177–20,190. https://doi.org/10.1021/ie502625u, https://www.scopus.com/ inward/record.uri?eid=2-s2.0-85053828032&doi=10.1016%2fj.conengprac.2018.09.017& partnerID=40&md5=a2a9fdd773ae5496b217dcc72537b0ca 5. Stewart B, Rawlings J, Wright S (2010) Hierarchical cooperative distributed model predictive control. pp 3963–3968. https://www.scopus.com/inward/record.uri?eid=2-s2.077957757073&partnerID=40&md5=74ad17fc6e145139d65b9f45683d5b2b 6. Stewart BT, Venkat AN, Rawlings JB, Wright SJ, Pannocchia G (2010) Cooperative distributed model predictive control. Syst Control Lett 59(8):460–469

Chapter 11

Conclusions and Future Research

11.1 Discussion and Review In this monograph, we studied the design of a supervisory controller based on the model predictive control (MPC) strategy. The MPC-based reference governor (MPCRG) is the superior controller to lower level regulators, often denoted as primary controllers. The design and the structure of the MPC-RG are hugely dependent on the model of the closed-loop system consisting of the model of the plant and the model of the primary controller. The synthesis of the MPC-RG hence had two phases: the first was the modeling of the closed-loop, and the second was to incorporate the model into the MPC framework. The theoretical part of this monograph includes the modeling of closed-loops with the synthesis of the MPC-RG for three main cases of primary controllers: 1. closed-loop with a linear process controlled by a set of PID controllers, 2. closed-loop with a system with a linear process controlled by a relay-based controller, and 3. a multiple-system composition controlled by decoupled MPC controllers. The modeling of the closed-loop systems with a set of PID controllers was conveniently reformulated to the state space model. Such a reformulation allowed us to employ a standard MPC strategy which is based on the linear state space model. The resulting formulation of the MPC-RG was converted to the standardized quadratic programming problem. The challenge here, of course, is the increased number of system dimensions. However, current off-the-shelve optimization software tools are suitable to solve these problems fast enough. The closed-loop model with the relay-based primary controller was done using binary variables. Before the actual formulation of the dynamical model of the relaybased controller, a set of IF-THEN rules were devised, that capture the behavior of the primary controller. Subsequently, we have formulated the supervisory controller, that except continuous variables contain binary variables. Such an optimal control problem was reformulated to a mixed-integer linear optimization problem, which © Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7_11

133

134

11 Conclusions and Future Research

is a non-convex program. Again such an optimization problem can be solved with state-of-the-art software packages toward global optimality in a tractable fashion. One of the main challenges addressed in this monograph was the modeling of the closed-loop system with a primary controller in the form of an MPC. Such a system is inherently nonlinear, due to the constraints in the MPC strategy. However, we do not formulate the model of the closed-loop with MPC strategy separately, but we directly designed the MPC-RG. In this case, however, the supervisory MPC strategy was cast as a bi-level optimization problem. In fact, the MPC-RG must anticipate the optimal evolution of control actions provided with the primary MPC. The chapter devoted to the MPC-RGs for the multisystem primary loops with MPC strategies covered two approaches to the solution of the bi-level optimization problem. The first approach exploits the Karush–Kuhn–Tucker (KKT) conditions reformulation of the primary MPC and subsequent encoding of the KKT conditions with binary variables. In this case, the MPC-RG is again in the form of a mixed-integer linear/quadratic optimization problem with linear constraints. The second approach extends the parametric solution of the inner MPC problem. Here, the supervisory MPC strategy is again formulated as a mixed-integer optimization problem due to the piecewise affine (PWA) nature of the parametric solution of the inner MPC. The second part of the monograph is devoted to a series of four case studies, which demonstrates the advantages the addition of the supervisory control layer in the form of an MPC-RG. First, we have presented the application of the MPC governor to a PID controlled boiler–turbine unit. Here, we showed that the MPC-based reference governor improved the performance of the closed-loop system in terms of conserved energy in almost 30% and concerning tracking performance for the desired output power by 50%. Moreover, the most significant advantage was the guaranteed satisfaction of constrained control rates that manipulated the fuel valves. The second case study involved an experimental application of the state space based MPC-RG to govern the position of the magnetically suspended ball. The main aim of this study was to enforce the output constraints, which was difficult to achieve by the PID controller. Moreover, the MPC-RG was implemented as an explicit MPC strategy on a microcontroller with limited computational resources. The third case study presented the improvements done on indoor temperature control in buildings with a wall-mounted thermostat. Here, the MPC-RG strategy governed the thermostat, which behaves as a relay-based controller. This case study primarily focused on energy saving aspects, where the inclusion of the MPC-RG strategy resulted in approximately 40% energy savings compared to the pure thermostat usage. We did not focus on reference tracking aspects, however, as guaranteed by the MPC-RG strategy, not only the constraint on heating power was adhered to but also the thermal comfort constraints were enforced. The MPC-based reference governor strategy was formulated as a mixed-integer linear optimization problem and it was solved online. Last but not least, we covered the control of a multi-reactor system in the fourth case study. The primary focus here was to coordinate three individual MPC strategies that primarily control interconnected continuous stirred tank reactors and a separator.

11.1 Discussion and Review

135

By introducing supervisor layer to the individual MPCs, we manage to improve the tracking properties and disturbance rejection in the profiles related to the production of individual substances.

11.2 Future Research We see two possible areas in the advances of the MPC-RG design. First is to further focus on closed-loop modeling that will include other usual primary controllers, like: • closed-loops with a set of gain-scheduled PIDs, • closed-loops with fuzzy controllers, and • closed-loops combining various types of primary controllers. Moreover, with a more precise model, we should expect to formulate nonlinear MPC strategies as reference governors. Even though that MPC-RG based on linear models can do the job with satisfactory performance, it might not be the general case. The second part of the further focus in MPC-RG synthesis is to exploit the approximations of the closed-loop systems. Reason for such a suggestion stems from the complexity of the optimal control problems that MPC-RG represents. An increasing number of primary controllers, especially relay-based or local MPCs, result in extremely complex MI problems. One of the future research topics is to exploit the approximations of the closed-loop system in order to decrease its complexity.

Index

B Binary search tree, 13 Box constraints, 18 K Kalman filter time-varying, 23, 77, 125 KKT conditions, 58 M MPC explicit solution, 32 input–output prediction models, 19 linear prediction models, 17, 55 model predictive control, 15 objective function, 17 offset-free control, 21, 77 state space prediction models, 20, 55, 79 MPC-based reference governors bilevel optimization, 56 initial conditions, 37 input–output prediction models, 36 MPC-based inner models, 56, 123

objective function, 37, 41 relay-based controller, 51, 106 state space prediction models, 41, 77, 96

O Optimization general optimization, 9 linear programming, 9 mixed-integer optimization, 10, 51, 60, 62, 106 online optimization, 11 parametric optimization, 12 quadratic programming, 10

P PWA,piecewise affine function, 12, 61, 99

R Relay-based controller dynamic model, 45 mixed-integer formulation, 50, 105

© Springer Nature Switzerland AG 2019 M. Klauˇco and M. Kvasnica, MPC-Based Reference Governors, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-17405-7

137