multiple controller with gps neo6M, same code, different time.

Hi,
I am trying to sync several controllers ( esp8266 in my case, but this is not important I guess) to the milliseconds. one of my options is to use neo6m gps receiver, using neogps lib.
Is it normal that all controllers receive a time which can be different from one to the other up to 4 or 5 seconds (not even millisec) ?
I would have expect that all gps module receives the exact same time at the same moment ... ?

The other option I tried (almost successfully) is to have RTC (ds3231) on all devices, and wire-connect them 1 time to sync the SQW shift they can have. This works, pretty well. But all RTC have a tolerance, and I will lose that sync over the days (tolerance of 0.5 sec per days).

Thank for your input...
JC

jc999:
I would have expect that all gps module receives the exact same time at the same moment ... ?

Depending on how long the different GPS have been on, and when the firmware in the GPS was written, they can display different times, normal behaviour.

It can take up to 12.5 minutes of good GPS signals for a collection of GPSs to all output the correct UTC time.

Hi jc.

My understanding is that the neo 6m will provide UTC time in its sentences or nothing. You don't need a fix to get UTC; it becomes available before fix is achieved.

Isn't the time coming from the atomic clocks on the satellites? You would expect them all to be precisely equal. So all neo 6ms in the world would produce the same UTC value?

Perhaps commercial GPS units have their own RTC that would drift when the unit is not powered. Don't know.

srnet - is there another source of time?

John.

Isn't the time coming from the atomic clocks on the satellites?

How do you suppose that you are going to get that time, when the GPS doesn't have a fix?

How close do you expect the time on the various satellites to be?

One watch, everyone knows what time it is. Two watches, no one knows what time it is.

jpom:
srnet - is there another source of time?

Sort of, GPS time is based on UTC time back in 1980.

GPS time is now around 18 seconds ahead of UTC.

All explained here;

GPS_Leap_seconds

Hi Paul.

I'm by no means an expert. Much of how GPS works is a mystery to me but some things are clearly observable.

I use the u-centre software from u-blox to monitor the performance of my GPS. I can see the NMEA sentences.

Upon powerup of the GPS, the sentences have no data. After a short while, say 1 minute, they start to include UTC. After say another minute a fix is achieved. UTC comes before fix.

I figure it gets UTC from one or more of the satellites it first picks up. No need for a fix -- the time is transmitted by each satellite. The satellite signals are received for some time before a fix is calculated.

I thought an underlying premise of GPS technology is supremely accurate timekeeping. There are 32 satellites in the USA's GPS constellation. Sure, that's 32 clocks, but if they are deadly accurate then they are effectively the same clock, yeah? Maybe there is the ability of a ground station to synchronise them all.

Something I've noticed is that when I'm viewing the GPS data the UTC very closely matches my laptop's time. I never adjust its time so I wonder if Windows synchronises our computers' time to UTC when we connect to the Internet.

Hi srnet.

Thanks for that link. GPS is a deep and fascinating subject. Amazingly complex, yet to we users simple to use.

U-blox call the time UTC, not GPS time. But GPS is actually the American system. The umbrella term is GNSS. That doesn't really matter.

To get back to jc's question -- would all GPS receivers deliver the exact same time? I might try to set up two receivers and view their output in parallel on the PC. That introduces the PC's processing speed into the problem. Might work tothe second, but not to the millisecond.

Something I've noticed is that when I'm viewing the GPS data the UTC very closely matches my laptop's time. I never adjust its time so I wonder if Windows synchronises our computers' time to UTC when we connect to the Internet.

your browser syncs your system time to your ISPs NTP server.

go to https:// time.is

my Raspberry Pi typically runs about -.028 seconds compared to time.is. My desktop runs -2.8 seconds. same ISP

investigate WHY SIMPLE GPS-BASED CLOCKS MAY BE INACCURATE

on pages 1 - 3 of this PDF. in that image, the leading edge on the pulse goes positive, then the blue burst of data comes along and tells the user what the time was when the pulse happened. to make a GPS module display right you have to add one second to the time when the next leading edge comes along.

the GPS sends time out when one receiver is locked. two receivers gives location. three locked receivers gives elevation above sea level.

U-blox call the time UTC, not GPS time.

GPS time and UTC time are different, even UBLOX cannot change that.

GPS is actually the American system

And the first as I recall.

The umbrella term is GNSS.

Not sure when the American system was joined by others and the term GNSS became common.

would all GPS receivers deliver the exact same time? I might try to set up two receivers and view their output in parallel on the PC.

Be careful here. If your GPSs are recent their firmware likely has the current (2019) value of leap seconds programmed in, so in effect the GPS (which works in GPS time) adds the leap seconds and then displays the time, which since the leap seconds are correct, it the same as UTC.

But what happens when a couple of leap seconds are added next year ? Your GPS firmware has the wrong default leap seconds value so no longer displays UTC.

Hi, thank you all for your answers so far.

To clarify, I don't need the devices to have the exact time, I need all of them to have the exact same time (if the leap/error/delay/... is on all of them, it's perfectly ok).

If I could initiate all of them to 'zero' sort of UTC like, it would be ok...

It seems very difficult (impossible?) to have a precise timing from the satellite... even a 1 sec tolerance seems not possible. I have tested again yesterday with 7 devices, almost all of them have different seconds.
All of them are powered by the same cable, so the switch on in on the exact same time ( but this for dev, at the end, the device will be own powered).
I really tought that gps would have been damn precise... but it's not. or it's the neo6m which is not that good...

thanks again
JC

It seems very difficult to have a precise timing from the satellite... even a 1 sec tolerance seems not possible.

The rising edge of PPS is extremly accurate in relation to GPS time, a uS or better perhaps.

I have tested again yesterday with 7 devices, almost all of them have different seconds.

Quite possible, expected even.

Leave them on, under good signal conditions for 15 mintes or so.