+86-0755-28192060

news

Events
Home -Events -Industry News -This should be one of the most detailed and clear articles on GPS positioning

This should be one of the most detailed and clear articles on GPS positioning

Release date:2021-12-29Author source:KinghelmViews:211

  [introduction]   

In this article, let's talk about satellite positioning, which is closely related to the Internet of things.

   
 
   


   

Introduction


In the past, if your girlfriend was a road addict, there might be such a conversation


——Where are you?

——Ah? I'm on the road.

——What are the characteristics?

——There is a moon overhead.

——What's next to you?

——There is a street lamp.

——Are there any road signs? What does the sign say?

——Let me see. Really, it says "no parking, fine for violators".

——Aunt, I really convinced you

——Hum, don't you love me anymore? You certainly don't love me anymore. Do you like the new receptionist?

——。。。

——I tell you, that receptionist is definitely a fake mother! (start the gossip mode) also, Xiao Wang bought a new lipstick. It's really nice. Can you buy it for me

——(a broken expression)

(passerby A: you can't have a girlfriend!)


Now, if your girlfriend is a road fool


——Where are you?

——I'll send you a location! Come and pick me up.

——Yes...


As a standard road addict, he has fallen into a desperate black history for N times. It's the so-called: holding a map, staring at the road, looking around at a loss, where am I?


Later, with the popularity of smart phones, I thought the situation could be improved. Later, I found that I thought more - why does XX map and XX navigation always let me run into a dead end, and let me drive across the lake?


Later, with the iteration of the mobile operating system and the upgrading of the chip, the positioning gradually became accurate and reliable. I don't have to swim in the lake anymore... Of course, that's all later.


(brother doesn't drive a car, he does! Silence! Loneliness!)


Slowly, with the in-depth understanding, I realized that there were so many differences in the original positioning, and the knowledge inside was great.


There are many kinds of positioning methods. Outdoor positioning includes base station positioning, satellite positioning, etc; Indoor positioning includes ble, RFID, Wi Fi and other methods; There are other IP positioning, inertial navigation and so on.

Positioning mode

Positioning principle

Positioning scheme

Application scenario

cost

Equipment requirements

accuracy

Base station location

Report the information of the base stations around the equipment, and the server looks up the table, analyzes and returns the positioning results

Single base station positioning

Multi base station positioning

outdoor

Very low

Low equipment cost

Back end support required*

500m

satellite positioning

The antenna is used to search the radio wave emitted by the satellite to the surface, and the positioning results are output after calculation

Multi satellite positioning

outdoor

Lower

Low equipment cost

5m

Differential positioning

The satellite is positioned in combination with the data of the reference station

Multi satellite positioning

outdoor

Very high

High equipment cost

Proprietary backend support required*

5mm

BLE iBeacon

Use the device to receive the Bluetooth signal, calculate the distance according to the signal strength, and output the positioning result

Single point positioning

Multipoint positioning

indoor

higher

High equipment cost

30cm

RFID

Use the equipment to receive the RF signal, calculate the distance according to the signal strength, and output the positioning result

Single point positioning

Multipoint positioning

indoor

Very high

High equipment cost

10cm

Wi-Fi

Report the MAC information of the router around the device, and the server looks up the table, parses and returns the positioning results

Single machine positioning

Multi machine positioning

indoor

Lower

Low equipment cost

Back end support required*

10m

IP} location

Report the public IP address of the target device, and the server looks up the table and returns the positioning result

-

unlimited

Very low

Low equipment cost

Back end support required*

10km

buddha-like

Holding Buddha beads

mutter incantations

-

unlimited

0 cost

No equipment required

Follow suit

     
       
       

"Back end support required" means that you need to connect to the server for data analysis in order to obtain positioning results;


"Proprietary back-end support" means that you may need to pay to obtain relevant data before the terminal equipment can locate.


In this article, let's talk about satellite positioning, which is most closely related to the Internet of things.


 


Among many satellite positioning systems, the most well-known is GPS (Global Positioning System). It was developed by the United States in 1958, put into use in 1964 and achieved global coverage in 1994.



GPS consists of 24 working stars and 4 standby stars. The satellite operates in six non synchronous orbits with an altitude of 20200 km at 55 degrees to each other. In this way, more than four GPS satellites can be observed anywhere and at any time in the world. GPS satellite sends navigation messages (system time, ephemeris, almanac, satellite clock correction parameters, navigation satellite health status, ionospheric delay parameters, etc.) to the earth. After receiving the data sent by the satellite, the GPS terminal can determine the current position through solution, and output the data in NMEA0183 grid and WGS-84 coordinate system.



Some readers may ask, what if the satellite breaks down, isn't GPS going to be inaccurate? In fact, this worry is superfluous. There are not only backup satellites in orbit, but also NASA will entrust space X to reissue and replace the satellites at the end of their life every year.


Of course, GPS is not the only satellite positioning system. Just because of the pioneering position of GPS, many people habitually call all satellite positioning systems "GPS".


After all, when GPS satellites are used, they are clamped down by the United States. GPS satellites are controlled by the U.S. military. They can freely adjust the positioning accuracy of a certain region (such as the Middle East), and even make the solution results of terminal equipment quite different. Moreover, GPS satellite is one-way broadcast, does not have two-way communication capability, and its function is slightly single.


In view of this, many countries are also building or have built satellite positioning systems. asBeidou in China, Galileo in Europe, GLONASS in Russia and irnss in IndiaWait.


At present, Beidou in China has commercial capacity. With the reference station, it can even provide customers with positioning services accurate to mm. At the same time, Beidou also makes up for the lack of GPS and has the ability of short message (necessary for donkey friends and HNA. It is by no means comparable to the base station of mobile phone, but the charge is very touching).


Since there are so many satellites in space and so many different satellite positioning systems, how can we know whether a certain area is covered by positioning satellites and which satellites are covered?For Android phones, please search for "GPS data" in the app store and install it. After opening it, you can see the positioning satellite currently in use



Due to the differences of smartphone operating system, positioning chip, antenna and algorithm, not all satellite systems for positioning can be searched. Generally speaking, smart phones can only find and use parts (as shown in the figure, that is, GPS Beidou GLONASS QZSS, without Galileo and irnss).


 
       

Operating frequencies of different frequency bands of each navigation system

Navigation system

country

Frequency band

working frequency

GPS

U.S.A

L1

1575.42MHZ ± 1.023MHZ

L2

1227.60MHZ ± 1.023MHZ

L5

1176.45MHZ ± 1.023MHZ

GLONASS

Russia

L1

1602.5625MHZ ± 4MHZ

L2

1246.4375MHZ ± 4MHZ

BD1

China

S

2491.75MHZ ± 4.08MHZ

L

1615.68MHZ ± 4.08MHZ

(left-handed circular polarization)

BD2

B1

1561.098MHZ ± 2.046MHZ

B2

1207.520MHZ ± 2.046MHZ

B3

1268.520MHZ ± 10.23MHZ

Galileo

Europe

L1

1575.420MHZ ± 1.023MHZ

E5b

1207.140MHZ ± 1.023MHZ

E5a

1176.450MHZ ± 1.023MHZ

E6

1278.750MHz ± 1.023MHZ

QZSS

Japan

L1C

L1CD

1575.42 MHz

L1CP

L1-C/A

L2C

1227.6 MHz

L5

L5I

1176.45 MHz

L5Q

L1-SAIF

1575.42 MHz

LEX

1278.75 MHz

IRNSS

India

L5

1176.45 MHz

S

2492.028 MHz


     
     
       

Looking at the table, we can find that Japan is a "chicken thief" - L1 C / A, L1C, L2C and L5 signals are fully compatible with GPS satellite signals. At the same time, l1-saif can also provide high-precision positioning services to Japan; The frequency point of Lex signal coincides with E6 frequency point of European Galileo system. In other words, QZSS in Japan can be used as a supplement to GPS. In the future, QZSS can also supplement Galileo system when Galileo system officially provides services.


Next, enter the popular "you ask and I answer" link:


Q: Why is sometimes mobile positioning still very slow?

A: Signal problems, baseband problems, everything is possible. If you want to improve the positioning accuracy, the simplest way is to buy! One! New! Hands! Machine!


Q: I want to try Galileo. Do you have a supported mobile phone?

A: Huawei supports some models.


Q: Xiaomi 8 bangs are not good-looking. Look how beautiful vivo nex is. By the way, Xiaomi 8 said it was the first mobile phone in the world to support GPS dual band positioning (L1 and L5). It seems very awesome. Can it achieve centimeter level positioning?

A: No. Without the support of the reference station, the dual frequency is at most to reduce the error and is helpless for high-precision positioning. So, wash and sleep.


Q: How touching is Beidou's short message rate?

A: A dozen dollars a piece. You can go to a cat and a treasure to check the quotation.

As for voice communication, there are also maritime satellite phones available. The charges vary from more than ten yuan to dozens of yuan a minute in different countries; what? Do you want to use satellite Internet? How about $10 / 1m by volume? Is it affordable?


Q: Now that you have GPS, why rebuild the wheel?

A: Because L1 and L5 of GPS are civil codes, they are available to the public. At the time of the upgrading of the Sino US science and technology war, the chip has been held by the throat. How can the "privacy" of the positioning system be in the hands of others?


Q: Is GPS only useful on the surface?

A: No. Negative altitude (as long as there is a signal), in the air, or even outside the atmosphere. It should be noted that it cannot be used in objects with high density such as water and rocks.

For use outside the atmosphere, we should also pay attention to the impact of general relativity on the clock.


Q: In 007 tomorrow Empire, the villain used some awesome equipment, changed satellite parameters and hijacked a ship by some means. Is this possible?

A: This kind of thing has happened in the world.

Because the GPS signal has no authentication method, and the signal is very weak, it is very easy to be hijacked. For example, hackrf one can simulate and transmit GPS signals; Even let Dajiang UAV take off in the no fly zone.

Iran has also used similar technology to successfully capture American drones.


Q: How many satellites can we find at least to locate successfully?

A: Because of the principle of triangular positioning, at least three satellites can achieve accurate positioning; Specific requirements are as follows:

Number of satellites used

Can you locate

remarks

0

Unable to locate


one

Unable to locate

UTC time and date can be updated;

two

Unable to locate


three

It can realize 2D fix and output longitude and latitude

Altitude information cannot be output

four

3D fix

Correct altitude information can be output

>4 (multi frequency)

3D fix

Exportable pseudo range


     
                 
       

Q: Why do you know so much?

A: Probably because I'm taller than you.


Positioning article


Some people will ask, since there are many satellites in the sky, why do I only use a limited number of output results? This is because the small-size ceramic antenna used by the single chip microcomputer can only be compatible with two frequency bands (generally, the software also selects two), and can not be compatible with three frequency bands at the same time. Therefore, it is usually single choice GPS or Beidou; Or the combination of GPS Beidou and GPS GLONASS.


Some developers find that the code is correct, but the positioning module can't find the satellite and can't locate it?


In fact, troubleshooting this problem is both simple and complex. The reason why it is simple is that the only reason why we can't find the satellite is the signal problem. Complex because even if you know the cause, developers may feel helpless.


Signal problem, that is"Satellite → antenna → module → code → output"Something went wrong in one of the links. Here, combined with the "look, hear, ask and cut" method, we will break down the possible problems one by one.


first,Developers should keep in mind that at any time, there should be no foreign objects shielding the antenna in the space (such as trees, buildings and viaducts), and there are physical metal shells shielding the antenna (such as aluminum shells and iron shells). It shall be ensured that the test environment is open, unobstructed and the signal is good.


The reason why we have been emphasizing antenna, signal and no shielding is that the transmission power of the satellite is not large and the signal is very weak when it reaches the ground. This signal intensity is equivalent to the light emitted by a 25 watt bulb 16000 kilometers away. As another analogy, it is 1 billion times lower than the power received by the TV antenna.


If the signal is weak or no signal, it will be unable to locate or slow to locate. So, how to judge whether the positioning is slow or true due to signal problems; No signal? Observe the GGA, RMC and GSA output from the module:

GGA:

Format:

$--GGA,hhmmss. ss,llll. ll,a,yyyyy. yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh

Example:

$GPGGA,065545.789,2109.9551,N,12023.4047,E,1,9,0.85,18.1,M,8.0,M,,*5E


name

Sample

Company

describe

Message ID

$GPGGA


GGA # protocol header

UTC time

sixty-five thousand five hundred and forty-five point seven eight nine


hhmmss. sss

latitude

two thousand one hundred and nine point nine five five one


ddmm. mmmm

N/S

N


N = north, s = South

longitude

twelve thousand and twenty-three point four zero four seven


dddmm. mmmm

E/W

E


W = west, e = east

Positioning indication

one


0: not located

1: SPS} mode, effective positioning

2: Differential, SPS} mode, effective positioning

3: PPS} mode, effective positioning

Number of satellites

nine


Range 0 to 12

HDOP

zero point eight five


Horizontal accuracy

MSL amplitude

eighteen point one

rice


Company

M

rice


earth

-2.2

rice


Company

M


-

Differential time


second

Invalid when there is no DGPS}

Differential station ID




Checksum

*5E





End of message


     

       

RMC:

Format:

$--RMC,hhmmss. ss,A,llll. ll,a,yyyyy. yy,a,x.x,x.x,xxxx,x.x,a*hh

example sentence:

$GPRMC,100646.000,A,3109.9704,N,12123.4219,E,0.257,335.62,291216,,,A*59


name

Sample

Company

describe

Message ID

$GPRMC


RMC} protocol header

UTC time

one hundred thousand six hundred and forty-six


hhmmss. sss

state

A


A = data valid; V = invalid data

latitude

two thousand one hundred and nine point nine seven zero four


ddmm. mmmm

N/S

N


N = north, s = South

longitude

eleven thousand one hundred and twenty-three point four two one nine


dddmm. mmmm

E/W

E


W = west, e = east

ground speed

zero point two five seven

Knot (section)


position

three hundred and thirty-five point six two

degree


date

two hundred and ninety-one thousand two hundred and sixteen


ddmmyy

Magnetic variable



-

Checksum

*59





End of message


GSA:

Format:

$--GSA,a,a,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x.x,x.x,x.x*hh

example sentence:

$GPGSA,A,3,10,24,12,32,25,21,15,20,31,,,,1.25,0.85,0.91*04


name

Sample

Company

describe

Message ID

$GPGSA


GSA} protocol header

Mode 1

A


M = manual (forced in 2D or 3D mode)

A = Automatic

Mode 2

three


1: Invalid positioning

2: 2D} positioning

3: 3D} positioning

Satellite use

ten


Channel 1

Satellite use

twenty-four


Channel 2

Satellite use

twelve


Channel 3

Satellite use

thirty-two


Channel 4

Satellite use

twenty-five


Channel 5

Satellite use

twenty-one


Channel 6

Satellite use

fifteen


Channel 7

Satellite use

twenty


Channel 8

,,,

,,,

,,,


Satellite use



Channel 12

PDOP

one point two five


Position accuracy

HDOP

zero point eight five


Horizontal accuracy

VDOP

zero point nine one


Vertical accuracy

Checksum

*04





End of message


  • If UTC time in GGA is wrong,The positioning indication is 0, and the number of satellites is not 0; Or the UTC time and date of RMC are wrong; Number of satellites in GSANot 0However, if the carrier to noise ratio is very low, it may beSlow satellite search, slow positioning, poor signal


  • If UTC time in GGA is wrong,The positioning indication is 0, and the number of satellites is always 0; Or the UTC time and date of RMC are wrong; If the GSA has no valid output at all, it may beNo signal at all.


aboutSlow satellite search, slow positioning, poor signalThe antenna design shall be improved to ensure the installation and use state of the antenna facing upward; And there is no metal object around the antenna to block, and there is no RF interference; Large size ceramic antenna shall be selected as far as possible when space allows, and active antenna shall be used when necessary.


In the case of no signal at all, the probability is that the antenna design is wrong. For example, the active antenna is not powered on, the antenna model is used incorrectly (for example, the chip only supports GPS, the antenna only supports Beidou; the GSM antenna is used incorrectly to receive signals), etc.


Extended reading: design suggestions for GPS antenna of luat module

http://blog.sina.com.cn/s/blog_5b0121350102xy8v.html


Another common situation is that developers can't test indoors (including windows and windowsills). Because there is no satellite signal indoors, positioning cannot be realized.


If it is not convenient for developers to test outdoors, they can search "GPS} forwarding" in a treasure and buy relevant equipment. In this way, developers don't have to "take the trouble" to debug outdoors.


Next, let's enter the "you ask and I answer" link:


Q: Is there an antenna with small size and strong signal?

A: You can't have both fish and bear's paws. Only the most suitable, not the best.


Q: Where is NMEA-0183 format description?

A: Please http://www.openluat.com/ The GPS module of the product center is downloaded from the "Download Center".


Q: What is the relationship between GNSS and GPS?

A: Strictly speaking, GPS ∈ GNSS.

All satellite positioning systems can be called GNSS, and GPS is a subset of GNSS.

This is also reflected in the output, such as gngga, gpgga and bdgga, namely "hybrid positioning" (multi satellite system), "GPS positioning" and "Beidou Positioning".

Statement identifier:


identifier

meaning

BD

BDS, Beidou second generation satellite system

GP

GPS

GL

GLONASS

GA

Galileo

GN

GNSS, global navigation satellite system


Q: What is the difference between GGA, RMC and RSV?

A: All are required by NMEA-0183 standard. Their definitions are as follows:


identifier

meaning

GGA

Time, location, number of satellites and positioning mode

GSA

GPS} receiver operation mode, satellite used for positioning, DOP value, positioning status

GSV

Visible GPS satellite information, elevation, azimuth and signal-to-noise ratio

RMC

Time, date, location, speed

VTG

Ground speed information

  

Q: Is there any way to convert UTC time to local time?

A: On land, because many countries may span many time zones, but use the same time, they can only look up the table (such as UTC 8, Beijing time). If it is an ocean, the time zone is calculated based on longitude.


Q: Is there a mobile phone that can be used to test GPS and a powerful app?

A:Android:GPS Status; GPS Test ; GPS Data

iOS:GPS Test


Q: Why is the mobile phone positioning so fast and accurate, the positioning module so slow, and the error is still great?

A: Because the mobile phone is multi positioning (base station WiFi Bluetooth GPS AGPs historical data) at the expense of personal privacy, and the module only uses GPS antenna, it is slightly slower. However, after using "AGPs assisted positioning", second positioning can also be achieved.


Q: Why do you know so much?

A: Probably because I'm rich.


PS: so, how to use "AGPs assisted positioning"? Please pay attention to the following.


Second positioning


Why is the positioning speed not fast when the signal is excellent? Is there any way to achieve it"Second positioning"And? Of course, the answer is yes.

         
           
       


Under normal circumstances, after the positioning module is powered on, it searches the satellite through the antenna, analyzes the data transmitted by the satellite (navigation message), then internally generates the ephemeris, and then obtains the current accurate position (3D fix) through complex calculation. This process is called"Cold start"。 According to the signal strength and chip computing power, it usually takes tens of seconds to a few minutes.


In the process,Search for stars to generate ephemeris filesIt takes the longest.


However, some readers may ask, why sometimes the positioning module successfully locates in only a few seconds?There are two reasons: 1. Non "cold start" mode, i.e. "warm start" or "hot start";

2. AGPs assisted positioning is used.


So what is the difference between "cold start", "warm start" and "hot start"? Perhaps you will think that the "x startup" here is similar to the startup, standby (sleep) and restart of the computer? Actually, that's not the case. Since the space position of the satellite and the surface position of the terminal equipment are not fixed, the "x start" here is based on the last positioning time and displacement distance:


Start mode

explain

Autonomous second positioning*

Auxiliary second positioning*

cold boot

1. When used for the first time;

2. When the ephemeris information is lost due to battery depletion;

3. When moving more than 1000 km under shutdown.

×

Warm start

More than 2 hours and less than 4 hours from the last positioning time;

No large distance displacement occurs.

Hot start

Less than 2 hours from the last positioning time;

No large distance displacement occurs.


Autonomous second positioning: fast star searching and positioning can be realized according to the ephemeris saved in the module.

Auxiliary second positioning: use AGPs to realize fast satellite search and positioning.


In other words, under the conditions of "warm start" and "hot start", the positioning module can realize autonomous second positioning.


So, what is "AGPs assisted positioning"? In the traditional GPS positioning mode, the positioning module needs full band search to find available satellites, so it takes a long time. The "AGPs assisted positioning" method is to directly download the available satellite ephemeris data in the current area through the network and send it to the positioning module. The positioning module only searches for specific satellites, so as to improve the satellite search speed and reduce the power consumption of equipment.


For example: cold start is like a multiple-choice question. You have to calculate all the options before you can find the correct answer; The "AGPs assisted positioning" is like a cheater, eliminating many wrong answers, as long as a few can be calculated. So as to improve efficiency and accuracy.


However, there is no Holy Grail in the world, "AGPs assisted positioning" is not a panacea. Its application conditions still need to be relatively harsh:

· The satellite signal receiving conditions must be good, and at least 4 satellites can be observed (if possible,Active antenna is recommended);


  • Positioning chipAGPs assisted positioning must be supported

  • Must beaccuracyObtain the ephemeris data of the current region;

  • In case of cold start, it is necessary to wait for the successful attachment of the communication chip and transmit the ephemeris data to the positioning module after receiving the ephemeris data;

  • If it is warm start / hot start, it is also necessary to search the star again;


It can be seen that the second positioning can be realized only when the above conditions are met. If it is cold start} GPRS attachment to transmit ephemeris data, the waiting time is actually not short (it is even possible that the positioning module has 3D fix and GPRS has just attached successfully and sent ephemeris data).


Taking the air8xx series module of Shanghai Hezhou Communication Technology Co., Ltd. as an example, its AGPs auxiliary positioning basic process is as follows:


1、The device obtains the cell information of the current location from the cellular base station;

2、The device transmits the current cellular cell information to the AGPs location server in the network through the cellular network;

3、The APGs location server queries the currently available satellite information (including satellite frequency band, azimuth, elevation and other relevant information) in the area according to the current cell information, generates the corresponding ephemeris file and returns it to the equipment;

4、The communication module transmits the received ephemeris file to the positioning module through the serial port;

5、According to the available satellite information obtained from the ephemeris file, the positioning module can quickly find the currently available GPS satellites and search for satellites, which greatly improves the positioning time.


Next, let's enter the "you ask and I answer" link of universal celebration:


Q: My module has no GPS chip. Can I use "AGPs assisted positioning" to realize positioning?

A: Of course not. This question is equivalent to "can I run 100 miles without a supercharger and an engine". "AGPs assisted positioning" is only used to assist accelerated positioning, rather than an independent and available positioning service.


Q: Can "AGPs assisted positioning" improve positioning accuracy?

A: No, it can only speed up positioning. Positioning accuracy cannot be improved.


Q: How to judge whether AGPs is successfully written according to NMEA-0183?

A: Check whether the UTC time of GGA and RMC is corrected and whether the GSV data is generated;


 
 
           
       

GSV:

Format:

$--GSV,x,x,x,x,x,x,x,...* hh

example sentence:

$GPGSV,3,1,12,14,75,001,31,32,67,111,38,31,57,331,33,26,47,221,20*73


name

Sample

Company

describe

Message ID

$GPGSV


GSV} protocol header

Number of messages

three


1~3

Message number

one


1~3

Number of satellites

twelve



Satellite ID

fourteen


1~32

elevation

seventy-five

degree

0~90

azimuth

001

degree

0~359

Carrier noise ratio (C / no)

thirty-one

dBHz

0 ~ 99 (null without tracking)

Satellite ID

thirty-two


1~32

elevation

sixty-seven

degree

0~90

azimuth

one hundred and eleven

degree

0~359

Carrier noise ratio (C / no)

thirty-eight

dBHz

0 ~ 99 (null without tracking)

Satellite ID

thirty-one


1~32

elevation

fifty-seven

degree

0~90

azimuth

three hundred and thirty-one

degree

0~359

Carrier noise ratio (C / no)

thirty-three

dBHz

0 ~ 99 (null without tracking)

Satellite ID

twenty-six


1~32

elevation

forty-seven

degree

0~90

azimuth

two hundred and twenty-one

degree

0~359

Carrier noise ratio (C / no)

twenty

dBHz

0 ~ 99 (null without tracking)

Checksum

*73





End of message


Q: Does the ephemeris file of "AGPs assisted positioning" consume much traffic?

A: Very few, just a few K.


Q: Do ephemeris files need to be updated regularly? What is the update frequency?

A: It needs to be analyzed according to its own situation. If it is cold start, do not close the positioning module and download the "AGPs auxiliary positioning" data (ephemeris file) once. During operation, the corresponding ephemeris file will be automatically generated in the positioning module without repeated downloading;

If it is started and closed irregularly, it is not necessary to update it within 4 hours of shutdown ("warm start" category); If the ephemeris saved in the module is invalid after more than 4 hours, the ephemeris file must be updated (downloaded again), otherwise it is the same as "cold start".


Q: Can you build your own AGPs ephemeris data server?

A: Yes. But it's more troublesome. It is recommended to use the interface provided by our company (please refer to the code of agps.lua in the routine).


Briefly describe how to build. First, download the navigation message data of BRDC on that day at NASA (take February 1, 2018 as an example):


ftp://cddis.gsfc.nasa.gov/pub/gps/data/daily/2018/brdc/brdc0320.18n.Z

(standby) ftp://igs.ensg.ign.fr/pub/igs/data/2018/032/brdc0320.18n.Z

Almanac of GPS satellite is included in the fourth and fifth subframes of navigation message, which can be regarded as a simplified subset of satellite ephemeris parameters. The server receives the request from the client, extracts the ephemeris of the current day from the navigation message, and then sends it to the client.


Extended reading: GPS satellite ephemeris and Almanac

https://blog.csdn.net/Csdn_Darry/article/details/72052686


Q: Taking gk9501 positioning chip as an example, how to send the data of "AGPs assisted positioning" to it?

A: Please refer to the relevant documents provided by the manufacturer and send the data to the positioning chip through the serial port in the specified format (please refer to the code of agps.lua in the routine).


Extended reading: test case of air series GPS module

http://blog.sina.com.cn/s/blog_5b0121350102xy8w.html


Q: Why do you know so much?

A: Probably because I'm handsome.


Mars coordinates (correction)


After suffering, we finally succeeded in positioning and obtaining the correct output. But how does it seem that the format is not quite right? The longitude and latitude are 4 and 5. Isn't that going to circle the earth several times?


In fact, this is a misunderstanding caused by the difference between the NMEA-0183 output format and the format we use every day. Let's take another look at the GGA format:


Format:

$--GGA,hhmmss. ss,llll. ll,a,yyyyy. yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh

Example:

$GPGGA,065545.789,2109.9551,N,12023.4047,E,1,9,0.85,18.1,M,8.0,M,,*5E


name

Sample

Company

describe

Message ID

$GPGGA


GGA # protocol header

UTC time

sixty-five thousand five hundred and forty-five point seven eight nine


hhmmss. sss

latitude

two thousand one hundred and nine point nine five five one


ddmm. mmmm

N/S

N


N = north, s = South

longitude

twelve thousand and twenty-three point four zero four seven


dddmm. mmmm

E/W

E


W = west, e = east

(omit part GGA)


Have you found the problem?

GGA output format: ddmm Mmmm (degrees minutes)

Daily use format: dd.dddd (degree)


So how to convert the data output by GGA into the format we use every day? Xueba will say at a glance that this problem is very simple, Balabala ~ ~ ~ as a learning slag, I am confused.


Cough, I'd better apply the formula directly.


The formula is as follows:

ddmm. Mmmm → move the decimal point forward by two digits → dd.mmmm → DD 0 (mmmm/60) = dd.dddddd

give an example:

12023.4047 → 120.234047 → 120 0. (234047÷60) = 120.390078


After such conversion, we can put the obtained values into the map software.


Everything seems beautiful, but... Until... You used Baidu map... Shit, lying slot... Why is the error so big? Deviation of hundreds of meters?


 
 
     
       

Clearly in the building, why does the map show me in the river? Why? Is there a problem with the positioning module? Or did mine write another bug? Or is the antenna faulty? Black question mark face.

       
 



       

The reason for the "Deviation" involves a problem related to coordinate system transformation: gcj-02 Mars coordinate system deviation correction.


As mentioned earlier, the format of module output data is NMEA-0183 and the coordinate system used is WGS-84. Usually, the map software of other countries in the world also uses WGS-84, which is safe and sound. However, China's State Bureau of Surveying and mapping requires all companies, units, institutions and individuals engaged in geographic survey and map drawing to use the gcj-02 coordinate system (g represents Guojia country, C represents Cehui surveying and mapping, and j represents Ju Bureau).


In other words, most domestic map software uses the gcj-02 coordinate system. Therefore, if developers / users fill the longitude and latitude of WGS-84 into domestic map software, there will be great deviation.


(all electronic maps and navigation equipment need to use gcj-02 coordinate system. First, the mapping company shall map and send it to the State Bureau of Surveying and mapping after mapping, and encrypt the electronic map of real coordinates WGS-84 into "gcj-02 Mars coordinates" , such a map can be published and published. In the second step, all customer-oriented equipment manufacturers should add the conversion algorithm to the software to convert the real WGS-84 coordinates output by the positioning module into gcj-02 coordinates. In this way, the coordinate system can be completely matched and there will be no "Deviation")


So, do all domestic maps use gcj-02 coordinate system? No... Baidu and Sogou have established their own system and independent coordinates.


Coordinate system

Map

WGS-84

Google Map

Bing Map

Here Map

etc.

CGJ-02

Gaude map

Tencent map

Google Maps (China)

etc.

BD-09

Baidu Maps

other

Sogou map


Among them, baidu is special, requiring two conversions of # WGS-84 → gcj-02 → bd-09 #.


Because the conversion algorithm is complex, it will not be repeated in this paper. The conversion algorithm involves floating-point operation. It is recommended that the developer hand over the operation task to the server or host computer.


For the convenience of testing, developers can visit this website http://www.openluat.com/GPS-Offset.html Test the correction effect.


 
 
           
       

The developer fills in the corresponding latitude and longitude according to the data format (ddmm.mmmm, dd.dddd and DD & deg; mm ′ SS ″) and clicks the "coordinate conversion" button to see the effect after deviation correction. At the same time, this page also provides the download of coordinate conversion and coordinate axis correction algorithm.


Next, go to the "you ask me and answer" link:


Q: Why create a gcj-02 coordinate system out of nothing? Isn't it good to use WGS-84?

A: You oh, Tucson is broken. One charge for deviation addition and one charge for deviation correction of positioning equipment. The annual shipment volume of vehicle machines and positioning terminals is hundreds of millions, which can drive how much GDP.


Q: Can I use WGS-84 on foreign map software?

A: No problem, but in foreign map software, the update of mainland data lags behind and is incomplete.


Q: If I don't involve map deviation / correction, I only need speed, direction angle and other data. Is this affected?

A: Deviation correction is only the conversion of coordinate values and has nothing to do with other data.


Q: Why recommend developers to put the deviation correction algorithm on the upper computer?

A: Because MCU really -- can't calculate.


Q: Why do you feel that the longitude and latitude reported by the GPS chip float around in a small range?

A: This requires software static drift suppression. Technical means can be used for filtering, such as setting the speed threshold - when it is lower than a certain speed, it is considered to be stationary. Or know in advance what movement mode the user is in, whether stationary, walking or driving.


Q: I found that after correction, it is still not accurate enough and the positioning error is large. Can it be true & middot; Centimeter positioning?

A: Yes. See "detailed centimeter positioning" below.


Meticulous centimeter level positioning


Generally, GPS provides positioning accuracy of about 5m, which can meet the positioning requirements in most cases. However, there are some scenarios that require higher precision positioning. Such as surveying and mapping, landslide monitoring, UAV, driverless car, etc.


Based on the characteristics of GPS, it is difficult to provide sub meter positioning, so what to do? After n times of technological innovation and lasting construction of reference station, centimeter level positioning technology covering the whole country can now be achieved.


In fact, simply put, the core of high-precision positioning is to eliminate errors. The low accuracy of satellite positioning is due to the accumulation of errors. As long as the controllable errors are eliminated to the minimum, higher accuracy positioning results can be obtained.


The error sources of satellite positioning usually include:


Error source

Error term

Error reason

Influence of positioning error

satellite

satellite ephemeris error

In the ephemeris, the deviation between the satellite's spatial position and the satellite's actual position

-

Satellite clock error

It refers to the difference between GPS satellite clock and GPS standard time

The deviation and drift and the total drift are still within 1ms ~ 0.1ms, and the resulting equivalent error will reach 300km ~ 30km

SA interference error

SA error is a policy adopted by the U.S. military to reduce the system accuracy in order to restrict non licensed users from using GPS for high-precision point positioning

-

Influence of relativistic effect

The relative error between the satellite clock and the receiver clock caused by the different states (motion speed and gravity potential) between the satellite clock and the receiver clock

20~30km

propagation path

Ionospheric refraction

When the GPS signal passes through the ionosphere, like other electromagnetic waves, the path of the signal will bend and the propagation speed will change, resulting in the deviation of the measured distance

-

Tropospheric refraction

When GPS signal passes through the troposphere, it also bends the propagation path, resulting in deviation of the measured distance

-

Multipath effect

The satellite signal (reflected wave) reflected by the reflectors around the station enters the receiver antenna and will interfere with the signal (direct wave) directly from the satellite, so as to deviate the observed value


Receiver

Receiver clock error

GPS} receivers generally use high-precision crystal oscillators. The difference between the clock face time of the receiver and the GPS standard time is called the receiver clock difference


Position error of receiver

Error of receiver antenna phase center relative to the center of station marker


Phase center deviation of receiver antenna

During observation, the phase center of the antenna changes with the intensity and direction of signal input. This difference is called the position deviation of the antenna phase center



calculation error

Calculation error caused by algorithm, hardware instability, radiation or thermoelectric effect, etc



So, how to correct these errors to make the positioning results more accurate? It is necessary to transmit the carrier observation value and the reference station coordinate information to the user station through the data link. Simultaneous interpreting the carrier phase of the GPS satellite and the carrier phase from the reference station, and the phase difference observation value is processed in time, the location result of centimeter level can be given in time.


Generally, DGPS we mentioned refers to RTD, i.e. real time differential, pseudo range difference. On the reference station, observe all satellites, and calculate the real distance from each satellite to the reference station at each time according to the known coordinates of the reference station and the coordinates of each satellite. Compared with the measured pseudo range, the travel division correction number is obtained and transmitted to the user receiver to improve the positioning accuracy. So as to realize sub meter positioning.


For centimeter level positioning, RTK, i.e. real time kinematic, carrier phase difference, is required to process the carrier phase observation of two stations in real time. That is, the carrier phase collected by the reference station is sent to the user receiver for difference and coordinate calculation, so as to realize centimeter level positioning.


Text space hole, for example: the boss tells the manpower to pay you ¥ 8848.00. Manpower heard wrong and sent you ¥ 8844.00. After receiving the salary, I don't think it's quite right - the homonym of numbers. It's not a disguised curse.


You should log in to ERP and submit the actual salary of ¥ 8844 for inquiry. Oh, no, the system jammed for a while (in the background), and then Duan told you that ¥ 4.00 was missing. You go to the manpower and want to come back. The difference is ¥ 4.00. Xi Ti hammer R1.

     
 
 
           
       

In this story:

"Boss" is a satellite - responsible for conveying instructions and not dealing with specific things;

"Manpower" is the communication path - from the top to the bottom, resulting in errors;

"ERP query return value" is the base station - the "salary correction number" distributed according to the data uploaded by the "user station";

You, the user station, upload the "received value" (¥ 8844.00) to the "benchmark station" and get the "salary correction" (- ¥ 4.00), you will know that it is underpaid by ¥ 4.00. After calculation (¥ 8844.00 ¥ 4.00), the correct solution (¥ 8848.00) can be obtained.


It feels like a blockchain, doesn't it?


Extended reading: the difference between DGPS and RTK

https://blog.csdn.net/foreverhuylee/article/details/25693893


 
           
           
       

At present, the service covers the whole country, only Chihiro location & reg;.


(Chihiro location & reg; was jointly founded by China ordnance industry group and Alibaba group. Chihiro location is based on the basic positioning data of Beidou satellite system (compatible with GPS, GLONASS and Galileo), and uses more than 2000 ground-based enhancement stations and self-developed positioning algorithms throughout the country to calculate big data through Internet technology, Provide accurate positioning and extension services for users all over the country)


User in Chihiro location & reg; After purchasing the relevant package, you can use Chihiro location & reg; The provided SDK or ntrip protocol receives RTCM differential data.


Development mode

Support architecture

Account authentication

Upload statement

Mount point

Return data format

SDK

Android

iOS

Windows

STM32

automatic

GGA

-

RTCM

NTRIP

unlimited

Base64 encoded transmission

GGA

RTD

RTCM32_ GGB

RTCM3. two

RTCM23_ GPS

RTCM2. three

RTK

RTCM32_ GGB

RTCM3. two

RTCM30_ GG


reference material: https://www.qxwz.com/help-document-location-service.html

https://www.qxwz.com/help-document-common-find-config-service.html


Since ntrip authentication is cumbersome, this article will not repeat it. Interested readers can click the link below to learn more:

Extended reading: ntrip communication protocol

https://www.cnblogs.com/hanford/p/6028156.html


The positioning effect is so outstanding, of course, the conditions are quite harsh:


  • The positioning chip must support differential data solution;

  • The clearance condition of the site is good, and try not to have any shelter (tall buildings, trees, etc.);

  • SNR shall be greater than 40;

  • The equipment has the ability to receive data (network access);

  • High flow consumption;

  • The measuring point is within the coverage of the reference station;


The fixed solution takes a long time.


We can judge the current positioning status through the GGA statement output by the module:


GGA:

Format:

$--GGA,hhmmss. ss,llll. ll,a,yyyyy. yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh

Example:

$GPGGA,065545.789,2109.9551,N,12023.4047,E,5,9,0.85,18.1,M,8.0,M,1,0999,*5E


name

Sample

Company

describe

Message ID

$GPGGA


GGA # protocol header

UTC time

sixty-five thousand five hundred and forty-five point seven eight nine


hhmmss. sss

latitude

two thousand one hundred and nine point nine five five one


ddmm. mmmm

N/S

N


N = north, s = South

longitude

twelve thousand and twenty-three point four zero four seven


dddmm. mmmm

E/W

E


W = west, e = east

Positioning indication

one


0 = not positioned

1 = fixed solution of GPS single point positioning

2 = RTD differential positioning

3 = PPS mode

4 = RTK fixed solution (positioning accuracy up to centimeter level)

5 = RTK floating point solution

6 = Inertial Navigation

7 = manual input mode

8 = analog mode

Number of satellites

nine


Range 0 to 12

HDOP

zero point eight five


Horizontal accuracy

MSL amplitude

eighteen point one

rice


Company

M

rice


earth

eight

rice


Company

M


-

Differential time

one

second

(the number of seconds since the differential signal is received. If it is not differential positioning, it will be empty)

Differential station ID

0999


Differential station ID No. 0000 - 1023 (if the leading digits are insufficient, fill in 0. If it is not differential positioning, it will be empty)

Checksum

*5E





End of message


If the GPS chip has been solved and the differential positioning result is output, the "positioning indication" in the GGA statement should be 2, 4, or 5; The scoring time should be greater than 0 (not null); Differential station ID should not be empty.


Only when the above conditions are met at the same time can accurate measurement results be obtained. Next, let's look at the actual test results. Test environment, in a cell:


 
           
           
 

In the test, the air202 GPRS communication module provided by Shanghai Hezhou Communication Technology Co., Ltd. is used to control the GPS chip and connect the Chihiro position & reg; Platform. Report the original GGA statement output by the module to the Chihiro location & reg; Platform, transmit the data sent by the platform to the GPS chip, and then print the GGA output after the GPS chip is solved.


   
   
   
(mobile app output data)    
                   
   
   
   
(differential positioning results)                   
                   
   
   
   
(comparison)    
                   
             

It can be seen from the comparison chart that the mobile phone positioning deviation is large (not tested on the roof), and the RTK test results are very accurate and meet the needs of Surveying and mapping.


Next, we will enter the "you ask me and answer" session:


Q: Are RTD and RTK services expensive?

A: You can go to the location & reg; Query on the official website. Reference price: RTD ¥ 6 / month / equipment; RTK ¥ 400 / month / equipment.


Q: How to judge whether my positioning result is the result of differential operation?

A: Observe the output value of positioning indication in GGA statement


Q: How much traffic is consumed?

A: RTCM data is sent once per second, about 0.5K each time, about 60m / day (calculated according to 24 hours).


Q: How long will it take to get the RTK fixed solution?

A: The fixed point measurement takes about 10 minutes.


Q: Is there any way to reduce traffic consumption?

A: You can modify the code according to the GPS status, and actively disconnect when the positioning mode is "RTK fixed solution". Change the GPS positioning status and reconnect the server.


Q: Why is the device always in the floating-point de positioning state and cannot be fixed.

A: Please ensure that the aerial observation environment of the terminal equipment antenna is good, not blocked, or near objects prone to multi-path signal reflection. Please also note that the navigation satellite signal reception is normal, cN0 is within the normal range and is not subject to radio interference.


Low power consumption


——What is the most important partner of the Internet of things in the 21st century?

——Batteries.


From common shared single vehicle and on-board locator to uncommon remote meter reading and charging pile management. In various Internet of things related applications, power supply is always an inseparable topic.


If you have regular electricity (such as cars and vending machines), it's OK. If you use batteries, every milliampere of electricity needs to be calculated carefully (even shared bicycles charged with solar panels often face the problem of "low electricity").


MCU, GPS and communication module are well-known power consumers. Among them, the power consumption of GPS chip can not be underestimated because it has to undertake the tasks of satellite search, calculation and output. So, is there any way to make GPS chip "energy saving and consumption reduction"?


Of course, the answer is yes. As mentioned earlier, the power consumption of GPS chip in satellite search is the largest. If the module can minimize the power consumption of satellite search and tracking, the purpose can be achieved. How to achieve these two points? Next, we take the most commonly used gk9501 GPS chip in the Internet of things industry as an example.


Search star

Ephemeris download and ephemeris forecast


As mentioned earlier, the ephemeris file is transmitted to the GPS chip through the 2G network, so as to achieve second positioning and save power. Everyone clapped and cheered. So, suddenly there is another "ephemeris prediction". What the hell is this?


Q: What is ephemeris prediction?

A: The software of gk9501 has its own "ephemeris prediction" function. It means that when the signal is normal (CN value is greater than 27), the hardware can automatically generate the ephemeris internally after running for 5 ~ 10 minutes, and predict the ephemeris in the next 2 ~ 3 days. This process does not need to consume any traffic. Realize "power on for 5 minutes and run for 72 hours".


Of course, there are conditions for realizing the function of "ephemeris prediction":


1、The ephemeris has been downloaded once (externally input to the GPS chip ephemeris file, or GPS chip independent 3D fix)

2、The CN value of GPS signal shall not be less than 27

3、Normal positioning once;

4、The RTC does not power down (when the main power supply is disconnected, the ephemeris prediction function can be used only when the RTC power supply is continuously disconnected, and the ephemeris prediction function will no longer work after the RTC is disconnected);


Q: What is the difference between "ephemeris forecast" and "ephemeris download"? How does it help the actual positioning?

A: This should start with the development history of AGPs.


In the early days, the ephemeris file issued by the server contained all the visible satellite data and sent it to the GPS chip, which then searched the stars according to the ephemeris file. The disadvantage is that the ephemeris file is large and the positioning effect is poor; Now, the first is to use the communication chip to locate the base station, obtain a rough geographical location in the background, query the navigation message, and then accurately issue the currently visible satellite ephemeris according to the geographical location. The GPS chip then searches the stars according to the accurate ephemeris file. The ephemeris file has smaller volume and better positioning effect.


It can be seen that "ephemeris prediction" is automatically generated by the chip and only contains the ephemeris of visible satellites; The "ephemeris download" is a ephemeris that contains all visible (but unavailable) satellites.


mode

Implementation mode

Effective time

advantage

Second positioning limit

shortcoming

Ephemeris Download

Download ephemeris file to GPS chip through 2G network

4 hours

Second positioning can be realized

unlimited

Need to consume network traffic

Ephemeris prediction

After long-term effective operation (3D fix), the GPS chip is automatically generated

2 ~ 3 days

Fast positioning can be achieved

In case of small displacement

There are many restrictions


In any state, the better the CN value of GPS signal, the faster the positioning; When the ephemeris is downloaded and saved within 6 hours, the RTC power can be disconnected.


Q: If "ephemeris prediction" can be used, why "ephemeris download" through 2G network?

A: Because the premise of "ephemeris prediction" is that "when the signal is normal (CN value is greater than 27), it runs continuously for 5-10 minutes" with a current of 28ma, which is relatively power consumption. Therefore, most applications tend to "download ephemeris" every time instead of using "ephemeris prediction" -- not to mention the action of obtaining the approximate location through the positioning of the base station, which itself requires a 2G networked server.


Q: Why is the ephemeris data valid for up to 6 hours?

A: The effective saving time of ephemeris is related to the running track of satellite.


The longer the ephemeris is kept, the fewer visible satellites in the original ephemeris. Because GPS satellites orbit the earth for 12 hours, the validity period of ephemeris data of 6 hours is the limit value. After this time, the original ephemeris data is meaningless.


Since the shorter the ephemeris is saved, the more visible stars in the corresponding ephemeris, the ephemeris within 2 hours is more helpful for positioning than the ephemeris within 6 hours.


track


Dynamic tracking is also very power consuming, so is there any way to make the chip "half asleep and half awake"? Hey, there's a way. Gk9501 can "Da Vinci sleep".


pattern

explain

Wake up mode

Low power mode

CPU sleep

Wake up through serial port

Ultra low power mode

CPU power down, only RTC works

Force on wakeup required

Low power tracking mode

When the CPU is sleeping, it can wake up through the serial port or periodically wake up automatically for positioning output. The running track can be given


Ultra low power tracking mode

When the CPU is powered down and only RTC works, force on wake-up or periodic Automatic wake-up is required for positioning output. The running track can be given



Power saving tracking modeIn fact, it is periodic Automatic wake-up: gk9501 automatically sets the sleep time and running time according to the current motion state. For example, in the case of fast movement, it will automatically sleep for 30 seconds and run for 3 seconds; When the movement is slow, it will automatically sleep for 60 seconds and run for 3 seconds; It achieves the purpose of reducing power consumption when there is an approximate trajectory. If the master also needs synchronous sleep, the master can be notified through GPIO. Of course, this can also be achieved by periodically cutting off the power supply of gk9501 by the master control.


Q: It seems that other friends' chips also support AGPs second positioning. What's the difference between them and gk9501?

A: Ublox, Zhongke micro and leading support AGPs, while MTK and Guoke gk9501 support second positioning. The difference is that the former only downloads the ephemeris, while the latter not only downloads the ephemeris, but also speeds up the process of star finding and positioning in combination with base station positioning. This is the essential difference between AGPs and second positioning.


Q: Is there a recommended GPS IOT module?

A: Air8xx series of Shanghai Hezhou Communication Technology Co., Ltd. The rda8955 gk9501 platform supports 2G and GPS, which is stable and reliable.


 

 

This article is reproduced from“Internet of things think tank”, support the protection of intellectual property rights. Please indicate the original source and author for reprint. If there is infringement, please contact us to delete



 
Links: sitemap

Service hotline

+86 0755-28192060

Wifi antenna

GPS Antenna

WeChat

WeChat