Design and Implementation of Interior-Point Method Based Linear Model Predictive Controller Vihangkumar V. Naik, D.N. Sonawane, Deepak D. Ingole, Divyesh L. Ginoya, and Neha S. Girme Department of Instrumentation & Control Engineering, College of Engineering, Pune- 411 005 Maharashtra, India {naikvihang,dlginoya007,nehagirme}@gmail.com,
[email protected],
[email protected]
Abstract. Linear model predictive control (MPC) assumes a linear system model, linear inequality constraints and a convex quadratic cost function. Thus, it can be formulated as a quadratic programming (QP) problem. Due to associated computational complexity of QP solving algorithms, its applicability is restricted to relatively slow dynamic systems. This paper presents an interiorpoint method (IPM) based QP solver for the solution of optimal control problem in MPC. We propose LU factorization to solve the system of linear equations efficiently at each iteration of IPM, which renders faster execution of MPC. The approach is demonstrated practically by applying MPC to QET DC Servomotor for position control application. Keywords: Model Predictive Control, Interior-Point Method, LU factorization, DC Servomotor.
1
Introduction
We are considering interior-point algorithm used on-line with linear Model Predictive Control (MPC). Linear MPC assumes a linear system model, linear inequality constraints and a convex quadratic cost function [1]. MPC can be formulated as a quadratic programming (QP) problem and solved at each sampling interval. It thus has the natural ability to handle physical constraints arising in industrial applications [2]. At each sampling instance MPC solves an online QP optimization problem, computes the sequence of optimal current and future control inputs by minimizing the difference between set-points and future outputs predicted from a given plant model over a finite horizon in forward time. Then, only the current optimal input is applied to the plant. The updated plant information is used to formulate and solve a new optimal control problem at the next sampling instance. This procedure is repeated at the each sampling instance and the concept is called as receding horizon control MPC strategy. Since this quadratic program can be large depending upon control problem, V.V. Das and Y. Chaba (Eds.): AIM/CCPE 2012, CCIS 296, pp. 255–261, 2013. © Springer-Verlag Berlin Heidelberg 2013
256
V.V. Naik et al.
MPC requires long computation times at each sampling instants, therefore it is usually restricted to systems with slow dynamics and large sampling intervals, such as chemical processes [3]. The ability to solve the QP problem online become critical when applying MPC to systems with fast response time and/or embedded applications where computational resource may be limited [4]. Recently, many reports in the literature address applying MPC to control applications with short sampling intervals, by adapting fast optimization algorithms. These algorithms solve the resulting QP by exploiting the special structure of the control problem the MPC sub problem. The interior-point method (IPM) approaches the solution of Karush-Kuhn-Tucker (KKT) equations by successive decent steps. Each decent step is Newton’s like step and the solution is obtained by solving system of linear equations using appropriate numerical methods in order to determine search direction. Matrix decomposition and factorization algorithm provides a means to simplify the computation involved in linear solver. Different decomposition and factorization methods are used such as Gauss elimination, QR, LU, and Cholesky [3], [5], [6]. In this paper, we present an interior-point algorithm to solve MPC problem, which utilizes Mehrotra's predictor-corrector algorithm [7], and the linear system at each IPM iteration is solved efficiently by a LU factorization based Linear Solver. This remainder of the paper is organized as follows: section 2 describes MPC problem formulation. Section 3 presents the interior-point method. MPC implementation on Quanser QET DC Servomotor is presented in section 4. Section 5 shows experimental results. Section 6 is conclusion.
2
MPC Problem Formulation
A discrete time linear time-invariant model of a system in a state space form is given as, x t
1 Ax t Bu t y t Cx t
.
(1)
are output vectors, u t are input vectors and x t where, y t internal states vectors. The objective function is defined as, min , J where, Δu t
N
∑ i|t
y t u
i|t u
y
t
i|t
∑N
Δu t
i|t
.
are (2)
subjected to linear inequality constraints on system inputs, where N is prediction horizon, N is control horizon [8]. In turn, the MPC problem is formulated as a QP problem, min J U
UTH U
f T U subjected to AU
b.
where, H is Nu X Nu Hessian matrix, f is Nu X 1 column vector [8], [10].
(3)
Design and Implementation of Interior-Point Method
3
257
Interior-Point Method
Consider the following standard QP problem, x T Qx
min
C T x subjected to Ax
b, Lx
k.
(4)
Except equality constraints in (4), it resembles (3). The KKT Conditions for optimality are given by, Qx
AT y LT z Ax b Lx s k zT s 0 z, s 0
C .
(5)
where, y and z represents the Lagrange multipliers for the equality and inequality constraints respectively. The slack variable s is introduced for converting inequality into equality. By applying Newton’s method search direction (Δx, Δy, Δz, Δs is obtained as shown in (6), where J x, z, λ, s denotes Jacobian of f x, z, λ, s ,
J x, z, λ, s
Δx Δy Δz Δs
r1 r2 r3 r4
(6)
If we consider only inequality constraints and augmented form of original system is given as, ∆s Q L
Z
r4
Δx LT Z S Δz
S∆z . r3
(7)
r1 . Z r4
(8)
We use Mehrotra’s Predictor-corrector algorithm [7] to solve (8) for (Δx, Δz . Predictor or affine and corrector-centering steps uses r1, r3, r4 values from (9) and (10) respectively to form the right-hand side of (7) and (8) which in turn finds (∆x , ∆z , ∆s ) and (∆x , ∆z , ∆s [1], [11], [12], [13]. r1 r3 r4 r1 r3 r4
diag ∆z
Qx C LT z Lx s k . ZSe 0 0 diag ∆s
e
(9)
σµe
.
(10)
where, σ is centering parameter and µ is complementarity measure or duality gap. Thus, solution of linear system in (8) is to be calculated twice at each iteration of IPM, which puts major computational load on overall performance of IPM, and
258
V.V. Naik et al.
eventually on MPC. Linear system in (8) uses two different right-hand side components but the same coefficient matrix, so just one factorization of this matrix is required per iteration. Such system can be solved using Gauss elimination, QR, LU, Cholesky factorization methods. The coefficient matrix in a linear system (8) involved in IPM is symmetric and indefinite so conventional and more numerically stable Cholesky factorization cannot be used to solve the linear system. Compared to computational cost of QR decomposition (2/3n and the problem of associated pivoting with ill condition of Gauss elimination, LU factorization proves to be more effective and accurate to solve system of linear equations [5], [6]. We propose LU factorization based Linear Solver for the same. The pseudo code of LU factorization Linear Solver for (8) is given as follows: Pseudo Code-LU factorization A ; where, A A A ; A A Q; A B ; B ; where, B B r1 ; B r3 A LU; Solve LY=B // forward sustitution UX=Y // backward substitution X X ;X ; ∆x X ; ∆z X ;
4
L; Z
A r4
L;
A
Z
S
MPC Implementation on Quanser QET DC Servomotor
In this paper the efficacy of the proposed method is implemented and demonstrated practically on Quanser QET DC Servomotor plant. The experimental setup has DC Servomotor with Q2 USB based data acquisition card and a PC equipped with proprietary QuaRc 2.1 software. QuaRc provides hardware-in-loop simulation environment [15]. Motor shaft position θ(t) is measured by an encoder. High pass filter is designed to get motor shaft velocity ω(t) numerically. The proposed real-time MPC implementation strategy is shown in Fig. 1.
Fig. 1. Real-time MPC Implementation strategy for position control of QET DC Servomotor
Design and Implementation of Interior-Point Method
259
The state space representation of DC Servomotor model is given as, A
5
0 0
1 ,B 10
0 ,C 210
1
0 ,D
0 .
(11)
Experimental Results
The proposed algorithm is coded in MATLAB. Fig. 2 shows per iteration computation time comparison of proposed method with QR factorization and MATLAB’s QP solver quadprog.
Fig. 2. Computation Time Comparison of QP Solving Algorithms
The performance of QP solver for linear MPC is tested for position control of DC Servomotor with 0.01s sample time. Fig. 3 shows the response of the system output by keeping for reference tracking and effect of change of prediction horizon N control horizon (N constant. Step response of controller to load disturbances and system uncertainties is shown in Fig. 4. The constraints on control input are -10V and +10V, form Fig. 3 and Fig.4, the constraint handling capability of MPC is verified.
Fig. 3. MPC response to reference position for different prediction horizon
260
V.V. Naik et al.
Fig. 4. MPC response to load disturbances
6
Conclusion
In this paper, we presented LU factorization based linear solver for solution of IPM, which is used for real time implementation of constrained linear Model Predictive Controller for position control of DC Servomotor. From experimentation results, it is observed that, the proposed method for MPC solves QP problem efficiently within the specified sample period and performs well for tracking a reference position of DC Servomotor which is relatively a fast dynamic system. It is also observed that, the controller is robust to handle parameter uncertainties and load disturbances. Acknowledgment. We would like to thank Rashmi More from Department of Mathematics, College of Engineering, Pune, for her sustained contribution towards this work.
References 1. Wills, A.G., Heath, W.P.: Interior-Point Methods For Linear Model Predictive Control. In: Control 2004. University of Bath, UK (2004) 2. Wills, A., Mills, A., Ninness, B.: FPGA Implementation of an Interior-Point Solution for Linear Model Predictive Control. In: Preprints of the 18th IFAC World Congress, Milano, Italy, pp. 14527–14532 (2011) 3. Rao, C.V., Wright, S.J., Rawlings, J.B.: Application of interior point methods to model predictive control. Journal of Optimization Theory and Applications, 723–757 (1998) 4. Ling, K.V., Yue, S.P., Maciejowski, J.M.: A FPGA Implementation of Model Predictive Control. In: Proceedings of the 2006 American Control Conference, Minneapolis, Minnesota, USA, pp. 1930–1935 (2011) 5. Sudarsanam, A., Hauser, T., Dasu, A., Young, S.: A Power Efficient Linear Equation Solver on a Multi-FPGA Accelerator. International Journal of Computers and Applications 32(1), 1–19 (2010)
Design and Implementation of Interior-Point Method
261
6. Chai, W., Jiao, D.: An LU Decomposition Based Direct Integral Equation Solver of Linear Complexity and Higher-Order Accuracy for Large-Scale Interconnect Extraction. IEEE Transactions on Advanced Packaging 33(4), 794–803 (2010) 7. Mehrotra, S.: On Implementation of a primal-dual interior-point method. SIAM Journal on Optimization 2(4), 575–601 (1992) 8. Maciejowski, J.M.: Predictive Control with Constraints. Pearson Education Limited 9. Wright, S.J.: Applying new optimization algorithms to model predictive control. In: Chemical Process Control-V, CACHE, AIChE Symposium Series, vol. 93(316), pp. 147–155 (1997) 10. Wills, A.G.: EE04025 - Notes on Linear Model Predictive Control. Technical Report (2004) 11. Kruth, T.R.: Interior-Point Algorithms for Quadratic Programming. IMM-M.Sc-2008-19, Technical University of Denmark (2008) 12. Nejdawi, I.M.: An Efficient interior Point Method for Sequential Quadratic Programming Based Optimal Power Flow. IEEE Trasactions on Power Systems 15(4), 1179–1183 (2000) 13. Wills, A.G., Heath, W.P.: EE03016 Inerior-Point Methods for Linear Model Predictive Control. Technical Report, University of Newcastle, Australia (2003) 14. Stinga, F., Roman, M., Soimu, A., Bobasu, E.: Optimal and MPC Control of the Quanser Flexible Link Experiment. In: 4th WSEAS/IASME International Conference on Dynamical Systems and Control (Control 2008), Greece, pp. 175–180 (2008) 15. Introduction to QuaRc 2.0 & DCMCT Instructor manual and Hardware Guide. Quanser Inc., Markham, ON, Canada (2010)