多卫星定位算法

多卫星定位算法

现已知有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)+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)=((xxs)2+(yys)2+(zzs)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)(XX0)+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)(XX0)进行多元展开:
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)(XX0)=x((xxs)2+(yys)2+(zzs)2)1/2x=x0(xx0)+y((xxs)2+(yys)2+(zzs)2)1/2y=y0(yy0)+z((xxs)2+(yys)2+(zzs)2)1/2z=z0(zz0)=F(X0)x0xs(xx0)+F(X0)y0ys(yy0)+F(X0)z0zs(zz0)=F(X0)x0xsδx+F(X0)y0ysδy+F(X0)z0zsδz
忽略泰勒展开的高阶项之后,再将以上的等式矩阵化得到:
多卫星定位算法_第1张图片

以上只是对于一个卫星而言,如果拓展多个卫星就得到:
多卫星定位算法_第2张图片

令其等于 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(RF(X0))2=δXTATAδX2(RF(X0))TAδX+(RF(X0))T(RF(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(RF(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差别不大,才跳出循环。

你可能感兴趣的:(Algorithm,算法)