KR20170135384A - Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method - Google Patents

Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method Download PDF

Info

Publication number
KR20170135384A
KR20170135384A KR1020160067212A KR20160067212A KR20170135384A KR 20170135384 A KR20170135384 A KR 20170135384A KR 1020160067212 A KR1020160067212 A KR 1020160067212A KR 20160067212 A KR20160067212 A KR 20160067212A KR 20170135384 A KR20170135384 A KR 20170135384A
Authority
KR
South Korea
Prior art keywords
slave device
delay time
propagation delay
calculated
moving average
Prior art date
Application number
KR1020160067212A
Other languages
Korean (ko)
Inventor
성민영
김웅기
Original Assignee
서울시립대학교 산학협력단
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 서울시립대학교 산학협력단 filed Critical 서울시립대학교 산학협력단
Priority to KR1020160067212A priority Critical patent/KR20170135384A/en
Publication of KR20170135384A publication Critical patent/KR20170135384A/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0095Arrangements for synchronising receiver with transmitter with mechanical means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/04Speed or phase control by synchronisation signals

Landscapes

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

Abstract

The present invention relates to an apparatus for distributed clock synchronization based on Ethernet for control automation technology (EtherCAT), capable of correcting a measurement error of a propagation delay; a method thereof; and a computer-recordable medium storing the same. According to the present invention, the apparatus comprises: a communication unit connected to a slave device including a reference slave device and at least one common slave device through an EtherCAT network to perform communication; a delay time calculation module to calculate a propagation delay time of the common slave device when a system or control application is re-executed; an average delay calculation module using the calculated propagation delay time and a previously calculated exponential weight moving average (EWMV) to calculate a current EWMV; and a delay time recording module transmitting the calculated current EWMV through the communication unit to allow the common slave device to record the calculated current EWMV in a register as the propagation delay time.

Description

이더캣 기반의 분산 시계 동기화를 위한 장치, 이를 위한 방법 및 이 방법이 기록된 컴퓨터 판독 가능한 기록매체{Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method}BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for synchronizing distributed clocks based on an Ethernet, a method therefor, and a computer readable recording medium on which the method is recorded.

본 발명은 이더캣 기반의 분산 시계 동기화 기술에 관한 것으로, 보다 상세하게는, 전파 지연 측정 오류를 보정할 수 있는 이더캣 기반의 분산 시계 동기화를 위한 장치, 이를 위한 방법 및 이 방법이 기록된 컴퓨터 판독 가능한 기록매체에 관한 것이다. The present invention relates to an Ethernet-based distributed clock synchronization technique, and more particularly to an apparatus for an Ethernet-based distributed clock synchronization capable of correcting a propagation delay measurement error, a method therefor and a computer Readable recording medium.

IT 트렌드에 힘입어, 기존의 제어 시스템은 산업용 이더넷 기술을 이용한 분산 제어 시스템으로 빠르게 대체되고 있다. 산업용 이더넷기술은 IEC 61784, 61158-2 등의 표준으로 정의되어 있으며, 높은 전송 속도, TCP/IP 지원, 가격 경쟁력 확보 등 다양한 이점을 이용하여 분산 제어 시스템의 효율적인 구성을 가능하게 한다. 특히, 산업용 이더넷 표준 중의 하나인 이더캣(EtherCAT)은 통합형 메시지 프레임(summation frame) 및 하드웨어 기반의 프레임 릴레이를 통해 고속의 실시간 통신을 구현함으로써, 다양한 분야의 정밀 제어 시스템에서 활발히 사용되고 있다. Thanks to IT trends, existing control systems are quickly replacing distributed control systems using industrial Ethernet technology. Industrial Ethernet technology is defined as a standard such as IEC 61784, 61158-2, and enables efficient configuration of a distributed control system by utilizing various advantages such as high transmission rate, TCP / IP support, and cost competitiveness. In particular, EtherCAT, one of the industrial Ethernet standards, is actively used in precision control systems in various fields by realizing high-speed real-time communication through an integrated message frame and hardware-based frame relay.

네트워크의 여러 장치에게 전송될 이더캣 메시지는 하나의 이더넷 프레임으로 묶여 전송되므로 매우 높은 전송 대역폭을 실현할 수 있다. 또한 각 장치는 전송받은 프레임을 하드웨어 기반의 프레임 릴레이를 통하여 다음 장치에게 전달하므로 매우 확정적인 메시지 전송 시간을 확보할 수 있으며, 이를 이용하여 고도로 동기화된 분산 제어 시스템을 구축할 수 있다. 이에 따라 이더캣은 공장 자동화, 로봇 수술, 생산 공정 등 다양한 제어 응용에 적용되고 있다. EtherCAT messages to be transmitted to multiple devices in the network are bundled into one Ethernet frame, so that a very high transmission bandwidth can be realized. Also, since each device transmits the received frame to the next device through hardware-based frame relay, a highly deterministic message transmission time can be secured and a highly synchronized distributed control system can be constructed. Accordingly, EtherCAT is applied to various control applications such as factory automation, robot surgery, and production process.

정밀한 시계 동기화는 분산 제어 시스템에서 그 중요성이 점점 증가하고 있다. 분산 제어 네트워크에서 시계 동기화를 수행하지 않고 로컬 시계에 의존하여 제어 장치 내의 태스크 주기를 결정할 경우, 제어 네트워크에 속한 모든 장치의 태스크 활성화 시점이 일정하지 않으므로, 동기화된 동작의 구현이 어렵다. 이에 반해, 전역적으로 동기화된 시계를 이용하면 높은 수준의 동기 제어가 가능하다. 예를 들어, 산업용 로봇의 경우, 모터 드라이브를 동기화하여 모터를 제어함으로써 원하는 경로를 정밀하게 추적할 수 있다. Precise clock synchronization is becoming increasingly important in distributed control systems. In the case of determining the task cycle in the control device depending on the local clock without performing the clock synchronization in the distributed control network, it is difficult to implement the synchronized operation since the task activation time of all devices belonging to the control network is not constant. On the other hand, using a globally synchronized clock enables a high level of synchronous control. For example, in the case of industrial robots, the desired path can be tracked precisely by controlling the motor by synchronizing the motor drive.

한국공개특허 제2014-0014918호 2014년 02월 06일 공개 (명칭: 이더넷 통신 시스템 및 시간 동기화 방법)Korea Publication No. 2014-0014918 Published Feb. 06, 2014 (name: Ethernet communication system and time synchronization method)

본 발명의 목적은 전파 지연 편차에 따라 발생하는 전파 지연 측정 오류를 보정할 수 있는 이더캣 기반의 분산 시계 동기화를 위한 장치, 이를 위한 방법 및 이 방법이 기록된 컴퓨터 판독 가능한 기록매체를 제공함에 있다. An object of the present invention is to provide an apparatus for an Ethernet-based distributed clock synchronization capable of correcting a propagation delay measurement error caused by a propagation delay deviation, a method therefor, and a computer readable recording medium on which the method is recorded .

상술한 바와 같은 목적을 달성하기 위한 본 발명의 바람직한 실시예에 따른 마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 장치는 참조 슬레이브 장치 및 적어도 하나의 커먼 슬레이브 장치를 포함하는 슬레이브 장치와 이더캣(EtherCAT) 네트워크를 통해 연결되어 통신하는 통신부와, 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행되면, 상기 커먼 슬레이브 장치의 전파 지연 시간을 산출하는 지연시간산출모듈과, 상기 산출된 전파 지연 시간과 이전에 산출된 지수 가중 이동 평균을 이용하여 현재의 지수 가중 이동 평균을 산출하는 지연평균산출모듈과, 상기 산출된 현재의 지수 가중 이동 평균을 전파 지연 시간으로 상기 커먼 슬레이브 장치가 레지스터에 기록하도록 상기 산출된 현재의 지수 가중 이동 평균 상기 통신부를 통해 전송하는 지연시간기록모듈을 포함한다. According to another aspect of the present invention, there is provided an apparatus for synchronizing distributed clocks of a master device, comprising: a slave device including a reference slave device and at least one common slave device; And a control unit for controlling the control unit so as to calculate a propagation delay time of the common slave unit when the system application or the control application is executed again; And calculating a current exponentially weighted moving average by using the weighted moving average; and calculating a current exponentially weighted moving average by using the calculated current exponent moving average so that the common slave device records the calculated exponentially weighted moving average in a register The weighted moving average is transmitted through the communication unit And a delay time recording module.

상기 현재의 지수 가중 이동 평균은 상기 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행될 때 상기 산출된 전파 지연 시간에 가중치를 적용한 값과 상기 이전에 산출된 지수 가중 이동 평균에 잔여 가중치를 적용한 값의 평균인 것을 특징으로 한다. Wherein the current exponential weighted moving average is an average of a value obtained by applying a weight to the calculated propagation delay time when the system application or control application is re-executed and an average of a value obtained by applying a residual weight to the previously calculated exponential weighted moving average .

상기 현재의 지수 가중 이동 평균은 수학식 The current exponentially weighted moving average is calculated by the following equation

Figure pat00001
Figure pat00001

에 따라 산출되며, 상기

Figure pat00002
는 현재의 지수 가중 이동 평균이며, 상기
Figure pat00003
은 초기 지수 가중 이동 평균이고, 상기
Figure pat00004
는 가중치이며, 상기
Figure pat00005
는 현재 산출된 전파 지연 시간이고, 상기
Figure pat00006
는 상기 이전에 산출된 지수 가중 이동 평균인 것을 특징으로 한다. Is calculated according to the equation
Figure pat00002
Is the current exponentially weighted moving average,
Figure pat00003
Is an initial exponential weighted moving average,
Figure pat00004
Is a weight,
Figure pat00005
Is the currently calculated propagation delay time,
Figure pat00006
Is the previously calculated exponentially weighted moving average.

더욱이, 상기 지연시간산출모듈이 네트워크가 구성되는 것을 감지하면, 상기 커먼 슬레이브 장치의 전파 지연 시간을 복수번 산출하며, 상기 지연평균산출모듈은 상기 복수번 산출된 전파 지연 시간의 평균을 상기 초기 지수 가중 이동 평균으로 결정하는 것을 특징으로 한다. Further, when the delay time calculation module detects that the network is configured, it calculates the propagation delay time of the common slave device a plurality of times, and the delay average calculation module calculates an average of the propagation delay times calculated the plurality of times, As a weighted moving average.

상술한 바와 같은 목적을 달성하기 위한 본 발명의 바람직한 실시예에 따른 마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 방법은 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행되면, 참조 슬레이브 장치 및 적어도 하나의 커먼 슬레이브 장치를 포함하는 슬레이브 장치 중 상기 커먼 슬레이브 장치의 전파 지연 시간을 산출하는 단계와, 상기 산출된 전파 지연 시간과 이전에 산출된 지수 가중 이동 평균을 이용하여 현재의 지수 가중 이동 평균을 산출하는 단계와, 상기 산출된 현재의 지수 가중 이동 평균을 전파 지연 시간으로 상기 커먼 슬레이브 장치가 레지스터에 기록하도록 상기 산출된 현재의 지수 가중 이동 평균 전송하는 단계를 포함한다. According to another aspect of the present invention, there is provided a method for an EDC based distributed clock synchronization of a master device, wherein when a system application or a control application is re-executed, a reference slave device and at least one common slave device Calculating a current exponential weighted moving average using the calculated propagation delay time and a previously calculated exponential weighted moving average; And transmitting the calculated current exponentially weighted moving average to the register so that the common slave device records the calculated exponentially weighted moving average as a propagation delay time.

여기서, 상기 현재의 지수 가중 이동 평균은 상기 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행될 때 상기 산출된 전파 지연 시간에 가중치를 적용한 값과 상기 이전에 산출된 지수 가중 이동 평균에 잔여 가중치를 적용한 값의 평균인 것을 특징으로 한다. Here, the current exponential weighted moving average may be an average of a value obtained by applying a weight to the calculated propagation delay time when the system application or the control application is re-executed and an average of a value obtained by applying a residual weight to the previously calculated exponential weighted moving average .

다른 말로, 상기 현재의 지수 가중 이동 평균은 다음의 수학식 In other words, the current exponential weighted moving average is calculated by the following equation

Figure pat00007
Figure pat00007

에 따라 산출되며, 상기

Figure pat00008
는 현재의 지수 가중 이동 평균이며, 상기
Figure pat00009
은 초기 지수 가중 이동 평균이고, 상기
Figure pat00010
는 가중치이며, 상기
Figure pat00011
는 현재 산출된 전파 지연 시간이고, 상기
Figure pat00012
는 상기 이전에 산출된 지수 가중 이동 평균인 것을 특징으로 한다. Is calculated according to the equation
Figure pat00008
Is the current exponentially weighted moving average,
Figure pat00009
Is an initial exponential weighted moving average,
Figure pat00010
Is a weight,
Figure pat00011
Is the currently calculated propagation delay time,
Figure pat00012
Is the previously calculated exponentially weighted moving average.

네트워크가 구성될 때, 상기 커먼 슬레이브 장치의 전파 지연 시간이 복수번 산출되며, 상기 초기 지수 가중 이동 평균은 상기 복수번 산출된 전파 지연 시간의 평균인 것을 특징으로 한다. When the network is configured, the propagation delay time of the common slave device is calculated a plurality of times, and the initial exponential weighted moving average is an average of the propagation delay times calculated a plurality of times.

상술한 바와 같은 목적을 달성하기 위해 전술한 바와 같은 본 발명의 바람직한 실시예에 따른 마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 방법이 기록된 컴퓨터 판독 가능한 기록매체를 제공한다. According to another aspect of the present invention, there is provided a computer-readable recording medium on which is recorded a method for an EDC-based distributed clock synchronization of a master device according to a preferred embodiment of the present invention.

본 발명에 따르면, 네트워크를 구성할 때, 시스템 혹은 제어 애플리케이션이 재실행될 때, 필요한 횟수로 전파 지연을 측정하고, 측정된 전파 지연을 통해 지수 가중 이동 평균을 산출한 후, 이를 전파 지연 시간으로 설정하여, 적정한 수의 연산으로 정밀한 분산 시계 동기화를 이룰 수 있다. According to the present invention, when configuring a network, when a system or a control application is re-executed, the propagation delay is measured as many times as necessary, the exponentially weighted moving average is calculated through the measured propagation delay, So that accurate distributed clock synchronization can be achieved with an appropriate number of operations.

도 1 및 도 2는 본 발명의 실시예에 따른 이더캣 기반의 분산 제어 시스템의 구성을 설명하기 위한 도면이다.
도 3은 본 발명의 실시예에 따른 마스터 장치를 설명하기 위한 블록도이다.
도 4 및 도 5는 본 발명의 실시예에 따른 분산 시계 동기화를 위한 방법을 설명하기 위한 도면이다.
도 6 및 도 7은 본 발명의 실시예에 따른 분산 시계 동기화를 위한 방법을 설명하기 위한 흐름도이다.
1 and 2 are views for explaining a configuration of an Ethernet-based distributed control system according to an embodiment of the present invention.
3 is a block diagram for explaining a master device according to an embodiment of the present invention.
4 and 5 are views for explaining a method for distributed clock synchronization according to an embodiment of the present invention.
6 and 7 are flowcharts illustrating a method for distributed clock synchronization according to an embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예들이 설명될 것이다. 이때, 첨부된 도면에서 동일한 구성 요소는 가능한 동일한 부호로 나타내고 있음을 유의해야 한다. 또한, 본 발명의 요지를 흐리게 할 수 있는 공지 기능 및 구성에 대한 상세한 설명은 생략할 것이다. 마찬가지의 이유로 첨부 도면에 있어서 일부 구성요소는 과장되거나 생략되거나 또는 개략적으로 도시되었으며, 각 구성요소의 크기는 실제 크기를 전적으로 반영하는 것이 아니다. Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings. Note that, in the drawings, the same components are denoted by the same reference symbols as possible. Further, the detailed description of known functions and configurations that may obscure the gist of the present invention will be omitted. For the same reason, some of the elements in the accompanying drawings are exaggerated, omitted, or schematically shown, and the size of each element does not entirely reflect the actual size.

특히, 이하에서 설명되는 본 명세서 및 청구범위에 사용된 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 아니 되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념으로 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다. 따라서 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 실시예에 불과할 뿐, 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형 예들이 있을 수 있음을 이해하여야 한다. In particular, terms and words used in the present specification and claims should not be construed as limited to ordinary or dictionary meanings, and the inventor should understand the concept of the term The present invention should be construed as meaning and concept consistent with the technical idea of the present invention. Therefore, the embodiments described in the present specification and the configurations shown in the drawings are merely the most preferred embodiments of the present invention, and are not intended to represent all of the technical ideas of the present invention. Therefore, various equivalents It should be understood that water and variations may be present.

먼저, 본 발명의 실시예에 따른 이더캣(EtherCAT) 기반의 분산 제어 시스템에 대해서 설명하기로 한다. 도 1 및 도 2는 본 발명의 실시예에 따른 이더캣 기반의 분산 제어 시스템의 구성을 설명하기 위한 도면이다. First, an EtherCAT-based distributed control system according to an embodiment of the present invention will be described. 1 and 2 are views for explaining a configuration of an Ethernet-based distributed control system according to an embodiment of the present invention.

도 1 및 도 2를 참조하면, 본 발명의 실시예에 따른 분산 제어 시스템은 마스터 장치(master, 100) 및 복수의 슬레이브 장치(slave, 200)를 포함한다. 일례로, 복수의 슬레이브 장치(200)는 도 1에 보인 바와 같이, 어느 하나의 로봇팔의 축에 배치된 모터를 제어하기 위한 모터 드라이버가 될 수 있다. 그리고 마스터 장치(100)는 각 모터 드라이버를 제어하기 위한 컴퓨터 연산을 수행할 수 있는 장치가 될 수 있다. Referring to FIGS. 1 and 2, a distributed control system according to an embodiment of the present invention includes a master device 100 and a plurality of slave devices 200. As an example, the plurality of slave devices 200 may be motor drivers for controlling motors disposed on the axis of one of the robot arms, as shown in Fig. The master device 100 may be a device capable of performing a computer operation for controlling each motor driver.

슬레이브 장치(200)는 하나의 참조 슬레이브 장치(reference slave, 210)와 하나 혹은 복수의 커먼 슬레이브 장치(common slave, 220)로 구분할 수 있다. 참조 슬레이브 장치(210)는 이더캣 기반의 분산 제어 시스템의 네트워크 토폴로지 상 마스터 장치(100)에 대해 첫 번째 위치한 슬레이브 장치(200)이다. 커먼 슬레이브 장치(220)는 참조 슬레이브 장치(210) 외의 나머지 슬레이브 장치(200)를 의미한다. The slave device 200 can be divided into a reference slave device 210 and one or more common slave devices 220. The reference slave device 210 is the slave device 200 located first in relation to the master device 100 on the network topology of the Ethernet-based distributed control system. The common slave device 220 refers to the slave device 200 other than the reference slave device 210.

그러면, 본 발명의 실시예에 따른 마스터 장치(100)의 구성에 대해서 설명하기로 한다. 도 3은 본 발명의 실시예에 따른 마스터 장치를 설명하기 위한 블록도이다. 도 3을 참조하면, 마스터 장치(100)는 통신부(110), 저장부(120) 및 제어부(130)를 포함한다. The configuration of the master device 100 according to the embodiment of the present invention will now be described. 3 is a block diagram for explaining a master device according to an embodiment of the present invention. Referring to FIG. 3, the master device 100 includes a communication unit 110, a storage unit 120, and a control unit 130.

통신부(110)는 마스터 장치(100)와 복수의 슬레이브 장치(200)가 이더캣 네트워크를 통해 연결될 때, 슬레이브 장치(200)와 통신을 위한 것이다. 이러한 통신부(110)는 슬레이브 장치(200)로 데이터그램(datagram)을 전송하고, 수신할 수 있다. 데이터그램(datagram)은 이더캣의 기본 메시지 단위이며, 데이터그램은 지정된 슬레이브 장치(200)의 특정 주소를 가지는 메모리(혹은 레지스터)에 데이터를 쓰거나, 해당 주소의 메모리로부터 데이터를 읽어올 수 있다. 전송되는 데이터그램들은 하나의 이더넷 프레임(ethernet frame)에 포함되어 전송된다. The communication unit 110 is for communicating with the slave device 200 when the master device 100 and a plurality of slave devices 200 are connected via the Ethernet network. The communication unit 110 may transmit and receive datagrams to the slave device 200. A datagram is a basic message unit of the Ethernet, and a datagram can write data to or read data from a memory (or a register) having a specific address of the slave device 200 designated. The datagrams transmitted are contained in one Ethernet frame and transmitted.

데이터그램들은 마스터 장치(100)에 의해 주기적으로 생성되어 모든 슬레이브 장치(200)에 순차적으로 전달되고, 마지막 슬레이브 장치(200)에서부터 다시 역순으로 전달되어 마스터 장치(100)로 돌아온다. 목적지 슬레이브 장치(200)에 데이터그램이 도달하면 해당 슬레이브 장치(200)의 메모리에서 필요한 데이터를 읽어오거나, 쓰고자 하는 데이터를 복사한다. 분산 제어 시스템은 링 형태의 네트워크 토폴로지가 사용되는 것이 바람직하며, 이를 이용하여 데이터그램을 통해 모든 장치 간의 시계 값을 공유할 수 있다. The datagrams are generated periodically by the master device 100 and sequentially transmitted to all the slave devices 200, and are transferred from the last slave device 200 in the reverse order to the master device 100 again. When the datagram reaches the destination slave device 200, the necessary data is read from the memory of the slave device 200 or the data to be written is copied. The distributed control system preferably uses a network topology of a ring type, and can share clock values among all devices through a datagram.

저장부(120)는 메모리 혹은 레지스터로 구현될 수 있다. 저장부(120)는 제어부(130)가 산출한 지수 가중 이동 평균 혹은 지수 가중 이동 평균을 산출할 때 사용되는 가중치 등을 저장할 수 있다. The storage unit 120 may be implemented as a memory or a register. The storage unit 120 may store an exponentially weighted moving average calculated by the controller 130 or a weight used when the exponentially weighted moving average is calculated.

제어부(130)는 본 발명의 실시예에 따른 마스터 장치(100)의 전반적인 동작 및 마스터 장치(100)의 내부 블록들 간 신호 흐름을 제어하고, 데이터를 처리하는 데이터 처리 기능을 수행할 수 있다. 이러한 제어부(350)는 대표적으로 중앙 처리 장치(Central Processing Unit : CPU)를 예시할 수 있다. 본 발명의 실시예에 따른 제어부(130)는 지연시간산출모듈(131), 지연평균산출모듈(133) 및 지연시간기록모듈(135)을 포함한다. 이러한 지연시간산출모듈(131), 지연평균산출모듈(133) 및 지연시간기록모듈(135)을 포함하는 제어부(130)의 동작은 아래에서 더 상세하게 설명될 것이다. The controller 130 may control the overall operation of the master device 100 according to an embodiment of the present invention and the signal flow between the internal blocks of the master device 100 and may perform a data processing function for processing the data. The controller 350 may represent a central processing unit (CPU). The controller 130 according to the embodiment of the present invention includes a delay time calculating module 131, a delay average calculating module 133, and a delay time recording module 135. The operation of the controller 130 including the delay time calculation module 131, the delay average calculation module 133 and the delay time recording module 135 will be described in more detail below.

한편, 마스터 장치(100)는 마스터 장치(100)에 사용자의 입력을 입력하기 위한 입력부(미도시), 마스터 장치(100)가 연결된 슬레이브 장치(200)에 대한 상태 정보를 표시하기 위한 표시부(미도시) 등을 더 포함할 수 있다. 하지만, 이들에 대한 설명은 단순화를 위하여 생략하기로 한다. The master device 100 includes an input unit (not shown) for inputting a user's input to the master device 100, a display unit (not shown) for displaying status information about the slave device 200 to which the master device 100 is connected And the like). However, the description thereof will be omitted for the sake of simplicity.

다음으로, 본 발명의 실시예에 따른 분산 시계 동기화를 수행하는 방법에 대해서 설명하기로 한다. 도 4 및 도 5는 본 발명의 실시예에 따른 분산 시계 동기화를 위한 방법을 설명하기 위한 도면이다. Next, a method of performing distributed clock synchronization according to an embodiment of the present invention will be described. 4 and 5 are views for explaining a method for distributed clock synchronization according to an embodiment of the present invention.

상세한 방법의 설명에 앞서, 분산 시계 동기화에 사용되는 용어에 대해서 설명하기로 한다. 분산 시계 동기화를 위해 다음과 같이 표준 문서에 정의된 용어를 사용할 수 있다. 시스템 시간(System Time)은 전역 시계(Global Clock) 값을 나타내기 위한 시간으로, 2000년 1월 1일 자정을 기준으로 하여 1 나노 초 단위씩 증가하는 정수 값으로 정의한다. 시스템 시간은 각 슬레이브 장치(200) 별로 64비트 크기의 레지스터에 저장되며, 본 발명의 실시예에 따른 시계 동기화 기능에 의하여 관리된다. 로컬 시간(Local Time)은 슬레이브 장치(200) 고유의 시간을 나타내며, 슬레이브 장치(200)에 내장되어 있는 로컬 시계(Local Clock 또는 Slave Clock)에 의해 관리된다. 참조 시간(Reference Time)은 마스터 장치(100)에서 가장 가까운 슬레이브 장치(200), 즉 참조 슬레이브 장치(210)에 의해 관리되는 시스템 시간을 가리키며, 모든 슬레이브 장치(200)의 시스템 시간은 참조 시간을 기준으로 동기화된다. Before describing the detailed method, the terms used in distributed clock synchronization will be described. For distributed clock synchronization, you can use the terms defined in the standard document as follows: The system time is a time for displaying the global clock value, which is defined as an integer value incremented by 1 nanosecond from the midnight of January 1, 2000. The system time is stored in a 64-bit register for each slave device 200, and is managed by a clock synchronization function according to an embodiment of the present invention. The local time represents a time unique to the slave device 200 and is managed by a local clock (slave clock) built in the slave device 200. [ The reference time indicates the system time managed by the slave device 200 closest to the master device 100, i.e., the reference slave device 210, and the system time of all the slave devices 200 indicates a reference time Synchronized.

본 발명의 실시예에 따른 분산 제어 시스템은 다음의 3가지 측면, 즉 오프셋(offset) 보정, 전파 지연(Propagation delay) 보정 및 드리프트 보정(drift compensation)을 통해 네트워크의 모든 장치의 시계를 동기화할 수 있다. 오프셋(offset)은 참조 시간과 로컬 시간 간의 차이를 뜻한다. 각 슬레이브 장치(200)의 부팅 시간 차이 등으로 인하여 발생하는 로컬 시간의 시작 시점 차이에 의해 나타난다. 전파 지연(Propagation delay)은 마스터 장치(100)로부터 각 슬레이브 장치(200)까지 메시지 전송에 걸리는 시간을 의미한다. 전파 지연은 네트워크 토폴로지의 형태, 슬레이브 장치(200)의 구현 특성, 네트워크에서의 슬레이브 장치(200) 위치에 따라 달라질 수 있다. 시스템 시간 드리프트는 각 슬레이브 장치(200)의 로컬 시계에 서 발생하는 오실레이터의 진동 편차에 의한 시스템 시간의 차이를 의미한다. The distributed control system according to the embodiment of the present invention can synchronize the clocks of all devices in the network through the following three aspects: offset correction, propagation delay correction and drift compensation have. The offset refers to the difference between the reference time and the local time. And the start time difference of the local time caused by the difference in boot time of each slave device 200 and the like. Propagation delay means a time required for message transmission from the master device 100 to each slave device 200. The propagation delay may vary depending on the type of the network topology, the implementation characteristics of the slave device 200, and the position of the slave device 200 in the network. The system time drift refers to the difference in system time due to the oscillation deviation of the oscillator generated in the local clock of each slave device 200.

각 슬레이브 장치(200)의 시스템 시간이 정확히 동기화 되더라도, 드리프트에 의해 오차가 발생하게 된다. 시계 동기화는 다음의 세 단계, 즉 전파 지연 측정, 오프셋 보정, 드리프트 보정을 거쳐 이루어진다. Even if the system time of each slave device 200 is exactly synchronized, an error occurs due to drift. Clock synchronization is accomplished through the following three steps: propagation delay measurement, offset correction, and drift correction.

전파 지연 측정은 마스터 장치(100)가 슬레이브 장치(200)를 초기화할 때 이루어진다. 전파 지연 측정을 위해 마스터 장치(100)는 모든 슬레이브 장치(200)에 대하여 특정 주소의 레지스터에 대한 전역 쓰기(BWR; Broadcast Write) 명령을 프레임에 포함시켜 전송한다. 각 슬레이브 장치(200)는 명령을 수신한 시간을 로컬 시간 기준으로 측정하여 해당 레지스터에 저장한다. 모든 슬레이브 장치(200)를 순환하고 돌아오는 프레임이 각 포트에 도착한 시간 또한 해당 레지스터에 기록된다. 각 도착 시간의 기록이 끝나면 마스터 장치(100)는 모든 슬레이브 장치(200)로부터 해당 레지스터 값을 읽어온다. 마스터 장치(100)는 읽어 들인 시간 값으로부터 전파 지연을 측정할 수 있다. 도 2를 참조하면,

Figure pat00013
를 슬레이브 장치 s의 포트 p에 측정 프레임이 도착한 시간으로 정의하였을 때, 슬레이브 장치 i, i+1 사이의 전파 지연 시간은 다음의 수학식 1과 같다. The propagation delay measurement is performed when the master device 100 initializes the slave device 200. To measure the propagation delay, the master device 100 transmits a global write (BWR) command for a register of a specific address to all the slave devices 200 in a frame. Each slave device 200 measures the time when the command is received on the basis of the local time and stores it in the corresponding register. The time at which the frame that circulates and returns to all the slave devices 200 arrives at each port is also recorded in the corresponding register. When the recording of each arrival time is completed, the master device 100 reads the corresponding register value from all the slave devices 200. The master device 100 can measure the propagation delay from the read time value. Referring to Figure 2,
Figure pat00013
Is defined as the arrival time of the measurement frame at the port p of the slave device s, the propagation delay time between the slave devices i and i + 1 is expressed by the following equation (1).

Figure pat00014
Figure pat00014

이와 같이, 마스터 장치(100)는 각 슬레이브 장치(200) 사이의 전파 지연 시간을 측정하여, 참조 슬레이브 장치(210)와 각 커먼 슬레이브 장치(220) 사이의 전파 지연 시간을 산출할 수 있다. 산출된 전파 지연 시간은 마스터 장치(100)에 의해 각 슬레이브 장치(200)의 해당하는 레지스터, 예컨대, "시스템 시간 지연(system time delay)" 레지스터에 기록된다. As described above, the master device 100 can measure the propagation delay time between each of the slave devices 200, and calculate the propagation delay time between the reference slave device 210 and each common slave device 220. The calculated propagation delay time is recorded by the master device 100 in a corresponding register of each slave device 200, for example, a "system time delay" register.

오프셋 보정을 위해 슬레이브 장치(200)의 초기화 과정에서 마스터 장치(100)의 제어에 따라, 참조 슬레이브(reference slave) 장치(210)의 시스템 시간은 커먼 슬레이브 장치(220)에 전달된다. 그러면, 커먼 슬레이브 장치(220)는 전달받은 시스템 시간과 자신의 로컬 시간 사이의 차를 계산하여 해당하는 레지스터, 예컨대, "시스템 시간 오프셋(system time offset)" 레지스터에 저장한다. 이는 다음의 수학식 2에 따른다. The system time of the reference slave device 210 is transferred to the common slave device 220 under the control of the master device 100 during the initialization of the slave device 200 for offset correction. Then, the common slave device 220 calculates a difference between the received system time and its local time and stores the difference in a corresponding register, for example, a "system time offset" register. This is expressed by the following equation (2).

Figure pat00015
Figure pat00015

드리프트 보정은 마스터 장치(100)의 운영(OP; operation) 상태에서 이루어진다. 드리프트 보정을 위해 마스터 장치(200)는 주기적으로 참조 시간 값을 각 슬레이브 장치(200)에 전달해 주어야 한다. 이를 위하여, 마스터 장치(200)는 "단일 읽기 다중 쓰기(RMW; Read Multiple Write)" 명령어를 사용할 수 있다. 보다 자세히 설명하면, 마스터 장치(200)는 슬레이브 장치(200)와의 실시간 통신을 위한 EtherCAT 프레임 전송 시, 미리 정해진 드리프트 보정 주기마다 실시간 데이터를 담은 데이터그램과 함께 보정 데이터그램을 포함하는 프레임을 전송한다. 이때, 마스터 장치(200)는 참조 슬레이브 장치(210)의 시스템 시간을 읽어온 후, 읽어온 시스템 시간을 보정 데이터그램에 포함시킨다. 이에 따라, 보정 데이터그램을 통해 시스템 시간이 각 커먼 슬레이브 장치(220)에 전달된다. 이때, 시스템 시간을 전달받은 커먼 슬레이브 장치(220)는 다음의 수학식 3을 기반으로 자신의 시스템 시간 드리프트를 계산한다. The drift correction is performed in the operation (OP) state of the master device 100. The master device 200 must periodically transmit the reference time value to each slave device 200 for drift correction. To this end, the master device 200 may use a "Read Multiple Write (RMW)" More specifically, when transmitting an EtherCAT frame for real-time communication with the slave device 200, the master device 200 transmits a frame including a correction datagram together with a datagram containing real-time data at a predetermined drift correction period . At this time, the master device 200 reads the system time of the reference slave device 210, and then includes the read system time in the correction datagram. Accordingly, the system time is transmitted to each common slave device 220 via the correction datagram. At this time, the common slave device 220 receiving the system time calculates its own system time drift based on the following Equation (3).

Figure pat00016
Figure pat00016

상술한 바와 같이, 드리프트를 계산한 후, 커먼 슬레이브 장치(220)는 커먼 슬레이브 장치(220)의 로컬 시계 속도를 보정할 수 있다. 드리프트가 양의 값을 가지면 커먼 슬레이브 장치(220)에서 관리중인 시스템 시간의 속도가 더 빠름을 의미하므로 로컬 시계의 속도를 감소시켜 드리프트를 줄인다. 반대의 경우, 로컬 시계의 속도를 증가시켜 드리프트를 감소시킬 수 있다. As described above, after calculating the drift, the common slave device 220 can correct the local clock speed of the common slave device 220. If the drift has a positive value, it means that the speed of the system time managed by the common slave device 220 is faster, thereby reducing the speed of the local clock and reducing the drift. In the opposite case, the speed of the local clock can be increased to reduce drift.

한편, 전파 지연 측정 시, 전파 지연은 참조 슬레이브 장치(210)로부터 해당 슬레이브 장치(220)까지의 케이블 길이에 비례한 케이블 전송 지연(wire propagation delay), 해당 슬레이브 장치(220)까지 거치는 전체 슬레이브 장치(200)들의 처리 지연(processing delay), 슬레이브 장치(220)들의 프레임 전달을 위한 하드웨어 혹은 소프트웨어 프레임 릴레이에서의 전달 지연(fowarding delay)이 포함된다. 전술한 처리 지연 및 전달 지연에 의해, 각 프레임 별로 측정되는 전파 지연은 편차를 가질 수 있다. 이러한 전파 지연 편차는 각 커먼 슬레이브 장치(220) 별로 전파 지연 측정값에 반영될 수 있다. 그리고 이러한 전파 지연 편차로 인한 측정 오류에 따라 커먼 슬레이브 장치(220)의 시스템 시간이 일정한 오류를 지속적으로 유지할 수 있다. 또한, 오프셋 보정 단계에서 참조 슬레이브 장치(210)의 시스템 시간을 전달 받는 과정 중 해당 전파 지연 편차가 오프셋 계산에 오차로 반영될 수 있다. 전파 지연 편차는 슬레이브 장치를 지날 때마다 누적되므로 슬레이브 장치가 많을수록 전파 지연 편차가 커질 수 있으며, 이에 따라 최초 오프셋 오차도 커질 수 있다. In the propagation delay measurement, the propagation delay is determined by a wire propagation delay proportional to the cable length from the reference slave device 210 to the slave device 220, a total propagation delay that is proportional to the cable length from the reference slave device 210 to the slave device 220, Processing delays of the slave devices 200, and fowarding delays in the hardware or software frame relay for the slave devices 220 to transfer frames. Due to the above-described processing delay and propagation delay, the propagation delay measured for each frame may have a deviation. This propagation delay deviation may be reflected in the propagation delay measurement value for each common slave device 220. The system time of the common slave device 220 can be maintained constant according to the measurement error due to the propagation delay deviation. In addition, during the process of receiving the system time of the reference slave device 210 in the offset correction step, the propagation delay deviation may be reflected as an error in the offset calculation. Since the propagation delay deviation is accumulated each time the slave device passes, the propagation delay deviation may become larger as the number of the slave devices increases, so that the initial offset error can also be increased.

그러면, 이러한 전파 지연 편차로 인한 영향을 보정하기 위한 분산 시계 동기화를 위한 방법에 대해서 설명하기로 한다. 도 6 및 도 7은 본 발명의 실시예에 따른 분산 시계 동기화를 위한 방법을 설명하기 위한 흐름도이다. 도 6 및 도 7을 참조하는 실시예에서 하나의 커먼 슬레이브 장치(220)만이 도시되고 설명될 것이지만, 도 1에 도시된 실시예와 같이, 복수의 커먼 슬레이브 장치(220)가 존재할 수 있으며, 이 기술 분야에서 통상의 지식을 가진자라면 복수의 커먼 슬레이브 장치(220)로 이루어진 분산 제어 시스템의 경우에도 본 발명을 적용할 수 있을 것이다. A method for the distributed clock synchronization for correcting the influence due to the propagation delay deviation will now be described. 6 and 7 are flowcharts illustrating a method for distributed clock synchronization according to an embodiment of the present invention. Although only one common slave device 220 will be shown and described in the embodiment with reference to Figures 6 and 7, as in the embodiment shown in Figure 1, there can be a plurality of common slave devices 220, The present invention may be applied to a distributed control system composed of a plurality of common slave devices 220, as long as those skilled in the art are familiar with the present invention.

도 6을 참조하면, 마스터 장치(100)의 지연시간산출모듈(131)은 S110 단계에서 네트워크가 최초로 혹은 새로 구성되는 상태임을 인지할 수 있다. 그러면, S120 단계에서 마스터 장치(100)의 지연시간산출모듈(131)는 참조 슬레이브 장치(210) 및 커먼 슬레이브 장치(220)를 통해 전파 지연 시간을 측정하고, 이를 산출한다. S120 단계는 S121 단계 내지 S131 단계를 포함하며, 이러한 S120 단계는 복수회 수행된다. Referring to FIG. 6, the delay time calculation module 131 of the master device 100 may recognize that the network is initially or newly configured in step S110. Then, in step S120, the delay time calculation module 131 of the master device 100 measures the propagation delay time through the reference slave device 210 and the common slave device 220, and calculates the propagation delay time. Step S120 includes steps S121 to S131, and step S120 is performed a plurality of times.

S120 단계에 대해서 상세히 설명하면 다음과 같다. 마스터 장치(100)의 지연시간산출모듈(131)은 통신부(110)를 통해 S111 단계에 전파 지연 측정을 위한 프레임을 전송한다. 이 프레임을 측정 프레임이라고 칭하기로 한다. 측정 프레임에는 전역 쓰기(BWR: Broadcast Write) 명령이 포함된다. 마스터 장치(100)의 지연시간산출모듈(131)에 의해 S111 단계에 전송된 측정 프레임은 모든 슬레이브 장치(200)를 순환하여 다시 마스터 장치(100)로 돌아온다. 즉, 측정 프레임은 S123 단계에서 참조 슬레이브 장치(210)로부터 커먼 슬레이브 장치(220)로 전송되고, S125 단계에서 커먼 슬레이브 장치(220)로부터 참조 슬레이브 장치(210)로 전송되며, S127 단계에서 참조 슬레이브 장치(210)로부터 마스터 장치(100)로 전달된다. 도 2를 참조하면, 이 측정 프레임이 네트워크 내 슬레이브 장치(210, 220)를 순회할 때, 각 슬레이브 장치(210, 220)는 자신의 각 포트(Port 0, Port 1)마다 프레임이 도착한 시간을 측정한다. 마스터 장치(100)의 지연시간산출모듈(131)이 측정 프레임을 다시 수신하면, 측정이 완료된 것으로 판단한다. Step S120 will be described in detail as follows. The delay time calculation module 131 of the master device 100 transmits a frame for propagation delay measurement in step S111 through the communication unit 110. [ This frame will be referred to as a measurement frame. The measurement frame includes a BWR (Broadcast Write) command. The measurement frame transmitted to the step S111 by the delay time calculation module 131 of the master device 100 circulates through all the slave devices 200 and returns to the master device 100 again. That is, the measurement frame is transmitted from the reference slave device 210 to the common slave device 220 in step S123, transferred from the common slave device 220 to the reference slave device 210 in step S125, And transferred from the device 210 to the master device 100. Referring to FIG. 2, when the measurement frame traverses the slave devices 210 and 220 in the network, each slave device 210 and 220 determines the arrival time of a frame for each port (Port 0 and Port 1) . When the delay time calculation module 131 of the master device 100 receives the measurement frame again, it is determined that the measurement is completed.

이에 따라, 지연시간산출모듈(131)은 S129 단계에서 참조 슬레이브 장치(210) 및 커먼 슬레이브 장치(220)로부터 측정된 프레임 도착 시간을 수집한다. 그런 다음, 마스터 장치(100)의 지연시간산출모듈(131)은 S131 단계에서 슬레이브 장치(200)의 네트워크 토폴로지에 따라 네트워크 내 노드 간 프레임 전파 지연 시간을 산출한다. 예컨대, 마스터 장치(100)의 지연시간산출모듈(131)은 수학식 1에 따라 전파 지연 시간을 산출할 수 있다. Accordingly, the delay time calculation module 131 collects measured frame arrival times from the reference slave device 210 and the common slave device 220 in step S129. Then, the delay time calculation module 131 of the master device 100 calculates the frame propagation delay time in the network according to the network topology of the slave device 200 in step S131. For example, the delay time calculation module 131 of the master device 100 can calculate the propagation delay time according to Equation (1).

S110 단계는 복수회 수행되며, 이에 따라, 복수의 전파 지연 시간이 산출될 수 있다. 이에 따라, 마스터 장치(100)의 지연평균산출모듈(133)은 S140 단계에서 앞서 산출된 복수의 전파 지연 시간의 평균을 구한다. 여기서, 산출된 복수의 전파 지연 시간의 평균은 초기 지수 가중 이동 평균이 될 수 있다(

Figure pat00017
). 이는 아래의 수학식 4를 참조로 상세하게 설명될 것이다. 그런 다음, 마스터 장치(100)의 지연시간기록모듈(135)은 S150 단계에서 산출된 전파 지연 시간의 평균을 전파 지연 시간으로 커먼 슬레이브 장치(220)의 레지스터에 기록한다. 이때, 지연시간기록모듈(135)은 통신부(110)를 통해 앞서 산출된 전파 지연 시간의 평균이 전파 지연 시간으로 기록된 데이터그램이 포함된 프레임을 커먼 슬레이브 장치(220)로 전송하면, 커먼 슬레이브 장치(220)는 수신된 전파 지연 시간의 평균을 전파 지연 시간으로 해당 레지스터에 기록할 수 있다. 이에 따라, 적어도 하나의 커먼 슬레이브 장치(220)는 기록된 전파 지연 시간의 평균을 전파 지연 시간으로 하여 분산 시계를 동기화할 수 있다. Step S110 is performed a plurality of times, whereby a plurality of propagation delay times can be calculated. Accordingly, the delay average calculation module 133 of the master device 100 obtains the average of the plurality of propagation delay times calculated in the step S140. Here, the average of the calculated plurality of propagation delay times may be an initial exponentially weighted moving average (
Figure pat00017
). This will be described in detail with reference to Equation (4) below. Then, the delay time recording module 135 of the master device 100 records the average of the propagation delay time calculated in step S150 in the register of the common slave device 220 as the propagation delay time. At this time, when the delay time recording module 135 transmits a frame including the datagram in which the average of the propagation delay time calculated in advance through the communication unit 110 is recorded as the propagation delay time, to the common slave device 220, The device 220 may record the average of the received propagation delay time in the corresponding register as the propagation delay time. Accordingly, at least one common slave device 220 can synchronize the distributed clock by setting the average of the recorded propagation delay time as the propagation delay time.

전술한 바와 같이, 일 실시예에 따르면 전파 지연 시간은 전파 지연 시간의 평균이 된다. 이러한 상태에서, 마스터 장치(100)는 시스템 혹은 제어 애플리케이션이 재실행될 때마다, 도 5에 보인 바와 같이, 전파 지연 시간을 갱신한다. 도 7을 참조하면, 마스터 장치(100)의 지연시간산출모듈(131)은 S220 단계에서 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행되는 것을 인지할 수 있다. As described above, according to one embodiment, the propagation delay time is an average of the propagation delay time. In this state, the master device 100 updates the propagation delay time, as shown in Fig. 5, whenever the system or control application is re-executed. Referring to FIG. 7, the delay time calculation module 131 of the master device 100 may recognize that the system application or the control application is executed again in step S220.

그러면, S220 단계에서 마스터 장치(100)의 지연시간산출모듈(131)은 참조 슬레이브 장치(210) 및 커먼 슬레이브 장치(220)를 통해 전파 지연 시간을 측정하고, 이를 산출한다. S220 단계는 S221 단계 내지 S231 단계를 포함하며, 이러한 S220 단계는 1회 수행된다. 또한, S220 단계는 S120 단계와 동일한 동작을 수행하며, S220 단계에 포함된 S221 단계 내지 S231 단계 또한 대응하는 S121 단계 내지 S131 단계와 동일한 동작을 수행한다. 즉, S211 단계 내지 S231 단계에 측정 프레임은 모든 슬레이브 장치(200)를 순환하여 다시 마스터 장치(100)로 돌아온다. 이때, 이 측정 프레임이 네트워크 내 슬레이브 장치(210, 220)를 순회할 때, 각 슬레이브 장치(210, 220)는 자신의 각 포트(Port 0, Port 1)마다 프레임이 도착한 시간을 측정한다(도 2 참조). 마스터 장치(100)의 지연시간산출모듈(131)이 통신부(110)를 통해 측정 프레임을 다시 수신하면, 측정이 완료된 것으로 판단한다. Then, in step S220, the delay time calculation module 131 of the master device 100 measures the propagation delay time through the reference slave device 210 and the common slave device 220, and calculates the propagation delay time. Step S220 includes steps S221 to S231, and step S220 is performed once. In operation S220, the same operation as in operation S120 is performed, and operations S221 to S231 included in operation S220 are performed in the same manner as operation S121 through operation S131. That is, in steps S211 to S231, the measurement frames are returned to the master device 100 by circulating through all the slave devices 200. [ At this time, when this measurement frame traverses the slave devices 210 and 220 in the network, each of the slave devices 210 and 220 measures the arrival time of the frame for each port (Port 0, Port 1) 2). When the delay time calculation module 131 of the master device 100 receives the measurement frame again through the communication unit 110, it is determined that the measurement is completed.

이에 따라, 마스터 장치(100)의 지연시간산출모듈(131)은 S229 단계에서 참조 슬레이브 장치(210) 및 커먼 슬레이브 장치(220)로부터 측정된 프레임 도착 시간을 수집한다. 그런 다음, 마스터 장치(100)의 지연시간산출모듈(131)은 S231 단계에서 슬레이브 장치(200)의 네트워크 토폴로지에 따라 네트워크 내 노드 간 프레임 전파 지연 시간을 산출한다(수학식 1). Accordingly, the delay time calculation module 131 of the master device 100 collects the measured frame arrival times from the reference slave device 210 and the common slave device 220 in step S229. Then, the delay time calculation module 131 of the master device 100 calculates the frame propagation delay time between nodes in the network according to the network topology of the slave device 200 in step S231 (Equation 1).

S220 단계는 1회 수행되기 때문에 1개의 전파 지연 시간이 산출된다. 이에 따라, 마스터 장치(100)의 지연평균산출모듈(133)은 S240 단계에서 전파 지연 시간의 지수 가중 이동 평균(EWMA: Exponential Weighted Moving Average)을 구한다. 이러한 지수 가중 이동 평균은 다음의 수학식 4에 따라 산출된다. Since step S220 is performed once, one propagation delay time is calculated. Accordingly, the delay average calculation module 133 of the master device 100 obtains an exponential weighted moving average (EWMA) of the propagation delay time in step S240. This exponentially weighted moving average is calculated according to the following equation (4).

Figure pat00018
Figure pat00018

여기서,

Figure pat00019
는 현재의 지수 가중 이동 평균이며,
Figure pat00020
은 초기 지수 가중 이동 평균이며, 초기 지수 가중 이동 평균은 도 4를 참조로 하는 실시예에 따라 산출되는 복수의 전파 지연 시간의 평균이 될 수 있다.
Figure pat00021
는 가중치이며,
Figure pat00022
는 현재 산출된 전파 지연 시간이고,
Figure pat00023
는 이전에 산출된 지수 가중 이동 평균이다. 즉, 수학식 4의 (현재의) 지수 가중 이동 평균은 새로 산출된 전파 지연 시간
Figure pat00024
에 가중치
Figure pat00025
를 적용한 값과 이전에 산출된 지수 가중 이동 평균
Figure pat00026
에 잔여 가중치(1-
Figure pat00027
)를 적용한 평균값이다. 다른 말로, (현재의) 지수 가중 이동 평균
Figure pat00028
는 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행될 때 새로 산출된 전파 지연 시간
Figure pat00029
에 가중치
Figure pat00030
를 적용한 값과 이전에 산출된 지수 가중 이동 평균
Figure pat00031
에 잔여 가중치 (1-
Figure pat00032
)를 적용한 값의 평균이다. here,
Figure pat00019
Is the current exponentially weighted moving average,
Figure pat00020
Is an initial exponential weighted moving average, and the initial exponential weighted moving average may be an average of a plurality of propagation delay times calculated according to an embodiment with reference to FIG.
Figure pat00021
Is a weight,
Figure pat00022
Is the currently calculated propagation delay time,
Figure pat00023
Is the exponentially weighted moving average calculated previously. That is, the (current) exponentially weighted moving average of Equation (4) represents the newly calculated propagation delay time
Figure pat00024
Weight
Figure pat00025
And the previously calculated exponentially weighted moving average
Figure pat00026
Lt; RTI ID = 0.0 > 1-
Figure pat00027
). In other words, the (current) exponentially weighted moving average
Figure pat00028
A new propagation delay time when the system application or control application is re-executed
Figure pat00029
Weight
Figure pat00030
And the previously calculated exponentially weighted moving average
Figure pat00031
Lt; RTI ID = 0.0 > 1-
Figure pat00032
) Is applied.

전술한 바와 같이, 지수 가중 이동 평균을 산출한 후, 마스터 장치(100)의 지연시간기록모듈(135)은 S250 단계에서 산출된 지수 가중 이동 평균을 전파 지연 시간으로 커먼 슬레이브 장치(220)의 레지스터에 기록한다. 이때, 지연시간기록모듈(135)은 통신부(110)를 통해 앞서 산출된 지수 가중 이동 평균이 전파 지연 시간으로 기록된 데이터그램이 포함된 프레임을 커먼 슬레이브 장치(220)로 전송하면, 커먼 슬레이브 장치(220)는 수신된 지수 가중 이동 평균을 전파 지연 시간으로 해당 레지스터에 기록할 수 있다. 이에 따라, 적어도 하나의 커먼 슬레이브 장치(220)는 기록된 지수 가중 이동 평균을 전파 지연 시간으로 하여 분산 시계를 동기화할 수 있다. As described above, after calculating the exponentially weighted moving average, the delay time recording module 135 of the master device 100 calculates the exponentially weighted moving average calculated in step S250 as the propagation delay time, . At this time, when the delay time recording module 135 transmits to the common slave device 220 a frame including the datagram in which the exponentially weighted moving average calculated in advance through the communication unit 110 is recorded as the propagation delay time, The mobile station 220 may record the received exponentially weighted moving average as a propagation delay time in a corresponding register. Accordingly, at least one common slave device 220 can synchronize the distributed clock with the recorded exponentially weighted moving average as the propagation delay time.

전술한 바와 같이, 마스터 장치(100)는 에서 최초 새로운 네트워크 토폴로지 구성 시에 한해 다수 측정을 통하여 전파 지연 시간 평균(초기 지수 가중 이동 평균)을 전파 지연 시간으로 설정하고, 이후에는 시스템 애플리케이션 혹은 제어 애플리케이션이 재실행 될 때마다 1회 전파 지연 시간을 산출한다. 그리고 새로 산출된 전파 지연 시간에 시스템 특성을 고려한 가중치(

Figure pat00033
)를 반영하고, 기존 지수 가중 이동 평균에 잔여 가중치(1-??
Figure pat00034
)를 반영한다. 마스터 장치(100)는 구비된 영구 저장장치(예컨대, flash rom 등)에 해당 네트워크 토폴로지에 대한 지수 가중 이동 평균
Figure pat00035
과 가중치
Figure pat00036
를 저장할 수 있다. 한편, 마스터 장치(100)는 도 4에 보인 바와 같이, 네트워크 내 슬레이브 장치(200)의 네트워크 토폴로지가 변경될 경우, 이를 감지하여 새로이 전파 지연 시간을 측정할 수 있다. As described above, the master device 100 sets the propagation delay time average (initial exponentially weighted moving average) as the propagation delay time through multiple measurements only in the initial configuration of the new network topology, and then the system application or control application And calculates one propagation delay time each time it is re-executed. The newly calculated propagation delay time is weighted considering system characteristics (
Figure pat00033
), And the residual weight (1-?
Figure pat00034
). The master device 100 may provide an exponentially weighted moving average (for example,
Figure pat00035
And weight
Figure pat00036
Can be stored. 4, when the network topology of the slave device 200 in the network is changed, the master device 100 can detect the network topology and measure a new propagation delay time.

한편, 앞서 설명된 본 발명의 실시예에 따른 방법은 다양한 컴퓨터수단을 통하여 판독 가능한 프로그램 형태로 구현되어 컴퓨터로 판독 가능한 기록매체에 기록될 수 있다. 여기서, 기록매체는 프로그램 명령, 데이터 파일, 데이터구조 등을 단독으로 또는 조합하여 포함할 수 있다. 기록매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 예컨대 기록매체는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광 기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치를 포함한다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 와이어뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 와이어를 포함할 수 있다. 이러한 하드웨어 장치는 본 발명의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다. Meanwhile, the method according to the embodiment of the present invention described above can be implemented in a form of a program readable by various computer means and recorded in a computer-readable recording medium. Here, the recording medium may include program commands, data files, data structures, and the like, alone or in combination. Program instructions to be recorded on a recording medium may be those specially designed and constructed for the present invention or may be available to those skilled in the art of computer software. For example, the recording medium may be a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical medium such as a CD-ROM or a DVD, a magneto-optical medium such as a floppy disk magneto-optical media, and hardware devices that are specially configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions may include machine language wires such as those produced by a compiler, as well as high-level language wires that may be executed by a computer using an interpreter or the like. Such a hardware device may be configured to operate as one or more software modules to perform the operations of the present invention, and vice versa.

이상 본 발명을 몇 가지 바람직한 실시예를 사용하여 설명하였으나, 이들 실시예는 예시적인 것이며 한정적인 것이 아니다. 이와 같이, 본 발명이 속하는 기술 분야에서 통상의 지식을 지닌 자라면 본 발명의 사상과 첨부된 특허청구범위에 제시된 권리범위에서 벗어나지 않으면서 균등론에 따라 다양한 변화와 수정을 가할 수 있음을 이해할 것이다. While the present invention has been described with reference to several preferred embodiments, these embodiments are illustrative and not restrictive. It will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit of the invention and the scope of the appended claims.

100: 마스터 장치 110: 통신부
120: 저장부 130: 제어부
131: 지연시간산출모듈 133: 지연평균산출모듈
135: 지연시간기록모듈 200: 슬레이브 장치
210: 참조 슬레이브 장치 220: 커먼 슬레이브 장치
100: Master device 110:
120: storage unit 130:
131: delay time calculating module 133: delay average calculating module
135: delay time recording module 200: slave device
210: Reference slave device 220: Common slave device

Claims (3)

마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 장치에 있어서,
참조 슬레이브 장치 및 적어도 하나의 커먼 슬레이브 장치를 포함하는 슬레이브 장치와 이더캣(EtherCAT) 네트워크를 통해 연결되어 통신하는 통신부;
시스템 애플리케이션 혹은 제어 애플리케이션이 재실행되면, 상기 커먼 슬레이브 장치의 전파 지연 시간을 산출하는 지연시간산출모듈;
상기 산출된 전파 지연 시간과 이전에 산출된 지수 가중 이동 평균을 이용하여 현재의 지수 가중 이동 평균을 산출하는 지연평균산출모듈; 및
상기 산출된 현재의 지수 가중 이동 평균을 전파 지연 시간으로 상기 커먼 슬레이브 장치가 레지스터에 기록하도록 상기 산출된 현재의 지수 가중 이동 평균 상기 통신부를 통해 전송하는 지연시간기록모듈;을 포함하는 것을 특징으로 하는 마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 장치.
An apparatus for use in an ether-based distributed clock synchronization of a master device,
A communication unit connected to a slave device including a reference slave device and at least one common slave device through an EtherCAT network;
A delay time calculation module for calculating a propagation delay time of the common slave device when the system application or the control application is re-executed;
A delay averaging module for calculating a current exponentially weighted moving average using the calculated propagation delay time and the previously calculated exponentially weighted moving average; And
And a delay time recording module that transmits the calculated current exponentially weighted moving average through the communication unit so that the common slave device records the calculated current exponentially weighted moving average as a propagation delay time in the register Device for distributed clock synchronization of an ethercat based master device.
마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 방법에 있어서,
시스템 애플리케이션 혹은 제어 애플리케이션이 재실행되면, 참조 슬레이브 장치 및 적어도 하나의 커먼 슬레이브 장치를 포함하는 슬레이브 장치 중 상기 커먼 슬레이브 장치의 전파 지연 시간을 산출하는 단계;
상기 산출된 전파 지연 시간과 이전에 산출된 지수 가중 이동 평균을 이용하여 현재의 지수 가중 이동 평균을 산출하는 단계; 및
상기 산출된 현재의 지수 가중 이동 평균을 전파 지연 시간으로 상기 커먼 슬레이브 장치가 레지스터에 기록하도록 상기 산출된 현재의 지수 가중 이동 평균 전송하는 단계;를 포함하는 것을 특징으로 하는 마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 방법.
A method for an Ethernet-based distributed clock synchronization of a master device,
Calculating a propagation delay time of the common slave device among the slave devices including the reference slave device and the at least one common slave device when the system application or the control application is re-executed;
Calculating a current exponentially weighted moving average using the calculated propagation delay time and a previously calculated exponentially weighted moving average; And
And transmitting the calculated current exponentially weighted moving average to the register so that the common slave device records the calculated exponentially weighted moving average as a propagation delay time. Method for distributed clock synchronization.
제2항에 따른 마스터 장치의 이더캣 기반의 분산 시계 동기화를 위한 방법이 기록된 컴퓨터 판독 가능한 기록매체. A computer-readable recording medium on which is recorded a method for the Ethernet-based distributed clock synchronization of a master device according to claim 2.
KR1020160067212A 2016-05-31 2016-05-31 Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method KR20170135384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160067212A KR20170135384A (en) 2016-05-31 2016-05-31 Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160067212A KR20170135384A (en) 2016-05-31 2016-05-31 Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method

Publications (1)

Publication Number Publication Date
KR20170135384A true KR20170135384A (en) 2017-12-08

Family

ID=60920200

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160067212A KR20170135384A (en) 2016-05-31 2016-05-31 Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method

Country Status (1)

Country Link
KR (1) KR20170135384A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108445830A (en) * 2018-03-13 2018-08-24 大连理工大学 A kind of wave maker control system based on multi-controller synchronous control
CN112147956A (en) * 2019-06-26 2020-12-29 丰田自动车株式会社 Distributed control system
KR20210026241A (en) 2019-08-29 2021-03-10 주식회사 효원파워텍 System and method for clock synchronization based on ethercat network
KR20240063516A (en) 2022-11-03 2024-05-10 한국로봇융합연구원 Hydraulic system using multiple manipulators

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108445830A (en) * 2018-03-13 2018-08-24 大连理工大学 A kind of wave maker control system based on multi-controller synchronous control
CN108445830B (en) * 2018-03-13 2020-11-06 大连理工大学 Wave making machine control system based on multi-controller synchronous control
CN112147956A (en) * 2019-06-26 2020-12-29 丰田自动车株式会社 Distributed control system
KR20210026241A (en) 2019-08-29 2021-03-10 주식회사 효원파워텍 System and method for clock synchronization based on ethercat network
KR20240063516A (en) 2022-11-03 2024-05-10 한국로봇융합연구원 Hydraulic system using multiple manipulators

Similar Documents

Publication Publication Date Title
KR102013617B1 (en) Method and apparatus for synchronizing time
US9398080B2 (en) Control device, image processing device, control method, computer-readable recording medium, and program
JP6192995B2 (en) COMMUNICATION DEVICE, COMMUNICATION SYSTEM, COMMUNICATION METHOD, AND COMPUTER PROGRAM
KR20170135384A (en) Apparatus for distributed clock synchronization based on EtherCAT, method thereof and computer recordable medium storing the method
US11316605B2 (en) Method, device, and computer program for improving synchronization of clocks in devices linked according to a daisy-chain topology
US9270481B2 (en) Communication system and method for isochronous data transmission in real time
US9456032B2 (en) Peer-to-peer networking through universal port connections
KR102291573B1 (en) Synchronization method and system among multiple MCUs in EtherCAT-based slave system
KR102614829B1 (en) Apparatus and method for synchoronizing clock
WO2019209585A1 (en) Timing synchronization over cable networks
JP5675703B2 (en) Communication device, control device, and program
WO2019140638A1 (en) Positioning system and time synchronization control and apparatus therefor
KR101492910B1 (en) Method and system for ethercat-based distributed clokc synchronization
Gutiérrez et al. Time synchronization in modular collaborative robots
JP4961589B2 (en) Network system and slave synchronization method
CN103986601A (en) Message transmission delay obtaining method and device
US20220286267A1 (en) Control system, information processing device, and non-transitory computer readable medium
US20190229885A1 (en) Computing device and control system
JP6400553B2 (en) Numerical control system with synchronous control function between units
CN109660310B (en) Clock synchronization method and device, computing equipment and computer storage medium
US20170117980A1 (en) Time synchronization for network device
KR101379248B1 (en) Ethernet communication system and time synchronization method
KR102064575B1 (en) Method, apparatus, system and computer program for enhancing the accuracy of Time Synchronization between devices
KR101748268B1 (en) Synchronization method of can communication and computer-readable medium storing program for executing the same
CN113228564B (en) Stamping processing method and device