HomeSoftware


PC clock synchronization using GPS
jack
Hello,

I want to set my laptop time to the GPS time using a GPS receiver connected to the laptop. I am using windows OS. I am unable to find a software which can poll data from USB GPS receiver and set the laptop time. Can anybody suggest something?

Also most of the GPS receivers like Time Tools, Galleon etc come with a connection to the com port. But these days laptop doesn have the DB9 serial port. What is best solution for this??

I am breaking my head on this for many days now. Please help me out
tcassidy
Most USB GPS devices come with a device driver on an included CD to provide COM port serial output from the USB input. Exceptions are Delorme and Garmin GPS units.

Terry
Ken in Regina
You have apparently already found the software you need for setting the clock from a GPS receiver (Time Tools GPS Clock looks nice) so you just need to do what Terry said. Get the virtual COM port driver for your GPS receiver and you'll be in business.

...ken...
jack
Thanks Ken and Terry.

I also had one question. I want to set the laptop time with an accuracy of microseconds. Is this possible? I read the following in the GPS clock section of timetools

Quote:
The GPS clock utility can also update the system time of the host PC with GPS time. Note however, time synchronisation can only be achieved to the nearest second. Standard NMEA GPS devices do not have a pulse per second output that can be utilised by the serial port of a PC. Therefore, the microsecond accuracy that is available from TimeTools GPS T1000 and T2000 GPS timing receivers is not available with this software.
So I was thinking if microsecond accuracy or even millisecond accuracy is possible?

..jack
Ken in Regina
Hi Jack,

Simple answer: they are correct that consumer navigation GPS devices do not output the PPS signal so a program like GPS Clock cannot give you any better accuracy than can be extracted from the data output from the GPS receiver. It might actually be a bit better than 1 second. But there are so many factors they cannot control for that the best promise they can make is 1 second accuracy. But it's a free utility.

Millisecond and microsecond accuracy are possible on a PC.

But the crystal in the internal clock on a PC is about as accurate and stable as a cheap wristwatch (e.g. not very). So in order to maintain stable timing at that level of accuracy in a PC you would need connection to an accurate time server like the T2000 that you can use to monitor the PC timing fairly frequently. Or close proximity (~zero latency) connection to an NTP server that is connected to a T2000.

Do you understand time synchronization and how it really works, e.g. using the PPS signal from a time server device like the T2000 and why a pulse only once per second can give you millisecond or microsecond accuracy? Do you understand Accuracy? Stability? The difference?

What kind of application are you using that you want millisecond or microsecond accuracy?

...ken...
jack
Hi ken,

I do understand the difference between accuracy and stability but I am not sure about the PPS signal.

I am trying to synchronize two laptops to a same time so that they provide exactly the same timestamps for the images. Images are taken at 30fps( frames per second) and can even go up to 115fps. I will be in a place where there is no internet access. The 2 laptops will be placed far apart. The only way I can synchronize time on two laptops is by using the GPS signal right?

-jack
Ken in Regina
[Warning for the casual reader, this is way long and a little bit technical.]

Jack,

Apologies in advance if some of this is redundant for you but I need to do the whole thing in order to make sure I do it right.

Accuracy -- Two pieces to this and they are both answers to the question: Accurate relative to what?

Relative to some "absolute" time. We typically treat Universal Coordinated Time (UTC), or what was originally called Greenwich Mean Time (GMT) as sort of the "absolute" time. Or more specifically, an atomic clock in the Greenwich Observatory, is considered to be "Zero" time, or as the military refers to it "Zulu".

If you need to sync to UTC, you need a signal that is traceable directly back to that atomic clock and without too many hops (latency) between. We typically do that by using less expensive atomic clocks that are placed nearer our location but which are constantly synchronized back to the master clock for UTC.

So, we can sync our PCs over the network to, say, Boulder, CO, in the US by using a program that knows how to use the network time protocol (NTP) to connect to an NTP server and sync up with it. If the sync program is a really good one it will try to get a good guess at network latency and factor in an adjustment for it.

Relative to another computer but independent of UTC. This seems like it would apply to your situation. You need two computers to be synchronized with each other to a high degree of accuracy. But it's not really important that they have any significant accuray relative to UTC. A few seconds or even a minute or two away from UTC are huge in the data synchronization world but for most practical purposes aren't a big deal for other stuff.

Pulse Per Second (PPS) - If you have a high accuracy timing device, like a Stratum One atomic clock, it can output a pulse every second on, say, a serial connection to the computer. There are two ways the computer can deal with this. The simplest, but least accurate is to read the timestamp message that follows over the serial connection nearest after the pulse is detected. This can be used by software on the computer to determine whether, and by how much, the internal clock has to be adjusted. Or alternatively, the pulse detection itself can be used directly by kernel level software to drive the timebase synchronization.

Naturally the next question is, If the pulses are coming only one per second, how can you get subsecond accuracy? Easy, Grasshopper. The pulses themselves are the accuracy. That is, the pulses are generated with huge accuracy, so by using them as the timebase for synchronization you can keep the computer sync'ed very tightly with the source of the PPS signal.

Also, you don't need to worry about the stability (drift) of the computer's internal clock because you are getting a fresh pulse every second. Even the crappiest crystal in the PC's internal clock can't drift enough to be significant in one second.

Consumer GPS signals. Consumer GPS receivers that are used primarily for navigation or geolocation functions are not designed to provide time synchronization. However, they can be used as a crude substitute in the field if one has the necessary software and is aware of the limits.

The data that is sent from the GPS receiver is a series of standard "sentences" that contain defined data. The data in those sentences are defined by the NMEA 0183 (National Marine Electronics Association standard 0183) or NMEA 2000.

The NMEA 0183 standard sentences allow the GPS receiver to send information related to Time & Date, Geographic Position - Latitude/Longitude, and individual satellite information. It's the Time & Date information that matters here.

The GPS satellites each contain three Stratum One cesium atomic clocks in them. These are highly stable clocks that were originally calibrated with UTC, so the signals that originate from them can be considered a good sync link back to UTC, and therefore a good source of synchronization on their own.

However, there are a few minor hitches in this that need to be understood. Latency is always the killer when trying to sync two or more devices together. That is, essentially, the time it takes for the signal to travel from sender to receiver. In the case of the extremely weak GPS signals, there are many things that will affect this. These are mainly related to atmospheric conditions from high in the atmosphere to anything affecting only local conditions.

If two devices are close enough together to be connected to the same GPS receiver, say via Bluetooth, it really won't matter because they'll be getting the same signal and by using it will be sync'ed as accurately as that signal will allow.

If they are too far apart to use the same GPS receiver but close enough together that they are affected by the same local atmospheric conditions, say, within a few miles of each other, it still won't be an issue as long as they use the same make/model of receiver and the same software.

If they are so far apart that they are being affected by significantly different atmospheric conditions, all may not be lost. Most GPS receivers support a protocol called WAAS (Wide Area Augmentation System). This is, to keep it really simple, a system of satellites and ground stations that are used to provide GPS signal corrections. These corrections account for GPS satellite orbital drift and clock drift plus signal delays caused by conditions in the atmosphere and ionosphere.

So, if our two GPS receivers that are far apart both have WAAS enabled they will still be pretty close, accuracy-wise, after the corrections are done.

Finally, we get to the question of whether a couple of consumer-grade GPS receivers will work for your purposes.

I think so. Here's why...

Just like PPS, most consumer-grade GPS receivers are sending updated data to the computer as a group of NMEA sentences once per second (1Hz). Indeed, some GPS receivers will send them out even more frequently, as many as five per second (5Hz). So, like PPS, the computer gets a fresh bit of information to sync with every second. And if the GPS signals is good and corrected fairly well, it will be fairly accurate, relative to UTC, and fairly stable.

If you have two computers using the same make and model GPS receiver of good quality with WAAS enabled and using the same software for keeping their clocks in sync, I think you should be able to keep them close enough for 30 frames per second with little difficulty and even 115fps shouldn't be a real problem.

Indeed, if you trigger the shooting sequence manually on each computer, you will have more of a time delta (offset) caused by when you start the shooting sequence on each computer than from any differences between the clocks. That is, if you do not trigger the shooting sequences at precisely the same instant on both computers, there will immediately be a small offset that will need to be corrected for.

I expect you will need some way to correct for any slight offset caused by operating procedutes anyway. If you can do that, correcting for any tiny differences between the clocks in the two computers will be trivial.

If you can't correct for procedure-induced differences, the issue of how tightly the computer clocks are locked together isn't very relevant.

On the other hand, if you can trigger the shooting sequences from software so that they will start at identical times on each computer, it will be possible to determine how tightly the computers are tied together by simply examining the timestamps in the first few frames.

I hope that all makes sense. I've tried to keep it simple without being patronizing, in case others may be interested.

I hope it's helpful.

How far apart will the two computers be: feet, meters, miles, continents?

Will your editing software allow you to adjust for a minor offset as long as it's consistent?

Could you share what you're up to without getting into trouble? The possibilities are interesting.

...ken...
t1d
Jack,

I tried to locate Time Tools. I did get to the manufacturer's site, but did not see what I thought was the right download icon. Please clue me in on the link and download procedure.

Very interesting thread... Way to go, Ken...
Ken in Regina
Here's the page.

GPS Clock

Scroll down and look just below the image of the example config dialogue and you will see the word "Download" in bold letters.

That's not the link.

Look carefully just below the bold paragraph for this line:

"Download version 1.0.001 (20 Dec 2006) Download (1929 KB)"

The second instance of the word "download" is the link. ... Or maybe the link in the line above will get you the download...

...ken...
t1d
Thanks, Ken, you are most gracious... I will give it a try...
jack
Hi ken,

Thank you very much for your wonderful explanation.

My 2 laptops will be say few hundred meters apart. The trigger to start the capturing of images is done by the software. I am not aware of the flexibilities of that software. All I know is that software captures the images and time stamps it using system clock. The time stamp is accurate to microseconds. My task is to set the system time so that the time stamps provided by the 2 laptops interpret the same image take at 2 different angles at same point of time. So that we can do some analysis on the 2 images which represent the same data taken at 2 different angles.
I am yet to buy a GPS receiver and also yet to fix the software to set the system clock. I saw many GPS receivers and as I mentioned in my first post was fully confused with both software and GPS receivers.
I think the timetools software GPS clock will not be an option for me right??
I need to look out for some other softwares

-jack
Ken in Regina
The Time Tools software could work.

How long a period will the shooting sessions be? Will they be for hours or minutes?

In your situation you don't need absolute stability of the time. What you need is reasonable stability in the time drift. That is, it would be good if you used identical computers. Computers that are only a few digits apart in their serial numbers (so you know they went through the assembly line at nearly the same time and they will likely have identical components in their system clock).

If both computers clocks drift (gain or lose time) at very nearly the same rate, that's okay. You need the system clocks to be very close to each other in the timestamps. So if they can be set very close to each other immediately before you start shooting, and if they drift (gain/lose time) at very close to the same rate, they will still be as close together in their timestamps as when the clocks were set.

With this specific application, you do not want to be re-syncing the system clocks partway through a shooting session unless you can ensure that the sync updates to the clocks occur simultaneously on both computers.

That's really really hard to do. Actually, nearly impossible.

I know it may sound counter-intuitive, but you are actually better off with letting the system clocks drift than trying to keep them "accurate".

If you recall my explanation of "accuracy" you might recall that you can keep the two computers in sync relative to some "absolute" time, e.g. UTC. Or you can just worry about keeping them in sync with each other.

In your application, the only thing that matters is that they stay in sync with each other.

If it were me, I would do some immediate "lab" testing. If the two computers can be connected to the internet, I would download a program called NISTime and install it on both computers. It will sync the computers' clocks with a time server of your selection from a list included with the program.

Try to run the NISTime program as close to simultaneously on both computers as you can. Then do a shooting session as you would in the field. Compare the timestamps on some frames from early in the shoot and near the end of the shoot.

If you synced the computers very nearly simultaneously and if the drift in the system clocks is very nearly identical throughout the shooting session, you should be in business because you should be able to use GPS Clock in the field to sync the times on the two computers the same way you used NISTime to sync them in the lab tests.

I hope that makes sense.

I'll talk a little about your GPS selection concerns in another post, to keep this one from turning into another book. Perhaps tomorrow.

...ken...
Ken in Regina
Just a quick note on GPS selection. To ease your mind that there are still options in case a consumer-grade navigation GPS won't do the job, you can also buy GPS devices that are designed to do exactly what you want. They use GPS signals to acquire sync. They connect to the computer and deliver PPS signals for synchronization. So a couple of them would get you in business if you really need to go that route.

High precision NTP Time Server, precision timing and accuracy solutions synchronized by GNSS: ZTI

The z100 runs on 12V and the z200 runs on AC.

And/or you can connect a better quality clock to the parallel port, if you have one, using their High Precision Clock product.

Or the Exactime 300 which is basically a standard navigation GPS receiver that also does PPS.

Lots of options.

...ken...
jack
ken,

Our experiment usually runs for say around 45mins to 1 hr.

I understand accuracy in my case will be keeping the 2 laptops in sync with each other. But here the only reference clock will be the UTC through GPS receiver. One laptop has absolutely no idea about what is going on in the other one. I think even if we start capturing images at different instants it should not be a problem because the system time will be already synchronized to GPS signal in both the laptops and hence images will be time stamped accordingly.Is this assumption acceptable??

I saw the link given by you:
High precision NTP Time Server, precision timing and accuracy solutions synchronized by GNSS: ZTI

But most of them require RS 232 port which most of the laptops doesn have.
I know u have already mentioned about using virtual com port drivers, but is there any other work around for this ??..Do we get any good USB GPS receivers because most of the GPS receivers I have seen are RS232 compatible and not with USB??

-jack
t1d
Ken,

Thanks for the link. I have installed Time Tools and have it reading from the GPS signal. The computer is configured as follows: Update for daylight savings = yes; Time zone = Central; Update from Net = no.

There seems to be a slight lag in the sync for the seconds. How do I test to see that the PC time is actually being feed by Time Tools? I changed the hours display on the PC clock and it did not correct back to the present hour.

Very interesting thread! Thanks for the help.
laptopgpsworld.com About