<<

v1.7

PrecisePrecise :Time: fromfrom CPUCPU clocksclocks toto hackinghacking thethe UniverseUniverse

Tom Van Baak FOSDEM’15 Brussels, 1 February 2015 Outline

• Part 1 – computers and timekeeping • Part 2 – time and frequency • Part 3 – amateur timekeeping • Part 4 – powers of ten • Part 5 – kids, , and relativity

tvb FOSDEM 2015 2 1. computers and timekeeping

• A long ago: – computers were calculators, not clocks – time was for people, not programs, and – it came from astronomers, not atoms • Photos/influences from the early days: – first leap , 1972 – my first 3 computers – a CPU test program that deeply affected me

tvb FOSDEM 2015 3 1972 computer: NCR 200

tvb FOSDEM 2015 4 1974 computer: GE 635

tvb FOSDEM 2015 5 1976 computer: Honeywell 6620

tvb FOSDEM 2015 6 Instruction timings (GE 636)

• computers, clocks, precision, accuracy, measurement

tvb FOSDEM 2015 7 1980 timekeeping was simple

• UNIX timekeeping (System-III, PDP11/34) – time(), sleep(), (gtime: stime: alarm:)

tvb FOSDEM 2015 8 2015 timekeeping is complex

(), gettimeofday(), TIME-TAI, TIME- UTC, TIME-MONOTONIC, TIME- THREAD, TIME-PROCESS, TIME- DURATION, tv_sec, tv_usec, tv_nsec, POSIX, TOY, TAI, TAI64, , ISO 8601, granularity, resolution, drift, precision, jitter, adjtime(), NTP, PTP, QueryPerformanceCounter, RDTSC

tvb FOSDEM 2015 9 Engineers get timekeeping

• Software and hardware timing: – kHz, MHz, GHz (rate, speed, frequency) – ms, µs, ns, ps (duration, period, time interval) – time_t, tv_sec, tv_usec, tv_nsec, ticks, jiffy – disk storage: data rates, latency – network communication speeds, ping – cpu instruction times, cache misses, OOE – video frames, USB packets, SPI, I2C • Makefiles, databases, synchronization tvb FOSDEM 2015 10 2. time and frequency

• What is time? – so obvious we don’t usually ask – so mysterious we don’t actually know • Some cute (but circular) definitions… – “Time is what clocks measure” – “Space is what prevents everything from being in the same place” – “Time is what prevents everything from happening at once”

tvb FOSDEM 2015 11 Basics: time, time interval

• Seems like two kinds of time? – & time, time-of-, when (earth) – duration, time interval, how long (timer) • Time interval: time(A) to time(B) – distance “space interval”: point(A) to point(B) • Time-of-day = time interval: then to now – people simply agree on “then” (aka epoch) – 1 AD, 1858-11-17, 1970-01-01, 1980-01-06 tvb FOSDEM 2015 12 Basics: frequency, clock

• Frequency = periodic events over time – count the events (e.g., 51.0 cycles) – measure elapsed time (e.g., 1.004 ) • Units: “per second”, 1/second, s-1, Hz – frequency is a ratio (as length, mass, etc.) – period = 1 / frequency (20 ms : 50 Hz) • Clock = frequency plus counter – analog (hands) or digital (symbols) tvb FOSDEM 2015 13 Chronometer adjust (time, rate)

tvb FOSDEM 2015 14 Frequency adjust

tvb FOSDEM 2015 15 Time adjust (20 ns)

tvb FOSDEM 2015 16 What (where) time is it?

tvb FOSDEM 2015 17 Basics: clock comparison

• Compare clock time – difference: (t1–t0) seconds, ms, µs, ns, ps • Compare clock frequency – ratio: (f1/f0) or relative (f1-f0)/f0 [unit-less] – measure slow time drift between clocks • No two clocks are identical! – are you looking close enough? – or, are you waiting long enough? tvb FOSDEM 2015 18 Astronomy and clocks

• Earth/sun orbit is a clock (unit: ) – 365.24219265 d/y (ratio) • Moon/earth orbit is a clock (unit: *) – 27.321662 d/m (ratio) • Earth rotation is a clock (unit: day) – 86400.002117 s/d (ratio) today* • Pulsar 1937+21 is a clock (unit: blink) – 0.0015578065 s = 641.92825 Hz tvb FOSDEM 2015 19 Basics: clock stability

• Don’t care about time (can set) • Don’t care about frequency (can adjust) • We care about consistency of frequency – stability, or instability (lower is better) – a standard deviation* called sigma • Stability is measured by sampling – the sampling time interval is called tau • Allan deviation, log-log sigma(tau) plot tvb FOSDEM 2015 20 Basics: summary

•Time • Time interval • Frequency • Clocks • Clock comparison • Offsets/adjustments, time & frequency • Frequency Stability • Time Accuracy tvb FOSDEM 2015 21 3. amateur timekeeping

• Two kinds of clocks (1) My own clock; with precise oscillator – wide variety of DIY clock projects – set once, then occasionally compare (2) My own clock; but “borrow” the time – radio clocks (WWVB, DCF77, GPS) – power line (50/60 Hz mains) wall clocks – network clocks (telephone, cellular, NTP) tvb FOSDEM 2015 22 A DIY quartz analog/LED clock

tvb FOSDEM 2015 23 How to keep time?

• “Timebase” required (quartz oscillator) – how accurate is it? – how to measure it? • Use frequency counter – how accurate is it? – how to measure it?

tvb FOSDEM 2015 24 Accuracy

• 0.01/10.00 MHz = 0.1% (~86 sec/day) • 0.0001/10 = 10 ppm (~0.8 sec/day)

tvb FOSDEM 2015 25 More accuracy

• Better timekeeping needs better timebase – better measurement requires better counter – better counter requires better reference • What does it mean to “keep” time? – who’s time are we actually keeping? – WWVB, DCF77, NTP, Loran-C, GPS time – what is UTC; how good are atomic clocks? • This time stuff is all so interesting tvb FOSDEM 2015 26 The quest for better oscillators

tvb FOSDEM 2015 27 The quest for more digits

tvb FOSDEM 2015 28 Slippery slope

• More oscillators, more test equipment – quartz, rubidium, cesium standards – , , picoseconds • Most modern technology depends on: – precise time synchronization – stable frequency references • Books, articles, op/svc manuals, HPJ – danger: catch the “time bug” tvb FOSDEM 2015 29 Home time & frequency lab

tvb FOSDEM 2015 30 Museum of hp clocks

tvb FOSDEM 2015 31 HP quartz

. 105B . 107BR . 106B . 104AR . 103AR . 101A . 100ER

tvb FOSDEM 2015 32 HP clocks

. HP01 . 571B . 5321 . 117A . 114BR . 115BR . 113AR

tvb FOSDEM 2015 33 HP cesium & rubidium

. 5071A . 5065A . 5062c . 5061B . 5061A . 5060A

tvb FOSDEM 2015 34 Vintage hp 5061A (eBay)

tvb FOSDEM 2015 35 FYI: cesium (caesium)

• Cesium atomic clocks are not radioactive • They use a natural, stable Cs133 atom, not the scary man-made radioisotope Cs137 • Analogy: C12 vs. C14 •K39 vs. K40 (banana) • “hyperfine transition” 9,192,631,770 Hz • Solid / liquid [28 °C] tvb FOSDEM 2015 36 First radioactive cesium clock!

tvb FOSDEM 2015 37 What is the best clock?

• Quartz: inaccurate and drifts • Rubidium vapor: more stable but still drifts • Cesium beam: better still and no drift • Hydrogen maser: most stable, small drift • UTC is “average” of 364 clocks [w1412] • Exotic ion, “fountain”, optical clocks • No one best clock, no perfect time

tvb FOSDEM 2015 38 “Keeps perfect time”

• quartz • art deco

tvb FOSDEM 2015 39 Which is best?

• You go shopping for at lunch…

tvb FOSDEM 2015 40 Which clock do you want?

• Checking each day, at precisely noon: • (a) (b) (c) (d) • 12:00:00 12:01:30 12:03:30 12:06:11 • 12:00:00 12:01:40 12:03:25 12:07:22 • 12:00:00 12:01:20 12:03:30 12:08:33 • 12:00:00 12:01:10 12:03:35 12:09:44 • 12:00:00 12:01:40 12:03:30 12:10:55 • Which one do you want to buy? tvb FOSDEM 2015 41 Which clock do you want?

•Answer: – (a) is probably a stopped watch – (b) is most accurate, but more variable – (c) is less accurate, but less variable – (d) is least accurate, but very stable • Watch (d) is exactly 1:11 fast per 24h – regulate (or simply apply a math correction) and then you have the best watch

tvb FOSDEM 2015 42 Best wristwatch

tvb FOSDEM 2015 43 4. powers of ten

•Anyperiodic event is can be a clock – not all clocks are super accurate •How regular the occurrence determines: – how good or bad the clock is •How continuous the events determines: – how reliable the clock is • The range of accuracy/stability is huge! – all you have to do is measure it tvb FOSDEM 2015 44 “Powers of Ten” – inspiration

• Mr Charles and Ms Ray Eames (1977) – “the effect of adding another zero”

tvb FOSDEM 2015 45 Fractional units

• 1 second / day = ~1.2 × 10-5 • 3 seconds / month = 10-6 = 1 ppm • 1 second / month = ~3.8 × 10-7 • 1 second / year = ~3.2 × 10-8 • 1 ms [] / day = ~10-8 •1 µs [] / day = ~10-11 •1 ns [] / day = ~10-14 • 1 sec / 3 000 000 = ~10-14

tvb FOSDEM 2015 46 -0 10 drip, drip • Leak in ceiling • 0.57 s … 9.9 s • 1.7 Hz … 0.1 Hz

tvb FOSDEM 2015 47 -1 10 heart beat •10-1, 0.1, 10% • The original ‘1 PPS’ • Sometimes 2x, even 3x • Much higher stability at night • < 10% accuracy possible

tvb FOSDEM 2015 48 -1 10 heart beat • 12 h frequency plot (evening/night) • ADEV floor is 10-1 from 101 to 104 s!

tvb FOSDEM 2015 49 -2 10 tuning fork oscillator • 0.01, 1% • General Radio Type 213 Audio Oscillator • 1 ‘kc’; f = ~992.8 Hz • ±1.3 mHz (60 x 1 s) • Accuracy < 1% • Count those 9’s • ADEV is 10-6…10-4

tvb FOSDEM 2015 50 -2 10 tuning fork oscillator • plots

tvb FOSDEM 2015 51 -3 10 precision tuning fork • 0.001, 0.1%, 1 ms/s • General Radio Type 813 single vacuum tube • 1 ‘kc’ tuning fork •f = ~999.4 Hz • ±400 µHz (60 x 1 s) • Accuracy < 0.1% • ADEV is 10-7…10-4

tvb FOSDEM 2015 52 -3 10 precision tuning fork • plots

tvb FOSDEM 2015 53 -4 10 mechanical oscillator • 0.01%, 100 ppm • Mechanical oscillator transistorized • “Four 9’s”

tvb FOSDEM 2015 54 -5 10 mains (line frequency) • 0.001%, 10 ppm • 50/60± Hz

tvb FOSDEM 2015 55 -5 10 mains (line frequency) • plots

tvb FOSDEM 2015 56 -6 10 quartz watch (RC) • 0.0001%, 1 ppm, 1 µs/s • +160 ms/d = +1.85 ppm

tvb FOSDEM 2015 57 -6 10 quartz watch (RC) • Nightly WWVB radio sync (60 kHz) • Look closely at 01:30 AM PST • +1h +30m +15s • Plot of 9 days • Rate variations • Sync variations

tvb FOSDEM 2015 58 -7 10 chronometer • 0.1 ppm • Rated ¼ sec/day deviation

tvb FOSDEM 2015 59 -7 10 chronometer • ~55 runtime • 200 ms phase residuals • ADEV 610-7

tvb FOSDEM 2015 60 -7 10 chronometer • From 1940’s USN manual… • Phase – Dial error • Frequency –Daily rate •Drift – Deviation in rate

tvb FOSDEM 2015 61 -8 10 pendulum clock • 0.01 ppm, 10 ppb 10 ns/s, 864 µs/d • Shortt, Riefler, Fedchenko, Littlemore’ •T ≈ 2π√(L/g)

tvb FOSDEM 2015 62 -8 10 pendulum clock • plots

tvb FOSDEM 2015 63 -8 10 pendulum clock • Fedchenko AChF-3 clock (Nov 1969)

tvb FOSDEM 2015 64 -9 10 earth • 0.001 ppm • Slow by ~2 ms per day • Also somewhat irregular • ADEV 10-8 ~ 10-9 • Limited by core, weather, climate • Lunar/solar tides, periodic variations • Tidal friction, long- drift

tvb FOSDEM 2015 65 -9 10 earth (40y of data) • plots

tvb FOSDEM 2015 66 -9 10 earth clock • Long-term plot (300 years) • Length of day (LOD) is 86,400 seconds ± a few

tvb FOSDEM 2015 67 -9 10 earth clock • Short-term plot (3 recent years) • LOD is about 86,400.002 seconds

tvb FOSDEM 2015 68 -9 10 earth clock

tvb FOSDEM 2015 69 -9 10 earth frequency standard • Suggested improvements: – Thoroughly clean, and dry with cloth – Remove surrounding gas and water vapor – Wait for core to cool before use – Re-align axis of rotation (wobbling) – Keep away from nearby moon (tides) – Keep away from sun (tempco) – Re-adjust rate (avoid leap seconds)

tvb FOSDEM 2015 70 -10 10 ocxo • 0.1 ppb, 100 ps/s, 8.64 µs/d •10-10…10-13 short •510-10/d drift

tvb FOSDEM 2015 71 -11 10 good ocxo • 0.01 ppb, 10 ps/s, 864 ns/d (~1 µs/d) •10-11…10-13 short •~10-11/d drift

tvb FOSDEM 2015 72 -12 10 excellent ocxo • 1 ppt, 1 ps/s, 86.4 ns/d (~100 ns/d) •~10-13 short/mid •~310-12/d drift

tvb FOSDEM 2015 73 -13 10 hp 106B quartz • Best hp quartz •~410-13/d drift

tvb FOSDEM 2015 74 -13 10 rubidium • 8.64 ns/d (~10 ns/d) •~10-13 mid-term •~110-11/m drift

tvb FOSDEM 2015 75 -14 10 cesium • 864 ps/d (~1 ns/d) •~10-13 mid-term •~110-14 @ 1 day

tvb FOSDEM 2015 76 -14 10 more cesium •10-14 not! • Cesium clocks differ by 2x – 50x • Vintage 5060A

tvb FOSDEM 2015 77 -14 10 another cesium • Not even close to 10-14 @ 1 day • FTS 4010 • Portable clock

tvb FOSDEM 2015 78 -15 10 hp 5071A cesium • High-performance model • Pair ~210-14 at a day • Flicker floor ~510-15 in

tvb FOSDEM 2015 79 -16 10 active H-maser • 8.64 ps/d • Under 110-15 @1d • Most stable

tvb FOSDEM 2015 80 Summary – powers of ten

• 17 orders of magnitude – from a billion times worse than earth – to a billion times better than earth

tvb FOSDEM 2015 81 5. kids, clocks, and relativity

• What to do with hobby? • Einstein said time itself is not fixed – S.R. predicts higher speed slows time – G.R. predicts stronger gravity slows time • Is this only abstract theory in textbooks? – fast moving rocket ships and aging twins – objects getting too close to black holes • Can this be tested for real on earth? tvb FOSDEM 2015 82 Relativity at home

• We have many atomic clocks at home • No planes or rockets (high speed) • But we have mountains (high altitude)

tvbFrom NPL website FOSDEM 2015 83 Big idea

• Take our 3 kids with portable cesium clocks high up Mt Rainier • See if Einstein was right about gravity and time • See if clocks really run faster up there

tvb FOSDEM 2015 84 Einstein and 2005

• 100th anniversary of relativity: books, magazines, radio, TV, web sites, “ Year”, lectures…

tvb FOSDEM 2015 85 Louis Essen (UK) and 2005

•50th anniversary of cesium clock (NPL) • “famous for a second” 9 192 631 770 Hz

tvb FOSDEM 2015 86 Project GRE²AT

• General Relativity Einstein/Essen Anniversary Test (2005) – 100th anniversary (Einstein) –50th anniversary (Essen) first cesium clock • Combine atomic clock hobby, physics, history, technology, math, computers, children, car trip, vacation, and family fun

tvb FOSDEM 2015 87 Clock equations

• To a first approximation, small v, small h 2 2 • Kinematic: fk ½v c (redshift) 2 • Gravitation: fg ghc (blueshift) 2 2 2 • Sagnac: ts R cos ()•c

• Net freq f fk fg

• Total time T fT  ts – these corrections are usually infinitesimal –1/c2 ≈ 1.1×10-17 = 0.000000000000000011 tvb FOSDEM 2015 88 Magnify the effect

• Go as high as possible •Stay as long as possible • Measure as precisely as possible

Cartoon by Dusan Petricic Scientific American column Wonders by Philip and Phyllis Morrison http://www.sciam.com/1998/0298issue/0298wonders.html tvb FOSDEM 2015 89 calculation

• Turn infinitesimal into measurable • Frequency change f/f  gh/c2 f/f  1.09×10-16 s/s/meter • But if you go up 1 km instead of 1 m, then f/f = 1.1×10-13 = 0.11 ps/s • And if you stay up there 24 , then T= f/f  86400 s = 9.5×10-9 s = 9.5 ns • Gravitational time dilation 10 ns/day/km tvb FOSDEM 2015 90 The GREAT trip, day 1

• Carrying clock downstairs. Limited time; car is a mess, but it works.

tvb FOSDEM 2015 91 The GREAT trip, day 1

• Clocks in the middle, batteries (200 kg) on the floor, and instrumentation in the front.

tvb FOSDEM 2015 92 The GREAT trip, day 1

• Kids in the back. Dad making final clock BNC connections; Mom says goodbye.

tvb FOSDEM 2015 93 The GREAT trip, day 1

• Detail of TIC’s and laptop in front seat and clocks in middle seat. 23:33:48 UTC

tvb FOSDEM 2015 94 The GREAT trip, day 1

• Final gas stop and evening arrival at Rainier National Park.

tvb FOSDEM 2015 95 The GREAT trip, day 2

• Paradise Inn is at 5400 ft (~1650 m) elevation. Large parking lot to hide in.

tvb FOSDEM 2015 96 The GREAT trip, day 2

• Classic old Northwest inn; you should visit sometime.

tvb FOSDEM 2015 97 The GREAT trip, day 2

• Wonderful hiking trails and climbing. Lucky to have clear weather.

tvb FOSDEM 2015 98 The GREAT trip, day 2

• Avoid a ticket and move the car again. Ouch, running low in fuel. Now what.

tvb FOSDEM 2015 99 The GREAT trip, day 3

• Got gas at 6 AM. Used 15.78 gal in 34 h = 0.46 gph; ~2h/gal, so about 1 ns/gal.

tvb FOSDEM 2015 100 The GREAT trip, day 3

• More hiking, exploring, playing. It’s a fun place for a while.

tvb FOSDEM 2015 101 The GREAT trip, day 3

• 42 hours is up; time to leave. We’re all tired. Can this really work? Go home.

tvb FOSDEM 2015 102 The GREAT trip

• Home clock and mountain clock elevations (1650 m − 310 m = +1340 m)

tvb FOSDEM 2015 103 Back home, re-measure clocks

• Results are unknowable until the return (1) Did we see any time dilation? – requires before/after time-rate comparison – comparison against stable “house” clock (2) Did the results match prediction? – requires record of altitude and duration – used Garmin GPS NMEA log – approx +1340 m for 42 hours (integrate) tvb FOSDEM 2015 104 Elevation and predicted dilation

tvb FOSDEM 2015 105 Clock results (measured)

•Red 20.3 ns

tvb FOSDEM 2015 106 Mean clock results

• Mean 23.2 ns • ±4 ns • Predict 22.4 ns

tvb FOSDEM 2015 107 3-hat, residuals (home)

•Csi –Csj via lab reference

tvb FOSDEM 2015 108 3-hat, residuals (away)

•Csi –Csj via mutual-comparisons

tvb FOSDEM 2015 109 3-hat, residuals (combined)

•Csi –Csj

tvb FOSDEM 2015 110 GRE²AT experiment worked

• Gravitational time dilation is real! – we came back 22 ns older (wife −= 22 ns) – hacked hidden secret of the universe – ”relativity is now child’s play” • Unexpected press – Physics Today, WIRED magazine • No perfect clock, no perfect time – even atomic clocks are gravimeters tvb FOSDEM 2015 111 Thanks for your time

• Poul-Henning Kamp, FOSDEM / Gerry Demaret, time-nuts mailing list • Contact: [email protected] • Web: www.LeapSecond.com

tvb FOSDEM 2015 112