CN112564841A - Method for controlling equipment with different communication protocols in mode of synchronizing clocks - Google Patents

Method for controlling equipment with different communication protocols in mode of synchronizing clocks Download PDF

Info

Publication number
CN112564841A
CN112564841A CN202011423228.3A CN202011423228A CN112564841A CN 112564841 A CN112564841 A CN 112564841A CN 202011423228 A CN202011423228 A CN 202011423228A CN 112564841 A CN112564841 A CN 112564841A
Authority
CN
China
Prior art keywords
clock
real
time
operating system
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011423228.3A
Other languages
Chinese (zh)
Inventor
李寅
梁富好
潘子圆
常宏
吴方泳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruanying Technology Co ltd
Original Assignee
Shenzhen Ruanying Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ruanying Technology Co ltd filed Critical Shenzhen Ruanying Technology Co ltd
Priority to CN202011423228.3A priority Critical patent/CN112564841A/en
Publication of CN112564841A publication Critical patent/CN112564841A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation

Abstract

The invention relates to the field of motion control, in particular to a method for controlling equipment with different communication protocols in a synchronous clock mode, which comprises the following steps: the application program of the PC operating system interacts with the real-time operating system through the control channel; under the master station of the same communication engine, clock synchronization is carried out between the master station and the slave station with the function of distributing clocks through a synchronous clock generator; the master stations of different communication engines carry out clock synchronization through a synchronous clock management module, so that the master stations of all the communication engines and the corresponding slave stations have the same system time; the real-time operating system carries out communication interaction with the control equipment through a communication engine which realizes clock synchronization; the clocks of the master stations and the slave stations are synchronized, and then the clocks of the master stations with different communication protocols are synchronized, so that the master stations of all the communication engines and the corresponding slave stations have the same system time, and accurate real-time synchronous control of the control equipment at the same system time is realized.

Description

Method for controlling equipment with different communication protocols in mode of synchronizing clocks
Technical Field
The invention relates to the field of motion control, in particular to a method for controlling equipment with different communication protocols in a synchronous clock mode.
Background
Clock synchronization is an important index for transmission system design, and provides correct clock information for each device in the system, thereby improving the transmission quality and efficiency of the system. With the continuous development of industrial real-time ethernet technology, the clock synchronization problem of the IP-based asynchronous communication network becomes an urgent problem to be solved, the next generation transport network will integrate a large amount of ethernet technologies, and how to perform clock synchronization on the asynchronous data network becomes a major problem at present.
In the field of motion control, especially in the scenes of intelligent device and intelligent robot control, the quality and efficiency of system transmission are an important part, and in the prior art, devices under different communication protocols are controlled in a common gateway mode, but the control mode in this mode has many problems, such as troublesome operation, complex steps for configuring the gateway, too large transmission delay between different communication protocols, inability to guarantee accurate synchronous control, and extra hardware cost required during configuration.
Disclosure of Invention
Aiming at the defects in the technology, the invention provides a method for controlling equipment with different communication protocols in a clock synchronization mode, which ensures the clock synchronization between a master station and a slave station by synchronizing the clocks of an upper computer and control equipment before executing software control, thereby realizing accurate real-time synchronous control on the control equipment.
In order to achieve the above object, the present invention provides a method for controlling devices with different communication protocols by synchronizing clocks, comprising the following steps:
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 equipment carry out clock synchronization through a synchronous clock generator;
the master stations of different communication engines carry out clock synchronization through a synchronous clock management module of a real-time operating system, so that the master stations of all different communication engines and the slave stations under different corresponding control devices have the same system time;
and the real-time operating system is in communication interaction with the control equipment through the communication engine which realizes clock synchronization.
Specifically, the method comprises the following steps: in the step of performing clock synchronization between the master station under the same communication engine in the real-time operating system and the slave station in the control device through the synchronous clock generator, the first slave station with a distributed clock function connected with the master station under the same communication engine is used as a reference clock, and clocks of other slave stations and the master station are synchronized by the reference clock.
Specifically, the method comprises the following steps: the method comprises the following steps that clock synchronization is carried out between the master stations of different communication engines through a synchronous clock management module of a real-time operating system, so that the master stations of all different communication engines and the slave stations corresponding to the master stations under different control devices have the same system time.
Specifically, the method comprises the following steps: the calculated reference clock and clock offset are stored in the synchronous clock management module.
Preferably, the method comprises the following steps: in the step of synchronizing clocks among the master stations of different communication engines through a synchronous clock management module of a real-time operating system, so that the master stations of all different communication engines and the slave stations corresponding to the master stations under different control devices have the same system time, the synchronous clock management module selects a reference clock of one communication engine as a reference clock, calculates clock adjustment offset of each communication engine according to the difference value of the reference clock and the reference clocks of the other communication engines, and compensates the clock adjustment offset into the clock offset of each communication engine so as to enable the communication engines of different communication protocols to be synchronized in one system time.
Preferably, the method comprises the following steps: the real-time operating system uses at least two master stations with different communication engines, and each master station is connected with at least one slave station.
Preferably, the method comprises the following steps: the slave station and the master station connected with the slave station use the same communication protocol.
Specifically, the method comprises the following steps: before the step of the application program of the PC operating system interacting with the real-time operating system through the control channel, the method also comprises a step of allocating a special core and a special memory for the real-time operating system from a multi-core CPU and a memory of the PC operating system.
Preferably, the method comprises the following steps: in the step of the interaction between the application program of the PC operating system and the real-time operating system through the control channel, the real-time operating system is divided into a circulating processing part and a non-circulating processing part, the PC operating system preferentially interacts with the non-circulating processing part of the real-time operating system, and then interacts with the circulating processing part.
Preferably, the method comprises the following steps: in the step of interacting with the loop processing part, the loop processing part is interacted by means of a creation engine.
The invention has the beneficial effects that: compared with the prior art, the invention provides a method for controlling equipment with different communication protocols in a clock synchronization mode, which comprises the following steps: under the master station of the same communication engine, clock synchronization is carried out between the master station and the slave station with the function of distributing clocks through a synchronous clock generator; the master stations of different communication engines carry out clock synchronization through a synchronous clock management module, so that the master stations of all the communication engines and the corresponding slave stations have the same system time; the application program of the PC operating system interacts with the real-time operating system through the control channel; the real-time operating system carries out communication interaction with the control equipment through a communication engine which realizes clock synchronization; the clocks between the master stations and the slave stations are synchronized through the synchronous clock generator, and then the clocks between the master stations with different communication protocols are synchronized through the synchronous clock management module, so that the master stations of all communication engines and the corresponding slave stations have the same system time, and accurate real-time synchronous control of the control equipment at the same system time is realized.
Drawings
FIG. 1 is a schematic diagram of the operation of a synchronous clock management module of the present invention;
FIG. 2 is a schematic diagram of the operation of the present invention;
FIG. 3 is a flow chart of the steps of the present invention.
Detailed Description
In order to more clearly describe the present invention, the present invention will be further described with reference to the accompanying drawings.
In the field of motion control, especially in the scenes of intelligent device and intelligent robot control, the quality and efficiency of system transmission are an important part, and in the prior art, devices under different communication protocols are controlled in a common gateway mode, but the control mode in this mode has many problems, such as troublesome operation, complex steps for configuring the gateway, too large transmission delay between different communication protocols, inability to guarantee accurate synchronous control, and extra hardware cost required during configuration.
In view of the shortcomings and drawbacks of the prior art, the present application provides a method for controlling devices with different communication protocols by synchronizing clocks, referring to fig. 1-3, the method includes the following steps:
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 equipment carry out clock synchronization through a synchronous clock generator;
the master stations of different communication engines carry out clock synchronization through a synchronous clock management module of a real-time operating system, so that the master stations of all different communication engines and the slave stations under different corresponding control devices have the same system time;
the real-time operating system carries out communication interaction with the control equipment through a communication engine which realizes clock synchronization; in the prior art, because drivers and IO modules used by control equipment are different, the upper computer often controls the control equipment not through the same communication protocol; in the process of information transmission, the communication engine of each control device is asynchronous with the system time of the master station, so that a certain difference on system clocks exists; compensating the offset corresponding to each communication engine into each engine, wherein the offset can be positive or negative, so as to ensure that the clock of each communication engine is synchronous with the reference clock, and thus, the real-time synchronous control of a plurality of control devices can be realized when the upper computer controls the control devices; meanwhile, different slave stations with the same communication protocol connected with the master station of the same communication engine realize clock synchronization with the master station through a synchronous clock generator, so that all system clocks from the master station to the slave stations are ensured to be synchronous, and an application program based on the PC operating system interacts with a real-time operating system through a control channel; the real-time operating system is communicated and interacted with the control equipment through the communication engine which realizes clock synchronization, and real-time synchronous control of the control equipment can be guaranteed.
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 slave stations in control equipment through a synchronous clock generator, taking a first slave station with a distributed clock function connected with the master station under the same communication engine as a reference clock, and synchronizing clocks of other slave stations and the master station through the reference clock; when the network ports are connected, a plurality of different slave stations with the same communication protocol and corresponding control equipment are accessed to the master station, the first accessed slave station is used as a reference clock, and the slave stations accessed subsequently and the master station can compensate clock adjustment offset by using the clock of the first accessed slave station as the reference clock, so that the master station and the slave station under the same communication engine have the same system time.
In the present embodiment, mention is made of: the method comprises the steps that clock synchronization is carried out between master stations of different communication engines through a synchronous clock management module, so that the master stations of all the communication engines and the corresponding slave stations have the same system time; because the received message information is more, the message needs to be analyzed to obtain the required clock data, and meanwhile, preparation is made for subsequent clock synchronization, so that the reference clock and the clock offset are measured and calculated in advance.
In this embodiment: the calculated reference clock and clock skew are stored in the synchronous clock management module; the synchronous clock management module manages and stores reference clocks and clock offsets of different master stations, and is mainly used for calculating difference values between the reference clocks and clock adjustment offsets.
In a preferred embodiment mention is made of: in the step of synchronizing clocks among the master stations of different communication engines through a synchronous clock management module to enable the master stations of all the communication engines and the corresponding slave stations thereof to have the same system time, the synchronous clock management module selects a reference clock of one communication engine as a reference clock, calculates clock adjustment offset of each communication engine according to the difference value of the reference clock and the reference clocks of the other communication engines, compensates the clock adjustment offset into the clock offset of each communication engine, and enables the communication engines of different communication protocols to be synchronous with one system time; the method comprises the steps of analyzing a message sent by a communication engine to a master station to obtain a reference clock, calculating to obtain clock skew according to the obtained reference clock, so that the clock skew of each reference clock can be obtained firstly, then one of the reference clocks is selected as a reference clock, the reference clock is taken as a reference, the difference value between each other reference clock and the reference clock is calculated, and the required clock adjustment offset when the other clocks are synchronized to be uniform with the reference clock is calculated; and compensating the offset corresponding to each communication engine into each engine, wherein the offset can be positive or negative, so that the synchronization of the clock of each communication engine and a reference clock is ensured, and the real-time synchronous control of a plurality of control devices can be realized when the upper computer controls the control devices.
An example of a specific implementation is mentioned: for example, two network ports of a PC are connected with a driver and an IO module which respectively use two communication protocols of EtherCAT and CC-Link IE TSN, wherein the EtherCAT communication protocol controls an intelligent automation device, the CC-Link IE TSN controls an industrial robot, a clock distribution mechanism can ensure that a master station and a slave station under respective communication engines are synchronous with a system time, a synchronous clock management module can measure and calculate the reference clock and clock offset of the respective communication engines, the CC-Link IE TSN communication engine is taken as a reference, the difference value of the reference clock and the reference clock of the EtherCAT communication engine is calculated, the obtained clock adjustment offset is compensated into the clock offset of the EtherCAT communication engine, so that the CC-Link IE TSN and the EtherCAT communication engine are synchronous with the system time, therefore, accurate action synchronization and coordination can be realized between the intelligent automation equipment and the industrial robot.
In a preferred embodiment, mention is made of: the real-time operating system at least uses more than two main stations with different communication engines, and each main station is connected with at least one slave station; because the purpose of this application lies in realizing the synchronous clock control of the master station of host computer to the controlgear of the slave station that has different communication protocols, so only under the circumstances of a plurality of communication engines, can realize the clock synchronization of multiple communication engines, set up the equipment that the host computer can support different protocols like this, driver and IO module that every net gape is connected will be the same with the communication protocol of this net gape, just so can ensure that the communication is gone on successfully.
In a preferred embodiment, mention is made of: before the step of the application program of the PC operating system interacting with the real-time operating system through the control channel, the method also comprises a step of allocating a special core and a special memory for executing real-time control from a multi-core CPU and a memory of the PC operating system; because the adopted upper computer is a PC end, when the software runs, the high efficiency of the software in the running process can be ensured by independent CPU inner core distribution and memory distribution without being interfered by other application programs of the PC end, and meanwhile, the stability of the execution process is also ensured without redundant hardware cost.
In this embodiment: in the step of interaction between an application program of a PC operating system and the real-time operating system through a control channel, the real-time operating system is divided into a circulating processing part and a non-circulating processing part, the PC operating system preferentially interacts with the non-circulating processing part of the real-time operating system, and then interacts with the circulating processing part; in the step of interacting with the circular processing part, interacting with the circular processing part by means of creating an engine; the GMC application program, the robot application program, the PLC application program, the setting application program and the custom DLL application program are adopted, when the function libraries of the application programs are interacted with the real-time operation end through the control channel, the function libraries are firstly interacted with the non-cyclic processing part of the real-time operation end, and then are interacted with the cyclic processing part in an engine creating mode, the real-time operation system is characterized in that tasks can be completed within specific time, and tasks of issuing instructions of a host computer and obtaining feedback information of control equipment, namely real-time control, can be guaranteed to be completed within the time of one communication period.
The invention has the advantages that:
1. under the condition that the same PC end is used as an upper computer, various communication protocols can be operated. The equipment with different communication protocols can run in the same system and realize accurate synchronous control.
2. The communication engine of the master station of the upper computer and the slave station of the control equipment are used for clock synchronization, so that the master stations of different communication engines and the slave stations under the master station of the same communication engine can have the same system time, and different control equipment can realize accurate synchronous control.
3. A CPU inner core and a special memory of the PC end are independently distributed to the real-time control system, so that the high efficiency of software in operation is ensured, unnecessary hardware cost is not needed, and the stability of the execution process is also ensured.
The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.

Claims (10)

1. A method for controlling devices with different communication protocols in a mode of synchronizing clocks is characterized by comprising the following steps:
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 equipment carry out clock synchronization through a synchronous clock generator;
the master stations of different communication engines carry out clock synchronization through a synchronous clock management module of a real-time operating system, so that the master stations of all different communication engines and the slave stations under different corresponding control devices have the same system time;
and the real-time operating system is in communication interaction with the control equipment through the communication engine which realizes clock synchronization.
2. The method of claim 1, wherein in the step of synchronizing clocks between the master under the same communication engine and the slave in the control device through the synchronous clock generator in the real-time operating system, the clock of the other slave and the master is synchronized with the reference clock by using the first slave with distributed clock function connected to the master under the same communication engine as the reference clock.
3. The method of claim 1, wherein the synchronization of clocks between the masters of different communication engines is performed by a synchronous clock management module of a real-time operating system, so that all masters of different communication engines and their corresponding slaves under different control devices have the same system time.
4. The method of claim 3, wherein the calculated reference clock and clock offset are stored in a synchronous clock management module.
5. The method of claim 1, wherein in the step of synchronizing clocks among masters of different communication engines by using a synchronous clock management module of a real-time operating system so that the masters of all different communication engines and their corresponding slaves under different control devices have the same system time, the synchronous clock management module selects a reference clock of one of the communication engines as a reference clock, calculates clock adjustment offsets of the respective communication engines according to differences between the reference clock and the reference clocks of the other respective communication engines, and compensates the clock adjustment offsets into clock offsets of the respective communication engines so that the communication engines of different communication protocols are synchronized at the same system time.
6. The method of claim 1, wherein the real-time operating system uses at least two masters with different communication engines, each master being connected to at least one slave.
7. The method of claim 6, wherein the slave station and the master station connected thereto use the same communication protocol.
8. The method of claim 1, further comprising a step of allocating a dedicated core and a dedicated memory to the multi-core CPU and the memory of the PC os for the real-time os, before the step of interacting the application program of the PC os with the real-time os through the control channel.
9. The method of claim 1, wherein in the step of the application program of the PC OS interacting with the real-time OS via the control channel, the real-time OS is divided into a cyclic processing part and a non-cyclic processing part, and the PC OS preferentially interacts with the non-cyclic processing part of the real-time OS and then interacts with the cyclic processing part.
10. The method of claim 9, wherein the step of interacting with the loop processing part comprises interacting with the loop processing part by means of creating an engine.
CN202011423228.3A 2020-12-08 2020-12-08 Method for controlling equipment with different communication protocols in mode of synchronizing clocks Pending CN112564841A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011423228.3A CN112564841A (en) 2020-12-08 2020-12-08 Method for controlling equipment with different communication protocols in mode of synchronizing clocks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011423228.3A CN112564841A (en) 2020-12-08 2020-12-08 Method for controlling equipment with different communication protocols in mode of synchronizing clocks

Publications (1)

Publication Number Publication Date
CN112564841A true CN112564841A (en) 2021-03-26

Family

ID=75059642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011423228.3A Pending CN112564841A (en) 2020-12-08 2020-12-08 Method for controlling equipment with different communication protocols in mode of synchronizing clocks

Country Status (1)

Country Link
CN (1) CN112564841A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114071790A (en) * 2021-12-16 2022-02-18 中国联合网络通信集团有限公司 Communication method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107959564A (en) * 2016-10-14 2018-04-24 欧姆龙株式会社 Control device and communicator
CN111478834A (en) * 2020-03-25 2020-07-31 武汉迈信电气技术有限公司 EtherCAT master station synchronization method based on non-real-time system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107959564A (en) * 2016-10-14 2018-04-24 欧姆龙株式会社 Control device and communicator
CN111478834A (en) * 2020-03-25 2020-07-31 武汉迈信电气技术有限公司 EtherCAT master station synchronization method based on non-real-time system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114071790A (en) * 2021-12-16 2022-02-18 中国联合网络通信集团有限公司 Communication method, device, equipment and storage medium
CN114071790B (en) * 2021-12-16 2023-05-12 中国联合网络通信集团有限公司 Communication method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US7904184B2 (en) Motion control timing models
US7983769B2 (en) Time stamped motion control network protocol that enables balanced single cycle timing and utilization of dynamic data structures
CN105763641B (en) A kind of quick clock synchronous method of EtherCAT main website control system
EP3691192B1 (en) Control system and control device
CN106603367A (en) CAN bus communication method for time synchronization
US20220413474A1 (en) Control system
CN111272127B (en) Method for measuring and controlling synchronization through EtherCAT bus
CN107276711A (en) EtherCAT master station devices
CN107276709B (en) A kind of method for synchronizing time and system
US9081371B2 (en) Method for synchronizing an operating clock with a time clock of an automation network
Lesi et al. Towards plug-n-play numerical control for reconfigurable manufacturing systems
JP2004523972A (en) Application of switchable data networks for real-time and non-real-time communications
US20130013952A1 (en) Method for Integration of Systems with Only One Sync Domain for Time of Day and Clock Pulse Synchronization into a Global Time of Day Synchronization Domain
CN112564841A (en) Method for controlling equipment with different communication protocols in mode of synchronizing clocks
CN108199822B (en) Bus synchronization method and device of EtherCAT-NCUC
Wang et al. A low-latency and interoperable industrial internet of things architecture for manufacturing systems
WO2020054477A1 (en) Control system and control device
CN113225768B (en) 4G/5G transmission network synchronization method
WO2022185589A1 (en) Information processing device, method, and program
CN105743758A (en) Communication method
US20220278871A1 (en) Method, system, and gateway for linking time-sensitive fieldbuses
CN115755810A (en) Distributed control device based on cooperative control
CN210181471U (en) Time division multiplexing multi-axis motion control structure
CN103326637B (en) A kind of Multi-motor control method based on CAN
Huang et al. Design of electronic shaft synchronization control system based on EtherCAT bus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination