원시데이터 수집 시스템
선정목록으로

A Neural Network Architecture to Learn Explicit MPC Controllers from Data

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Emilio T. Maddalena — École Polytechnique Fédérale de Lausanne (EPFL), Switzerland
  2. Caio Guilherme da Silva Moraes — Universidade Federal de Santa Catarina (UFSC), Brazil
  3. Gierri Waltrich — Universidade Federal de Santa Catarina (UFSC), Brazil
  4. Colin N. Jones — École Polytechnique Fédérale de Lausanne (EPFL), Switzerland
DOI
10.1016/j.ifacol.2020.12.546
저널
IFAC-PapersOnLine
발행년도
2020
발행기관
Elsevier BV
피인용수
54
라이선스
0
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.ifacol.2020.12.546
토픽
Fuel Cells and Related Materials
OpenAlex ID
W3153251967

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

초록이 없습니다.

본문 36,451자

본문 펼치기
## A Neural Network Architecture to Learn Explicit MPC Controllers from Data ∗ E. T. Maddalena, C. G. da S. Moraes, G. Waltrich and C. N. Jones Abstract We present a methodology to learn explicit Model Predictive Control (eMPC) laws from sample data points with tunable complexity. The learning process is cast in a special Neural Network setting where the coefficients of two linear layers and a parametric quadratic program (pQP) implicit layer are optimized to fit the training data. Thanks to this formulation, powerful tools from the machine learning community can be exploited to speed up the off-line computations through high parallelization. The final controller can be deployed via low-complexity eMPC and the resulting closed-loop system can be certified for stability using existing tools available in the literature. A numerical example on the voltage-current regulation of a multicell DC-DC converter is provided, where the storage and on-line computational demands of the initial controller are drastically reduced with negligible performance impact. Keywords: Explicit model predictive control, machine learning, data-driven control, neural networks, power electronics. #### 1 Introduction Model Predictive Control (MPC) is a valuable control methodology to be considered whenever performance needs to be maximized, possibly operating the system close to its physical constraints. For certain classes of problems - e.g. when the dynamics and constraints are affine and the objective is quadratic - a closed-form solution exists, mapping the current state to the control inputs through a continuous piecewise-affine (PWA) function. This approach is known as explicit Model Predictive Control (eMPC) and is particularly employed when the hardware where such a control law is to be implemented cannot solve the MPC mathematical program on-line (either for time limitations or even safety regulations regarding the final application). Unfortunately, eMPC controllers might also suffer from having high complexity due to the exponential growth of the number of regions in the worst case [1], thus leading to not only high memory requirements but also high computational times. Scaling down the memory footprint and computational burden of eMPC is possible through a variety of techniques. Given a measurement of the current state, deciding in which region of the polyhedral partition the system is can be efficiently accomplished using search trees, hash tables, among other data structures [2, 3, 4]. If some information is known about the initial condition of the plant (even if only with respect to a subset of the states), reachability arguments can be used to drop polytopic cells that are guaranteed not to be visited during operation; this was recently studied in [5] and in [6]. Additional region elimination schemes were presented in [7] and [8], where an interpolation strategy and a backup control law were respectively defined to be used in case the system visited a state whose region had been eliminated. Finally, approximation methods for eMPC were investigated using polynomial functions [9], multi-scale basis [10], as well as piecewise-affine functions [11]. The use of Neural Networks (NN) to learn nonlinear MPC controllers was studied in [12], where one hidden layer and sigmoid activation functions were employed. The authors _∗_ This work has received support from the Swiss National Science Foundation under the RISK project (Risk Aware Data-Driven Demand Response, grant number 200021 175627. E. T. Maddalena and C. N. Jones are with Ecole <sup>´</sup> Polytechnique F´ed´erale de Lausanne (EPFL), Switzerland (e-mails: `emilio.maddalena@epfl.ch`, `colin.jones@epfl.ch` ). C. G. da S. Moraes and G. Waltrich are with Universidade Federal de Santa Catarina (UFSC), Brazil (e-mails: `caio.moraes@posgrad.ufsc.com`, `gierri.waltrich@ufsc.br` ). assumed a specific degree of regularity of the obtained approximator in terms of a bound of an integral weighted by its Fourier decomposition coefficients. It was then shown that the final NN approximation error can be bounded. More recently, [13] proposed training a NN with rectified linear units by means of reinforcement learning instead of fully supervised learning. The context was that of quadratic MPC for linear systems. Their approach was shown to alleviate the training phase computations, especially since the system model can be exploited at this stage. Nevertheless, no guarantees of closed-loop stability are given or even tools to analyze it a posteriori - a rather common drawback of machine learning approximators. _Contribution_ : Herein we propose a method to fit datapoints sampled from an MPC controller - either in implicit or explicit form - with a particular type of Neural Netowrk. The architecture is defined by two linear layers and an implicit parametric quadratic program (pQP) layer, which together are able to capture any linear MPC problem with quadratic cost. In contrast with the majority of previous approaches such as [7, 8, 14], the final complexity is incremental and can be flexibly adjusted. The resulting approximator can be deployed essentially as a new simpler eMPC controller, and _closed-loop_ _stability_ _can_ _be_ _certified_ _a_ _posteriori_ with tools already available in the literature. A case study in the power electronics domain, where several successful implementations of eMPC have been reported (see e.g. [15]), is presented to illustrate the potential of the proposed methodology. Although the proposed simplification technique gives up the original controller optimality, our numerical investigations show that significant complexity reduction is possible with little to negligible performance degradation <sup>1</sup> . _Notation_ : R <sup>_n_</sup> is the n-dimensional Euclidean space equipped with its usual norm. Given a matrix _A_, its transpose is denoted by _A_ <sup>_′_</sup>, and _A_ _≻_ ( _⪰_ ) 0 means it is positive-definite (semidefinite). Furthermore, _||v||_ <sup>2</sup> _A_ <sup>is</sup> <sup>defined</sup> <sup>as</sup> <sup>_||v′Av||_</sup> <sup>2,</sup> <sup>_I_</sup> <sup>denotes</sup> <sup>an</sup> <sup>identity</sup> <sup>matrix</sup> <sup>of</sup> appropriate size, and 0 denotes a zero matrix of appropriate size. diag( _a_ 1 _, . . ., an_ ) represents a diagonal matrix with entries _a_ 1 _, . . ., an_ . #### 2 Learning Predictive Controllers Consider the following standard MPC formulation for linear dynamical systems _k_ <sup>_′_</sup> <sup>_Ruk_</sup> - + _x_ <sup>_′_</sup> _H_ <sup>_PxH_</sup> (1a) P1 : min _X,U_ _H−_ 1 _k_ =0 - _x_ <sup>_′_</sup> <sup>_′_</sup> _k_ <sup>_Qxk_</sup> <sup>+</sup> <sup>_u_</sup> _k_ <sup>_′_</sup> s.t. _∀k_ = 0 _, . . ., H_ _−_ 1 (1b) _xk_ +1 = _Axk_ + _Buk_ (1c) _xk_ _∈_ X (1d) _uk_ _∈_ U (1e) _xH_ _∈_ X _H_ (1f) _x_ 0 = _x_ (0) (1g) where _X_ := _{x_ 1 _, . . ., xH_ _}_, _U_ := _{u_ 0 _, . . ., uH−_ 1 _}_, _Q_ _⪰_ 0, _P_ _⪰_ 0, _R_ _≻_ 0, and the constraints are all described by affine equalities and inequalities. Denote by _π_ : X _→_ U the optimal solution of (1) in its parametric form with respect to the initial conditions _x_ (0), where X _⊆_ R <sup>_n_</sup> is the feasible state space of P1 and U _⊆_ R <sup>_m_</sup> is the control space. We assume a set of _N_ samples can be acquired from the original control law <sup>2</sup> _D_ = _{_ x _i,_ u _i}_ <sup>_N_</sup> _i_ =1 (2a) u _i_ = _π_ (x _i_ ) _,_ _i_ = 1 _, . . ., N_ (2b) The process of acquiring the training dataset does not have to follow a particular distribution, nor do the samples have to be independent. 1All MATLAB scripts and `python` code can be downloaded from `www.c4science.ch/source/QPFit` . 2The dataset can also be directly obtained from the implicit controller; depending on the size of the problem at hand, computing the explicit solution might be intractable. 2 Linear layer: F, f x y1=Fx+f pQP layer: L y2 = arg min ||Lz+y1 || <sup>2</sup> +"||z|| <sup>2</sup> z≥0 Linear layer: G, g Projection layer: y3= Gy2+g y4 = sat(y3) u^ Figure 1: An illustration of the NN eMPC controller approximator. The parameters to be optimized are shown on the left-hand side. 2.1 The proposed architecture The key idea behind the proposed approximator is the use of a parametric quadratic program layer as part of the Neural Network, and optimizing over its parameters in order to fit the available dataset. This layer is implicitly described by the quadratic program _z_ <sup>_⋆_</sup> = arg min (3) _z≥_ 0 <sup>_||Lz_</sup> <sup>+</sup> <sup>_y_</sup> <sup>1(</sup> <sup>_x_</sup> <sup>)</sup> <sup>_||_</sup> <sup>2 +</sup> <sup>_ϵ||z||_</sup> <sup>2</sup> which is _always_ _feasible_ and _bounded_ _from_ _below_ . The size of this mathematical program, i.e. the dimension of _z_, can be tuned to attain approximations with different complexity. Moreover, as notation suggests, the parameter _y_ 1 depends on a previous affine layer that maps the system states into the _z_ space, _y_ 1 := _Fx_ + _f_ . Let _y_ 2 := _z_ <sup>_⋆_</sup>, then another affine layer maps the optimal solution to the input space _y_ 3 := _Gy_ 2 + _g_, and a projection onto the feasible input set produces the final control action _u_ ˆ := Proj U( _y_ 2). This last step is necessary to guarantee feasibility of the control moves (see e.g. [13]). An illustration of the proposed architecture is presented in Fig. 1, where the projection layer was particularized to a familiar element-wise saturation operation sat( _·_ ), valid for box input constraints. Let the chosen number of decision variables in the pQP be _z_ _∈_ R <sup>_nz_</sup> . We choose _L_ _∈_ R <sup>_nz×nz_</sup> to be square, and therefore _F_ _∈_ R <sup>_nz×n_</sup>, _f_ _∈_ R <sup>_nz_</sup> . Moreover, _G_ _∈_ R <sup>_m×nz_</sup> and _g_ _∈_ R <sup>_m_</sup> . If _nz_ _≥_ _n_, the first layer lifts the input data into a higher dimensional space before it is passed through the optimization layer. A last affine function then projects it onto the control space. These facts will be later employed to analyze the representative power of the network. The parameters to be trained are therefore _F_, _f_, _L_, _G_ and _g_ . This process can be carried out via a stochastic gradient descent algorithm applied to an appropriate loss function. Differentiability of all layers is trivial with the exception of the pQP one [16, 17]. Regarding the later, note that the objective in (3) can be rewritten as _V_ ( _z_ ) := _z_ <sup>_′_</sup> ( _ϵI_ + _L_ <sup>_′_</sup> _L_ ) _z_ + (2 _L_ <sup>_′_</sup> _y_ 1( _x_ )) <sup>_′_</sup> _z_ + _y_ 1( _x_ ) <sup>_′_</sup> _y_ 1( _x_ ) (4) whose Lagrangian is simply L( _z, λ_ ) = _V_ ( _z_ ) _−_ _λ_ <sup>_′_</sup> _z_ (5) The Karush-Kuhn-Tucker (KKT) conditions for primal and dual feasibility, complementary slackness, and stationarity then read _z_ <sup>_⋆_</sup> _≥_ 0 (6a) _λ_ <sup>_⋆_</sup> _≥_ 0 (6b) _λ_ <sup>_⋆_</sup> _i_ <sup>_⋆_</sup> _i_ <sup>_z_</sup> _i_ <sup>_⋆_</sup> _i_ <sup>_⋆_</sup> <sup>= 0</sup> <sup>_,_</sup> <sup>_∀i_</sup> <sup>= 1</sup> <sup>_, . . ., nz_</sup> (6c) 2( _ϵI_ + _L_ <sup>_′_</sup> _L_ ) _z_ <sup>_⋆_</sup> + (2 _L_ <sup>_′_</sup> _y_ 1( _x_ )) _−_ _λ_ <sup>_⋆_</sup> = 0 (6d) where _λi_ and _zi_ denote the components of the Lagrange multipliers and decision variables vectors. The following proposition presents the differentiability properties of the pQP layer, and holds since (3) is a particular instance of the `OptNet` layer [17] with strictly convex objective function. 3 Proposition 1 : Let _θ_ := ( _L, y_ 1). The parametric solution _z_ <sup>_⋆_</sup> ( _θ_ ) of (3) is subdifferentiable everywhere in its domain, i.e., _∂z_ <sup>_⋆_</sup> ( _θ_ ) _̸_ = _{ }_, and _∂z_ <sup>_⋆_</sup> ( _θ_ ) has a unique element (the jacobian) everywhere but in a set of measure zero. As shown in [17], the relevant gradients with respect to the parameters to be trained can be obtained from the KKT set of equations (6). Hence, backward passes are possible and backpropagation can be performed to optimize all of the NN parameters. 2.2 Properties of the approximator The authors of [18] showed that any continuous PWA function can be obtained as the solution of a particular parametric linear program (pLP) transformed by a linear map. Even though this view could be adopted herein, we instead prove a different result that is enough in the context of linear eMPC. Theorem 1 : (The proposed NN architecture can learn any linear quadratic MPC controller) Let _π_ ˆ : X _→_ U be the map defined by the composition of all four layers, i.e., _π_ ˆ ( _x_ ) := _y_ 4 _◦_ _y_ 3 _◦_ _y_ 2 _◦_ _y_ 1( _x_ ). Set _ϵ_ = 0, then _∃F_, _f_, _L_, _G_ and _g_ with appropriate dimensions such that _∀x ∈_ X _,_ _π_ ˆ ( _x_ ) = _π_ ( _x_ ). _Proof_ : Define the following parametric problem P2 : min _U_ <sup>_′_</sup> Λ _U_ + _x_ (0) <sup>_′_</sup> Γ _U_ (7a) _U_ s.t. Φ _U_ _≤_ Ω _x_ (0) + _ω_ (7b) obtained from P1 by using the equality constraints to eliminate all state decision variables (see [19] for the construction of each matrix and vector). We also have that Λ _≻_ 0. Problems P2 and P1 are then equivalent in the sense that the solution _U_ <sup>_⋆_</sup> of P2 and _{X_ <sup>_⋆_</sup> _, U_ <sup>_⋆_</sup> _}_ of P1 have the same _U_ <sup>_⋆_</sup> component. Next, the dual problem of P2 can be shown to be D2 : min _λ≥_ 0 <u>1</u> - _λ_ <sup>_′_</sup> Φ Λ <sup>_−_</sup> <sup>1</sup> Φ <sup>_′_</sup> _λ_ + (4 _x_ (0) <sup>_′_</sup> Ω <sup>_′_</sup> + 2 _x_ (0) <sup>_′_</sup> ΓΛ <sup>_−_</sup> <sup>1</sup> Φ <sup>_′_</sup> 4 (8) _· · ·_ + 4 _ω_ <sup>_′_</sup> ) _λ_ + _x_ (0) <sup>_′_</sup> ΓΛ <sup>_−_</sup> <sup>1</sup> Γ <sup>_′_</sup> _x_ (0)� From the stationarity optimality condition of P2, it is possible to recover the primal optimal solution _U_ <sup>_⋆_</sup> from the dual optimal solution _λ_ <sup>_⋆_</sup> _U_ <sup>_⋆_</sup> = _−_ 0 _._ 5 Λ <sup>_−_</sup> <sup>1</sup> Φ <sup>_′_</sup> _λ_ <sup>_⋆_</sup> _−_ 0 _._ 5 Λ <sup>_−_</sup> <sup>1</sup> Γ <sup>_′_</sup> _x_ (0) (9) It would be possible to enforce the first two layers to match the dual problem D2, and the third to implement (9) and recover the primal solution. Nevertheless, this would require the third layer to have a so called skip connection directly from the NN input, i.e., access to _x_ (0). We instead define slightly different linear and pQP layers that not only learn D2, but also let _x_ (0) pass through them and arrive at the second linear layer. Let the auxiliary variable _L_ <sup>˜</sup> and function _y_ ˜1( _x_ ) := _Fx_ <sup>˜</sup> + _f_ <sup>˜</sup> be the solution to (compare (4) and (8)) _L_ ˜ <sup>_′_</sup> _L_ ˜ + _ϵI_ = 0 _._ 25 ΦΛ <sup>_−_</sup> <sup>1</sup> Φ <sup>_′_</sup> (10a) 2 _L_ <sup>˜</sup> <sup>_′_</sup> _y_ ˜1( _x_ ) = Ω _x_ (0) + 0 _._ 5 ΦΛ <sup>_−_</sup> <sup>1</sup> _x_ (0) + _ω_ (10b) which leads to _ϵ_ = 0, _L_ <sup>˜</sup> = 0 _._ 5 (ΦΛ) <sup>˜</sup> <sup>_′_</sup>, where Λ <sup>˜</sup> is the unique square root of Λ <sup>_−_</sup> <sup>1</sup>, guaranteed to exist as Λ <sup>_−_</sup> <sup>1</sup> _≻_ 0. Then, _y_ ˜1( _x_ ) = (ΦΛ) <sup>˜</sup> <sup>_−_</sup> <sup>1</sup> (Ω _x_ (0) + 0 _._ 5 ΦΛ <sup>_−_</sup> <sup>1</sup> _x_ (0) + _ω_ ) = _⇒_ _F_ ˜ = (ΦΛ) <sup>˜</sup> <sup>_−_</sup> <sup>1</sup> (Ω+ 0 _._ 5 ΦΛ <sup>_−_</sup> <sup>1</sup> ) _,_ _f_ <sup>˜</sup> = (ΦΛ) <sup>˜</sup> <sup>_−_</sup> <sup>1</sup> _ω_ . Set the first layer weights to _F_ = [ _−I_ _I_ _F_ <sup>˜</sup> ] <sup>_′_</sup> and _f_ = [ 0 0 _f_ <sup>˜</sup> ] <sup>_′_</sup> so that _y_ 1( _x_ ) = [ _−x_ ; _x_ ; _Fx_ <sup>˜</sup> + _f_ ˜]. Set the weights of the pQP layer (3) to _ϵ_ = 0 and _L_ = [ _I_ 0 0 ; 0 _I_ 0 ; 0 0 _L_ ˜]. If we partition the decision variable as _z_ = [˜ _z_ _x_ <sup>_p_</sup> _x_ <sup>_n_</sup> ] <sup>_′_</sup>, this results in min (11) _z,x_ ˜ <sup>_p_</sup> _,x_ <sup>_n_</sup> _≥_ 0 <sup>_||xp −_</sup> <sup>_x_</sup> <sup>(0)</sup> <sup>_||_</sup> <sup>2 +</sup> <sup>_||xn_</sup> <sup>+</sup> <sup>_x_</sup> <sup>(0)</sup> <sup>_||_</sup> <sup>2 +</sup> <sup>_||L_</sup> <sup>˜</sup> <sup>_z_</sup> <sup>˜ + ˜</sup> <sup>_y_</sup> <sup>1(</sup> <sup>_x_</sup> <sup>)</sup> <sup>_||_</sup> <sup>2</sup> which is a separable objective in _z_ ˜, _x_ ˜ <sup>_p_</sup> and _x_ ˜ <sup>_n_</sup> . Due to the choice of _L_ <sup>˜</sup> and _y_ ˜1( _x_ ) in (10), the last term of the pQP matches the dual D2 with the exception of its constant term - not 4 relevant for determining the optimal solution. Therefore, we have that _z_ ˜ <sup>_⋆_</sup> in (11) matches _λ_ <sup>_⋆_</sup> in D2. Regarding _x_ <sup>_p⋆_</sup>, the _n_ optimizer components will satisfy _∀i_ = 1 _, . . ., n_, _x_ <sup>_p⋆_</sup> _i_ = _xi_ (0) if _xi_ (0) _≥_ 0, else _x_ <sup>_p⋆_</sup> _i_ = 0. Similarly, _x_ <sup>_n⋆_</sup> _i_ = _−xi_ (0) if _xi_ (0) _≤_ 0, else _x_ <sup>_n⋆_</sup> _i_ = 0. Therefore, _x_ <sup>_p⋆_</sup> _−_ _x_ <sup>_n⋆_</sup> = _x_ (0). <sup>_p⋆_</sup> _i_ = 0. Similarly, _x_ <sup>_n⋆_</sup> _i_ <sup>_n⋆_</sup> _i_ = _−xi_ (0) if _xi_ (0) _≤_ 0, else _x_ <sup>_n⋆_</sup> _i_ Next set the weights of the second linear layer _y_ 3 to _G_ = [ _−_ 0 _._ 5Λ <sup>_−_</sup> <sup>1</sup> Φ <sup>_′_</sup> _−_ 0 _._ 5Λ <sup>_−_</sup> <sup>1</sup> Γ <sup>_′_</sup> 0 _._ 5Λ <sup>_−_</sup> <sup>1</sup> Γ <sup>_′_</sup> ] and _g_ = 0 . Therefore, _y_ 3 = _G_ [˜ _z_ <sup>_⋆_</sup> _x_ <sup>_p⋆_</sup> _x_ <sup>_n⋆_</sup> ] <sup>_′_</sup> = _G_ [ _λ_ <sup>_⋆_</sup> _x_ <sup>_p⋆_</sup> _x_ <sup>_n⋆_</sup> ] <sup>_′_</sup> = _U_ <sup>_⋆_</sup>, where equality (9) was used in the last step. Finally, note that the last layer _y_ 4 = ProjU( _y_ 3) will simply evaluate to _y_ 3 since _y_ 3 is the optimal primal solution _U_ <sup>_⋆_</sup>, which satisfies the constraints (7b) and necessarily belongs to U. The theorem then follows from the fact that _x_ (0) in the above calculations can be taken to be any point _x_ in X. Exactly matching the original MPC controller would require _L_ to have the same size of ΦΛ and <sup>˜</sup> _ϵ_ = 0 as shown. Nevertheless, we are interested precisely in reducing the complexity of the resulting controller through employing less parameters. In this process, choosing a regularizer _ϵ_ _>_ 0 is beneficial since it ensures that the QP is bounded during the training phase for all possible parameters. 2.3 Stability certification After the NN has been trained and its weights have been defined, closed-loop stability in the sense of Lyapunov can be verified through sum-of-squares (SoS) programming. First note that the NN is a composition of linear maps and optimization problems. The central idea is that the forward pass involves calculating the optimal solution to these mathematical programs, which necessarily satisfy their respective KKT conditions, e.g. (6). Furthermore, these conditions are sets of polynomial inequalities in the primal-dual lifted space; hence, the control moves are defined by polynomial and linear functions. As the system being controlled is linear, the certification technique presented in [20] can be readily applied. 2.4 Controller deployment The final approximated control law _u_ = _π_ ˆ ( _x_ ) is evaluated by a forward pass in the NN. If the first and second linear layers are incorporated respectively into the pQP and projection ones, this can be done by solving the two (simpler) optimization problems on-line. Alternatively, two explicit PWA solutions can be calculated off-line with a bound on the number of regions dependent on the chosen size _nz_ . If the constraints _u_ _∈_ U are simply a box - as in many practical applications - an element-wise saturation is the closed-form solution to the projection layer _u_ = _y_ 3 = ProjU( _y_ 2), further simplifying the final controller. We illustrate the use of the proposed technique in a power electronics context in the next section. Any discrepancy between _π_ ˆ ( _x_ ) and _π_ ( _x_ ) in the region that contains the origin will result in steady-state errors. Several techniques can be used to overcome this issue. As discussed in [12], the LQR solution associated with (1) can be stored and used whenever the system is inside the associated invariant set, where no constraints are active. Alternatively, an external disturbance estimator could be adopted to account for the optimal-approximate controller mismatch. #### 3 Control of a step-down converter In order to enhance readability and stay consistent with the standard circuits convention, notation will be overloaded. 3.1 Analysis and controller design Parallelism is a key concept to increase the efficiency and power levels of electronic converters. Still, this design choice has to be followed by proper current/voltage balancing techniques to ensure that no stage is subjected to a higher electrical stress when compared to the others. A schematic representation of a multicell step-down converter is shown in Fig. 2, and its parameters can be found in Table 1. The topology features three arms that are connected to a coupled inductor, and an L-C output filter. All self inductances are assumed equal 5 <u>Table</u> <u>1:</u> <u>DC-DC</u> <u>converter</u> <u>parameters</u> _<u>Vin</u>_ _<u>Ls</u>_ _<u>Lm</u>_ _<u>R</u>_ _<u>Lf</u>_ _<u>Co</u>_ _<u>Ro</u>_ <u>350 V</u> <u>4 mH</u> <u>-2 mH</u> <u>10 mΩ</u> <u>270</u> _<u>µ</u>_ <u>H</u> <u>20</u> _<u>µ</u>_ <u>F</u> <u>6.25 Ω</u> Q1 Q2 Q3 L1 <u>i1</u> <u>i2</u> <u>i3</u> R R R <u>i2</u> R L2 Vin L3 Lf vout Co Ro ___ ___ ___ Q1 Q2 Q3 Figure 2: Circuit diagram of the multicell step-down DC-DC converter. _L_ 1 = _L_ 2 = _L_ 3 = _Ls_, and all mutual inductances have value _Lm_ . The switches of each arm operate in a complementary fashion at a fixed frequency _f_ = 15 kHz, and with variable but constrained duty cycle 0 _≤_ _di_ _≤_ 0 _._ 9 _,_ _i_ = 1 _,_ 2 _,_ 3. Let the average voltage applied by the arms over one switching period be denoted by _vi_ := _diVin, i_ = 1 _,_ 2 _,_ 3. In order to ease the analysis, we apply the Lunze transform Ψ to all variables, decomposing the phase voltages and currents into differential and common mode components - _idm_ 1 _idm_ 2 _icm_ - _′_ := Ψ - _i_ 1 _i_ 2 _i_ 3� _′_ (12) - _vdm_ 1 _vdm_ 2 _vcm_ - _′_ := Ψ - _v_ 1 _v_ 2 _v_ 3� _′_ (13) - _idm_ 1 _idm_ 2 _icm_ - _′_ := Ψ _i_ 1 _i_ 2 _i_ 3 - _′_ := Ψ - _v_ 1 _v_ 2 _v_ 3 - _′_ (13) where Ψ = (1 _/_ 3) [2 _−_ 1 _−_ 1; _−_ 1 2 _−_ 1; 1 1 1]. The control input is defined as _u_ := [ _vdm_ 1 _vdm_ 2 _vcm_ ] <sup>_′_</sup> and the continuous-time state vector, by appending the output voltage to the transformed currents _x_ := [ _idm_ 1 _idm_ 2 _icm_ _vout_ ] <sup>_′_</sup> . By using Kircchoff’s circuit laws, a linear model of the form _x_ ˙ = _Actx_ + _Bctu_ can be derived with 0 0 _<u>−R</u>_ _<u>−</u>_ <u>1</u> _Ls_ +2 _Lm_ +3 _Lf_ _Ls_ +2 _Lm_ +3 _Lf_ 0 0 <u>3</u> _<u>−</u>_ <u>1</u> _Co_ _RoCo_ _<u>−</u>_ <u>1</u> _RoCo_ _Act_ =   _<u>−R</u>_ 0 0 0 _Ls_ + _Lm_ 0 _<u>−R</u>_ 0 0 _Ls_ + _Lm_ 0 0 _<u>−R</u>_ _<u>−</u>_ _Ls_ +2 _Lm_ +3 _Lf_ _Ls_ +2 _Lm_  (14)  <u>1</u> 0 0 _Ls_ 0 <u>1</u> 0 _Ls_ 0 0 <u>1</u> _Ls_ +2 _Lm_ +3 _Lf_ 0 0 0   (15) _Bct_ =   Finally, discretization at frequency _f_ is carried out using the zero-order hold method, yielding _xk_ +1 = _Axk_ + _Buk_ . The control goal is to regulate the output voltage _vout_ to 300 V while maintaining the phase currents balanced at all times, which translates to driving the differential currents to zero. More specifically we have the following fixed reference _xeq_ = [0 0 16 300] <sup>_′_</sup> with _ueq_ = _B_ <sup>_†_</sup> ( _I −_ _A_ ) _xeq_, where _B_ <sup>_†_</sup> is the pseudo-inverse of _B_ . Moreover, the controller approximation procedure must not incur a steady-state error larger than 200 mA for _idm_ 1 and _idm_ 2, and 5% for the common mode component _icm_ and output voltage _vout_ . The chosen MPC cost function was _||_ <sup>2</sup> _Q_ <sup>+</sup> <sup>_||uk_</sup> <sup>_−_</sup> <sup>_ueq||_</sup> _R_ <sup>2</sup> _R_ <sup>2</sup> <sup>)</sup> <sup>+</sup> <sup>_||xN_</sup> <sup>_−_</sup> <sup>_xeq||_</sup> <sup>2</sup> _P_ <sup>2</sup> _P_ (16) _J_ = _H−_ 1 ( _||xk −_ _xeq||_ <sup>2</sup> _Q_ _k_ =0 where _Q_ = diag(10 _,_ 10 _,_ 0 _._ 1 _,_ 0 _._ 1), _R_ = 0 _._ 1 _I_, _P_ is the solution to the associated the discretetime algebraic Riccati equation, and _H_ = 10. For all time instants, box state constraints 6 10 <sup>-2</sup> 10 <sup>-3</sup> 10 <sup>-4</sup> ~~<u>0.29 kB</u>~~ ~~<u>Optimal</u>~~ ~~<u>Loss = 0</u>~~ <u>Size = 518 kB</u> <u>1 kB</u> 1 kB ~~8 kB~~ 3 kB 17 kB 34 kB 1 2 3 4 5 6 7 Size nz of the NN pQP layer Figure 3: Neural network training loss as a function of the pQP layer size, and storage requirements associated with their PWA representations. were imposed - _−_ 5 _−_ 5 _−_ 10 _−_ 20 <sup>�</sup> <sup>_′_</sup> _≤_ _xk_ _≤_ �5 5 30 400 <sup>�</sup> <sup>_′_</sup> and polyhedron constraints on the controls _Hu uk_ _≤_ _hu_ that simply mapped the duty cycle saturation to the Lunze domain. Due to the polytopic input constraints, the system cannot be decomposed into three decoupled parts as the structure of matrices _Act_ and _Bct_ suggest. Furthermore, the standard terminal set constraint was imposed on _xH_, defined as the invariant set associated to the unconstrained infinite-time problem formulation. were imposed - _−_ 5 _−_ 5 _−_ 10 _−_ 20 <sup>�</sup> <sup>_′_</sup> _≤_ _xk_ _≤_ 3.2 Learning the optimal controller With the aid of the Multi-Parametric Toolbox (MPT) [21], the optimal eMPC solution _π_ ( _x_ ) was calculated and consisted of 2’337 critical regions. By counting the number of parameters necessary to describe each halfspace and control gain, the memory requirement of this PWA function was found to be 518 kB. In the previous calculation, a 4 byte representation was considered for both integers and floating point numbers. Next, 5’000 samples were randomly acquired from the eMPC controller using a uniform distribution. The first and second components of the sampled control moves had considerably smaller amplitudes compared to the third due to the structure of the Lunze transform Ψ. The dataset labels _{_ u _i}_ <sup>5000</sup> _i_ =1 <sup>had</sup> <sup>therefore</sup> <sup>to</sup> <sup>be</sup> <sup>scaled</sup> <sup>to</sup> <sup>ensure</sup> <sup>a</sup> <sup>similar</sup> <sup>learning</sup> <sup>of</sup> all control components. Moreover, instead of ProjU( _y_ 3), the last NN layer was simplified to _y_ 4 = Ψ sat( _y_ 3) with saturation limits 0 and 0 _._ 9 _Vin_ . This clearly guarantees control feasibility without the need of a second quadratic program. NN approximators were trained using `PyTorch` and the `OptNet` framework [17]. A mean squared error loss function was minimized by employing the Adam algorithm, mini-batch stochastic gradient descent with batch size 50, and 150 epochs. The size _nz_ of the pQP layer was varied from 1 to 7 and a total of 10 models were trained for each size; the lowest obtained losses are shown in Figure 3. On average, training a model required 42 minutes on a 3.1 GHz Intel Core i7 machine without GPU acceleration, and 23 minutes with a single NVIDIA Tesla T4 graphics card. The learned parameters were then exported to MATLAB in order to calculate the PWA solution of the pQP layer. An increase in the _nz_ size clearly expands the representation capabilities of the neural network. This however does not always translate to a decrease in the final loss since the training process is affected by the weights initialization among other factors. Although not monotonic, we see a decrease of the overall training loss in Figure 3 as _nz_ grows. In order to validate the models, the start-up response of the converter was analyzed under all 7 different approximate controllers, and only the two largest ones ( _nz_ = 6 and _nz_ = 7) met the target specifications given in Section 3.1. We refer to these two solutions as the _viable_ _learned_ _controllers_ . Slices of their control surfaces are shown in Figure 4 <sup>3</sup>, and a phase portrait of the closed-loop system evolution over 50 steps starting from four initial conditions is depicted in Figure 5. A summary of the two viable learned controller features is presented in Table 2, including the number of polytopic regions, the storage requirements, the worst 3The _vout_ axis was extended to -100 V for visualization purposes. 7 350 300 250 200 150 100 400 Optimal solution π (x) Optimal solution π (x) 30 10 -20 -30 -50 5 0 2.5 -5 -2.5 idm1 300 200 vout 100 0 -100 30 20 -10 0 10 icm idm2 -2.5 -5 -5 -2.5 0 idm1 5 2.5 0 idm2 -2.5 -5 350 300 250 200 150 100 400 π^ (x), nz= 7 π^ (x), nz= 7 30 10 -20 -30 -50 5 0 2.5 -5 -2.5 idm1 300 200 vout 100 0 -100 30 20 -10 0 10 icm 5 2.5 0 idm2 -2.5 -5 idm2 -2.5 -5 -5 -2.5 0 idm1 350 300 250 200 150 100 400 π^ (x), nz= 6 π^ (x), nz= 6 30 10 -20 -30 -50 5 0 2.5 -5 -2.5 idm1 300 200 vout 100 0 -100 30 20 -10 0 10 icm 5 2.5 0 idm2 -2.5 -5 idm2 -2.5 -5 -5 -2.5 0 idm1 350 300 250 200 150 100 400 ### ... ... π^ (x), nz= 2 π^ (x), nz= 2 30 10 -20 -30 -50 5 0 2.5 -5 -2.5 idm1 300 200 vout 100 0 -100 30 20 -10 0 10 icm 5 2.5 0 idm2 -2.5 -5 idm2 -2.5 -5 -5 -2.5 0 idm1 350 300 250 200 150 100 400 π^ (x), nz= 1 π^ (x), nz= 1 30 10 -20 -30 -50 5 0 2.5 -5 -2.5 idm1 300 200 vout 100 0 -100 30 20 -10 0 10 icm 5 2.5 0 idm2 -2.5 -5 idm2 -2.5 -5 -5 -2.5 0 idm1 Figure 4: Slices of the optimal eMPC controller _π_ ( _x_ ) and several PWA NN approximations _π_ ˆ ( _x_ ). The left plots are associated to _vcm_ and the right plots, to _vdm_ 1. case computation time <sup>4</sup> and the steady state (SS) error for _icm_ and _vout_ - both clearly always equal. Even though four initial states were given, the systems always converged to the same points and, hence, only one SS error is reported. Plus, the storage numbers also take into account all the remaining layers parameters. Analyzing the obtained results we see that the approximations drastically reduced the storage requirements by 93.4% and 96.7% and sped up the worst-case evaluation time by 83.7% and 88.4%, respectively for the _nz_ = 7 and _nz_ = 6 cases. The closed-loop trajectories with the proposed _π_ ˆ ( _x_ ) remained reasonably close to the scenario with the optimal _π_ ( _x_ ), converging to nearby equilibrium points. In practice, steady-state errors could be removed by using the tools mentioned in Section 2.4. 4Before proceeding to implementation, a further speed up is possible through the methods listed in the Introduction. 8 Table 2: Optimal <u>and</u> <u>viable</u> <u>learned</u> <u>controllers</u> <u>information</u> <u>Regions</u> <u>Storage</u> <u>Comp.</u> <u>time</u> <u>SS</u> <u>error</u> _<u>π</u>_ <u>(</u> _<u>x</u>_ <u>)</u> <u>2’337</u> <u>518 kB</u> <u>12.9 ms</u> <u>0%</u> _<u>π</u>_ <u>ˆ</u> <u>(</u> _<u>x</u>_ <u>),</u> _<u>nz</u>_ <u>=</u> <u>7</u> <u>107</u> <u>34 kB</u> <u>2.1 ms</u> <u>0.59%</u> _<u>π</u>_ <u>ˆ</u> <u>(</u> _<u>x</u>_ <u>),</u> _<u>nz</u>_ <u>=</u> <u>6</u> <u>56</u> <u>17 kB</u> <u>1.5 ms</u> <u>1.25%</u> 400 π (x) 350 300 250 200 150 100 50 0 ~~π~~ <u>^</u> ~~(x), nz=~~ ~~7~~ π^ (x), nz= 6 <u>-5</u> <u>0</u> <u>5</u> <u>10</u> <u>15</u> <u>20</u> <u>25</u> <u>30</u> icm Figure 5: Output voltage and common mode current phase portraits when employing the optimal controller and the two viable approximations. #### 4 Conclusion We proposed a novel method to approximate explicit MPC controllers from samples of the optimal control law. The essence of the approach is a Neural Network architecture featuring a pQP layer incorporated to learn the MPC dual problem. It was shown that, with an appropriate pQP size, it is possible to learn any linear quadratic MPC exactly. After its training, an equivalent representation of the NN can be found off-line as a new and simpler controller. Steady-state errors due to approximation inaccuracies can be mitigated by employing standard tools. A numerical example was provided where the storage requirements and computational burden of the approximate PWA controllers were significantly lower than their optimal counterpart with minor performance degradation. #### References [1] A. Alessio and A. Bemporad, “A survey on explicit model predictive control,” in _Non-_ _linear_ _model_ _predictive_ _control_ . Springer, 2009, pp. 345–369. [2] C. N. Jones, P. Grieder, and S. V. Rakovi´c, “A logarithmic-time solution to the point location problem for parametric linear programming,” _Automatica_, vol. 42, no. 12, pp. 2215–2218, 2006. [3] F. Bayat, T. A. Johansen, and A. A. Jalali, “Using hash tables to manage the time storage complexity in a point location problem: Application to explicit model predictive control,” _Automatica_, vol. 47, no. 3, pp. 571–577, 2011. [4] M. M¨onnigmann and M. Kastsian, “Fast explicit MPC with multiway trees,” _IFAC_ _Proceedings_ _Volumes_, vol. 44, no. 1, pp. 1356–1361, 2011. 9 [5] E. T. Maddalena, R. K. H. Galv˜ao, and R. J. M. Afonso, “Robust region elimination for piecewise affine control laws,” _Automatica_, vol. 99, pp. 333–337, 2019. [6] M. Kvasnica, P. Bakar´aˇc, and M. Klauˇco, “Complexity reduction in explicit MPC: A reachability approach,” _Systems_ _&_ _Control_ _Letters_, vol. 124, pp. 19–26, 2019. [7] J. A. Rossiter and P. Grieder, “Using interpolation to improve efficiency of multipara metric predictive control,” _Automatica_, vol. 41, no. 4, pp. 637–643, 2005. [8] F. J. Christophersen, M. N. Zeilinger, C. N. Jones, and M. Morari, “Controller com plexity reduction for piecewise affine systems through safe region elimination,” in _2007_ _46th_ _IEEE_ _Conference_ _on_ _Decision_ _and_ _Control_, 2007, pp. 4773–4778. [9] M. Kvasnica, J. L¨ofberg, and M. Fikar, “Stabilizing polynomial approximation of ex plicit MPC,” _Automatica_, vol. 47, no. 10, pp. 2292–2297, 2011. [10] S. Summers, C. N. Jones, J. Lygeros, and M. Morari, “A multiresolution approximation method for fast explicit model predictive control,” _IEEE_ _Transactions_ _on_ _Automatic_ _Control_, vol. 56, no. 11, pp. 2530–2541, 2011. [11] C. N. Jones and M. Morari, “Polytopic approximation of explicit model predictive controllers,” _IEEE_ _Transactions_ _on_ _Automatic_ _Control_, vol. 55, no. 11, pp. 2542–2553, 2010. [12] T. Parisini and R. Zoppoli, “A receding-horizon regulator for nonlinear systems and a neural approximation,” _Automatica_, vol. 31, no. 10, pp. 1443–1451, 1995. [13] S. Chen, K. Saulnier, N. Atanasov, D. D. Lee, V. Kumar, G. J. Pappas, and M. Morari, “Approximating explicit model predictive control using constrained neural networks,” in _2018_ _Annual_ _American_ _Control_ _Conference_ _(ACC)_, 2018, pp. 1520–1527. [14] M. Kvasnica and M. Fikar, “Clipping-based complexity reduction in explicit MPC,” _IEEE_ _Transactions_ _on_ _Automatic_ _Control_, vol. 57, no. 7, pp. 1878–1883, 2011. [15] S. Mari´ethoz and M. Morari, “Explicit model-predictive control of a PWM inverter with an LCL filter,” _IEEE_ _Transactions_ _on_ _Industrial_ _Electronics_, vol. 56, no. 2, pp. 389–399, 2008. [16] S. Gould, B. Fernando, A. Cherian, P. Anderson, R. S. Cruz, and E. Guo, “On dif ferentiating parameterized argmin and argmax problems with application to bi-level optimization,” _arXiv_ _preprint_ _arXiv:1607.05447_, 2016. [17] B. Amos and J. Z. Kolter, “Optnet: Differentiable optimization as a layer in neural networks,” in _Proceedings_ _of_ _the_ _34th_ _International_ _Conference_ _on_ _Machine_ _Learning-_ _Volume_ _70_, 2017, pp. 136–145. [18] A. B. Hempel, P. J. Goulart, and J. Lygeros, “Every continuous piecewise affine function can be obtained by solving a parametric linear program,” in _2013_ _European_ _Control_ _Conference_ _(ECC)_, 2013, pp. 2657–2662. [19] S. J. Wright, “Efficient convex optimization for linear MPC,” in _Handbook_ _of_ _Model_ _Predictive_ _Control_ . Springer, 2019, pp. 287–303. [20] M. Korda and C. N. Jones, “Stability and performance verification of optimization based controllers,” _Automatica_, vol. 78, pp. 34–45, 2017. [21] M. Herceg, M. Kvasnica, C. N. Jones, and M. Morari, “Multi-parametric toolbox 3.0,” in _2013_ _European_ _control_ _conference_ _(ECC)_, 2013, pp. 502–510. 10

섹션 본문 43문단 · 20,671자

(제목 없음)

1We present a methodology to learn explicit Model Predictive Control (eMPC) laws from sample data points with tunable complexity. The learning process is cast in a special Neural Network setting where the coefficients of two linear layers and a parametric quadratic program (pQP) implicit layer are optimized to fit the training data. Thanks to this formulation, powerful tools from the machine learning community can be exploited to speed up the off-line computations through high parallelization. The final controller can be deployed via low-complexity eMPC and the resulting closed-loop system can be certified for stability using existing tools available in the literature. A numerical example on the voltage-current regulation of a multicell DC-DC converter is provided, where the storage and on-line computational demands of the initial controller are drastically reduced with negligible performance impact.

Introduction

2Model Predictive Control (MPC) is a valuable control methodology to be considered whenever performance needs to be maximized, possibly operating the system close to its physical constraints. For certain classes of problems -e.g. when the dynamics and constraints are affine and the objective is quadratic -a closed-form solution exists, mapping the current state to the control inputs through a continuous piecewise-affine (PWA) function. This approach is known as explicit Model Predictive Control (eMPC) and is particularly employed when the hardware where such a control law is to be implemented cannot solve the MPC mathematical program on-line (either for time limitations or even safety regulations regarding the final application). Unfortunately, eMPC controllers might also suffer from having high complexity due to the exponential growth of the number of regions in the worst case [1], thus leading to not only high memory requirements but also high computational times.

3Scaling down the memory footprint and computational burden of eMPC is possible through a variety of techniques. Given a measurement of the current state, deciding in which region of the polyhedral partition the system is can be efficiently accomplished using search trees, hash tables, among other data structures [2,3,4]. If some information is known about the initial condition of the plant (even if only with respect to a subset of the states), reachability arguments can be used to drop polytopic cells that are guaranteed not to be visited during operation; this was recently studied in [5] and in [6]. Additional region elimination schemes were presented in [7] and [8], where an interpolation strategy and a backup control law were respectively defined to be used in case the system visited a state whose region had been eliminated. Finally, approximation methods for eMPC were investigated using polynomial functions [9], multi-scale basis [10], as well as piecewise-affine functions [11].

4The use of Neural Networks (NN) to learn nonlinear MPC controllers was studied in [12], where one hidden layer and sigmoid activation functions were employed. The authors assumed a specific degree of regularity of the obtained approximator in terms of a bound of an integral weighted by its Fourier decomposition coefficients. It was then shown that the final NN approximation error can be bounded. More recently, [13] proposed training a NN with rectified linear units by means of reinforcement learning instead of fully supervised learning. The context was that of quadratic MPC for linear systems. Their approach was shown to alleviate the training phase computations, especially since the system model can be exploited at this stage. Nevertheless, no guarantees of closed-loop stability are given or even tools to analyze it a posteriori -a rather common drawback of machine learning approximators.

5Contribution: Herein we propose a method to fit datapoints sampled from an MPC controller -either in implicit or explicit form -with a particular type of Neural Netowrk. The architecture is defined by two linear layers and an implicit parametric quadratic program (pQP) layer, which together are able to capture any linear MPC problem with quadratic cost. In contrast with the majority of previous approaches such as [7,8,14], the final complexity is incremental and can be flexibly adjusted. The resulting approximator can be deployed essentially as a new simpler eMPC controller, and closed-loop stability can be certified a posteriori with tools already available in the literature. A case study in the power electronics domain, where several successful implementations of eMPC have been reported (see e.g. [15]), is presented to illustrate the potential of the proposed methodology. Although the proposed simplification technique gives up the original controller optimality, our numerical investigations show that significant complexity reduction is possible with little to negligible performance degradation 1 .

6Notation: R n is the n-dimensional Euclidean space equipped with its usual norm. Given a matrix A, its transpose is denoted by A , and A ( ) 0 means it is positive-definite (semidefinite). Furthermore, ||v|| 2 A is defined as ||v Av|| 2 , I denotes an identity matrix of appropriate size, and 0 denotes a zero matrix of appropriate size. diag(a 1 , . . . , a n ) represents a diagonal matrix with entries a 1 , . . . , a n .

Learning Predictive Controllers

7Consider the following standard MPC formulation for linear dynamical systems P1 : min

8where X := {x 1 , . . . , x H }, U := {u 0 , . . . , u H−1 }, Q 0, P 0, R 0, and the constraints are all described by affine equalities and inequalities. Denote by π : X → U the optimal solution of (1) in its parametric form with respect to the initial conditions x(0), where X ⊆ R n is the feasible state space of P1 and U ⊆ R m is the control space. We assume a set of N samples can be acquired from the original control law 2

9The process of acquiring the training dataset does not have to follow a particular distribution, nor do the samples have to be independent. y 2 = arg min ||Lz+y 1 || 2 +"||z|| 2 z≥0F igure 1: An illustration of the NN eMPC controller approximator. The parameters to be optimized are shown on the left-hand side.

The proposed architecture

10The key idea behind the proposed approximator is the use of a parametric quadratic program layer as part of the Neural Network, and optimizing over its parameters in order to fit the available dataset. This layer is implicitly described by the quadratic program

11which is always feasible and bounded from below. The size of this mathematical program, i.e. the dimension of z, can be tuned to attain approximations with different complexity. Moreover, as notation suggests, the parameter y 1 depends on a previous affine layer that maps the system states into the z space, y 1 := F x + f . Let y 2 := z , then another affine layer maps the optimal solution to the input space y 3 := Gy 2 + g, and a projection onto the feasible input set produces the final control actionû := Proj U (y 2 ). This last step is necessary to guarantee feasibility of the control moves (see e.g. [13]). An illustration of the proposed architecture is presented in Fig. 1, where the projection layer was particularized to a familiar element-wise saturation operation sat(·), valid for box input constraints. Let the chosen number of decision variables in the pQP be z ∈ R nz . We choose L ∈ R nz×nz to be square, and therefore F ∈ R nz×n , f ∈ R nz . Moreover, G ∈ R m×nz and g ∈ R m . If n z ≥ n, the first layer lifts the input data into a higher dimensional space before it is passed through the optimization layer. A last affine function then projects it onto the control space. These facts will be later employed to analyze the representative power of the network.

12The parameters to be trained are therefore F , f , L, G and g. This process can be carried out via a stochastic gradient descent algorithm applied to an appropriate loss function. Differentiability of all layers is trivial with the exception of the pQP one [16,17]. Regarding the later, note that the objective in (3) can be rewritten as

13whose Lagrangian is simply

14The Karush-Kuhn-Tucker (KKT) conditions for primal and dual feasibility, complementary slackness, and stationarity then read

15where λ i and z i denote the components of the Lagrange multipliers and decision variables vectors. The following proposition presents the differentiability properties of the pQP layer, and holds since (3) is a particular instance of the OptNet layer [17] with strictly convex objective function.

16Proposition 1: Let θ := (L, y 1 ). The parametric solution z (θ) of (3) is subdifferentiable everywhere in its domain, i.e., ∂z (θ) = { }, and ∂z (θ) has a unique element (the jacobian) everywhere but in a set of measure zero.

17As shown in [17], the relevant gradients with respect to the parameters to be trained can be obtained from the KKT set of equations (6). Hence, backward passes are possible and backpropagation can be performed to optimize all of the NN parameters.

Properties of the approximator

18The authors of [18] showed that any continuous PWA function can be obtained as the solution of a particular parametric linear program (pLP) transformed by a linear map. Even though this view could be adopted herein, we instead prove a different result that is enough in the context of linear eMPC.

19Theorem 1: (The proposed NN architecture can learn any linear quadratic MPC controller) Letπ : X → U be the map defined by the composition of all four layers, i.e., π(x) := y 4 • y 3 • y 2 • y 1 (x). Set = 0, then ∃F , f , L, G and g with appropriate dimensions such that ∀x ∈ X,π(x) = π(x).

20Proof : Define the following parametric problem

21obtained from P1 by using the equality constraints to eliminate all state decision variables (see [19] for the construction of each matrix and vector). We also have that Λ 0. Problems P2 and P1 are then equivalent in the sense that the solution U of P2 and {X , U } of P1 have the same U component. Next, the dual problem of P2 can be shown to be D2 : min

22From the stationarity optimality condition of P2, it is possible to recover the primal optimal solution U from the dual optimal solution λ

23It would be possible to enforce the first two layers to match the dual problem D2, and the third to implement (9) and recover the primal solution. Nevertheless, this would require the third layer to have a so called skip connection directly from the NN input, i.e., access to x(0). We instead define slightly different linear and pQP layers that not only learn D2, but also let x(0) pass through them and arrive at the second linear layer.

24Let the auxiliary variableL and functionỹ 1 (x) :=F x +f be the solution to (compare (4) and (8)

25which is a separable objective inz,x p andx n . Due to the choice ofL andỹ 1 (x) in (10), the last term of the pQP matches the dual D2 with the exception of its constant term -not relevant for determining the optimal solution. Therefore, we have thatz in (11) matches λ in D2. Regarding x p , the n optimizer components will satisfy ∀i = 1, . . . , n,

26Next set the weights of the second linear layer y 3 to G = [−0.5Λ −1 Φ −0.5Λ −1 Γ 0.5Λ −1 Γ ] and g = 0. Therefore, y 3 = G [z x p x n ] = G [λ x p x n ] = U , where equality (9) was used in the last step. Finally, note that the last layer y 4 = Proj U (y 3 ) will simply evaluate to y 3 since y 3 is the optimal primal solution U , which satisfies the constraints (7b) and necessarily belongs to U. The theorem then follows from the fact that x(0) in the above calculations can be taken to be any point x in X.

27Exactly matching the original MPC controller would require L to have the same size of ΦΛ and = 0 as shown. Nevertheless, we are interested precisely in reducing the complexity of the resulting controller through employing less parameters. In this process, choosing a regularizer > 0 is beneficial since it ensures that the QP is bounded during the training phase for all possible parameters.

Stability certification

28After the NN has been trained and its weights have been defined, closed-loop stability in the sense of Lyapunov can be verified through sum-of-squares (SoS) programming. First note that the NN is a composition of linear maps and optimization problems. The central idea is that the forward pass involves calculating the optimal solution to these mathematical programs, which necessarily satisfy their respective KKT conditions, e.g. (6). Furthermore, these conditions are sets of polynomial inequalities in the primal-dual lifted space; hence, the control moves are defined by polynomial and linear functions. As the system being controlled is linear, the certification technique presented in [20] can be readily applied.

Controller deployment

29The final approximated control law u =π(x) is evaluated by a forward pass in the NN. If the first and second linear layers are incorporated respectively into the pQP and projection ones, this can be done by solving the two (simpler) optimization problems on-line. Alternatively, two explicit PWA solutions can be calculated off-line with a bound on the number of regions dependent on the chosen size n z . If the constraints u ∈ U are simply a box -as in many practical applications -an element-wise saturation is the closed-form solution to the projection layer u = y 3 = Proj U (y 2 ), further simplifying the final controller. We illustrate the use of the proposed technique in a power electronics context in the next section.

30Any discrepancy betweenπ(x) and π(x) in the region that contains the origin will result in steady-state errors. Several techniques can be used to overcome this issue. As discussed in [12], the LQR solution associated with (1) can be stored and used whenever the system is inside the associated invariant set, where no constraints are active. Alternatively, an external disturbance estimator could be adopted to account for the optimal-approximate controller mismatch.

Control of a step-down converter

31In order to enhance readability and stay consistent with the standard circuits convention, notation will be overloaded.

Analysis and controller design

32Parallelism is a key concept to increase the efficiency and power levels of electronic converters. Still, this design choice has to be followed by proper current/voltage balancing techniques to ensure that no stage is subjected to a higher electrical stress when compared to the others.

33A schematic representation of a multicell step-down converter is shown in Fig. 2, and its parameters can be found in Table 1. The topology features three arms that are connected to a coupled inductor, and an L-C output filter. All self inductances are assumed equal In order to ease the analysis, we apply the Lunze transform Ψ to all variables, decomposing the phase voltages and currents into differential and common mode components

34The control input is defined as u := [v dm1 v dm2 v cm ] and the continuous-time state vector, by appending the output voltage to the transformed currents x := [i dm1 i dm2 i cm v out ] . By using Kircchoff's circuit laws, a linear model of the formẋ = A ct x + B ct u can be derived with

35Finally, discretization at frequency f is carried out using the zero-order hold method, yielding

36The control goal is to regulate the output voltage v out to 300 V while maintaining the phase currents balanced at all times, which translates to driving the differential currents to zero. More specifically we have the following fixed reference x eq = [0 0 16 300] with u eq = B † (I − A)x eq , where B † is the pseudo-inverse of B. Moreover, the controller approximation procedure must not incur a steady-state error larger than 200 mA for i dm1 and i dm2 , and 5% for the common mode component i cm and output voltage v out . The chosen MPC cost function was

37where Q = diag ( Size n z of the NN pQP layer were imposed −5 −5 −10 −20 ≤ x k ≤ 5 5 30 400 and polyhedron constraints on the controls H u u k ≤ h u that simply mapped the duty cycle saturation to the Lunze domain. Due to the polytopic input constraints, the system cannot be decomposed into three decoupled parts as the structure of matrices A ct and B ct suggest. Furthermore, the standard terminal set constraint was imposed on x H , defined as the invariant set associated to the unconstrained infinite-time problem formulation.

Learning the optimal controller

38With the aid of the Multi-Parametric Toolbox (MPT) [21], the optimal eMPC solution π(x) was calculated and consisted of 2'337 critical regions. By counting the number of parameters necessary to describe each halfspace and control gain, the memory requirement of this PWA function was found to be 518 kB. In the previous calculation, a 4 byte representation was considered for both integers and floating point numbers. Next, 5'000 samples were randomly acquired from the eMPC controller using a uniform distribution. The first and second components of the sampled control moves had considerably smaller amplitudes compared to the third due to the structure of the Lunze transform Ψ. The dataset labels {u i } 5000 i=1 had therefore to be scaled to ensure a similar learning of all control components. Moreover, instead of Proj U (y 3 ), the last NN layer was simplified to y 4 = Ψ sat(y 3 ) with saturation limits 0 and 0.9 V in . This clearly guarantees control feasibility without the need of a second quadratic program. NN approximators were trained using PyTorch and the OptNet framework [17]. A mean squared error loss function was minimized by employing the Adam algorithm, mini-batch stochastic gradient descent with batch size 50, and 150 epochs. The size n z of the pQP layer was varied from 1 to 7 and a total of 10 models were trained for each size; the lowest obtained losses are shown in Figure 3. On average, training a model required 42 minutes on a 3.1 GHz Intel Core i7 machine without GPU acceleration, and 23 minutes with a single NVIDIA Tesla T4 graphics card. The learned parameters were then exported to MATLAB in order to calculate the PWA solution of the pQP layer.

39An increase in the n z size clearly expands the representation capabilities of the neural network. This however does not always translate to a decrease in the final loss since the training process is affected by the weights initialization among other factors. Although not monotonic, we see a decrease of the overall training loss in Figure 3 as n z grows. In order to validate the models, the start-up response of the converter was analyzed under all 7 different approximate controllers, and only the two largest ones (n z = 6 and n z = 7) met the target specifications given in Section 3.1. We refer to these two solutions as the viable learned controllers. Slices of their control surfaces are shown in Figure 4 3 , and a phase portrait of the closed-loop system evolution over 50 steps starting from four initial conditions is depicted in Figure 5. A summary of the two viable learned controller features is presented in Table 2, including the number of polytopic regions, the storage requirements, the worst- π(x), n z = 7 π(x), n z = 7

40π(x), n z = 6 π(x), n z = 6 π(x), n z = 2 π(x), n z = 2 π(x), n z = 1 π(x), n z = 1.

41. . . . . Figure 4: Slices of the optimal eMPC controller π(x) and several PWA NN approximationŝ π(x). The left plots are associated to v cm and the right plots, to v dm1 .

42case computation time 4 and the steady state (SS) error for i cm and v out -both clearly always equal. Even though four initial states were given, the systems always converged to the same points and, hence, only one SS error is reported. Plus, the storage numbers also take into account all the remaining layers parameters. Analyzing the obtained results we see that the approximations drastically reduced the storage requirements by 93.4% and 96.7% and sped up the worst-case evaluation time by 83.7% and 88.4%, respectively for the n z = 7 and n z = 6 cases. The closed-loop trajectories with the proposedπ(x) remained reasonably close to the scenario with the optimal π(x), converging to nearby equilibrium points. In practice, steady-state errors could be removed by using the tools mentioned in Section 2.4.

Conclusion

43We proposed a novel method to approximate explicit MPC controllers from samples of the optimal control law. The essence of the approach is a Neural Network architecture featuring a pQP layer incorporated to learn the MPC dual problem. It was shown that, with an appropriate pQP size, it is possible to learn any linear quadratic MPC exactly. After its training, an equivalent representation of the NN can be found off-line as a new and simpler controller. Steady-state errors due to approximation inaccuracies can be mitigated by employing standard tools. A numerical example was provided where the storage requirements and computational burden of the approximate PWA controllers were significantly lower than their optimal counterpart with minor performance degradation.

참고문헌 21건

  1. Stability and performance verification of optimization-based controllers Automatica · Elsevier BV · 2017 10.1016/j.automatica.2016.12.008
  2. Multi-Parametric Toolbox 3.0 2022 European Control Conference (ECC) · 2013 10.23919/ecc.2013.6669862
  3. Every continuous piecewise affine function can be obtained by solving a parametric linear program 2022 European Control Conference (ECC) · 2013 10.23919/ecc.2013.6669386
  4. Clipping-Based Complexity Reduction in Explicit MPC IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2011 10.1109/tac.2011.2179428
  5. A logarithmic-time solution to the point location problem for parametric linear programming Automatica · Elsevier BV · 2006 10.1016/j.automatica.2006.07.010
  6. Stabilizing polynomial approximation of explicit MPC Automatica · Elsevier BV · 2011 10.1016/j.automatica.2011.08.023
  7. A receding-horizon regulator for nonlinear systems and a neural approximation Automatica · Elsevier BV · 1995 10.1016/0005-1098(95)00044-w
  8. Using interpolation to improve efficiency of multiparametric predictive control Automatica · Elsevier BV · 2004 10.1016/j.automatica.2004.08.021
  9. Polytopic Approximation of Explicit Model Predictive Controllers IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2010 10.1109/tac.2010.2047437
  10. Using hash tables to manage the time-storage complexity in a point location problem: Application to explicit model predictive control Automatica · Elsevier BV · 2011 10.1016/j.automatica.2011.01.009
  11. Explicit Model-Predictive Control of a PWM Inverter With an <i>LCL</i> Filter IEEE Transactions on Industrial Electronics · Institute of Electrical and Electronics Engineers · 2008 10.1109/tie.2008.2008793
  12. Controller complexity reduction for piecewise affine systems through safe region elimination 2007 10.1109/cdc.2007.4434694
  13. A Multiresolution Approximation Method for Fast Explicit Model Predictive Control IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2011 10.1109/tac.2011.2146990
  14. Fast explicit MPC with multiway trees IFAC Proceedings Volumes · Elsevier BV · 2011 10.3182/20110828-6-it-1002.00686
  15. On Differentiating Parameterized Argmin and Argmax Problems with Application to Bi-level Optimization arXiv (Cornell University) · Cornell University · 2016 10.48550/arxiv.1607.05447
  16. OptNet: Differentiable Optimization as a Layer in Neural Networks arXiv (Cornell University) · Cornell University · 2017
  17. Approximating Explicit Model Predictive Control Using Constrained Neural Networks 2018 10.23919/acc.2018.8431275
  18. Efficient Convex Optimization for Linear MPC Control engineering · Springer International Publishing · 2018 10.1007/978-3-319-77489-3_13
  19. Robust region elimination for piecewise affine control laws Automatica · Elsevier BV · 2018 10.1016/j.automatica.2018.10.042
  20. Complexity reduction in explicit MPC: A reachability approach Systems & Control Letters · Elsevier BV · 2018 10.1016/j.sysconle.2018.12.002
  21. Handbook of Model Predictive Control Control engineering · Springer International Publishing · 2018 10.1007/978-3-319-77489-3