 |
|
| |
|
|
| |
Remote control synchronizes clocks
( 01 Jun 2007 )
by Jon Titus, Senior Technical Editor, ECN
|
Most engineers understand that equipment cannot use Ethernet communications to accurately synchronize events at distant locations. To address this problem, the IEEE has released a time-synchronization standard that some industrial-control companies and instrument vendors have adopted. Named IEEE 1588 (2002), the standard provides a protocol that lets devices take advantage of the most precise and accurate clock on a network. Embedded-system developers who need to synchronize timing across a network also can benefit from this standard.
Although separated pieces of equipment may have their own accurate clocks, circuits drift and small differences — from nanoseconds to microseconds — can accumulate quickly. And, a network connection causes latency delays, or “jitter.” Equipment manufacturers that include 1588 capabilities in their products, or who supply 1588 add-on products, help engineers overcome these timing problems. Depending on the network configuration and equipment, synchronized clocks can track within 10’s of nanoseconds to a few microseconds.
The steps below explain in general how the 1588 Precision Time Protocol (PTP) works with IEEE 1588-compliant devices:
1. When added to a network, a device runs a Best Master Clock (BMC) algorithm that transmits information about its clock and receives information about other clocks in the network. The best clock becomes the master and all other devices operate as slaves.
2. The master sends a synchronization message to all slaves and creates an internal transmission-time stamp. (Figure 1) When a slave receives a synchronization message, it creates its own arrival-time stamp. The master clock sends a follow-up message that includes its transmission-time stamp data. At this point, each slave knows when the master sent the sync message and when it arrived. This time difference lets each slave synchronize its internal clock to the master clock. Keep in mind that the time-stamp difference includes the network's propagation delay.
3. To determine the network delay, a slave transmits a delay-request message to the master and creates a time stamp. The master notes the delay-request message’s arrival time and transmits this information back to the slave in a delay-response message. The time difference between these two time stamps represents the network propagation delay. Now, the slave can account for the delay and fine tune its internal clock. For this approach to work, the network must provide a symmetrical delay between the master and each slave.
4. At regular intervals — the default is two seconds — the master transmits a new synchronization message and a follow-up message to keep the clocks synchronized. If the plan is to implement IEEE 1588 in a product, several manufacturers offer help. IXXAT, for example, offers PTP protocol software that will operate independent of an operating system, and that connects to the User Datagram Protocol (UDP) socket in an Ethernet stack. The software provides a clock interface and a time-stamp unit. To help users get a head start, the IXXAT package comes with a sample implementation for a Freescale PowerQUICC MPC8360 processor. The chip’s integrated time unit, system clock and PTP-based timer let designers achieve a time base with an accuracy of 20ns. (www.ixxat.com)
Real-Time Systems also offers software that implements master and slave clocks. The RTS protocol stack automatically determines the most accurate clock and adjusts real-time clocks by constantly exchanging timing messages. This software uses statistical techniques to further reduce residual clock fluctuations. Because the RTS IEEE 1588 protocol stack provides for hot-swapping devices, they may “join” or “leave” the network at any time. The company makes available open-source tools you can use to monitor, tune and analyze a PTP network. Engineers can obtain source code for this stack. The company also supports hardware implementations of the IEEE 1588 protocol. (www.real-time-systems.com)
On the hardware side, National Instruments sells the PCI-1588 that implements a hardware time-stamp unit, runs on the PCI bus and operates as either a master or slave. Because many distributed control, instrumentation and data-acquisition systems rely on a host controller, this card can easily drop into a PC and serve as the master clock. Three general-purpose outputs let the card synchronize operations with clocks that do not comply with the IEEE 1588 protocol. National Instruments provides NI-Sync driver software. (www.ni.com)
If you would like a complete setup to test the protocol and put it to work immediately, Meinberg offers three starter kits that all include a GrandMaster clock from Meinberg and an industrial Ethernet switch from Hirschmann Automation and Control. You can choose a kit that meets specific needs of engineers who want to integrate 1588 with existing equipment, develop software for a 1588-based network or test 1588-capable equipment. (ptp-starterkit.meinberg.de)
For further reading
“IEEE 1588 Protocol Stack Product Documentation,” Real Time Systems. www.real-time-systems.com/ieee_1588_documentation.html.
“Introduction to Distributed Clock Synchronization and the IEEE 1588 Precision Time Protocol,” National Instruments. www.ni.com. Search Developer Zone for “1588.”
Eidson, John C., and Dan Pleasant, “Time Scales and IEEE 1588,” Part 2, LXIConnexion, July 2006, www.lxiconnexion.com.
Mohl, Dirk, “IEEE 1588: Running Real-Time on Ethernet,” Industrial Networking. www.industrial-networking.com.
Illustrations:
Figure 1 |
|
|