多卫星定位算法
现已知有N(N>=4)个卫星,每个卫星的坐标用
X
s
{X_s}
Xs表示,其对应的伪距用
r
r
r表示。
由于伪距不是准确的、真实的距离,它有所干扰。所以我们可以再根据三维空间中的距离公式,另外估计卫星和用户的距离为
r
^
\hat r
r^。公式如下:
r
^
=
F
(
X
)
+
c
δ
t
\hat r = F\left( X \right) + c\delta t
r^=F(X)+cδt
此时注意此时的
X
X
X和
X
s
{X_s}
Xs都是三维矢量(vector),
X
X
X表示用户的坐标。
X
=
(
x
y
z
)
X = \left( \begin{array}{l} x\\ y\\ z \end{array} \right)
X=
xyz
其中
c
c
c是光速
(
m
/
s
)
(m/s)
(m/s),
δ
t
\delta t
δt是卫星和接收机的时间差。
F
(
X
)
F\left( X \right)
F(X)的距离公式如下:
F
(
X
)
=
(
(
x
−
x
s
)
2
+
(
y
−
y
s
)
2
+
(
z
−
z
s
)
2
)
1
/
2
F\left( X \right) = {\left( {{{\left( {x - {x_s}} \right)}^2} + {{\left( {y - {y_s}} \right)}^2} + {{\left( {z - {z_s}} \right)}^2}} \right)^{1/2}}
F(X)=((x−xs)2+(y−ys)2+(z−zs)2)1/2
对
F
(
X
)
F\left( X \right)
F(X)泰勒展开(Taylor Expansion):
F
(
X
)
=
F
(
X
0
)
+
d
F
(
X
0
)
d
X
(
X
−
X
0
)
+
o
(
X
)
F\left( X \right) = F\left( {{X_0}} \right) + \frac{{dF\left( {{X_0}} \right)}}{{dX}}\left( {X - {X_0}} \right) + o\left( X \right)
F(X)=F(X0)+dXdF(X0)(X−X0)+o(X)
再对
d
F
(
X
0
)
d
X
(
X
−
X
0
)
\frac{{dF\left( {{X_0}} \right)}}{{dX}}\left( {X - {X_0}} \right)
dXdF(X0)(X−X0)进行多元展开:
d
F
(
X
0
)
d
X
(
X
−
X
0
)
=
∂
(
(
x
−
x
s
)
2
+
(
y
−
y
s
)
2
+
(
z
−
z
s
)
2
)
1
/
2
∂
x
∣
x
=
x
0
(
x
−
x
0
)
+
∂
(
(
x
−
x
s
)
2
+
(
y
−
y
s
)
2
+
(
z
−
z
s
)
2
)
1
/
2
∂
y
∣
y
=
y
0
(
y
−
y
0
)
+
∂
(
(
x
−
x
s
)
2
+
(
y
−
y
s
)
2
+
(
z
−
z
s
)
2
)
1
/
2
∂
z
∣
z
=
z
0
(
z
−
z
0
)
=
x
0
−
x
s
F
(
X
0
)
(
x
−
x
0
)
+
y
0
−
y
s
F
(
X
0
)
(
y
−
y
0
)
+
z
0
−
z
s
F
(
X
0
)
(
z
−
z
0
)
=
x
0
−
x
s
F
(
X
0
)
δ
x
+
y
0
−
y
s
F
(
X
0
)
δ
y
+
z
0
−
z
s
F
(
X
0
)
δ
z
\begin{array}{l} \frac{{dF\left( {{X_0}} \right)}}{{dX}}\left( {X - {X_0}} \right) = \frac{{\partial {{\left( {{{\left( {x - {x_s}} \right)}^2} + {{\left( {y - {y_s}} \right)}^2} + {{\left( {z - {z_s}} \right)}^2}} \right)}^{1/2}}}}{{\partial x}}{|_{x = {x_0}}}\left( {x - {x_0}} \right) + \frac{{\partial {{\left( {{{\left( {x - {x_s}} \right)}^2} + {{\left( {y - {y_s}} \right)}^2} + {{\left( {z - {z_s}} \right)}^2}} \right)}^{1/2}}}}{{\partial y}}{|_{y = {y_0}}}\left( {y - {y_0}} \right) + \frac{{\partial {{\left( {{{\left( {x - {x_s}} \right)}^2} + {{\left( {y - {y_s}} \right)}^2} + {{\left( {z - {z_s}} \right)}^2}} \right)}^{1/2}}}}{{\partial z}}{|_{z = {z_0}}}\left( {z - {z_0}} \right)\\ \\= \frac{{{x_0} - {x_s}}}{{F\left( {{X_0}} \right)}}\left( {x - {x_0}} \right) + \frac{{{y_0} - {y_s}}}{{F\left( {{X_0}} \right)}}\left( {y - {y_0}} \right) + \frac{{{z_0} - {z_s}}}{{F\left( {{X_0}} \right)}}\left( {z - {z_0}} \right)\\ \\= \frac{{{x_0} - {x_s}}}{{F\left( {{X_0}} \right)}}\delta x + \frac{{{y_0} - {y_s}}}{{F\left( {{X_0}} \right)}}\delta y + \frac{{{z_0} - {z_s}}}{{F\left( {{X_0}} \right)}}\delta z \end{array}
dXdF(X0)(X−X0)=∂x∂((x−xs)2+(y−ys)2+(z−zs)2)1/2∣x=x0(x−x0)+∂y∂((x−xs)2+(y−ys)2+(z−zs)2)1/2∣y=y0(y−y0)+∂z∂((x−xs)2+(y−ys)2+(z−zs)2)1/2∣z=z0(z−z0)=F(X0)x0−xs(x−x0)+F(X0)y0−ys(y−y0)+F(X0)z0−zs(z−z0)=F(X0)x0−xsδx+F(X0)y0−ysδy+F(X0)z0−zsδz
忽略泰勒展开的高阶项之后,再将以上的等式矩阵化得到:
以上只是对于一个卫星而言,如果拓展多个卫星就得到:
令其等于
R
^
=
A
δ
X
\hat R = A\delta X
R^=AδX。
再根据最小二乘法的公式:
L
(
X
)
=
∥
R
^
−
R
∥
2
L\left( X \right) = {\left\| {\hat R - R} \right\|^2}
L(X)=
R^−R
2
得到:
L
(
δ
X
)
=
∥
A
δ
X
−
(
R
−
F
(
X
0
)
)
∥
2
=
δ
X
T
A
T
A
δ
X
−
2
(
R
−
F
(
X
0
)
)
T
A
δ
X
+
(
R
−
F
(
X
0
)
)
T
(
R
−
F
(
X
0
)
)
\begin{array}{l} L\left( {\delta X} \right) = {\left\| {A\delta X - \left( {R - F\left( {{X_0}} \right)} \right)} \right\|^2}\\ \\ = \delta {X^T}{A^T}A\delta X - 2{\left( {R - F\left( {{X_0}} \right)} \right)^T}A\delta X + {\left( {R - F\left( {{X_0}} \right)} \right)^T}\left( {R - F\left( {{X_0}} \right)} \right) \end{array}
L(δX)=∥AδX−(R−F(X0))∥2=δXTATAδX−2(R−F(X0))TAδX+(R−F(X0))T(R−F(X0))
对
δ
X
\delta X
δX推导出以下公式:
δ
X
=
(
A
T
A
)
−
1
A
T
(
R
−
F
(
X
0
)
)
X
=
X
0
+
δ
X
\begin{array}{l} \delta X = {\left( {{A^T}A} \right)^{ - 1}}{A^T}\left( {R - F\left( {{X_0}} \right)} \right)\\ \\X = {X_0} + \delta X \end{array}
δX=(ATA)−1AT(R−F(X0))X=X0+δX
最后,由于泰勒展开时
X
0
{X_0}
X0是任意取的,所以我们并不能确定它就是
X
X
X附近,而如果
X
0
{X_0}
X0不在
X
X
X附近,再忽略掉泰勒展开后高阶项将导致巨大的误差。为了解决这个问题,我们将计算得到的
X
X
X当成
X
0
{X_0}
X0循环代入以上这些公式,直到本次得到
X
X
X值和上次得到
X
X
X差别不大,才跳出循环。