Time Accuracy

Hi guys,

I have an Arduino Mega 2560, a gps module (NEO-6M-0-001) and an Adafruit 10-DOF board.

I am building a location tracker with IMU so that the GPS logs location and when it signal drops out, the IMU will then calculate the position from acc, gyro, compass. Just a project atm, but will probably add sd/phone board for logging or SMS locating so I can use it for my car or maybe even on the dog.

Anyway for my code, I am sampling the acceleration at 100 Hz and processing, then by addition, giving the final location. This is where my query comes.

I have heard the Arduino clock is not very accurate at all, therefore the location accuracy would drift massively.

So I have 2 options: Use a real time clock (RTC) like the ChronoDot which uses the DS3231. This looks perfect for accuracy (1 minute per year drift). Use the GPS clock, which would be good because it saves on components. However without an external time signal, I do not know how accurate its internal clock actually is. I've had a quick look at the datasheet but I'm not sure what I'm looking for.

So does anyone know how accurate the Arduino and GPS internal clocks are compared to the ChronoDot?

Cheers!

Arduino boards are usually made with a resonator that's +/- 2% (in terms of how fast time passes from the chip's perspective)

If you get (or make) one with a crystal (some clones use a crystal), that is much more accurate.

How accurate do you need it? How long will it be running in this mode where it's using gyro/accel to find it's way?

I have heard the Arduino clock is not very accurate at all, therefore the location accuracy would drift massively

The clock errors won’t be that bad as long as you don’t loose the GPS for too long…

And the errors from your accelerometer, gyro, and compass will be worse than the timing errors. :wink:

Thanks guys.

DrAzzy: 2% is pretty significant, I want it to be able to run for a number of hours in this mode, do you know how accurate I should expect the GPS timer to be?

DVDdoug: I am going to deal with the other errors individually, with code and hardware. My question here here is about removing the inaccuracy of the clock, as it is an easy fix. ~2% is a significant reduction in error for little effort.

I've never bothered to measure the drift of the internal RTC in my GPS but after a couple of days the drift isn't visually apparent. So I suspect it's better than 250ms/day which would mean it's on par with an uncalibrated DS3231. Of course your GPS may be different.

And 2% for a resonator? The datasheet for the one on the Uno says ±0.5% over the entire temperature range. My two Unos are both off by about 0.1%.

As far as I understood the whole GPS system is based on a very accurate clock.

GPS time is theoretically accurate to about 14 nanoseconds.
However, most receivers lose accuracy in the interpretation of the signals and are only accurate to 100 nanoseconds.

Global Positioning System

Whandall:
As far as I understood the whole GPS system is based on a very accurate clock.

Global Positioning System

That is the actual GPS time you are talking about, what we are discussing is the time keeping ability of a single GPS module running without the input from satellites.

Whandall: As far as I understood the whole GPS system is based on a very accurate clock.

Of course. But what happens when you lose fix? A GPS will try to keep time on its own, just as any other RTC will, and the question is how good is a particular GPS at doing that?

I just fired up a GPS (GlobalTop FGPMMOPA6H) that had been sitting powered down with battery backup for the last 8 days. Here’s what came out:

$GPRMC,225046.998,V,0.00,0.00,050216,N42
$GPRMC,225050.302,V,0.00,0.00,050216,N
4C

As you can see it received time information before it had a 3D fix. It had drifted by 3.3 seconds in 8 days, an average loss of about 1 second in 2.4 days, or -5ppm. So a DS3231 (~1ppm ) would outperform it but not by a huge margin.

the IMU will then calculate the position from acc, gyro, compass.

For a few seconds, perhaps. Utterly hopeless for more than about 1 minute, with consumer grade IMUs.

(deleted)

Why not post the code (using code tags)? Others would be interested in how you sync the RTC with the GPS time.

Note that 1 second drift in 90 minutes is 1 part in 5400, or 0.019% accuracy, which is pretty good for a resonator.

You, really, don't want to use millis() anyway. It is difficult to sync with an external clock because it really isn't counting 1 millisecond per count of processor clocks. It counts 1.024 milliseconds per count and skips 6 counts over a one second period. You are much better off syncing to micros(). You can keep a running total of the error. Dwight

An idea of the actual accuracy you need would help...

Are you needing an atomic clock or a sundial?

Accuracy != Precision.

Accuracy == deviation from true value.

Precision == random fluctuation around mean measured value.

Are you wanting both? One or the other suffices?

Honestly...a sticky on the use of the terms would be wonderful...