1、约束优化问题描述
考虑如下线性离散时间系统的状态空间增量模型:
Δ
x
(
k
+
1
)
=
A
Δ
x
(
k
)
+
B
u
Δ
u
(
k
)
+
B
d
Δ
d
(
k
)
y
c
(
k
)
=
C
c
Δ
x
(
k
)
+
y
c
(
k
−
1
)
y
b
(
k
)
=
C
b
Δ
x
(
k
)
+
y
b
(
k
−
1
)
(1)
\begin{aligned} \Delta x(k+1)&=A\Delta x(k)+B_u\Delta u(k) +B_d\Delta d(k)\\[1ex] y_c(k)&=C_c\Delta x(k) + y_c(k-1)\\[1ex] y_b(k)&=C_b\Delta x(k) + y_b(k-1) \end{aligned}\tag{1}
Δx(k+1)yc(k)yb(k)=AΔx(k)+BuΔu(k)+BdΔd(k)=CcΔx(k)+yc(k−1)=CbΔx(k)+yb(k−1)(1)
其中
Δ
x
(
k
)
=
x
(
k
)
−
x
(
k
−
1
)
Δ
u
(
k
)
=
u
(
k
)
−
u
(
k
−
1
)
Δ
d
(
k
)
=
d
(
k
)
−
d
(
k
−
1
)
(2)
\begin{aligned} \Delta x(k) & = x(k) - x(k-1)\\[1ex] \Delta u(k) & = u(k) - u(k-1)\\[1ex] \Delta d(k) & = d(k) - d(k-1)\\[1ex] \end{aligned}\tag{2}
Δx(k)Δu(k)Δd(k)=x(k)−x(k−1)=u(k)−u(k−1)=d(k)−d(k−1)(2)
模型中 Δ x ( k ) \Delta x(k) Δx(k) 是状态增量; Δ u ( k ) \Delta u(k) Δu(k) 是控制输入增量; Δ d ( k ) \Delta d(k) Δd(k) 是可以测量的外部干扰增量; y c ( k ) y_c(k) yc(k) 是被控输出量; y b ( k ) y_b(k) yb(k) 是约束输出量; A , B u , B d , C c , C b A,B_u,B_d,C_c,C_b A,Bu,Bd,Cc,Cb 是相应维数的系统矩阵。
我们考虑的控制目标是使得被控输出
y
c
y_c
yc 跟踪给定的参考输入
r
r
r。同时,系统的控制量,控制增量和输出量满足下面的控制约束及输出约束:
u
min
(
k
)
≤
u
(
k
)
≤
u
max
(
k
)
,
∀
k
≥
0
,
Δ
u
min
(
k
)
≤
Δ
u
(
k
)
≤
Δ
u
max
(
k
)
,
∀
k
≥
0
,
y
min
(
k
)
≤
y
b
(
k
)
≤
y
max
(
k
)
,
∀
k
≥
0
(3)
\begin{aligned} u_{\min}(k)&\leq u(k)\leq u_{\max}(k),\quad\forall k\geq 0,\\[1ex] \Delta u_{\min}(k)&\leq\Delta u(k)\leq\Delta u_{\max}(k),\quad\forall k\geq0,\\[1ex] y_{\min}(k)&\leq y_b(k)\leq y_{\max} (k),\quad\forall k\geq0 \end{aligned}\tag{3}
umin(k)Δumin(k)ymin(k)≤u(k)≤umax(k),∀k≥0,≤Δu(k)≤Δumax(k),∀k≥0,≤yb(k)≤ymax(k),∀k≥0(3)
简单起见,我们假设系统的全部状态是可以测量的。如果系统的状态不是全部可以测量的,则需要设计状态观测器,以估计状态作为模型的初始状态,预测系统未来动态。
在 k k k 时刻有状态测量(估计)值 x ( k ) x(k) x(k),根据预测控制的基本原理,约束 MPC 的优化问题描述为
min Δ U ( k ) J ( x ( k ) , Δ U ( k ) ) (4) \min_{\Delta U(k)}J\big(x(k),\Delta U(k)\big)\tag{4} ΔU(k)minJ(x(k),ΔU(k))(4)
满足系统动力学( i = 0 , 1 , ⋯ , p i=0,1,\cdots,p i=0,1,⋯,p)
Δ x ( k + i + 1 ∣ k ) = A Δ x ( k + i ∣ k ) + B u Δ u ( k + i ) + B d Δ d ( k + i ) Δ x ( k ∣ k ) = Δ x ( k ) y c ( k + i ∣ k ) = C c Δ x ( k + i ∣ k ) + y c ( k + i − 1 ∣ k ) , i ≥ 1 y c ( k ∣ k ) = y c ( k ) y b ( k + i ∣ k ) = C b Δ x ( k + i ∣ k ) + y b ( k + i − 1 ∣ k ) , i ≥ 1 y b ( k ∣ k ) = y b ( k ) (5) \begin{aligned} \Delta x(k+i+1|k)&=A\Delta x(k+i|k)+B_u\Delta u(k+i) + B_d\Delta d(k+i)\\[1ex] \Delta x(k|k)&=\Delta x(k)\\[1ex] y_c(k+i|k)&=C_c\Delta x(k+i|k) + y_c(k+i-1|k),\quad i\geq 1\\[1ex] y_c(k|k)&=y_c(k)\\[1ex] y_b(k+i|k)&=C_b\Delta x(k+i|k) + y_b(k+i-1|k),\quad i\geq 1\\[1ex] y_b(k|k)&=y_b(k) \end{aligned}\tag{5} Δx(k+i+1∣k)Δx(k∣k)yc(k+i∣k)yc(k∣k)yb(k+i∣k)yb(k∣k)=AΔx(k+i∣k)+BuΔu(k+i)+BdΔd(k+i)=Δx(k)=CcΔx(k+i∣k)+yc(k+i−1∣k),i≥1=yc(k)=CbΔx(k+i∣k)+yb(k+i−1∣k),i≥1=yb(k)(5)及时域约束
u min ( k + i ) ≤ u ( k + i ) ≤ u max ( k + i ) , i = 0 , 1 , ⋯ , m − 1 , Δ u min ( k + i ) ≤ Δ u ( k + i ) ≤ Δ u max ( k + i ) , i = 0 , 1 , ⋯ , m − 1 , y min ( k + i ) ≤ y b ( k + i ) ≤ y max ( k + i ) , i = 0 , 1 , ⋯ , p (6) \begin{aligned} &u_{\min}(k+i)\leq u(k+i)\leq u_{\max}(k+i),\quad i=0,1,\cdots,m-1,\\[1ex] &\Delta u_{\min}(k+i)\leq\Delta u(k+i)\leq\Delta u_{\max}(k+i),\quad i=0,1,\cdots,m-1,\\[1ex] &y_{\min}(k+i)\leq y_b(k+i)\leq y_{\max} (k+i),\quad i=0,1,\cdots,p \end{aligned}\tag{6} umin(k+i)≤u(k+i)≤umax(k+i),i=0,1,⋯,m−1,Δumin(k+i)≤Δu(k+i)≤Δumax(k+i),i=0,1,⋯,m−1,ymin(k+i)≤yb(k+i)≤ymax(k+i),i=0,1,⋯,p(6)其中
J ( x ( k ) , Δ U ( k ) ) = ∥ Γ y ( Y p , c ( k + 1 ∣ k ) − R ( k + 1 ) ) ∥ 2 + ∥ Γ u Δ U ( k ) ∥ 2 (7) J\big(x(k),\Delta U(k)\big)=\parallel\Gamma_y\big(Y_{p,c}(k+1|k)-R(k+1)\big)\parallel^2 + \parallel\Gamma_u\Delta U(k)\parallel^2\tag{7} J(x(k),ΔU(k))=∥Γy(Yp,c(k+1∣k)−R(k+1))∥2+∥ΓuΔU(k)∥2(7)
上面的优化问题中
Γ
y
,
Γ
u
\Gamma_y,\Gamma_u
Γy,Γu 是加权矩阵,给定为
Γ
y
=
d
i
a
g
{
Γ
y
,
1
,
Γ
y
,
2
,
⋯
,
Γ
y
,
p
}
p
×
p
,
Γ
u
=
d
i
a
g
{
Γ
u
,
1
,
Γ
u
,
2
,
⋯
,
Γ
u
,
p
}
m
×
m
(8)
\begin{aligned} &\Gamma_y=\mathrm{diag}\lbrace\Gamma_{y,1},\Gamma_{y,2},\cdots,\Gamma_{y,p}\rbrace_{p\times p},\\[1ex] &\Gamma_u=\mathrm{diag}\lbrace\Gamma_{u,1},\Gamma_{u,2},\cdots,\Gamma_{u,p}\rbrace_{m\times m}\\[1ex] \end{aligned}\tag{8}
Γy=diag{Γy,1,Γy,2,⋯,Γy,p}p×p,Γu=diag{Γu,1,Γu,2,⋯,Γu,p}m×m(8)
R
(
k
+
1
)
R(k+1)
R(k+1) 是给定的控制输入参考序列,为
R
(
k
+
1
)
=
[
r
(
k
+
1
)
r
(
k
+
2
)
⋮
r
(
k
+
p
)
]
p
×
1
(9)
R(k+1)=\left[ \begin{matrix} r(k+1) \\[1ex] r(k+2) \\[1ex] \vdots\\[1ex] r(k+p) \end{matrix} \right]_{p\times 1}\tag{9}
R(k+1)=
r(k+1)r(k+2)⋮r(k+p)
p×1(9)
Δ
U
(
k
)
\Delta U(k)
ΔU(k) 是控制量增量序列,作为约束优化问题的独立变量,定义为
Δ
U
(
k
)
=
=
d
e
f
[
Δ
u
(
k
)
Δ
u
(
k
+
1
)
⋮
Δ
u
(
k
+
m
−
1
)
]
m
×
1
(10)
\Delta U(k)\overset{\mathrm{def}}{=\!=}\left[ \begin{matrix} \Delta u(k) \\[2ex] \Delta u(k+1) \\[2ex] \vdots\\[2ex] \Delta u(k+m-1) \end{matrix} \right]_{m\times 1}\tag{10}
ΔU(k)==def
Δu(k)Δu(k+1)⋮Δu(k+m−1)
m×1(10)
Y
p
,
c
(
k
+
1
∣
k
)
Y_{p,c}(k+1|k)
Yp,c(k+1∣k) 是
k
k
k 时刻基于模型(1)预测的
p
p
p 步控制输出,定义为
Y
p
,
c
(
k
+
1
∣
k
)
=
=
d
e
f
[
y
c
(
k
+
1
∣
k
)
y
c
(
k
+
2
∣
k
)
⋮
y
c
(
k
+
p
∣
k
)
]
p
×
1
(11)
Y_{p,c}(k+1|k)\overset{\mathrm{def}}{=\!=}\left[ \begin{matrix} y_c(k+1|k) \\[2ex] y_c(k+2|k) \\[2ex] \vdots\\[2ex] y_c(k+p|k) \end{matrix} \right]_{p\times 1}\tag{11}
Yp,c(k+1∣k)==def
yc(k+1∣k)yc(k+2∣k)⋮yc(k+p∣k)
p×1(11)
具体的,预测的控制输出 y c ( k + i ∣ k ) y_c(k+i|k) yc(k+i∣k) 和约束输出 y b ( k + i ∣ k ) y_b(k+i|k) yb(k+i∣k) 由(5)计算。
进一步,
Y
p
,
c
(
k
+
1
∣
k
)
Y_{p,c}(k+1|k)
Yp,c(k+1∣k) 可以由预测方程
Y
p
(
k
+
1
∣
k
)
=
S
x
Δ
x
(
k
)
+
I
y
c
(
k
)
+
S
u
Δ
U
(
k
)
+
S
d
Δ
d
(
k
)
(12)
Y_p(k+1|k)=S_x\Delta x(k)+{\cal{I}}y_c(k)+{\cal{S}_u}\Delta U(k)+{\cal{S}_d}\Delta d(k)\tag{12}
Yp(k+1∣k)=SxΔx(k)+Iyc(k)+SuΔU(k)+SdΔd(k)(12)
计算,其中
S
x
=
[
C
c
A
∑
i
=
1
2
C
c
A
i
⋮
∑
i
=
1
p
C
c
A
i
]
p
×
1
,
I
=
[
I
n
c
×
n
c
I
n
c
×
n
c
⋮
I
n
c
×
n
c
]
p
×
1
,
S
d
=
[
C
c
B
d
∑
i
=
1
2
C
c
A
i
−
1
B
d
⋮
∑
i
=
1
p
C
c
A
i
−
1
B
d
]
p
×
1
,
S
u
=
[
C
c
B
u
0
0
⋯
0
∑
i
=
1
2
C
c
A
i
−
1
B
u
C
c
B
u
0
⋯
0
⋮
⋮
⋮
⋮
∑
i
=
1
m
C
c
A
i
−
1
B
u
∑
i
=
1
m
−
1
C
c
A
i
−
1
B
u
⋯
⋯
C
c
B
u
⋮
⋮
⋮
⋮
∑
i
=
1
p
C
c
A
i
−
1
B
u
∑
i
=
1
p
−
1
C
c
A
i
−
1
B
u
⋯
⋯
∑
i
=
1
p
−
m
+
1
C
c
A
i
−
1
B
u
]
p
×
m
(13)
\begin{aligned} S_x&=\left[ \begin{matrix} C_cA \\[2ex] \sum_{i=1}^2C_cA^i \\[2ex] \vdots\\[2ex] \sum_{i=1}^pC_cA^i \end{matrix} \right]_{p\times 1} ,\quad{\cal{I}}=\left[ \begin{matrix} I_{n_c\times n_c} \\[1ex] I_{n_c\times n_c} \\[1ex] \vdots\\[1ex] I_{n_c\times n_c} \end{matrix} \right]_{p\times 1},\quad{\cal{S}_d}=\left[ \begin{matrix} C_cB_d \\[2ex] \sum_{i=1}^2C_cA^{i-1}B_d \\[2ex] \vdots\\[2ex] \sum_{i=1}^pC_cA^{i-1}B_d \end{matrix} \right]_{p\times 1},\\[4ex] {\cal{S}_u}&=\left[ \begin{matrix} C_cB_u & 0 & 0 & \cdots & 0\\[2ex] \sum_{i=1}^2C_cA^{i-1}B_u & C_cB_u & 0 & \cdots & 0 \\[2ex] \vdots & \vdots & \vdots & &\vdots \\[2ex] \sum_{i=1}^mC_cA^{i-1}B_u & \sum_{i=1}^{m-1}C_cA^{i-1}B_u & \cdots & \cdots & C_cB_u \\[2ex] \vdots & \vdots & \vdots & &\vdots \\[2ex] \sum_{i=1}^pC_cA^{i-1}B_u & \sum_{i=1}^{p-1}C_cA^{i-1}B_u & \cdots & \cdots & \sum_{i=1}^{p-m+1}C_cA^{i-1}B_u \end{matrix} \right]_{p\times m} \end{aligned}\tag{13}
SxSu=
CcA∑i=12CcAi⋮∑i=1pCcAi
p×1,I=
Inc×ncInc×nc⋮Inc×nc
p×1,Sd=
CcBd∑i=12CcAi−1Bd⋮∑i=1pCcAi−1Bd
p×1,=
CcBu∑i=12CcAi−1Bu⋮∑i=1mCcAi−1Bu⋮∑i=1pCcAi−1Bu0CcBu⋮∑i=1m−1CcAi−1Bu⋮∑i=1p−1CcAi−1Bu00⋮⋯⋮⋯⋯⋯⋯⋯00⋮CcBu⋮∑i=1p−m+1CcAi−1Bu
p×m(13)
2、约束优化问题求解
由于约束条件(6)的存在,一般情况下,我们无法得到优化问题的解析解,因此,需要采用数值求解方法。由于目标函数是二次型的,动力学方程和时域约束条件是线性的,所以该问题是一个二次规划(Quadratic Programming,QP)问题。
QP 问题是下面形式的优化问题:
min z z T H z − g T z , 满足 C z ≥ b (14) \min_z z^THz-g^Tz,\quad 满足 Cz\geq b\tag{14} zminzTHz−gTz,满足Cz≥b(14)其中 H H H 是 H e s s i a n Hessian Hessian 矩阵,
2.1、目标函数转化为 z T H z − g T z \pmb {z^THz-g^Tz} zTHz−gTz
z
=
Δ
U
(
k
)
z=\Delta U(k)
z=ΔU(k) 是优化问题的独立变量。将预测方程(12)代入目标函数(7),并定义
E
p
(
k
+
1
∣
k
)
=
=
d
e
f
R
(
k
+
1
)
−
S
x
Δ
x
(
k
)
−
I
y
c
(
k
)
−
S
d
Δ
d
(
k
)
(15)
E_p(k+1|k)\overset{\mathrm{def}}{=\!=}R(k+1)-\cal{S}_x\Delta x(k)-\cal{I}y_c(k)-\cal{S}_d\Delta d(k)\tag{15}
Ep(k+1∣k)==defR(k+1)−SxΔx(k)−Iyc(k)−SdΔd(k)(15)
则目标函数变为
J
(
x
(
k
)
,
Δ
U
(
k
)
)
=
∥
Γ
y
(
Y
p
,
c
(
k
+
1
∣
k
)
−
R
(
k
+
1
)
)
∥
2
+
∥
Γ
u
Δ
U
(
k
)
∥
2
=
∥
Γ
y
(
S
u
Δ
U
(
k
)
−
E
p
(
k
+
1
∣
k
)
)
∥
2
+
∥
Γ
u
Δ
U
(
k
)
∥
2
=
Δ
U
(
k
)
T
S
u
T
Γ
y
T
Γ
y
S
u
Δ
U
(
k
)
+
Δ
U
(
k
)
T
Γ
u
T
Γ
u
Δ
U
(
k
)
−
2
E
p
(
k
+
1
∣
k
)
T
Γ
y
T
Γ
y
S
u
Δ
U
(
k
)
+
E
p
(
k
+
1
∣
k
)
T
Γ
y
T
Γ
y
E
p
(
k
+
1
∣
k
)
(16)
\begin{aligned} J\big(x(k),\Delta U(k)\big)&=\parallel\Gamma_y\big(Y_{p,c}(k+1|k)-R(k+1)\big)\parallel^2 + \parallel\Gamma_u\Delta U(k)\parallel^2\\[1ex] &=\parallel\Gamma_y\big({\cal S}_u\Delta U(k)-E_p(k+1|k)\big)\parallel^2 + \parallel\Gamma_u\Delta U(k)\parallel^2\\[1ex] &=\Delta U(k)^T{\cal S}_u^T\Gamma_y^T\Gamma_y{\cal S}_u\Delta U(k) + \Delta U(k)^T\Gamma_u^T\Gamma_u\Delta U(k) \\[1ex] &\quad- 2E_p(k+1|k)^T\Gamma_y^T\Gamma_y{\cal S}_u\Delta U(k) + E_p(k+1|k)^T\Gamma_y^T\Gamma_yE_p(k+1|k) \end{aligned}\tag{16}
J(x(k),ΔU(k))=∥Γy(Yp,c(k+1∣k)−R(k+1))∥2+∥ΓuΔU(k)∥2=∥Γy(SuΔU(k)−Ep(k+1∣k))∥2+∥ΓuΔU(k)∥2=ΔU(k)TSuTΓyTΓySuΔU(k)+ΔU(k)TΓuTΓuΔU(k)−2Ep(k+1∣k)TΓyTΓySuΔU(k)+Ep(k+1∣k)TΓyTΓyEp(k+1∣k)(16)
因为
E
p
(
k
+
1
∣
k
)
T
Γ
y
T
Γ
y
E
p
(
k
+
1
∣
k
)
E_p(k+1|k)^T\Gamma_y^T\Gamma_yE_p(k+1|k)
Ep(k+1∣k)TΓyTΓyEp(k+1∣k) 与独立变量
Δ
U
(
k
)
\Delta U(k)
ΔU(k) 无关,所以对优化问题而言,上式等价于
J
~
=
Δ
U
(
k
)
T
H
Δ
U
(
k
)
−
G
(
k
+
1
∣
k
)
T
Δ
U
(
k
)
,
(17)
\boxed{\tilde J=\Delta U(k)^T H \Delta U(k) - G(k+1|k)^T\Delta U(k)},\tag{17}
J~=ΔU(k)THΔU(k)−G(k+1∣k)TΔU(k),(17)
其中
H
=
S
u
T
Γ
y
T
Γ
y
S
u
+
Γ
u
T
Γ
u
,
G
(
k
+
1
∣
k
)
=
2
S
u
T
Γ
y
T
Γ
y
E
p
(
k
+
1
∣
k
)
(18)
\begin{aligned} H&={\cal S}_u^T\Gamma_y^T\Gamma_y{\cal S}_u + \Gamma_u^T\Gamma_u,\\[1ex] G(k+1|k)&=2{\cal S}_u^T\Gamma_y^T\Gamma_yE_p(k+1|k) \end{aligned}\tag{18}
HG(k+1∣k)=SuTΓyTΓySu+ΓuTΓu,=2SuTΓyTΓyEp(k+1∣k)(18)
2.2、控制增量约束转化为 C z ≥ b \pmb{Cz\geq b} Cz≥b
可以将控制量增量约束直接写成需要的形式
[
−
T
T
]
Δ
U
(
k
)
≥
[
−
Δ
u
max
(
k
)
⋮
−
Δ
u
max
(
k
+
m
−
1
)
Δ
u
min
(
k
)
⋮
Δ
u
min
(
k
+
m
−
1
)
]
,
(19)
\left[ \begin{matrix} -\pmb T\\[1ex] \pmb T \end{matrix} \right]\Delta U(k)\geq \left[ \begin{matrix} -\Delta u_{\max}(k)\\[1ex] \vdots\\[1ex] -\Delta u_{\max}(k+m-1)\\[1ex] \Delta u_{\min}(k)\\[1ex] \vdots\\[1ex] \Delta u_{\min}(k+m-1)\\ \end{matrix} \right],\tag{19}
[−TT]ΔU(k)≥
−Δumax(k)⋮−Δumax(k+m−1)Δumin(k)⋮Δumin(k+m−1)
,(19)
其中
T
=
[
I
n
u
×
n
u
0
⋯
0
0
I
n
u
×
n
u
⋯
0
⋮
⋮
⋮
0
0
⋯
I
n
u
×
n
u
]
m
×
m
(20)
\pmb T=\left[ \begin{matrix} I_{n_u\times n_u} & \pmb 0 & \cdots & \pmb 0\\[1ex] \pmb 0 & I_{n_u\times n_u} & \cdots & \pmb 0\\[1ex] \vdots & \vdots & & \vdots\\[1ex] \pmb 0 & \pmb 0 & \cdots &I_{n_u\times n_u}\\[1ex] \end{matrix} \right]_{m\times m}\tag{20}
T=
Inu×nu0⋮00Inu×nu⋮0⋯⋯⋯00⋮Inu×nu
m×m(20)
2.3、控制量约束转化为 C z ≥ b \pmb{Cz\geq b} Cz≥b
由于 Δ u ( k + i ) = u ( k + i ) − u ( k + i − 1 ) (21) \Delta u(k+i)=u(k+i) - u(k+i-1)\tag{21} Δu(k+i)=u(k+i)−u(k+i−1)(21)
因此对
i
=
0
i=0
i=0 有
u
(
k
)
=
u
(
k
−
1
)
+
Δ
u
(
k
)
u(k)=u(k-1)+\Delta u(k)
u(k)=u(k−1)+Δu(k),进而有
u
min
(
k
)
≤
u
(
k
)
≤
u
max
(
k
)
⟹
{
−
Δ
u
(
k
)
≥
u
(
k
−
1
)
−
u
max
(
k
)
Δ
u
(
k
)
≥
u
min
(
k
)
−
u
(
k
−
1
)
(22)
u_{\min}(k)\leq u(k)\leq u_{\max}(k)\Longrightarrow \begin{cases} -\Delta u(k)\geq u(k-1)-u_{\max}(k)\\[1ex] \Delta u(k)\geq u_{\min}(k) - u(k-1) \end{cases}\tag{22}
umin(k)≤u(k)≤umax(k)⟹{−Δu(k)≥u(k−1)−umax(k)Δu(k)≥umin(k)−u(k−1)(22)
对
i
=
1
i=1
i=1 有
u
(
k
+
1
)
=
u
(
k
−
1
)
+
Δ
u
(
k
)
+
Δ
u
(
k
+
1
)
u(k+1)=u(k-1)+\Delta u(k)+\Delta u(k+1)
u(k+1)=u(k−1)+Δu(k)+Δu(k+1),因此有
u
min
(
k
+
1
)
≤
u
(
k
+
1
)
≤
u
max
(
k
+
1
)
⟹
{
−
(
Δ
u
(
k
)
+
Δ
u
(
k
+
1
)
)
≥
u
(
k
−
1
)
−
u
max
(
k
+
1
)
Δ
u
(
k
)
+
Δ
u
(
k
+
1
)
≥
u
min
(
k
+
1
)
−
u
(
k
−
1
)
(23)
u_{\min}(k+1)\leq u(k+1)\leq u_{\max}(k+1)\Longrightarrow \begin{cases} -\big(\Delta u(k)+\Delta u(k+1)\big)\geq u(k-1)-u_{\max}(k+1)\\[1ex] \Delta u(k)+\Delta u(k+1)\geq u_{\min}(k+1) - u(k-1) \end{cases}\tag{23}
umin(k+1)≤u(k+1)≤umax(k+1)⟹{−(Δu(k)+Δu(k+1))≥u(k−1)−umax(k+1)Δu(k)+Δu(k+1)≥umin(k+1)−u(k−1)(23)
对任意
i
=
0
,
1
,
2
,
⋯
,
m
−
1
i=0,1,2,\cdots,m-1
i=0,1,2,⋯,m−1 有
u
(
k
+
i
)
=
u
(
k
−
1
)
+
∑
j
=
0
i
Δ
u
(
k
+
j
)
u(k+i)=u(k-1)+\sum_{j=0}^i\Delta u(k+j)
u(k+i)=u(k−1)+∑j=0iΔu(k+j),因此有
u
min
(
k
+
i
)
≤
u
(
k
+
i
)
≤
u
max
(
k
+
i
)
⟹
{
−
∑
j
=
0
i
Δ
u
(
k
+
j
)
≥
u
(
k
−
1
)
−
u
max
(
k
+
i
)
∑
j
=
0
i
Δ
u
(
k
+
j
)
≥
u
min
(
k
+
i
)
−
u
(
k
−
1
)
(24)
u_{\min}(k+i)\leq u(k+i)\leq u_{\max}(k+i)\Longrightarrow \begin{cases} -\sum_{j=0}^i\Delta u(k+j)\geq u(k-1)-u_{\max}(k+i)\\[1ex] \sum_{j=0}^i\Delta u(k+j)\geq u_{\min}(k+i) - u(k-1) \end{cases}\tag{24}
umin(k+i)≤u(k+i)≤umax(k+i)⟹{−∑j=0iΔu(k+j)≥u(k−1)−umax(k+i)∑j=0iΔu(k+j)≥umin(k+i)−u(k−1)(24)
综上,将控制量约束写成如下的矩阵形式:
[
−
L
L
]
Δ
U
(
k
)
≥
[
u
(
k
−
1
)
−
u
max
(
k
)
⋮
u
(
k
−
1
)
−
u
max
(
k
+
m
−
1
)
u
min
(
k
)
−
u
(
k
−
1
)
⋮
u
min
(
k
+
m
−
1
)
−
u
(
k
−
1
)
]
,
(25)
\left[ \begin{matrix} -\pmb L\\[1ex] \pmb L \end{matrix} \right]\Delta U(k)\geq \left[ \begin{matrix} u(k-1)-u_{\max}(k)\\[1ex] \vdots\\[1ex] u(k-1)-u_{\max}(k+m-1)\\[1ex] u_{\min}(k)-u(k-1)\\[1ex] \vdots\\[1ex] u_{\min}(k+m-1)-u(k-1) \end{matrix} \right],\tag{25}
[−LL]ΔU(k)≥
u(k−1)−umax(k)⋮u(k−1)−umax(k+m−1)umin(k)−u(k−1)⋮umin(k+m−1)−u(k−1)
,(25)
其中
L
=
[
I
n
u
×
n
u
0
⋯
0
I
n
u
×
n
u
I
n
u
×
n
u
⋯
0
⋮
⋮
⋮
I
n
u
×
n
u
I
n
u
×
n
u
⋯
I
n
u
×
n
u
]
m
×
m
(26)
\pmb L=\left[ \begin{matrix} I_{n_u\times n_u} & \pmb 0 & \cdots & \pmb 0\\[1ex] I_{n_u\times n_u} & I_{n_u\times n_u} & \cdots & \pmb 0\\[1ex] \vdots & \vdots & & \vdots\\[1ex] I_{n_u\times n_u} & I_{n_u\times n_u} & \cdots &I_{n_u\times n_u}\\[1ex] \end{matrix} \right]_{m\times m}\tag{26}
L=
Inu×nuInu×nu⋮Inu×nu0Inu×nu⋮Inu×nu⋯⋯⋯00⋮Inu×nu
m×m(26)
2.4、输出约束转化为 C z ≥ b \pmb{Cz\geq b} Cz≥b
对系统未来
p
p
p 步约束输出的预测可以由下面的预测方程计算:
Y
p
,
b
(
k
+
1
∣
k
)
=
S
x
,
b
Δ
x
(
k
)
+
I
b
y
b
(
k
)
+
S
u
,
b
Δ
U
(
k
)
+
S
d
,
b
Δ
d
(
k
)
(27)
Y_{p,b}(k+1|k)={\cal S}_{x,b}\Delta x(k)+{\cal I}_by_b(k)+{\cal{S}_{u,b}}\Delta U(k)+{\cal{S}_{d,b}\Delta d(k})\tag{27}
Yp,b(k+1∣k)=Sx,bΔx(k)+Ibyb(k)+Su,bΔU(k)+Sd,bΔd(k)(27)
其中, S x , b , I b , S d , b , S u , b {\cal S}_{x,b},{\cal I}_b,{\cal S}_{d,b},{\cal S}_{u,b} Sx,b,Ib,Sd,b,Su,b 与式(13)类似,只是将 C c C_c Cc 更换为 C b C_b Cb。
记
Y
min
(
k
+
1
)
=
[
y
min
(
k
+
1
)
y
min
(
k
+
2
)
⋮
y
min
(
k
+
p
)
]
p
×
1
,
Y
max
(
k
+
1
)
=
[
y
max
(
k
+
1
)
y
max
(
k
+
2
)
⋮
y
max
(
k
+
p
)
]
p
×
1
(28)
Y_{\min}(k+1)=\left[ \begin{matrix} y_{\min}(k+1)\\[2ex] y_{\min}(k+2)\\[2ex] \vdots\\[2ex] y_{\min}(k+p) \end{matrix} \right]_{p\times 1},\quad Y_{\max}(k+1)=\left[ \begin{matrix} y_{\max}(k+1)\\[2ex] y_{\max}(k+2)\\[2ex] \vdots\\[2ex] y_{\max}(k+p) \end{matrix} \right]_{p\times 1}\tag{28}
Ymin(k+1)=
ymin(k+1)ymin(k+2)⋮ymin(k+p)
p×1,Ymax(k+1)=
ymax(k+1)ymax(k+2)⋮ymax(k+p)
p×1(28)
可以将输出约束描述为如下的向量形式:
Y
min
(
k
+
1
)
≤
Y
p
,
b
(
k
+
1
∣
k
)
≤
Y
max
(
k
+
1
)
(29)
Y_{\min}(k+1)\leq Y_{p,b}(k+1|k)\leq Y_{\max}(k+1)\tag{29}
Ymin(k+1)≤Yp,b(k+1∣k)≤Ymax(k+1)(29)
将约束输出预测方程(27)代入上式,则输出约束转换为
[
−
S
u
,
b
S
u
,
b
]
Δ
U
(
k
)
≥
[
(
S
x
,
b
Δ
x
(
k
)
+
I
b
y
b
(
k
)
Δ
U
(
k
)
+
S
d
,
b
Δ
d
(
k
)
)
−
Y
max
(
k
+
1
)
−
(
S
x
,
b
Δ
x
(
k
)
+
I
b
y
b
(
k
)
Δ
U
(
k
)
+
S
d
,
b
Δ
d
(
k
)
)
+
Y
min
(
k
+
1
)
]
(30)
\begin{aligned} \left[ \begin{matrix} -{\cal S}_{u,b}\\[2ex] {\cal S}_{u,b} \end{matrix} \right]\Delta U(k)\geq \left[ \begin{matrix} \big({\cal S}_{x,b}\Delta x(k)+{\cal I}_by_b(k)\Delta U(k)+{\cal{S}_{d,b}\Delta d(k})\big)-Y_{\max}(k+1)\\[2ex] -\big({\cal S}_{x,b}\Delta x(k)+{\cal I}_by_b(k)\Delta U(k)+{\cal{S}_{d,b}\Delta d(k})\big)+Y_{\min}(k+1) \end{matrix} \right] \end{aligned}\tag{30}
[−Su,bSu,b]ΔU(k)≥[(Sx,bΔx(k)+Ibyb(k)ΔU(k)+Sd,bΔd(k))−Ymax(k+1)−(Sx,bΔx(k)+Ibyb(k)ΔU(k)+Sd,bΔd(k))+Ymin(k+1)](30)
综上所述,约束 MPC 的优化问题可以转换为如下的 QP 问题描述:
min
Δ
U
(
k
)
Δ
U
(
k
)
T
H
Δ
U
(
k
)
−
G
(
k
+
1
∣
k
)
T
Δ
U
(
k
)
,
满足
C
u
Δ
U
(
k
)
≥
b
(
k
+
1
∣
k
)
\begin{aligned} &\min_{\Delta U(k)} \Delta U(k)^TH\Delta U(k)-G(k+1|k)^T\Delta U(k),\\[1ex] &满足 C_u\Delta U(k)\geq b(k+1|k) \end{aligned}
ΔU(k)minΔU(k)THΔU(k)−G(k+1∣k)TΔU(k),满足CuΔU(k)≥b(k+1∣k)
其中
H
,
G
(
k
+
1
∣
k
)
H,G(k+1|k)
H,G(k+1∣k) 由(18)给出,
C
u
=
[
−
T
T
T
T
−
L
T
L
T
−
S
u
,
b
T
S
u
,
b
T
]
(
4
m
+
2
p
)
×
1
T
,
b
(
k
+
1
∣
k
)
=
[
−
Δ
u
max
(
k
)
⋮
−
Δ
u
max
(
k
+
m
−
1
)
Δ
u
min
(
k
)
⋮
Δ
u
min
(
k
+
m
−
1
)
u
(
k
−
1
)
−
u
max
(
k
)
⋮
u
(
k
−
1
)
−
u
max
(
k
+
m
−
1
)
u
min
(
k
)
−
u
(
k
−
1
)
⋮
u
min
(
k
+
m
−
1
)
−
u
(
k
−
1
)
(
S
x
,
b
Δ
x
(
k
)
+
I
b
y
b
(
k
)
Δ
U
(
k
)
+
S
d
,
b
Δ
d
(
k
)
)
−
Y
max
(
k
+
1
)
−
(
S
x
,
b
Δ
x
(
k
)
+
I
b
y
b
(
k
)
Δ
U
(
k
)
+
S
d
,
b
Δ
d
(
k
)
)
+
Y
min
(
k
+
1
)
]
(
4
m
+
2
p
)
×
1
\begin{aligned} C_u&=\left[ \begin{matrix} -T^T & T^T & -L^T & L^T & -{\cal S}_{u,b}^T & {\cal S}_{u,b}^T \end{matrix} \right]^T_{(4m+2p)\times1},\\ b(k+1|k)&=\left[ \begin{matrix} -\Delta u_{\max}(k)\\[1ex] \vdots\\[1ex] -\Delta u_{\max}(k+m-1)\\[1ex] \Delta u_{\min}(k)\\[1ex] \vdots\\[1ex] \Delta u_{\min}(k+m-1)\\[1ex] u(k-1)-u_{\max}(k)\\[1ex] \vdots\\[1ex] u(k-1)-u_{\max}(k+m-1)\\[1ex] u_{\min}(k)-u(k-1)\\[1ex] \vdots\\[1ex] u_{\min}(k+m-1)-u(k-1)\\[1ex] \big({\cal S}_{x,b}\Delta x(k)+{\cal I}_by_b(k)\Delta U(k)+{\cal{S}_{d,b}\Delta d(k})\big)-Y_{\max}(k+1)\\[1ex] -\big({\cal S}_{x,b}\Delta x(k)+{\cal I}_by_b(k)\Delta U(k)+{\cal{S}_{d,b}\Delta d(k})\big)+Y_{\min}(k+1) \end{matrix} \right]_{(4m+2p)\times 1} \end{aligned}
Cub(k+1∣k)=[−TTTT−LTLT−Su,bTSu,bT](4m+2p)×1T,=
−Δumax(k)⋮−Δumax(k+m−1)Δumin(k)⋮Δumin(k+m−1)u(k−1)−umax(k)⋮u(k−1)−umax(k+m−1)umin(k)−u(k−1)⋮umin(k+m−1)−u(k−1)(Sx,bΔx(k)+Ibyb(k)ΔU(k)+Sd,bΔd(k))−Ymax(k+1)−(Sx,bΔx(k)+Ibyb(k)ΔU(k)+Sd,bΔd(k))+Ymin(k+1)
(4m+2p)×1
3、约束 MPC 的闭环解
由(18)知
H
≥
0
H\geq0
H≥0,因此 QP 问题对任何加权矩阵
Γ
y
≥
0
,
Γ
u
≥
0
\Gamma_y\geq0,\Gamma_u\geq0
Γy≥0,Γu≥0 有解,记为
Δ
U
∗
(
k
)
\Delta U^\ast(k)
ΔU∗(k)。根据预测控制的基本原理,得到的开环控制序列的第一步作用于被控系统。在下一个采样时刻,将用新的测量值刷新约束优化问题,即 QP 问题,并重新求解。因此,约束 MPC 的闭环控制率定义为
Δ
u
(
k
)
=
[
I
n
u
×
n
u
0
⋯
0
]
1
×
m
Δ
U
∗
(
k
)
\Delta u(k) =\left[ \begin{matrix} \ \ I_{n_u\times n_u} &0 &\cdots &0\ \ \end{matrix} \right]_{1\times m}\Delta U^\ast(k)
Δu(k)=[ Inu×nu0⋯0 ]1×mΔU∗(k)
下面给出了约束 MPC 控制器的实现流程。