Method for controlling devices with different communication protocols by means of synchronous clock

By using the synchronous clock generator and management module in the real-time operating system, clock synchronization between the master and slave stations is achieved, and the problems of complex operation, large delay and difficult synchronization of controlling devices in different communication protocols in the prior art are solved. , achieving accurate real-time synchronous control and efficiency improvement.

CN112564841BActive Publication Date: 2025-02-18深圳市软赢科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011423228.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-08
Publication Date
2025-02-18
Estimated Expiration
2040-12-08

AI Technical Summary

Technical Problem

In the prior art, devices that control different communication protocols have problems such as operational troubles, complex configuration, large transmission delay, and inability to ensure precise synchronization control, and additional hardware costs are required.

Method used

By using the synchronous clock generator and the synchronous clock management module in the real-time operating system, clock synchronization between the master and slave station is achieved, ensuring that the master stations of different communication engines and their corresponding slaves have the same system time, thereby realizing that the Accurate real-time synchronous control of control equipment.

Benefits of technology

Accurate real-time synchronous control of equipment with different communication protocols is realized, which simplifies operation and configuration processes, reduces hardware costs, and improves the quality and efficiency of system transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112564841B_ABST
    Figure CN112564841B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of motion control, and in particular to a method for controlling devices with different communication protocols by means of synchronous clocks, comprising the following steps: an application program of a PC operating system interacts with a real-time operating system through a control channel; under a master station of the same communication engine, clock synchronization is performed between the master station and a slave station with a distributed clock function through a synchronous clock generator; clock synchronization is performed between master stations of different communication engines through a synchronous clock management module, so that the master stations of all communication engines and their corresponding slave stations have the same system time; the real-time operating system communicates and interacts with a control device through a communication engine that has achieved clock synchronization; by synchronizing the clocks between the master station and the slave station, and then synchronizing the clocks between master stations of different communication protocols, the master stations of all communication engines and their corresponding slave stations have the same system time, thereby achieving precise real-time synchronous control of control devices under the same system time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of motion control, and in particular to a method for controlling devices with different communication protocols by means of synchronous clocks. Background Art

[0002] Clock synchronization is an important indicator in the design of transmission systems. It provides correct clock information for each device in the system and improves the transmission quality and efficiency of the system. With the continuous development of industrial real-time Ethernet technology, the clock synchronization problem of IP-based asynchronous communication networks will become an urgent problem to be solved. The next generation transmission network will integrate a large number of Ethernet technologies. How to synchronize the clock of asynchronous data networks has become the main problem at present.

[0003] In the field of motion control, especially in the scenarios of smart device and smart robot control, the quality and efficiency of system transmission are particularly important. In the existing technology, gateways are often used to control devices under different communication protocols. However, this form of control has many problems, such as cumbersome operation and complicated steps to configure the gateway. At the same time, the transmission delay between different communication protocols is too large, and precise synchronous control cannot be guaranteed. In addition, additional hardware costs are required during configuration. Summary of the invention

[0004] In view of the shortcomings of the above-mentioned technology, the present invention provides a method for controlling devices with different communication protocols by means of synchronous clocks. By synchronizing the clocks of the host computer and the control device before executing software control, the clock synchronization between the master station and the slave station is ensured, thereby realizing accurate real-time synchronous control of the control device.

[0005] To achieve the above object, the present invention provides a method for controlling devices of different communication protocols by means of clock synchronization, comprising the following steps:

[0006] The application program of the PC operating system interacts with the real-time operating system through the control channel;

[0007] The master station under the same communication engine in the real-time operating system and the slave station in the control device are synchronized by the synchronous clock generator;

[0008] The master stations of different communication engines are synchronized through the synchronous clock management module of the real-time operating system, so that all the master stations of different communication engines and their corresponding slave stations under different control devices have the same system time;

[0009] The real-time operating system communicates and interacts with the control device through a communication engine that has achieved clock synchronization.

[0010] Specifically: in the step of performing clock synchronization between a master station under the same communication engine in a real-time operating system and a slave station in a control device through a synchronous clock generator, the first slave station with a distributed clock function connected to the master station under the same communication engine is used as a reference clock, and the reference clock is used to synchronize the clocks of other slave stations and the master station.

[0011] Specifically: before the step of performing clock synchronization between master stations of different communication engines through the synchronous clock management module of the real-time operating system so that all master stations of different communication engines and their corresponding slave stations under different control devices have the same system time, there is also a step in which the master stations of different communication protocols receive and parse the corresponding data messages, measure and calculate the reference clock and clock offset.

[0012] Specifically: The calculated reference clock and clock offset are stored in the synchronous clock management module.

[0013] Preferably: in the step of performing clock synchronization between master stations of different communication engines through the synchronous clock management module of the real-time operating system so that the master stations of all different communication engines and their corresponding slave stations under different control devices have the same system time, the synchronous clock management module selects the reference clock of one of the communication engines as the base reference clock, calculates the clock adjustment offset of each communication engine based on the difference between the base reference clock and the reference clocks of the remaining communication engines, compensates the clock adjustment offset into the clock offset of each communication engine, and synchronizes the communication engines of different communication protocols with one system time.

[0014] Preferably, the real-time operating system uses at least two master stations with different communication engines, and each master station is connected to at least one slave station.

[0015] Preferably, the slave station and the master station connected thereto use the same communication protocol.

[0016] Specifically: before the step of the application program of the PC operating system interacting with the real-time operating system through the control channel, a step is also included to allocate a dedicated core and dedicated memory from the multi-core CPU and memory of the PC operating system for the real-time operating system.

[0017] Preferably, in the step where the application of the PC operating system interacts with the real-time operating system through a control channel, the real-time operating system is divided into a cyclic processing part and a non-cyclic processing part, and the PC operating system interacts with the non-cyclic processing part of the real-time operating system first, and then interacts with the cyclic processing part.

[0018] Preferably, in the step of interacting with the loop processing part, the interaction with the loop processing part is performed by creating an engine.

[0019] The beneficial effects of the present invention are as follows: compared with the prior art, the present invention provides a method for controlling devices with different communication protocols by means of a synchronous clock, comprising the following steps: under a master station of the same communication engine, clock synchronization is performed between the master station and a slave station with a distributed clock function through a synchronous clock generator; clock synchronization is performed between master stations of different communication engines through a synchronous clock management module, so that the master stations of all communication engines and their corresponding slave stations have the same system time; the application of the PC operating system interacts with the real-time operating system through a control channel; the real-time operating system communicates and interacts with the control device through the communication engine that has achieved clock synchronization; the clocks between the master station and the slave station are synchronized through a synchronous clock generator, and then the clocks between the master stations of different communication protocols are synchronized through a synchronous clock management module, so that the master stations of all communication engines and their corresponding slave stations have the same system time, thereby achieving precise real-time synchronous control of the control devices under the same system time. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a working principle diagram of the synchronous clock management module of the present invention;

[0021] Figure 2 It is a working principle diagram of the present invention;

[0022] Figure 3 It is a flow chart of the steps of the present invention. DETAILED DESCRIPTION

[0023] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with the accompanying drawings.

[0024] In the field of motion control, especially in the scenarios of smart device and smart robot control, the quality and efficiency of system transmission are particularly important. In the existing technology, gateways are often used to control devices under different communication protocols. However, this form of control has many problems, such as cumbersome operation and complicated steps to configure the gateway. At the same time, the transmission delay between different communication protocols is too large, and precise synchronous control cannot be guaranteed. In addition, additional hardware costs are required during configuration.

[0025] In view of the shortcomings and defects of the prior art, the present application provides a method for controlling devices with different communication protocols by means of synchronous clocks. Figure 1-3 , the method comprises the following steps:

[0026] The application program of the PC operating system interacts with the real-time operating system through the control channel;

[0027] The master station under the same communication engine in the real-time operating system and the slave station in the control device are synchronized by the synchronous clock generator;

[0028] The master stations of different communication engines are synchronized through the synchronous clock management module of the real-time operating system, so that all the master stations of different communication engines and their corresponding slave stations under different control devices have the same system time;

[0029] The real-time operating system communicates and interacts with the control device through a communication engine that has achieved clock synchronization. In the prior art, since the control devices use different drivers and IO modules, the host computer often does not control the control devices through the same communication protocol. Therefore, when performing communication transmission, the transmission delay is relatively large, and accurate synchronous control between different control devices cannot be guaranteed. In the process of information transmission, the communication engines of each control device are not synchronized with the system time of the main station, so there are certain differences in the system clocks. The present application obtains a reference clock by analyzing the message sent by the communication engine to the main station, and then obtains the clock offset by calculation based on the obtained reference clock. In this way, the clock offset between each reference clock can be obtained first, and then one of the reference clocks is selected as the base reference clock. Based on the base reference clock, the other reference clocks are calculated relative to the base reference clock. The difference between the clocks is calculated, and the clock adjustment offset required for the remaining clocks to be synchronized to the benchmark reference clock is calculated; the offset corresponding to each communication engine is then compensated into each engine, and the offset may be positive or negative, so as to ensure that the clock of each communication engine is synchronized with the benchmark reference clock. In this way, when the upper computer controls the control device, real-time synchronous control of multiple control devices can be achieved; at the same time, different slave stations with the same communication protocol connected to the master station of the same communication engine are synchronized with the master station through a synchronous clock generator, ensuring that all system clocks from the master station to the slave station are synchronized. The application based on this PC operating system interacts with the real-time operating system through a control channel; the real-time operating system communicates and interacts with the control device through the communication engine that has achieved clock synchronization, which can ensure real-time synchronous control of the control device.

[0030] In this embodiment: in the step of performing clock synchronization between a master station under the same communication engine in a real-time operating system and a slave station in a control device through a synchronous clock generator, the first slave station with a distributed clock function connected to the master station under the same communication engine is used as a reference clock, and the clocks of other slave stations and the master station are synchronized with the reference clock; because when connecting the network port, there will be multiple different slave stations with the same communication protocol and corresponding control devices connected to the master station, the first connected slave station is used as the reference clock, which enables the subsequently connected slave stations and the master station to use the clock of the first connected slave station as the reference clock to compensate for the clock adjustment offset, so that the master station and the slave station under the same communication engine have the same system time.

[0031] In this embodiment, it is mentioned that: clock synchronization is performed between the master stations of different communication engines through the synchronous clock management module so that the master stations of all communication engines and their corresponding slave stations have the same system time. There is also a step before that, in which the master stations of different communication protocols receive and parse the corresponding data messages, measure and calculate the reference clock and clock offset; since the received message information is large, it is necessary to parse the message to obtain the required clock data, and in order to prepare for the subsequent clock synchronization, the reference clock and clock offset are measured and calculated in advance.

[0032] In this embodiment: the calculated reference clock and clock offset are stored in the synchronous clock management module; the synchronous clock management module manages and stores the reference clocks and clock offsets of different master stations, and is mainly used to calculate the difference between the reference clocks and the clock adjustment offset.

[0033] In a preferred embodiment, it is mentioned that: in the step of performing clock synchronization between the master stations of different communication engines through a synchronous clock management module so that the master stations of all communication engines and their corresponding slave stations have the same system time, the synchronous clock management module selects the reference clock of one of the communication engines as the base reference clock, calculates the clock adjustment offset of each communication engine according to the difference between the base reference clock and the reference clocks of the remaining communication engines, and compensates the clock adjustment offset into the clock offset of each communication engine, so that the communication engines of different communication protocols are synchronized with one system time; the present application obtains the reference clock by analyzing the message sent by the communication engine to the master station, and then obtains the reference clock according to the obtained The obtained reference clock obtains the clock offset through calculation, so that the clock offset of each reference clock can be obtained first, and then one of the reference clocks is selected as the base reference clock. Taking the base reference clock as the base, the difference between other reference clocks and the base reference clock is calculated, and the clock adjustment offset required for the remaining clocks to be synchronized with the base reference clock is calculated; then the offset corresponding to each communication engine is compensated into each engine, and the offset may be positive or negative, so as to ensure that the clock of each communication engine is synchronized with the base reference clock, so as to ensure that when the upper computer controls the control device, real-time synchronous control of multiple control devices can be achieved.

[0034] A specific implementation example mentions: for example, the two network ports of a PC are connected to drivers and IO modules that use EtherCAT and CC-Link IE TSN communication protocols respectively. The EtherCAT communication protocol controls an intelligent automation device, and the CC-Link IE TSN controls an industrial robot. The distributed clock mechanism can ensure that the master station and the slave station under each communication engine are synchronized with a system time. The reference clock and clock offset of each communication engine can be measured and calculated through the synchronous clock management module. The difference between the reference reference clock and the reference clock of the EtherCAT communication engine is calculated based on the CC-Link IE TSN communication engine to obtain the clock adjustment offset. The clock adjustment offset is then compensated into the clock offset of the EtherCAT communication engine, so that the CC-Link IE TSN and EtherCAT communication engines are synchronized with a system time, thereby enabling precise action synchronization and coordination between intelligent automation equipment and industrial robots.

[0035] In a preferred embodiment, it is mentioned that: the real-time operating system uses at least two or more master stations with different communication engines, and each master station is connected to at least one slave station; since the purpose of this application is to realize the synchronous clock control of the control equipment of the slave stations with different communication protocols by the master station of the host computer, the clock synchronization of multiple communication engines can only be realized in the case of multiple communication engines. In this way, the host computer can support devices with different protocols, and the driver and IO module connected to each network port must be the same as the communication protocol of the network port, so as to ensure successful communication.

[0036] In a preferred embodiment, it is mentioned that before the step of the application of the PC operating system interacting with the real-time operating system through the control channel, there is also a step of allocating a dedicated core and dedicated memory from the multi-core CPU and memory of the PC operating system for executing real-time control; since the upper computer used is the PC end, during operation, the separate CPU core allocation and memory allocation can ensure the high efficiency of the software during operation, without being interfered by other applications on the PC end, and at the same time, no unnecessary hardware cost is required, and the stability of the execution process is also guaranteed.

[0037] In this embodiment: in the step of the application of the PC operating system interacting with the real-time operating system through the control channel, the real-time operating system is divided into a cyclic processing part and a non-cyclic processing part. The PC operating system interacts with the non-cyclic processing part of the real-time operating system first, and then interacts with the cyclic processing part; in the step of interacting with the cyclic processing part, the cyclic processing part is interacted with by creating an engine; when the function libraries of the GMC application, robot application, PLC application, setting application and custom DLL application interact with the real-time operation terminal through the control channel, they first interact with the non-cyclic processing part of the real-time operation terminal, and then interact with the cyclic processing part by creating an engine. The characteristic of the real-time operating system is that it can complete the task within a specific time, and can ensure that the tasks of issuing host computer instructions and obtaining feedback information from the control device are completed within one communication cycle, that is, real-time control.

[0038] The advantages of the present invention are:

[0039] 1. With the same PC as the host computer, multiple communication protocols can be run. Devices with different communication protocols can run in the same system and achieve precise synchronous control.

[0040] 2. The clock of the control device slave is synchronized through the communication engine of the master station of the host computer, ensuring that the master stations of different communication engines and the slave stations under the master station of the same communication engine have the same system time, and different control devices can achieve precise synchronous control.

[0041] 3. Allocate a CPU core and dedicated memory on the PC side to the real-time control system separately to ensure the efficiency of the software during runtime, without requiring extra hardware costs, and also ensure the stability of the execution process.

[0042] The above disclosures are only several specific embodiments of the present invention, but the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. A method for controlling devices with different communication protocols by means of clock synchronization, characterized in that: The following steps are involved: The application program of the PC operating system interacts with the real-time operating system through the control channel; The master station under the same communication engine in the real-time operating system and the slave station in the control device are synchronized by the synchronous clock generator; The master stations of different communication engines are synchronized through the synchronous clock management module of the real-time operating system, so that all the master stations of different communication engines and their corresponding slave stations under different control devices have the same system time; The real-time operating system communicates and interacts with the control device through a communication engine that has achieved clock synchronization; Before the step of performing clock synchronization between master stations of different communication engines through a synchronous clock management module of a real-time operating system so that all master stations of different communication engines and their corresponding slave stations under different control devices have the same system time, there is also a step in which master stations of different communication protocols receive and parse corresponding data messages, measure and calculate reference clocks and clock offsets; The calculated reference clock and clock offset are stored in the synchronous clock management module; In the step of performing clock synchronization between master stations of different communication engines through the synchronous clock management module of the real-time operating system so that the master stations of all different communication engines and their corresponding slave stations under different control devices have the same system time, the synchronous clock management module selects the reference clock of one of the communication engines as the base reference clock, calculates the clock adjustment offset of each communication engine based on the difference between the base reference clock and the reference clocks of the remaining communication engines, and compensates the clock adjustment offset into the clock offset of each communication engine, so that the communication engines of different communication protocols are synchronized with one system time.

2. The method for controlling devices with different communication protocols by means of clock synchronization according to claim 1, characterized in that: In the step of performing clock synchronization between a master station under the same communication engine in a real-time operating system and a slave station in a control device through a synchronous clock generator, the first slave station with a distributed clock function connected to the master station under the same communication engine is used as a reference clock, and the reference clock is used to synchronize the clocks of other slave stations and the master station.

3. The method for controlling devices with different communication protocols by means of clock synchronization according to claim 1, characterized in that: The real-time operating system uses at least two or more master stations with different communication engines, and each master station is connected to at least one slave station.

4. The method for controlling devices with different communication protocols by means of clock synchronization according to claim 3, characterized in that: The slave station and the master station connected thereto use the same communication protocol.

5. The method for controlling devices with different communication protocols by means of clock synchronization according to claim 1, characterized in that: Before the step of the application of the PC operating system interacting with the real-time operating system through the control channel, there is also a step of allocating a dedicated core and dedicated memory from the multi-core CPU and memory of the PC operating system for the real-time operating system.

6. The method for controlling devices with different communication protocols by means of clock synchronization according to claim 1, characterized in that: In the step where the application of the PC operating system interacts with the real-time operating system through a control channel, the real-time operating system is divided into a cyclic processing part and a non-cyclic processing part. The PC operating system interacts with the non-cyclic processing part of the real-time operating system first, and then interacts with the cyclic processing part.

Citation Information

Patent Citations

  • Control device and communication device

    CN107959564A