A Neural Network Architecture to Learn Explicit MPC Controllers from Data
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
기본 정보
- 저자
- 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자
본문 펼치기
섹션 본문 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건
- Stability and performance verification of optimization-based controllers Automatica · Elsevier BV · 2017 10.1016/j.automatica.2016.12.008
- Multi-Parametric Toolbox 3.0 2022 European Control Conference (ECC) · 2013 10.23919/ecc.2013.6669862
- 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
- Clipping-Based Complexity Reduction in Explicit MPC IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2011 10.1109/tac.2011.2179428
- A logarithmic-time solution to the point location problem for parametric linear programming Automatica · Elsevier BV · 2006 10.1016/j.automatica.2006.07.010
- Stabilizing polynomial approximation of explicit MPC Automatica · Elsevier BV · 2011 10.1016/j.automatica.2011.08.023
- A receding-horizon regulator for nonlinear systems and a neural approximation Automatica · Elsevier BV · 1995 10.1016/0005-1098(95)00044-w
- Using interpolation to improve efficiency of multiparametric predictive control Automatica · Elsevier BV · 2004 10.1016/j.automatica.2004.08.021
- Polytopic Approximation of Explicit Model Predictive Controllers IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 2010 10.1109/tac.2010.2047437
- 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
- 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
- Controller complexity reduction for piecewise affine systems through safe region elimination 2007 10.1109/cdc.2007.4434694
- 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
- Fast explicit MPC with multiway trees IFAC Proceedings Volumes · Elsevier BV · 2011 10.3182/20110828-6-it-1002.00686
- On Differentiating Parameterized Argmin and Argmax Problems with Application to Bi-level Optimization arXiv (Cornell University) · Cornell University · 2016 10.48550/arxiv.1607.05447
- OptNet: Differentiable Optimization as a Layer in Neural Networks arXiv (Cornell University) · Cornell University · 2017
- Approximating Explicit Model Predictive Control Using Constrained Neural Networks 2018 10.23919/acc.2018.8431275
- Efficient Convex Optimization for Linear MPC Control engineering · Springer International Publishing · 2018 10.1007/978-3-319-77489-3_13
- Robust region elimination for piecewise affine control laws Automatica · Elsevier BV · 2018 10.1016/j.automatica.2018.10.042
- Complexity reduction in explicit MPC: A reachability approach Systems & Control Letters · Elsevier BV · 2018 10.1016/j.sysconle.2018.12.002
- Handbook of Model Predictive Control Control engineering · Springer International Publishing · 2018 10.1007/978-3-319-77489-3