当被控对象含有未知参数时,通过设计李雅普诺夫函数使参数估计和被控对象的输出同时收敛。本文主要内容为,第一部分介绍使用李雅普诺夫法估计参数的基本原理,第二部分介绍参数不匹配情况下的反步法,第三部分对其中一个问题进行仿真。
参数估计
一阶系统参数估计
对被控对象
y
′
=
a
+
b
u
y'=a+bu
y′=a+bu,
a
a
a 和
b
b
b 均未知。写成矩阵形式
y
′
=
θ
∗
T
ϕ
=
[
a
b
]
[
1
u
]
y'=\theta^{*\text{T}}\phi= \begin{bmatrix} a & b \end{bmatrix} \begin{bmatrix} 1 \\ u \end{bmatrix}
y′=θ∗Tϕ=[ab][1u]
取
u
=
1
b
(
−
a
−
k
y
+
k
y
m
+
y
m
′
)
u=\frac{1}{b}(-a-ky+ky_m+y_m')
u=b1(−a−ky+kym+ym′),则
y
′
=
−
k
y
+
k
y
m
+
y
m
′
(
y
−
y
m
)
′
=
−
k
(
y
−
y
m
)
\begin{aligned} & y'=-ky+ky_m + y_m' \\ & (y-y_m)'=-k(y-y_m) \\ \end{aligned}
y′=−ky+kym+ym′(y−ym)′=−k(y−ym)
a
,
b
a,b
a,b 的估计值分别记作
a
^
,
b
^
\hat{a},\hat{b}
a^,b^,则
y
m
′
=
b
^
u
+
a
^
+
k
y
−
k
y
m
y_m'=\hat{b}u+\hat{a}+ky-ky_m
ym′=b^u+a^+ky−kym。
定义参数估计误差
θ
~
(
t
)
=
θ
^
(
t
)
−
θ
∗
\tilde\theta(t)=\hat\theta(t)-\theta^*
θ~(t)=θ^(t)−θ∗ 和跟踪误差
e
=
y
−
y
m
e=y-y_m
e=y−ym,则
θ
~
′
(
t
)
=
θ
^
′
(
t
)
\tilde\theta'(t)=\hat\theta'(t)
θ~′(t)=θ^′(t),
e
′
(
t
)
=
y
′
−
y
m
′
=
a
+
b
u
−
(
a
^
+
b
^
u
+
k
y
−
k
y
m
)
=
a
−
a
^
+
(
b
−
b
^
)
u
−
k
e
=
−
k
e
−
θ
~
T
ϕ
\begin{aligned} e'(t) =& y'-y_m' \\ =& a+bu - (\hat{a}+\hat{b}u+ky-ky_m) \\ =& a-\hat a+(b-\hat b)u-ke=-ke-\tilde\theta^\text{T}\phi \end{aligned}
e′(t)===y′−ym′a+bu−(a^+b^u+ky−kym)a−a^+(b−b^)u−ke=−ke−θ~Tϕ
取候选李雅普诺夫函数
V
(
e
,
θ
~
)
=
1
2
e
2
+
1
2
θ
~
T
θ
~
V(e,\tilde\theta) = \frac{1}{2}e^2+\frac{1}{2}\tilde\theta^\text{T}\tilde\theta
V(e,θ~)=21e2+21θ~Tθ~
则
V
′
=
e
e
′
+
θ
~
T
θ
~
′
=
e
(
−
k
e
−
θ
~
T
ϕ
)
+
θ
~
T
θ
~
′
=
−
k
e
2
+
θ
~
T
(
θ
^
′
−
e
ϕ
)
\begin{aligned} V' =& ee'+\tilde\theta^\text{T}\tilde\theta' \\ =& e(-ke-\tilde\theta^\text{T}\phi)+\tilde\theta^\text{T}\tilde\theta' \\ =& -ke^2 + \tilde\theta^\text{T}(\hat\theta'-e\phi) \end{aligned}
V′===ee′+θ~Tθ~′e(−ke−θ~Tϕ)+θ~Tθ~′−ke2+θ~T(θ^′−eϕ)
取
θ
^
′
=
e
ϕ
\hat\theta'=e\phi
θ^′=eϕ 时可使得
V
V
V 是李雅普诺夫函数,即
a
^
′
=
e
b
^
′
=
e
u
\begin{aligned} \hat a' =& e \\ \hat b' =& eu \\ \end{aligned}
a^′=b^′=eeu
高阶系统参数估计
对被控对象
x
′
=
A
x
+
B
u
y
=
C
x
\begin{aligned} &x'=Ax+Bu \\ &y=Cx \\ \end{aligned}
x′=Ax+Buy=Cx
A
,
B
,
C
A,B,C
A,B,C 均未知。
注意到
B
,
C
B,C
B,C 不可逆,对
y
y
y 求导
y
′
=
C
x
′
=
C
A
x
+
C
B
u
y'=Cx'=CAx+CBu
y′=Cx′=CAx+CBu
取
C
A
^
,
C
B
^
\widehat{CA},\widehat{CB}
CA
,CB
为待估计的参数,则取
u
=
1
C
B
^
[
−
C
A
^
x
+
y
m
′
−
K
(
y
−
y
m
)
]
u=\frac{1}{\widehat{CB}}\left[-\widehat{CA}x+y_m'-K(y-y_m)\right]
u=CB
1[−CA
x+ym′−K(y−ym)]
当参数估计误差为0时,代入
y
y
y 得
y
′
−
y
m
′
=
−
K
(
y
−
y
m
)
y'-y_m'=-K(y-y_m)
y′−ym′=−K(y−ym)
误差不为0时,
y
m
′
=
C
B
^
u
+
C
A
^
x
+
K
y
−
K
y
m
y_m'=\widehat{CB}u+\widehat{CA}x+Ky-Ky_m
ym′=CB
u+CA
x+Ky−Kym。记
y
′
=
θ
∗
T
ϕ
=
[
C
A
C
B
]
[
x
u
]
y'=\theta^{*\text{T}}\phi=\begin{bmatrix} CA & CB \end{bmatrix} \begin{bmatrix} x \\ u \end{bmatrix}
y′=θ∗Tϕ=[CACB][xu]
设
θ
~
(
t
)
=
θ
^
(
t
)
−
θ
∗
,
e
=
y
−
y
m
\tilde\theta(t)=\hat\theta(t)-\theta^*,e=y-y_m
θ~(t)=θ^(t)−θ∗,e=y−ym,则
e
′
(
t
)
=
y
′
−
y
m
′
=
C
A
x
+
C
B
u
−
(
C
B
^
u
+
C
A
^
x
+
K
y
−
K
y
m
)
=
(
C
A
−
C
A
^
)
x
+
(
C
B
−
C
B
^
)
u
−
k
e
=
−
k
e
−
θ
~
T
ϕ
\begin{aligned} e'(t) =& y'-y_m' \\ =& CAx+CBu - (\widehat{CB}u+\widehat{CA}x+Ky-Ky_m) \\ =& (CA-\widehat{CA})x+(CB-\widehat{CB})u-ke=-ke-\tilde\theta^\text{T}\phi \end{aligned}
e′(t)===y′−ym′CAx+CBu−(CB
u+CA
x+Ky−Kym)(CA−CA
)x+(CB−CB
)u−ke=−ke−θ~Tϕ
取候选李雅普诺夫函数
V
(
e
,
θ
~
)
=
1
2
e
2
+
1
2
θ
~
T
θ
~
V(e,\tilde\theta) = \frac{1}{2}e^2+\frac{1}{2}\tilde\theta^\text{T}\tilde\theta
V(e,θ~)=21e2+21θ~Tθ~
剩下步骤与一阶系统相同。
反步法
例1
x
′
=
θ
ϕ
(
x
)
+
u
x'=\theta\phi(x)+u
x′=θϕ(x)+u
其中
θ
\theta
θ 未知。取
u
=
−
θ
^
ϕ
(
x
)
−
k
x
u=-\hat\theta\phi(x)-kx
u=−θ^ϕ(x)−kx,候选李雅普诺夫函数
V
(
e
,
θ
~
)
=
1
2
x
2
+
1
2
θ
~
2
V(e,\tilde\theta) = \frac{1}{2}x^2+\frac{1}{2}\tilde\theta^2
V(e,θ~)=21x2+21θ~2
则
V
′
=
x
x
′
+
θ
~
θ
~
′
=
x
θ
ϕ
+
x
(
−
θ
^
ϕ
−
k
x
)
+
θ
~
θ
~
′
=
−
k
x
2
−
x
ϕ
θ
~
+
θ
~
θ
~
′
\begin{aligned} V' =& xx'+\tilde\theta\tilde\theta' \\ =& x\theta\phi+x(-\hat\theta\phi-kx)+\tilde\theta\tilde\theta' \\ =& -kx^2-x\phi\tilde\theta+\tilde\theta\tilde\theta' \\ \end{aligned}
V′===xx′+θ~θ~′xθϕ+x(−θ^ϕ−kx)+θ~θ~′−kx2−xϕθ~+θ~θ~′
取
θ
~
′
=
θ
^
′
=
x
ϕ
\tilde\theta'=\hat\theta'=x\phi
θ~′=θ^′=xϕ,则
V
′
=
−
k
x
2
≤
0
V'=-kx^2\le 0
V′=−kx2≤0。
李雅普诺夫函数小于等于0不能保证收敛,需要证明。
V
V
V 单调下降有下界,所以
V
V
V 的极限一定存在。
V
(
∞
)
−
V
(
0
)
=
−
k
∫
0
∞
x
2
d
x
,
x
∈
L
2
V(\infty)-V(0)=-k\int_0^\infty x^2\text{d}x,\ x\in L_2
V(∞)−V(0)=−k∫0∞x2dx, x∈L2
x
x
x 有界,
θ
~
\tilde\theta
θ~ 在
V
V
V 中所以有界,所以
u
u
u 有界,
x
′
x'
x′ 有界,由信号收敛引理得
x
x
x 极限存在。但是,除非充分激励,否则不能保证
θ
^
\hat\theta
θ^ 收敛到
θ
\theta
θ。
例2
x
1
′
=
ϕ
1
(
x
1
)
+
x
2
x
2
′
=
θ
ϕ
2
(
x
⃗
)
+
u
x_1'=\phi_1(x_1)+x_2 \\ x_2'=\theta\phi_2(\vec{x})+u
x1′=ϕ1(x1)+x2x2′=θϕ2(x)+u
θ
\theta
θ 已知时,反馈线性化,令
y
=
x
1
y=x_1
y=x1,则
y
′
=
x
1
′
=
x
2
+
ϕ
1
y'=x_1'=x_2+\phi_1
y′=x1′=x2+ϕ1,
y
′
′
=
θ
ϕ
2
+
ϕ
1
′
+
u
y''=\theta\phi_2+\phi_1'+u
y′′=θϕ2+ϕ1′+u。取
u
=
−
θ
ϕ
2
−
ϕ
1
−
k
1
y
′
−
k
2
y
u=-\theta\phi_2-\phi_1-k_1y'-k_2y
u=−θϕ2−ϕ1−k1y′−k2y,则
y
′
′
=
−
k
1
y
′
−
k
2
y
y''=-k_1y'-k_2y
y′′=−k1y′−k2y。判断
T
(
x
)
=
[
y
y
′
]
=
[
x
1
x
2
+
ϕ
1
]
T(x)=\begin{bmatrix}y \\ y'\end{bmatrix} =\begin{bmatrix}x_1 \\ x_2+\phi_1\end{bmatrix}
T(x)=[yy′]=[x1x2+ϕ1]
是否是微分同胚
∂
T
(
x
)
∂
x
=
[
1
0
∂
ϕ
1
(
x
1
)
∂
x
1
1
]
\frac{\partial T(x)}{\partial x}=\begin{bmatrix} 1& 0 \\ \frac{\partial \phi_1(x_1)}{\partial x_1} & 1 \end{bmatrix}
∂x∂T(x)=[1∂x1∂ϕ1(x1)01]
矩阵非奇异所以全局微分同胚。
使用反步法重新设计,设计虚拟控制
x
2
→
α
1
(
x
1
)
=
−
ϕ
1
(
x
1
)
−
c
1
x
1
x_2\rightarrow\alpha_1(x_1)=-\phi_1(x_1)-c_1x_1
x2→α1(x1)=−ϕ1(x1)−c1x1,也就是设计
u
u
u 使
x
2
x_2
x2 收敛到
α
1
\alpha_1
α1,则
x
1
′
=
−
c
1
x
1
x_1'=-c_1x_1
x1′=−c1x1,收敛。
为了能让
x
1
x_1
x1 和
x
2
−
α
1
(
x
1
)
x_2-\alpha_1(x_1)
x2−α1(x1) 收敛,取李雅普诺夫候选
V
1
=
1
2
x
1
2
+
1
2
(
x
2
−
α
1
(
x
1
)
)
2
V_1 = \frac{1}{2}x_1^2+\frac{1}{2}(x_2-\alpha_1(x_1))^2
V1=21x12+21(x2−α1(x1))2
则
V
˙
1
=
x
1
x
1
˙
+
(
x
2
−
α
1
)
(
x
2
˙
−
α
˙
1
)
=
x
1
x
2
+
x
1
ϕ
1
+
(
x
2
−
α
1
)
(
θ
ϕ
2
+
u
−
α
˙
1
)
\begin{aligned} \dot{V}_1 =& x_1\dot{x_1}+(x_2-\alpha_1)(\dot{x_2}-\dot\alpha_1) \\ =& x_1x_2+x_1\phi_1+(x_2-\alpha_1)(\theta\phi_2+u-\dot\alpha_1) \\ \end{aligned}
V˙1==x1x1˙+(x2−α1)(x2˙−α˙1)x1x2+x1ϕ1+(x2−α1)(θϕ2+u−α˙1)
取
u
=
−
θ
ϕ
2
+
α
˙
1
−
x
1
−
c
2
(
x
2
−
α
1
)
u=-\theta\phi_2+\dot\alpha_1-x_1-c_2(x_2-\alpha_1)
u=−θϕ2+α˙1−x1−c2(x2−α1)
代入
V
˙
1
\dot{V}_1
V˙1 得
V
˙
1
=
x
1
(
x
2
+
ϕ
1
)
+
(
x
2
−
α
1
)
(
θ
ϕ
2
+
u
)
=
x
1
x
2
+
x
1
ϕ
1
+
(
x
2
−
α
1
)
(
−
x
1
−
c
2
(
x
2
−
α
1
)
)
=
x
1
ϕ
1
+
α
1
x
1
−
c
2
(
x
2
−
α
1
)
2
=
x
1
ϕ
1
+
(
−
ϕ
1
−
c
1
x
1
)
x
1
−
c
2
(
x
2
−
α
1
)
2
=
−
c
1
x
1
2
−
c
2
(
x
2
−
α
1
)
2
≤
0
\begin{aligned} \dot{V}_1=& x_1(x_2+\phi_1)+(x_2-\alpha_1)(\theta\phi_2+u) \\ =& x_1x_2+x_1\phi_1+(x_2-\alpha_1)(-x_1-c_2(x_2-\alpha_1)) \\ =& x_1\phi_1+\alpha_1x_1-c_2(x_2-\alpha_1)^2 \\ =& x_1\phi_1+(-\phi_1-c_1x_1)x_1-c_2(x_2-\alpha_1)^2 \\ =& -c_1x_1^2-c_2(x_2-\alpha_1)^2 \le 0 \end{aligned}
V˙1=====x1(x2+ϕ1)+(x2−α1)(θϕ2+u)x1x2+x1ϕ1+(x2−α1)(−x1−c2(x2−α1))x1ϕ1+α1x1−c2(x2−α1)2x1ϕ1+(−ϕ1−c1x1)x1−c2(x2−α1)2−c1x12−c2(x2−α1)2≤0
θ
\theta
θ 未知时,取李雅普诺夫候选
V
2
=
V
1
+
1
2
θ
~
2
V_2 = V_1+\frac{1}{2}\tilde\theta^2
V2=V1+21θ~2
将
u
u
u 中的
θ
\theta
θ 替换为
θ
^
\hat\theta
θ^
u
2
=
−
θ
^
ϕ
2
+
α
1
˙
−
x
1
−
c
2
(
x
2
−
α
1
)
u_2=-\hat\theta\phi_2+\dot{\alpha_1}-x_1-c_2(x_2-\alpha_1)
u2=−θ^ϕ2+α1˙−x1−c2(x2−α1)
代入
V
˙
2
\dot{V}_2
V˙2 得
V
˙
2
=
x
1
(
x
2
+
ϕ
1
)
+
(
x
2
−
α
1
)
(
θ
ϕ
2
+
u
2
−
α
1
˙
)
+
θ
~
˙
θ
~
=
x
1
x
2
+
x
1
ϕ
1
+
(
x
2
−
α
1
)
(
−
θ
~
ϕ
2
−
x
1
−
c
2
(
x
2
−
α
1
)
)
+
θ
~
˙
θ
~
=
x
1
ϕ
1
+
α
1
x
1
−
c
2
(
x
2
−
α
1
)
2
−
θ
~
ϕ
2
(
x
2
−
α
1
)
+
θ
~
˙
θ
~
=
x
1
ϕ
1
+
(
−
ϕ
1
−
c
1
x
1
)
x
1
−
c
2
(
x
2
−
α
1
)
2
+
θ
~
(
θ
~
˙
−
ϕ
2
x
2
+
ϕ
2
α
1
)
=
V
˙
1
+
θ
~
(
θ
~
˙
−
ϕ
2
x
2
+
ϕ
2
α
1
)
\begin{aligned} \dot{V}_2=& x_1(x_2+\phi_1)+(x_2-\alpha_1)(\theta\phi_2+u_2-\dot{\alpha_1}) +\dot{\tilde\theta}\tilde\theta \\ =& x_1x_2+x_1\phi_1+(x_2-\alpha_1)(-\tilde\theta\phi_2-x_1-c_2(x_2-\alpha_1)) +\dot{\tilde\theta}\tilde\theta \\ =& x_1\phi_1+\alpha_1x_1-c_2(x_2-\alpha_1)^2 -\tilde\theta\phi_2(x_2-\alpha_1)+\dot{\tilde\theta}\tilde\theta \\ =& x_1\phi_1+(-\phi_1-c_1x_1)x_1-c_2(x_2-\alpha_1)^2 +\tilde\theta(\dot{\tilde\theta}-\phi_2x_2+\phi_2\alpha_1) \\ =& \dot{V}_1+\tilde\theta(\dot{\tilde\theta}-\phi_2x_2+\phi_2\alpha_1) \end{aligned}
V˙2=====x1(x2+ϕ1)+(x2−α1)(θϕ2+u2−α1˙)+θ~˙θ~x1x2+x1ϕ1+(x2−α1)(−θ~ϕ2−x1−c2(x2−α1))+θ~˙θ~x1ϕ1+α1x1−c2(x2−α1)2−θ~ϕ2(x2−α1)+θ~˙θ~x1ϕ1+(−ϕ1−c1x1)x1−c2(x2−α1)2+θ~(θ~˙−ϕ2x2+ϕ2α1)V˙1+θ~(θ~˙−ϕ2x2+ϕ2α1)
或在
V
˙
2
\dot{V}_2
V˙2 中取
u
2
=
u
−
θ
~
ϕ
2
u_2=u-\tilde\theta\phi_2
u2=u−θ~ϕ2,此时
V
˙
2
=
V
˙
1
−
θ
~
ϕ
2
(
x
2
−
α
1
)
+
θ
~
˙
θ
~
=
V
˙
1
+
θ
~
(
θ
~
˙
−
ϕ
2
x
2
+
ϕ
2
α
1
)
\begin{aligned} \dot{V}_2=& \dot{V}_1-\tilde\theta\phi_2(x_2-\alpha_1) +\dot{\tilde\theta}\tilde\theta \\ =& \dot{V}_1+\tilde\theta(\dot{\tilde\theta}-\phi_2x_2+\phi_2\alpha_1) \end{aligned}
V˙2==V˙1−θ~ϕ2(x2−α1)+θ~˙θ~V˙1+θ~(θ~˙−ϕ2x2+ϕ2α1)
当
θ
~
˙
=
ϕ
2
x
2
−
ϕ
2
α
1
\dot{\tilde\theta}=\phi_2x_2-\phi_2\alpha_1
θ~˙=ϕ2x2−ϕ2α1 时,
V
˙
2
=
V
˙
1
≤
0
\dot{V}_2=\dot{V}_1 \le 0
V˙2=V˙1≤0。
例3
x
1
′
=
θ
ϕ
(
x
1
)
+
x
2
x
2
′
=
u
\begin{aligned} & x_1'=\theta\phi(x_1)+x_2 \\ & x_2'=u \end{aligned}
x1′=θϕ(x1)+x2x2′=u
θ
\theta
θ 已知时,设计虚拟控制
x
2
→
α
1
(
x
1
)
=
−
θ
ϕ
(
x
1
)
−
c
1
x
1
x_2\rightarrow\alpha_1(x_1)=-\theta\phi(x_1)-c_1x_1
x2→α1(x1)=−θϕ(x1)−c1x1,取李雅普诺夫候选
V
1
=
1
2
x
1
2
+
+
1
2
(
x
2
−
α
1
)
2
V_1=\frac{1}{2}x_1^2++\frac{1}{2}(x_2-\alpha_1)^2
V1=21x12++21(x2−α1)2
取
u
=
−
c
2
(
x
2
−
α
1
)
−
x
1
+
α
˙
1
u= -c_2(x_2-\alpha_1)-x_1 +\dot\alpha_1
u=−c2(x2−α1)−x1+α˙1
则
V
˙
=
x
1
x
2
+
x
1
θ
ϕ
+
(
x
2
−
α
1
)
(
u
−
α
˙
1
)
=
x
1
x
2
+
x
1
θ
ϕ
+
(
x
2
−
α
1
)
(
−
c
2
(
x
2
−
α
1
)
−
x
1
)
=
−
c
2
(
x
2
−
α
1
)
2
+
x
1
x
2
+
x
1
θ
ϕ
−
x
1
(
x
2
−
α
1
)
=
−
c
2
(
x
2
−
α
1
)
2
+
x
1
θ
ϕ
+
x
1
(
−
θ
ϕ
−
c
1
x
1
)
=
−
c
1
x
1
2
−
c
2
(
x
2
−
α
1
)
2
≤
0
\begin{aligned} \dot{V}=& x_1x_2+x_1\theta\phi+(x_2-\alpha_1)(u-\dot\alpha_1) \\ =& x_1x_2+x_1\theta\phi+(x_2-\alpha_1)(-c_2(x_2-\alpha_1)-x_1) \\ =& -c_2(x_2-\alpha_1)^2+x_1x_2+x_1\theta\phi-x_1(x_2-\alpha_1) \\ =& -c_2(x_2-\alpha_1)^2+x_1\theta\phi+x_1(-\theta\phi-c_1x_1) \\ =&-c_1x_1^2-c_2(x_2-\alpha_1)^2 \le 0 \end{aligned}
V˙=====x1x2+x1θϕ+(x2−α1)(u−α˙1)x1x2+x1θϕ+(x2−α1)(−c2(x2−α1)−x1)−c2(x2−α1)2+x1x2+x1θϕ−x1(x2−α1)−c2(x2−α1)2+x1θϕ+x1(−θϕ−c1x1)−c1x12−c2(x2−α1)2≤0
θ
\theta
θ 未知时,设计虚拟控制
x
2
→
α
1
(
x
1
,
θ
^
)
=
−
θ
^
ϕ
(
x
1
)
−
c
1
x
1
x_2\rightarrow\alpha_1(x_1,\hat\theta)=-\hat\theta\phi(x_1)-c_1x_1
x2→α1(x1,θ^)=−θ^ϕ(x1)−c1x1,定义新变量
z
1
=
x
1
,
z
2
=
x
2
−
α
1
(
x
1
,
θ
^
)
z_1=x_1,z_2=x_2-\alpha_1(x_1,\hat\theta)
z1=x1,z2=x2−α1(x1,θ^),则
z
1
˙
=
z
2
+
α
1
(
x
1
,
θ
^
)
+
θ
ϕ
=
z
2
−
θ
^
ϕ
−
c
1
z
1
+
θ
ϕ
=
z
2
−
θ
~
ϕ
−
c
1
z
1
z
2
˙
=
u
−
∂
α
∂
x
1
x
˙
1
−
∂
α
∂
θ
^
θ
^
˙
=
u
−
∂
α
∂
x
1
(
θ
ϕ
(
x
1
)
+
x
2
)
−
∂
α
∂
θ
^
θ
^
˙
\begin{aligned} \dot{z_1}=& z_2+\alpha_1(x_1,\hat\theta)+\theta\phi \\ =& z_2-\hat\theta\phi-c_1z_1+\theta\phi \\ =& z_2-\tilde\theta\phi-c_1z_1 \\ \dot{z_2}=& u-\frac{\partial\alpha}{\partial x_1}\dot{x}_1 -\frac{\partial\alpha}{\partial\hat\theta}\dot{\hat\theta} \\ =& u-\frac{\partial\alpha}{\partial x_1}(\theta\phi(x_1)+x_2) -\frac{\partial\alpha}{\partial\hat\theta}\dot{\hat\theta} \\ \end{aligned}
z1˙===z2˙==z2+α1(x1,θ^)+θϕz2−θ^ϕ−c1z1+θϕz2−θ~ϕ−c1z1u−∂x1∂αx˙1−∂θ^∂αθ^˙u−∂x1∂α(θϕ(x1)+x2)−∂θ^∂αθ^˙
此时
x
2
x_2
x2 作为控制量,设计
x
2
x_2
x2 使
x
1
x_1
x1 收敛,并试图估计出
θ
^
\hat\theta
θ^,因此取李雅普诺夫候选
V
1
=
1
2
z
1
2
+
1
2
θ
~
2
V_1=\frac{1}{2}z_1^2+\frac{1}{2}\tilde\theta^2
V1=21z12+21θ~2
V
˙
1
=
z
1
(
z
2
−
θ
~
ϕ
−
c
1
z
1
)
+
θ
~
˙
θ
~
=
−
z
1
2
+
z
1
z
2
+
θ
~
(
θ
~
˙
−
z
1
ϕ
)
\begin{aligned} \dot{V}_1=& z_1(z_2-\tilde\theta\phi-c_1z_1)+\dot{\tilde\theta}\tilde\theta \\ =& -z_1^2+z_1z_2+\tilde\theta(\dot{\tilde\theta}-z_1\phi) \end{aligned}
V˙1==z1(z2−θ~ϕ−c1z1)+θ~˙θ~−z12+z1z2+θ~(θ~˙−z1ϕ)
取
θ
~
˙
=
z
1
ϕ
\dot{\tilde\theta}=z_1\phi
θ~˙=z1ϕ 能消掉
V
˙
1
\dot{V}_1
V˙1 中的一部分,并把这个作为
θ
\theta
θ 的第一步估计(暂时没懂),继续取李雅普诺夫候选
V
2
=
1
2
z
1
2
+
1
2
θ
~
2
+
1
2
z
2
2
V_2=\frac{1}{2}z_1^2+\frac{1}{2}\tilde\theta^2+\frac{1}{2}z_2^2
V2=21z12+21θ~2+21z22
V
˙
2
=
−
z
1
2
+
z
1
z
2
+
z
2
z
˙
2
\dot{V}_2= -z_1^2+z_1z_2+z_2\dot{z}_2
V˙2=−z12+z1z2+z2z˙2
此时如果能让
z
˙
2
=
−
z
1
−
c
2
z
2
\dot{z}_2=-z_1-c_2z_2
z˙2=−z1−c2z2,那么
V
˙
2
=
−
z
1
2
−
z
2
2
\dot{V}_2=-z_1^2-z_2^2
V˙2=−z12−z22。也就是说
u
=
∂
α
∂
x
1
(
θ
ϕ
(
x
1
)
+
x
2
)
+
∂
α
∂
θ
^
θ
^
˙
−
z
1
−
c
2
z
2
u=\frac{\partial\alpha}{\partial x_1}(\theta\phi(x_1)+x_2) +\frac{\partial\alpha}{\partial\hat\theta}\dot{\hat\theta}-z_1-c_2z_2
u=∂x1∂α(θϕ(x1)+x2)+∂θ^∂αθ^˙−z1−c2z2
因为该式中出现了另一个
θ
\theta
θ,所以需要再估计一遍,将式中出现的
θ
\theta
θ 的第二次估计值记为
θ
^
2
\hat\theta_2
θ^2,估计误差记作
θ
~
2
\tilde\theta_2
θ~2,代入
z
˙
2
\dot{z}_2
z˙2,继续取李雅普诺夫候选
V
3
=
1
2
z
1
2
+
1
2
θ
~
2
+
1
2
z
2
2
+
1
2
θ
~
2
2
V_3=\frac{1}{2}z_1^2+\frac{1}{2}\tilde\theta^2+\frac{1}{2}z_2^2 +\frac{1}{2}\tilde\theta_2^2
V3=21z12+21θ~2+21z22+21θ~22
V
˙
3
=
−
z
1
2
+
z
1
z
2
+
z
2
z
˙
2
+
θ
~
2
˙
θ
~
2
=
−
z
1
2
+
z
1
z
2
+
z
2
(
u
−
∂
α
∂
x
1
(
θ
ϕ
+
x
2
)
−
∂
α
∂
θ
^
θ
^
˙
)
+
θ
~
2
˙
θ
~
2
=
−
z
1
2
+
z
1
z
2
+
z
2
(
(
∂
α
∂
x
1
(
θ
^
2
ϕ
+
x
2
)
+
∂
α
∂
θ
^
θ
^
˙
−
z
1
−
c
2
z
2
)
−
∂
α
∂
x
1
(
θ
ϕ
+
x
2
)
−
∂
α
∂
θ
^
θ
^
˙
)
+
θ
~
2
˙
θ
~
2
=
−
z
1
2
−
c
2
z
2
2
+
z
2
(
∂
α
∂
x
1
(
θ
^
2
ϕ
+
x
2
)
−
∂
α
∂
x
1
(
θ
ϕ
+
x
2
)
)
+
θ
~
2
˙
θ
~
2
=
−
z
1
2
−
c
2
z
2
2
+
z
2
∂
α
∂
x
1
θ
~
2
ϕ
+
θ
~
2
˙
θ
~
2
=
−
z
1
2
−
c
2
z
2
2
+
θ
~
2
(
∂
α
∂
x
1
z
2
ϕ
+
θ
~
2
˙
)
\begin{aligned} \dot{V}_3=& -z_1^2+z_1z_2+z_2\dot{z}_2+\dot{\tilde\theta_2}\tilde\theta_2 \\ =& -z_1^2+z_1z_2+z_2\left(u-\frac{\partial\alpha}{\partial x_1}(\theta\phi+x_2) -\frac{\partial\alpha}{\partial\hat\theta}\dot{\hat\theta}\right) +\dot{\tilde\theta_2}\tilde\theta_2 \\ =& -z_1^2+z_1z_2+z_2\left( (\frac{\partial\alpha}{\partial x_1}(\hat\theta_2\phi+x_2) +\frac{\partial\alpha}{\partial\hat\theta}\dot{\hat\theta}-z_1-c_2z_2) -\frac{\partial\alpha}{\partial x_1}(\theta\phi+x_2) -\frac{\partial\alpha}{\partial\hat\theta}\dot{\hat\theta}\right) +\dot{\tilde\theta_2}\tilde\theta_2 \\ =& -z_1^2-c_2z_2^2+z_2\left(\frac{\partial\alpha}{\partial x_1}(\hat\theta_2\phi+x_2) -\frac{\partial\alpha}{\partial x_1}(\theta\phi+x_2)\right) +\dot{\tilde\theta_2}\tilde\theta_2 \\ =& -z_1^2-c_2z_2^2+z_2\frac{\partial\alpha}{\partial x_1}\tilde\theta_2\phi +\dot{\tilde\theta_2}\tilde\theta_2 \\ =& -z_1^2-c_2z_2^2+\tilde\theta_2\left( \frac{\partial\alpha}{\partial x_1}z_2\phi+\dot{\tilde\theta_2}\right) \\ \end{aligned}
V˙3======−z12+z1z2+z2z˙2+θ~2˙θ~2−z12+z1z2+z2(u−∂x1∂α(θϕ+x2)−∂θ^∂αθ^˙)+θ~2˙θ~2−z12+z1z2+z2((∂x1∂α(θ^2ϕ+x2)+∂θ^∂αθ^˙−z1−c2z2)−∂x1∂α(θϕ+x2)−∂θ^∂αθ^˙)+θ~2˙θ~2−z12−c2z22+z2(∂x1∂α(θ^2ϕ+x2)−∂x1∂α(θϕ+x2))+θ~2˙θ~2−z12−c2z22+z2∂x1∂αθ~2ϕ+θ~2˙θ~2−z12−c2z22+θ~2(∂x1∂αz2ϕ+θ~2˙)
当
θ
^
˙
2
=
θ
~
˙
2
=
−
∂
α
∂
x
1
z
2
ϕ
\dot{\hat\theta}_2=\dot{\tilde\theta}_2 =-\frac{\partial\alpha}{\partial x_1}z_2\phi
θ^˙2=θ~˙2=−∂x1∂αz2ϕ
时,
V
˙
≤
0
\dot{V}\le 0
V˙≤0。
总结
参数匹配条件:当系统参数已知时,控制律可以直接把未知参数消掉;当未知参数假设已知时,没办法把未知参数消掉。此时就需要递归地多次估计未知参数,所以称作反步法(backstepping)。
仿真
本节仿真例2。
x
1
˙
=
e
x
1
−
1
+
x
2
x
2
˙
=
2
x
1
x
2
2
+
u
\begin{aligned} \dot{x_1} =& \text{e}^{x_1}-1+x_2 \\ \dot{x_2} =& 2 x_1x_2^2+u \end{aligned}
x1˙=x2˙=ex1−1+x22x1x22+u
α
1
(
x
1
)
=
−
ϕ
1
(
x
1
)
−
c
1
x
1
=
1
−
e
x
1
−
3
x
1
α
˙
1
(
x
1
)
=
−
e
x
1
x
˙
1
−
3
x
˙
1
=
−
(
e
x
1
+
3
)
(
e
x
1
−
1
+
x
2
)
u
=
−
θ
ϕ
2
+
α
˙
1
−
x
1
−
c
2
(
x
2
−
α
1
)
=
−
2
x
1
x
2
2
−
(
e
x
1
+
3
)
(
e
x
1
−
1
+
x
2
)
−
x
1
−
3
(
x
2
−
α
1
)
u
1
=
−
θ
ϕ
2
+
α
˙
1
−
x
1
−
c
2
(
x
2
−
α
1
)
=
−
2
x
1
x
2
2
−
(
e
x
1
+
3
)
(
e
x
1
−
1
+
x
2
)
−
3
(
x
2
−
α
1
)
\begin{aligned} \alpha_1(x_1) =& -\phi_1(x_1)-c_1x_1 \\ =& 1-\text{e}^{x_1}-3x_1 \\ \dot\alpha_1(x_1) =& -\text{e}^{x_1}\dot{x}_1-3\dot{x}_1 \\ =& -(\text{e}^{x_1}+3)(\text{e}^{x_1}-1+x_2) \\ u =& -\theta\phi_2+\dot\alpha_1-x_1-c_2(x_2-\alpha_1) \\ =& -2 x_1x_2^2-(\text{e}^{x_1}+3)(\text{e}^{x_1}-1+x_2)-x_1-3(x_2-\alpha_1) \\ u_1 =& -\theta\phi_2+\dot\alpha_1-x_1-c_2(x_2-\alpha_1) \\ =& -2 x_1x_2^2-(\text{e}^{x_1}+3)(\text{e}^{x_1}-1+x_2)-3(x_2-\alpha_1) \\ \end{aligned}
α1(x1)==α˙1(x1)==u==u1==−ϕ1(x1)−c1x11−ex1−3x1−ex1x˙1−3x˙1−(ex1+3)(ex1−1+x2)−θϕ2+α˙1−x1−c2(x2−α1)−2x1x22−(ex1+3)(ex1−1+x2)−x1−3(x2−α1)−θϕ2+α˙1−x1−c2(x2−α1)−2x1x22−(ex1+3)(ex1−1+x2)−3(x2−α1)
设初值
x
1
(
0
)
=
2
,
x
2
(
0
)
=
3
x_1(0)=2,x_2(0)=3
x1(0)=2,x2(0)=3,仿真结果如图所示。
simucpp 代码如下
#include <iostream>
#include <cmath>
#include "simucpp.hpp"
using namespace simucpp;
using namespace std;
class Plant: public PackModule {
public:
Plant(Simulator *sim) {
intx1 = new UIntegrator(sim, "intx1");
intx2 = new UIntegrator(sim, "intx2");
fcnx1 = new UFcnMISO(sim, "fcnx1");
fcnx2 = new UFcnMISO(sim, "fcnx2");
in1 = new UGain(sim, "in1");
sim->connectU(intx1, fcnx1);
sim->connectU(intx2, fcnx1);
sim->connectU(in1, fcnx1);
sim->connectU(intx1, fcnx2);
sim->connectU(intx2, fcnx2);
sim->connectU(in1, fcnx2);
sim->connectU(fcnx1, intx1);
sim->connectU(fcnx2, intx2);
intx1->Set_InitialValue(2);
intx2->Set_InitialValue(3);
fcnx1->Set_Function([](double *u){
double x1 = u[0], x2 = u[1], u1 = u[2];
return exp(x1) + x2;
});
fcnx2->Set_Function([](double *u){
double x1 = u[0], x2 = u[1], u1 = u[2];
return 2*x1*x2*x2 + u1;
});
}
private:
virtual PUnitModule Get_InputPort(uint n=0) const override {
if (n==0) return in1;
return nullptr;
}
virtual PUnitModule Get_OutputPort(uint n=0) const override {
if (n==0) return intx1;
if (n==1) return intx2;
return nullptr;
}
UIntegrator *intx1=nullptr;
UIntegrator *intx2=nullptr;
UFcnMISO *fcnx1=nullptr;
UFcnMISO *fcnx2=nullptr;
UGain *in1=nullptr;
};
int main() {
Simulator sim1(5);
auto *out1 = new UOutput(&sim1, "x1");
auto *out2 = new UOutput(&sim1, "x2");
// auto *out3 = new UOutput(&sim1, "alpha");
auto fcnu = new UFcnMISO(&sim1, "fcnu");
auto fcnalpha = new UFcnMISO(&sim1, "fcnalpha");
Plant *plant1 = new Plant(&sim1);
sim1.connectU(fcnu, plant1, 0);
sim1.connectU(plant1, 0, fcnu);
sim1.connectU(plant1, 1, fcnu);
sim1.connectU(plant1, 0, fcnalpha);
sim1.connectU(plant1, 1, fcnalpha);
sim1.connectU(plant1, 0, out1);
sim1.connectU(plant1, 1, out2);
sim1.connectU(fcnalpha, fcnu);
fcnu->Set_Function([](double *u) {
double x1 = u[0], x2 = u[1], a1=u[2];
return -2*x1*x2*x2 - (exp(x1)+3)*(exp(x1)+x2)-3*(x2-a1);
});
fcnalpha->Set_Function([](double *u) {
double x1 = u[0], x2 = u[1];
return -exp(x1)-3*x1;
});
sim1.Initialize();
sim1.Simulate();
cout << out1->Get_OutValue() << endl;
cout << out2->Get_OutValue() << endl;
sim1.Plot();
return 0;
}