Network time synchronization of industrial control system based on NTP service

Network time synchronization
of industrial control system based on NTP service Network time synchronization of industrial control system based on NTP service

With the continuous development of digital networks, technologies based on Internet Protocol (IP) continue to emerge because of its sufficient convenience, flexibility and scalability. Local area networks (LANs), wide area networks (WANs), and cellular networks are common examples of IP network applications. When we adopt IP network technology in the field of industrial control, test and measurement, and data backbone applications that transmit information such as sound and video, time synchronization is the key point we consider. For example, sound and video quality are very sensitive to uncertain delays and jitter, and robots on the assembly line also need to be strictly synchronized with each other.

Figure 1: Digital display gear helps to synchronize time

IP network and Ethernet did not consider the synchronization problem when they were originally designed, but this is very necessary now. What measures need to be taken in the design if your product needs time synchronization? There are already several solutions. Here we discuss four common solutions: Network Time Protocol (NTP), Simplified Network Time Protocol (SNTP), Precise Time Protocol (PTP), and time synchronization with the aid of navigation systems. Such as the global positioning system GPS. Fortunately, from an architectural point of view, these different implementations have a lot in common.

Master clock source
Synchronous networks usually have a master clock. Its source is generally Coordinated Universal Time (UTC), which is a public time established based on the rotation of the earth. UTC and International Atomic Time (TAI) maintain a fixed relationship. The fixed relationship between the two is maintained by periodically increasing the leap second time on UTC according to the slowing speed of the earth's rotation. The current UTC time is longer than TAI. The time was nearly 36 seconds fast. Another metric is UT1, which is the time standard of Greenwich mean solar time starting at midnight as 0 o'clock plus artificial polar shift correction. The relationship between UTC and UT1 is kept within 9 seconds.
There are many time servers, but the most commonly used in the United States is the time provided by the National Institute of Science and Technology (NIST). The time provided by NIST is based on UTC, UTC1 and the Network Time Protocol (NTP) server. Computers on other networks And the main clock source is determined according to this server, but there are many auxiliary servers, and the time information can also come from the navigation satellite.

Time research elements
In the network design, there are asynchronous and synchronous time models. All synchronous methods require a cohesive level timing solution. The reference clock is necessary for the synchronization of network elements. Network elements usually need a voltage-controlled crystal oscillator (VCXO), phase-locked loop (PLL) or clock generator to achieve synchronization through adjustment. At present, the more popular solutions include the ultra-low phase noise VXCO launched by Abracon and the 82P33814-1NLG synchronization management unit launched by IDT, which supports multiple synchronization modes.
No matter which solution is chosen, the design system needs to be able to provide proper jitter attenuation and phase noise rejection, and maintain proper synchronization tolerances with other elements in the network. Time design should include certain retention characteristics, that is, the ability to maintain the clock before being notified of the synchronization state to prevent the master clock or reference clock from malfunctioning.
Industrial Automation System

Commonly used synchronization solutions
Network Time Protocol (NTP) and Simplified Network Time Protocol (SNTP) The
most commonly used public network time synchronization method is NTP and its simplified version SNTP. The public NTP subnet has servers on all continents and even on the sea floor. , Provide time support services for countless computers on the global Internet. The NTP server time is based on UTC, but the NIST organization has set up an NTP server based on UT1.
The NTP protocol uses software time stamps to achieve precise time synchronization, with an accuracy ranging from 100µs to 100ms or greater. Many factors can cause differences, but they are usually caused by network delays, hardware, operating systems, oscillator drift caused by changes in ambient temperature, and time intervals caused by time updates.
When we determine that we need to adjust the client's local time, we also need to take the round-trip time delay into account. NTP and SNTP use the same process to determine the correction factor. The calculation result is based on the assumption that the delays in both directions are the same. Therefore, a total of four data packets are exchanged between the client and the server.
The main difference between NTP and SNTP is that SNTP clients need to periodically synchronize their time directly from a single SNTP server. Therefore, SNTP is mainly used for applications that do not require high precision, while NTP uses complex state-based algorithms. To improve accuracy.

Figure 2: The synchronization path of the first three layers

NTP supports multicast/anycast, client-server, and point-to-point mode, while SNTP is usually used in client-server mode. The NTP system broadcast time information is hierarchical and establishes different levels, each level is assigned to one Corresponding to the serial number of the level (Stratum), the Stratum 1 server is the bottom layer and provides global time synchronization services. The upper layer needs to synchronize according to the time information of the bottom layer. (The network event structure provides a good source of information for further research, and provides a reference implementation called NTPd, which is suitable for Unix and Windows operating systems)

IEEE 1588 Precision Time Protocol (PTP)
PTP has quickly become the preferred time synchronization solution for Ethernet packet networks, especially suitable for industrial control, telecommunications, test and measurement applications, and it is more accurate and more certain than the NTP protocol . The PTP protocol has many similarities with the NTP protocol, but there are several key differences. First, the client's time stamp is implemented by hardware instead of software, and place it as close to the network interface as possible to eliminate irregular delays related to the client software, which will improve the accuracy of a few nanoseconds. The PTP network master clock selection process is more robust.

Figure 3: Synchronization mechanism and delay calculation-cheap correction =ó

In the PTP protocol, time information is passed through the entire network hierarchically in the form of a master-slave structure. The event source is based on the TAI standard. The "Best Master Clock (BMC)" software algorithm will select from all available clock sources. The most suitable clock and time information will be passed to all sub-networks of PTP.
The selection of the master clock in all sub-networks of the PTP protocol also uses the BMC algorithm. Multicast transmission is the main transmission method of the clock, but the terminal client will synchronize with the master clock by direct communication, and send it regularly in the form of unicast Time synchronization request. Of course, there is also the possibility of a "transparent clock", that is, the network switch may modify the timestamp in the process of transmitting the PTP message to the PTP subnet. This modification is to improve the accuracy of the time stamp of the receiving subnet by calculating the local device delay.
The perfect PTP solution certainly exists, but the choice is still due to the combination of a transceiver solution and a microcontroller-controlled PTP software protocol stack or a microcontroller-based solution and protocol stack. The network time organization provides an open source PTP protocol stack implementation solution called PTPd, which can be downloaded for free. The most widely distributed solution is DP83640 launched by TI. As a universal module, it will output a slave clock in different operation modes. This clock is synchronized with the master clock in both frequency and phase, and then passed to the lower sub-network with accuracy In the sub-nanosecond range, of course, it also has the time stamp of the NTP protocol. TI provides detailed application instructions, such as how to configure and how to achieve higher accuracy.

Global Positioning System (GPS)

Figure 4: Space-based navigation system includes a set of satellites orbiting the earth

Space-based navigation systems include a set of satellites orbiting the earth, and these systems can provide very precise time and position information. The US system became the "Global Positioning System (GPS)", Russia called the "Global Navigation Satellite System (GLONASS)", China's "BeiDou-2 Navigation Satellite System", and India's "Indian Regional Navigation Satellite System" (IRNSS)”, of course other countries are also developing their own navigation systems.

GPS satellites are equipped with atomic clocks, and they are synchronized with each other and periodically adjusted to synchronize with the ground clock. The time is calculated based on the timestamps periodically sent by at least four satellites, and the delay calculation is relatively simple, because the signal travels at the speed of light, and the satellites regularly send its position information.

Unlike the NTP and PTP protocols, the variable delay problem of the GPS system is different, because the time information comes directly from the satellite. The only limiting factor is that the receiver must have an unobstructed path, the atmospheric environment and the satellite relative to the receiver. Location will affect accuracy. Because it is expensive to integrate a receiver for each network element, engineers will effectively control the cost, but related products in the GPS era are much cheaper, making the actual solution synchronization accuracy within 100ns.

Another good feature of GPS receivers is that they can be used in closed networks, that is, there is no Internet connection. They can also provide an accurate master clock source for PTP networks.

Summary
In addition to the time synchronization method mentioned above, there are of course other solutions such as "Synchronization Network (SyncE)" and "In-scope Instrument Group Time Coding (IRIG)", which are worthy of our in-depth study. These technologies all achieve synchronization by distributing signals but all require a dedicated hardware platform.
"Synchronization network" has become a standard and has been more and more popular. The traditional time division multiplex network has evolved into an IP-based switching and multiplexing implementation (the DP83640 mentioned above is based on SyncE technology Achieved). For further exploration, you can refer to the relevant standards of the International Telecommunication Union: ITU-T Rec.G8261, 62, 64.
The network time synchronization solution can also be implemented by the combination of the methods mentioned above. For example, the PTP-based industrial control network can obtain its master clock source from the GPS receiver, and of course it can also be obtained from the NTP derived server. Many feasible methods and combinations can work together, the ultimate goal is to achieve precise time synchronization through the network, but each technology has its own unique features, and with the development of the network and technology can gradually meet most of the modern applications demand.

Guess you like

Origin blog.csdn.net/weixin_44990608/article/details/108604697