"What time is it?" aksed the microcontroller

Assume that we have a group of computers. Some of them are PCs and others are small microcontroller boards of different types. Some of the PCs running Linux and others running Windows, vxWorks or QNX. Microcontroller boards have no operating system but some embedded program that we are going to provide.

Our mission is "some how" synchronize their time as accurate as possible. What we are going to debate is the following special cases; 1. All computers (PCs and controllers) are placed next to each other and we are free to connect them together any way we want (freedom in electronics and in sw). 2. Computers are in the same room but separated from each other with few meters 3. Computers are in different rooms of the same building. 4. Computers are in the same campus. 5. Computers would be anyware (in the same town or city, country, continent, on the world or near Earth orbits).

What would be your suggestions ? How to connect them together? Which sort of HW and SW would you use ? How accurate the time sync. you would acheive (minute, secont, milli sec, micro sec, nano sec )?

Reply to
<jiang>
Loading thread data ...

What class is this for? If I give you an answer, do I get the credit for the grade in the class?

I don't know how to compensate for the time of travel of a the signal (only an issue for the last situation), but WWV in Colorado USA broadcasts a time signal that can be used anywhere on earth if you can receive the signal. By synchronizing to a common source, you can sync all your computers. Another common source is the GPS system, but again, you have to be able to receive the signals which precludes some locations.

--

Rick "rickman" Collins

rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design      URL http://www.arius.com
4 King Ave                               301-682-7772 Voice
Frederick, MD 21701-3110                 301-682-7666 FAX
Reply to
rickman

Another option is IEEE 1588, it's a time sync protocol.

others

running

possible.

and

electronics

few

sort of

Reply to
Glen Atkins

NTP as previously suggested, or if the units are external to the building, GPS is very good for this.

Reply to
pbreed

How much sybc accuracy can be achieved with NTP (minute, secont, milli sec, micro sec, nano sec )? Isn't the non-deterministic nature of ethernet is a problem for high accuracy? I think GPS is a good choice of otdoor environment but it is not be an option for indoor applications. Also GPS gives 1Hz timing signal isn't it?

GPS

Reply to
<jiang>

NTP will yield between 1mS (same subnet) and 100mS (cross-Internet) accuracy, depending on infrastructure between the server and client.

That depends on what you mean by high accuracy. For most computing purposes, 0.1 to 0.001 second accuracy is very adequate. More specialized applications use GPS sources with direct time signalling, both of which adjust for cable lengths. Or extreme-accuracy clocks (e.g., cesium) which are periodically referenced to a NIST atomic clock or GPS. These can offer better than 40nS accuracy.

See

formatting link
for a wide spectrum of products with the kinds of outputs and accuracies you're asking about. These guys pretty much own the market on time sync products.

For NTP, read the reference given earlier at

formatting link
It's loaded with FAQ, info, source code, etc.

GPS is an excellent option for internal use in fixed installations. Antenna on the roof feeds to an interior device of your choosing, which serves time using the interface of your choice. It's not uncommon for organizations to sync their root NTP servers this way.

GPS can sync to 40nS accuracy. The cycle of the GPS signal isn't really relevant - it's used to keep an internal clock sync'd. If a master clock needs to correct drift more than once a second, a better internal clock is probably in order.

Consider also - do you need accurate time, or just synchronized time? Presumably you want your devices sync'd to each other; that's the first part. Then, does your application need sync to UTC?

Reply to
Richard

If only synchronised time but not absolute time is needed and all devices are connected to the same synchronised national/continental AC power grid, it can be used to generate a common clock signal to all devices.

The problem is to identify the correct cycle to be used as a reference point, but if you can reach about 5 ms timing accuracy by other means at least once, it is possible to identify a common cycle and also into which phase in the three phase power distribution network the devices are connected.

Since the practical wave shape is far from a pure sine wave these days, using a zero crossing detector or peak detector is not very reliable. Instead use some form of phase locked loop with a several second integration time. This is also useful if the mains is lost for a few seconds due to lightning over voltages and other short disruptions.

The short time frequency accuracy is much worse than what is obtainable from even a bad crystal oscillator, but if the main purpose is only to register a common event by multiple devices, the absolute timing is not so critical.

Also the field and line sync pulses from a local TV-transmitter (or TV satellite) has been used in the past to synchronise receivers far apart, with timing accuracy well below the 64 us line time. Of course, you have to compensate for the propagation delay. Since analog (satellite/terrestrial) TV-transmissions will not last for many more years, this might not be a good solution for new systems any more.

Paul

Reply to
Paul Keinanen

Assume that someone find a magical way to sync all omputers with the accuracy you want. How can you verify that?

Reply to
Michael

Interesting thought, once the initial sync can be achieved. SOme thoughts on this...

The power grid clock is not constant (it varies +/- throughout the day), but probably isn't adjusted at a rate that would cause problems for this approach. However, I understand that grids are often inter-linked with DC, so it may work in some areas but not others.

It all depends on the timing accuracy required. And I wonder how well it'd work behind UPS systems - many operate with batteries "on-line" (power is rectified, then re-alternated), so the output may not be sync'd with the grid.

Good point. Even with digital TV, there's bound to be a timing signal you could sync from. Cellular would be another option.

Reply to
Richard

...

I've heard that public television transmits a time signal during vertical retrace. Would that help? - RM

Reply to
Rick Merrill

We once used the serial line break signal at system startup to set all the clocks in various moving systems in a large hall. The break signal bypassed the protocol stack and also any UART buffering, so you could get a quite accurate timing and the system worked for that day after this single reset.

Some units measured signals that were time stamped at the source. Based on these measurements the central unit preloaded (on serial lines) commands to other units which executed the command in the future, at a time specified in the command frame.

The original system used the same reset principle but relied on identical processor cards and their CPU clock oscillators to maintain a common time base. Some units were in boxes, while other in open frame structures moving around and thus cooled by the air stream and by the cold winter air coming through the doors when large equipment were moved in or out from the hall. The CPU clocks could be off by a second or two only after half an hour requiring a system stop and new reset.

Using the common mains as the clock solved all the problems. No extra wires were needed, since the mains was needed at each unit anyway.

Even if the absolute time would be off by a few seconds during the day, the same error would be at all stations and there would be no differential error.

At least most part of continental Europe is in the same synchronised area. There are other separate synchronised areas in CIS, Scandinavia and the British Isles, which are connected to the continental system by DC links only.

Within the same synchronised area you could use for instance a dial-up modem in non-error correcting, non-compressed mode at 4800 or 9600 bit/s to reset the clock and then let the systems run independently.

It will work only if all the equipment are fed by the same UPS.

With the amount of lip sync and subtitle timing problems in DVB-T, I very much doubt that you could get any usable timing :-)

Depending on the system, something usable might be available.

Paul

Reply to
Paul Keinanen

Install in all units a TimerPCB with CPLD, and 100'sMHz Clock. Sync all units from a star-cable pulse (equal cable lengths) Should attain in the 2-5ns time sync, time drift depends on the Local Clocks, but you can also run a common clock signal

Same as 1. (equal cable lengths)

As 1., or you can assign all units to Reset on POWER_UP, and then start counting. Flick the mains switch [+run fast] to (re)Sync Precison will depend on the Power-UP deltas in the units, but expect

10ms-1second region.

As 3, but be prepared to run faster when the whole campus power is interrupted for your sync, but the debate brief mentions nothing about disruption to others :)

1-4 are out, wireless is now needed. Look up the specs on GPS time, not just the time-ref pulse rate, but its precision and jitter

The debate brief should really have included notions of absolute(Standards) and relative(local) time. Ask your tutor to re-write the brief, to ask a better question :)

-jg

Reply to
Jim Granville

A sore spot among time sync fans. It's there, and it's often poorly maintained (i.e., out of sync by minutes+). There are stories of station engineers that didn't realize they were broadcasting time, then upon tracking down the box had no idea how to re-sync it to UTC.

Reply to
Richard

Easy ... just use Thiotimoline based components and slave them all to a common clock source.

George ============================================= Send real email to GNEUNER2 at COMCAST o NET

Reply to
George Neuner

Don't forget to use Black Hole Diodes at the end of the chain or the excess energy will be sucked back in time and kill your grandfather.

--
 -| Bob Hauck
 -| To Whom You Are Speaking
 -| http://www.haucks.org/
Reply to
Bob Hauck

But wouldn't that require you to throw all the systems into a vat of water (simultaneously)? Might be hard on the non-thiotimoline components...

Regards,

-=Dave

--
Change is inevitable, progress is not.
Reply to
Dave Hansen

Nope. Thiotimoline was a salt which could be added to other materials. In the proper crystaline structure, the 4th dimensional bond would create an alternate conductivity path having an effective zero propogation delay. Asimov himself speculated on this use and included the idea in some of his stories.

George ============================================= Send real email to GNEUNER2 at COMCAST o NET

Reply to
George Neuner

I wonder how closely related this is to how tunnel diodes work?

Cheers! Rich

Reply to
Rich Grise

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.