CN109412733A - The mean filter method that EtherCAT synchronised clock is adjusted - Google Patents

The mean filter method that EtherCAT synchronised clock is adjusted Download PDF

Info

Publication number
CN109412733A
CN109412733A CN201810964337.2A CN201810964337A CN109412733A CN 109412733 A CN109412733 A CN 109412733A CN 201810964337 A CN201810964337 A CN 201810964337A CN 109412733 A CN109412733 A CN 109412733A
Authority
CN
China
Prior art keywords
slave station
transmission delay
time
delay
main website
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
CN201810964337.2A
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.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201810964337.2A priority Critical patent/CN109412733A/en
Publication of CN109412733A publication Critical patent/CN109412733A/en
Pending legal-status Critical Current

Links

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
    • 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/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The method of the present invention is related to the performance improvement of EtherCAT synchronised clock, and a transmission delay bring synchronised clock error is only calculated for conventional method, and the present invention goes out new transmission delay according to EtherCAT master-salve station Structure Calculation first;Then mean filter is carried out to all values for finishing difference in a sampling period, has obtained a transmission delay error;Transmission delay error compensation after filtering is obtained into new transmission delay to the transmission delay of upper a cycle and writes into slave station;The time control loop adjuster (TCL) of slave station will automatically adjust synchronised clock according to new transmission delay;Finally using new transmission delay as the reference value of next cycle.The method of the present invention and conventional method comparison show that synchronised clock performance can be improved in the present invention.

Description

The mean filter method that EtherCAT synchronised clock is adjusted
Technical field
The present invention relates to a kind of methods that EtherCAT synchronised clock is adjusted.
Background technique
In automation application, Industrial Ethernet is had been widely used, because they have such as high bandwidth, high transfer rate, The flexible advantages such as topological structure and multi-protocols.EtherCAT is one of the industrial network agreement based on Ethernet, EtherCAT The delay for the instruction and data that high transfer rate, the high real-time of technology enable main website to be dealt into slave station equipment reaches Microsecond grade Not.EtherCAT provides synchronization solutions using distributed clock (DC) mechanism.In this mechanism, all non-reference are from setting Standby clock is all adjusted to reference clock, reference clock be in EtherCAT network first slave equipment with DC function when Clock.However, always having tolerance that is small but can not ignore from the internal oscillator of device, this may cause reference clock and other Synchronous error between the clock of device, traditional transmission delay calculate main equipment and only calculate once, if current meter There are errors then to influence whether entire net synchronization capability below for calculation.High-precision net synchronization capability is needed in some automation control areas When, which can cause very important influence to whole system.
Summary of the invention
The present invention will overcome the disadvantages mentioned above of the prior art, provide a kind of mean filter that EtherCAT synchronised clock is adjusted Method.Mean filter processing is carried out by the multiple calculating transmission delay of main website, and to error, finally compensates back error again Transmission delay is to adjust the synchronism between slave station.
The mean filter method that EtherCAT synchronised clock of the present invention is adjusted, the specific steps are as follows:
Step1.EtherCAT data frame is always initiated by main website, is traversed all slave stations and is returned again to main website, therefore number later The receiving time port 0 that all slave stations will be first reached according to frame has traversed all slave stations and has been returned again by receiving time port 1 later Go back to main website.WithIndicate the latch time with reference to slave station receiving time port 0,It indicates with reference to slave station receiving time port 1 The time is latched,Indicate the latch time of the receiving time port 0 of n-th of non-reference slave station,Indicate n-th of non-reference from The time for the receiving time port 1 stood.Tldn(Time last delay) indicated the reference slave station and the in upper method period Transmission delay between n slave station.
Main website obtains these data and according to transmission delay calculation formula:
Calculate current transmission delay of n-th of non-reference slave station in sampled point i(Time current delay).N-th of non-reference slave station current transmission delay and the delay of a upper method periodic transfer in sampled point i are calculated again Difference
Step2. it usesIndicate the filtering delay-time of n-th of slave station i-th sampling when sampled point total number is K Error is calculated for Step1Using mean filter it can be concluded that
Step3. the filtering delay-time error calculated using Step2Calculate next method periodic system time Delay(Time next delay)。
Main website willIt is re-written to n-th of non-reference slave station system time delay register, each non-reference slave station Time Control Loop (TCL) adjuster can be delayed the automatic adjustment system time according to new system time, carry out dynamic with this Ground adjustment synchronised clock finally realizes the synchronization between slave station.Finally willIt is assigned to TldnAs next method period Transmission delay initial value.
The invention has the advantages that this method is realized in existing synchronization mechanism, without will increase excessive calculated load.
Detailed description of the invention
Fig. 1 is the flow chart of the method for the present invention;
Fig. 2 is the program flow diagram for realizing the method for the present invention;
Fig. 3 is transmission delay schematic diagram calculation;
Fig. 4 is that the clock of the method for the present invention adjusts model schematic;
Fig. 5 is synchronous error distribution map of the invention;
Fig. 6 is conventional method synchronous error distribution map.
Specific embodiment
Below in conjunction with drawings and examples, the technical scheme of the present invention will be further described.
The present invention realizes the method flow of attached drawing 1 by the IGH open source main website of Etherlab, what Etherlab company proposed IGH main website is a kind of EtherCAT main website of open source, it is integrated in above linux kernel.Overall architecture is divided into master station module, sets Standby three module, application program parts.Because main website has in bus communication many periodic tasks needs to do at the scene, and the period Property task be usually by kernel timer interruption trigger.Because do not need to consume the additional time be transformed into client layer into Journey, so the execution delay for handling Abort Timer can be shorter when main website function is when inner nuclear layer.It is based in Linux Core, which can be convenient, to be modified to primary application program code to realize method proposed by the present invention.Finally use oscilloscope measurement SYNC0 signal is verified.
Step1.IGH main website is (to be commonly used for EtherCAT using the program of IGH main website based on Linux platform Slave station recycles exchange process data).These programs are not a part of EtherCAT main website code, are write by user oneself.It answers With program main website can be requested by application programming interfaces.If it is successful, the control that it will obtain main website: it can be provided always Line configuration and exchange process data.Application program can be the kernel module that application programming interfaces are used by the library EtherCAT (directly using kernel application interface) or user space program.
Entire program circuit is as shown in Fig. 2.Increase by three first in the master structural body in main website code Datagram data message structural body is to be used to send three new data frames, including BWR (message is write in broadcast), (address FPRD Pairing is read the newspaper text), FPWR (message is write in address pairing).By IGH main website send BWR data frame to reference slave station and non-reference from The 0 register 0900h of receiving time port and 1 register 0904h of receiving time port to stand executes write access.Register will be automatic Latch the local zone time when receiving frame on each port starts (when first of lead code starts).Then main website sends FPRD Data frame reads 0 register of the port 0900h, 1 register of the port 0904h, 0928h system time delay register of each slave station Value.WithIndicate the latch time with reference to slave station receiving time port 0,Indicate the lock with reference to slave station receiving time port 1 The time is deposited,Indicate the latch time of the receiving time port 0 of n-th of non-reference slave station,Indicate n-th of non-reference slave station Receiving time port 1 time.TldnIndicate that the transmission between the reference slave station and n-th of slave station in a method period is prolonged When.
IGH main website obtains these data and as shown in Fig. 3 according to transmission delay Computing Principle:
Calculate new transmission delay of n-th of non-reference slave station in sampled point iN-th of non-reference is calculated again The slave station delay of current method periodic transfer and upper method periodic transfer delay inequality in sampled point i
Step2. the cycle of operation of this example is 1ms, and total slave station number N is 4, and sampling number K is 100, for Step1 It calculatesUsing mean filter it can be concluded that
Step3. the filtering delay-time error calculated using Step2Calculate final system time delay
The each method period (this example 100ms) of IGH main website sends FPWR data message willIt is re-written to n-th Non-reference slave station system time delay register 0928h.Therefore, the Time Control Loop (TCL) of each non-reference slave station Time regulator can be delayed when every 100ms according to new system time and adjust once.Clock adjusts model such as attached drawing 4.Finally willIt is assigned to TldnReference as next method period.
The SYNC0 signal of each slave station is measured respectively with oscillograph, and acquires 100000 samples.Commonly from The SYNC0 deviation of signal measurement distribution results for standing and referring to slave station are as shown in Fig. 5, conventional method synchronism deviation result such as attached drawing Shown in 6, wherein abscissa is error size, and ordinate is experiment number, by distribution map it can be seen that new method compares conventional method Waveform closer to zero point.The data of the two are as shown in the table:
The present invention only calculates a transmission delay there may be certain error for EtherCAT synchronization mechanism, and main website exists Multiple adjustment is carried out to transmission delay below, is influenced with reducing synchronised clock error to system bring.By with tradition side Method Comparative result, the maximum jitter of new method, minimum jitter, mean value, root mean square, steady-state error are all smaller.EtherCAT is synchronous The mean filter method that clock is adjusted more has the advantage in performance than conventional method.
Content described in this specification embodiment is only enumerating to the way of realization of inventive concept, protection of the invention Range should not be construed as being limited to the specific forms stated in the embodiments, and protection scope of the present invention is also and in art technology Personnel conceive according to the present invention it is conceivable that equivalent technologies mean.

Claims (1)

  1. The mean filter method that 1.EtherCAT synchronised clock is adjusted, includes the following steps:
    Step1.EtherCAT data frame is initiated by main website, is traversed all slave stations and is returned again to main website later, therefore data frame will The receiving time port 0 for first reaching all slave stations has traversed all slave stations and has returned to main website by receiving time port 1 again later;WithIndicate the latch time with reference to slave station receiving time port 0,Indicate the latch time with reference to slave station receiving time port 1,Indicate the latch time of the receiving time port 0 of n-th of non-reference slave station,When indicating the reception of n-th of non-reference slave station Between port 1 time;TldnIndicate the transmission delay between the reference slave station and n-th of slave station in a method period;
    Main website obtains these data and according to transmission delay calculation formula:
    Calculate new transmission delay of n-th of non-reference slave station in sampled point iN-th of non-reference slave station is calculated again The difference of current transmission delay and the delay of a upper method periodic transfer in sampled point i
    Step2. it usesIndicate that the filtering delay-time of n-th of slave station i-th sampling when sampled point total number is K misses Difference is calculated for Step1Using mean filter it can be concluded that
    Step3. the filtering delay-time error calculated using Step2Calculate next method periodic system time delays
    Main website willIt is re-written to n-th of non-reference slave station system time delay register, the TCL of each non-reference slave station Adjuster can be delayed the automatic adjustment system time according to new system time, finally be realized with this to dynamically adjust synchronised clock Synchronization between slave station;Finally willIt is assigned to TldnAs the transmission delay initial value in next method period,
CN201810964337.2A 2018-08-23 2018-08-23 The mean filter method that EtherCAT synchronised clock is adjusted Pending CN109412733A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810964337.2A CN109412733A (en) 2018-08-23 2018-08-23 The mean filter method that EtherCAT synchronised clock is adjusted

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810964337.2A CN109412733A (en) 2018-08-23 2018-08-23 The mean filter method that EtherCAT synchronised clock is adjusted

Publications (1)

Publication Number Publication Date
CN109412733A true CN109412733A (en) 2019-03-01

Family

ID=65464357

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810964337.2A Pending CN109412733A (en) 2018-08-23 2018-08-23 The mean filter method that EtherCAT synchronised clock is adjusted

Country Status (1)

Country Link
CN (1) CN109412733A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314534A (en) * 2022-07-12 2022-11-08 埃夫特智能装备股份有限公司 Real-time optimization simulation robot system based on EtherCAT communication protocol

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227246A (en) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 Method and apparatus for master-salve clock synchronization
CN102325019A (en) * 2011-08-23 2012-01-18 西安电子科技大学 Clock synchronization method of real-time industrial Ethernet EtherCAT redundant system
US20150139038A1 (en) * 2013-11-21 2015-05-21 Rockwell Automation Technologies, Inc. Automatic Network Discovery In Precision Time Protocol Networks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227246A (en) * 2008-01-28 2008-07-23 中兴通讯股份有限公司 Method and apparatus for master-salve clock synchronization
CN102325019A (en) * 2011-08-23 2012-01-18 西安电子科技大学 Clock synchronization method of real-time industrial Ethernet EtherCAT redundant system
US20150139038A1 (en) * 2013-11-21 2015-05-21 Rockwell Automation Technologies, Inc. Automatic Network Discovery In Precision Time Protocol Networks

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314534A (en) * 2022-07-12 2022-11-08 埃夫特智能装备股份有限公司 Real-time optimization simulation robot system based on EtherCAT communication protocol

Similar Documents

Publication Publication Date Title
KR100701924B1 (en) Method of operating a memory device for establishing and maintaining desired read latency in high-speed dram, and memory device and processor system for the same
CN111416617B (en) Clock synchronization method and device and electronic equipment
WO2020057303A1 (en) Network card, time synchronization method and device and computer storage medium
Park et al. Synchronization improvement of distributed clocks in EtherCAT networks
WO2021008532A1 (en) Active antenna unit delay alignment method and apparatus and active antenna unit
CN107276711B (en) EtherCAT master station device
CN106253902A (en) There is the reset of many device synchronization and identify the multi-channel parallel acquisition system of calibration function
CN103248471B (en) Clock synchronizing method based on PTP protocol Yu Reflective memory network
CN105743598A (en) Industrial Ethernet clock synchronization method and system
US20200133330A1 (en) Timestamp alignment across multiple computing nodes
CN107402534A (en) Adjusting method, EtherCAT main websites and computer-readable recording medium
DE102013222369B4 (en) A matrix phase detector
US9166773B2 (en) System timing margin improvement of high speed I/O interconnect links by using fine training of phase interpolator
CN109412733A (en) The mean filter method that EtherCAT synchronised clock is adjusted
CN109104763B (en) Synchronization signal control method and device
WO2012071977A1 (en) Method and device for time synchronisation on rack
CN104601269B (en) Master-salve clock synchronous method and system
JP2021103439A5 (en)
CN110611544A (en) Method and device for accurately timing by utilizing RS232 serial port
US11907754B2 (en) System to trigger time-dependent action
US9104364B2 (en) Generation and distribution of steered time interval pulse to a plurality of hardware components of the computing system
CN101867431A (en) Network clock synchronization method
CN105785085A (en) Merging unit detection analog source based on synchronous clock signal, and output method thereof
CN111381539B (en) Bus real-time synchronous control device
Serrano et al. White rabbit status and prospects

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190301