Analysis of the Basic Principles of GPS Positioning

Source: http://blog.csdn.net/webgeek/article/details/18220891

 

Location-based services have become an increasingly popular technology and will become standard for all future mobile devices ( smartphones , PDAs, etc.). Among the positioning and navigation technologies, the most accurate and widely used technology is GPS. There are many professional materials on the Internet that introduce the principles of GPS, and this article attempts to briefly introduce the basic principles of GPS positioning from the perspective of programmers in an easy-to-understand way for programmers , hoping to inspire friends who do GPS development. Of course, this article does not involve specific development technology.

1. GPS positioning mathematical model

The reason why the mathematical model is introduced first is because I think this mathematical model may be a problem that programmers are more concerned about. Of course, it is stated in advance that this model is just a simplified model that I have always summed up for programmers based on some GPS data. The details may not be in line with reality. If you want to know the specific details, please refer to the professional GPS explanation materials.

GPS positioning, in fact, is to determine the position of the GPS receiver through four satellites with known positions.

GPS_thumb22

As shown in the figure above, the GPS receiver in the figure is the device that is currently determining the location, and the satellites 1, 2, 3, and 4 are the four satellites used for this positioning:

  • Position1, Position2, Position3, and Position4 are the current positions (spatial coordinates) of the four satellites, which are known
  • d1, d2, d3, and d4 are the distances from the four satellites to the GPS receiver to be positioned, which are known
  • Location is the location of the satellite receiver to be located, to be requested

Then the process of positioning, simply speaking, is to obtain the Location from the known four pairs of data [Position1,d1], [Position2,d2], [Position3,d3], [Position4,d4] through a function GetLocation() . value of . Expressed in terms of function calls familiar to programmers, this is:

Location=GetLocation([Position1,d1],[Position2,d2],[Position3,d3],[Position4,d4]);

As soon as they see this function call, programmers should be excited: where do these parameters come from? How is this function executed? Who will execute it? The solid geometry has not been forgotten, and it is possible to ask: why are 4 pairs of parameters necessary? Then let's explore it together.

1. Where does the position information of Position1, Position2, Position3, and Position4 come from?

In fact, each GPS satellite running in space is constantly broadcasting its current position coordinate information to the world through satellite signals. Any GPS receiver can easily receive this information through the antenna, and can read this information (which is actually one of the core functions of every GPS chip). That's where this location information comes from.

2. Where does the distance information of d1, d2, d3, and d4 come from?

We already know that each GPS satellite is painstakingly broadcasting its position, so when the position information is sent, the timestamp when the data packet is sent will also be attached. After the GPS receiver receives the data packet, the current time (of course, the current time can only be determined by the GPS receiver itself) minus the time on the timestamp is the time used for the data packet to be transmitted in the air.

Knowing the transmission time of the data packet in the air, then multiplying his transmission speed is the distance that the data packet is transmitted in the air, that is, the distance from the satellite to the GPS receiver. The data packet is transmitted by radio waves, then the ideal speed is the speed of light c, and if the travel time is recorded as Ti, the formula is:

di = c * Ti (i = 1,2,3,4);

This is where di(i=1,2,3,4) comes from.

3.GetLocation()函数是如何执行的?

这个函数是我为了说明问题而虚构的,事实上未必存在,但是一定存在这样类似的运算逻辑。这些运算逻辑可以由软件来实现,但是事实上可能大都是由硬件芯片来完成的(这可能也是每一个GPS芯片的核心功能之一)。

4.为什么要必须要四对参数?

根据立体几何知识,三维空间中,三对[Positioni,di]这样的数据就可以确定一个点了(实际上可能是两个,但我们可以通过逻辑判断舍去一个),为什么这里需要四对呢?理想情况下,的确三对就够了,也就是说理想情况下只需要三颗卫星就可以实现GPS定位。但是事实上,必须要四颗。

因为根据上面的公式,di是通过c*Ti计算出来的,而我们知道c值是很大的(理想速度即光速),那么对于时间Ti而言,一个极小的误差都会被放大很多倍从而导致整个结果无效。也就是说,在GPS定位中,对时间的精度要求是极高的。GPS卫星上是用銫原子钟来计时的,但是我们不可能为每一个GPS接收器也配一个銫原子钟,因为一个銫原子钟的价格可能已经超过了这个GPS设备再加上使用GPS的这辆名贵汽车的价格。

同时,由于速度c也会受到空中电离层的影响,因此也会有误差;再者,GPS卫星广播的自己的位置也可能会有误差。其他等等一些因素也会影响数据的精确度。

总之,数据是存在误差的。这些误差可能导致定位精确度降低,也可能直接导致定位无效。GetLocation(函数)中多用了一组数据,正是为了来校正误差。至于具体的细节,我们就不用关心了,我们只要知道,多用一组数据,就可以通过一些巧妙的算法,消除或减小误差,保证定位有效。这就是GetLocation()函数必须用四组数据的原因,也就是为什么必须有四颗卫星才能定位的原因。

5.GetLocation()函数返回的位置信息怎样被GPS设备识别呢?

前面说在进行位置计算时都是用的空间坐标形式表示,但是对GPS设备及应用程序而言,通常需要用的是一个[经度,纬度,高度]这样的位置信息。那么我们可以想象,在GetLocation()函数返回位置结果前,可能会进行一个从空间坐标形式到经纬度形式的转换,我们不妨假设存在一个Convert(经纬度,空间坐标)这样的函数来进行这个转换。

6.单点定位与差分定位

实际上上面所说的只是定位原理中的其中一种,称为单点定位,或绝对定位。就是通过唯一的一个GPS接收器来确定位置。

GPS_thumb11

目前定位精度最高的是差分定位,或称相对定位。就是通过增加一个参考GPS接收器来提高定位精度。

GPS_thumb1 

 

上面我们已经围绕一个虚拟的GetLocation()函数基本搞清楚了GPS定位的基本数学模型,对于编程而言,知道这些就足够了(其实不知道也不影响编程)。如果好奇心还没满足的话,我们继续了解一些GPS相关的背景知识。

 

二、GPS卫星是哪里来的?

(废话,当然是人发射的!地球人发射的!)

GPS(Global Position System,全球定位系统),全称为NAVSTAR GPS(NAVigation Satellite Timing And Ranging Global Position System,导航星测时与测距全球定位系统)。GPS是一个由美国国防部开发的空基全天侯导航系统,它用以满足军方在地面或近地空间内获取在一个通用参照系中的位置、速度和时间信息的要求。

1.GPS发展历程

  • 1957年10月第一颗人造地球卫星SputnikⅠ发射成功,空基导航定位由此开始
  • 1958年开始设计NNSS-TRANSIT,即子午卫星系统; 
    1964年该系统正式运行; 
    1967年该系统解密以供民用。
  • 1973年,美国国防部批准研制GPS; 
    1991年海湾战争中,GPS首次大规模用于实战; 
    1994年,GPS全部建成投入使用; 
    2000年,克林顿宣布,GPS取消实施SA(对民用GPS精度的一种人为限制策略)。

2.美国政府的的GPS策略

  • 两种GPS服务: 
    SPS--标准定位服务,民用,精度约为100M; 
    PPS--精密定位服务,军用和得到特许的民间用户使用,精度高达10M.
  • 两种限制民用定位精度的措施(保障国家利益不受侵害): 
    SA--选择可用性,认为降低普通用户的测量精度,限制水平定位精度100M,垂直157M(已于2005年5月1日取消); 
    AS--反电子欺骗。

3.其他卫星导航系统

  • GLONASS(全球轨道导航卫星系统),前苏联
  • Galileo-ENSS(欧洲导航卫星系统,即伽利略计划),欧盟
  • 北斗导航系统,中国

 

三、GPS系统的构成

GPS系统=空间部分+控制部分+用户部分

GPS_thumb23

 

1.空间部分

GPS空间部分主要由24颗GPS卫星构成,其中21颗工作卫星,3颗备用卫星。24颗卫星运行在6个轨道平面上,运行周期为12个小时。保证在任一时刻、任一地点高度角15度以上都能够观测到4颗以上的卫星。

主要作用:发送用于导航定位的卫星信号。

构成:24颗卫星=21颗工作卫星+3颗备用卫星

GPS_thumb1

2.控制部分

GPS控制部分由1个主控站,5个检测站和3个注入站组成。

组成:GPS控制部分=主控站(1个)+监测站(5个)+注入站(3个)

作用:监测和控制卫星运行,编算卫星星历(导航电文),保持系统时间。

  • Main control station: Collect satellite data from various monitoring stations, calculate satellite ephemeris and clock correction parameters, etc., and inject satellites through injection stations; issue commands to satellites to control satellites, and dispatch backup satellites when satellites fail.
  • Monitoring station: Receive satellite signals, detect satellite operation status, collect weather data, and transmit this information to the main control station.
  • Injection station: inject the satellite ephemeris and clock correction parameters calculated by the main control station into the satellite. 

GPS_thumb3

 

Distribution:

  • Main control station: Falcon Air Force Base in Colorado, USA.
  • Injection stations: Ascendion, Atlantic Ocean; Diego Garcia, Indian Ocean; Kwajalein, Eastern Pacific.
  • Monitoring Stations: 1 with the main control station; 3 with the injection station; another in Hawaii, Western Pacific.

GPS_thumb2 

3. User Section

The GPS user equipment part includes GPS receivers and related equipment. The GPS receiver is mainly composed of GPS chips.

Such as vehicle-mounted, ship-mounted GPS navigators, mobile devices with built-in GPS functions, GPS surveying and mapping equipment, etc., all belong to GPS user equipment.

Composition: Mainly for GPS receiver

Role: A device that receives, tracks, transforms and measures GPS signals, and is a consumer of GPS systems.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326230313&siteId=291194637