A distributed control system and control method based on PTP protocol
By combining hardware decoding and instruction timetables in a distributed control system, the problem of limited time accuracy in existing technologies is solved, achieving high-precision control instruction output and system scalability, making it suitable for various types of distributed control systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2026-04-10
AI Technical Summary
Existing distributed control systems based on PTP network time synchronization implement control tasks through software control logic, which suffers from limitations in time accuracy due to system size and control node type.
A core switch is used to connect the PTP server and the end effector. The PTP module generates the TOD signal, reference clock signal and PPS signal, and performs hardware decoding in the I/O module. Combined with the instruction timetable, the system realizes the synchronous output of instructions, the time synchronization of each node in the system and the output of control instructions.
It achieves high-precision control command output, the system is simple and reliable, highly scalable, and suitable for various distributed control systems. It requires no complex network structure modification and is low in cost.
Smart Images

Figure CN117008515B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to distributed control systems, and more specifically to a distributed control system and control method based on the PTP protocol. Background Technology
[0002] For large-scale distributed control systems involving fields related to national economy and people's livelihood such as hydropower, wind power, petrochemicals, municipal engineering, and national defense, the control nodes are often widely distributed, and the front-end control equipment of each control node is required to execute actions according to unified and precise control instructions. The synchronization accuracy of instruction input and output time between various control nodes in the system is required to be high.
[0003] Currently, clock synchronization technologies based on distributed control systems include:
[0004] (1) GPS clock synchronization: Each distributed control node uses a GPS receiver to receive the second pulse of the GPS synchronization satellite and the serial port time information to realize the time synchronization between the distributed clock and the atomic clock mounted on the GPS satellite. The entire system structure is relatively complex and is easily affected by weather and other conditions.
[0005] (2) IRIG-B code communication, which sends time information via serial port, including year, month, day, hour, minute and second. After receiving the message, the receiving end decodes the time to achieve time synchronization. The synchronization accuracy can reach the level of 10 microseconds, but its transmission distance is limited and the system implementation is difficult.
[0006] (3) NTP network time synchronization adopts CS synchronization mode (i.e. client / server mode). By calculating the transmission link delay and time deviation between each client and the server, the local clock is adjusted to achieve time synchronization between each client and the server. Its synchronization accuracy can only reach the order of milliseconds.
[0007] (4) PTP Network Time Synchronization: The PTP (IEEE 1588) protocol is a network-based precision clock synchronization protocol that uses a combination of software and hardware for clock synchronization. Distributed nodes exchange network data packets with the master clock to achieve time and frequency synchronization among nodes, with synchronization accuracy reaching sub-microsecond levels. Existing distributed control systems using the PTP protocol typically employ network synchronization to synchronize the clocks of all nodes within the system, implementing control tasks through software control logic. However, software control cannot directly output control commands, and its time accuracy is limited by system size and the type of control nodes. Summary of the Invention
[0008] The purpose of this invention is to solve the technical problems of existing distributed control systems based on PTP network time synchronization, which typically use network synchronization to synchronize the clocks of each node in the system and implement control tasks through software control logic. However, these systems suffer from limitations such as the inability of software control to directly output control commands and the time accuracy being restricted by the system size and the type of control nodes. Therefore, this invention provides a distributed control system and control method based on the PTP protocol.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0010] A distributed control system based on the PTP protocol is characterized by including a core switch, as well as a PTP server and end actuators connected through the core switch.
[0011] The core switch is used for interconnection between the PTP server and the end effector; the PTP server is used for time synchronization with the end effector.
[0012] The number of end effectors is K, and each end effector includes a power module, a PTP module and T I / O modules connected to the power module, where K and T are both positive integers;
[0013] The PTP module is connected to the core switch via a network interface and to each of the T I / O modules via a backplane interface. The PTP module is used to generate TOD signal, reference clock signal and PPS signal and output them to the T I / O modules.
[0014] The I / O module has a preset instruction timetable. The I / O module is used to obtain the system time and realize the synchronous output of instructions.
[0015] The instruction timetable contains N instructions, as well as an instruction output start time register and an instruction output end time register for each instruction, where N is a positive integer.
[0016] Furthermore, the power module is tightly coupled to the PTP module and the T I / O modules, and the PTP module is connected to the T I / O modules via a backplane interface.
[0017] Furthermore, the PTP module is provided with at least one network interface;
[0018] The FPGA is located within the TOD decoding module of the I / O module.
[0019] A distributed control method based on the PTP protocol, and a distributed control system based on the aforementioned PTP protocol, is characterized by including the following steps:
[0020] Step 1: The PTP server transmits time to K PTP modules through the core switch. Each PTP module generates a TOD signal, a reference clock signal, and a PPS signal, and transmits them to its corresponding T I / O modules respectively.
[0021] Step 2: Each I / O module receives the TOD signal and reference clock signal transmitted by the PTP module. Through the TOD decoding module in the I / O module, the TOD signal is decoded according to the reference clock signal to obtain the year, month, day, hour, minute and second information of the system time, and stored in the year register, month register, day register, hour register, minute register and second register in the I / O module respectively.
[0022] Step 3: The I / O module receives the PPS signal and reference clock signal transmitted by the PTP module, and performs synchronous counting on the reference clock signal according to the arrival time of the PPS signal to obtain the sub-second information of the system time, and stores it in the sub-second time register in the I / O module.
[0023] Step 4: Combine the information in the year register, month register, day register, hour register, minute register, and second register obtained in Step 2 with the information in the sub-second time register obtained in Step 3 to obtain the current system time Sys_Time, and store it in the system time register in the I / O module.
[0024] Step 5: Compare the system time Sys_Time in the system time register with the instruction start time On_Time in the instruction output start time register of each instruction in the preset instruction timetable. i The instruction output end time (Off_Time) in the instruction output end time register i Compare when Sys_Time ≥ On_Time i And Sys_Time≤Off_Time i When the condition is met, the I / O module outputs the corresponding instruction and then executes step 6; otherwise, it does not output an instruction and directly executes step 6.
[0025] Step 6: Repeat steps 1-5 to obtain the system time in real time, and output instructions synchronously while obtaining the system time, until the control of the distributed control system is completed.
[0026] Furthermore, step 2 specifically includes:
[0027] 2.1 The I / O module receives the TOD signal and reference clock signal transmitted by the PTP module;
[0028] 2.2 The FPGA configured within the TOD decoding module of the I / O module performs serial protocol decoding on the TOD signal based on the reference clock signal, converting the high and low level signals of the TOD signal into TOD byte signals, and outputting the enable signal RX_VLD, the TOD byte signal RX_TOD, and the error signal RX_ERR. When RX_VLD is 1 and RX_ERR is 0, the RX_TOD byte data is transmitted to the TOD decoding module; if RX_ERR is 1, an alarm is triggered, indicating a system error; if RX_VLD is 0, no action is taken, and the process returns to step 1.
[0029] 2.3 The TOD decoding module receives the TOD byte signal RX_TOD byte by byte, and divides the TOD byte signal RX_TOD into multiple data frames with the byte whose data is in ASCII code as the dividing point.
[0030] 2.4. Determine whether the data frame is an RMC data frame or a ZDA data frame based on the first field of the data frame;
[0031] 2.5 If the data frame is an RMC data frame, the second field of the data frame is selected as the time information, and the corresponding bytes of data in the second field are stored in the hour register, minute register, and second register respectively; the tenth field is selected as the date information, and the corresponding bytes of data in the tenth field are stored in the year register, month register, and day register in the I / O module respectively.
[0032] If the data frame is a ZDA data frame, the second field is selected as the time information, and the corresponding bytes of data in the second field are stored in the hour register, minute register, and second register respectively; the third, fourth, and fifth fields are selected as the day, month, and year in the date information, and the corresponding bytes of data are stored in the day register, month register, and year register in the I / O module respectively;
[0033] If the data frame is not an RMC data frame or a ZDA data frame, no processing is performed, and the process returns to step 2.4 to determine the next data frame.
[0034] Furthermore, step 3 specifically includes:
[0035] 3.1 The I / O module receives the PPS signal and reference clock signal transmitted by the PTP module;
[0036] 3.2 Set the synchronization counter based on the reference clock signal, and use the rising edge of the PPS signal as the reset signal for the synchronization counter;
[0037] 3.3 A synchronous counter is used to count the reference clock signal. When the rising edge of the reference clock signal is detected, the value of the synchronous counter is incremented by 1; when the rising edge of the PPS signal is detected, the value of the synchronous counter becomes 0.
[0038] 3.4 After compensating for the delay of the PPS signal output by the PTP module, the value of the synchronization counter is stored in the sub-second time register in the I / O module.
[0039] Furthermore, in step 2.3, after dividing the TOD byte signal RX_TOD into multiple data frames, the method further includes verifying the data frames, specifically:
[0040] During data frame transmission, each data frame is checked according to byte parity. If the data frame is successfully checked, proceed to step 2.4; if the check fails, the data frame is not processed and the next data frame is checked.
[0041] Furthermore, in step 2.4, the RMC data frame has the following data frame format:
[0042] $xxRMC,UTCTime,status,lat,ulat,lon,ulon,spd,cog,date,mv,mvE,mode*CS <cr> <lf>;
[0043] The ZDA data frame has the following data frame format:
[0044] $xxZDA,UTCTime,day,month,year,ltzh,ltzn*CS <cr> <lf>.
[0045] Furthermore, in step 4, the current system time Sys_Time has the following structure:
[0046] YY, MM, DD, HH, MM, SS, SSS;
[0047] In this system, YY represents year, MM represents month, DD represents day, HH represents hour, MM represents minute, SS represents second, and SSS represents millisecond.
[0048] Furthermore, in step 1, the reference clock signal is a signal on the order of nanoseconds.
[0049] Compared with the prior art, the present invention has the following beneficial technical effects:
[0050] 1. The distributed control system based on the PTP protocol provided by this invention integrates the network time synchronization function and command output function based on the PTP protocol into the end effector. It has no limitations or constraints on the scale of the distributed control system or the type of control nodes. The system is simple and reliable with high control command output accuracy. The timing and control logic are implemented in hardware, which enables the system to have high real-time performance. It has no special requirements on the network structure of the existing control system, has low modification cost, strong portability, and can be widely used in various distributed control systems with high requirements for system command output accuracy.
[0051] 2. The distributed control system based on the PTP protocol provided by this invention connects the PTP module and each I / O module in a tightly coupled manner through a backplane interface. The number of I / O modules or the type of I / O modules can be arbitrarily expanded or changed according to control requirements, which has good scalability.
[0052] 3. The distributed control method based on the PTP protocol provided by this invention decodes the TOD signal and uses the PPS signal as a reset signal to synchronously count the reference clock signal, thereby realizing high-time-precision command output of each node in the distributed control system. Attached Figure Description
[0053] Figure 1 A schematic diagram of the structure of a distributed control system based on the PTP protocol provided in an embodiment of the present invention;
[0054] Figure 2 A schematic diagram illustrating the working principle of the end effector in a distributed control system based on the PTP protocol, provided for an embodiment of the present invention.
[0055] Figure 3 A flowchart illustrating a distributed control method based on the PTP protocol provided in an embodiment of the present invention;
[0056] Figure 4 A schematic diagram of step 2 of the distributed control method based on the PTP protocol provided in an embodiment of the present invention;
[0057] Figure 5 A schematic diagram of step 3 of the distributed control method based on the PTP protocol provided in an embodiment of the present invention;
[0058] The annotations in the attached figures are explained as follows:
[0059] 1-PTP server, 2-core switch, 3-end actuator, 4-power module, 5-PTP module, 6-I / O module. Detailed Implementation
[0060] The following detailed description, in conjunction with the accompanying drawings and specific embodiments, provides a further detailed explanation of the distributed control system and control method based on the PTP protocol proposed in this invention. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of this invention and are not intended to limit the scope of protection of this invention.
[0061] A distributed control system based on the PTP protocol, such as Figure 1 As shown, the system includes a PTP server 1 and an end-effector 3 connected via a core switch 2. The PTP server 1 serves as the master clock for the PTP network, providing time synchronization to the end-effector 3. It integrates a GPS clock and a BeiDou clock as reference clock sources to provide a precise time standard, and can also accommodate a rubidium atomic clock module for time synchronization. The core switch 2 facilitates the interconnection between the PTP server 1 and the end-effector 3, as well as the exchange of time information.
[0062] The number of end effectors 3 is K, such as Figure 2 As shown, each end effector 3 includes a power module 4, a PTP module 5, and T I / O modules 6, all connected to the power module 4, where K and T are positive integers. The power module 4 is tightly coupled to the PTP module 5 and the T I / O modules 6, and the PTP module 5 is tightly coupled to the T I / O modules 6 via a backplane interface. The PTP module 5 has at least one network interface, which is connected to the core switch 2. The PTP module 5 and the T I / O modules 6 are connected via backplane interfaces. The PTP module 5 is responsible for achieving precise network time synchronization within the control system, generating and transmitting TOD signals, reference clock signals, and PPS signals to the T I / O modules 6 in real time via the backplane interface. The I / O modules 6 are equipped with an FPGA, which receives the TOD signals, PPS signals, and reference clock signals input from the PTP module 5. The I / O modules 6 have a pre-set instruction timetable for acquiring the system time and simultaneously outputting instructions. The instruction timetable contains N instructions, as well as the instruction output start time register and end time register for each instruction, where N is a positive integer. Figure 2 The 10MHz frequency signal is the reference clock signal.
[0063] The distributed control system based on the PTP protocol provided by this invention involves a PTP server 1 transmitting time to a PTP module 5 via a core switch 2. The PTP module 5 generates a TOD signal, a reference clock signal, and a PPS signal, which are transmitted to T I / O modules 6 via a backplane interface. The FPGA mounted in each I / O module 6 performs real-time hardware decoding based on the three received signals, obtains the current system time, and stores it in a system time register. The system time register is compared with a predetermined instruction time register, and when the instruction output conditions are met, the hardware outputs the corresponding terminal instruction in real time.
[0064] The distributed control system based on the PTP protocol provided by this invention has no limitations or constraints on the scale of the distributed control system or the type of control nodes. The system is simple, reliable, and has high accuracy in outputting control commands. The PTP module 5 is tightly coupled to each I / O module 6 via a backplane, allowing for easy expansion of the number or change of the I / O modules 6 according to control requirements. It has good scalability, requires no special consideration for existing control system network structures, has low modification costs, and strong portability. It can be widely applied to various distributed control systems with high requirements for system command output accuracy. By tightly coupling the timing system with the control logic in hardware, high-precision synchronous output of control commands is directly achieved, resulting in higher command output synchronization accuracy and improved system real-time performance.
[0065] A distributed control method based on the PTP protocol, based on the aforementioned distributed control system based on the PTP protocol, such as... Figure 3 As shown, it includes the following steps:
[0066] Step 1: PTP server 1 transmits time to K PTP modules 5 through core switch 2. Each PTP module 5 generates a TOD signal, a reference clock signal, and a PPS signal, which are then transmitted to its corresponding T I / O modules 6 via the backplane. The reference clock signal is a signal on the order of nanoseconds. PTP server 1 transmits time to K PTP modules 5 using a periodic time transmission method, which provides high time accuracy within the transmission period.
[0067] Step 2: Each I / O module 6 receives the TOD signal and reference clock signal transmitted from the PTP module 5. Through the TOD decoding module within the I / O module 6, it decodes the TOD signal according to the reference clock signal to obtain the system time's year, month, day, hour, minute, and second information, and stores it respectively in the year register, month register, day register, hour register, minute register, and second register within the I / O module 6. Figure 4 As shown, specifically:
[0068] 2.1 I / O module 6 receives the TOD signal and reference clock signal transmitted by PTP module 5;
[0069] 2.2 The FPGA in the TOD decoding module of I / O module 6 performs serial protocol decoding on the TOD signal according to the reference clock signal, converting the high and low level signals of the TOD signal into TOD byte signals, and outputting the enable signal RX_VLD, the TOD byte signal RX_TOD, and the error signal RX_ERR. When RX_VLD is 1 and RX_ERR is 0, the RX_TOD byte data is transmitted to the TOD decoding module; if RX_ERR is 1, an alarm is triggered, indicating a system error; if RX_VLD is 0, no processing is performed, and the process returns to step 1.
[0070] 2.3 The TOD decoding module receives RX_TOD byte by byte, using the comma (",") as the delimiter to divide RX_TOD into multiple data frames, and verifies each data frame. The verification process is as follows:
[0071] During data frame transmission, byte parity is used to verify the data frame. If the data frame verification is successful, proceed to step 2.4; if the verification fails, the data frame is not processed and the next data frame is verified.
[0072] 2.4. Determine whether the data frame is an RMC data frame or a ZDA data frame based on the first field of the data frame;
[0073] RMC data frames have the following data frame format:
[0074] $xxRMC,UTCTime,status,lat,ulat,lon,ulon,spd,cog,date,mv,mvE,mode*CS <cr> <lf>;
[0075] ZDA data frames have the following data frame format:
[0076] $xxZDA,UTCTime,day,month,year,ltzh,ltzn*CS <cr> <lf>;
[0077] 2.5 If the data frame is an RMC data frame, the second field of the data frame is selected as the time information, and the corresponding bytes of data in the second field are stored in the hour register, minute register, and second register respectively; the tenth field is selected as the date information, and the corresponding bytes of data in the tenth field are stored in the year register, month register, and day register in I / O module 6 respectively.
[0078] If the data frame is a ZDA data frame, the second field is selected as the time information, and the corresponding bytes of data in the second field are stored in the hour register, minute register, and second register respectively; the third, fourth, and fifth fields are selected as the day, month, and year in the date information, and the corresponding bytes of data are stored in the day register, month register, and year register in I / O module 6 respectively.
[0079] If the data frame is not an RMC data frame or a ZDA data frame, no processing is performed, and the process returns to step 2.4 to continue judging the next data frame.
[0080] Step 3: I / O module 6 receives the PPS signal and reference clock signal transmitted from PTP module 5, performs synchronous counting on the reference clock signal to obtain the sub-second information of the system time, and stores it in the sub-second time register within I / O module 6. Figure 5 As shown, specifically:
[0081] 3.1 I / O module 6 receives the PPS signal and reference clock signal transmitted by PTP module 5;
[0082] 3.2 Set the synchronization counter based on the reference clock signal, and use the rising edge of the PPS signal as the reset signal for the synchronization counter;
[0083] 3.3 A synchronous counter is used to count the reference clock signal. When the rising edge of the reference clock signal is detected, the value of the synchronous counter is incremented by 1; when the rising edge of the PPS signal is detected, the value of the synchronous counter becomes 0.
[0084] 3.4 After compensating for the delay of the PPS signal output by the PTP module, the value of the synchronization counter is stored in the sub-second time register in the I / O module 6.
[0085] Step 4: Combine the information in the year register, month register, day register, hour register, minute register, and second register obtained in Step 2 with the information in the sub-second time register obtained in Step 3 to obtain the current system time Sys_Time, and store it in the system time register in I / O module 6.
[0086] The current system time Sys_Time has the following structure:
[0087] YY, MM, DD, HH, MM, SS, SSS;
[0088] In this system, YY represents year, MM represents month, DD represents day, HH represents hour, MM represents minute, SS represents second, and SSS represents millisecond.
[0089] Step 5: Compare the system time Sys_Time in the system time register with the instruction start time On_Time in the preset instruction timetable start time register for each instruction. i The instruction end time Off_Time in the end time register i Compare when Sys_Time ≥ On_Time i And Sys_Time≤Off_Time i When the condition is met, I / O module 6 outputs the corresponding instruction and then executes step 6; otherwise, it does not output an instruction and directly executes step 6.
[0090] Step 6: Repeat steps 1-5 to obtain the system time in real time, and output instructions synchronously while obtaining the system time to complete the control of the distributed control system.
[0091] The distributed control method provided by this invention determines the timing accuracy of command output synchronization based on the timing accuracy of the PTP network, regardless of system size, distance between control terminals, or number of terminals. Compared to NTP network timing synchronization, the PTP-based distributed control system method proposed in this invention significantly improves the final command output accuracy; compared to GPS timing, it significantly simplifies the system network structure and improves reliability; and compared to IRIG-B code, it offers greater system layout flexibility and achieves sub-microsecond command output accuracy.< / lf> < / cr> < / lf> < / cr> < / lf> < / cr> < / lf> < / cr>
Claims
1. A distributed control method based on PTP protocol, a distributed control system adopted comprising a core switch (2), and a PTP server (1) and an end execution mechanism (3) connected through the core switch (2); the core switch (2) is used for interconnection of the PTP server (1) and the end execution mechanism (3); the PTP server (1) is used for time service to the end execution mechanism (3); K and T are positive integers; the PTP module (5) is connected with the core switch (2) through a network interface, and is connected with T I / O modules (6) through a backplane interface respectively, the PTP module (5) is used for generating a TOD signal, a reference clock signal and a PPS signal, and outputting the same to the T I / O modules (6); the I / O module (6) is pre-provided with an instruction time table, and is used for acquiring a system time and realizing instruction synchronous output; the instruction time table comprises N instructions, and an instruction output start time register and an instruction output end time register corresponding to each instruction, wherein N is a positive integer; characterized by comprising the following steps:
1. The PTP server (1) time serves to K PTP modules (5) through the core switch (2), each PTP module (5) generates a TOD signal, a reference clock signal and a PPS signal, and transmits the same to T I / O modules (6) corresponding thereto respectively; The number of the end actuators (3) is K, each end actuator (3) comprises a power module (4), and a PTP module (5) and T I / O modules (6) connected with the power module (4) respectively, wherein, 2. Each I / O module (6) receives the TOD signal and the reference clock signal transmitted by the PTP module (5), decodes the TOD signal according to the reference clock signal through a TOD decoding module in the I / O module (6), obtains year, month, day, hour, minute and second information of the system time, and stores the same in a year register, a month register, a day register, an hour register, a minute register and a second register in the I / O module (6) respectively; 3. The I / O module (6) receives the PPS signal and the reference clock signal transmitted by the PTP module (5), synchronously counts the reference clock signal according to the time of arrival of the PPS signal, obtains information below the second of the system time, and stores the same in a time below the second register in the I / O module (6); 4. The information in the year register, the month register, the day register, the hour register, the minute register and the second register obtained in step 2, and the information in the time below the second register obtained in step 3 are merged to obtain a current system time Sys_Time, and the same is stored in a system time register in the I / O module (6); 6. Steps 1-5 are repeated to acquire the system time in real time and realize instruction synchronous output until the control of the distributed control system is completed. The power module (4) is connected with the PTP module (5) and the T I / O modules (6), and the PTP module (5) and the T I / O modules (6) through a backplane interface in a tight coupling structure. The PTP module (5) is provided with at least one network interface; The TOD decoding module of the I / O module (6) is realized by FPGA hardware. The step 2 is specifically: Step 5: Compare the system time Sys_Time in the system time register with the instruction start time On_Time in the instruction output start time register of each instruction in the preset instruction timetable. i The instruction output end time (Off_Time) in the instruction output end time register i Compare when Sys_Time ≥ On_Time i And Sys_Time≤Off_Time i When the instruction is in the correct order, the I / O module (6) outputs the corresponding instruction and then executes step 6; otherwise, it does not output the instruction and executes step 6 directly. 2. The distributed control method based on PTP protocol according to claim 1, characterized in that: 3. The distributed control method based on PTP protocol according to claim 2, characterized in that: 4. The distributed control method based on PTP protocol according to any one of claims 1-3, characterized in that, 2.1, the I / O module (6) receives the TOD signal and the reference clock signal transmitted by the PTP module (5); 2.2, the FPGA in the TOD decoding module of the I / O module (6) is set, and the TOD signal is decoded according to the reference clock signal, the high and low level signals of the TOD signal are converted into TOD byte signals, and the enable signal RX_VLD, the TOD byte signal RX_TOD and the error signal RX_ERR are output; when RX_VLD is 1 and RX_ERR is 0, the TOD byte signal RX_TOD is transmitted to the TOD decoding module to perform step 2.3; if RX_ERR is 1, an alarm is given to prompt a system error; if RX_VLD is 0, no processing is performed and the step 1 is returned; 2.3, the TOD decoding module receives the TOD byte signal RX_TOD byte by byte, takes the byte of the data as the ASIIC code "," as the segmentation point, and divides the TOD byte signal RX_TOD into multiple data frames; 2.4, whether the data frame is an RMC data frame or a ZDA data frame is judged according to the first field of the data frame; 2.5, if the data frame is an RMC data frame, the second field of the data frame is selected as time information, the data of the corresponding byte in the second field is stored into the hour register, the minute register and the second register respectively; the tenth field is taken as date information, and the data of the corresponding byte in the tenth field is stored into the year register, the month register and the day register in the I / O module (6) respectively; if the data frame is a ZDA data frame, the second field is selected as time information, the data of the corresponding byte in the second field is stored into the hour register, the minute register and the second register respectively; the third field, the fourth field and the fifth field are taken as the day, the month and the year in the date information respectively, and the data of the corresponding byte is stored into the day register, the month register and the year register in the I / O module (6) respectively; if the data frame is not an RMC data frame or a ZDA data frame, no processing is performed and the next data frame is judged in step 2.
4.
5. The distributed control method based on the PTP protocol according to claim 4, wherein the step 3 is specifically: 3.1, the I / O module (6) receives the PPS signal and the reference clock signal transmitted by the PTP module (5); 3.2, a synchronization counter is set based on the reference clock signal, and the rising edge of the PPS signal is taken as the clear 0 reset signal of the synchronization counter; 3.3, the synchronization counter is used to count the reference clock signal, and when the rising edge of the reference clock signal is detected, the value of the synchronization counter is increased by 1; when the rising edge of the PPS signal is detected, the value of the synchronization counter is 0; 3.4, the value of the synchronization counter is stored into the time register below the second in the I / O module (6) after being compensated according to the delay of the PTP module (5) outputting the PPS signal.
6. The distributed control method based on the PTP protocol according to claim 5, wherein after the TOD byte signal RX_TOD is divided into a plurality of data frames in step 2.3, the method further comprises checking the data frames, specifically comprising: checking each data frame according to byte parity during data frame transmission, if the data frame is successfully checked, then step 2.4 is performed, if the checking fails, the data frame is not processed, and the next data frame is checked. In step 2.4, the RMC data frame has the following data frame format:
7. The distributed control method based on PTP protocol according to claim 6, characterized in that, The ZDA data frame has the following data frame format: $xxRMC,UTCTime,status,lat,ulat,lon,ulon,spd,cog,date,mv,mvE,mode*CS <cr> <lf> ;< / lf> < / cr> In step 4, the current system time Sys_Time has the following structure: $xxZDA,UTCTime,day,month,year,ltzh,ltzn*CS <cr> <lf> 。< / lf> < / cr> 8. The distributed control method based on PTP protocol according to claim 7, characterized in that, YY, MM, DD, HH, MM, SS, SSS; Wherein, YY represents year, MM represents month, DD represents day, HH represents hour, MM represents minute, SS represents second, and SSS represents millisecond. In step 1, the reference clock signal is a signal of ns order.
9. The distributed control method based on PTP protocol according to claim 8, characterized in that,
Citation Information
Patent Citations
Time service device applied to aviation multi-target telemetry ground station
CN212181272U