Shop OBEX P1 Docs P2 Docs Learn Events
Timing Drift - How do you read ppm? — Parallax Forums

Timing Drift - How do you read ppm?

groggorygroggory Posts: 205
edited 2011-03-20 11:43 in Propeller 1
I'm looking at various types of oscillators and they all have a certain amount of error. Furthermore, that error can increase with various external conditions.

If I'm using these clocks for precision time references, how do I calculate exactly how much drift I have.

Let me take a stab at it and tell me how far off I am.

Let's say I'm using the DS32KHZSN. A temperature compensated 32.768kHz external oscillator rated for use between -40 to 85 C.

This chip says it's rated between -7.5 and 7.5 ppm stability. So in other words, for every 1 million 'ticks' it could be +/- 7.5 ticks off the real time.

1 million ticks = 30.517578125 sec +/- 0.006984919309 sec
so by a little multiplying...
1 day = 2831155200 ticks = 86400 sec +/- 6.48 sec
1 year = 365 days +/- 39.42 minutes

Is my thinking and math right here?

It seems like to have a very very accurate time keeping system that doesn't have drift you have to use a much more expensive clock.

Some other timing chips that I pulled off digikey...

Connor Winfield D75AS-020.0M | $31.50 | .25PPM | +/- 21.6ms/day
Maxim DS32KHz | $7.42 | 2PPM | +/- 172.8ms/day
Abracon Corp AOCJY-10.000MHZ-E | $168.84 | 10PPB = .01PPM | +/- 864us/day
Abracon Corp AOCJY-20.000MHZ | $168.84 | 5PPB = .005PPM | +/- 432us/day

Comments

  • BeanBean Posts: 8,129
    edited 2011-03-17 13:59
    Groggory,
    There are many reasons for frequency drift: Temperature, Aging, G-force (tip over), supply voltage change, etc.

    You need a stable reference to measure against.

    Most common are GPS (1pps) and Line Frequency (60Hz). These sources need to be averaged over a long period of time to get good stability.

    These might make a good project. Hmmmm. Anyone want to work on this with me ?

    Bean
  • groggorygroggory Posts: 205
    edited 2011-03-17 15:34
    I'll work with you on this, lol.

    I totally get where the drift and error can come from...I am mainly trying to build a good clock source and to quantify how accurate it is based on the spec sheets.

    Furthermore, I am thinking about building a discrete counter circuit of ~48 bits to feed this into so that all of my cogs (and potentially multiple propellers) can all grab from a unified highly accurate time source.

    So first thing's first...are my calculations up above done properly? In other words, after a year is my counter essentially +/- 39.42 minutes?

    Thanks.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2011-03-17 16:26
    If you want a really good frequency reference use a FE-5680A Rubidium Frequency Standard.
    They can be gotten for about $100 on ebay.

    See:
    http://www.dd1us.de/Downloads/precise%20reference%20frequency%20rev%200_5.pdf

    I also wrote a driver program to allow the DDS, Direct Digital Synthesys, chip in the unit to output
    other frequencies than the standard 10MHz. About 10kHz to 15MHz or so.
    All with a basic accuracy better than 2 x 10^-9 / yeart. Or 2 x 10^-11 / day.
    http://www.redrok.com/FE5680A.zip.
    This begs for a Propeller version.

    Duane
  • BeanBean Posts: 8,129
    edited 2011-03-17 17:48
    Does anyone know if any of the Parallax GPS units have 1pps output ?

    Bean
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2011-03-17 18:14
    I couldn't find the 1PPS output on the Parallax mither boards.
    Actually the 1PPS is inherent in all GPS receiver modules.
    Apparently they are not taking it from the module.
    You may be able to hack it a bit as I'm confident it's on the module.

    I understand this is maintained to very high tolerances of about 1nS.
    Its used in the low level timing functions.

    An interesting thing is that all GPS 1PPS outputs, wherever they may be located,
    are synchronous with each other.

    Duane
  • BeanBean Posts: 8,129
    edited 2011-03-17 18:32
    I don't know of ANY GPS that has 1nSec tolerance. I wish I did.

    In the past I have used the Trimble Resolution-T which has a 15nSec tolerance. Many low-end GPS have 1uSec tolerance.

    However, by averaging the 1pps signal over a long time (an hour) you can get much better as long as your reference is stable for that time.

    Bean
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2011-03-17 18:56
    Yes, your right.
    The long term accuracy is 1nS.

    The external hardware was an oven stabillized voltage controlled crystal oscillator with a long chain divider.
    The voltage was obtained from a DtoA watching an up-down counter. The counter was updated on the 1PPS edge.
    Essentially a very slow digital phase locked loop. That was how I built mine anyway.

    The amateur radio telescope guys did it similarly in the now defunct "TAC", "Totally Accurate Clock", they
    used for adding ticks to the radio "noise" they listen to.

    I think the rubidium standards are now used. Which use the GPS 1PPS to discipline them over the long term.

    Duane
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-03-17 19:05
    groggory wrote: »
    ...

    So first thing's first...are my calculations up above done properly? In other words, after a year is my counter essentially +/- 39.42 minutes?
    ....

    Maybe your math is correct but perhaps your assumptions are wrong??? The spec sheet says this:

    Accurate to ±4 Minutes/Year (-40°C to +85°)
    Accurate to ±1 Minute/Year (0°C to +40°C)

    Maybe I'm misunderstanding something, but it looks to me like the ppm you're quoting is for the Frequency Stability vs. Temperature, which is perhaps different than the overall drift of the crystal??? Would putting the crystal in a constant temperature "oven" help peg its rate a little better? Maybe if it's kept at 25 C, it will be at its best?

    As usual, I have no idea what I'm talking about but those little tidbits just jumped out at me at a glance.
  • groggorygroggory Posts: 205
    edited 2011-03-17 19:27
    Maybe your math is correct but perhaps your assumptions are wrong??? The spec sheet says this:

    Accurate to ±4 Minutes/Year (-40°C to +85°)
    Accurate to ±1 Minute/Year (0°C to +40°C)

    Maybe I'm misunderstanding something, but it looks to me like the ppm you're quoting is for the Frequency Stability vs. Temperature, which is perhaps different than the overall drift of the crystal??? Would putting the crystal in a constant temperature "oven" help peg its rate a little better? Maybe if it's kept at 25 C, it will be at its best?

    As usual, I have no idea what I'm talking about but those little tidbits just jumped out at me at a glance.

    The equipment I'm working on is going to be used outdoors in a large range of temperature and humidity enviroments. As such, I need it to work the same no matter where I put it. I'm quoting the worst case drift. I think they got their numbers by computing best case or average case.

    And wow, that rubidium standard is intense. Maybe a little too intense for my project. I'm trying to build a multi node timing system that is good to .0005 sec over a few hours.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2011-03-17 20:44
    groggory wrote: »
    ...
    Is my thinking and math right here?...


    It seems to me that there are 31536000 seconds in a year. So 1ppm of that would be 31.536 seconds, and 7.5ppm would therefore be 236.5 seconds, which is the same as 3.94 minutes, which seems to agree with their spec sheet 4 minute rating. But maybe I'm confused.
  • Miner_with_a_PICMiner_with_a_PIC Posts: 123
    edited 2011-03-18 08:12
    groggory wrote: »
    And wow, that rubidium standard is intense. Maybe a little too intense for my project. I'm trying to build a multi node timing system that is good to .0005 sec over a few hours.

    Half a millisecond per few hours is a VERY tight timing specification to hold. If the assumption of a few hours is taken to mean greater than or equal to 2 hours then we get <= 0.07 ppm (<= 0.0005 Sec / 7200 Sec) which is far beyond any standard crystal's performance. Even if you were to use a rubidium oscillator in an attempt to calibrate a crystal for both nominal (25C) offset as well as its unique temperature dependence curve, the 0.07ppm would be difficult to hit without a great deal of care and periodic calibration to correct for drift. It would be best to either directly use a rubidium oscillator for each unit or use either of the Abracon clocks that you found on digikey. All of these seem to be in the > $100 price range and so this project could get costly rather fast. Perhaps a GPS system could be used as Bean mention but no matter what method you choose it seems that you are in for some design challenges and expenditures, so the question is does your system really need at least 0.07 ppm?
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-03-18 09:17
    Groggory,

    If your concerned about long-term drift you could use a radio time reference to calibrate your clock generator. In the U.S. it would be WWV or WWWVB. If your in another country there should be an equivalent radio time signal. SparkFun has a "WWVB NIST Radio Time Receiver Kit" for $10.95.

    Dave
  • groggorygroggory Posts: 205
    edited 2011-03-18 10:17
    It seems to me that there are 31536000 seconds in a year. So 1ppm of that would be 31.536 seconds, and 7.5ppm would therefore be 236.5 seconds, which is the same as 3.94 minutes, which seems to agree with their spec sheet 4 minute rating. But maybe I'm confused.

    Ok! Ok! I must have, I must have put a decimal point in the wrong place or something. ****. I always do that. I always mess up some mundane detail.
  • David BDavid B Posts: 592
    edited 2011-03-18 11:54
    You're right, Dwayne, I recently did hack the Parallax GPS module to bring out the 1PPS signal.

    http://forums.parallax.com/showthread.php?129914-Parallax-GPS-sensor-PMB-688-1PPS

    But I don't think the GPS module's 1PPS rated better than around 1 microsecond accuracy. Most people wanting better than that have to get a local adjustible ovenized crystal oscillator and over the long term, phase-lock it to the GPS 1PPS.

    These guys could tell you more than you'll ever want to know about this sort of thing -

    http://www.febo.com/time-freq/
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2011-03-20 11:43
    Groggory

    I think the initial calculation was in error:
    1 million ticks * 7.5/(1 million) * (1 / 32768) second
    = 0 .00022882 second (not 0.006984919309 sec as you had it)

    The multiplier at any time scale is 0.0000075

    At 86400 seconds per day, that comes to maximum +/- 0.648 second.
    and over 365 days, just under 4 minutes as specified.

    The data sheet claims +/- 2ppm (1 min/yr) over the 0 to 40 °C range, and the +/- 7.5 ppm figure applies outside that range down to -40°C and up to +85°C.
Sign In or Register to comment.