CN104838615B - Signal synchronization system, node synchronization system, signal synchronization method, and node synchronization method - Google Patents
Signal synchronization system, node synchronization system, signal synchronization method, and node synchronization method Download PDFInfo
- Publication number
- CN104838615B CN104838615B CN201280077569.7A CN201280077569A CN104838615B CN 104838615 B CN104838615 B CN 104838615B CN 201280077569 A CN201280077569 A CN 201280077569A CN 104838615 B CN104838615 B CN 104838615B
- Authority
- CN
- China
- Prior art keywords
- reference signal
- value
- count value
- node
- synchronization
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 125
- 230000008569 process Effects 0.000 claims abstract description 85
- 238000012937 correction Methods 0.000 claims description 181
- 230000005540 biological transmission Effects 0.000 claims description 166
- 230000001360 synchronised effect Effects 0.000 claims description 92
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 claims description 72
- 238000004891 communication Methods 0.000 claims description 44
- 238000006243 chemical reaction Methods 0.000 claims description 7
- 230000015572 biosynthetic process Effects 0.000 claims 1
- 230000002035 prolonged effect Effects 0.000 claims 1
- 238000003786 synthesis reaction Methods 0.000 claims 1
- 238000012545 processing Methods 0.000 description 133
- 238000010586 diagram Methods 0.000 description 23
- 230000004044 response Effects 0.000 description 21
- 238000004364 calculation method Methods 0.000 description 20
- 238000003860 storage Methods 0.000 description 16
- 238000002360 preparation method Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 9
- 230000003111 delayed effect Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 239000000470 constituent Substances 0.000 description 2
- 238000003754 machining Methods 0.000 description 2
- 230000010355 oscillation Effects 0.000 description 2
- 230000006641 stabilisation Effects 0.000 description 2
- 238000011105 stabilization Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 229910000831 Steel Inorganic materials 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000010959 steel Substances 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
- G06F1/06—Clock generators producing several clock signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0682—Clock 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)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
Abstract
Description
技术领域technical field
本发明涉及用于使规定的信号同步的信号同步系统、节点同步系统、信号同步方法以及节点同步方法。The present invention relates to a signal synchronization system, a node synchronization system, a signal synchronization method, and a node synchronization method for synchronizing predetermined signals.
背景技术Background technique
以往,在利用处理器等来执行规定的程序这样的情况下,出于应对大规模处理或加快处理速度、分散负荷等目的,已知有利用多个处理器来执行处理的多处理器系统。在这样的多处理器系统中,为了在多个处理器之间实现计数器(定时器)的同步,使主处理器对从处理器的计数器产生中断信号等,从处理器根据该中断信号来实现计数器的同步。Conventionally, when a predetermined program is executed by a processor or the like, a multiprocessor system is known that executes processing by a plurality of processors for the purpose of coping with large-scale processing, increasing the processing speed, and distributing the load. In such a multiprocessor system, in order to realize the synchronization of counters (timers) between multiple processors, the master processor generates an interrupt signal to the counter of the slave processor, etc., and the slave processor realizes the timer according to the interrupt signal. Synchronization of counters.
另外,在现有的工厂控制用传输系统等产业用网络中,构成系统的各设备需要在保证实时性的基础上来相互进行大容量的数据交换。因此,在例如根据搭载于各设备的应用程序的访问请求的发生,事件性地相互访问的情况下,网络负荷取决于应用程序,从而有可能无法保证实时性。In addition, in an existing industrial network such as a transmission system for factory control, each device constituting the system needs to exchange large-capacity data with each other while ensuring real-time performance. Therefore, for example, when mutual access is event-based based on the occurrence of an access request from an application installed in each device, the network load depends on the application, and real-time performance may not be guaranteed.
因此,以往存在如下技术:对各设备设置虚拟的共享存储器(共用存储器),在更新定时(timing)向网络上的所有节点(站)发送本节点数据。在使用上述技术的情况下,接收到的各节点通过更新其数据,并供应用程序来访问,从而实现保证了实时性的数据交换方式。另外,以往,提出有用于在进行上述数据交换时,实现网络上的有效广播通信(BROADCAST COMMUNICATION)的方法(例如,参照专利文献1)。Therefore, conventionally, there has been a technique in which a virtual shared memory (common memory) is provided for each device, and own-node data is transmitted to all nodes (stations) on the network at update timing. In the case of using the above technology, the received nodes update their data and make it available for application programs to access, thereby realizing a data exchange mode that ensures real-time performance. In addition, conventionally, a method for realizing efficient broadcast communication (BROADCAST COMMUNICATION) on a network during the above-mentioned data exchange has been proposed (for example, refer to Patent Document 1).
在专利文献1中,同时使用利用各节点的内置定时器的时分复用访问方式、以及基于来自主控节点的同步化帧的从属节点的内置定时器修正。另外,在专利文献1所示的方法中,构成为利用总线或串行电缆来将传输路径相连接的网络。In Patent Document 1, a time-division multiplexing access method using a built-in timer of each node and a built-in timer correction of a slave node based on a synchronization frame from a master node are used together. In addition, in the method disclosed in Patent Document 1, a network is configured in which transmission paths are connected by a bus or a serial cable.
现有技术文献prior art literature
专利文献patent documents
专利文献1:日本专利特开2005-159754号公报Patent Document 1: Japanese Patent Laid-Open No. 2005-159754
发明内容Contents of the invention
发明所要解决的技术问题The technical problem to be solved by the invention
然而,在上述的主处理器与从处理器等之间进行的计数器同步修正处理中,优选主处理器直接(从硬件上)使从处理器的计数器复位。但是,由于该计数器是作为在内部进行的多个程序处理的执行标准的计数器,因此若可随意地由外部进行改写,则其它处理可能会产生问题。另外,在计数器内置于从处理器的CPU(Central Processing Unit:中央处理器)等中的情况下,无法从主处理器直接对从处理器的计数器进行复位。因此,以往,一旦从主处理器向从处理器发送中断信号,则从处理器接收该信号,并利用规定的软件来间接地(从软件上)执行计数器的复位处理。However, in the above-mentioned counter synchronization correction process performed between the master processor and the slave processor, it is preferable that the master processor directly (slave hardware) reset the counter of the slave processor. However, since this counter is used as an execution standard for a plurality of program processes performed internally, if it can be freely rewritten from the outside, problems may arise in other processes. In addition, when the counter is built in a CPU (Central Processing Unit: central processing unit) of the slave processor, etc., the counter of the slave processor cannot be reset directly from the master processor. Therefore, conventionally, when an interrupt signal is sent from the master processor to the slave processor, the slave processor receives the signal and indirectly (software-wise) executes counter reset processing by predetermined software.
上述情况下,从处理器在从主处理器接收到中断信号之后,直到执行与该信号相对应的本计数器的复位处理为止的期间,由于系统开销(overhead)等而产生延迟时间。因此,以往,即使进行了复位处理,主处理器与从处理器之间也仍然存在计数器同步误差。In the above case, a delay time occurs due to overhead (overhead) or the like between the slave processor receiving the interrupt signal from the master processor and executing the reset process of its own counter corresponding to the signal. Therefore, conventionally, even if reset processing is performed, there is still a counter synchronization error between the master processor and the slave processor.
另外,对于网络间具有主从关系的节点间的计数器的同步,考虑例如通过接收同步化帧来清零定时器等方法。然而,与上述相同,若在接收到同步化帧之后经由固件来使定时器清零,则会由于该系统开销等延迟时间而在计数器中产生误差。In addition, for the synchronization of counters between nodes having a master-slave relationship between networks, for example, a method such as clearing a timer by receiving a synchronization frame is conceivable. However, as described above, if the timer is cleared by firmware after the synchronization frame is received, an error will occur in the counter due to delay time such as the system overhead.
因此,对于作为现有方法的利用同步化帧的节点间的同步方法,在利用微机的固件来进行主控节点与各从属节点之间的同步时间的测定修正的情况下,会由于微机的处理时间而产生误差。Therefore, in the conventional method of synchronizing the nodes using the synchronization frame, when the firmware of the microcomputer is used to measure and correct the synchronization time between the master node and each slave node, the processing of the microcomputer error due to time.
因此,为了抑制因计数器的改写而带来的对其它处理的影响,考虑以下方法:从硬件上对从主处理器发送至从处理器的中断信号进行计数,基于与从处理器内的计数器之间的差分,来调整从处理器的计数器的计数目标(基准值),从而实现主处理器与从处理器之间的同步。Therefore, in order to suppress the impact on other processes caused by the rewriting of the counter, the following method is considered: the slave hardware counts the interrupt signals sent from the master processor to the slave processor, based on the relationship with the counter in the slave processor. The difference between them is used to adjust the count target (reference value) of the counter of the slave processor, so as to realize the synchronization between the master processor and the slave processor.
由于主处理器的计数器与从处理器的计数器各自的电气特性不同,因此难以推定主处理器与从处理器之间计数器有多少偏差。因此,若在每个中断信号时进行调整上述从处理器的计数器的基准值的同步修正处理,则能确保主处理器与从处理器之间的同步。然而,若频繁地进行同步修正处理,则其处理负荷增大,有可能对本来要执行的其它处理产生影响。Since the counters of the master processor and the counters of the slave processors have different electrical characteristics, it is difficult to estimate how many counters there are between the master processor and the slave processors. Therefore, if the synchronization correction process of adjusting the reference value of the counter of the slave processor is performed every interrupt signal, the synchronization between the master processor and the slave processor can be ensured. However, if the synchronization correction processing is performed frequently, the processing load increases, which may affect other processing that should be executed originally.
本发明鉴于上述内容而得以完成,其目的在于提供一种信号同步系统、节点同步系统、信号同步方法以及节点同步方法,能够抑制处理负荷并高精度地使规定的信号同步。The present invention has been made in view of the foregoing, and an object of the present invention is to provide a signal synchronization system, a node synchronization system, a signal synchronization method, and a node synchronization method capable of synchronizing predetermined signals with high precision while suppressing processing load.
解决技术问题所采用的技术方案Technical solutions adopted to solve technical problems
为了解决上述问题,本发明的信号同步系统包含根据第1基准信号进行动作的主模块、以及根据第2基准信号进行动作的从模块,并使该第2基准信号与该第1基准信号同步,其特征在于,主模块包括:第1基准信号生成部,该第1基准信号生成部通过进行计数,在计数值达到预先设定的基准值时,生成第1基准信号,从模块包括:第2基准信号生成部,该第2基准信号生成部通过进行计数,在计数值达到基准值时,生成第2基准信号;间隔计数部,该间隔计数部对进行同步修正处理的间隔进行计数;系统开销计数部,该系统开销计数部在间隔计数部中计数值达到进行同步修正处理的修正处理间隔值之后,接收第1基准信号,从而重新启动,并进行计数;计数值获取部,该计数值获取部在间隔计数部中计数值达到修正处理间隔值之后,根据第1基准信号的接收来获取第2基准信号生成部的计数值及系统开销计数部的计数值;以及同步修正部,该同步修正部将抵消第2基准信号生成部的计数值与系统开销计数部的计数值之间的差分的值作为基准值暂时性地设定于第2基准信号生成部。In order to solve the above problems, the signal synchronization system of the present invention includes a master module that operates based on a first reference signal, and a slave module that operates based on a second reference signal, and synchronizes the second reference signal with the first reference signal, It is characterized in that the master module includes: a first reference signal generating part, and the first reference signal generating part generates a first reference signal when the count value reaches a preset reference value by counting, and the slave module includes: a second A reference signal generation unit, the second reference signal generation unit generates a second reference signal by counting when the count value reaches the reference value; an interval counting unit, the interval counting unit counts the intervals for synchronous correction processing; system overhead A counting unit, the system overhead counting unit receives the first reference signal after the count value in the interval counting unit reaches the correction processing interval value for synchronous correction processing, thereby restarting, and counting; a count value acquisition unit, the count value acquisition After the count value in the interval counting part reaches the correction processing interval value, the count value of the second reference signal generating part and the count value of the system overhead counting part are acquired according to the reception of the first reference signal; and the synchronous correction part, the synchronous correction The unit temporarily sets, as a reference value, a value that cancels out a difference between the count value of the second reference signal generation unit and the count value of the overhead count unit in the second reference signal generation unit.
此外,本发明也包含将本发明的构成要素、表现或构成要素的任意组合应用于方法、装置、系统、计算机程序、记录介质、数据结构等而得到的技术方案。In addition, the present invention also includes technical solutions obtained by applying the constituent elements, expressions, or arbitrary combinations of constituent elements of the present invention to methods, devices, systems, computer programs, recording media, data structures, and the like.
发明效果Invention effect
根据本发明,能够在抑制处理负荷的同时高精度地使规定的信号同步。According to the present invention, predetermined signals can be synchronized with high precision while suppressing the processing load.
附图说明Description of drawings
图1是表示实施方式1的信号同步系统的大致结构的一个示例的图。FIG. 1 is a diagram showing an example of a schematic configuration of a signal synchronization system according to Embodiment 1. As shown in FIG.
图2是表示处理器模块的硬件结构的一个示例的图。FIG. 2 is a diagram showing an example of a hardware configuration of a processor module.
图3是用于说明实施方式1中的同步修正处理例的时序图(之一)。FIG. 3 is a sequence diagram (Part 1) for explaining an example of synchronization correction processing in Embodiment 1. FIG.
图4是用于说明实施方式1中的同步修正处理例的时序图(之二)。FIG. 4 is a sequence diagram (Part 2) for explaining an example of synchronization correction processing in Embodiment 1. FIG.
图5是用于说明实施方式1中的同步修正处理例的时序图(之三)。FIG. 5 is a sequence diagram (Part 3 ) for explaining an example of synchronization correction processing in Embodiment 1. FIG.
图6是表示信号同步方法的大致顺序的示例的图。FIG. 6 is a diagram showing an example of a rough procedure of a signal synchronization method.
图7是表示实施方式2中的节点同步系统的大致结构的一个示例的图。FIG. 7 is a diagram showing an example of a schematic configuration of a node synchronization system in Embodiment 2. FIG.
图8是用于说明实施方式2中的同步修正处理例的时序图(之一)。FIG. 8 is a sequence diagram (Part 1) for explaining an example of synchronization correction processing in Embodiment 2. FIG.
图9是用于说明实施方式2中的同步修正处理例的时序图(之二)。FIG. 9 is a sequence diagram (Part 2) for explaining an example of synchronization correction processing in Embodiment 2. FIG.
图10是用于说明实施方式2中的同步修正处理例的时序图(之三)。FIG. 10 is a sequence diagram (Part 3) for explaining an example of synchronization correction processing in Embodiment 2. FIG.
图11是用于说明实施方式2中的传输延迟时间的通知步骤的一个示例的图。FIG. 11 is a diagram for explaining an example of a notification procedure of a transmission delay time in Embodiment 2. FIG.
图12是表示包含有实施方式2中的使用了主控节点及从属节点的节点同步系统的网络传输系统的大致结构的一个示例的图。FIG. 12 is a diagram showing an example of a schematic configuration of a network transmission system including a node synchronization system using a master node and slave nodes in Embodiment 2. FIG.
图13是表示节点同步方法的大致顺序的示例的图。FIG. 13 is a diagram showing an example of a rough procedure of a node synchronization method.
具体实施方式detailed description
下面,参照附图对本发明的优选实施方式进行详细说明。所涉及的实施方式中所示出的尺寸、材料、其它具体数值等仅仅是为易于理解本发明而举出的示例,除明确表示的情况之外,均不局限于本发明所示出的示例。此外,在本说明书及附图中,关于具有实质相同的功能、结构的要素,通过标注同一标号来省略重复说明,另外,对与本发明无直接关系的要素省略图示。Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings. The dimensions, materials, and other specific numerical values shown in the related embodiments are merely examples for easy understanding of the present invention, and are not limited to the examples shown in the present invention except in cases explicitly indicated. . In this specification and the drawings, elements having substantially the same function and structure are assigned the same reference numerals to omit repeated description, and illustration of elements not directly related to the present invention is omitted.
(关于本实施方式)(about this embodiment)
本实施方式中,例如在多个处理器模块、至少分别包含一个处理器模块的多个节点、装置、基板这样的具有主从关系的模块之间进行计数器(定时器)同步的情况下,对于来自主模块侧的中断信号(计数器复位信号)求出从模块侧的系统开销值。另外,在本实施方式中,基于求出的系统开销值与从模块侧的计数器来进行同步修正处理。In this embodiment, for example, when synchronizing counters (timers) between multiple processor modules, multiple nodes each including at least one processor module, multiple nodes, devices, and substrates that have a master-slave relationship, the An interrupt signal (counter reset signal) from the master module side calculates the overhead value of the slave module side. In addition, in this embodiment, synchronization correction processing is performed based on the obtained overhead value and the counter on the slave module side.
然而,若频繁地执行该同步修正处理,则处理负荷会增大,因此在本实施方式中,对进行同步修正处理的间隔进行计数,按规定的修正处理间隔值来定期地(间歇性地)执行同步修正处理。However, if this synchronous correction process is executed frequently, the processing load will increase. Therefore, in this embodiment, the intervals at which the synchronous correction process is performed are counted, and periodically (intermittently) at a predetermined correction process interval value. Execute synchronous correction processing.
另外,在本实施方式中,在将具有主从关系的装置设为主控节点及从属节点的情况下,将通信路径上的延迟时间(传输延迟时间)也考虑在内来进行同步修正处理。In addition, in the present embodiment, when the devices having a master-slave relationship are set as the master node and the slave node, the synchronization correction process is performed taking into account the delay time (transmission delay time) on the communication path.
下面,利用附图对本实施方式中的信号同步系统以及节点同步系统的优选实施方式进行说明。Next, preferred embodiments of the signal synchronization system and the node synchronization system in this embodiment will be described with reference to the drawings.
(实施方式1:信号同步系统)(Embodiment 1: Signal Synchronization System)
图1是表示实施方式1的信号同步系统的大致结构的一个示例的图。图1所示的信号同步系统10中,作为一个示例,示出了用于在作为模块的多个处理器模块(图1的示例中为处理器模块11a~11c)之间,进行计数器同步的多处理器的一个示例。FIG. 1 is a diagram showing an example of a schematic configuration of a signal synchronization system according to Embodiment 1. As shown in FIG. In the signal synchronization system 10 shown in FIG. 1 , as an example, a method for performing counter synchronization among a plurality of processor modules as modules (processor modules 11a to 11c in the example in FIG. 1 ) is shown. An example of a multiprocessor.
图1所示的信号同步系统10具有:多个处理器模块11a~11c(以下根据需要称为“处理器模块11”)、传输总线12、I/O(输入输出)模块13(图中以13a~13d来示出)、外部设备14(图1中以14a~14d来示出)以及编译装置15。此处,在图1的示例中,为了说明方便,将处理器模块11a设为主处理器模块,将处理器模块11b、11c设为从处理器模块,对各个处理器模块的主要结构进行说明。其中,从处理器模块的数量等并不局限于图1中那样的两个。The signal synchronization system 10 shown in FIG. 1 has: a plurality of processor modules 11a-11c (hereinafter referred to as "processor modules 11" as needed), a transmission bus 12, and an I/O (input and output) module 13 (referred to as 13a-13d), the external device 14 (shown as 14a-14d in FIG. 1 ), and the compiling device 15. Here, in the example of FIG. 1 , for convenience of explanation, the processor module 11a is set as the master processor module, and the processor modules 11b and 11c are set as the slave processor modules, and the main structures of each processor module will be described. . Wherein, the number of slave processor modules is not limited to two as shown in FIG. 1 .
此外,本实施方式中,并不局限于上述结构,单个处理器模块均具有相同结构,以使得其既可以成为主处理器模块11a,又可以成为从处理器11b、11c。另外,各处理器模块11通过传输总线12相连接。此外,在实施方式1中,设为不会因为传输总线12而产生延迟时间。In addition, in this embodiment, it is not limited to the above-mentioned structure, and each single processor module has the same structure, so that it can be the master processor module 11a, and can also be the slave processor module 11b, 11c. In addition, the respective processor modules 11 are connected via a transmission bus 12 . In addition, in Embodiment 1, it is assumed that no delay time is generated due to the transmission bus 12 .
此处,主处理器模块11a具有第1基准信号生成部21、第1运算部22、以及存储部23。此外,在图1的示例中,第1基准信号生成部21内置于后述的CPU,但并不局限于此,例如第1基准信号生成部21与CPU也可以分开构成。另外,上述的“内置”例如表示仅CPU内的各功能部(第1基准信号生成部21、第1运算部22)能对第1基准信号生成部21进行访问。Here, the main processor module 11 a has a first reference signal generation unit 21 , a first calculation unit 22 , and a storage unit 23 . In addition, in the example of FIG. 1 , the first reference signal generating unit 21 is incorporated in a CPU described later, but the present invention is not limited thereto. For example, the first reference signal generating unit 21 and the CPU may be configured separately. In addition, the above-mentioned "built-in", for example, means that only each functional unit (first reference signal generation unit 21 , first calculation unit 22 ) in the CPU can access the first reference signal generation unit 21 .
另外,从处理器模块11b、11c具有第2基准信号生成部31、第2运算部32、间隔计数部33、系统开销计数部34、计数值获取部35、同步判断部36、同步修正部37、以及存储部38。此外,在图1的示例中,第2基准信号生成部31内置于CPU,但并不局限于此,例如第2基准信号生成部31与CPU也可以分开构成。In addition, the slave processor modules 11b and 11c have a second reference signal generating unit 31, a second calculating unit 32, an interval counting unit 33, an overhead counting unit 34, a count value acquiring unit 35, a synchronization judging unit 36, and a synchronization correcting unit 37. , and the storage unit 38 . In addition, in the example of FIG. 1 , the second reference signal generating unit 31 is incorporated in the CPU, but the present invention is not limited thereto. For example, the second reference signal generating unit 31 and the CPU may be configured separately.
第1基准信号生成部21通过进行计数,使计数值达到预先设定的基准值,从而生成第1基准信号。此外,第1基准信号生成部21起到硬件性的计数器(以下根据需要也称作“定时器”)的功能。基于基准值周期性地对上述计数值进行计数。图1中,以虚线来表示上述硬件性的计数器。The first reference signal generation unit 21 generates a first reference signal by counting until the count value reaches a preset reference value. In addition, the first reference signal generation unit 21 functions as a hardware counter (hereinafter also referred to as a “timer” as necessary). The count value described above is periodically counted based on the reference value. In FIG. 1, the above-mentioned hardware counters are indicated by dotted lines.
第1运算部22根据由第1基准信号生成部21生成的第1基准信号,执行(运算)存储在存储部23中的规定的应用程序等。另外,第1基准信号作为中断信号(计数器复位信号)经由传输总线12提供(发送)至从处理器模块11b、11c。The first calculation unit 22 executes (calculates) a predetermined application program and the like stored in the storage unit 23 based on the first reference signal generated by the first reference signal generation unit 21 . In addition, the first reference signal is supplied (transmitted) as an interrupt signal (counter reset signal) to the slave processor modules 11b and 11c via the transfer bus 12 .
存储部23存储在第1运算部22进行运算的规定的应用程序(Sequence Program:顺序程序)。此外,第1运算部22进行运算的规定的应用程序是对例如与主处理器模块11a相连的I/O模块13a发出指示,并利用I/O模块13a对外部设备14a进行控制的处理。因此,存储部23中主要存储有用于对与本处理器模块11a相连的I/O模块13a、外部设备14a执行规定处理的程序。The storage unit 23 stores a predetermined application program (Sequence Program) that is calculated by the first calculation unit 22 . In addition, the predetermined application program that the first calculation unit 22 performs calculations is, for example, a process of instructing the I/O module 13a connected to the main processor module 11a and controlling the external device 14a using the I/O module 13a. Therefore, the storage unit 23 mainly stores programs for executing predetermined processing on the I/O module 13a connected to the processor module 11a and the external device 14a.
也就是说,主处理器模块11a在每个规定周期生成第1基准信号,第1运算部22通过根据第1基准信号执行(运算)应用程序(顺序程序),来对规定的设备进行控制,周期性地执行该应用程序(顺序程序)。That is, the main processor module 11a generates the first reference signal every predetermined cycle, and the first calculating unit 22 controls a predetermined device by executing (calculating) an application program (sequence program) based on the first reference signal, The application program (sequence program) is executed periodically.
接着,对从处理器模块11b、11c进行说明,但由于从处理器模块11b、11c的结构相同,因此在以下说明中,利用从处理器模块11b进行说明,省略从处理器模块11c的说明。Next, the slave processor modules 11b and 11c will be described, but since the slave processor modules 11b and 11c have the same configuration, in the following description, the slave processor module 11b will be used for description, and the description of the slave processor module 11c will be omitted.
第2基准信号生成部31进行计数,并设定与上述第1基准信号生成部21中所设置的基准值相同的基准值,并通过使计数值达到基准值,从而生成第2基准信号。此外,第2基准信号生成部31起到硬件性的计数器的功能。基于基准值周期性地对上述计数值进行计数。另外,第1基准信号生成部21与第2基准信号生成部31各自的计数器是自运行计数器(free-running counter),自行进行推进。The second reference signal generation unit 31 counts, sets the same reference value as the reference value set in the first reference signal generation unit 21 , and generates the second reference signal by making the count value reach the reference value. In addition, the second reference signal generation unit 31 functions as a hardware counter. The count value described above is periodically counted based on the reference value. In addition, the respective counters of the first reference signal generating unit 21 and the second reference signal generating unit 31 are free-running counters, and advance by themselves.
第2运算部32根据由第2基准信号生成部31生成的第2基准信号,执行(运算)存储在存储部38中的规定的应用程序等。The second calculation unit 32 executes (calculates) a predetermined application program or the like stored in the storage unit 38 based on the second reference signal generated by the second reference signal generation unit 31 .
此外,第2基准信号生成部31是仅能从例如CPU内的第2运算部32进行访问的计数器,且内置于CPU内(CPU内置计数器)。也就是说,第2基准信号生成部31是无法从主处理器模块11a等外部进行硬件式复位的计数器。In addition, the second reference signal generating unit 31 is a counter that can be accessed only from the second calculation unit 32 in the CPU, for example, and is built in the CPU (CPU built-in counter). That is, the second reference signal generation unit 31 is a counter that cannot be reset by hardware from the outside such as the main processor module 11a.
另外,第2运算部32将来自主处理器模块11a的第1基准信号(同步基准信号)作为中断信号来进行接收,启动后述的同步修正处理。In addition, the second calculation unit 32 receives the first reference signal (synchronization reference signal) from the main processor module 11a as an interrupt signal, and starts a synchronization correction process described later.
间隔计数部33进行计数,预先设定有与进行同步处理的修正处理间隔相当的修正处理间隔值,在计数值达到修正处理间隔值的情况下,生成表示该情况的修正处理开始信号。The interval counting unit 33 counts, presets a correction processing interval value corresponding to the correction processing interval at which synchronization processing is performed, and generates a correction processing start signal indicating that when the count value reaches the correction processing interval value.
此外,修正处理间隔值通过以下的计算来设定。例如,将为了满足该信号同步系统所要求的加工精度而所容许的主处理器模块11a与从处理器模块11b之间的同步误差设为10μs。该情况下,本实施方式中,对到同步误差为1~5μs为止的最短时间进行计算。此处,将同步误差设为1μs以上是由于若比1μs还要短,则同步修正处理的频率变高,处理负荷增大,而将同步误差设为5μs以下则是考虑到相对于10μs的裕量。In addition, the correction processing interval value is set by the following calculation. For example, the allowable synchronization error between the master processor module 11a and the slave processor module 11b in order to satisfy the machining accuracy required by the signal synchronization system is set to 10 μs. In this case, in this embodiment, the shortest time until the synchronization error becomes 1 to 5 μs is calculated. Here, the synchronization error is set to 1 μs or more because if it is shorter than 1 μs, the frequency of the synchronization correction process will increase and the processing load will increase. quantity.
此时,将主处理器模块11a与从处理器模块11b中使用的振荡器的频率设为50MHz,振荡精度设为50ppm。该条件下,同步误差变为1μs的最短时间是一个时钟的时间×同步允许误差偏离的振荡次数,即,20ns×((1μs/20ns)×(1/50ppm))=20ms。同样,同步误差变为5μs的最短时间为100ms。因此,修正时间间隔值设为将20ms~100ms转换成计数值后得到的值即可。通过将修正处理间隔值设定在上述范围内,并间歇性地执行同步修正处理,从而能在抑制处理负荷的同时,实现更高的加工精度、提高生产质量。At this time, the frequency of the oscillators used in the master processor module 11 a and the slave processor module 11 b is set to 50 MHz, and the oscillation precision is set to 50 ppm. Under this condition, the shortest time for the synchronization error to become 1 μs is the time of one clock × the number of oscillations for which the synchronization error deviates, that is, 20 ns × ((1 μs/20 ns) × (1/50 ppm)) = 20 ms. Likewise, the minimum time for the synchronization error to become 5µs is 100ms. Therefore, the corrected time interval value may be a value obtained by converting 20 ms to 100 ms into a count value. By setting the correction processing interval value within the above range and intermittently executing the synchronous correction processing, it is possible to achieve higher machining accuracy and improve production quality while suppressing the processing load.
系统开销计数部34进行计数,并在接收到修正处理开始信号后,即,在间隔计数部33的计数值达到修正处理间隔值之后,测量出以上述第1基准信号的接收为起点、直到执行同步修正处理为止的系统开销值。具体而言,系统开销计数部34起到接收到第1基准信号后重新启动的硬件性的计数器(定时器)的功能。The system overhead counting unit 34 performs counting, and after receiving the correction process start signal, that is, after the count value of the interval counting unit 33 reaches the correction process interval value, measures the time starting from the reception of the above-mentioned first reference signal until execution. System overhead value up to synchronization correction processing. Specifically, the overhead counting unit 34 functions as a hardware counter (timer) that is restarted after receiving the first reference signal.
由于系统开销计数部34是由硬件构成的计数器,因此直接对第1基准信号做出反应,而同步修正处理例如在用于读取计数值的准备完成之前需要花费时间。用于读取该计数值的准备完成之前所需的时间即为系统开销。此外,系统开销表示从发生某个事件起到实际执行针对该事件的处理(软件)为止的延迟时间,而本示例中系统开销是从系统开销计数部34重启的起点到实际进行同步修正处理为止的时间,但并不局限于此。Since the overhead counting unit 34 is a counter constituted by hardware, it directly responds to the first reference signal, but the synchronization correction process takes time until preparations for reading the count value are completed, for example. The overhead is the time required until the preparation for reading the count value is complete. In addition, the system overhead represents the delay time from the occurrence of a certain event to the actual execution of the processing (software) corresponding to the event. In this example, the system overhead is from the restart point of the system overhead counting unit 34 to the actual execution of the synchronization correction process. time, but not limited to this.
计数值获取部35在接收到修正处理开始信号后,即,在间隔计数部33的计数值达到修正处理间隔值之后,根据第1基准信号的接收,获取实际执行同步修正处理的时刻(开始时刻)的第2基准信号生成部31的计数值以及系统开销计数部34的计数值。After the count value acquisition unit 35 receives the correction process start signal, that is, after the count value of the interval counter 33 reaches the correction process interval value, based on the reception of the first reference signal, it acquires the time (start time) when the synchronization correction process is actually executed. ) of the count value of the second reference signal generation unit 31 and the count value of the overhead count unit 34 .
同步判断部36在由计数值获取部35所获取到的第2基准信号生成部31的计数值与系统开销计数部34的计数值相同时,判断为第1基准信号与第2基准信号同步。另外,同步判断部36在由计数值获取部35所获取到的第2基准信号生成部31的计数值与系统开销计数部34的计数值不同时,判断为上述第1基准信号与第2基准信号不同步。The synchronization determination unit 36 determines that the first reference signal is synchronized with the second reference signal when the count value of the second reference signal generation unit 31 acquired by the count value acquisition unit 35 is the same as the count value of the overhead counter unit 34 . In addition, when the count value of the second reference signal generating unit 31 acquired by the count value acquiring unit 35 is different from the count value of the overhead counting unit 34, the synchronization determination unit 36 determines that the first reference signal is different from the second reference signal. Signals are out of sync.
另外,同步判断部36可以对由计数值获取部35所获取到的第2基准信号生成部31的计数值与系统开销计数部34的计数值进行时间换算,在两者的时间相等时,判断为同步,另外,在两者的时间不同时,判断为不同步。也就是说,在实施方式1中,在各处理器模块11之间,各计数器的每一个时钟的单位时间可能不相等。因此,在该情况下,将各计数值换算成时间,并利用换算后的时间来进行同步/不同步的判断。In addition, the synchronization judging unit 36 may perform time conversion on the count value of the second reference signal generating unit 31 acquired by the count value acquiring unit 35 and the count value of the system overhead counting unit 34, and when the two times are equal, determine In addition, when both times are different, it is judged to be out of synchronization. That is, in Embodiment 1, the unit time per clock of each counter may not be equal among the processor modules 11 . Therefore, in this case, each count value is converted into time, and the synchronization/non-synchronization determination is performed using the converted time.
同步修正部37在同步判断部36判断第1基准信号与第2基准信号同步的情况下,将基准值设定于第2基准信号生成部31。另外,同步修正部37在同步判断部36判断为第1基准信号与第2基准信号不同步的情况下,求出与第2基准信号生成部31的计数值和系统开销计数部34的计数值之间的差分相抵消的值。具体而言,同步修正部37将由计数值获取部35所获取到的第2基准信号生成部31的计数值减去系统开销计数部34的计数值来求出同步修正值。接着,同步修正部37从基准值减去所求出的同步修正值,将相减后得到的值作为新的基准值设定于第2基准信号生成部31。该新的基准值是指,相对于同步判断部36判断为同步时使用的定时器基准值(默认的基准值),同步判断部36在判断为不同步时暂时使用的定时器基准值。The synchronization correction unit 37 sets a reference value in the second reference signal generation unit 31 when the synchronization determination unit 36 determines that the first reference signal is synchronized with the second reference signal. In addition, when the synchronization determination unit 36 determines that the first reference signal is not synchronized with the second reference signal, the synchronization correction unit 37 obtains the count value of the second reference signal generation unit 31 and the count value of the overhead count unit 34. The difference between the offset values. Specifically, the synchronization correction unit 37 subtracts the count value of the overhead counter unit 34 from the count value of the second reference signal generation unit 31 acquired by the count value acquisition unit 35 to obtain a synchronization correction value. Next, the synchronization correction unit 37 subtracts the obtained synchronization correction value from the reference value, and sets the subtracted value as a new reference value in the second reference signal generation unit 31 . The new reference value is a timer reference value temporarily used when the synchronization judging unit 36 judges that it is out of sync, with respect to the timer reference value (default reference value) used when the synchronization judging unit 36 judges that it is synchronous.
另外,若同步判断部36判断为第1基准信号与第2基准信号不同步,并将相减后得到的值作为新的基准值来设定于第2基准信号生成部31,且使用了该相减后得到的值的计数完成,则同步修正部37迅速地将基准值设定于第2基准信号生成部31。由此,能暂时地使基准值改变同步修正值的量。此处,举出了执行一次与同步修正值相应的量的修正的示例,但并不局限于此,也可以分几次来执行。在该情况下,同步修正部37在同步修正处理完成后,将基准值设定于第2基准信号生成部31。In addition, if the synchronization judging unit 36 judges that the first reference signal and the second reference signal are out of sync, and sets the subtracted value as a new reference value in the second reference signal generating unit 31, and uses the When the counting of the value obtained after the subtraction is completed, the synchronization correction unit 37 promptly sets the reference value in the second reference signal generation unit 31 . Accordingly, it is possible to temporarily change the reference value by the amount of the synchronization correction value. Here, an example in which correction corresponding to the synchronous correction value is performed once is given, but the present invention is not limited thereto, and may be performed several times. In this case, the synchronization correction unit 37 sets the reference value in the second reference signal generation unit 31 after the synchronization correction process is completed.
此外,若同步判断部36判断为第1基准信号与第2基准信号之间同步,则同步修正部37可以一次一次地对第2基准信号生成部31设定上述默认的基准值,但也可以在保持同步的情况下,设定一次默认的基准值后,无任何进一步的动作。In addition, if the synchronization determination unit 36 determines that the first reference signal and the second reference signal are synchronized, the synchronization correction unit 37 can set the above-mentioned default reference value to the second reference signal generation unit 31 one by one, but it can also be In the case of maintaining synchronization, after setting the default reference value once, there is no further action.
另外,在本实施方式中,由于每隔修正处理间隔执行同步修正处理,因此第2基准信号生成部31的计数值与系统开销计数部34的计数值不同的可能性较高,同步判断部36大多情况下判断为第1基准信号与第2基准信号不同步。因此,可以不利用同步判断部36来执行判断,即,不论第1基准信号与第2基准信号是否同步,都可以由同步修正部37来求出与第2基准信号生成部31的计数值和系统开销计数部34的计数值之间的差分相抵消的值,并将该值作为新的基准值来设定于第2基准信号生成部31。In addition, in this embodiment, since the synchronization correction process is executed at every correction processing interval, there is a high possibility that the count value of the second reference signal generation unit 31 is different from the count value of the overhead count unit 34, and the synchronization determination unit 36 In many cases, it is determined that the first reference signal and the second reference signal are not synchronized. Therefore, it is not necessary to use the synchronization determination unit 36 to perform the determination, that is, regardless of whether the first reference signal and the second reference signal are synchronized or not, the synchronization correction unit 37 can obtain the sum of the count value and the second reference signal generation unit 31. A value obtained by canceling the difference between the count values of the overhead counting unit 34 is set in the second reference signal generating unit 31 as a new reference value.
由此,通过省略同步判断部36的结构,从而无需判断处理,能够减轻与判断所需的处理量相应的处理负荷。Thus, by omitting the configuration of the synchronization judging unit 36 , judging processing becomes unnecessary, and the processing load corresponding to the amount of processing required for judging can be reduced.
存储部38存储在第2运算部32进行运算的规定的应用程序(顺序程序)。此外,第2运算部32进行运算的规定的应用程序是例如向连接至从处理器模块11b的I/O模块13b、13c发出指示,并利用I/O模块13b、13c对外部设备14b、14c进行控制的处理。因此,存储部38中主要存储有用于对与本处理器模块11b相连的I/O模块13b、13c、外部设备14b、14c执行规定处理的程序。The storage unit 38 stores a predetermined application program (sequence program) that is calculated by the second calculation unit 32 . In addition, the predetermined application program that the second calculation unit 32 performs calculations is, for example, to issue instructions to the I/O modules 13b, 13c connected to the slave processor module 11b, and use the I/O modules 13b, 13c to communicate with the external devices 14b, 14c. Controlled processing. Therefore, the storage unit 38 mainly stores programs for executing predetermined processing on the I/O modules 13b and 13c connected to the processor module 11b and the external devices 14b and 14c.
I/O模块13进行与外部设备14等之间的输入输出处理。例如,I/O模块13将从所连接的外部设备14等获得的数据等输出(发送)至处理器模块11,或者将由处理器模块11运算处理出的结果输出至外部设备14等,或对其进行存储。也就是说,处理器模块11利用应用程序来运算从I/O模块13获得的输入数据,并将该运算结果作为输出数据提供至I/O模块13,从而对外部设备14进行控制。The I/O module 13 performs input/output processing with external devices 14 and the like. For example, the I/O module 13 outputs (transmits) data obtained from the connected external device 14 and the like to the processor module 11, or outputs the result of calculation and processing by the processor module 11 to the external device 14 and the like, or It is stored. That is, the processor module 11 uses the application program to calculate the input data obtained from the I/O module 13 , and provides the calculation result to the I/O module 13 as output data, thereby controlling the external device 14 .
外部设备14例如是各种传感器、电动机、记录装置等。外部设备14基于来自I/O模块13的控制信号等,来进行数据的检测或驱动、数据的输入输出等。The external device 14 is, for example, various sensors, motors, recording devices, and the like. The external device 14 performs detection or drive of data, input and output of data, and the like based on control signals and the like from the I/O module 13 .
此处,基准值可以分别预先设定于处理器模块11a、处理器模块11b、处理器模块11c,也可以分别由外部连接的编译装置15(设定装置)来进行设定。Here, the reference values may be set in advance in the processor module 11a, the processor module 11b, and the processor module 11c, respectively, or may be set by an externally connected compiling device 15 (setting device).
编译装置15可以通过对用户等所使用的PC(Personal Computer:个人电脑)等增加与处理器模块11进行通信并设定基准值的功能来实现,但并不局限于此,也可以是专用的设定装置。由此,能够针对每一个用户任意地调整基准值(处理周期)。The compiling device 15 can be implemented by adding a function of communicating with the processor module 11 and setting a reference value to a PC (Personal Computer) used by a user, etc., but it is not limited thereto, and may be a dedicated one. Set up the device. Thereby, the reference value (processing cycle) can be adjusted arbitrarily for each user.
此处,在上述示例中,作为信号同步系统10的一个示例对多处理器进行了说明,而信号同步信号系统10只要包含第1基准信号生成部21、第2基准信号生成部31、系统开销计数部34、计数值获取部35、同步判断部36以及同步修正部37即可。Here, in the above example, a multiprocessor was described as an example of the signal synchronization system 10, but the signal synchronization signal system 10 only needs to include the first reference signal generation unit 21, the second reference signal generation unit 31, the system overhead The counting unit 34 , the counter value acquisition unit 35 , the synchronization determination unit 36 , and the synchronization correction unit 37 are sufficient.
此外,关于信号同步系统10的应用例,并不局限于多处理器,也可以应用于例如如下定时器同步系统:将主装置侧设为发送原子钟的日期/时间信息的数字信号的发送站,而将从装置侧设为电子钟。In addition, the application example of the signal synchronization system 10 is not limited to multiprocessors, and can also be applied to, for example, a timer synchronization system in which the master device side is set as a transmission station of a digital signal that transmits date/time information of an atomic clock, On the other hand, the slave device side is set as an electronic clock.
(处理器模块11的硬件构成例)(Example of Hardware Configuration of Processor Module 11)
接着,利用附图对处理器模块11的硬件构成例进行说明。图2是表示处理器模块11的硬件结构的一个示例的图。图2所示的处理器模块11具有输入部41、输出部42、CPU43、FPGA44、存储器45、以及外部接口46,这些部件通过共用总线B相连接。Next, an example of the hardware configuration of the processor module 11 will be described with reference to the drawings. FIG. 2 is a diagram showing an example of a hardware configuration of the processor module 11 . The processor module 11 shown in FIG. 2 has an input unit 41 , an output unit 42 , a CPU 43 , an FPGA 44 , a memory 45 , and an external interface 46 , and these components are connected by a common bus B.
输入部41输入各种操作信号,例如来自用户等的程序的执行。此外,输入部41可以具有例如供用户等进行操作的键盘、鼠标、触摸面板等定点设备,在通过语音等来进行输入的情况下,也可以具有语音输入设备。The input unit 41 inputs various operation signals such as execution of a program from a user or the like. In addition, the input unit 41 may include, for example, a pointing device such as a keyboard, a mouse, or a touch panel for the user to operate, and may include a voice input device when input is performed by voice or the like.
输出部42具有显示器,对进行本实施方式中的处理的处理器模块11进行操作所需的各种窗口、数据等进行显示,并显示CPU43所执行的控制程序的执行过程、结果等。The output unit 42 has a display, and displays various windows, data, etc. necessary for the operation of the processor module 11 performing the processing in this embodiment, and displays the execution progress and results of the control program executed by the CPU 43 .
CPU43基于OS(Operating System:操作系统)等的控制程序、保存在存储器45中的执行程序,通过对整个处理器模块11的处理进行控制,来实现本实施方式中的各处理,例如各种运算、与各硬件构成部之间的数据的输入输出等。另外,CPU43与存储器45进行联动,实质上起到上述第1运算部22、第2运算部32、计数值获取部35、同步判断部36、同步修正部37的功能,并内置第1基准信号生成部21、第2基准信号生成部31。此外,执行程序的过程中所需的各种信息等也可以从存储器45获得,并将执行结果等保存于存储器45中。The CPU 43 controls the processing of the entire processor module 11 based on a control program such as an OS (Operating System) and an execution program stored in the memory 45 to realize each processing in this embodiment, such as various calculations. , Input and output of data with each hardware component, etc. In addition, the CPU 43 cooperates with the memory 45 to substantially perform the functions of the above-mentioned first calculation unit 22, second calculation unit 32, counter value acquisition unit 35, synchronization determination unit 36, and synchronization correction unit 37, and incorporates the first reference signal Generating part 21 , second reference signal generating part 31 . In addition, various information and the like required in the process of executing the program can also be obtained from the memory 45 , and the execution results and the like are stored in the memory 45 .
FPGA(Field-Programmable Gate Array:现场可编程门阵列)44是可改写逻辑电路的集成电路。FPGA44由辅助CPU43的各种逻辑电路构成,本实施方式中,特别起到间隔计数部33、系统开销计数部34的作用。其中,间隔计数部33也可以由软件来处理。The FPGA (Field-Programmable Gate Array: Field Programmable Gate Array) 44 is an integrated circuit in which logic circuits can be rewritten. The FPGA 44 is composed of various logic circuits that assist the CPU 43 , and in the present embodiment, particularly functions as the interval counting unit 33 and the overhead counting unit 34 . However, the interval counting unit 33 may be processed by software.
存储器45保存有由CPU43读取出的执行程序等。此外,存储器45由ROM(Read OnlyMemory:只读存储器)、RAM(Random Access Memory:随机存取存储器)等构成。另外,存储器45也可以具有硬盘等存储单元,以作为辅助存储装置。另外,存储器45存储本实施方式中的执行程序、设置于计算机中的控制程序等,根据需要来进行输入输出。此外,存储器45对应于上述存储部23、38等。The memory 45 stores execution programs and the like read by the CPU 43 . In addition, the memory 45 is constituted by ROM (Read Only Memory: Read Only Memory), RAM (Random Access Memory: Random Access Memory), and the like. In addition, the memory 45 may have storage means such as a hard disk as an auxiliary storage device. Moreover, the memory 45 stores the execution program in this embodiment, the control program installed in a computer, etc., and performs input and output as needed. In addition, the memory 45 corresponds to the above-mentioned storage units 23 , 38 and the like.
外部接口46经由传输总线12等与其它处理器模块11之间进行数据、控制信号的收发。另外,外部接口46也与相连的I/O模块13之间进行数据、控制信号的收发等。The external interface 46 transmits and receives data and control signals to and from other processor modules 11 via the transmission bus 12 and the like. In addition, the external interface 46 also transmits and receives data and control signals to and from the connected I/O module 13 .
通过上述硬件结构,能够执行本实施方式中的同步修正处理。另外,通过安装执行程序,从而能容易地利用通用的个人计算机等来实现本实施方式中的同步修正处理。With the hardware configuration described above, the synchronization correction processing in this embodiment can be executed. In addition, by installing and executing the program, the synchronization correction process in this embodiment can be easily realized by using a general-purpose personal computer or the like.
接下来,以下对实施方式1中的同步修正处理例进行说明。Next, an example of synchronization correction processing in Embodiment 1 will be described below.
(实施方式1中的同步修正处理例)(Example of synchronization correction processing in Embodiment 1)
图3~图5是用于说明实施方式1中的同步修正处理例的时序图(之一~之三)。在图3~图5所示的示例中,示出了主处理器模块11a、与从处理器模块11b之间的计数值的同步例。此外,实施方式1中的基准值(处理周期)设为1000μs,但并不局限于此,例如也可以利用上述的编译装置15来适当地改变设定。3 to 5 are sequence diagrams (Part 1 to Part 3) for explaining an example of synchronization correction processing in the first embodiment. In the examples shown in FIGS. 3 to 5 , examples of synchronization of count values between the master processor module 11 a and the slave processor module 11 b are shown. In addition, although the reference value (processing cycle) in Embodiment 1 is set to 1000 μs, the present invention is not limited thereto, and the setting may be appropriately changed using, for example, the compiler device 15 described above.
图3中,主处理器模块11a的第1基准信号生成部21进行计数。若其计数值在图3中的(1)时刻达到基准值,则输出第1基准信号。然后,第1运算部22根据该第1基准信号来执行规定处理。图3中,阴影三角形的区域表示计数值的变化,随着时间的流逝计数值增加,若达到计数目标(例如基准值),则重置。In FIG. 3 , the first reference signal generation unit 21 of the main processor module 11 a counts. If the count value reaches the reference value at time (1) in FIG. 3 , the first reference signal is output. Then, the first computing unit 22 executes predetermined processing based on the first reference signal. In FIG. 3 , the area of the shaded triangle represents the change of the count value. As time goes by, the count value increases, and if the count target (such as a reference value) is reached, it is reset.
另外,从处理器模块11b的第2基准信号生成部31进行计数。若其计数值在图3中的(2)时刻达到基准值,则输出第2基准信号。然后,第2运算部32根据该第2基准信号来执行规定处理。由此,主处理器模块11a及从处理器模块11b中,分别根据独立的第1基准信号及第2基准信号来执行规定的处理。In addition, the second reference signal generator 31 of the slave processor module 11b counts. If the count value reaches the reference value at time (2) in FIG. 3 , the second reference signal is output. Then, the second computing unit 32 executes predetermined processing based on the second reference signal. Accordingly, the master processor module 11a and the slave processor module 11b execute predetermined processing based on the independent first reference signal and second reference signal, respectively.
另外,在从处理器模块11b中,间隔计数部33进行计数,在计数值达到修正处理间隔值的情况下(图3的(3)),生成修正处理开始信号。根据所述修正处理开始信号来开始同步修正处理的准备。In addition, in the slave processor module 11b, the interval count unit 33 counts, and when the count value reaches the correction processing interval value ((3) in FIG. 3 ), a correction processing start signal is generated. Preparations for synchronous correction processing are started based on the correction processing start signal.
主处理器模块11a中生成的第1基准信号作为中断信号被发送至从处理器模块11b。从处理器模块11b接收第1基准信号作为中断,并利用软件来启动同步修正处理(图3的(4))。与此同时,从处理器模块11b的系统开销计数部34将由该硬件构成的计数器的计数值清零,并重启(图3的(5))。接着,在同步修正处理的准备完成的情况下,在图3(6)时刻,计数值获取部35从第2基准信号生成部31获取计数值(图3的(7)),并从系统开销计数部34获取计数值(图3的(8))。The first reference signal generated in the master processor module 11a is sent to the slave processor module 11b as an interrupt signal. The slave processor module 11b receives the first reference signal as an interrupt, and starts the synchronization correction process by software ((4) in FIG. 3 ). At the same time, the overhead counting unit 34 of the slave processor module 11b clears the count value of the counter constituted by the hardware and restarts ((5) in FIG. 3 ). Next, when preparations for the synchronous correction process are completed, at time (6) in FIG. The counting unit 34 acquires a count value ((8) in FIG. 3 ).
同步判断部36将由计数值获取部35提供的计数值换算成时间。此处,例如根据第2基准信号生成部31的计数值得到300μs,根据系统开销计数部34的计数值得到300μs。由此,能够测量出从第1基准信号的中断的起点开始,到同步修正处理中获取到计数值为止的系统开销,并能够获取到该时刻的第2基准信号生成部31的计数值。在第1基准信号与第2基准信号同步的情况下,所述计数值应当相等。The synchronization determination unit 36 converts the count value supplied from the count value acquisition unit 35 into time. Here, for example, 300 μs is obtained from the count value of the second reference signal generation unit 31 , and 300 μs is obtained from the count value of the overhead count unit 34 . Thereby, the overhead from the start of interruption of the first reference signal to the acquisition of the count value in the synchronization correction process can be measured, and the count value of the second reference signal generator 31 at that point can be acquired. In the case where the first reference signal is synchronized with the second reference signal, the count values should be equal.
同步判断部36将由计数值获取部35获取到的第2基准信号生成部31的计数值(300μs)与系统开销计数部34的计数值(300μs)进行比较。该情况下,由于两个值相等,因此同步判断部36判断为第1基准信号与第2基准信号同步。The synchronization determination unit 36 compares the count value (300 μs) of the second reference signal generation unit 31 acquired by the count value acquisition unit 35 with the count value (300 μs) of the overhead counter unit 34 . In this case, since the two values are equal, the synchronization determination unit 36 determines that the first reference signal is synchronized with the second reference signal.
由于同步判断部36判断为第1基准信号与第2基准信号同步,因此同步修正部37如通常一样地将基准值1000μs设定于第2基准信号生成部31(该时刻下第2基准信号生成部31不重启)。然后,由于在图3的(9)时刻计数值达到基准值1000μs,因此第2基准信号生成部31重启。Since the synchronization determination unit 36 determines that the first reference signal is synchronized with the second reference signal, the synchronization correction unit 37 sets a reference value of 1000 μs in the second reference signal generation unit 31 as usual (the second reference signal is generated at this time). Part 31 does not restart). Then, since the count value reaches the reference value of 1000 μs at time (9) in FIG. 3 , the second reference signal generator 31 is restarted.
此外,第2基准信号生成部31内置于上述CPU43中,而本实施方式中,并不局限于此,也可以与CPU43分开设置。In addition, although the 2nd reference signal generation part 31 is built in the said CPU43, in this embodiment, it is not limited to this, You may provide separately from CPU43.
另外,先提及一下,图3所示的同步修正处理中,包含计数值获取部35、同步判断部36、同步修正部37的程序的处理。Incidentally, it should be noted that the synchronization correction processing shown in FIG. 3 includes the processing of the programs of the counter value acquisition unit 35 , the synchronization determination unit 36 , and the synchronization correction unit 37 .
图4示出了从处理器模块11b的计数器相比主处理器模块11a的计数器延迟3μs的情况。Fig. 4 shows the case where the counter of the slave processor module 11b is delayed by 3 μs compared to the counter of the master processor module 11a.
图4中,从处理器模块11b的间隔计数部33进行计数,在计数值达到修正处理间隔值的情况下(图4的(1)),生成修正处理开始信号。根据所述修正处理开始信号来开始同步修正处理的准备。In FIG. 4, the interval counting unit 33 of the slave processor module 11b counts, and when the count value reaches the correction processing interval value ((1) in FIG. 4 ), a correction processing start signal is generated. Preparations for synchronous correction processing are started based on the correction processing start signal.
由于计数值达到基准值,因此主处理器11a的第1基准信号生成部21每隔1000μs输出第1基准信号。从处理器模块11b在生成修正处理开始信号后,接收第1基准信号作为中断,并利用软件来启动同步修正处理(图4的(2))。与此同时,从处理器模块11b的系统开销计数部34将由该硬件构成的计数器的计数值清零,并重启(图4的(3))。接着,在同步修正处理的准备完成的情况下,在图4的(4)时刻,计数值获取部35从第2基准信号生成部31获取计数值(图4的(5)),并从系统开销计数部34获取计数值(图4的(6))。Since the count value reaches the reference value, the first reference signal generator 21 of the main processor 11 a outputs the first reference signal every 1000 μs. After generating the correction processing start signal, the slave processor module 11b receives the first reference signal as an interrupt, and starts the synchronization correction processing by software ((2) in FIG. 4 ). At the same time, the overhead counting unit 34 of the slave processor module 11b clears the count value of the counter constituted by the hardware and restarts ((3) in FIG. 4 ). Next, when preparations for the synchronous correction process are completed, at time (4) in FIG. The overhead counting unit 34 acquires a count value ((6) in FIG. 4 ).
同步判断部36将由计数值获取部35提供的计数值换算成时间。此处,例如根据第2基准信号生成部31的计数值得到297μs,根据系统开销计数部34的计数值得到300μs。同步判断部36将两个计数值进行比较,由于两个计数值不同,因此判断为第1基准信号与第2基准信号不同步。The synchronization determination unit 36 converts the count value supplied from the count value acquisition unit 35 into time. Here, for example, 297 μs is obtained from the count value of the second reference signal generation unit 31 , and 300 μs is obtained from the count value of the overhead count unit 34 . The synchronization determination unit 36 compares the two count values and determines that the first reference signal and the second reference signal are not synchronized because the two count values are different.
由于同步判断部36判断为不同步,因此同步修正部37将临时的基准值设定于第2基准信号生成部31,以使得第2基准信号生成部31的计数值与系统开销计数部34的计数值之间的差分被抵消。具体而言,同步修正部37利用“基准值(处理周期)-(系统开销计数部34的计数值-第2基准信号生成部31的计数值)”这一式子求出第2基准信号生成部31的计数值的重启值(复位值),并将所求出的计数值作为临时的基准值来设定于第2基准信号生成部31。该示例的情况下,临时的基准值为1000μs-(300μs-297μs)=997μs。然后,由于在图4的(7)时刻计数值达到临时的基准值997μs,因此第2基准信号生成部31重启。也就是说,系统开销计数部34的计数值-第2基准信号生成部31的计数值后得到的值为同步修正值。Since the synchronization determination unit 36 determines that it is out of synchronization, the synchronization correction unit 37 sets a temporary reference value in the second reference signal generation unit 31 so that the count value of the second reference signal generation unit 31 is the same as that of the overhead count unit 34. Differences between count values are canceled out. Specifically, the synchronization correcting unit 37 obtains the second reference signal generation unit using the formula "reference value (processing cycle) - (count value of the overhead counter unit 34 - count value of the second reference signal generation unit 31)". The reset value (reset value) of the count value of 31 is set in the second reference signal generator 31 as a temporary reference value. In the case of this example, the temporary reference value is 1000 μs−(300 μs−297 μs)=997 μs. Then, since the count value reaches the temporary reference value of 997 μs at time (7) in FIG. 4 , the second reference signal generation unit 31 restarts. That is, the value obtained by calculating the count value of the overhead counting unit 34 - the count value of the second reference signal generating unit 31 is a synchronization correction value.
由此,实施方式1中,对于第2循环,能够在与下一个第3循环的第1基准信号的输出时刻大致相同的时刻使第2基准信号生成部31重启。因此,实施方式1能够使第1基准信号与第2基准信号同步。此外,图4的情况下,第3循环以后基准值被设定为1000μs。Thus, in Embodiment 1, the second reference signal generator 31 can be restarted at approximately the same timing as the output timing of the first reference signal in the next third cycle in the second cycle. Therefore, Embodiment 1 can synchronize the first reference signal and the second reference signal. In addition, in the case of FIG. 4, the reference value after the 3rd cycle is set to 1000 microseconds.
图5示出了从处理器模块11b的计数器相比主处理器模块11a的计数器提早3μs的情况。FIG. 5 shows that the counter of the slave processor module 11b is 3 μs earlier than the counter of the master processor module 11a.
图5中,从处理器模块11b的间隔计数部33进行计数,在计数值达到修正处理间隔值的情况下(图5的(1)),生成修正处理开始信号。根据所述修正处理开始信号来开始同步修正处理的准备。In FIG. 5, the interval counting unit 33 of the slave processor module 11b counts, and when the count value reaches the correction processing interval value ((1) in FIG. 5 ), a correction processing start signal is generated. Preparations for synchronous correction processing are started based on the correction processing start signal.
由于计数值达到基准值,因此主处理器模块11a的第1基准信号生成部21每隔1000μs输出第1基准信号。从处理器模块11b在生成了修正处理开始信号之后,接收第1基准信号作为中断,并利用软件来启动同步修正处理(图5的(2))。与此同时,从处理器模块11b的系统开销计数部34将由该硬件构成的计数器的计数值清零,并重启(图5的(3))。接着,在同步修正处理的准备完成的情况下,在图5的(4)时刻,计数值获取部35从第2基准信号生成部31获得计数值(图5的(5)),并从系统开销计数部34获取计数值(图5的(6))。Since the count value reaches the reference value, the first reference signal generator 21 of the main processor module 11 a outputs the first reference signal every 1000 μs. After generating the correction process start signal, the slave processor module 11b receives the first reference signal as an interrupt, and starts the synchronization correction process by software ((2) in FIG. 5 ). At the same time, the overhead counting unit 34 of the slave processor module 11b clears the count value of the counter constituted by the hardware and restarts ((3) in FIG. 5 ). Next, when preparations for the synchronous correction process are completed, at time (4) in FIG. The overhead counting unit 34 acquires a count value ((6) in FIG. 5 ).
同步判断部36将由计数值获取部35提供的计数值换算成时间。此处,例如根据第2基准信号生成部31的计数值得到303μs,根据系统开销计数部34的计数值得到300μs。同步判断部36将两个计数值进行比较,由于两个计数值不同,因此判断为第1基准信号与第2基准信号不同步。The synchronization determination unit 36 converts the count value supplied from the count value acquisition unit 35 into time. Here, for example, 303 μs is obtained from the count value of the second reference signal generation unit 31 , and 300 μs is obtained from the count value of the overhead count unit 34 . The synchronization determination unit 36 compares the two count values and determines that the first reference signal and the second reference signal are not synchronized because the two count values are different.
由于同步判断部36判断为不同步,因此同步修正部37对第2基准信号生成部31设定临时的基准值,以使得第2基准信号生成部31的计数值与系统开销计数部34的计数值之间的差分被抵消。具体而言,同步修正部37与图4的说明相同地进行计算,求出临时的基准值,并将该临时的基准值设定于第2基准信号生成部31。该示例的情况下,临时的基准值为1000μs-(300μs-303μs)=1003μs。然后,由于在图4的(7)时刻计数值达到临时的基准值1003μs,因此第2基准信号生成部31重启。也就是说,系统开销计数部34的计数值-第2基准信号生成部31的计数值后得到的值为同步修正值。Since the synchronization determination unit 36 determines that it is out of synchronization, the synchronization correction unit 37 sets a temporary reference value for the second reference signal generation unit 31 so that the count value of the second reference signal generation unit 31 is equal to the count value of the overhead count unit 34 Differences between values are canceled out. Specifically, the synchronization correction unit 37 performs calculations in the same manner as described in FIG. 4 to obtain a temporary reference value, and sets the temporary reference value in the second reference signal generation unit 31 . In the case of this example, the provisional reference value is 1000 μs−(300 μs−303 μs)=1003 μs. Then, since the count value reaches the temporary reference value of 1003 μs at time (7) in FIG. 4 , the second reference signal generation unit 31 restarts. That is, the value obtained by calculating the count value of the overhead counting unit 34 - the count value of the second reference signal generating unit 31 is a synchronization correction value.
由此,实施方式1中,对于第2循环,能够在与下一个第3循环的第1基准信号的输出时刻大致相同的时刻使第2基准信号生成部31重启。因此,本实施方式的信号同步系统能够使第1基准信号与第2基准信号相同步。另外,图5的第3循环以后,基准值被设定为1000μs。如上所述,实施方式1中,无论在从处理器模块11b的计数器(定时器)相对于主处理器模块11a的计数器(定时器)延迟的情况或是提早的情况下,均能恰当地实现计数器同步。Thus, in Embodiment 1, the second reference signal generator 31 can be restarted at approximately the same timing as the output timing of the first reference signal in the next third cycle in the second cycle. Therefore, the signal synchronization system of this embodiment can synchronize the first reference signal and the second reference signal. In addition, the reference value is set to 1000 μs after the third cycle in FIG. 5 . As described above, in Embodiment 1, regardless of whether the counter (timer) of the slave processor module 11b is delayed or ahead of the counter (timer) of the master processor module 11a, the The counters are synchronized.
(信号同步方法的顺序例)(Sequence example of signal synchronization method)
图6是表示信号同步方法的大致顺序(sequence)的示例的图。在图6的示例中,为了说明方便,对使用了主处理器模块11a及从处理器模块11b的同步进行说明,但本实施方式并不局限于此,能够使多个从处理器模块与一个主处理器模块相同步。FIG. 6 is a diagram showing an example of a rough sequence of a signal synchronization method. In the example of FIG. 6 , for convenience of description, the synchronization using the master processor module 11a and the slave processor module 11b is described, but this embodiment is not limited thereto, and multiple slave processor modules can be connected to one The main processor modules are synchronized.
在图6的计数器同步处理中,首先,主处理器模块11a的第1基准信号生成部21生成第1基准信号(S01),从处理器模块11b的第2基准信号生成部31生成第2基准信号(S02)。此外,该处理以硬件方式周期性地进行工作。另外,主处理器模块11a也将在S01的处理中获得的第1基准信号发送至从处理器模块11b。因此,从处理器模块11b始终处于能够接收第1基准信号的状态。In the counter synchronization process of FIG. 6, first, the first reference signal generator 21 of the main processor module 11a generates a first reference signal (S01), and the second reference signal generator 31 of the slave processor module 11b generates a second reference signal. signal (S02). Also, this processing works periodically by hardware. In addition, the master processor module 11a also transmits the first reference signal obtained in the process of S01 to the slave processor module 11b. Therefore, the slave processor module 11b is always in a state capable of receiving the first reference signal.
另外,从处理器模块11b的间隔计数部33对修正处理间隔进行计数,在计数值达到修正处理间隔值的情况下,生成修正处理开始信号,开始同步修正处理的准备(S03)。In addition, the interval counting unit 33 of the slave processor module 11b counts the correction processing interval, and when the count value reaches the correction processing interval value, a correction processing start signal is generated to start preparations for the synchronous correction processing (S03).
若在间隔计数部33的计数值达到修正处理间隔值之后,从处理器模块11b接收到主处理器模块11a所发送的第1基准信号(S04),则利用软件来启动同步修正处理(S05),并同时使系统开销计数部34重启(S06)。然后,计数值获取部35获取第2基准信号生成部31与系统开销计数部34的两个计数值(S07),同步判断部36基于所述两个计数值来进行同步判断(S08),在判断为不同步的情况下,同步修正部37进行同步修正(S09)。If after the count value of the interval counter 33 reaches the correction processing interval value, the first reference signal (S04) sent by the main processor module 11a is received from the processor module 11b, then the synchronization correction process is started by software (S05) , and at the same time restart the system overhead counting unit 34 (S06). Then, the count value acquisition unit 35 acquires two count values of the second reference signal generation unit 31 and the overhead count unit 34 (S07), and the synchronization determination unit 36 performs a synchronization determination based on the two count values (S08). When it is judged that it is out of synchronization, the synchronization correction unit 37 performs synchronization correction (S09).
由此,能够在抑制处理负荷的同时高精度地使规定的信号同步。Accordingly, predetermined signals can be synchronized with high precision while suppressing the processing load.
(实施方式2:节点同步系统)(Implementation 2: Node Synchronization System)
第2实施方式的特征在于,将上述实施方式1中的传输总线12所产生的延迟时间包含在内来执行同步修正处理。图7是表示实施方式2中的节点同步系统的大致结构的一个示例的图。图7所示的节点同步系统50是在节点51a~51c等多个节点之间进行计数器同步的一个示例。The second embodiment is characterized in that the synchronization correction process is executed including the delay time caused by the transmission bus 12 in the first embodiment described above. FIG. 7 is a diagram showing an example of a schematic configuration of a node synchronization system in Embodiment 2. FIG. The node synchronization system 50 shown in FIG. 7 is an example that performs counter synchronization among a plurality of nodes such as nodes 51a to 51c.
节点同步系统50具有:多个节点51a~51c(以下根据需要称为“节点51”)、通信路径(通信网络)52、I/O(输入输出)模块53(图7中以53a~53d来示出)、外部设备54(图7中以54a~54d来示出)以及编译装置55。也就是说,节点同步系统50经由作为通信网络的通信路径52将主控节点51a、与从属节点51b、51c相连接。The node synchronization system 50 has: a plurality of nodes 51a-51c (hereinafter referred to as "nodes 51" as needed), a communication path (communication network) 52, and an I/O (input-output) module 53 (referred to as 53a-53d in FIG. 7 shown), an external device 54 (shown as 54a-54d in FIG. 7 ), and a compiling device 55. That is, the node synchronization system 50 connects the master node 51a and the slave nodes 51b and 51c via the communication path 52 which is a communication network.
此处,为了说明方便,对将节点51a作为主控节点、将节点51b、51c作为从属节点,其各个节点所固有的结构进行说明,但并不局限于此,各个节点可既具有主控节点的结构也具有从属节点的结构,以使得各个节点既能成为主控节点又能成为从属节点。此外,在实施方式2中,设为通信路径52会产生传输延迟时间。Here, for the convenience of description, the node 51a is used as the master node, and the nodes 51b and 51c are used as the slave nodes. The inherent structure of each node is described, but it is not limited to this. The structure of also has a structure of slave nodes, so that each node can be both a master node and a slave node. In addition, in Embodiment 2, it is assumed that a transmission delay time occurs in the communication path 52 .
此处,先对实施方式2(图7)与实施方式1(图1)的不同点进行说明。主控节点51a相当于实施方式1中的主处理器模块11a,从属节点51b、51c相当于实施方式1中的从处理器模块11b、11c。另外,编译装置55与实施方式1中的编译装置15实质相等,此外,I/O模块53a~53d与实施方式1中的I/O模块13a~13d实质相等。另外,外部设备54a~54d与实施方式1中的外部设备14a~14d实质相等。由此,以下说明中,省略与实施方式1相同的结构的说明。Here, differences between Embodiment 2 (FIG. 7) and Embodiment 1 (FIG. 1) will be described first. The master control node 51a corresponds to the master processor module 11a in the first embodiment, and the slave nodes 51b and 51c correspond to the slave processor modules 11b and 11c in the first embodiment. In addition, the compiler device 55 is substantially equivalent to the compiler device 15 in Embodiment 1, and the I/O modules 53a to 53d are substantially equivalent to the I/O modules 13a to 13d in Embodiment 1. In addition, the external devices 54a to 54d are substantially equivalent to the external devices 14a to 14d in the first embodiment. Therefore, in the following description, the description of the same configuration as that of Embodiment 1 will be omitted.
主控节点51a具有:第1基准信号生成部61(对应于实施方式1的第1基准信号生成部21)、第1运算部62(对应于实施方式1的第1运算部22)、存储部63(对应于实施方式1的存储部23)、间隔计数部64(对应于实施方式1的间隔计数部33)、传输延迟时间通知部65以及同步化帧通知部66。The master node 51a has a first reference signal generation unit 61 (corresponding to the first reference signal generation unit 21 in the first embodiment), a first computing unit 62 (corresponding to the first computing unit 22 in the first embodiment), and a storage unit 63 (corresponding to the storage unit 23 in Embodiment 1), an interval counting unit 64 (corresponding to the interval counting unit 33 in Embodiment 1), a transmission delay time notification unit 65 , and a synchronization frame notification unit 66 .
主控节点51a与实施方式1中的主处理器模块11a之间的主要不同点在于,具备实施方式1中设置于从处理器模块11b的间隔计数部33作为间隔计数部64,并还新添加了传送延迟时间通知部65、同步化帧通知部66。由此,以下说明中,对实施方式2的主要部分进行说明,省略说明与实施方式1相同的动作。The main difference between the master control node 51a and the master processor module 11a in the first embodiment is that the interval counting unit 33 provided in the slave processor module 11b in the first embodiment is provided as the interval counting unit 64, and a newly added A transmission delay time notification unit 65 and a synchronization frame notification unit 66 are provided. Therefore, in the following description, the main part of Embodiment 2 will be described, and the description of the same operations as in Embodiment 1 will be omitted.
以下,对实施方式2的一个示例进行说明。实施方式2中,间隔计数部64进行计数,并预先设定有与进行同步处理的修正处理间隔相当的修正处理间隔值,在计数值达到修正处理间隔值的情况下,生成表示该情况的修正处理开始信号。此外,由于修正处理间隔值与实施方式1实质相等,因此此处省略对其进行说明。An example of Embodiment 2 will be described below. In Embodiment 2, the interval counting unit 64 counts and presets a correction processing interval value corresponding to the correction processing interval for synchronous processing, and when the count value reaches the correction processing interval value, generates a correction Handle the start signal. In addition, since the correction processing interval value is substantially equal to Embodiment 1, description thereof is omitted here.
另外,此处在主控节点51a一侧测定修正处理间隔,但也可以在从属节点51b一侧测定修正处理间隔。该情况下,若在从属节点51b中计数值达到修正处理间隔值,则将修正处理开始信号发送至主控节点51a,并开始同步修正处理。In addition, here, the correction processing interval is measured on the side of the master node 51a, but the correction processing interval may be measured on the side of the slave node 51b. In this case, when the counter value reaches the correction processing interval value in the slave node 51b, a correction processing start signal is transmitted to the master node 51a, and the synchronous correction processing is started.
在接收到修正处理开始信号之后,主控节点51a的传输延迟时间通知部65为了计算出传输延迟时间而将传输延迟时间请求帧发送至从属节点51b、51c。该传输延迟时间请求帧与后述的同步化帧的格式实质相同,而与同步化帧内的规定部分(例如指令部)的数据不同。所述传输延迟时间请求帧与第1基准信号生成部61所生成的第1基准信号相同步地被发送。After receiving the correction process start signal, the transmission delay time notification unit 65 of the master node 51a transmits a transmission delay time request frame to the slave nodes 51b and 51c in order to calculate the transmission delay time. The transmission delay time request frame has substantially the same format as a synchronization frame described later, but is different from the data of a predetermined portion (for example, a command portion) in the synchronization frame. The transmission delay time request frame is transmitted in synchronization with the first reference signal generated by the first reference signal generator 61 .
接着,传输延迟时间通知部65接收来自对传输延迟时间请求帧进行了应答的从属节点的接收完成帧。然后,传输延迟时间通知部65根据应答帧接收时的时刻与发送传输延迟时间请求帧时的时刻之间的差分,来计算出主控节点51a与从属节点51b、51c之间的往返传输延迟时间。然后,传输延迟时间通知部65将包含计算出的往返传输延迟时间在内的传输延迟时间通知帧与下一个第1基准信号相同步地发送至从属节点51b、51c,从而向从属节点51b、51c通知由通信路径52所产生的延迟时间。Next, the transmission delay time notification unit 65 receives a reception completion frame from the slave node that responded to the transmission delay time request frame. Then, the transmission delay time notification unit 65 calculates the round-trip transmission delay time between the master node 51a and the slave nodes 51b and 51c based on the difference between the time when the response frame is received and the time when the transmission delay time request frame is transmitted. . Then, the transmission delay time notification unit 65 transmits a transmission delay time notification frame including the calculated round-trip transmission delay time to the slave nodes 51b, 51c in synchronization with the next first reference signal, thereby notifying the slave nodes 51b, 51c The delay time generated by the communication path 52 is notified.
在通知了往返传输延迟时间之后,主控节点51a基于第1基准信号(与第1基准信号相同步),将预先准备的同步化帧经由通信路径52发送至从属节点51b、51c。此外,该处理由同步化帧通知部66来执行。在后面会详细说明,同步化帧是用于使从属节点51b、51c的第2基准信号生成部71的计数值与主控节点51a的第1基准信号生成部61的计数值相匹配的同步基准信号。After notifying the round-trip delay time, the master node 51a transmits a pre-prepared synchronization frame to the slave nodes 51b and 51c via the communication path 52 based on the first reference signal (synchronized with the first reference signal). Note that this processing is executed by the synchronization frame notification unit 66 . As will be described in detail later, the synchronization frame is a synchronization reference for matching the count value of the second reference signal generator 71 of the slave nodes 51b and 51c with the count value of the first reference signal generator 61 of the master node 51a. Signal.
接着,对从属节点51b、51c进行说明。从属节点51b、51c具有:第2基准信号生成部71(对应于实施方式1的第2基准信号生成部31)、第2运算部72(对应于实施方式1的第2运算部32)、系统开销计数部74(对应于实施方式1的系统开销计数部34)、计数值获取部75(对应于实施方式1的计数值获取部35)、同步判断部76(对应于实施方式1的同步判断部36)、同步修正部77(对应于实施方式1的同步修正部37)、存储部78(对应于实施方式1的存储部38)、接收完成通知部79以及帧接收部80。此外,CPU43内置有第2基准信号生成部71。由于从属节点51b、51c的结构相同,因此在以下说明中,利用从属节点51b来进行说明,省略从属节点51c的说明。Next, the slave nodes 51b and 51c will be described. The slave nodes 51b and 51c include: a second reference signal generating unit 71 (corresponding to the second reference signal generating unit 31 in Embodiment 1), a second computing unit 72 (corresponding to the second computing unit 32 in Embodiment 1), a system The overhead counting unit 74 (corresponding to the system overhead counting unit 34 in Embodiment 1), the counter value acquiring unit 75 (corresponding to the counting value acquiring unit 35 in Embodiment 1), the synchronization judgment unit 76 (corresponding to the synchronization judgment in Embodiment 1 unit 36), synchronization correction unit 77 (corresponding to synchronization correction unit 37 of Embodiment 1), storage unit 78 (corresponding to storage unit 38 of Embodiment 1), reception completion notification unit 79 and frame reception unit 80. In addition, the CPU 43 incorporates a second reference signal generation unit 71 . Since the configurations of the slave nodes 51b and 51c are the same, in the following description, the slave node 51b will be used for description, and the description of the slave node 51c will be omitted.
与实施方式1的处理器模块11b的主要不同点在于,同步判断部76与实施方式1的同步判断部36不同,并且添加了接收完成通知部79以及帧接收部80。其中,由于其它构成要素与实施方式1实质相等,因此此处省略对其进行说明。以下,对包含通信路径52的传输延迟时间在内的从属节点51b的同步修正处理进行说明。The main difference from the processor module 11b of the first embodiment is that the synchronization determination unit 76 is different from the synchronization determination unit 36 of the first embodiment, and a reception completion notification unit 79 and a frame reception unit 80 are added. However, since other components are substantially the same as those in Embodiment 1, description thereof will be omitted here. Next, the synchronization correction process of the slave node 51b including the transmission delay time of the communication path 52 will be described.
接收完成通知部79从主控节点51a接收上述传输延迟时间请求帧,并根据该传输延迟时间请求帧将接收完成帧发送至主控节点51a。The reception completion notification unit 79 receives the transmission delay time request frame from the master control node 51a, and transmits a reception completion frame to the master control node 51a based on the transmission delay time request frame.
帧接收部80接收主控节点51a所发送的上述传输延迟时间通知帧,并将该帧所包含的往返传输延迟时间(值)退避至上述存储器45等。由此,从属节点51b从主控节点51a获取到主控节点51a与从属节点51b之间的往返传输延迟时间。The frame reception unit 80 receives the transmission delay time notification frame transmitted from the master node 51a, and saves the round-trip transmission delay time (value) included in the frame to the memory 45 and the like. Thus, the slave node 51b acquires the round-trip transmission delay time between the master node 51a and the slave node 51b from the master node 51a.
从主控节点51a获得往返传输延迟时间的从属节点51b接收同步化帧,在第2运算部72产生中断。接收到中断的第2运算部72启动后述的同步修正处理。此外,在本实施方式中,即使在未获得往返传输延迟时间的情况下接收到同步化帧,也当然可以将往返传输延迟时间设为零(0)来启动同步修正处理。另外,若将接收到同步化帧之后、向第2运算部72发送中断的速度考虑在内,则虽未图示,但优选使用FPGA44等硬件逻辑来作为同步化帧的接收单元。The slave node 51 b which has obtained the round-trip transmission delay time from the master node 51 a receives the synchronization frame, and generates an interrupt in the second computing unit 72 . The second calculation unit 72 having received the interrupt starts the synchronization correction process described later. Also, in the present embodiment, even if a synchronization frame is received without obtaining the round-trip delay time, it is of course possible to set the round-trip delay time to zero (0) to start the synchronization correction process. In addition, considering the speed at which an interrupt is sent to the second computing unit 72 after receiving a synchronization frame, it is preferable to use hardware logic such as FPGA 44 as a synchronization frame receiving unit, although not shown in the figure.
另外,系统开销计数部74测量出以上述同步化帧的接收为起点、直到执行同步修正处理为止的系统开销值。具体而言,系统开销计数部74起到接收到同步化帧后进行重启的硬件性的计数器(定时器)的功能。In addition, the overhead counting unit 74 measures an overhead value starting from the reception of the above-mentioned synchronization frame until execution of the synchronization correction process. Specifically, the overhead counting unit 74 functions as a hardware counter (timer) that restarts after receiving a synchronization frame.
计数值获取部75根据同步化帧的接收获取在实际执行同步修正处理的开始时刻的第2基准信号生成部71的计数值以及系统开销计数部74的计数值。The count value acquisition unit 75 acquires the count value of the second reference signal generation unit 71 and the count value of the overhead counter unit 74 at the start time of actually executing the synchronization correction process based on the reception of the synchronization frame.
同步判断部76将上述往返传输延迟时间除以2,来求出通信路径52的单程的传输延迟时间,并进一步求出将该单程的传输延迟时间与上述系统开销计数部74的计数值经过时间换算后得到的值相加而得到的综合延迟时间。然后,同步判断部76将所求出的综合延迟时间、与计数值获取部75所获取到的第2基准信号生成部71的计数值经过时间换算后得到的值进行比较。当其比较结果为两者相等时,同步判断部76判断第1基准信号与第2基准信号同步,在两者不相等时,同步判断部76判断第1基准信号与第2基准信号不同步。此处,所谓同步意味着第1基准信号生成部61的计数值与第2基准信号生成部71的计数值相等。The synchronization determination unit 76 divides the round-trip transmission delay time by 2 to obtain the one-way transmission delay time of the communication path 52, and further calculates the one-way transmission delay time and the elapsed time of the counted value of the overhead counting unit 74. The composite delay time obtained by adding the converted values. Then, the synchronization determination unit 76 compares the obtained total delay time with the time-converted value of the count value of the second reference signal generation unit 71 acquired by the count value acquisition unit 75 . When the comparison result is equal, the synchronization determination unit 76 determines that the first reference signal is synchronized with the second reference signal, and when they are not equal, the synchronization determination unit 76 determines that the first reference signal is not synchronized with the second reference signal. Here, synchronization means that the count value of the first reference signal generator 61 is equal to the count value of the second reference signal generator 71 .
此外,同步判断部76当然也可以与实施方式1的同步判断部36相同,通过将各计数器的计数值换算成时间来进行比较,从而判断同步/不同步。In addition, the synchronization judging unit 76 may, of course, compare the count values of the respective counters in the same manner as the synchronization judging unit 36 of the first embodiment in terms of time, thereby judging whether it is synchronous or not.
实施方式2中,若每隔修正处理间隔,由同步判断部76判断为第1基准信号与第2基准信号同步,则同步修正部77将基准值设定于第2基准信号生成部71。另外,在判断为第1基准信号与第2基准信号不同步的情况下,求出将第2基准信号生成部71的计数值与综合延迟时间值之间的差分相抵消的值。具体而言,同步修正部77将由计数值获取部75所获取到的第2基准信号生成部71的计数值减去综合延迟时间值来求出同步修正值。接着,同步修正部77从基准值减去所求出的同步修正值,并将相减后得到的值作为新的基准值设定于第2基准信号生成部71。该新的基准值是相对于同步判断部76判断为同步时设定于第2基准信号生成部71的基准值(默认的基准值)而暂时设定的(临时的基准值),以用于修正第2基准信号生成部71的定时值。In Embodiment 2, the synchronization correction unit 77 sets a reference value in the second reference signal generation unit 71 when the synchronization determination unit 76 determines that the first reference signal is synchronized with the second reference signal at every correction processing interval. In addition, when it is determined that the first reference signal and the second reference signal are out of synchronization, a value obtained by canceling the difference between the count value of the second reference signal generator 71 and the total delay time value is obtained. Specifically, the synchronization correction unit 77 subtracts the total delay time value from the count value of the second reference signal generation unit 71 acquired by the count value acquisition unit 75 to obtain a synchronization correction value. Next, the synchronization correction unit 77 subtracts the obtained synchronization correction value from the reference value, and sets the subtracted value as a new reference value in the second reference signal generation unit 71 . This new reference value is temporarily set (temporary reference value) with respect to the reference value (default reference value) set in the second reference signal generation unit 71 when the synchronization determination unit 76 determines that it is synchronous, and is used for The timing value of the second reference signal generator 71 is corrected.
此外,本实施方式当然也可以在将默认的基准值设定于第2基准信号生成部71,且同步得到保持的情况下,之后不改写默认的基准值。In addition, in this embodiment, of course, when a default reference value is set in the second reference signal generating unit 71 and synchronization is maintained, the default reference value may not be rewritten thereafter.
由此,在本实施方式中,能够将经由通信路径52来通知同步基准信号(同步化帧)时的传输延迟时间的影响也考虑在内地进行同步修正处理。也就是说,实施方式2中,能够对含有节点间的传输延迟时间与从属节点51b、51c的系统开销的计数值进行修正,从而能够实现高精度的节点间的同步。Thus, in the present embodiment, it is possible to perform synchronization correction processing taking into account the influence of the transmission delay time when the synchronization reference signal (synchronization frame) is notified via the communication path 52 . That is, in Embodiment 2, it is possible to correct the count value including the transmission delay time between nodes and the overhead of the slave nodes 51b and 51c, thereby achieving highly accurate synchronization between nodes.
(实施方式2中的同步修正处理例)(Example of synchronization correction processing in Embodiment 2)
图8~图10是用于说明实施方式2中的同步修正处理例的时序图,是主控节点51a与从属节点51b之间的计数值的同步例。此外,实施方式2中的基准值(处理周期)与实施方式1相同,设为1000μs,该基准值能够利用编译装置55来适当地改变。8 to 10 are sequence diagrams for explaining an example of synchronization correction processing in Embodiment 2, and are examples of synchronization of count values between the master node 51a and the slave node 51b. In addition, the reference value (processing cycle) in Embodiment 2 is set to 1000 μs as in Embodiment 1, and this reference value can be appropriately changed by the compiler device 55 .
图8中,主控节点51a的第1基准信号生成部61进行计数。若该计数值在图8的(1)时刻达到基准值,则输出第1基准信号。然后,第1运算部62根据该第1基准信号来执行规定的处理。In FIG. 8 , the first reference signal generation unit 61 of the master node 51 a counts. When the count value reaches the reference value at time (1) in FIG. 8 , a first reference signal is output. Then, the first computing unit 62 executes predetermined processing based on the first reference signal.
另外,从属节点51b的第2基准信号生成部71进行计数。若该计数值在图8的(2)时刻达到基准值,则输出第2基准信号。然后,第2运算部72根据该第2基准信号来执行规定的处理。由此,在主控节点51a及从属节点51b中,分别根据独立的第1基准信号及第2基准信号来执行规定的处理。In addition, the second reference signal generator 71 of the slave node 51b counts. When the count value reaches the reference value at time (2) in FIG. 8 , a second reference signal is output. Then, the second computing unit 72 executes predetermined processing based on the second reference signal. Accordingly, in the master node 51a and the slave node 51b, predetermined processing is executed based on the independent first reference signal and second reference signal, respectively.
另外,主处理器模块51a中,间隔计数部64进行计数,在计数值达到修正处理间隔值的情况下(图8的(3)),生成修正处理开始信号。根据所述修正处理开始信号来开始主控节点51a中的同步修正处理。In addition, in the main processor module 51a, the interval counting unit 64 counts, and when the count value reaches the correction processing interval value ((3) in FIG. 8 ), a correction processing start signal is generated. The synchronization correction process in the master control node 51a is started in accordance with the correction process start signal.
在同步修正处理开始之后,主控节点51a的传输延迟时间通知部65为了计算出传输延迟时间而发送传输延迟时间请求帧(图8的(4))。若从属节点51b的接收完成通知部79从主控节点51a接收到传输延迟时间请求帧,则根据该传输延迟时间请求帧将接收完成帧发送至主控节点51a(图8的(5))。After the start of the synchronization correction process, the transmission delay time notification unit 65 of the master node 51a transmits a transmission delay time request frame in order to calculate the transmission delay time ((4) in FIG. 8 ). When the reception completion notification unit 79 of the slave node 51b receives the transmission delay time request frame from the master control node 51a, it transmits a reception completion frame to the master control node 51a based on the transmission delay time request frame ((5) in FIG. 8 ).
接着,主控节点51a的传输延迟时间通知部65根据接收完成帧,计算出主控节点51a与从属节点51b之间的往返传输延迟时间,发送含有计算出的往返传输延迟时间(400μs)在内的传输延迟时间通知帧(图8的(6))。若从属节点51b的帧接收部80接收到传输延迟时间通知帧,则将该帧所包含的往返传输延迟时间(值)退避至存储器45等(图8的(7))。Next, the transmission delay time notification unit 65 of the master node 51a calculates the round-trip transmission delay time between the master node 51a and the slave node 51b based on the received frame, and transmits transmission delay time notification frame ((6) of FIG. 8). When the frame reception unit 80 of the slave node 51b receives the transmission delay time notification frame, it saves the round-trip transmission delay time (value) included in the frame to the memory 45 or the like ((7) in FIG. 8 ).
在同步修正处理开始之后,主控节点51a的同步化帧通知部66将同步化帧作为中断信号发送至从属节点51b(图8的(8))。然后,从属节点51b经过通信路径52的单程的传输延迟时间(200μs)在图8的(9)的时刻接收到同步化帧,利用从属节点51b中的软件来启动同步修正处理。另外,伴随着同步化帧的接收,系统开销计数部74的由硬件构成的计数器被清零并重启(图8的(10))。After the start of the synchronization correction process, the synchronization frame notification unit 66 of the master node 51a transmits a synchronization frame as an interrupt signal to the slave node 51b ((8) in FIG. 8 ). Then, the slave node 51b receives the synchronization frame at the time of (9) in FIG. 8 via the one-way transmission delay time (200 μs) of the communication path 52, and starts the synchronization correction process by the software in the slave node 51b. In addition, when the synchronization frame is received, the hardware counter of the overhead counting unit 74 is cleared and restarted ((10) in FIG. 8 ).
接着,在同步修正处理的准备完成的情况下,在图8的(11)时刻,计数值获取部75从第2基准信号生成部71获得计数值(图8的(12)),并从系统开销计数部74获取计数值(图8的(13))。Next, when preparations for the synchronous correction process are completed, at time (11) in FIG. The overhead counting unit 74 acquires a count value ((13) in FIG. 8 ).
接着,计数值获取部75参照第2基准信号生成部71的计数值来进行时间换算,从而得到400μs。接着,同步判断部76从往返传输延迟时间(400μs)求出单程的传输延迟时间200μs,将所求出的传输延迟时间与系统开销计数部74的计数值经过时间换算后得到的200μs相加,从而求得综合延迟时间400μs。然后,同步判断部76将综合延迟时间400μs与计数值获取部75所获取到的第2基准信号生成部71的计数值经过时间换算后得到的400μs进行比较,由于两者相等,因此判断为第1基准信号与第2基准信号同步。Next, the count value acquiring unit 75 refers to the count value of the second reference signal generating unit 71 to perform time conversion to obtain 400 μs. Next, the synchronization judging unit 76 calculates a one-way transmission delay time of 200 μs from the round-trip transmission delay time (400 μs), adds the obtained transmission delay time to 200 μs obtained by converting the count value of the system overhead counting unit 74 over time, Thus, the integrated delay time of 400μs is obtained. Then, the synchronization determination unit 76 compares the total delay time of 400 μs with the time-converted 400 μs obtained by the count value acquisition unit 75 from the count value of the second reference signal generation unit 71. Since the two are equal, it is judged to be the second delay time. The 1st reference signal is synchronized with the 2nd reference signal.
由于同步判断部76判断为第1基准信号与第2基准信号同步,因此同步修正部77按通常那样,将基准值1000μs设定于第2基准信号生成部71(第2基准信号生成部71在设定时刻不进行重启)。然后,由于在图8的(14)时刻计数值达到基准值1000μs,因此第2基准信号生成部71重启。Since the synchronization determination unit 76 determines that the first reference signal is synchronized with the second reference signal, the synchronization correction unit 77 sets a reference value of 1000 μs in the second reference signal generation unit 71 as usual (the second reference signal generation unit 71 Set the time without restarting). Then, since the count value reaches the reference value of 1000 μs at time (14) in FIG. 8 , the second reference signal generator 71 restarts.
图9示出了从属节点51b的计数器比主控节点51a的计数器延迟3μs的情况。FIG. 9 shows the case where the counter of the slave node 51b is delayed by 3 μs from the counter of the master node 51a.
图9中,在主控节点51a的间隔计数部64的计数值达到修正处理间隔值,并开始同步修正处理之后,到从属节点51b的帧接收部80将传输延迟时间通知帧所包含的往返传输延迟时间(值)退避至存储器45等为止的处理与图8的处理实质相同,因此此处省略说明。In FIG. 9, after the count value of the interval counting unit 64 of the master node 51a reaches the correction processing interval value and the synchronization correction process is started, the frame receiving unit 80 of the slave node 51b notifies the round-trip transmission included in the transmission delay time frame. The processing until the delay time (value) is evacuated to the memory 45 and the like is substantially the same as the processing in FIG. 8 , and thus description thereof will be omitted here.
在同步修正处理开始之后,在图9(1)时刻,主控节点51a的同步化帧通知部66将同步化帧作为中断信号发送至从属节点51b。然后,从属节点51b经过通信路径52的单程的传输延迟时间(200μs)在图9的(2)的时刻接收到同步化帧,利用从属节点51b中的软件来启动同步修正处理。另外,伴随着同步化帧的接收,系统开销计数部74的计数器被清零并重启(图9的(3))。After the start of the synchronization correction process, the synchronization frame notifying unit 66 of the master node 51a transmits a synchronization frame as an interrupt signal to the slave node 51b at time point (1) of FIG. 9 . Then, the slave node 51b receives the synchronization frame at the time (2) of FIG. 9 via the one-way transmission delay time (200 μs) of the communication path 52, and starts the synchronization correction process by the software in the slave node 51b. In addition, the counter of the overhead counting unit 74 is cleared and restarted when the synchronization frame is received ((3) in FIG. 9 ).
接着,在同步修正处理的准备完成的情况下,在图9的(4)时刻,计数值获取部75从第2基准信号生成部71获得计数值(图9的(5)),并从系统开销计数部74获取计数值(图9的(6))。Next, when preparations for the synchronous correction process are completed, at time (4) in FIG. The overhead counting unit 74 acquires a count value ((6) in FIG. 9 ).
接着,计数值获取部75参照第2基准信号生成部71的计数值来进行时间换算,从而得到397μs。接着,同步判断部76从往返传输延迟时间(400μs)求出单程的传输延迟时间200μs,将所求出的传输延迟时间与系统开销计数部74的计数值经过时间换算后得到的200μs相加,从而求得综合延迟时间400μs。然后,同步判断部76将综合延迟时间400μs与计数值获取部75所获取到的第2基准信号生成部71的计数值经过时间换算后得到的397μs进行比较,由于两者不等,因此判断为第1基准信号与第2基准信号不同步。Next, the count value acquiring unit 75 refers to the count value of the second reference signal generating unit 71 to perform time conversion to obtain 397 μs. Next, the synchronization judging unit 76 calculates a one-way transmission delay time of 200 μs from the round-trip transmission delay time (400 μs), adds the obtained transmission delay time to 200 μs obtained by converting the count value of the system overhead counting unit 74 over time, Thus, the integrated delay time of 400μs is obtained. Then, the synchronization judging unit 76 compares the total delay time of 400 μs with the count value of the second reference signal generating unit 71 obtained by the count value acquiring unit 75, which is 397 μs after time conversion, and since the two are not equal, it is judged as The first reference signal is not synchronized with the second reference signal.
由于同步判断部76判断第1基准信号与第2基准信号不同步,因此同步修正部77将临时的基准值设定于第2基准信号生成部71。具体而言,同步修正部77利用“基准值(处理周期)-(综合延迟时间-第2基准信号生成部71的计数值)”这一式子求出第2基准信号生成部71的重启值(复位值),并将所求出的计数值作为临时的基准值来设定于第2基准信号生成部71。该示例的情况下,临时的基准值为1000μs-(400μs-397μs)=997μs。然后,由于在图9的(7)时刻计数值达到临时的基准值997μs,因此第2基准信号生成部71重启。也就是说,综合延迟时间-第2基准信号生成部71的计数值后得到的值为同步修正值。Since the synchronization determination unit 76 determines that the first reference signal and the second reference signal are out of synchronization, the synchronization correction unit 77 sets a temporary reference value in the second reference signal generation unit 71 . Specifically, the synchronization correcting unit 77 obtains the restart value of the second reference signal generating unit 71 using the formula “reference value (processing cycle)−(total delay time−count value of the second reference signal generating unit 71)” ( reset value), and set the calculated count value in the second reference signal generation unit 71 as a temporary reference value. In the case of this example, the provisional reference value is 1000 μs−(400 μs−397 μs)=997 μs. Then, since the count value reaches the temporary reference value of 997 μs at time (7) in FIG. 9 , the second reference signal generation unit 71 restarts. That is, the value obtained by integrating the delay time - the count value of the second reference signal generating unit 71 is a synchronous correction value.
图10示出了从属节点51b的计数器比主控节点51a的计数器提前3μs的情况。FIG. 10 shows the case where the counter of the slave node 51b is ahead of the counter of the master node 51a by 3 μs.
图10中,在主控节点51a的间隔计数部64的计数值达到修正处理间隔值,并开始同步修正处理之后,到从属节点51b的帧接收部80将传输延迟时间通知帧所包含的往返传输延迟时间(值)退避至存储器45等为止的处理与图8、图9的处理实质相同,因此此处省略说明。In FIG. 10, after the count value of the interval counting unit 64 of the master node 51a reaches the correction processing interval value and the synchronization correction process is started, the frame reception unit 80 of the slave node 51b notifies the transmission delay time to the round-trip transmission included in the frame. The processing until the delay time (value) is evacuated to the memory 45 and the like is substantially the same as the processing in FIG. 8 and FIG. 9 , and therefore description thereof will be omitted here.
在同步修正处理开始之后,在图10(1)时刻,主控节点51a的同步化帧通知部66将同步化帧作为中断信号发送至从属节点51b。然后,从属节点51b经过通信路径52的单程的传输延迟时间(200μs)在图10的(2)的时刻接收到同步化帧,利用从属节点51b中的软件来启动同步修正处理。另外,伴随着同步化帧的接收,系统开销计数部74的计数器被清零并重启(图10的(3))。After the start of the synchronization correction process, the synchronization frame notifying unit 66 of the master node 51a transmits a synchronization frame as an interrupt signal to the slave node 51b at time point (1) of FIG. 10 . Then, the slave node 51b receives the synchronization frame at the time (2) of FIG. 10 via the one-way transmission delay time (200 μs) of the communication path 52, and starts the synchronization correction process by the software in the slave node 51b. In addition, the counter of the overhead counting unit 74 is cleared and restarted when the synchronization frame is received ((3) in FIG. 10 ).
接着,在同步修正处理的准备完成的情况下,在图10的(4)时刻,计数值获取部75从第2基准信号生成部71获得计数值(图10的(5)),并从系统开销计数部74获取计数值(图10的(6))。Next, when preparations for the synchronous correction process are completed, at time (4) in FIG. The overhead counting unit 74 acquires a count value ((6) in FIG. 10 ).
接着,计数值获取部75参照第2基准信号生成部71的计数值来进行时间换算,从而得到403μs。接着,同步判断部76从往返传输延迟时间(400μs)求出单程的传输延迟时间200μs,并将所求出的单程的传输延迟时间与系统开销计数部74的计数值经过时间换算后得到的200μs相加,从而得到综合延迟时间400μs。然后,同步判断部76将综合延迟时间400μs与计数值获取部75所获取到的第2基准信号生成部71的计数值经过时间换算后得到的403μs进行比较,由于两者不等,因此判断为第1基准信号与第2基准信号不同步。Next, the count value acquiring unit 75 refers to the count value of the second reference signal generating unit 71 to perform time conversion to obtain 403 μs. Next, the synchronization judging unit 76 obtains the one-way transmission delay time of 200 μs from the round-trip transmission delay time (400 μs), and converts the obtained one-way transmission delay time and the counted value of the system overhead counting unit 74 into 200 μs over time. Added together, the overall delay time of 400μs is obtained. Then, the synchronization judging unit 76 compares the total delay time of 400 μs with the time-converted count value of the second reference signal generating unit 71 acquired by the count value acquiring unit 75, which is 403 μs. Since the two are not equal, it is determined that The first reference signal is not synchronized with the second reference signal.
由于同步判断部76判断第1基准信号与第2基准信号不同步,因此同步修正部77将临时的基准值设定于第2基准信号生成部71。该示例的情况下,临时的基准值为1000μs-(400μs-403μs)=1003μs。然后,由于在图10的(7)时刻计数值到达临时的基准值1003μs,因此第2基准信号生成部71重启。Since the synchronization determination unit 76 determines that the first reference signal and the second reference signal are out of synchronization, the synchronization correction unit 77 sets a temporary reference value in the second reference signal generation unit 71 . In the case of this example, the provisional reference value is 1000 μs−(400 μs−403 μs)=1003 μs. Then, since the count value reaches the temporary reference value of 1003 μs at time (7) in FIG. 10 , the second reference signal generation unit 71 restarts.
此外,在图9及图10的示例的情况下,在第3循环,主控侧的计数器与从属侧的计数器相同步,因此之后,同步修正部77将原先的基准值1000μs设定于第2基准信号生成部71(第2基准信号生成部71在设定时刻不进行重启)。然后,第2基准信号生成部71在计数值达到基准值1000μs时重启。也就是说,实施方式2中,相对于第3循环,能够在与下一个第4循环的主控侧的计数器的重启大致相同的时刻使从属侧的计数器重启,因此能够使主控侧的计数器的值与从属侧的计数器的值匹配成大致相等的值。In addition, in the case of the example in FIG. 9 and FIG. 10 , in the third cycle, the counter on the master side is synchronized with the counter on the slave side, so after that, the synchronization correction unit 77 sets the original reference value 1000 μs to the second cycle. Reference signal generation unit 71 (the second reference signal generation unit 71 is not restarted at the set time). Then, the second reference signal generator 71 restarts when the count value reaches the reference value of 1000 μs. That is to say, in Embodiment 2, with respect to the third cycle, the counter on the slave side can be restarted at approximately the same timing as the restart of the counter on the master side in the next fourth cycle, so the counter on the master side can be reset. The value of matches the value of the counter on the slave side to an approximately equal value.
此外,同步修正处理中,与实施方式1相同,包含计数值获取部75、同步判断部76、同步修正部77的程序的处理。In addition, the synchronization correction processing includes the processing of the program of the counter value acquisition part 75, the synchronization determination part 76, and the synchronization correction part 77 similarly to Embodiment 1.
另外,以从属节点51b的第2基准信号生成部71内置于CPU43为前提进行了说明,但并不局限于此。也就是说,第2基准信号生成部71也可以与CPU43分开实现。但是,由于第2基准信号生成部71内置于CPU43,因此无法利用在CPU43的外部生成的规定信号来从硬件上使第2基准信号生成部71复位。换言之,第2基准信号生成部71是存在有程序来控制其动作的计数器。因此,本实施方式需要利用程序来执行第2基准信号生成部71的复位处理(重启处理),其系统开销与同步误差有关。由此,本实施方式中,需要测量系统开销的结构(实施方式1中也相同)。In addition, although the description has been made on the premise that the second reference signal generation unit 71 of the slave node 51b is incorporated in the CPU 43, the present invention is not limited thereto. That is, the second reference signal generation unit 71 may be realized separately from the CPU 43 . However, since the second reference signal generation unit 71 is built in the CPU 43 , the second reference signal generation unit 71 cannot be reset by hardware using a predetermined signal generated outside the CPU 43 . In other words, the second reference signal generator 71 is a counter in which a program controls its operation. Therefore, in the present embodiment, it is necessary to use a program to execute the reset processing (restart processing) of the second reference signal generation unit 71, and the system overhead is related to the synchronization error. Therefore, in the present embodiment, a configuration for measuring system overhead is required (the same applies to Embodiment 1).
另外,实施方式2中,同步修正处理是通过同步化帧的接收来进行启动的中断处理。In addition, in Embodiment 2, the synchronization correction process is an interrupt process that is started upon reception of a synchronization frame.
另外,在上述说明中,从属节点51b例如从主控节点51a获得并保持往返传输延迟时间,并在同步修正处理时有效利用所保持的往返传输延迟时间。此外,还有如下方法:主控节点51a将往返传输延迟时间包含于同步化帧内并发送至从属节点51b,接收到该同步化帧的从属节点51b使用同步化帧所包含的往返传输时间。由此,主控节点51a能够根据状况适当地向从属节点51b通知往返传输延迟时间,因此在从属节点51b中能够适时地使用与状况相对应的往返传输延迟时间。In addition, in the above description, the slave node 51b acquires and holds the round-trip delay time from, for example, the master node 51a, and effectively utilizes the held round-trip delay time in the synchronization correction process. In addition, there is a method in which the master node 51a includes the round-trip transmission delay time in the synchronization frame and sends it to the slave node 51b, and the slave node 51b that has received the synchronization frame uses the round-trip transmission time included in the synchronization frame. Accordingly, the master node 51a can appropriately notify the slave node 51b of the round-trip delay time according to the situation, and therefore the slave node 51b can appropriately use the round-trip delay time according to the situation.
另外,关于传输延迟时间通知部65,对将往返传输延迟时间通知给从属节点51b的情况进行了说明,但并不局限于此。例如,传输延迟时间通知部65也可以将计算出的往返传输延迟时间除以2来求出单程的传输延迟时间,并将所求出的单程的传输延迟时间通知给从属节点51b。该情况下,从属节点51b的同步判断部76直接使用获得到的单程的传输延迟时间,来求出综合延迟时间即可。In addition, although the case where the transmission delay time notification part 65 notifies the slave node 51b of the round-trip transmission delay time was demonstrated, it is not limited to this. For example, the transmission delay time notification unit 65 may divide the calculated round-trip transmission delay time by 2 to obtain the one-way transmission delay time, and notify the slave node 51b of the obtained one-way transmission delay time. In this case, the synchronization determination unit 76 of the slave node 51b may use the obtained one-way transmission delay time as it is to obtain the total delay time.
如上述所说明的那样,实施方式2中,能够将通信路径52所产生的信号传输延迟时间包含在内地使第1基准信号与第2基准信号相同步。As described above, in Embodiment 2, it is possible to synchronize the first reference signal and the second reference signal including the signal propagation delay time caused by the communication path 52 .
(关于同步修正处理中的传输延迟时间的通知步骤)(Procedure for notification of transmission delay time in synchronization correction processing)
接着,对上述同步修正处理中的传输延迟时间的通知步骤进行说明。图11是用于说明实施方式2中的传输延迟时间的通知步骤的一个示例的图。此外,在图11的示例中,具有上述主控节点51a、以及从属节点51b、51c,且各节点51经由通信路径52以能够收发信号的状态相连接。另外,在以下说明中,示出了主控节点51a获取因各节点51之间的通信路径52而产生的信号的传输延迟时间的示例。Next, the notification procedure of the transmission delay time in the above-mentioned synchronization correction processing will be described. FIG. 11 is a diagram for explaining an example of a notification procedure of a transmission delay time in Embodiment 2. FIG. In addition, in the example of FIG. 11, the said master node 51a and slave nodes 51b and 51c are provided, and each node 51 is connected via the communication path 52 in the state which can transmit and receive a signal. In addition, in the following description, an example is shown in which the master control node 51 a acquires the transmission delay time of a signal generated by the communication path 52 between the nodes 51 .
另外,图11所示的四方形表示帧,各节点51的线上方的四方形表示发送帧,线下方的四方形表示接收帧。另外,图11所示的帧具有:传输延迟时间请求帧81(表示为图11中的“REQ*”(*例如表示各从属节点的标识符(例如为b、c)(以下相同))、接收完成帧82(图11中的“REC*”)、传输延迟时间通知帧83(图11中的“SET*”)、以及对于传输延迟时间通知帧83的应答帧84(图11中的“ANS*”)。The squares shown in FIG. 11 represent frames, the squares above the lines of the nodes 51 represent transmission frames, and the squares below the lines represent reception frames. In addition, the frame shown in FIG. 11 has: a transmission delay time request frame 81 (shown as "REQ*" in FIG. A reception completion frame 82 ("REC*" in FIG. 11), a transmission delay time notification frame 83 ("SET*" in FIG. 11), and a response frame 84 to the transmission delay time notification frame 83 ("SET*" in FIG. 11 ANS*").
图11的示例中,主控节点51a根据主控节点同步基准将针对从属节点51b的传输延迟时间请求帧81b(REQb)广播发送至通信路径52上。此时,传输延迟时间请求帧81b中包含有表示为针对从属节点51b的传输延迟时间请求的内容的信息(对象节点信息)。In the example of FIG. 11 , the master node 51 a broadcasts a transmission delay time request frame 81 b (REQb) for the slave node 51 b onto the communication path 52 according to the master node synchronization reference. At this time, the transmission delay time request frame 81b includes information (target node information) indicating the content of the transmission delay time request to the slave node 51b.
所广播发送的传输延迟时间请求帧81b经由通信路径52,在规定的传输延迟时间之后,被各从属节点51b、51c所接收。此外,在图11的示例中,从属节点51b根据主控节点同步基准在延迟时间D1接收传输延迟时间请求帧81b,从属节点51c根据主控节点同步基准在延迟时间D2接收传输延迟时间请求帧81b。The broadcast transmission delay time request frame 81b is received by each of the slave nodes 51b and 51c after a predetermined transmission delay time via the communication path 52 . Furthermore, in the example of FIG. 11 , the slave node 51b receives the transmission delay time request frame 81b at delay time D1 according to the master node synchronization reference, and the slave node 51c receives the transmission delay time request frame 81b at delay time D2 according to the master node synchronization reference .
此处,各从属节点51b、51c对传输延迟时间请求帧81b所包含的上述对象节点信息进行确认。由此,由于传输延迟时间请求帧81b是针对从属节点51b的请求,因此仅从属节点51b向主控节点51a广播发送接收完成帧82b(RECb)。此时,接收完成帧82b中包含有表示是针对主控节点51a的接收完成帧的内容的信息(对象节点信息)。Here, each of the slave nodes 51b and 51c confirms the above-mentioned target node information included in the transmission delay time request frame 81b. Thus, since the transmission delay time request frame 81b is a request for the slave node 51b, only the slave node 51b broadcasts the transmission reception completion frame 82b (RECb) to the master node 51a. In this case, the received frame 82b includes information (target node information) indicating the content of the received frame directed to the master node 51a.
所发送的接收完成帧82b经由通信路径52,被主控节点51a以及从属节点51c所接收。接着,主控节点51a及从属节点51c对接收完成帧82b所包含的上述对象节点信息进行确认。如上所述,接收完成帧82b是针对主控节点51a的帧。因此,主控节点51a基于从按照主控节点同步基准而发送的传输延迟时间请求帧81b的发送、到接收到该接收完成帧82b为止的时间信息,来设定针对从属节点51b的传输延迟时间。此外,此处所设定的传输延迟时间可以是规定的信号经由通信路径52在主控节点51a与从属节点51b之间往返的往返传输延迟时间,也可以是单程的传输延迟时间。The transmitted reception completion frame 82 b is received by the master node 51 a and the slave node 51 c via the communication path 52 . Next, the master node 51a and the slave node 51c confirm the above-mentioned target node information included in the received frame 82b. As described above, the reception completion frame 82b is a frame for the master control node 51a. Therefore, the master node 51a sets the transmission delay time for the slave node 51b based on the time information from the transmission of the transmission delay time request frame 81b transmitted according to the master node synchronization standard to the reception of the reception completion frame 82b. . In addition, the transmission delay time set here may be a round-trip transmission delay time for a predetermined signal to go back and forth between the master node 51 a and the slave node 51 b via the communication path 52 , or may be a one-way transmission delay time.
另外,主控节点51a生成用于将所设定的传输延迟时间通知给从属节点51b的传输延迟时间通知帧83b(SETb),并按照主控节点同步基准广播发送所生成的传输延迟时间通知帧83b。此外,传输延迟时间通知帧83b中包含上述对象节点信息。Also, the master node 51a generates a transmission delay time notification frame 83b (SETb) for notifying the slave node 51b of the set transmission delay time, and broadcasts the generated transmission delay time notification frame according to the master node synchronization standard. 83b. In addition, the above-mentioned target node information is included in the transmission delay time notification frame 83b.
所广播发送的传输延迟时间通知帧83b与上述传输延迟时间请求帧81b相同,经由通信路径52,在规定的传输延迟时间后,被各从属节点51b、51c所接收。The broadcast transmission delay time notification frame 83b is received by each of the slave nodes 51b and 51c after a predetermined transmission delay time via the communication path 52, similarly to the transmission delay time request frame 81b described above.
此时,从属节点51b根据所接收到的传输延迟时间通知帧83b的对象节点信息来判断为是针对本节点的信息,从而进行将帧内包含的传输延迟时间、与上述系统开销时间等包含在内的实施方式2的同步修正处理。另外,主控节点51b生成针对传输延迟时间通知帧83b的应答帧84b(ANSb),并对所生成的应答帧84b进行广播发送。此时,应答帧84b中包含有表示是针对主控节点51a的帧的内容的信息(对象节点信息)以及表示同步修正处理已完成的内容的信息等。At this time, the slave node 51b determines from the received target node information of the transmission delay time notification frame 83b that it is information aimed at its own node, and then includes the transmission delay time included in the frame, the above-mentioned system overhead time, etc. Synchronization correction processing of Embodiment 2 within. Also, the master control node 51b generates a response frame 84b (ANSb) to the transmission delay time notification frame 83b, and broadcasts the generated response frame 84b. At this time, the response frame 84b includes information indicating the content of the frame directed to the master node 51a (target node information), information indicating that the synchronization correction process has been completed, and the like.
所发送的应答帧84b与上述接收完成帧82b相同,经由通信路径52,被主控节点51a以及从属节点51c所接收。接着,主控节点51a及从属节点51c对应答帧84b所包含的上述对象节点信息进行确认。如上所述,应答帧84b是针对主控节点51a的帧。因此,主控节点51a能够通过来自从属节点51b的应答帧84b来把握同步修正处理已完成这一情况。此外,从属节点51c虽然接收到传输延迟时间请求帧81b(REQb)、接收完成帧82b(RECb)、传输延迟时间通知帧83b(SETb)、应答帧84b(ANSb),但由于均不是针对本节点的帧,因此放弃所接收到的帧。The transmitted response frame 84b is received by the master node 51a and the slave node 51c via the communication path 52 in the same way as the reception completion frame 82b described above. Next, the master node 51a and the slave node 51c confirm the above-mentioned target node information included in the response frame 84b. As described above, the response frame 84b is a frame for the master control node 51a. Therefore, the master node 51a can grasp the completion of the synchronization correction process by the response frame 84b from the slave node 51b. In addition, although the slave node 51c has received the transmission delay time request frame 81b (REQb), the reception completion frame 82b (RECb), the transmission delay time notification frame 83b (SETb), and the response frame 84b (ANSb), none of them are directed to the own node. frame, so the received frame is discarded.
到此为止的内容均是向从属节点51b的传输延迟时间通知步骤。因此主控节点51a同样地对从属节点51c通知传输延迟时间。The contents so far are all the steps of notifying the transmission delay time to the slave node 51b. Therefore, the master node 51a similarly notifies the slave node 51c of the transmission delay time.
具体而言,图11的示例中,主控节点51a根据主控节点同步基准将针对从属节点51c的传输延迟时间请求帧81c(REQc)广播发送至通信路径52上。所广播发送的传输延迟时间请求帧81c如上述那样经由通信路径52,在规定的传输延迟时间(D1、D2),被各从属节点51b、51c所接收。Specifically, in the example of FIG. 11 , the master node 51 a broadcasts a transmission delay time request frame 81 c (REQc) for the slave node 51 c onto the communication path 52 according to the master node synchronization reference. The broadcasted transmission delay time request frame 81c is received by each of the slave nodes 51b, 51c at the predetermined transmission delay time (D1, D2) via the communication path 52 as described above.
由于传输延迟时间请求帧81c是针对从属节点51c的请求,因此仅从属节点51c向主控节点51a广播发送接收完成帧82c(RECc)。所发送的接收完成帧82c经由通信路径52,被主控节点51a以及从属节点51c所接收。接收完成帧82c是针对主控节点51a的帧。因此,主控节点51a基于从按照主控节点同步基准而发送的传输延迟时间请求帧81c的发送、到接收到该接收完成帧82c为止的时间信息,来设定针对从属节点51c的传输延迟时间。此外,此处所设定的传输延迟时间可以是规定的信号经由通信路径52在主控节点51a与从属节点51c之间往返的往返传输延迟时间,也可以是单程的传输延迟时间。Since the transmission delay time request frame 81c is a request for the slave node 51c, only the slave node 51c broadcasts the transmission reception completion frame 82c (RECc) to the master node 51a. The transmitted reception completion frame 82c is received by the master node 51a and the slave node 51c via the communication path 52 . The reception completion frame 82c is a frame for the master control node 51a. Therefore, the master node 51a sets the transmission delay time for the slave node 51c based on the time information from the transmission of the transmission delay time request frame 81c transmitted according to the master node synchronization standard to the reception of the reception completion frame 82c. . In addition, the transmission delay time set here may be a round-trip transmission delay time for a predetermined signal to go back and forth between the master node 51 a and the slave node 51 c via the communication path 52 , or may be a one-way transmission delay time.
另外,主控节点51a生成用于将所设定的传输延迟时间通知给从属节点51c的传输延迟时间通知帧83c(SETc),并按照主控节点同步基准广播发送所生成的传输延迟时间通知帧83c。所广播发送的传输延迟时间请求帧83c与上述传输延迟时间请求帧81c相同,经由通信路径52,在规定的传输延迟时间(D1、D2),被各从属节点51b、51c所接收。Also, the master node 51a generates a transmission delay time notification frame 83c (SETc) for notifying the slave node 51c of the set transmission delay time, and broadcasts the generated transmission delay time notification frame according to the master node synchronization standard. 83c. The broadcasted transmission delay time request frame 83c is received by the slave nodes 51b, 51c via the communication path 52 at predetermined transmission delay times (D1, D2) like the above transmission delay time request frame 81c.
此时,从属节点51b如上述那样,根据所接收到的传输延迟时间通知帧83c的对象节点信息来判断为是针对本节点的信息,进行将帧内包含的传输延迟时间、与上述系统开销时间等包含在内的实施方式2的同步修正处理。另外,从属节点51c生成针对传输延迟时间通知帧83c的应答帧84c(ANSc),并对所生成的应答帧84c进行广播发送。此时,应答帧84c中包含有表示是针对主控节点51a的帧的内容的信息(对象节点信息)以及表示同步修正处理已完成的内容的信息等。At this time, as described above, the slave node 51b judges from the target node information of the received transmission delay time notification frame 83c that it is the information for its own node, and compares the transmission delay time included in the frame with the overhead time mentioned above. Synchronization correction processing of Embodiment 2 including etc. Also, the slave node 51c generates a response frame 84c (ANSc) to the transmission delay time notification frame 83c, and broadcasts the generated response frame 84c. At this time, the response frame 84c includes information indicating the content of the frame directed to the master node 51a (target node information), information indicating that the synchronization correction process has been completed, and the like.
所发送的应答帧84c与上述接收完成帧82c相同,经由通信路径52,被主控节点51a以及从属节点51c所接收。接着,主控节点51a及从属节点51b对应答帧84c所包含的上述对象节点信息进行确认。如上所述,应答帧84c是针对主控节点51a的帧。因此,主控节点51a能够通过来自从属节点51c的应答帧84c来把握同步修正处理已完成这一情况。此外,从属节点51b虽然接收到传输延迟时间请求帧81c(REQc)、接收完成帧82c(RECc)、传输延迟时间通知帧83c(SETc)、应答帧84c(ANSc),但由于均不是针对本节点的帧,因此放弃所接收到的帧。The transmitted response frame 84c is received by the master node 51a and the slave node 51c via the communication path 52 in the same way as the reception completion frame 82c described above. Next, the master node 51a and the slave node 51b confirm the above-mentioned target node information included in the response frame 84c. As described above, the response frame 84c is a frame for the master control node 51a. Therefore, the master node 51a can grasp the completion of the synchronization correction process by the response frame 84c from the slave node 51c. In addition, although the slave node 51b has received the transmission delay time request frame 81c (REQc), the reception completion frame 82c (RECc), the transmission delay time notification frame 83c (SETc), and the response frame 84c (ANSc), none of them are directed to the own node. frame, so the received frame is discarded.
实施方式2中,通过对通信路径52的各从属节点51b、51c依次实施上述处理,从而能通知传输延迟时间。In Embodiment 2, the transmission delay time can be notified by sequentially performing the above-described processing on each of the slave nodes 51b and 51c of the communication path 52 .
此外,传输延迟时间的通知步骤并不局限于上述步骤。例如,可以在上述各节点内部设置发送计数器,并利用该发送计数器控制为在不同的时刻发送应答帧84,以使得通信路径52上、主控节点51a上不会由于例如广播发送传输延迟时间请求帧81,且接收到该传输延迟时间请求帧81的从属节点51b、51c发送应答帧84而产生拥堵。In addition, the notification step of the transmission delay time is not limited to the above-mentioned steps. For example, a sending counter can be set inside each of the above-mentioned nodes, and the sending counter can be used to control to send the response frame 84 at different times, so that on the communication path 52 and the master control node 51a, there will be no transmission delay time request due to, for example, broadcasting. frame 81, and the slave nodes 51b and 51c that received the transmission delay time request frame 81 transmit a response frame 84 to generate congestion.
在上述实施方式2中,在例如具有以太网(注册商标)那样的星型拓扑的系统中,对于利用时分复用传输方式的公用存储器网络,能够使各节点的计数器同步,在整个装置中进行与控制的时刻相匹配的同步控制。另外,在实施方式2中,进行同步的计数器能够利用微机内部的计数器,或者利用基于FPGA等硬件的计数器来构成。因此,在实施方式2中,通过利用例如FPGA等硬件来构成例如在进行收发的帧的接收时刻与主控节点51a同步的计数器、以及测量微机的处理时间的计数器,并利用微机来运算其计数值,从而能修正处理误差。In Embodiment 2 above, in a system having a star topology such as Ethernet (registered trademark), for a common memory network using a time-division multiplexing transmission method, the counters of each node can be synchronized, and the entire device can perform Synchronous control matching the moment of control. In addition, in Embodiment 2, the counter for synchronizing can be configured by a counter inside a microcomputer, or a counter based on hardware such as an FPGA. Therefore, in Embodiment 2, for example, a counter synchronized with the master control node 51a at the time of receiving a frame to be transmitted and received and a counter for measuring the processing time of the microcomputer are configured by using hardware such as an FPGA, and the counts are calculated by the microcomputer. value, so that processing errors can be corrected.
此处,在上述示例中,作为节点同步系统50的一个示例,对主控-从属节点间的节点同步进行了说明,但在本实施方式中,并不局限于此,也能应用于例如保护继电器等中的采样同步技术。Here, in the above-mentioned example, as an example of the node synchronization system 50, the node synchronization between the master and slave nodes has been described, but in this embodiment, it is not limited to this, and it can also be applied to, for example, protection Sampling synchronization techniques in relays, etc.
(网络传输系统:大致结构例)(Network Transmission System: Schematic Configuration Example)
此处,在上述实施方式2中,存在例如利用IEEE802.3u(100BASE-TX)或IEEE802.3ab(1000BASE-T)等那样的HUB(集线器)等中继装置来将各节点间相连的情况。图12是表示包含利用了实施方式2中的主控节点51a及从属节点51b、51c的节点同步系统50在内的网络传输系统的大致结构的一个示例的图。图12所示的网络传输系统90作为一个示例具有:上述多个节点51(图12的示例中为节点51a~51c)、作为一个或多个中继装置的HUB91(图12的示例中为HUB91a~91e)。此外,节点、中继装置的数量、种类、连接方法并不局限于此。Here, in Embodiment 2 described above, nodes may be connected by a relay device such as a HUB (hub) such as IEEE802.3u (100BASE-TX) or IEEE802.3ab (1000BASE-T), for example. FIG. 12 is a diagram showing an example of a schematic configuration of a network transmission system including a node synchronization system 50 using a master node 51 a and slave nodes 51 b and 51 c in the second embodiment. The network transmission system 90 shown in FIG. 12 has as an example: the above-mentioned multiple nodes 51 (in the example of FIG. ~91e). In addition, the number, type, and connection method of nodes and relay devices are not limited thereto.
图12的示例中,将图7的主控节点,即节点51a设为节点A(主控站),将图7的从属节点,即节点51b、节点51c设为节点B、节点C(从属站)。另外,如图12所示,网络传输系统90的通信路径例如是在主控节点51a与从属节点51b之间具有中继装置的星型。此外,中继装置作为一个示例使用HUB,但本实施方式并不局限于此,例如也可以使用路由器、中继器、光转换器等。In the example of Fig. 12, the master control node of Fig. 7, i.e. node 51a is set as node A (master control station), and the slave nodes of Fig. 7, i.e. node 51b, node 51c are set as node B, node C (slave station ). In addition, as shown in FIG. 12 , the communication path of the network transmission system 90 is, for example, a star shape having a relay device between the master node 51 a and the slave node 51 b. In addition, the relay device uses a HUB as an example, but this embodiment is not limited thereto, and for example, a router, a repeater, an optical converter, etc. may be used.
另外,主控节点51a及从属节点51b、51c例如是可编程控制器(控制装置或也称为PLC(Programmable Logic Controller:可编程逻辑控制器),网络传输系统90的通信路径是对这些可编程控制器彼此间的数据进行交换的数据交换总线。连接至该数据交换总线的设备例如除了上述可编程控制器之外,还有PC、服务器、I/O模块、驱动装置(例如是逆变器、伺服机构等)等。In addition, the master control node 51a and the slave nodes 51b and 51c are, for example, programmable controllers (control devices or also called PLCs (Programmable Logic Controllers: Programmable Logic Controllers), and the communication path of the network transmission system 90 is programmable for these The data exchange bus that controller exchanges data between each other.The equipment that is connected to this data exchange bus for example also has PC, server, I/O module, driving device (such as inverter , servo mechanism, etc.) etc.
图12所示的网络传输系统90连接至与节点51a及节点51c相同的HUB91a,节点51b经由5级的HUB(中继装置)与节点51a及节点51c相连。The network transmission system 90 shown in FIG. 12 is connected to the same HUB 91a as the node 51a and the node 51c, and the node 51b is connected to the node 51a and the node 51c via a fifth-level HUB (relay device).
此处,一般的以太网的HUB中,采用被称为存储转发的接口方式。该情况下,发送来的帧全部存储在HUB内的接收缓存中,在进行HUB内部处理(例如异常判断或发送目的地判断等)之后进行发送。Here, in a general Ethernet HUB, an interface method called store-and-forward is used. In this case, all transmitted frames are stored in the receive buffer in the HUB, and are transmitted after HUB internal processing (for example, abnormality judgment and destination judgment, etc.).
(节点同步方法的顺序例)(Sequence example of node synchronization method)
图13是表示节点同步方法的大致顺序的一个示例的图。图13的示例中,为了说明方便,对使用了主控节点51a与从属节点51b的同步进行了说明,但在本实施方式中并不局限于此,能够使多个从属节点与一个主控节点同步。FIG. 13 is a diagram showing an example of a rough procedure of a node synchronization method. In the example of FIG. 13 , for the convenience of explanation, the synchronization between the master control node 51a and the slave node 51b has been described, but this embodiment is not limited to this, and multiple slave nodes and one master node can Synchronize.
在图13的节点同步处理中,首先,主控节点51a的第1基准信号生成部61生成第1基准信号(S11),从属节点51b的第2基准信号生成部71生成第2基准信号(S12)。另外,该处理以硬件方式周期性地进行工作。In the node synchronization process of FIG. 13, first, the first reference signal generator 61 of the master node 51a generates a first reference signal (S11), and the second reference signal generator 71 of the slave node 51b generates a second reference signal (S12). ). In addition, this process operates periodically by hardware.
另外,主控节点51a的间隔计数部64对修正处理间隔进行计数,在计数值达到修正处理间隔值的情况下,生成修正处理开始信号,开始同步修正处理(S13)。In addition, the interval counting unit 64 of the master node 51a counts the correction processing interval, and when the count value reaches the correction processing interval value, generates a correction processing start signal, and starts the synchronous correction processing (S13).
在间隔计数部64的计数值达到修正处理间隔值的情况下,开始主控节点51a中的同步修正处理(S13),主控节点51a的传输延迟时间通知部65为了计算出传输延迟时间而发送传输延迟时间请求帧(S14)。此外,传输延迟时间请求帧是仅改变同步化帧所包含的规定部分的数据后得到的帧,换言之也能称为同步化帧,此处为了方便,以“传输延迟时间请求帧”来进行说明。When the count value of the interval counting unit 64 reaches the correction processing interval value, the synchronization correction process in the master control node 51a is started (S13), and the transmission delay time notification unit 65 of the master control node 51a sends A delay time request frame is transmitted (S14). In addition, the transmission delay time request frame is a frame obtained by changing only a predetermined part of the data contained in the synchronization frame, in other words, it can also be called a synchronization frame. Here, for convenience, it will be described as a "transmission delay time request frame". .
若从属节点51b的接收完成通知部79接收到传输延迟时间请求帧,则生成接收完成通知,向主控节点51a进行通知(S15)。When the reception completion notification unit 79 of the slave node 51b receives the transmission delay time request frame, it generates a reception completion notification and notifies it to the master node 51a (S15).
主控节点51a的传输延迟时间通知部65在接收到接收完成通知的情况下,计算出例如往返传输延迟时间(S16),并生成包含了所计算出的往返传输延迟时间等的传输延迟时间通知帧(S17),然后将所生成的传输延迟时间通知帧经由通信路径52发送至从属节点51b(S18)。The transmission delay time notification unit 65 of the master node 51a calculates, for example, a round-trip transmission delay time (S16) when receiving the reception completion notification, and generates a transmission delay time notification including the calculated round-trip transmission delay time, etc. frame (S17), and then transmits the generated transmission delay time notification frame to the slave node 51b via the communication path 52 (S18).
若从属节点51b的帧接收部80接收到传输延迟时间通知帧,则将该帧所包含的往返传输延迟时间(值)退避至存储器45等(S19)。然后,主控节点51a的同步化帧通知部66与第1基准信号同步地将同步化帧作为中断信号发送至从属节点51b(S20)。从属节点51b在接收到同步化帧的情况下(S21),启动基于软件的同步修正处理(S22),并使系统开销计数部74重启(S23)。然后,计数值获取部75获取第2基准信号生成部71与系统开销计数部74的两个计数值(S24),同步判断部76基于所述两个计数值来进行同步判断(S25),在判断为不同步的情况下,计算出综合延迟时间(S26)。综合延迟时间是例如传输延迟时间与系统开销值相加后得到的值,但并不局限于此。另外,从属节点51b的同步修正部77利用所计算出的综合延迟时间来进行同步修正(S27)。此外,在图13所示的处理中,从属节点51b也可以将表示同步修正已完成这一情况的应答帧发送至主控节点51a。另外,主控节点51a也可通过上述步骤对与通信路径52相连的从属节点51b以外的从属节点进行节点同步处理。When the frame receiving unit 80 of the slave node 51b receives the transmission delay time notification frame, it saves the round-trip transmission delay time (value) included in the frame to the memory 45 or the like (S19). Then, the synchronization frame notification unit 66 of the master node 51a transmits a synchronization frame as an interrupt signal to the slave node 51b in synchronization with the first reference signal (S20). When the slave node 51b receives the synchronization frame (S21), it starts the synchronization correction process by software (S22), and restarts the overhead counting unit 74 (S23). Then, the count value acquisition unit 75 acquires two count values of the second reference signal generation unit 71 and the overhead count unit 74 (S24), and the synchronization determination unit 76 performs a synchronization determination based on the two count values (S25). When it is judged that it is out of synchronization, the overall delay time is calculated (S26). The overall delay time is, for example, a value obtained by adding the transmission delay time and the overhead value, but is not limited thereto. In addition, the synchronization correction unit 77 of the slave node 51b performs synchronization correction using the calculated total delay time (S27). In addition, in the processing shown in FIG. 13, the slave node 51b may transmit to the master node 51a a response frame indicating that synchronization correction has been completed. In addition, the master control node 51a may perform node synchronization processing on slave nodes other than the slave node 51b connected to the communication path 52 through the above steps.
此处,本实施方式中,生成用于使计算机起到上述节点51所具有的各单元的作用的程序(节点同步程序),通过将所生成的程序安装于计算机等,从而实现上述各节点同步处理。Here, in this embodiment, a program (node synchronization program) for causing a computer to function as each unit included in the above-mentioned node 51 is generated, and by installing the generated program on a computer or the like, synchronization of the above-mentioned nodes is realized. deal with.
如上所述,根据本实施方式,能够在抑制处理负荷的同时,高精度地使规定的信号同步。由此,例如能实现各节点51的数据交换周期的稳定化。另外,根据本实施方式,在具有例如以太网那样的星型拓扑的系统中,对于利用时分复用传输方式的公用存储器网络,能够使各节点51的定时器同步,实现传输的高效化、数据交换的高效化、数据交换周期的稳定化等。As described above, according to the present embodiment, it is possible to precisely synchronize predetermined signals while suppressing the processing load. Thereby, for example, stabilization of the data exchange period of each node 51 can be achieved. In addition, according to this embodiment, in a system having a star topology such as Ethernet, it is possible to synchronize the timers of each node 51 with respect to a common memory network using a time-division multiplexing transmission method, thereby realizing high-efficiency transmission and data transmission. Efficiency of exchange, stabilization of data exchange cycle, etc.
此外,本实施方式能够适用于例如钢铁工厂等大规模设备等中利用多个操作来进行一连串的动作时的同步方法,此外,还能广泛适用于整个千兆以太网中的各装置间的同步方式。In addition, this embodiment can be applied to a synchronization method when a series of operations are performed using multiple operations in a large-scale facility such as a steel plant, and can also be widely applied to synchronization between devices in the entire Gigabit Ethernet network. Way.
以上,参照附图对本发明的优选实施方式进行说明,本发明并不局限于所述实施方式。本领域的技术人员在权利要求的范围所记载的范畴内,能够想到各种变形例或修正例,其当然也属于本发明的技术范围内。As mentioned above, although preferred embodiment of this invention was described referring drawings, this invention is not limited to the said embodiment. Those skilled in the art can conceive of various modified examples and corrected examples within the scope described in the claims, and these naturally also belong to the technical scope of the present invention.
此外,本说明书的信号同步方法以及节点同步方法的各步骤并不一定要沿着顺序图所记载的次序来按时间序列进行处理,也可以包含并行处理或利用子程序的处理。In addition, each step of the signal synchronization method and the node synchronization method in this specification does not necessarily have to be processed in time series along the order described in the sequence diagram, and parallel processing or processing using a subroutine may be included.
工业上的实用性Industrial Applicability
本发明涉及用于使规定的信号同步的信号同步系统、节点同步系统、信号同步方法以及节点同步方法。The present invention relates to a signal synchronization system, a node synchronization system, a signal synchronization method, and a node synchronization method for synchronizing predetermined signals.
标号说明Label description
10 信号同步系统10 Signal Synchronization System
11 处理器模块11 processor module
12 传输总线12 transfer bus
13、53I/O (输入输出)模块13. 53I/O (input and output) module
14、54 外部设备14, 54 External equipment
15、55 编译装置15, 55 compilation device
21、61 第1基准信号生成部21, 61 1st reference signal generator
22、62 第1运算部22, 62 1st Computing Department
23、38、63、78 存储部23, 38, 63, 78 Storage
31、71 第2基准信号生成部31, 71 Second reference signal generator
32、72 第2运算部32, 72 2nd Computing Unit
34、74 系统开销计数部34, 74 System overhead counting department
35、75 计数值获取部35, 75 Count value acquisition part
36、76 同步判断部36, 76 Synchronous Judgment Unit
37、77 同步修正部37, 77 synchronous correction department
41 输入部41 Input section
42 输出部42 output section
43 CPU43 CPUs
44 FPGA44 FPGAs
45 存储器45 memory
46 外部接口46 external interface
50 节点同步系统50 Node Synchronous System
51 节点51 nodes
52 通信路径52 communication path
65 传输延迟时间通知部65 Transmission Delay Time Notification Department
66 同步化帧通知部66 Synchronization frame notification unit
79 接收完成通知部79 Receive Completion Notification Department
80 帧接收部80 frame receiving unit
81 传输延迟时间请求帧81 Transmission Delay Time Request Frame
82 接收完成帧82 Receive complete frame
83 传输延迟时间通知帧83 Transmission delay time notification frame
84 应答帧84 Acknowledgment frame
90 网络传输系统90 network transmission system
91 HUB(中继装置)91 HUB (relay device)
Claims (18)
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2012/082334 WO2014091592A1 (en) | 2012-12-13 | 2012-12-13 | Signal synchronization system, node synchronization system, signal synchronization method, and node synchroniz ation method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104838615A CN104838615A (en) | 2015-08-12 |
CN104838615B true CN104838615B (en) | 2017-08-18 |
Family
ID=50933913
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201280077569.7A Active CN104838615B (en) | 2012-12-13 | 2012-12-13 | Signal synchronization system, node synchronization system, signal synchronization method, and node synchronization method |
Country Status (4)
Country | Link |
---|---|
JP (1) | JP5825446B2 (en) |
KR (1) | KR101636496B1 (en) |
CN (1) | CN104838615B (en) |
WO (1) | WO2014091592A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6400553B2 (en) * | 2015-09-28 | 2018-10-03 | ファナック株式会社 | Numerical control system with synchronous control function between units |
JP6719994B2 (en) * | 2016-06-30 | 2020-07-08 | キヤノン株式会社 | Communication system, communication device, and communication method |
WO2019010626A1 (en) * | 2017-07-11 | 2019-01-17 | 深圳市柔宇科技有限公司 | Capturing method and terminal |
KR102200451B1 (en) * | 2018-09-21 | 2021-01-08 | 주식회사 룩시드랩스 | Method for synchronizing time and apparatus using the same |
JP7328064B2 (en) * | 2019-08-07 | 2023-08-16 | ファナック株式会社 | Synchronization method and control device |
FR3108817B1 (en) | 2020-03-26 | 2022-03-04 | Safran | Communication method according to a TDMA protocol between a master device and at least one slave device |
JP7243695B2 (en) * | 2020-08-25 | 2023-03-22 | 横河電機株式会社 | Information processing device, information processing system, and information processing method |
CN114285512B (en) * | 2021-11-17 | 2024-01-23 | 中国电子科技集团公司第五十四研究所 | Communication timing method, communication system and communication equipment |
KR20230079632A (en) * | 2021-11-29 | 2023-06-07 | 성창 주식회사 | System for synchronizing time between server and IoT device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101039145A (en) * | 2007-03-30 | 2007-09-19 | 华为技术有限公司 | Method and apparatus for realizing clock |
CN101136737A (en) * | 2007-07-16 | 2008-03-05 | 中兴通讯股份有限公司 | System and method for eliminating long line transmission time delay of source synchronizing signal |
CN101431796A (en) * | 2008-12-10 | 2009-05-13 | 扬州万方电子技术有限责任公司 | Method for clock master-slave synchronization of centered broad band radio communication system |
JP2009182659A (en) * | 2008-01-30 | 2009-08-13 | Toshiba Corp | Timing synchronizing method, synchronization device, synchronization system, and synchronization program |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6691071B2 (en) * | 2002-05-13 | 2004-02-10 | Motorola, Inc. | Synchronizing clock enablement in an electronic device |
JP4241343B2 (en) * | 2003-11-26 | 2009-03-18 | 富士電機システムズ株式会社 | Transmission timing determination method, bus usage right arbitration method, network system, program |
JP2005253033A (en) | 2004-02-06 | 2005-09-15 | Nippon Telegr & Teleph Corp <Ntt> | Network synchronization device, clock transmission method, and clock transmission packet network |
US7844703B2 (en) * | 2006-11-02 | 2010-11-30 | International Business Machines Corporation | System and method of measurement for a distributed computer system |
KR101011314B1 (en) * | 2008-03-31 | 2011-01-28 | 후지쯔 가부시끼가이샤 | Devices with a clock generation function, how to set the reference frequency and how to adjust the reference frequency |
US8120935B2 (en) * | 2011-03-29 | 2012-02-21 | American Superconductor Corporation | Power converter with dual ring network control |
-
2012
- 2012-12-13 CN CN201280077569.7A patent/CN104838615B/en active Active
- 2012-12-13 KR KR1020157015123A patent/KR101636496B1/en active IP Right Grant
- 2012-12-13 JP JP2014551797A patent/JP5825446B2/en active Active
- 2012-12-13 WO PCT/JP2012/082334 patent/WO2014091592A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101039145A (en) * | 2007-03-30 | 2007-09-19 | 华为技术有限公司 | Method and apparatus for realizing clock |
CN101136737A (en) * | 2007-07-16 | 2008-03-05 | 中兴通讯股份有限公司 | System and method for eliminating long line transmission time delay of source synchronizing signal |
JP2009182659A (en) * | 2008-01-30 | 2009-08-13 | Toshiba Corp | Timing synchronizing method, synchronization device, synchronization system, and synchronization program |
CN101431796A (en) * | 2008-12-10 | 2009-05-13 | 扬州万方电子技术有限责任公司 | Method for clock master-slave synchronization of centered broad band radio communication system |
Also Published As
Publication number | Publication date |
---|---|
WO2014091592A1 (en) | 2014-06-19 |
JPWO2014091592A1 (en) | 2017-01-05 |
KR101636496B1 (en) | 2016-07-05 |
KR20150084917A (en) | 2015-07-22 |
JP5825446B2 (en) | 2015-12-02 |
CN104838615A (en) | 2015-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104838615B (en) | Signal synchronization system, node synchronization system, signal synchronization method, and node synchronization method | |
EP2506470B1 (en) | Method, apparatus and system for time distribution in a telecommunications network | |
WO2014199729A1 (en) | Distribution device, distribution system, and distribution method | |
CN104184534B (en) | Method for achieving accuracy of transparent clock path delay of IEEE1588 protocol | |
US10756879B2 (en) | Master control device and synchronous communication system using same | |
US20090222589A1 (en) | Circuit arrangement and method for synchronization of clocks in a network | |
US20220413474A1 (en) | Control system | |
JP5127482B2 (en) | Timing synchronization method, synchronization apparatus, synchronization system, and synchronization program | |
CN102377558B (en) | For the system and method for time synchronized in communication network | |
WO2016004644A1 (en) | Method and apparatus for monitoring ethernet clock synchronization | |
WO2013051446A1 (en) | Time control device, time control method, and program | |
WO2017054554A1 (en) | Clock synchronization method, device, and communication apparatus | |
US9928184B2 (en) | Microcomputer | |
JP2020195056A (en) | Time synchronization program, information processing device and time synchronization method | |
JP6254028B2 (en) | Slave node and time synchronization method | |
JP4961589B2 (en) | Network system and slave synchronization method | |
EP3070926B1 (en) | Synchronous camera | |
WO2020021597A1 (en) | Communication device, communication system, and synchronization control method | |
CN104115450B (en) | Signal synchronization system, multiprocessor and node synchronization system | |
US9037891B2 (en) | Multi-processor synchronization using time base counters | |
CN103441832A (en) | Clock synchronization method, system and equipment based on PTP | |
CN107623556A (en) | Clock synchronizing method and its system in communication system | |
JP6085864B2 (en) | Time synchronization system, time synchronization method, slave node, and computer program | |
KR20170058629A (en) | Method, apparatus, system and computer program for enhancing the accuracy of Time Synchronization between devices | |
CN118802046A (en) | Time synchronization method, device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |