一些专业名词
- Perigee: 近地点
- Apogee: 远地点
- True anomaly: 真近点角(anomlay是古希腊语,就是角度的意思)
- Vernal equinox: 春分点(March 21)
- Autumnal equinox 秋分点(Sept 23)
- Perihelion: 近日点(Dec,22)
- Aphelion:远日点(July,1)
- Heliocentric Reference Frame: 日心坐标系
- GMST -Greenwich Mean Sidereal Time: 格林尼治恒星时间(格林尼治与ECI 的X轴(指向恒星,不随地球转动而转动)之间的夹角)
开普勒三大定律
- 开普勒第一定律: 所有行星绕太阳运行的轨道都呈椭圆,太阳位于椭圆的一焦点上。
- 开普勒第二定律: 连接行星和太阳的直线在相等的时间内扫过的面积相等
- 开普勒第三定律: 不同行星绕太阳运行的公转周期的平方分别于他们的轨道长半径的立方成正比
开普勒参数:
开普勒轨道参数一共有6个:
- 轨道升交点赤经
- 轨道倾角
- 近地点角距
- 长半径
- 偏心率
- 卫星真近点角
对于一颗在无摄状态下运行的卫星,它的6个开普勒轨道参数在地心惯性坐标系统中只有真近点角
偏近点角E和平近点角M的关系由以下的开普勒方程给出:
求出M后,
卫星星历和历书参数
以上两小节讨论了卫星在理想状态下的无摄动轨道以及6个开普勒轨道参数,然而在实际中,卫星除了主要受到来自地球的引力外,还会受到来自其他天体(太阳,月球)的引力、太阳光辐射压力以及地球的不规则形状,不均匀质地等多种因素的影响。在这些复杂因素的综合作用下,各个开普勒轨道参数将不再是常数,卫星的实际运行轨道也将偏离无摄运行轨道,而这种卫星轨道偏差在GPS中是绝对不容忽视的。
- 星历是详细的卫星轨道参数,有效期4小时
- 历书是简略的卫星轨道参数,只能大概估算位置,不能用于定位,有效期半年,一般只能用于接收机对卫星信号的搜索和捕获。
卫星空间位置计算
利用星历参数计算出GPS卫星在某一时刻的空间位置是GPS接收机为实现定位而必须完成的重要一步么,而本节将通过一个例子来详细解释这一计算方法和步骤。这一计算通常需要双精度浮点运算。π值一般取:3.141 592 653 589 8
SETP1 计算规化时间
卫星星历给出的轨道参数是以星历参考时间
上式得到的
SETP2 计算卫星的平均角速度n
将卫星星历给出的
而将星历提供的
SETP3 计算型号发射时刻的平近点角
将星历给出的
可得
STEP4 计算信号发射时刻的偏近点角
给出了平近点角
STEP5 计算信号发射时刻的真近点角
将
SETP6 计算信号发射时刻的升交点角距
可得到:
STEP7 计算信号发射时刻的摄动校正项
将星历参数
可得二次谐波摄动校正量:
STEP8 计算摄动校正后的升交点角距
可得:
STEP9 计算信号发射时刻卫星在轨道平面位置
通过以下公式将极坐标
得
STEP10 计算信号发射时刻的升交点赤经
升交点赤经的线性模型如下:
由此可得
STEP11 计算卫星在WGS-84地心地固直角坐标系
如图3.8所示,轨道平面直角坐标系
旋转(
代入数值后,最终得到卫星在ECEF中的表示:
matlab 代码如下:
clear;
clc;
clear all;
%%
% 星历 参考GPS原理及接收机设计 3.4
eph.rcvr_tow = 100;
eph.sqrtA = 5153.65531;
eph.toe = 244800;
eph.dn = 4.249105564E-9;
eph.m0 = -1.064739758;
eph.e = 0.005912038265;
eph.w = -1.717457876;
eph.i0 = 0.9848407943;
eph.idot = 7.422851197E-51;
eph.omg0 = 1.038062244;
eph.odot = -8.151768125E-9;
eph.cus = 2.237036824E-6;
eph.cuc = 3.054738045E-7;
eph.crs = 2.53125;
eph.crc = 350.53125;
eph.cis = 8.940696716E-8;
eph.cic = -8.381903172E-8;
[x y z] = get_satellite_position(eph, 239050.7223, 1);
pos = [x y z]
function [x y z] = get_satellite_position(eph, t, compute_harmonic_correction)
% get_satellite_position: computes the position of a satellite at time (t) given the
% ephemeris parameters.
% Usage: [x y z] = get_satellite_position(eph, t, compute_harmonic_correction)
% Input Args: eph: ephemeris data
% t: time
% compute_harmonic_correction (optional): 1 if harmonic
% correction should be applied, 0 if not.
% Output Args: [x y z] in ECEF in meters
% ephmeris data must have the following fields:
% rcvr_tow (receiver tow)
% svid (satellite id)
% toc (reference time of clock parameters)
% toe (referece time of ephemeris parameters)
% af0, af1, af2: clock correction coefficients
% ura (user range accuracy)
% e (eccentricity)
% sqrtA (sqrt of semi-major axis)
% dn (mean motion correction)
% m0 (mean anomaly at reference time)
% w (argument of perigee)
% omg0 (lontitude of ascending node)
% i0 (inclination angle at reference time)
% odot (rate of right ascension)
% idot (rate of inclination angle)
% cus (argument of latitude correction, sine)
% cuc (argument of latitude correction, cosine)
% cis (inclination correction, sine)
% cic (inclination correction, cosine)
% crs (radius correction, sine)
% crc (radius correction, cosine)
% iod (issue of data number)
% set default value for harmonic correction
switch nargin
case 2
compute_harmonic_correction=1;
end
mu = 3.986005e14;
omega_dot_earth = 7.2921151467e-5; %(rad/sec)
% Now follow table 20-IV
A = eph.sqrtA^2;
cmm = sqrt(mu/A^3); % computed mean motion
tk = t - eph.toe;
% account for beginning of end of week crossover
if (tk > 302400)
tk = tk-604800;
end
if (tk < -302400)
tk = tk+604800;
end
% apply mean motion correction
n = cmm + eph.dn;
% Mean anomaly
mk = eph.m0 + n*tk;
% solve for eccentric anomaly
% 迭代3次
Ek = mk;
Ek = mk + eph.e*sin(Ek);
Ek = mk + eph.e*sin(Ek);
Ek = mk + eph.e*sin(Ek);
% syms E;
% eqn = E - eph.e*sin(E) == mk;
% solx = vpasolve(eqn, E);
% Ek = double(solx);
% True anomaly:
nu = atan2((sqrt(1-eph.e^2))*sin(Ek)/(1-eph.e*cos(Ek)), (cos(Ek)-eph.e)/(1-eph.e*cos(Ek)));
%Ek = acos((e + cos(nu))/(1+e*cos(nu)));
%升交点角距
Phi = nu + eph.w;
du = 0;
dr = 0;
di = 0;
% 摄动校正量
if (compute_harmonic_correction == 1)
% compute harmonic corrections
du = eph.cus*sin(2*Phi) + eph.cuc*cos(2*Phi);
dr = eph.crs*sin(2*Phi) + eph.crc*cos(2*Phi);
di = eph.cis*sin(2*Phi) + eph.cic*cos(2*Phi);
end
u = Phi + du;
r = A*(1-eph.e*cos(Ek)) + dr;
% inclination angle at reference time
i = eph.i0 + eph.idot*tk + di;
x_prime = r*cos(u);
y_prime = r*sin(u);
omega = eph.omg0 + (eph.odot - omega_dot_earth)*tk - omega_dot_earth*eph.toe;
x = x_prime*cos(omega) - y_prime*cos(i)*sin(omega);
y = x_prime*sin(omega) + y_prime*cos(i)*cos(omega);
z = y_prime*sin(i);
end
参考
- GPS原理及接收机设计
- http://www.telesens.co/2017/07/17/calculating-position-from-raw-gps-data/#1b_Code_for_Calculating_Satellite_Position