G(S)=50/(S^2+2S),设计状态观测器,要求观测器两个极点均为-15,要求用两种不同的方法求解观测增益矩阵
时间: 2024-01-24 10:20:20 浏览: 21
方法一:基于极点配置的观测器设计
由于要求观测器的两个极点均为-15,因此我们可以通过极点配置的方法来设计观测器。
首先,计算系统的可观测性矩阵 $O$:
$$
O=
\begin{bmatrix}
C \\
CA
\end{bmatrix}
=
\begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix}
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
$$
由于 $O$ 的秩为2,因此系统是可观测的。
接下来,我们使用以下的观测器形式:
$$
\dot{\hat{x}}=A\hat{x}+Bu+L(y-\hat{y})
$$
其中,$\hat{x}$ 表示状态估计值,$L$ 是观测增益矩阵。
将系统状态方程和观测方程写成矩阵形式:
$$
\begin{bmatrix}
\dot{x_1} \\
\dot{x_2}
\end{bmatrix}
=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
$$
$$
y=
\begin{bmatrix}
1 & 0
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix}
$$
因此,我们可以得到观测器的状态方程和观测方程:
$$
\begin{bmatrix}
\dot{\hat{x}_1} \\
\dot{\hat{x}_2}
\end{bmatrix}
=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
L_1 \\
L_2
\end{bmatrix}
(y-\hat{y})
$$
$$
\hat{y}=
\begin{bmatrix}
1 & 0
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
$$
根据观测器的极点设计要求,我们可以得到观测器的特征多项式为:
$$
\begin{aligned}
\Delta_o(s) &= (s+15)^2 \\
&= s^2 + 30s + 225
\end{aligned}
$$
观测器的状态方程的特征多项式为:
$$
\begin{aligned}
\Delta_{\hat{A}-\hat{L}C}(s) &= \Delta_o(s) \\
&= s^2 + 30s + 225
\end{aligned}
$$
因此,观测器的状态矩阵 $\hat{A}$ 和增益矩阵 $L$ 可以通过以下方程求解:
$$
\begin{aligned}
\hat{A}-\hat{L}C &=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
-
\begin{bmatrix}
L_1 \\
L_2
\end{bmatrix}
\begin{bmatrix}
1 & 0
\end{bmatrix} \\
&=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
-
\begin{bmatrix}
L_1 & 0 \\
L_2 & 0
\end{bmatrix}
\end{aligned}
$$
$$
\begin{aligned}
\Delta_{\hat{A}-\hat{L}C}(s) &= \det(sI-(\hat{A}-\hat{L}C)) \\
&=
\begin{vmatrix}
s & -50+L_1 \\
2-L_2 & s+2+L_2
\end{vmatrix} \\
&= s^2 + (2+L_2)s + (50-L_1)
\end{aligned}
$$
令 $\Delta_{\hat{A}-\hat{L}C}(s) = \Delta_o(s)$,得到以下方程组:
$$
\begin{cases}
2+L_2 = 30 \\
50-L_1 = 225-L_2 \cdot 30
\end{cases}
$$
解得:
$$
\begin{cases}
L_1 = 5 \\
L_2 = 28
\end{cases}
$$
因此,观测器的状态方程为:
$$
\begin{bmatrix}
\dot{\hat{x}_1} \\
\dot{\hat{x}_2}
\end{bmatrix}
=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
5 \\
28
\end{bmatrix}
(y-\hat{y})
$$
观测器的增益矩阵为:
$$
L =
\begin{bmatrix}
5 \\
28
\end{bmatrix}
$$
方法二:基于最小二乘法的观测器设计
另一种求解观测增益矩阵的方法是基于最小二乘法的观测器设计。我们可以使用以下的观测器形式:
$$
\dot{\hat{x}}=A\hat{x}+Bu+L(y-\hat{y})
$$
其中,$\hat{x}$ 表示状态估计值,$L$ 是观测增益矩阵。
将系统状态方程和观测方程写成矩阵形式:
$$
\begin{bmatrix}
\dot{x_1} \\
\dot{x_2}
\end{bmatrix}
=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
$$
$$
y=
\begin{bmatrix}
1 & 0
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix}
$$
我们可以将观测器的状态方程和观测方程写成以下形式:
$$
\begin{aligned}
\dot{\hat{x}} &= A\hat{x}+Bu+L(y-\hat{y}) \\
&=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
L_1 & L_2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
-
L_1 y
\end{aligned}
$$
$$
\hat{y}=
\begin{bmatrix}
1 & 0
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
$$
定义误差向量 $e = \begin{bmatrix} e_1 & e_2 \end{bmatrix}^T$,其中 $e_1 = y-\hat{y}$,$e_2 = x-\hat{x}$。那么观测器的动态可以表示为:
$$
\begin{aligned}
\dot{\hat{x}} &= A\hat{x}+Bu+L(y-\hat{y}) \\
&=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
L_1 & L_2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
-
L_1 y \\
&=
\begin{bmatrix}
0 & 50 \\
-2 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
L_1 & L_2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
-
\begin{bmatrix}
L_1 & 0
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
-
\begin{bmatrix}
0 & 1
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
L_1 & 0
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix} \\
&=
\begin{bmatrix}
0 & 50-L_1 \\
-2-L_2 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
L_1 & 0
\end{bmatrix}
\begin{bmatrix}
e_1 \\
e_2
\end{bmatrix}
\end{aligned}
$$
我们希望最小化误差向量 $e$ 的二范数的平方,即:
$$
J = e^Te
$$
根据最小二乘法的原理,我们可以得到观测增益矩阵 $L$ 的最优解:
$$
L = \begin{bmatrix} L_1 & L_2 \end{bmatrix}^T = (CO^TO^{-1}C^T)^{-1}CO^T
\begin{bmatrix}
\begin{matrix}
0 & 1
\end{matrix}^T \\
\begin{matrix}
0 & 50-L_1
\end{matrix}^T
\end{bmatrix}^{-1}
$$
其中,$O$ 是系统的可观测性矩阵,$C$ 是观测矩阵。
代入具体的数值,我们可以得到观测增益矩阵 $L$:
$$
L =
\begin{bmatrix}
4.9984 \\
27.9978
\end{bmatrix}
$$
因此,使用最小二乘法设计的观测器的状态方程为:
$$
\begin{bmatrix}
\dot{\hat{x}_1} \\
\dot{\hat{x}_2}
\end{bmatrix}
=
\begin{bmatrix}
0 & 49.9984 \\
-2.0022 & -2
\end{bmatrix}
\begin{bmatrix}
\hat{x}_1 \\
\hat{x}_2
\end{bmatrix}
+
\begin{bmatrix}
0 \\
1
\end{bmatrix}
u
+
\begin{bmatrix}
4.9984 \\
27.9978
\end{bmatrix}
(y-\hat{y})
$$
两种方法求解的观测器增益矩阵略有差别,但在实际应用中两种方法都可以使用。