QP_MPC2QP – Conversion of MPC problem to quadratic programming

Block SymbolLicensing group: ADVANCED
Qt SVG Document Exported by REXYGEN Studio np nc uA uBu uBv uC uQ uW uR ul uH uGx uGv uGw uSuL uSv uT uScuL uScv uTc uWORK HLD yA yBu yBv yC yQ yW yR yl yH yGx yGv yGw ySuL ySv yT yScuL yScv yTc yWORK E QP_MPC2QP

Function Description
Quadratic Programming (QP) is a standard technique which suites very well to solve Model based Predictive Control (MPC) problems [12]. Quadratic Programming is an optimization technique that minimizes the sum of quadratic form and linear form.

The QP_MPC2QP block converts a linear MPC problem with quadratic optimization criterion to a quadratic programming problem. The block is compatible with the block QP_UPDATE and the QP solver QP_OASES.

MPC problem formulation
The MPC problem consists of a discrete linear time invariant state space model

xk+1 = Axk + Buuk + Bvvk, yk = Cxk, (15.7)

where x n is the state vector, u mu is the input vector, v mv is the disturbance vector and y p is the output vector. Matrices A n×n, Bu n×mu, Bv n×mv and C p×n are referenced by inputs uA, uBu, uBv and uC. The model based predictive control problem is formulated as an optimization problem – minimization of the quadratic optimality criterion (cost function) in the form

J = k=1np x̂kT Qx̂ k + x̂kT W + û k1T Rû k1 , (15.8)

where symmetric and positive (semi-)definite matrices Q n×n and R mu×mu and the vector W n are referenced by inputs uQ, uR and uW, and np is the prediction horizon (input np).

Additional constraints on the state x and the output y may be required for the minimization process:

xmin xk xmax (15.9) ymin yk ymax (15.10)

For detailed derivation, see the PDF version of this manual.

This block does not propagate the signal quality. More information can be found in the 1.4 section.

Input

np

Prediction horizon   1  1000000

Long (I32)

nc

Control horizon   1  1000000

Long (I32)

uA

Input reference to system matrix A

Reference

uBu

Input reference to input matrix Bu of control vector u

Reference

uBv

Input reference to input matrix Bv of disturbance vector v

Reference

uC

Input reference to output matrix C

Reference

uQ

Input reference to symmetric matrix Q in cost function

Reference

uW

Input reference to vector W in cost function

Reference

uR

Input reference to symmetric matrix R in cost function

Reference

ul

Input reference to integer index vector l

Reference

uH

Input reference to Hessian matrix H

Reference

uGx

Input reference to part of gradient vector G corresponding to state vector x

Reference

uGv

Input reference to part of gradient vector G corresponding to disturbance vector v

Reference

uGw

Input reference to part of gradient vector G corresponding to vector W

Reference

uSuL

Input reference to work matrix Su*L

Reference

uSv

Input reference to work matrix Sv

Reference

uT

Input reference to work matrix T

Reference

uScuL

Input reference to work matrix Scu*L

Reference

uScv

Input reference to work matrix Scv

Reference

uTc

Input reference to work matrix Tc

Reference

uWORK

Input reference to matrix WORK

Reference

HLD

Hold

Bool

Output

yA

Output reference to system matrix A

Reference

yBu

Output reference to input matrix Bu of control vector u

Reference

yBv

Output reference to input matrix Bv of disturbance vector v

Reference

yC

Output reference to output matrix C

Reference

yQ

Output reference to symmetric matrix Q in cost function

Reference

yW

Output reference to vector W in cost function

Reference

yR

Output reference to symmetric matrix R in cost function

Reference

yl

Output reference to integer index vector l

Reference

yH

Output reference to Hessian matrix H

Reference

yGx

Output reference to part of gradient vector G corresponding to state vector x

Reference

yGv

Output reference to part of gradient vector G corresponding to disturbance vector v

Reference

yGw

Output reference to part of gradient vector G corresponding to vector W

Reference

ySuL

Output reference to work matrix Su*L

Reference

ySv

Output reference to work matrix Sv

Reference

yT

Output reference to work matrix T

Reference

yScuL

Output reference to work matrix Scu*L

Reference

yScv

Output reference to work matrix Scv

Reference

yTc

Output reference to work matrix Tc

Reference

yWORK

Output reference to matrix WORK

Reference

E

Error indicator

Bool

2024 © REX Controls s.r.o., www.rexygen.com