Pages: 1 [2]   Go Down
Author Topic: problems combining millis() and GPS timekeeping  (Read 4204 times)
0 Members and 1 Guest are viewing this topic.
Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2086
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 1sec pulse from a GPS module is not exactly 1sec. It has a jitter (~few milliseconds) thus the short time precision is poor. Only when averaged over a longer time period (~hours) it follows the "GPS" precision, however. Normally, you do not want to use 1sec pulses from a GPS module for a measurement. It is used for disciplining of a quality crystal oscillator (ie 5-10MHz) instead. Google "crystal oscillator disciplining"..
http://en.wikipedia.org/wiki/GPS_disciplined_oscillator
« Last Edit: January 30, 2013, 05:35:50 pm by pito » Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4091
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 1sec pulse from a GPS module is not exactly 1sec. It has a jitter (~few milliseconds) thus the short time precision is poor. Only when averaged over a longer time period (~hours) it follows the "GPS" precision, however. Normally, you do not want to use 1sec pulses from a GPS module for a measurement. It is used for disciplining of a quality crystal oscillator (ie 5-10MHz) instead. Google "crystal oscillator disciplining"..
http://en.wikipedia.org/wiki/GPS_disciplined_oscillator

I wondered about short term jitter and yes I am aware of disciplined oscillators. Yet, using this technique, I have measured several µCs with crystals for their system clock, and having one of the timers set to create a 1MHz output, I can watch the readings for minutes at a time and I usually don't see more than a single digit bobble. A few milliseconds jitter would cause variations of thousands of Hertz. Perhaps this particular GPS receiver uses a disciplined oscillator for its 1 PPS output. Don't remember but I'll double check the datasheet.

Here is some typical output, I was fairly amazed. Just the first minute's worth in the quote but the attached file has ten minutes or so. I've checked this particular unit several times over as many days, and the frequency is always the same, so I'm not seeing any longer-term variation either.

Code:
GPS Frequency Counter
2: 1,000,003 Hz
4: 1,000,003 Hz
6: 1,000,004 Hz
8: 1,000,003 Hz
10: 1,000,003 Hz
12: 1,000,003 Hz
14: 1,000,004 Hz
16: 1,000,002 Hz
18: 1,000,003 Hz
20: 1,000,003 Hz
22: 1,000,003 Hz
24: 1,000,003 Hz
26: 1,000,003 Hz
28: 1,000,003 Hz
30: 1,000,003 Hz
32: 1,000,000 Hz
34: 1,000,003 Hz
36: 1,000,003 Hz
38: 1,000,003 Hz
40: 1,000,003 Hz
42: 1,000,003 Hz
44: 1,000,003 Hz
46: 1,000,003 Hz
48: 1,000,003 Hz
50: 1,000,003 Hz
52: 1,000,003 Hz
54: 1,000,003 Hz
56: 1,000,003 Hz
58: 1,000,003 Hz
60: 1,000,003 Hz

* CoolTerm Capture 2013-01-30 19-13-47.txt (6.09 KB - downloaded 18 times.)
« Last Edit: January 30, 2013, 07:28:54 pm by Jack Christensen » Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3077
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which GPS are you using to get 40 samples per second ?
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4091
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Which GPS are you using to get 40 samples per second ?

I read that he was logging data 40/sec, not that the GPS was providing updates at that rate.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: 1 [2]   Go Up
Jump to: