Time synchronization device, method, and program

The time synchronization device dynamically adjusts correction speed based on time differences by using quantization values and errors, enhancing synchronization accuracy and efficiency by matching timer time with reference time effectively.

WO2024190549A1PCT designated stage expired Publication Date: 2024-09-19OMRON CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/008439
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-14
Filing Date
2024-03-06
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

Existing time synchronization techniques have a fixed correction speed, which can be too fast or slow depending on the time difference, leading to inefficiencies in adjusting the timer time to match a reference time.

Method used

A time synchronization device that calculates the time difference between a reference time and a timer time, uses quantization to derive a quantization value and error, and adjusts the correction speed based on the time difference by adding quantization errors, allowing for dynamic correction speed adjustment.

Benefits of technology

The solution enables precise and adaptive time synchronization by increasing correction speed for larger time differences and decreasing it for smaller differences, improving synchronization accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024008439_19092024_PF_FP_ABST
    Figure JP2024008439_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present invention changes a correction speed for time synchronization according to a time difference. The device: calculates, for each first period, a time difference between a reference time detected by network communication and a timer time measured by a timer; inputs the time difference for each second period within the first period; outputs a quantization value quantized into a quantization bit width and a quantization error; corrects, for each second period, the timer time so as to indicate the reference time, using the quantization value output by the quantization unit; adds, for each second period, a quantization error in a second period immediately before a particular second period to the time difference calculated in the first period to which the particular second period belongs; and outputs the time difference after the addition to the quantization unit.
Need to check novelty before this filing date? Find Prior Art

Description

Time synchronization device, method, and program

[0001] The present disclosure relates to a time synchronization technique for synchronizing the time of a timer with a reference time.

[0002] Various techniques for adjusting time have been proposed. For example, Patent Document 1 (Japanese Patent Laid-Open Publication No. 2009-157913) discloses a technique in which a slave gradually adjusts the deviation of its time axis using an adjustment amount based on the time difference between the slave and the master. Also, Patent Document 2 (Japanese Patent Laid-Open Publication No. 2011-216085) discloses a technique in which a slave corrects its internal clock based on time information stored in a time synchronization frame received from the master and a set correction time.

[0003] JP 2009-157913 A JP 2011-216085 A

[0004] In the time correction described above, the correction (adjustment) speed was a preset constant speed so that the correction would be completed within a predetermined correction interval. Therefore, depending on the size of the time difference, the correction speed may be too fast or may be inappropriate.

[0005] Therefore, an object of one aspect of the present disclosure is to provide a technique that can change the correction speed for time synchronization according to the time difference.

[0006] The time synchronization device of the present disclosure includes a calculation unit that calculates, for each first period, the time difference between a reference time detected by network communication and the timer time measured by a timer; a quantization unit that inputs the time difference and outputs a quantization value quantized to a predetermined quantization bit width and a quantization error for each second period within the first period; a correction unit that corrects, for each second period, the timer time to indicate the reference time using the quantization value output from the quantization unit; and an addition unit that adds, for each second period, the quantization error for the second period immediately preceding the second period to the time difference calculated for the first period to which the second period belongs, and outputs the time difference after the addition to the quantization unit.

[0007] According to the above-described time synchronization device, when quantization is performed by the quantization unit, the larger the time difference, the larger the quantization value and quantization error derived, and the larger the correction amount per second period, allowing for a faster correction speed of the timer time. Conversely, the smaller the time difference, the smaller the quantization value and quantization error derived, and the smaller the correction amount per second period, allowing for a slower correction speed of the timer time. Therefore, the correction speed for time synchronization can be changed according to the time difference.

[0008] The above-described time synchronization device is provided in a control device for FA (factory automation), and therefore can be applied to time synchronization for controlling FA.

[0009] In the above-mentioned time synchronization device, the predetermined quantization bit width is a bit width shorter than the bit width of the time difference data, and is composed of higher-order bits following the most significant bit including the most significant bit of the time difference data.

[0010] According to the above-described time synchronization device, the quantization bit width can be configured by the most significant bit and the subsequent significant bits.

[0011] In the time synchronization device described above, the time difference includes a transmission delay in network communication. Therefore, when the reference time is detected using network communication, the timer time can be corrected using the time difference including the network transmission delay.

[0012] The time synchronization device is provided in a slave device that communicates with a master device over a network, and the slave device communicates reference time messages with the master device. Therefore, in a master-slave system, the time synchronization device can synchronize the timer time of the slave device with the reference time of the master device.

[0013] The slave devices equipped with the above-described time synchronization device include FA (factory automation) control devices. Therefore, in an FA control system, the timer time of the control device can be synchronized to the reference time by the time synchronization device.

[0014] The above-described time synchronization device includes a noise shaping unit having the above-described quantization unit and addition unit. Therefore, it is possible to realize a time synchronization device having a quantization unit and an addition unit that configure noise shaping.

[0015] The control device equipped with the above-mentioned time synchronization device includes a control calculation unit that performs control calculations to calculate control commands for controlling the target, a first connector for connecting a network to which the master device belongs, and a second connector for connecting a field network to which the target belongs and which communicates control commands.

[0016] A control device equipped with the above-mentioned time synchronization device can make the network it connects to for communication with the master device that provides the reference time and the network it connects to for communication with the controlled object independent of each other.

[0017] A method for performing time synchronization of a timer according to this disclosure includes calculating, for each first period, a time difference between a reference time obtained through network communication and a timer time measured by the timer; inputting, for each second period within the first period, the time difference and outputting a quantized value and a quantization error quantized to a predetermined quantization bit width; correcting, for each second period, the timer time to indicate the reference time using the quantization value output in the quantization; and adding, for each second period, the quantization error in the second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, wherein the quantization includes inputting the time difference after the addition and outputting the quantized value and the quantization error quantized to a predetermined quantization bit width.

[0018] A program according to this disclosure is a program for causing a computer to execute a method for synchronizing a timer, the method including: calculating, for each first period, a time difference between a reference time acquired via network communication and a timer time measured by the timer; inputting, for each second period within the first period, the time difference and outputting a quantized value and a quantization error quantized to a predetermined quantization bit width; correcting, for each second period, the timer time to indicate the reference time using the quantized value output in the quantization; and adding, for each second period, the quantization error in a second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, wherein the quantization includes inputting the time difference after the addition and outputting the quantized value and the quantization error quantized to the predetermined quantization bit width.

[0019] According to the present disclosure, the correction speed for time synchronization can be changed according to the time difference.

[0020] 1 is a diagram schematically showing an application example of a slave device 200 having a time synchronization unit according to the present embodiment. FIG. 2 is a diagram schematically showing the configuration of a control system according to the present embodiment. FIG. 3 is a block diagram showing an example of the hardware configuration of a control device 2 according to the present embodiment. FIG. 4 is a block diagram of a noise shaping unit 33. FIG. 5 is a diagram schematically showing frequency characteristics achieved by noise shaping. FIG. 6 is a diagram showing the characteristics of a quantizer 37 according to the present embodiment. FIG. 7 is a diagram showing the characteristics of a quantizer 37 according to the present embodiment. FIG. 8 is a diagram showing the transfer characteristics of quantization noise Vg in noise shaping. FIG. 9 is a flowchart of time synchronization processing according to the present embodiment. FIG. 10 is a diagram showing the correction processing according to the present embodiment in comparison with other correction processing. FIG. 11 is a diagram showing the correction processing according to the present embodiment in comparison with other correction processing.

[0021] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described in detail with reference to the accompanying drawings, in which the same or corresponding parts in the drawings are designated by the same reference numerals and the description thereof will not be repeated.

[0022] <A. Application Example> First, an example of a situation in which the present invention is applied will be described. In this embodiment, as a typical example of a "controller," a controller applied to FA (factory automation), typically a PLC (programmable logic controller), will be described. However, the technical concept disclosed in this specification is not limited to the name PLC, and can be applied to any control device.

[0023] In this embodiment, the time synchronization device is provided in a slave device that communicates with the master device over a network. The slave device includes the control device described above. The time synchronization device (slave device, control device) performs a "time synchronization process" to synchronize the management timer with a reference timer that manages the reference time. In this disclosure, "time" is intended to indicate a certain point in the flow of time, and is defined using units such as hours, minutes, and seconds.

[0024] The time of the management timer indicates the time measured based on the clock of the management timer, and the time of the reference timer indicates the time measured based on the clock of the reference timer. More specifically, the reference timer and the management timer each count a reference clock generated by an oscillator (not shown) and store the count value in an internal register that is not reset. The count value represents, for example, an integer value. In this way, the reference time is indicated based on the count value of the reference timer's register, and the time is indicated based on the count value of the management timer's register. The time difference between the management timer and the reference timer includes the time difference caused by the frequency difference between the clocks of the two timers.

[0025] FIG. 1 is a diagram schematically illustrating an application example of a slave device 200 having a time synchronization unit according to this embodiment. Referring to FIG. 1 , the slave device 200 communicates with a master device via a network 11 that constitutes a transmission path. The master device has a reference timer 191 that manages a reference time R. The master device transmits a message (hereinafter referred to as a time distribution message 21) for distributing the reference time R at a predetermined first period (e.g., 1 ms) via the network 11. The slave device 200 has a management timer 35 and a time synchronization unit 3. The time synchronization unit 3 corresponds to a time synchronization device. The time synchronization unit 3 performs a "time synchronization process" by correcting a time 44 managed by the management timer 35 based on the time difference between the time 44 and the reference time R.

[0026] The slave device 200 receives a time distribution message 21 from the master device and acquires a reference time R based on the received time distribution message 21. Because the reference time R indicates a value that includes a propagation delay (jitter) on the network 11 that transfers the time distribution message 21, the time difference acquired from the reference time R also indicates a value that includes this transmission delay. The time synchronization unit 3 includes a calculation unit 31 that inputs the acquired reference time R and a time 44 of a management timer 35 and derives a time difference 41 (time difference 41 = reference time R - time 44), which is the deviation between the two; a filter 32 that derives an operation amount 42 based on the time difference 41; a noise shaping unit 33 that derives a correction amount 43 based on the operation amount 42 from the filter 32; and a correction unit 34 that corrects the time 44 of the management timer 35 to indicate the reference time using the correction amount 43 from the noise shaping unit 33. The filter 32 operates in synchronization with the first period, and the noise shaping unit 33 and the correction section 34 operate in synchronization with a second period (described later) based on time 44 .

[0027] The filter 32 performs a proportional-integral-differential controller (PID) control operation using, for example, the time difference 41 as an input, to derive a manipulated variable 42 indicating the filtered time difference 41. The filter 32 operates in synchronization with the first period, thereby outputting the manipulated variable 42 for each first period.

[0028] The noise shaping unit 33 corresponds to a "quantization unit." For each second period within a first period, which is the distribution period of the time distribution message 21, the noise shaping unit 33 receives an operation amount 42 corresponding to a time difference 41 acquired in the first period, quantizes the operation amount 42 to a predetermined quantization bit width, and outputs a correction amount 43, which is a quantized value. The noise shaping unit 33 also outputs a quantization error that occurs in the quantization for each second period.

[0029] The correction unit 34 also corrects the time 44 of the management timer 35 every second period using a correction amount 43, which is a quantized value output from the noise shaping unit 33, so that the time 44 indicates the reference time R. The correction unit 34 corrects the time 44, for example, by adding the correction amount 43. The correction performed by the correction unit 34 also represents the concept of "adjustment," in which a value indicated by the correction amount 43 is added to or subtracted from a counter value of a register. In this case, the correction amount 43 represents the concept of an adjustment amount that indicates an amount of addition or subtraction.

[0030] The time synchronization unit 3 adds the quantization error output in the second period immediately preceding the second period to the operation amount 42 input by the noise shaping unit 33 for each second period, and outputs the operation amount 42 after the addition to the noise shaping unit 33.

[0031] The noise shaping unit 33 according to this embodiment includes a quantization module. The quantization module converts a discrete value of an operation amount 42 into a correction amount 43, which is a discrete digital value having a quantization bit width. The value of the operation amount 42 having a bit width that does not correspond to the quantization bit width is added to the correction amount 43 for the next second period as a quantization error, and the noise shaping unit 33 quantizes the correction amount 43 after the addition for the next second period to derive the correction amount 43.

[0032] When the manipulated variable 42 is quantized using such noise shaping unit 33, the larger the time difference 41, i.e., the larger the change in the manipulated variable 42, the larger the derived quantized value and quantization error, so the larger the correction amount 43 for each second period and the faster the correction speed at time 44. On the other hand, the smaller the time difference 41, i.e., the smaller the change in the manipulated variable 42, the smaller the derived quantized value and quantization error, so the smaller the correction amount 43 for each second period and the slower the correction speed at time 44.

[0033] Therefore, by correcting the time 44 using the correction amount 43 derived by the noise shaping unit 33, the correction speed for time synchronization for each first period (i.e., the correction amount 43 for each second period) can be changed to a speed corresponding to the magnitude of the time difference 41 obtained in the first period.

[0034] <B. Control System Configuration> The slave device 200 described above can be mounted on a PLC that constitutes an FA control system. FIG. 2 is a diagram that schematically illustrates the configuration of a control system according to this embodiment. Referring to FIG. 2, the control system 1 realizes FA of a production line. More specifically, in the control system 1, networks are connected at multiple levels, and different functions are assigned to the networks at each level. Specifically, although not limited thereto, for example, four levels of networks 11 to 14 are provided.

[0035] The control level network 11 includes multiple control devices 2A, 2B, and 2C, a device / line management device 190, and a display device 280 that provides a supervisory control and data acquisition (SCADA) function. These devices exchange data with each other via the network 11. When there is no need to distinguish between the control devices 2A, 2B, and 2C, they are referred to as "control devices 2." The network 11 mainly transmits information such as time synchronization and control commands related to the control system.

[0036] The control device 2 connects one or more field devices 90 that can be controlled via a field-level network 110. Each of the one or more field devices 90 belonging to such a field network includes an actuator that exerts some kind of physical action on a manufacturing device, a production line, or the like (hereinafter also collectively referred to as "field"), and an input / output device that exchanges information with the field.

[0037] Data exchanged between the control device 2 and the field devices 90 via the network 110 is updated at extremely short intervals of the order of several hundred microseconds to several tens of milliseconds. Such an update process of exchanged data is also called an input / output refresh process.

[0038] An equipment / line management device 190 that manages equipment and lines, and manufacturing management devices 380 and 390 that manage manufacturing plans, etc. are connected to management-level network 12. Equipment / line management device 190 and manufacturing management devices 380 and 390 exchange management information such as manufacturing plans, and equipment or line information, via network 12.

[0039] Connected to computer-level network 13 are manufacturing control devices 380 and 390, and a manufacturing execution system (MES) 400 that manages a time-series DB (abbreviation for database) 450. Manufacturing control devices 380 and 390 and manufacturing execution system 400 exchange production control and information data via network 13.

[0040] The manufacturing execution system 400 stores the observed values, which are input values ​​from the field devices 90 collected via the network 13, in the time-series DB 450 as time-series data in the order in which they were observed. Specifically, in this embodiment, the control device 2 generates a frame including the specified observed value (or control command) and the time 44 data of the management timer 35, and transfers it to the manufacturing execution system 400 via the networks 11, 12, and 13.

[0041] The manufacturing execution system 400 and external devices on the cloud are connected to the network 14, which includes an external network such as the Internet. The manufacturing execution system 400 transfers data from the time-series DB 450 to the devices on the cloud by exchanging data with the devices on the cloud.

[0042] In the control system 1 shown in FIG. 2, networks 11 to 14 and network 110 employ protocols and frameworks that correspond to the differences in required characteristics. For example, EtherNet / IP (registered trademark), an industrial open network that implements a control protocol on general-purpose Ethernet (registered trademark), may be used as the protocol for networks 11 and 12 belonging to the factory network. EtherCAT (registered trademark), an example of a machine control network, may be used as the protocol for network 110. The same or different protocols may be used for network 11 and network 110. By employing such network technology suited to machine control, real-time performance can be provided, with the time required for transmission between devices guaranteed.

[0043] In contrast, networks 13 and 14 belonging to the corporate network use a protocol such as general-purpose Ethernet to ensure a variety of connection destinations. By adopting general-purpose Ethernet, restrictions on the amount of data that can be transmitted can be eliminated.

[0044] Support devices may be connected to the control device 2 or the device / line management device 190. The support devices are devices that assist the control device 2 in making the necessary preparations to control the controlled object.

[0045] The control system 1 includes a distributed system 300 in which control devices 2A, 2B, and 2C are provided in different processes 3A, 3B, and 3C, respectively. For example, and without limitation, process 3A represents a part feeder process that aligns and transports workpieces (components, members), process 3B represents a process that moves the aligned workpieces in process 3A using a pick-and-place operation of a robot, and process 3C represents a process that assembles the moved workpieces. In the distributed system 300, the operation of the field devices 90 connected to the control device 2 in each process differs from the operation of the field devices 90 connected to the control device 2 in the preceding and following processes. To meet the required takt time in the distributed system 300, the operation in a certain process is performed in synchronization with the operation in the preceding and following processes of the process.

[0046] The control device 2 outputs control commands for implementing sequence control of the field devices 90 connected to the control device 2. The control device 2 executes control calculation programs related to control, including, for example, sequence programs and motion programs for implementing motion control, at predetermined cycles (also referred to as control cycles) based on synchronized time, and outputs the control commands. The field devices 90 are controlled in real time in accordance with the control commands. Such control cycles correspond to the predetermined cycles based on the time 44 of the management timer 35.

[0047] 2, the configuration for realizing time synchronization may include, for example, a case in which the network 11 performs data communication in accordance with TSN (Time-Sensitive Networking), which is a protocol for industrial networks, and a case in which the network 11 performs data communication in accordance with EtherCAT (registered trademark: Ethernet for Control Automation Technology). Note that the standard applied to the network 11 is not limited to these and may be, for example, IEEE 1588.

[0048] 2, a master device having a reference timer 191 transmits a time distribution message 21 including data on the reference time measured by the reference timer to the network 11. The reference timer may be a timer possessed by any of the control devices 2A, 2B, and 2C or a timer of another device (e.g., device / line management device 190) on the network 11, and corresponds to the timer with the highest accuracy among these timers. In this embodiment, for example, the device / line management device 190 operates as the master device.

[0049] In each control device 2, the time synchronization process shown in FIG. 1 is performed to synchronize the management timer 35 of the control device 2 with the reference timer 191, so that the control device 2 of a certain process can operate the field devices 90 in that process in synchronization with the field devices 90 in the processes before and after that process.

[0050] <C. Configuration of Control Device> A case will be described in which a slave device 200 having a module of the time synchronization device shown in Fig. 1 is installed in a control device 2 constituting a distributed system 300. Fig. 3 is a block diagram showing an example of the hardware configuration of the control device 2 according to this embodiment.

[0051] Referring to FIG. 3 , the control device 2 includes a processor 102, a chipset 104, a secondary storage device 106, a main storage device 108, a host network controller 105, a USB (Universal Serial Bus) controller 107, a memory card interface 109, a field network controller 118, a counter 126, and an RTC (Real Time Clock) 128.

[0052] The processor 102 is composed of a central processing unit (CPU), a microprocessor unit (MPU), a graphics processing unit (GPU), etc., and reads various programs stored in the secondary storage device 106, deploys them in the main storage device 108, and executes them to perform control according to the control target and various processes described below. The secondary storage device 106 is composed of non-volatile storage devices such as a hard disk drive (HDD) and a solid state drive (SSD). The main storage device 108 is composed of volatile storage devices such as a dynamic random access memory (DRAM) and a static random access memory (SRAM).

[0053] The chipset 104 controls the processor 102 and each device to realize processing of the control device 2 as a whole.

[0054] The secondary storage device 106 stores period data 202 indicating a first period and a second period for receiving (distributing) the time distribution message 21 for the reference time. The second period corresponds to a sampling period for quantization in the noise shaping unit 33.

[0055] The secondary storage device 106 stores a UPG (short for user program) 201, which is created according to the manufacturing device or facility to be controlled. The UPG 201 includes a control program including instruction codes that, when executed, cause the processor 102 to execute control calculations, and a time synchronization program 210 including instruction codes that, when executed, cause the processor 102 to execute time synchronization processing. The time synchronization program 210 includes a correction program 211 including instruction codes that, when executed, cause the processor 102 to perform time correction of the management timer based on the correction amount 43. The correction program 211 includes a noise shaping program 212 including instruction codes that, when executed, cause the processor 102 to perform noise shaping. In this embodiment, the processor 102 corresponds to a "control calculation unit." The control calculation unit executes the control program to calculate control commands for controlling the field device 90 to be controlled.

[0056] The upper network controller 105 includes a connector for connecting to the network 11 and a circuit such as a NIC (Network Interface Card) having a timer 103. The upper network controller 105 exchanges data with each device belonging to the upper network 11. The USB controller 107 controls the exchange of data with an external device via a USB connection.

[0057] The memory card interface 109 is configured to allow a memory card 116 to be attached and detached, and allows data to be written to the memory card 116 and various data (user programs, trace data, etc.) to be read from the memory card 116 .

[0058] Counter 126 is used as a time reference for managing the execution timing of various processes in control device 2. Counter 126 can be a "management timer" or a "reference timer." Counter 126 may be implemented using, for example, a hardware timer such as a high precision event timer (HPET) arranged on a system bus that drives processor 102, or may be implemented using a dedicated circuit such as an application specific integrated circuit (ASIC) or field-programmable gate array (FPGA). Control device 2 synchronizes timers 103, 119, 91A, and 91B with counter 126. The implementation of the noise shaping unit module is not limited to software implementation and may be implemented in the circuit of counter 126.

[0059] The RTC 128 is a type of counter with a timekeeping function, and provides the current time to the processor 102 and the like.

[0060] The field network controller 118 controls the exchange of data with other devices including the field device 90 via the network 110. The field network controller 118 has a connector for connecting to the network 110 and a timer 119 used as a time reference for managing timing with other devices. In Fig. 3, the timers 91 of the field devices 90 are indicated by timer 91A of the field device 90A, timer 91B of the field device 90B, and so on.

[0061] The timer 119 and the counters (timers 91A and 91B) included in devices such as the field equipment 90 can have the same configuration as the counter 126 described above.

[0062] The field network controller 118 operates as a communication master for periodic communication via the network 110, continuously monitors the difference between the counter value indicated by the counter of each device connected to the field bus and the counter value indicated by the timer 119, and outputs a synchronization signal to instruct a device in which a discrepancy in the counter value occurs to correct the discrepancy, as necessary. In this way, the field network controller 118 has a synchronization management module that issues a command to the device to make the counter value indicated by the device's counter coincide with the counter value indicated by the timer 119.

[0063] FIG. 3 shows an example of a configuration in which the processor 102 executes a program to provide required modules. However, some or all of these provided modules may be implemented using dedicated hardware circuits (e.g., large-scale integration (LSI), application-specific integrated circuit (ASIC), or field-programmable gate array (FPGA)). Alternatively, the main part of the control device 2 may be realized using hardware that conforms to a general-purpose architecture (e.g., an industrial PC based on a general-purpose PC). In this case, virtualization technology may be used to run multiple operating systems (OS) for different purposes in parallel, and required applications may be executed on each OS.

[0064] 3, the network 11 through which the control device 2 communicates with the master device that has the reference timer 191 and provides the reference time can be separated from the field network 110 through which the control device 2 communicates with the field device 90 that is the control target. This makes it possible to avoid congestion on the same network between communication related to the reference time and communication related to control commands.

[0065] <D. Noise Shaping> In this embodiment, noise shaping characteristics are applied to the noise shaping unit 33 in order to derive a correction amount 43 based on a time difference 41 (or a manipulated variable 42 corresponding to the time difference 41). The noise shaping characteristics will be described with reference to FIGS. 4 and 5. FIG. 4 is a block diagram of the noise shaping unit 33. FIG. 5 is a diagram schematically showing the frequency characteristics achieved by noise shaping. The horizontal axis of FIG. 5 represents the sampling frequency fs, and the vertical axis represents the gain (level). In the diagram, bits are indicated as "bit." Note that in this embodiment, the data width (number of bits) of the input X and output Y of the noise shaping unit 33 is not limited to the number of bits in FIG. 4, and can be changed according to design specifications.

[0066] Referring to FIG. 4 , the noise shaping unit 33 includes, for example, an adder 36, a quantizer 37, a delay 38, and an amplifier 381 with a coefficient a1 as elements for quantizing an input X representing a manipulated variable corresponding to a time difference into an output Y having a predetermined quantization bit width. These elements operate in synchronization with the sampling period (second period). The quantizer 37 subtracts the output Y from the input X during quantization and outputs the resulting value as a quantization noise Vg. The delay 38 receives the quantization noise Vg output from the quantizer 37, delays it by the sampling period, and outputs it. The amplifier 381 receives the output from the delay 38 (i.e., the delayed quantization noise), amplifies it by the coefficient a1, and then outputs it to the adder 36. The adder 36 adds the output from the amplifier 381 (the delayed and amplified quantization noise Vg) to the input X, and outputs the input X to which the quantization noise Vg has been added to the quantizer 37. Here, the input X indicates data having a bit width of, for example, 8 bits, and the quantization bit width is, but is not limited to, 2 bits. The 2 bits of the quantization bit width are shorter than the bit width of the data of the input X, and are composed of higher-order bits following the most significant bit including the most significant bit of the data of the input X. Since the most significant bit of the input X is a sign bit, the output Y from the quantizer 37 represents one of the values ​​−1, 0, and 1. The output Y is output to the correction unit 34 shown in FIG. 1 via an LPF (low-pass filter) 39 provided outside the noise shaping unit 33.

[0067] In this embodiment, the coefficient a1 corresponding to the gain of the amplifier 381 is set to (a1=1), but the set value of the coefficient a1 can be changed. By changing the set value of the coefficient a1, the characteristics of the noise shaping unit 33 can be changed.

[0068] As shown in FIG. 5, when the input X is simply quantized, the quantization noise Vg is uniformly distributed across the entire frequency band of the sampling frequency fs. In contrast, the quantization in noise shaping has a characteristic in which the quantization noise Vg is concentrated in the high frequency band of the sampling frequency fs, as shown in FIG. 5. The LPF 39 removes the quantization noise in the high frequency band from the output Y of the quantizer 37 having such a characteristic and outputs the output Y. The LPF 39 has a cutoff frequency that reduces noise in the required band, i.e., the band 81 of the input signal in FIG. 5 (the frequency band corresponding to 1 ms of the first period). Therefore, the noise shaping unit 33 can derive an output Y with a high S / N ratio.

[0069] In this way, the noise shaping is configured to control the quantization noise Vg generated by the quantizer 37 so as to concentrate in the high frequency region, thereby making it possible to easily extract (remove) the quantization noise Vg.

[0070] In this embodiment, the noise shaping unit 33 is configured as a first-order noise shaping unit. However, this is not limited to a first-order configuration, and higher-order noise shaping units such as second-order, third-order, and so on can also be applied to this embodiment. For example, in the case of a first-order noise shaping unit, the frequency at which the noise becomes 0 dB shown in FIG. 5 is the 1 / 6 fs point when coefficient a1 = 1, and this point coincides with the point at which the noise becomes 0 dB with a second-order noise shaping unit. Meanwhile, the slope of the quantization noise varies from 20 dB / dec (first order), 40 dB / dec (second order), 60 dB / dec (third order), and so on. Thus, the higher the order of the noise shaping unit 33, the steeper the slope of the differential characteristics, and the greater the noise shaping effect.

[0071] (d1. Quantizer) Quantization refers to an operation of approximating discrete values ​​obtained by sampling to digital values ​​with a fixed number of discrete bits. FIGS. 6 and 7 are diagrams showing the characteristics of the quantizer 37 according to this embodiment. FIG. 7 schematically shows the frequency characteristics achieved by the quantizer 37. The horizontal axis of FIG. 7 represents the sampling frequency fs, and the vertical axis represents the gain (level).

[0072] 6, the quantizer 37 quantizes an 8-bit input X with a quantization bit width (e.g., 2 bits). During quantization, the quantizer 37 deletes the lowest 6 bits of the input X and derives the 2 bits following the most significant bit, including the most significant bit, of the input X as the output Y. The 6 bits of data deleted from the input X during this quantization process are quantization noise Vg, which corresponds to a quantization error. Note that the input X, quantization bit width, quantization noise Vg, and number of bits of the output Y of the quantizer 37 in FIG. 6 are merely examples and may be changed depending on the design specifications.

[0073] 7, the quantization noise Vg is uniformly distributed with respect to the sampling frequency (fs) of the quantizer 37 and therefore does not have frequency dependency. More specifically, the quantization noise Vg is the continuous 6-bit data from the 3rd bit to the 8th bit deleted from the input X by the quantizer 37, and this 6-bit quantization noise Vg does not have dependency on the data of the preceding or following bits.

[0074] (d2. Transfer Characteristics of Quantization Noise) FIGS. 8 and 9 are diagrams showing the transfer characteristics of quantization noise Vg in noise shaping. FIG. 8 shows an arithmetic expression 80 for calculating the transfer characteristics, and FIG. 9 shows a block configuration of a quantizer 37 and its peripheral components that achieve such transfer characteristics. In FIG. 9, the quantizer 37 of the noise shaping unit 33 includes an adder 371 that adds the quantization noise Vg to the output a from the adder 36 and derives the output Y as the addition result, and a subtractor 372 that subtracts the addition result (output Y) of the adder 371 from the output (output a) of the adder 36. The delay device 38 delays the quantization noise Vg, which is the subtraction result from the subtractor 372, by a second period and outputs it to the adder 36 via an amplifier 381 with a coefficient a1. 8 shows the operation of the subtractor 372, delay unit 38, amplifier 381 and adder 36 in Fig. 9, and equation (2) shows the operation of the adder 371 in Fig. 9. The output a matches the input a of the quantizer 37.

[0075] In noise shaping, the output Y is the sum of the input a of the quantizer 37 and the quantization noise Vg, so the output Y is derived from equation (2) ((a + Vg) = Y). Furthermore, the input a of the quantizer 37 is derived from equation (1). From equations (1) and (2), the output error (Y-X) is expressed by equation (3). In equation (3), the output error (Y-X) is a term obtained by subtracting the quantization noise Vg derived in the previous sampling period from the quantization noise Vg derived in the current sampling period (second period), and this term represents the characteristics of differentiation. The noise shaping unit 33 having the configuration shown in FIG. 9 includes the characteristics of a differentiation circuit. Because a differentiation circuit corresponds to a high-pass filter, the noise shaping unit 33 has the characteristic that the quantization noise Vg is concentrated in the high frequency band of the sampling frequency fs, as shown in FIG. 5.

[0076] When the coefficient a1 is (a1 = 1), the frequency f at which the quantization noise Vg becomes 0 dB (gain 1) can be calculated as f = 1 / 6 × fs (where fs is the sampling frequency) as shown in FIG. 5 by using equation (3) and Euler's formula, etc.

[0077] FIG. 9 shows a first-order noise shaping unit 33, but the configuration of FIG. 9, like that of FIG. 4, can also be applied to higher-order (second-order, third-order, etc.) noise shaping units, and as shown in FIG. 5, the higher the order of the configuration, the greater the slope of the differential characteristics and the greater the noise shaping effect.

[0078] <E. Flowchart> Figure 10 is a flowchart of the time synchronization process according to this embodiment. Referring to Figure 10, the processor 102 determines, for each first period, whether or not it has received a time distribution message 21 transferred from the master device via the network 11 (step S1). While it is determined that the time distribution message 21 has not been received (NO in step S1), the processor 102 repeatedly performs step S10. When it is determined that the time distribution message 21 has been received (YES in step S1), the processor 102 detects the reference time R based on the time distribution message 21 (step S10) and calculates the difference between the acquired reference time R and the time 44 measured by the management timer 35, thereby detecting the time difference 41 (step S20).

[0079] The processor 102 repeatedly performs the process in the first period in synchronization with the second period (step S30). The process in step S30 includes a noise shaping process (step S35) for deriving the correction amount 43, and a correction process (step S37) in which the processor 102, functioning as the correction unit 34, corrects the time 44 of the management timer 35.

[0080] More specifically, in the noise shaping process (step S35), the processor 102 quantizes the manipulated variable 42 based on the time difference 41 to a quantization bit width and outputs the quantized value (correction amount 43) and quantization noise Vg resulting from the quantization. Furthermore, in the correction process (step S37), the processor 102 corrects the time 44 of the management timer 35 for each second period using the quantized value (correction amount 43) output in the quantization. This causes the time 44 to indicate the reference time R. Furthermore, in the noise shaping process (step S35), the processor 102 performs feedback processing for each second period. The feedback processing includes adding the quantization noise Vg for the second period immediately preceding the second period to the manipulated variable 42 corresponding to the time difference 41 calculated for the first period to which the second period belongs. In the noise shaping process, the processor 102 receives the added manipulated variable 42 in quantization and outputs the quantized value and quantization error quantized to the quantization bit width.

[0081] 11 and 12 are diagrams illustrating the correction process according to the present embodiment in comparison with other correction processes. In each of Fig. 11 and Fig. 12, the vertical axis represents the time difference 41 and the horizontal axis represents time.

[0082] In FIG. 11 , graph 50 shows the correction speed according to the correction process of this embodiment, and graph 51 shows the correction speed according to another correction process. The correction interval shown on the horizontal axis is the distribution interval of the time distribution message 21, e.g., 1 ms. In FIG. 11 , when the time difference 41 detected at each correction interval is 100 ns (nanoseconds), 50 ns, and 25 ns, the slope of graph 50, i.e., the correction speed (correction amount 43), varies depending on the magnitude of the time difference. That is, the larger the time difference 41, the larger the slope (correction speed). On the other hand, graph 51 has a constant slope (correction speed) at each correction interval, i.e., the correction speed is constant regardless of the magnitude of the time difference.

[0083] Therefore, according to the correction process with variable correction speed shown in FIG. 11 of this embodiment, the time difference can be reduced to approximately zero within the third correction interval, as shown in graph 50 of FIG. 12 . On the other hand, according to the other correction process with constant correction speed shown in FIG. 11 , the time difference does not converge to zero, as shown in graph 51 of FIG. 12 . Graph 51 of FIG. 12 shows time regression. More specifically, when the time 44 of the management timer 35 is ahead of the reference time R at the third correction interval, the correction process of adding the time difference to the time 44 of the management timer 35 is performed, which increases the amount of fluctuation in the time 44 of the management timer 35, causing the time measured by the management timer 35 to revert to an earlier time. In this embodiment, the correction speed (correction amount 43) at each correction interval is varied depending on the magnitude of the time difference 41 detected at that correction interval, so such time regression does not occur.

[0084] <G. Program> The processor 102 of the control device 2 executes a program non-temporarily stored in the secondary storage device 106 to realize the time synchronization process described above.

[0085] The programs and data executed to realize the time synchronization process may be downloaded from an external device to the secondary storage device 106. More specifically, they are downloaded from the memory card 116 via the memory card interface 109, or downloaded from an external device connected to the network via the upper network controller 105.

[0086] The memory card 116 is a medium that non-temporarily stores information such as programs by electrical, magnetic, optical, mechanical, or chemical action so that the information can be read by a computer or other device, machine, etc.

[0087] <H. Advantages> In the time synchronization process according to the present embodiment, noise shaping technology is applied to derive correction amount 43 for each second period according to time difference 41, so that the correction speed for each first period can be changed according to the magnitude of time difference 41 detected in that period.

[0088] According to the inventor's experiments, when the correction process according to this embodiment was performed, a time difference of 80 ns occurred when the correction process was not performed, but when the correction process was performed, the time difference could be reduced to -6 ns, and the synchronization accuracy could be increased by 13 times.

[0089] <I. Supplementary Notes> The present embodiment as described above includes the following technical idea: [Configuration 1] A time synchronization device (3) including: a calculation unit (31) that calculates, for each first period, a time difference (41) between a reference time (R) detected through network communication and a timer time (44) measured by a timer (35), a quantization unit (37) that receives the time difference as an input and outputs a quantized value (Y) quantized to a predetermined quantization bit width and a quantization error (Vg) for each second period within the first period, a correction unit (34) that corrects, for each second period, the timer time to indicate the reference time using the quantization value output from the quantization unit, and an addition unit (36) that, for each second period, adds the quantization error for a second period immediately preceding the second period to the time difference calculated for the first period to which the second period belongs, and outputs the time difference after the addition to the quantization unit. [Configuration 2] The time synchronization device according to configuration 1, wherein the time synchronization device is provided in a control device (2, 2A, 2B, 2C) of FA (factory automation). [Configuration 3] The time synchronization device according to configuration 1 or 2, wherein the predetermined quantization bit width is a bit width shorter than the bit width of the time difference data, and is composed of higher-order bits following the most significant bit including the most significant bit of the time difference data. [Configuration 4] The time synchronization device according to configuration 1 or 2, wherein the time difference includes a transmission delay in the network communication. [Configuration 5] The time synchronization device according to configuration 1 or 2, wherein the time synchronization device is provided in a slave device (20) that performs the network communication with a master device, and the slave device communicates the reference time message (21) with the master device. [Configuration 6] The time synchronization device according to configuration 5, wherein the slave device includes a control device (2, 2A, 2B, 2C) of FA (factory automation). [Configuration 7] The time synchronization device according to configuration 1 or 2, further comprising a noise shaping unit (33) having the quantization unit and the addition unit.[Configuration 8] The time synchronization device according to Configuration 6, wherein the control device includes: a control calculation unit (102) that performs control calculations to calculate control commands for controlling the target (90); a first connector (105) for connecting the network to which the master device belongs; and a second connector (118) for connecting a field network (110) to which the target (90) belongs, the field network communicating the control commands. [Configuration 9] A method for performing time synchronization of a timer (35), the method comprising: calculating, for each first period, a time difference between a reference time (R) acquired through network communication and a timer time (44) measured by the timer (S20); inputting, for each second period within the first period, the time difference, and outputting a quantized value (Y) and a quantization error (Vg) quantized to a predetermined quantization bit width (S35); correcting, for each second period, the timer time to indicate the reference time using the quantization value output in the quantization (S37); and adding, for each second period, the quantization error in a second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, wherein the quantization includes inputting the time difference after addition, and outputting the quantized value and the quantization error quantized to the predetermined quantization bit width.[Configuration 10] A program (210) for causing a computer (102) to execute a method for time synchronization of a timer (35), the method comprising: calculating (S20), for each first period, a time difference (41) between a reference time (R) acquired through network communication and a timer time (44) measured by the timer; inputting (S35), for each second period within the first period, a quantization value (Y) quantized to a predetermined quantization bit width and a quantization error (Vg); correcting (S37), for each second period, using the quantization value output in the quantization, to indicate the reference time; and adding, for each second period, the quantization error in a second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, wherein the quantization includes inputting the time difference after addition and outputting the quantization value quantized to the predetermined quantization bit width and the quantization error.

[0090] The embodiments disclosed herein should be considered to be illustrative in all respects and not restrictive. The scope of the present invention is defined by the claims, not by the above description, and is intended to include all modifications within the meaning and scope of the claims.

[0091] 1 Control system, 2, 2A, 2B Control device, 3 Time synchronization unit, 3A, 3B, 3C Process, 11, 12, 13, 14, 110 Network, 200 Slave device, 21 Time distribution message, 31 Calculation unit, 32 Filter, 33 Noise shaping unit, 34 Correction unit, 35 Management timer, 36, 371 Adder, 37 Quantizer, 38 Delay unit, 41 Time difference, 42 Manipulation amount, 43 Correction amount, 44 Time, 50, 51 Graph, 80 Arithmetic formula, 81 Bandwidth, 90, 90A, 90B Field device, 91, 91A, 91B, 103, 119 Timer, 102 Processor, 104 Chip set, 105 Upper network controller, 106 Secondary storage device, 107 USB controller, 108 Main storage device, 109 Memory card interface, 116 memory card, 118 field network controller, 126 counter, 190 line management device, 191 reference timer, 202 periodic data, 210 time synchronization program, 211 correction program, 212 noise shaping program, 280 display device, 300 distributed system, 372 subtractor, 380 manufacturing management device, 381 amplifier, 400 manufacturing execution system, R reference time, Vg quantization noise, f frequency, fs sampling frequency.

Claims

1. A time synchronization device comprising: a calculation unit that calculates, for each first period, a time difference between a reference time detected by network communication and a timer time measured by a timer; a quantization unit that inputs the time difference for each second period within the first period, and outputs a quantization value quantized to a predetermined quantization bit width and a quantization error; a correction unit that corrects, for each second period, the timer time to indicate the reference time using the quantization value output from the quantization unit; and an addition unit that adds, for each second period, the quantization error in the second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, and outputs the time difference after the addition to the quantization unit.

2. The time synchronization device according to claim 1, wherein the time synchronization device is provided in a control device for FA (factory automation).

3. A time synchronization device as described in claim 1 or 2, wherein the predetermined quantization bit width is a bit width shorter than the bit width of the time difference data, and is composed of higher bits following the most significant bit including the most significant bit of the time difference data.

4. A time synchronization device as described in claim 1 or 2, wherein the time difference includes a transmission delay in the network communication.

5. The time synchronization device according to claim 1 or 2, wherein the time synchronization device is provided in a slave device that performs the network communication with a master device, and the slave device communicates messages of the reference time with the master device.

6. The time synchronization device according to claim 5, wherein the slave device includes a control device for FA (factory automation).

7. The time synchronization device according to claim 1 or 2, further comprising a noise shaping unit having the quantization unit and the addition unit.

8. The time synchronization device described in claim 6, wherein the control device includes: a control calculation unit that performs control calculations to calculate control commands for controlling an object; a first connector for connecting the network to which the master device belongs; and a second connector for connecting a field network to which the object belongs, the field network communicating the control commands.

9. A method for performing time synchronization of a timer, the method comprising: calculating, for each first period, a time difference between a reference time obtained through network communication and a timer time measured by the timer; inputting, for each second period within the first period, the time difference and outputting a quantized value and a quantization error quantized to a predetermined quantization bit width; correcting, for each second period, the timer time to indicate the reference time using the quantization value output in the quantization; and adding, for each second period, the quantization error in a second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, wherein the quantization includes inputting the time difference after addition, and outputting the quantized value and the quantization error quantized to the predetermined quantization bit width.

10. A program for causing a computer to execute a method for timer time synchronization, the method comprising: calculating, for each first period, a time difference between a reference time acquired through network communication and a timer time measured by the timer; inputting, for each second period within the first period, the time difference and outputting a quantized value and a quantization error quantized to a predetermined quantization bit width; correcting, for each second period, the timer time to indicate the reference time using the quantization value output in the quantization; and adding, for each second period, the quantization error in a second period immediately preceding the second period to the time difference calculated in the first period to which the second period belongs, the quantization including inputting the time difference after addition and outputting the quantization value and the quantization error quantized to the predetermined quantization bit width.

Citation Information

Patent Citations

  • Industrial controller

    JP2009157913A

  • Timing system and method for time synchronization through packet network

    JP2014147105A

  • Information processing device, method, and program

    WO2022185589A1