[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2024162337A1 - Control device, control system, method, and program - Google Patents

Control device, control system, method, and program Download PDF

Info

Publication number
WO2024162337A1
WO2024162337A1 PCT/JP2024/002831 JP2024002831W WO2024162337A1 WO 2024162337 A1 WO2024162337 A1 WO 2024162337A1 JP 2024002831 W JP2024002831 W JP 2024002831W WO 2024162337 A1 WO2024162337 A1 WO 2024162337A1
Authority
WO
WIPO (PCT)
Prior art keywords
time
timer
control device
threshold
time difference
Prior art date
Application number
PCT/JP2024/002831
Other languages
French (fr)
Japanese (ja)
Inventor
太雅 新實
光宏 米田
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Publication of WO2024162337A1 publication Critical patent/WO2024162337A1/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Definitions

  • This disclosure relates to time synchronization in FA (Factory Automation) control systems.
  • Control systems using control devices such as PLCs (Programmable Logic Controllers) are becoming common in various production sites.
  • PLCs Programmable Logic Controllers
  • distributed control systems have been proposed in which multiple control devices exchange data with each other to collaboratively control peripheral devices.
  • Patent Document 1 JP 2019-146060 A discloses a time synchronization configuration.
  • each of multiple communication devices connected to a network corrects the time of its own device by using the difference between the time of the other communication devices and the time of its own device as a time adjustment value.
  • a threshold is set that indicates the tolerance range for determining when time synchronization is complete, the time difference described above is compared with this threshold, and the completion of time synchronization is determined based on the result of the comparison. Therefore, depending on the threshold that is set, there have been cases where it takes a long time to complete time synchronization, or time synchronization cannot be performed with high accuracy.
  • the objective of this disclosure is to provide technology that can complete time synchronization quickly and accurately.
  • the FA (factory automation) control device includes a connector for connecting a network, a timer, a control processing unit that performs processing related to the control of the target, and a time synchronization processing unit that performs time synchronization processing.
  • the time synchronization processing unit includes a time difference calculation unit that calculates the time difference between a reference time and the time measured by the timer, a threshold acquisition unit that acquires a second threshold equal to or greater than a first threshold that indicates an acceptable range of the time difference, and a correction unit that performs either a first correction process that corrects the timer time by a first correction amount so that it indicates the reference time, or a second correction process that corrects the timer time by a second correction amount smaller than the first correction amount so that it indicates the reference time.
  • the correction unit performs a first correction process when the time difference is equal to or greater than a second threshold, and performs a second correction process when the time difference is less than the second threshold.
  • the correction process is switched between the first correction process and the second correction process based on the relationship between the magnitude of the time difference and a second threshold value that indicates the acceptable range of the time difference and is different from the first threshold value.
  • the correction unit performs the correction process with the larger first correction amount to quickly reduce the time difference and complete time synchronization.
  • the correction unit performs the correction process with the smaller second correction amount to gradually converge the time difference into the acceptable range and complete time synchronization with high precision.
  • the time on the timer of the control device mentioned above indicates the time based on the clock possessed by the timer
  • the reference time indicates the time based on the clock of the master device connected to the network
  • the time difference calculation unit calculates the time difference based on the difference between the frequency of the timer's clock and the frequency of the master device's clock.
  • the time difference used in the time synchronization process is calculated based on the difference between the clock frequency of the control device's timer and the clock frequency of the master device that provides the reference time.
  • the above-mentioned control device further includes a communication unit that receives a message distributed from a master device connected to the network, and the distributed message from the master device includes the transmission time of the message based on the master clock of the master device.
  • the time difference calculation unit calculates a reference time based on the transmission time of the distributed message received from the master device and the propagation delay time of the network, and calculates the time difference based on the difference between the reception time of the distributed message measured by the timer and the calculated reference time.
  • the control device described above can calculate the time difference using the reference time included in the message delivered from the master device.
  • the time synchronization processing unit of the above-mentioned control device determines whether or not the synchronization condition of the time difference being equal to or less than the first threshold is satisfied, and the correction unit, depending on whether or not the synchronization condition is satisfied, performs a first correction process when the time difference is equal to or greater than the second threshold, and performs a second correction process when the time difference is less than the second threshold.
  • the control device described above can switch between the correction processes described above even when the synchronization conditions are met and it is determined that synchronization is complete, thereby maintaining a time-synchronized state.
  • the threshold acquisition unit of the control device calculates the second threshold according to a calculation formula using the time difference. This makes it possible to calculate the second threshold using the time difference.
  • the threshold acquisition unit of the control device calculates the second threshold according to a calculation formula using the magnitude relationship between the first threshold and a predetermined value and the first threshold. This allows the second threshold to be calculated using the magnitude relationship between the first threshold and a predetermined value and the first threshold.
  • the first correction process of the control device described above repeats the process of correcting the timer time by the first correction amount M times (where M is greater than or equal to 2), and the first correction amount includes a correction amount based on a value obtained by dividing the time difference value into M parts.
  • the first correction process divides the time difference and repeats correction using each divided value, thereby achieving time synchronization.
  • the second correction process of the control device described above repeats the process of correcting the timer time by the second correction amount N times (where N is greater than or equal to 2), and the second correction amount includes a correction amount based on a value obtained by dividing the time difference value into N parts.
  • the second correction process divides the time difference and repeats correction using each divided value, thereby achieving time synchronization.
  • the time synchronization processing unit of the above-mentioned control device determines whether or not the synchronization condition of the time difference being equal to or less than a first threshold value is satisfied, and the processing related to the target control includes a first processing that is performed when it is determined that the synchronization condition is satisfied, and a second processing that is different from the first processing and is performed in response to the determination that the synchronization condition is satisfied.
  • the control device described above can perform different control-related processes depending on whether time synchronization has been completed.
  • the first process of the control device described above includes a process of collecting data having observed values related to the control of the target and timer times indicating the observed timing.
  • the first process is executed, making it possible to collect observation values according to the observation time measured by the time-synchronized timer.
  • FA factory automation
  • a method is provided that is implemented by a control device of FA (factory automation).
  • the control device includes a connector for connecting a network and a timer.
  • the method includes implementing a process related to the control of an object and implementing a time synchronization process, where implementing the time synchronization process includes calculating a time difference between a reference time and a time measured by the timer, acquiring a second threshold value equal to or greater than a first threshold value indicating an acceptable range of the time difference, and implementing one of a first correction process that corrects the timer time by a first correction amount so as to indicate the reference time or a second correction process that corrects the timer time by a second correction amount smaller than the first correction amount so as to indicate the reference time, and implementing one of such processes includes implementing the first correction process when the time difference is equal to or greater than the second threshold value, and implementing the second correction process when the time difference is less than the second threshold value.
  • a program for causing a processor of a control device for FA (factory automation) to execute a method.
  • the control device includes a connector for connecting a network and a timer.
  • the method includes executing a process related to the control of an object and executing a time synchronization process, where executing the time synchronization process includes calculating a time difference between a reference time and a time measured by the timer, acquiring a second threshold value equal to or greater than a first threshold value indicating an acceptable range of the time difference, and executing one of a first correction process that corrects the timer time by a first correction amount so as to indicate the reference time or a second correction process that corrects the timer time by a second correction amount smaller than the first correction amount so as to indicate the reference time, and executing one of the processes includes executing the first correction process when the time difference is equal to or greater than the second threshold value, and executing the second correction process when the time difference is less than the second threshold value.
  • the above program includes instructions that, when executed by a computer, cause the computer to execute the above method.
  • time synchronization can be completed quickly and accurately.
  • FIG. 1 is a diagram illustrating an example of an overall configuration of a control system 1 according to an embodiment of the present invention.
  • 2 is a block diagram showing an example of a hardware configuration of a control device 2 according to the present embodiment.
  • FIG. FIG. 5 is a block diagram showing an example of a hardware configuration of a support device 500 according to the present embodiment.
  • 2 is a block diagram showing an example of a software configuration of a control device 2 according to the present embodiment.
  • FIG. FIG. 5 is a diagram illustrating a schematic configuration of a synchronization module 560 according to the present embodiment.
  • 1 is a schematic process flowchart of application design according to the present embodiment.
  • FIG. 7 is a diagram illustrating the application design environment of FIG. 6.
  • FIG. 2 is a diagram showing an example of a communication sequence according to the present embodiment.
  • 4 is a flowchart of a time synchronization process according to the present embodiment.
  • 11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment.
  • FIG. 11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment.
  • FIG. 11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment.
  • FIG. 11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment.
  • FIG. 13 is another flowchart of the time synchronization process according to the embodiment.
  • 10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment.
  • 10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment.
  • 10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment.
  • 10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment.
  • 10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment.
  • 10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment.
  • FIG. 2 is a diagram showing an example of a communication sequence according to the present embodiment.
  • 10 is a graph illustrating a relationship between a time difference and a second threshold value according to the present embodiment.
  • control device has a management timer that manages time.
  • the control device executes a "time synchronization process" to synchronize the management timer with a reference timer that manages the reference time.
  • the time of the management timer indicates the time based on the clock of the management timer
  • the time of the reference timer indicates the time based on the clock of the reference timer.
  • FIG. 1 is a diagram showing an example of the overall configuration of a control system 1 according to this embodiment.
  • control system 1 realizes factory automation of a production line. More specifically, in control system 1, networks are connected at multiple levels, and different functions are assigned to the networks at each level. Specifically, but not limited to, for example, four levels of networks 11 to 14 are provided.
  • the control level network 11 is connected to multiple control devices 2A, 2B, and 2C, a device/line management device 190, and a display device 280 that provides a SCADA (Supervisory Control and Data Acquisition) function, forming a data link that allows data to be exchanged between the devices.
  • SCADA Supervisory Control and Data Acquisition
  • the network 11 mainly transmits information related to time synchronization and the control system.
  • the control device 2 connects one or more field devices 90 via a field-level network 110. These field devices 90 may be directly connected to the control device 2. Each of the one or more field devices 90 includes an actuator that exerts some kind of physical action on a manufacturing device or a production line (hereinafter collectively referred to as the "field"), and an input/output device that exchanges information with the field.
  • an actuator that exerts some kind of physical action on a manufacturing device or a production line (hereinafter collectively referred to as the "field")
  • an input/output device that exchanges information with the field.
  • the data exchanged between the control device 2 and the field device 90 via the network 110 is updated at very short intervals of the order of several hundred microseconds to several tens of milliseconds. This process of updating the exchanged data is also called input/output refresh processing.
  • the management-level network 12 is connected to an equipment/line management device 190 that manages equipment and lines, and manufacturing management devices 380 and 390 that manage manufacturing plans, etc.
  • the 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 the network 12.
  • manufacturing management devices 380 and 390 Connected to computer-level network 13 are manufacturing management devices 380 and 390, and a manufacturing execution system (MES) 400 that manages a time-series DB (short for database) 450.
  • Manufacturing management devices 380 and 390, and manufacturing execution system 400 exchange production management and information system data via network 13.
  • MES manufacturing execution system
  • the manufacturing execution system 400 stores the observation 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 observation value and data on the time of the management timer, and transfers it to the manufacturing execution system 400 via the networks 11, 12, and 13.
  • 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 in the time series DB 450 to the devices on the cloud by exchanging data with the devices on the cloud.
  • networks 11-14 and network 110 adopt protocols and frameworks that correspond to the differences in the required characteristics.
  • EtherNet/IP registered trademark
  • EtherCAT registered trademark
  • networks 11 and 12 may be used as the protocol for networks 11 and 12 belonging to the factory network.
  • EtherCAT registered trademark
  • the same or different protocols may be applied to the protocols for networks 11 and 110.
  • networks 13 and 14 belonging to the corporate network use protocols such as general-purpose Ethernet to ensure a diversity of connection destinations.
  • general-purpose Ethernet By adopting general-purpose Ethernet, restrictions on the amount of data that can be transmitted can be eliminated.
  • the control device 2 or the device/line management device 190 may be connected to a support device 500.
  • the support device 500 is a device that assists the control device 2 in making the necessary preparations to control the controlled object.
  • 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.
  • process 3A indicates a part feeder process that aligns and transports workpieces (components, parts)
  • process 3B indicates a process that moves the workpieces aligned in process 3A by a robot's pick-and-place operation
  • process 3C indicates a process of assembling the moved workpieces.
  • the operation of the field devices 90 connected to the control device 2 of each process differs from the operation of the field devices 90 connected to the control device 2 of the previous and next processes.
  • the operation of a certain process is performed in synchronization with the operation of the process before and after the process.
  • the control device 2 executes control programs, including a sequence program for implementing sequence control of the field devices 90 connected to the control device 2 and a motion program for implementing motion control, at predetermined intervals (also called control intervals) based on synchronized time, thereby achieving real-time control of the field devices 90.
  • control programs including a sequence program for implementing sequence control of the field devices 90 connected to the control device 2 and a motion program for implementing motion control, at predetermined intervals (also called control intervals) based on synchronized time, thereby achieving real-time control of the field devices 90.
  • time is intended to indicate a certain point in the flow of time, and is specified using units such as hours, minutes, and seconds.
  • a “timer” basically measures time based on a clock generated by a hardware clock in order to measure values for controlling timing within the control device 2 and related devices. More specifically, the timer may be configured to include a counter that is incremented or decremented by a predetermined value for each predetermined unit time based on the clock frequency. The counter has a predetermined bit length that represents, for example, an integer value.
  • “Synchronization accuracy” can be indicated based on the time difference (error or displacement) between the reference timer and the management timer of the control device 2.
  • a user can set the allowable range of time difference as a "tolerance” so that the desired synchronization accuracy can be achieved in the control system 1.
  • a tolerance range is referred to as a "first threshold”.
  • the configuration for achieving time synchronization may include, for example, a case where the network 11 performs data communication according to TSN (Time-Sensitive Networking), which is a protocol for industrial networks, and a case where the network 11 performs data communication according to EtherCAT (registered trademark: Ethernet for Control Automation Technology).
  • TSN Time-Sensitive Networking
  • EtherCAT registered trademark: Ethernet for Control Automation Technology
  • the master that serves as the "reference timer” 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 on the network 11 (e.g., device/line management device 190), and corresponds to the timer with the highest accuracy among these timers.
  • device/line management device 190 operates as the master.
  • the support device 500 provides a support tool for designing a synchronization program by executing a support program 590 described later.
  • the user operates the support tool to design a synchronization application 177 described later.
  • the synchronization application 177 includes a program for implementing time synchronization processing and information on the set first threshold value.
  • the control device 2 realizes time synchronization processing by executing the synchronization application 177 transferred from the support device 500.
  • the user sets the first threshold value by operating the support tool. Note that the method for setting the first threshold value is not limited to user operation, and may be calculated based on the synchronization accuracy required for the control system in the specifications, for example.
  • the control device 2 acquires a second threshold value equal to or greater than the first threshold value, based on a first threshold value indicating a predetermined tolerance range of the time difference (step ST1).
  • the control device 2 estimates (calculates) the reference time based on the time information contained in the time distribution message 21 received via the network 11, and calculates the time difference between the estimated reference time and the time measured by the management timer (step ST2). Details of the estimation of the reference time and the calculation of the time difference will be described later.
  • the control device 2 performs either a first correction process in which the time of the management timer is corrected by a first correction amount so as to indicate the reference time, or a second correction process in which the time of the management timer is corrected by a second correction amount smaller than the first correction amount so as to indicate the reference time (step ST3).
  • a first correction process in which the time of the management timer is corrected by a first correction amount so as to indicate the reference time
  • a second correction process in which the time of the management timer is corrected by a second correction amount smaller than the first correction amount so as to indicate the reference time
  • the second correction process is a correction process that gradually changes the time on the management timer using a second correction amount that is smaller than the first correction amount used in the first correction process to accurately approach the reference time.
  • the first correction process is a correction process that quickly changes the time on the management timer using a first correction amount that is larger than the second correction amount to quickly approach the reference time.
  • control device 2 switches between the second correction process, which gradually changes the time on the management timer to bring it closer to the reference time with high precision, and the first correction process, which quickly changes the time on the management timer to bring it closer to the reference time, depending on the relationship between the magnitude of the value between the time difference and the second threshold value, without relying on the first threshold value for determining whether time synchronization is complete.
  • This allows time synchronization to be completed quickly and accurately.
  • the correction of the time difference represents the concept of "adjustment” to add or subtract from the value of the time difference.
  • the first correction amount or the second correction amount represents the concept of an adjustment amount that represents the amount of addition or subtraction.
  • Fig. 2 is a block diagram showing an example of the hardware configuration of the control device 2 according to the present embodiment.
  • Fig. 3 is a block diagram showing an example of the hardware configuration of the support device 500 according to the present embodiment.
  • control device 2 includes a processor 102, a chipset 104, a secondary memory device 106, a main memory device 108, a host network controller 105, a Universal Serial Bus (USB) controller 107, a memory card interface 109, a field network controller 118, a counter 126, and a Real Time Clock (RTC) 128.
  • the processor 102 is composed of a CPU (Central Processing Unit), MPU (Microprocessor unit), GPU (Graphics Processing Unit), etc., and reads out various programs stored in the secondary storage device 106, deploys them in the main storage device 108, and executes them to realize control according to the control target and various processes as described below.
  • the secondary storage device 106 is composed of non-volatile storage devices such as HDD (Hard Disk Drive) and SSD (Solid State Drive).
  • the main storage device 108 is composed of volatile storage devices such as DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory).
  • the chipset 104 controls the processor 102 and each device to realize processing for the control device 2 as a whole.
  • the secondary storage device 106 stores communication cycle data 200 indicating the cycle for distributing the time distribution message 21.
  • the secondary storage device 106 stores a UPG (short for user program) 201 that is created according to the manufacturing device or facility to be controlled.
  • the main storage device 108 stores a flag 40 that indicates whether time synchronization is complete or not. For example, the flag 40 is set to "0" as the initial value, and is set to "1" when it is determined that time synchronization is complete.
  • the upper network controller 105 includes a connector for connecting 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 the manufacturing execution system 400 or a device on the cloud (see FIG. 1) via the upper network 11.
  • the USB controller 107 controls the exchange of data with the support device 500 via a USB connection.
  • the memory card interface 109 is configured to allow the memory card 116 to be attached and detached, and is capable of writing data to the memory card 116 and reading various data (such as user programs or trace data) from the memory card 116.
  • the counter 126 is used as a time reference for managing the execution timing of various processes in the control device 2.
  • the counter 126 constitutes a clock that can be a "management timer” or a "reference timer".
  • the counter 126 has a clock and provides time based on the clock. Typically, the counter 126 generates a clock and increments or decrements the counter value for each clock period.
  • the count value of the counter 126 represents the time measured by the timer.
  • the counter 126 may be implemented using a hardware timer such as a High Precision Event Timer (HPET) arranged on the system bus that drives the processor 102, or may be implemented using a dedicated circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array).
  • the control device 2 synchronizes the timers 103, 119, 91A, and 91B with the counter 126.
  • the RTC 128 is a type of counter with a timekeeping function, and provides the current time to the processor 102 etc.
  • the field network controller 118 controls data exchange with other devices, including the field device 90, via the network 110.
  • the field network controller 118 has a connector that connects to the network 110, and a timer 119 that is used as a time reference for managing timing with other devices.
  • the timers 91 of the field device 90 are indicated by timers 91A, 91B, etc.
  • the timer 119 and the counters (timers 91A and 91B) of devices such as the field device 90 can have a configuration similar to that of the counter 126 described above.
  • the timer 119 is synchronized with the counter 126.
  • the field network controller 118 functions as a communication master for periodic communication via the network 110, and 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 make a correction, if necessary.
  • the field network controller 118 has a synchronization management function that issues a command to the device to make the counter value indicated by the device's counter match the counter value indicated by the timer 119.
  • FIG. 2 shows an example of a configuration in which the necessary functions are provided by the processor 102 executing a program, but some or all of these provided functions may be implemented using dedicated hardware circuits (e.g., an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array)).
  • the main part of the control device 2 may be realized using hardware that follows a general-purpose architecture (e.g., an industrial PC based on a general-purpose PC).
  • a general-purpose architecture e.g., an industrial PC based on a general-purpose PC.
  • virtualization technology may be used to run multiple OSs (Operating Systems) with different uses in parallel, and necessary applications may be executed on each OS.
  • control device 2 and the support device 500 are configured as separate entities, but a configuration in which all or part of these functions are integrated into a single device may also be adopted.
  • the support device 500 corresponds to an information processing device such as a computer.
  • the support device 500 includes portable and stationary information processing devices.
  • the support device 500 includes a CPU (Central Processing Unit) 501, a memory 502 configured as a volatile storage device such as a DRAM (Dynamic Random Access Memory), a timer 503, a hard disk 504 configured as a non-volatile storage device such as a HDD, an input interface 505, a display controller 506, a communication interface 507, and a data reader/writer 508.
  • CPU Central Processing Unit
  • memory 502 configured as a volatile storage device such as a DRAM (Dynamic Random Access Memory)
  • a timer 503 configured as a non-volatile storage device such as a HDD
  • an input interface 505 a display controller 506, a communication interface 507, and a data reader/writer 508.
  • a bus 509 so as to be able to communicate data with each other.
  • the input interface 505 mediates data transmission between the CPU 501 and input devices such as a keyboard 510, a mouse (not shown), and a touch panel (not shown).
  • the display controller 506 is connected to a display 511 and displays the results of processing by the CPU 501.
  • the communication interface 507 communicates with the control device 2 or the device/line management device 190 via USB.
  • the data reader/writer 508 mediates data transmission between the CPU 501 and a memory card 512, which is an external storage medium.
  • memory card 116 in FIG. 2 and memory card 512 in FIG. 3 include volatile or non-volatile storage media, such as general-purpose semiconductor storage devices such as CF (Compact Flash: registered trademark) and SD (Secure Digital), magnetic storage media such as flexible disks, or optical storage media such as CD-ROMs (Compact Disk Read Only Memory).
  • volatile or non-volatile storage media such as general-purpose semiconductor storage devices such as CF (Compact Flash: registered trademark) and SD (Secure Digital), magnetic storage media such as flexible disks, or optical storage media such as CD-ROMs (Compact Disk Read Only Memory).
  • Hard disk 504 stores various programs and data, including support program 590, transfer program 595, and GUI (Graphical User Interface) program 550.
  • transfer program 595 transfers UPG 201 and data designed in support device 500 to control device 2.
  • GUI program 550 provides an interface for the user to operate tools provided by executing support program 590 or transfer program 595.
  • FIG. 4 is a block diagram showing an example of the software configuration of the control device 2 according to this embodiment.
  • the control device 2 includes an execution engine 150, a time series database 180, a higher-level connection program 192, and a gateway program 194.
  • the execution engine 150 constitutes a type of program that executes various programs in an execution environment for the various programs. Typically, this execution environment is provided by the processor 102 of the control device 2 reading out a system program stored in the secondary storage device 106, expanding it into the main storage device 108, and executing it.
  • the execution engine 150 includes a control program 152 for implementing control-related processing related to the control of the field device 90, a variable management program 160, a scheduler program 170 for managing the execution order of the programs, an input program 172, and an output program 174.
  • the execution engine 150 further includes a synchronization application 177 for implementing time synchronization processing.
  • the control device 2 includes a gateway program 194 and an upper connection program 192 for implementing various processing including service processing related to control.
  • the control program 152 is typically connected to a database writing program 156 and a serialized communication program 158. When executed, the control program 152 corresponds to the main part that performs the control calculation process, and the control program 152 can be arbitrarily configured according to the manufacturing device or facility that is the object of control by the control device 2.
  • the database writing program 156 is called by an instruction defined in the control program 152, and writes specified data to the time series database 180.
  • the serialization communication program 158 performs serialization processing on the data written to the time series database 180 by the database writing program 156.
  • the gateway program 194 communicates with devices on the cloud. For example, it provides time series data 182 of the time series database 180 to a device that provides an IoT service on the cloud.
  • the database writing program 156, the serialization communication program 158, and the gateway program 194 may be optional.
  • variable management program 160 manages values available to the execution engine 150 in the form of variables. More specifically, the variable management program 160 manages system variables indicating the state of the control device 2, device variables indicating values held by various devices such as the field equipment 90 connected to the control device 2, and user variables indicating values held by the control program 152 executed by the control device 2.
  • the input program 172 provides a function for acquiring input data from field devices 90, including devices such as actuators and sensors connected to the control device 2.
  • the output program 174 outputs command values (output data) calculated by the control program 152 executed in the control device 2 to the field devices 90, which are the target devices connected via the network 110.
  • the synchronization application 177 for time synchronization processing includes various information such as a correction program 178 that corrects the time of the management timer of the control device 2.
  • the scheduler program 170 When the scheduler program 170 is executed, it provides a scheduler.
  • the scheduler manages resource allocation, including the processor 102, and execution timing for processes or tasks of the control device 2 according to the execution priority assigned to the process or task.
  • Such processes or tasks include processes or tasks that can be generated by the control device 2 executing the control program 152, variable management program 160, input program 172, output program 174, and synchronization application 177, etc.
  • the time series database 180 is typically placed in the main storage device 108 or the secondary storage device 106, and has a function for storing data as well as a search function for responding to an external request (query) with specified data.
  • the time series database 180 stores time series data 182 written by the database writing program 156.
  • the time series database 180 stores at least a portion of the input data, output data, calculation data calculated in the control calculation by the control program 152, manufacturing data, and event data in chronological order.
  • the upper connection program 192 exchanges data with external devices connected to the upper network 13, such as the manufacturing execution system 400.
  • external devices connected to the upper network 13, such as the manufacturing execution system 400.
  • input data and calculation data are output from the control device 2 to the manufacturing execution system 400, and manufacturing information can be received from the manufacturing execution system 400.
  • the manufacturing execution system 400 has the time series DB 450 of FIG. 1.
  • a database connection program 193 database is indicated as "DB" in the figure
  • the time series data 182 of the time series database 180 in the control device 2 can be transferred to the manufacturing execution system 400 and stored in the time series DB 450.
  • the variable management program 160 manages, as variables, the input data (status values) that the input program 172 acquires from the field and the manufacturing data that the upper connection program 192 acquires from the manufacturing execution system 400.
  • the control program 152 executes a pre-specified control operation while referencing the system variables, device variables, and user variables managed by the variable management program 160, and outputs the execution results (output data) to the variable management program 160.
  • the control system 1 or the control device 2 can collect such status values or output data as "observation values" of the field.
  • Fig. 5 is a diagram illustrating a schematic configuration of a synchronization module 560 according to the present embodiment.
  • the synchronization module 560 illustrated in Fig. 5 is provided by executing the synchronization application 177 in Fig. 5.
  • the synchronization module 560 includes a threshold acquisition module 521, a correction module 522, and a time difference calculation module 523. In the synchronization module 560, these modules may be configured as a single module.
  • the threshold acquisition module 521 acquires a second threshold indicating a value equal to or greater than a first threshold, based on a first threshold indicating a predetermined acceptable range of the time difference.
  • the time difference calculation module 523 calculates the time difference between the reference time and the time of the management timer.
  • the correction module 522 performs either a first correction process for correcting the time of the counter 126 by a first correction amount so that it indicates the reference time, or a second correction process for correcting the time of the counter 126 by a second correction amount smaller than the first correction amount so that it indicates the reference time.
  • the correction module 522 compares the calculated time difference with the second threshold, and performs the first correction process when it determines based on the result of the comparison that the time difference is greater than the second threshold, and performs the second correction process when it determines that the time difference is equal to or less than the second threshold.
  • FIG. 6 is a schematic process flow chart of application design according to this embodiment.
  • FIG. 7 is a diagram showing the application design environment of FIG. 6.
  • the support device 500 executes a support program 590 to execute a process for supporting the application design of FIG. 6, and executes a GUI program 550 to display the UI screen 51 of FIG. 7 on the display 511.
  • the UI screen 51 of FIG. 7 includes windows 51A, 51B, and 51C that display objects configured to be able to accept user operations.
  • the window 51A includes a button 51D that accepts a user operation to specify whether or not to start the synchronization application 177 in the control device 2 and execute the time synchronization process by valid or invalid.
  • the button 51D of FIG. 7 indicates that, for example, "valid" has been specified.
  • Window 51B includes a text box 51E that accepts a user operation for setting the first threshold of the control device 2. For example, 500 ⁇ s (microseconds) is set in text box 51E.
  • Window 51C is an area that accepts a user operation for editing the control program 152.
  • the program in window 51C shows a control structure that judges whether time synchronization has been completed based on flag 40, and executes one of process A and process B based on the judgment result.
  • a program that expresses such a control structure is referred to below as "control structure program 51F".
  • control program 152 is designed according to the specifications of a predetermined programming language.
  • the programming language can typically be written using any language defined in the international standard IEC 61131-3, such as LD (Ladder Diagram), IL (Instruction List), ST (Structured Text), FBD (Function Block Diagram), or SFC (Sequential Function Chart).
  • the support device 500 accepts a setting for enabling or disabling time synchronization processing and a setting for a first threshold value based on user operations in windows 51A and 51B (step S1).
  • the support device 500 accepts a control structure program 51F based on user operations in window 51C (step S2).
  • the support device 500 transfers the information accepted in step S1 and the control structure program 51F to the control device 2 (step S3).
  • the control structure program 51F transferred from the support device 500 is executed in synchronization with the control period according to a schedule managed by the scheduler program 170.
  • control device 2 determines that the execution of the time synchronization process is set to "enabled” based on the information received from the support device 500, it starts the time synchronization process from step S4 onwards (step S4).
  • control device 2 completes time synchronization through the time synchronization process, it sets flag 40 to "1".
  • flag 40 indicates "0".
  • the control device 2 executes the control structure program 51F in parallel with the time synchronization process.
  • the control device 2 executes process B instead of process A while it determines that time synchronization is not complete based on the flag 40 (step S5), and executes process A instead of process B when it determines that time synchronization is complete based on the flag 40 (step S6) (step S7). Details of process A and process B will be described later.
  • the scheduler of the control device 2 manages the priority of the execution of tasks or processes. More specifically, the highest priority is assigned to the process or task of the control-related process including the processing of the control structure program 51F, and the low priority is assigned to the process or task of the time synchronization process and the service process.
  • the scheduler assigns the processor 102 to the control-related process with the highest priority in the control period, and when the execution of the control-related process is completed, assigns the processor 102 to the process with the low priority in the remaining "slack time".
  • the time synchronization process is mainly executed in the "slack time" of the control period.
  • a high-precision time synchronization protocol such as IEEE1588, IEEE802.1AS, or IEEE802.1AS-Rev can be adopted.
  • IEEE1588 specifies gPTP (generalized Precision Time Protocol).
  • gPTP can be applied to a communication system including a master, which is a reference timer, and a slave, which is a timer synchronized with the reference timer.
  • frames having a time distribution message 21 are periodically exchanged between the master and the slave, and the slave's time is corrected to match the master's reference time based on information such as the time difference obtained in the process.
  • control device 2 can correct the time using either a time difference calculated based on a frequency difference, which is the difference between the clock frequency of the reference timer and the clock frequency of the management timer (hereinafter referred to as a frequency-based time difference), or a time difference calculated based on a timestamp of the reference time indicated by the time distribution message 21 (hereinafter referred to as a message-based time difference).
  • a frequency difference which is the difference between the clock frequency of the reference timer and the clock frequency of the management timer
  • message-based time difference a time difference calculated based on a timestamp of the reference time indicated by the time distribution message 21
  • FIG. 8 is a diagram showing an example of a communication sequence according to this embodiment.
  • FIG. 8 shows a communication sequence according to gPTP, for example.
  • the master M and the slave S work together to realize communication for time synchronization between the master and the slave.
  • the master M communicates with the slave S without going through a repeater.
  • the slave S receives a message (Sync) periodically distributed from a master device connected to the network.
  • the message (Sync) includes the transmission time of the message based on the clock of the master device.
  • the slave S as a time difference calculation module 523, (i) for each periodically distributed message (Sync), (i-1) calculates a first time measured by the management timer and indicating when the message (Sync) was received, (i-2) calculates a second time measured by the clock of the master device and indicating when the master device transmitted the distributed message based on the transmission time of the message (Sync) and the propagation delay time of the network, (ii) for the message (Sync) and a message (Sync) delivered one cycle after the delivery of the message, (ii-1) calculates the difference between the frequency of the clock of the master device and the frequency of the clock of the management timer from the difference in the first time between the two messages and the difference in the second time between the two messages, and (ii-2) calculates a frequency-based time difference based on
  • the slave S receives a time-distributed message (Sync) from the master M at least twice (at times T1 and T2).
  • the slave S saves (stores) the Sync reception time and the Sync estimated reception time for each message (Sync).
  • the Sync reception time is the time measured by the management timer and indicates the time when the slave S received the message (Sync), while the Sync estimated reception time is the time estimated to have been measured by the reference timer of the master M and indicates the time when the slave S received the message (Sync).
  • the slave S calculates the Sync estimated reception time according to the gPTP stack. This calculation is based on the message timestamp and the propagation delay time of the message on the network, as shown in FIG. 21, which will be described later.
  • the slave S also calculates the Sync reception period.
  • the slave S calculates the time difference with the master M until the next message (Sync) is received.
  • Tref_d indicates the estimated reference time when slave S receives the second message (Sync)
  • Tlocal indicates the time measured by slave S's management timer when slave S receives the second message (Sync)
  • Tref_prev indicates the estimated reference time when slave S receives the first message (Sync)
  • Tlocal_prev indicates the time measured by slave S's management timer when slave S receives the first message (Sync).
  • the frequency difference is calculated to be 0.25.
  • the frequency-based time difference indicates the time difference that occurs in part due to the clock frequency difference between the reference timer and the management timer during the communication cycle of the time distribution message 21.
  • FIG. 21 is a diagram showing an example of a communication sequence according to this embodiment.
  • FIG. 21 shows a gPTP communication sequence.
  • the master M also communicates with the slave S without going through a repeater.
  • a slave S receives a message distributed from a master M connected to the network. Such a distributed message includes the transmission time of the message based on the clock possessed by the master M.
  • the slave S as a time difference calculation module 523, calculates a reference time based on the transmission time of the message received from the master M and the message propagation delay time of the network, and calculates a message-based time difference based on the difference between the reception time of the message measured by the management timer and the calculated reference time.
  • the slave S calculates (estimates) the message-based time difference based on the timestamp (time) obtained from the gPTP time distribution message 21 exchanged with the master M.
  • the master M transfers the message (Sync) and the message (FollowUp) to the slave S.
  • the message (FollowUp) indicates the transmission time t1 of the message (Sync) measured by the reference timer of the master M.
  • the slave S transmits a message (Pdelay_Req) to the master M at time t3, and then receives a message (Pdelay_Resp) in response to the message (Pdelay_Req) from the master M, and subsequently receives the message (Pdelay_Resp_FollowUp).
  • the message (Pdelay_Resp) indicates the time t4 measured by the reference timer when the master M received the message (Pdelay_Req)
  • the message (Pdelay_Resp_FollowUp) indicates the time t5 measured by the reference timer when the master M sent the message (Pdelay_Resp).
  • the slave S estimates the time measured by the master M's reference timer when the slave S's management timer received the message (Sync), that is, the reference time (t1+td), and calculates (estimates) the time difference according to (t2-(t1+td)).
  • the slave S can estimate the master M's reference time and estimate the message-based time difference from the estimated reference time.
  • the "time synchronization process” includes a process of estimating the reference time and the time difference by implementing the communication sequence of FIG. 8 or FIG. 21.
  • the time synchronization process is implemented in synchronization with a communication cycle.
  • the "communication cycle” refers to a cycle for transmitting a synchronization message (message (sync)) between the master M and the slave S via the network 11. More specifically, the communication cycle refers to a cycle in which the master M transmits a message (Sync) to the slave S, or a cycle in which the slave S receives a message (Sync) from the master M.
  • the scheduler of each control device 2 allocates the processor 102 to a process that follows the communication sequence in synchronization with such a communication cycle.
  • the time synchronization protocol in this embodiment is not limited to gPTP or PTP, and other wired or wireless communication protocols can be applied.
  • NTP Network Time Protocol
  • SNTP Simple Network Time Protocol
  • GPS Global Positioning System
  • Synchronous Ethernet registered trademark
  • CS-NMS Lock-sampling mutual network synchronization
  • RBS Reference Broadcast Synchronization
  • RBIS Reference Broadcast Infrastructure Synchronization
  • control device 2 performs a phase correction corresponding to the first correction process or a frequency correction corresponding to the second correction process as a correction to align the management time with the reference time.
  • the time difference handled in such a correction process is a frequency-based time difference or a message-based time difference, and indicates a positive or negative value.
  • phase correction the time difference D is treated as a first correction amount, and the control device 2 adds the time difference to the time of the management timer, thereby quickly matching the management timer to the reference timer.
  • frequency correction the control device 2 adjusts the increment value per increment of the counter constituting the management timer with a second correction amount based on the magnitude of the time difference D described above, thereby gradually decreasing the time difference and matching the management timer to the reference timer.
  • the increment value is calculated based on the time difference D according to a calculation formula for PID (Proportional-Integral-Differential) control.
  • the first correction amount used in the first correction process is not limited to the time difference D.
  • N and M or the values Di and Dj may be variable. For example, these values may be variable based on the magnitude of the time difference D.
  • the period of addition or subtraction using the value Di or Dj may be synchronized with the control period.
  • the control system 1 can be gradually transitioned to a time synchronization completion state over N or M control periods.
  • the second correction amount is set to a value smaller than the first correction amount, so that the first correction process can quickly converge the control system 1 to a time synchronization completion state, and the second correction process can gradually bring the control system 1 closer to the time synchronization completion state, allowing for accurate convergence.
  • Fig. 9 is a flowchart of the time synchronization process according to this embodiment. Referring to Fig. 9, when the control device 2 is started, it determines whether the time synchronization process is valid based on the information received from the support device 500 (step S10). If it is determined that the time synchronization process is not valid (NO in step S10), the process ends, but if it is determined that the time synchronization process is valid (YES in step S10), the process proceeds to step S11.
  • the control device 2 acquires a first threshold value from the information received from the support device 500 (step S11) and calculates the time difference (step S13). More specifically, the control device 2 determines whether the time distribution message 21 has been received two or more times (step S12). If it is determined that the time distribution message 21 has not been received two or more times (NO in step S12), the control device 2 repeats step S12, but if it is determined that the time distribution message 21 has been received two or more times (YES in step S12), the control device 2 calculates the time difference (step S13). In step S13, for example, a frequency-based time difference is calculated.
  • the control device 2 acquires and sets a second threshold value indicating a value equal to or greater than the first threshold value (steps S14, S15). The acquisition of the second threshold value will be described in detail later.
  • the control device 2 activates the correction module 522 to start time correction (step S16).
  • the control device 2 determines whether to receive the time distribution message 21 (step S17). While it is determined that the time distribution message 21 has not been received (NO in step S17), step S17 is repeated, but when it is determined that the time distribution message 21 has been received (YES in step S17), the time difference is calculated (step S18). In step S18, for example, the frequency-based time difference and the message-based time difference are calculated.
  • the control device 2 compares the frequency-based time difference calculated in step S18 with a first threshold value, and determines, based on the result of the comparison, whether the condition that the frequency-based time difference is less than or equal to the first threshold value continues to be satisfied for a certain period of time (step S19). In steps S18 and S19, the control device 2 calculates the frequency-based time difference for each of the times periodically output by the management timer, and determines whether the period during which the above condition is satisfied for each time difference calculated in this way continues for a certain period of time.
  • step S19 If it is determined that the state in which the above conditions are satisfied has continued for a certain period of time (YES in step S19), the control device 2 sets flag 40 to "1" to indicate that time synchronization has been completed (step S20), and proceeds to step S21. On the other hand, if it is determined that the state in which the above conditions are satisfied has not continued for a certain period of time (NO in step S19), the control device 2 proceeds to step S21 without executing the processing in step S20.
  • step S21 the control device 2 compares a representative time difference of the multiple frequency-based time differences calculated in steps S18 and S19 with a second threshold value, and determines whether the representative time difference is equal to or greater than the second threshold value based on the comparison result (step S21).
  • This representative time difference includes the average value, mode, median, latest value, etc. of the multiple frequency-based time differences calculated in steps S18 and S19.
  • the control device 2 determines whether the representative time difference is equal to or greater than the second threshold, and performs correction processing using the message-based time difference calculated in steps S18 and S19 based on the determination result. More specifically, if the control device 2 determines that the representative time difference is equal to or greater than the second threshold (YES in step S21), it performs phase correction processing (step S22), and if the control device 2 determines that the representative time difference is not equal to or greater than the second threshold, i.e., is less than the second threshold (NO in step S21), it performs frequency correction processing (step S23). Then, it returns to step S17.
  • step S19 when the control device 2 determines that time synchronization is complete (YES in step S19), it always determines that the time difference is equal to or less than the second threshold (NO in step S21) and performs frequency correction (step S23). In this way, when time synchronization is complete in the control device 2 (YES in step S19), even if a correction process is performed, frequency correction is performed and phase correction is not performed, so that "time backtracking" of the management timer does not occur.
  • the time of the management timer when the time of the management timer is ahead of the reference time, if a phase correction process is performed to add the time difference to the time of the management timer, the time of the management timer may go back to an earlier time because the fluctuation amount of the time of the management timer is large.
  • time backtracking In the frequency correction process, the time of the management timer is corrected to gradually reduce the time difference, so that the management timer can be converged to a time synchronization completion state with high accuracy without causing "time backtracking", and it is possible to maintain the time synchronization completion state thereafter.
  • (f1. Obtaining the second threshold) 10 to 13 are diagrams for explaining how the second threshold value is obtained according to the present embodiment. The mechanism for obtaining the second threshold value in steps S14 and S15 will be explained.
  • the threshold acquisition module 521 includes a first calculation module that calculates the second threshold according to a calculation formula using the frequency-based time difference, for example.
  • the second threshold is required to satisfy the condition (second threshold ⁇ upper limit value X) to prevent an extreme value from being set.
  • the condition (second threshold ⁇ first threshold) is required to be satisfied to prevent "time backtracking".
  • the values A and X are set based on experiments, etc.
  • FIG. 14 is another flowchart of the time synchronization process according to the present embodiment.
  • steps S12 and S13 are omitted from the flowchart in FIG. 9, but the other steps are the same as in FIG. 9 and therefore will not be described again.
  • step S14 in FIG. 14 the control device 2 obtains a second threshold value based on a first threshold value set by the user.
  • the threshold acquisition module 521 includes a second calculation module that acquires the relationship between the magnitude of the first threshold and a predetermined value, and calculates the second threshold according to the relationship and a calculation formula using the first threshold.
  • the control device 2 sets the second threshold differently when the relationship is acquired that the first threshold is less than a predetermined value and when the relationship is acquired that the first threshold is equal to or greater than the predetermined value.
  • the first threshold is set in the window 51B of FIG. 12. As shown in the process of FIG. 13, when the first threshold is less than 1 ms (millisecond), the control device 2 sets the second threshold to 1 ms, and when the first threshold is 1 ms or less, sets the second threshold to a value of (first threshold x 2).
  • the threshold acquisition module 521 may be configured to acquire the second threshold using a look up table (LUT). More specifically, the control device 2 acquires a value selected by the user from among the multiple values in the window 51B of the UI screen in FIG. 10 as the first threshold, and the control device 2 searches the table 44 in FIG. 11 for the second threshold based on the first threshold.
  • the table 44 is stored in advance in the control device 2. In the table 44, multiple records representing combinations of the first threshold and the second threshold are registered. The combinations of the first threshold and the second threshold are acquired by experiments or the like. For example, when the first threshold is selected in the window 51B, the second threshold of the record R1 is searched for in the table 44 in FIG. 11. Note that the second threshold in the table 44 satisfies the condition that it is at least equal to or greater than the first threshold and the condition of the upper limit value X described above.
  • FIG. 22 is a graph showing a schematic relationship between the time difference and the second threshold in this embodiment.
  • the vertical axis of this graph shows the time difference value, and the horizontal axis shows the elapsed time.
  • the time difference described in FIG. 22 shows the frequency-based time difference or the message-based time difference.
  • the time difference D3 shows the time difference obtained to calculate (estimate) the second threshold in step S14.
  • FIG. 22 shows the second threshold shown by a dashed line and graphs 221 and 222.
  • Graph 221 shows the change in the second threshold when based on the time difference D3 obtained to calculate (estimate) the second threshold in step S14, that is, the change in the value calculated by the formula (D3 x A (where A is changed to 1, 2, 3, 4, 5)). Additionally, graph 222 represents the change in the time difference calculated (estimated) by the control device 2 in step S18 in synchronization with the period SY.
  • the control device 2 performs frequency correction for a period TT (time T2 to time T7) that corresponds to the length of several cycles SY immediately after the phase correction.
  • TT time T2 to time T7
  • multiple frequency corrections can be performed.
  • the control device 2 determines that the time difference has exceeded the second threshold indicated by the dashed line, and performs phase correction in accordance with this determination.
  • control device 2 sets the second threshold based on the frequency-based time difference.
  • control device 2 changes the second threshold according to the magnitude of the frequency-based time difference, and can change the second threshold for switching between phase correction and frequency correction according to the first threshold or the magnitude of the frequency-based time difference.
  • Figures 15 to 20 are graphs that explain the advantages of setting the second threshold to a variable value according to this embodiment.
  • Figures 15, 16, and 17 show cases where the second threshold is fixed, unlike this embodiment. In these cases, since the second threshold is a fixed value, it takes time to complete time synchronization due to the magnitude of the second threshold or the relationship between the magnitude of the first threshold and the second threshold. In Figure 15, the second threshold is too large compared to the first threshold, so the message-based time difference remains large even after phase correction is performed, but frequency correction is started in such a state, so it takes a long time to complete time synchronization.
  • the second threshold is too small, so only phase correction is repeatedly performed even when the message-based time difference is small, and as a result, it takes a long time to complete time synchronization.
  • the second threshold since the second threshold has a relationship of (second threshold ⁇ first threshold), phase correction is performed even during time synchronization after time synchronization is completed. As a result, there is a high possibility that "time backwards" will occur.
  • Figs. 18, 19, and 20 show cases in which the second threshold is not fixed but is changed according to the magnitude of the frequency-time difference.
  • Fig. 18 shows a case in which the second threshold is set based on the frequency-based time difference in the case of Fig. 15. More specifically, in Fig. 18, a value that is not too large compared to the first threshold is set for the second threshold, so that phase correction and frequency correction can be combined and implemented, and the time required to complete time synchronization can be shortened compared to the case of Fig. 15.
  • Fig. 19 shows a case in which the second threshold is set based on the frequency-based time difference in the case of Fig. 16. More specifically, in Fig.
  • a value that is not too large and not too small compared to the first threshold is set for the second threshold, so that phase correction and frequency correction can be combined and implemented, and the time required to complete time synchronization can be shortened compared to the case of Fig. 15 or Fig. 16.
  • control-related processing includes processing in which the control device 2 issues a query to the manufacturing execution system 400 in order to store the data in the time-series DB 450.
  • This query follows a database manipulation language (SQL: Structured Query Language) in order to store data in a time series.
  • the data includes the observed values collected by the control device 2 and the management time as a timestamp associated with each observed value.
  • time synchronization is completed in each control device 2, the timestamps from each control device 2 indicate the time synchronized with each other.
  • the manufacturing execution system 400 can aggregate (i.e., integrate) the time-series data of the observed values from each control device 2 in the time-series DB 450 by matching the observed timing based on the timestamp. Using the data aggregated in this way makes it easier to analyze the observed values.
  • time synchronization if time synchronization has not been completed in the control device 2, the time stamps of each control device 2 will not be synchronized, and even if the manufacturing execution system 400 aggregates the time series data of observed values in the time series DB 450, it will not be possible to analyze the aggregated data based on the observation time.
  • Process A of the control structure program 51F includes a process that is performed when time synchronization is complete. More specifically, in process A, the control device 2 generates time series data having a timestamp and an observation value of the time output by the management timer, and transmits it to the manufacturing execution system 400.
  • Process B includes a process that is performed when time synchronization is not complete. More specifically, in process B, the control device 2 does not execute process A. Alternatively, in process B, the control device 2 generates time series data having a timestamp, an observation value, and an identifier of "time synchronization not complete", and transmits it to the manufacturing execution system 400.
  • the control device 2 referring to the flag 40 set in the time synchronization process when executing the control structure program 51F, it is possible to differentiate the control-related process that is performed when time synchronization is incomplete as described above from the control-related process that is performed when time synchronization is complete.
  • the processes A and B that are performed based on the flag 40 are not limited to the transfer of observed values to the manufacturing execution system 400 described above.
  • the second threshold was set based on the frequency-based time difference, but the second threshold may also be set based on the message-based time difference.
  • the correction amount used in the time correction process described above is set based on the message-based time difference, but the correction amount may also be set based on the frequency-based time difference. Note that this method of setting does not limit gPTP time correction to time correction using the frequency-based time difference.
  • the processor 102 of the control device 2 executes the programs in the secondary storage device 106 to realize the time synchronization process and the control-related processes or methods described above.
  • the programs and data executed to realize these processes 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.
  • the CPU 501 of the support device 500 provides the support tool to the user.
  • the hard disk 504 may store programs and data for implementing the support tool.
  • the programs and data for implementing the support tool may be downloaded to the hard disk 504 via the communication interface 507 and various communication lines. Alternatively, they may be downloaded to the hard disk 504 via the memory card 512.
  • Memory card 116 or memory card 512 is a medium that stores information such as a program through electrical, magnetic, optical, mechanical, or chemical action so that the information can be read by a computer or other device or machine.
  • a control device (2) for FA factory automation
  • the time synchronization processing unit A time difference calculation unit (523) that calculates a time difference between a reference time and a time measured by the timer;
  • a threshold acquisition unit (521) that acquires a second threshold that is equal to or greater than a first threshold indicating an allowable range of the time difference;
  • the time of the timer indicates a time based on a clock included in the timer
  • the reference time indicates a time based on a clock of a master device connected to the network
  • the control device according to configuration 1, wherein the time difference calculation unit calculates the time difference based on a difference between a clock frequency of the timer and a clock frequency of the master device.
  • the control device further includes a communication unit for receiving a message (21) delivered from a master device connected to the network, a broadcast message from the master device including a transmission time of the message based on a master clock of the master device; The time difference calculation unit Calculating the reference time based on the transmission time of the delivery message received from the master device and a propagation delay time of the network; 3.
  • the control device according to configuration 1 or 2, wherein the time difference is calculated based on a difference between a reception time of the delivery message measured by the timer and the calculated reference time.
  • the time synchronization processing unit determining whether a synchronization condition is satisfied, that is, the time difference is equal to or smaller than the first threshold value; A control device described in any one of configurations 1 to 3, wherein the correction unit performs the first correction process when the time difference is greater than or equal to the second threshold value, and performs the second correction process when the time difference is less than the second threshold value, depending on whether the synchronization condition is satisfied.
  • the threshold acquisition unit The control device according to any one of configurations 1 to 4, wherein the control device calculates the second threshold value according to a calculation formula using the time difference.
  • the threshold acquisition unit The control device according to any one of configurations 1 to 5, wherein the second threshold value is calculated according to a calculation formula using a magnitude relationship between the first threshold value and a predetermined value and the first threshold value.
  • the first correction process includes: Repeating the process of correcting the time of the timer by the first correction amount M times (where M ⁇ 2); The control device according to any one of configurations 1 to 6, wherein the first correction amount includes a correction amount based on a value obtained by dividing the value of the time difference into M parts.
  • the second correction process includes: Repeating the process of correcting the time of the timer by the second correction amount N times (N ⁇ 2); The control device according to any one of configurations 1 to 7, wherein the second correction amount includes a correction amount based on a value obtained by dividing the value of the time difference by N.
  • the time synchronization processing unit determines whether or not a synchronization condition that the time difference is equal to or less than the first threshold is satisfied;
  • the control device according to any one of configurations 1 to 8, wherein the processing related to the control of the target includes a first processing that is performed when it is determined that the synchronization condition is satisfied, and a second processing that is performed in response to it being determined that the synchronization condition is satisfied and is different from the first processing.
  • the first process includes a process of collecting data having observed values related to control of the object and times of the timer indicative of observed timing.
  • a factory automation (FA) control system comprising a plurality of control devices according to any one of configurations 1 to 10.
  • the execution of the time synchronization process includes: Calculating a time difference between a reference time and a time measured by the timer; obtaining a second threshold value that is equal to or greater than the first threshold value and indicates an acceptable range of the time difference; performing one of a first correction process for correcting the time of the timer by a first correction amount so as to indicate the reference time, and a second correction process for correcting the time of the timer by a second correction amount smaller than the first correction amount so as to indicate the reference time;
  • a program (177) for causing a processor (102) of a control device (2) for FA (factory automation) to execute a method The control device includes a connector (105) for connecting to a network (11) and a timer (126); The method comprises: performing a process related to the control of the target; and performing a process of time synchronization;
  • the execution of the time synchronization process includes: Calculating a time difference between a reference time and a time measured by the timer; obtaining a second threshold value that is equal to or greater than the first threshold value and indicates an acceptable range of the time difference; performing one of a first correction process for correcting the time of the timer by a first correction amount so as to indicate the reference time, and a second correction process for correcting the time of the timer by a second correction amount smaller than the first correction amount so as to indicate the reference time;
  • the implementation of one of the above The program includes: performing the first correction process when the time difference is equal to or greater than the second threshold; and performing the second correction process when the time difference is
  • Control system 2 2A, 2B, 2C Control device 3A, 3B, 3C Process 11, 12, 13, 14, 110 Network 21 Time distribution message 40 Flag 44 Table 51 Screen 51A, 51B, 51C Window 51D Button 51E Text box 51F
  • Control structure program 90 Field equipment 91, 91A, 91B, 103, 119, 503 Timer 102 Processor 104 chip set, 105 upper network controller, 106 secondary storage device, 107 controller, 108 main storage device, 109 memory card interface, 116, 512 memory card, 118 field network controller, 126 counter, 150 execution engine, 152 control program, 156 database writing program, 158 serialized communication program, 160 variable management management program, 170 scheduler program, 172 input program, 174 output program, 177 synchronization application, 178 correction program, 180 time series database, 182 time series data, 190 line management device, 192 upper connection program, 193 database connection program, 194 gateway program, 200 communication cycle data, 280 display device, 300 distributed system, 380 manufacturing management device, 400 manufacturing execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Programmable Controllers (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The present invention enables time synchronizations to be promptly and accurately completed. A time synchronization processing unit calculates the time difference between a reference time and the time measured by a timer, and acquires a second threshold that indicates the permissible range of time differences and that is greater than or equal to a first threshold. The time synchronization processing unit carries out either a first correction process to correct the time on the timer using a first correction amount so as to indicate the reference time or a second correction process to correct the time on the timer using a second correction amount that is smaller than the first correction amount. The time synchronization processing unit carries out the first correction process when the time difference is greater than or equal to the second threshold and carries out the second correction process when the time difference is less than the second threshold.

Description

制御装置、制御システム、方法およびプログラムControl device, control system, method and program
 本開示は、FA(Factory Automation)の制御システムの時刻同期に関する。 This disclosure relates to time synchronization in FA (Factory Automation) control systems.
 様々な生産現場において、PLC(Programmable Logic Controller)等の制御装置を用いた制御システムが普及している。制御システムとしては、1台の制御装置が周辺装置を制御するシステムに加えて、複数台の制御装置が互いにデータを遣り取りして協働で周辺装置を制御する分散制御システムが提案されている。分散制御システムでは、高精度に協働するために、複数の制御装置が互いに時刻同期することが望まれる。 Control systems using control devices such as PLCs (Programmable Logic Controllers) are becoming common in various production sites. In addition to systems in which one control device controls peripheral devices, distributed control systems have been proposed in which multiple control devices exchange data with each other to collaboratively control peripheral devices. In a distributed control system, it is desirable for the multiple control devices to be time-synchronized with each other in order to work together with high precision.
 例えば、特許文献1(特開2019-146060号公報)は時刻同期の構成を開示する。この構成では、ネットワークに接続された複数の通信装置はそれぞれ、他の通信装置の時刻と自装置の時刻との差分を時刻調整値として、自装置の時刻を補正する。 For example, Patent Document 1 (JP 2019-146060 A) discloses a time synchronization configuration. In this configuration, each of multiple communication devices connected to a network corrects the time of its own device by using the difference between the time of the other communication devices and the time of its own device as a time adjustment value.
特開2019-146060号公報JP 2019-146060 A
 FAの制御システムでは、時刻同期完了を判断するための許容範囲を示す閾値が設定されて、上記に述べた時刻の差分は当該閾値と比較されて、比較の結果に基づき時刻同期の完了が判断される。したがって、設定される閾値によって時刻同期の完了に長時間を要する、または、精度良く時刻同期できない等のケースがあった。 In FA control systems, a threshold is set that indicates the tolerance range for determining when time synchronization is complete, the time difference described above is compared with this threshold, and the completion of time synchronization is determined based on the result of the comparison. Therefore, depending on the threshold that is set, there have been cases where it takes a long time to complete time synchronization, or time synchronization cannot be performed with high accuracy.
 それゆえに、本開示の目的は、時刻同期を精度良く速やかに完了させることが可能な技術を提供することである。 Therefore, the objective of this disclosure is to provide technology that can complete time synchronization quickly and accurately.
 本開示に係るFA(ファクトリオートメーション)の制御装置は、ネットワークを接続するコネクタと、タイマと、対象の制御に関連する処理を実施する制御処理部と、時刻同期の処理を実施する時刻同期処理部と、を備える。 The FA (factory automation) control device according to the present disclosure includes a connector for connecting a network, a timer, a control processing unit that performs processing related to the control of the target, and a time synchronization processing unit that performs time synchronization processing.
 時刻同期処理部は、基準時刻とタイマが計測した時刻との間の時刻差を算出する時刻差算出部と、時刻差の許容範囲を示す第1閾値以上である第2閾値を取得する閾値取得部と、タイマの時刻を、基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、基準時刻を示すように第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施する補正部と、を含む。 The time synchronization processing unit includes a time difference calculation unit that calculates the time difference between a reference time and the time measured by the timer, a threshold acquisition unit that acquires a second threshold equal to or greater than a first threshold that indicates an acceptable range of the time difference, and a correction unit that performs either a first correction process that corrects the timer time by a first correction amount so that it indicates the reference time, or a second correction process that corrects the timer time by a second correction amount smaller than the first correction amount so that it indicates the reference time.
 補正部は、時刻差が第2閾値以上であるとき第1補正処理を実施し、時刻差が前記第2閾値未満であるとき第2補正処理を実施する。 The correction unit performs a first correction process when the time difference is equal to or greater than a second threshold, and performs a second correction process when the time difference is less than the second threshold.
 上述の制御装置によれば、時刻差の許容範囲を示し第1閾値とは異なる第2閾値と時刻差との両者の値の大きさの関係に基づき、補正処理は第1補正処理と第2補正処理との間で切替えられる。この場合、補正部は、時刻差が第2閾値以上であり許容範囲から比較的離れていれば、大きい方の第1補正量で補正処理を実施して、時刻差を速やかに小さくして時刻同期を完了させることができる。対照的に、時刻差が第2閾値未満であり許容範囲に近ければ、小さい方の第2補正量で補正処理を実施して、時刻差を徐々に許容範囲に収束させて、精度良く時刻同期を完了させることができる。 According to the control device described above, the correction process is switched between the first correction process and the second correction process based on the relationship between the magnitude of the time difference and a second threshold value that indicates the acceptable range of the time difference and is different from the first threshold value. In this case, if the time difference is equal to or greater than the second threshold value and is relatively far from the acceptable range, the correction unit performs the correction process with the larger first correction amount to quickly reduce the time difference and complete time synchronization. In contrast, if the time difference is less than the second threshold value and close to the acceptable range, the correction unit performs the correction process with the smaller second correction amount to gradually converge the time difference into the acceptable range and complete time synchronization with high precision.
 上述の制御装置のタイマの時刻は、当該タイマが有するクロックに基づいた時刻を示し、基準時刻は、ネットワークに接続されるマスタ装置のクロックに基づいた時刻を示し、時刻差算出部は、タイマのクロックの周波数とマスタ装置のクロックの周波数の差に基づき時刻差を算出する。 The time on the timer of the control device mentioned above indicates the time based on the clock possessed by the timer, the reference time indicates the time based on the clock of the master device connected to the network, and the time difference calculation unit calculates the time difference based on the difference between the frequency of the timer's clock and the frequency of the master device's clock.
 上述の制御装置によれば、時刻同期処理に用いる時刻差は、制御装置のタイマのクロックの周波数と基準時刻を提供するマスタ装置のクロックの周波数の差に基づき算出される。  According to the above-mentioned control device, the time difference used in the time synchronization process is calculated based on the difference between the clock frequency of the control device's timer and the clock frequency of the master device that provides the reference time.
 上述の制御装置は、ネットワークに接続されたマスタ装置から配信されるメッセージを受信する通信部を、さらに備え、マスタ装置からの配信メッセージは、当該マスタ装置のマスタクロックに基づく当該メッセージの送信時刻を含む。時刻差算出部は、マスタ装置から受信した配信メッセージの送信時刻とネットワークの伝搬遅延時間とに基づき基準時刻を算出し、タイマが計測した配信メッセージの受信時刻と算出された基準時刻との差に基づき時刻差を算出する。 The above-mentioned control device further includes a communication unit that receives a message distributed from a master device connected to the network, and the distributed message from the master device includes the transmission time of the message based on the master clock of the master device. The time difference calculation unit calculates a reference time based on the transmission time of the distributed message received from the master device and the propagation delay time of the network, and calculates the time difference based on the difference between the reception time of the distributed message measured by the timer and the calculated reference time.
 上述の制御装置によれば、マスタ装置からの配信メッセージに含まれる基準時刻を用いて時刻差を算出できる。 The control device described above can calculate the time difference using the reference time included in the message delivered from the master device.
 上述の制御装置の時刻同期処理部は、時刻差が第1閾値以下であることの同期条件が満たされるか否かを判定し、補正部は、同期条件が満たされたことの判定に応じて、時刻差が第2閾値以上であるとき第1補正処理を実施し、時刻差が第2閾値未満であるとき第2補正処理を実施する。 The time synchronization processing unit of the above-mentioned control device determines whether or not the synchronization condition of the time difference being equal to or less than the first threshold is satisfied, and the correction unit, depending on whether or not the synchronization condition is satisfied, performs a first correction process when the time difference is equal to or greater than the second threshold, and performs a second correction process when the time difference is less than the second threshold.
 上述の制御装置によれば、上記に述べた補正処理の切替を、同期条件が満たされて同期完了と判定された場合においても実施して、時刻同期した状態を維持することができる。 The control device described above can switch between the correction processes described above even when the synchronization conditions are met and it is determined that synchronization is complete, thereby maintaining a time-synchronized state.
 上述の制御装置の閾値取得部は、時刻差を用いた算出式に従い第2閾値を算出する。これにより、第2閾値を、時刻差を用いて算出することができる。 The threshold acquisition unit of the control device calculates the second threshold according to a calculation formula using the time difference. This makes it possible to calculate the second threshold using the time difference.
 上述の制御装置の閾値取得部は、第1閾値と予め定められた値の間の大きさの関係および第1閾値を用いた算出式に従い、第2閾値を算出する。これにより、第2閾値を、第1閾値と所定値の大きさの関係および当該第1閾値を用いて算出できる。 The threshold acquisition unit of the control device calculates the second threshold according to a calculation formula using the magnitude relationship between the first threshold and a predetermined value and the first threshold. This allows the second threshold to be calculated using the magnitude relationship between the first threshold and a predetermined value and the first threshold.
 上述の制御装置の第1補正処理は、タイマの時刻を第1補正量で補正する処理を、M回(ただし、M≧2)繰り返し、第1補正量は、時刻差の値をM個に分割した値に基づく補正量を含む。 The first correction process of the control device described above repeats the process of correcting the timer time by the first correction amount M times (where M is greater than or equal to 2), and the first correction amount includes a correction amount based on a value obtained by dividing the time difference value into M parts.
 上述の制御装置によれば、第1補正処理では、時刻差を分割し、分割された各値を用いて補正を繰り返すことで、時刻同期させることができる。 In the above-mentioned control device, the first correction process divides the time difference and repeats correction using each divided value, thereby achieving time synchronization.
 上述の制御装置の第2補正処理は、タイマの時刻を第2補正量で補正する処理を、N回(ただし、N≧2)繰り返し、第2補正量は、時刻差の値をN個に分割した値に基づく補正量を含む。 The second correction process of the control device described above repeats the process of correcting the timer time by the second correction amount N times (where N is greater than or equal to 2), and the second correction amount includes a correction amount based on a value obtained by dividing the time difference value into N parts.
 上述の制御装置によれば、第2補正処理では、時刻差を分割し、分割された各値を用いて補正を繰り返すことで、時刻同期させることができる。 In the above-mentioned control device, the second correction process divides the time difference and repeats correction using each divided value, thereby achieving time synchronization.
 上述の制御装置の時刻同期処理部は、時刻差が第1閾値以下であることの同期条件が満たされるか否かを判定し、対象の制御に関連する処理は、同期条件が満たされと判定されたときに実施される第1処理と、当該同期条件が満たされと判定されたことに応じて実施される処理であって第1処理とは異なる第2処理を含む。 The time synchronization processing unit of the above-mentioned control device determines whether or not the synchronization condition of the time difference being equal to or less than a first threshold value is satisfied, and the processing related to the target control includes a first processing that is performed when it is determined that the synchronization condition is satisfied, and a second processing that is different from the first processing and is performed in response to the determination that the synchronization condition is satisfied.
 上述の制御装置によれば、時刻同期が完了したか否かで実施される制御関連処理を異ならせることができる。 The control device described above can perform different control-related processes depending on whether time synchronization has been completed.
 上述の制御装置の第1処理は、対象の制御に関連した観測値と観測されたタイミングを示すタイマの時刻を有するデータの収集処理を含む。 The first process of the control device described above includes a process of collecting data having observed values related to the control of the target and timer times indicating the observed timing.
 上述の制御装置によれば、同期条件が満たされて時刻同期した場合に第1処理が実行されることで、時刻同期したタイマが計測する観測時刻に従い観測値を収集できる。  According to the control device described above, when the synchronization condition is satisfied and time synchronization is achieved, the first process is executed, making it possible to collect observation values according to the observation time measured by the time-synchronized timer.
 この開示の他の局面では、FA(ファクトリオートメーション)の制御システムであって、上記に述べた制御装置を複数備える制御システムが提供される。 In another aspect of this disclosure, there is provided a factory automation (FA) control system that includes a plurality of the control devices described above.
 この開示の他の局面では、FA(ファクトリオートメーション)の制御装置が実施する方法が提供される。制御装置は、ネットワークを接続するコネクタと、タイマとを備える。方法は、対象の制御に関連する処理を実施すること、および、時刻同期の処理を実施すること、を備え、時刻同期の処理を実施することは、基準時刻とタイマが計測した時刻との間の時刻差を算出すること、時刻差の許容範囲を示す第1閾値以上である第2閾値を取得すること、タイマの時刻を、基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、基準時刻を示すように第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施すること、を含み、このような一方を実施することは、時刻差が第2閾値以上であるとき第1補正処理を実施し、時刻差が第2閾値未満であるとき第2補正処理を実施することを含む。 In another aspect of this disclosure, a method is provided that is implemented by a control device of FA (factory automation). The control device includes a connector for connecting a network and a timer. The method includes implementing a process related to the control of an object and implementing a time synchronization process, where implementing the time synchronization process includes calculating a time difference between a reference time and a time measured by the timer, acquiring a second threshold value equal to or greater than a first threshold value indicating an acceptable range of the time difference, and implementing one of a first correction process that corrects the timer time by a first correction amount so as to indicate the reference time or a second correction process that corrects the timer time by a second correction amount smaller than the first correction amount so as to indicate the reference time, and implementing one of such processes includes implementing the first correction process when the time difference is equal to or greater than the second threshold value, and implementing the second correction process when the time difference is less than the second threshold value.
 この開示の他の局面では、FA(ファクトリオートメーション)の制御装置のプロセッサに方法を実施させるためのプログラムが提供される。制御装置は、ネットワークを接続するコネクタと、タイマを備える。方法は、対象の制御に関連する処理を実施すること、および時刻同期の処理を実施すること、を備え、時刻同期の処理を実施することは、基準時刻とタイマが計測した時刻との間の時刻差を算出すること、時刻差の許容範囲を示す第1閾値以上である第2閾値を取得すること、タイマの時刻を、基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、基準時刻を示すように第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施すること、を含み、一方を実施することは、時刻差が第2閾値以上であるとき第1補正処理を実施し、時刻差が第2閾値未満であるとき第2補正処理を実施することを含む。 In another aspect of this disclosure, a program is provided for causing a processor of a control device for FA (factory automation) to execute a method. The control device includes a connector for connecting a network and a timer. The method includes executing a process related to the control of an object and executing a time synchronization process, where executing the time synchronization process includes calculating a time difference between a reference time and a time measured by the timer, acquiring a second threshold value equal to or greater than a first threshold value indicating an acceptable range of the time difference, and executing one of a first correction process that corrects the timer time by a first correction amount so as to indicate the reference time or a second correction process that corrects the timer time by a second correction amount smaller than the first correction amount so as to indicate the reference time, and executing one of the processes includes executing the first correction process when the time difference is equal to or greater than the second threshold value, and executing the second correction process when the time difference is less than the second threshold value.
 上記のプログラムは、当該プログラムがコンピュータによって実行されると、コンピュータに上記の方法を実行させる命令を備えている。 The above program includes instructions that, when executed by a computer, cause the computer to execute the above method.
 本開示によれば、時刻同期を精度良く速やかに完了させることできる。 According to this disclosure, time synchronization can be completed quickly and accurately.
本実施の形態に係る制御システム1の全体構成の一例を模式的に示す図である。1 is a diagram illustrating an example of an overall configuration of a control system 1 according to an embodiment of the present invention. 本実施の形態に係る制御装置2のハードウェア構成例を示すブロック図である。2 is a block diagram showing an example of a hardware configuration of a control device 2 according to the present embodiment. FIG. 本実施の形態に係るサポート装置500のハードウェア構成例を示すブロック図である。FIG. 5 is a block diagram showing an example of a hardware configuration of a support device 500 according to the present embodiment. 本実施の形態に係る制御装置2のソフトウェア構成例を示すブロック図である。2 is a block diagram showing an example of a software configuration of a control device 2 according to the present embodiment. FIG. 本実施の形態に係る同期モジュール560の構成を模式的に示す図である。FIG. 5 is a diagram illustrating a schematic configuration of a synchronization module 560 according to the present embodiment. 本実施の形態に係るアプリケーション設計の概略処理フローチャートである。1 is a schematic process flowchart of application design according to the present embodiment. 図6のアプリケーション設計の環境を模式的に示す図である。FIG. 7 is a diagram illustrating the application design environment of FIG. 6. 本実施の形態に係る通信シーケンスの一例を示す図である。FIG. 2 is a diagram showing an example of a communication sequence according to the present embodiment. 本実施の形態に係る時刻同期処理のフローチャートである。4 is a flowchart of a time synchronization process according to the present embodiment. 本実施の形態に係る第2閾値の取得を説明する図である。11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment. FIG. 本実施の形態に係る第2閾値の取得を説明する図である。11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment. FIG. 本実施の形態に係る第2閾値の取得を説明する図である。11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment. FIG. 本実施の形態に係る第2閾値の取得を説明する図である。11 is a diagram illustrating acquisition of a second threshold value according to the present embodiment. FIG. 本実施の形態に係る時刻同期処理の他のフローチャートである。13 is another flowchart of the time synchronization process according to the embodiment. 本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment. 本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment. 本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment. 本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment. 本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment. 本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。10 is a graph illustrating an advantage obtained by variably setting the second threshold value according to the present embodiment. 本実施の形態に係る通信シーケンスの一例を示す図である。FIG. 2 is a diagram showing an example of a communication sequence according to the present embodiment. 本実施の形態に係る時刻差と第2閾値の関係を模式的に示すグラフである。10 is a graph illustrating a relationship between a time difference and a second threshold value according to the present embodiment.
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。 The embodiment of the present invention will be described in detail with reference to the drawings. Note that the same or corresponding parts in the drawings will be given the same reference numerals and their description will not be repeated.
 <A.適用例>
 まず、本発明が適用される場面の一例について説明する。本実施の形態では、「制御装置」の典型例として、PLCを説明するが、PLCの名称に限定されることなく、本明細書に開示された技術思想は、任意の制御装置に対して適用可能である。
<A. Application Examples>
First, an example of a situation in which the present invention is applied will be described. In this embodiment, a PLC will be described as a typical example of a "control device", but the technical idea disclosed in this specification is not limited to the name of the PLC and can be applied to any control device.
 また、本実施の形態では、制御装置は時間を管理する管理タイマを有する。制御装置は、管理タイマを、基準時刻を管理する基準タイマに合わせるための「時刻同期処理」を実行する。管理タイマの時刻は、管理タイマのクロックに基づいて時刻を示し、基準タイマの時刻は、基準タイマのクロックに基づいた時刻を示す。 In addition, in this embodiment, the control device has a management timer that manages time. The control device executes a "time synchronization process" to synchronize the management timer with a reference timer that manages the reference time. The time of the management timer indicates the time based on the clock of the management timer, and the time of the reference timer indicates the time based on the clock of the reference timer.
 図1は、本実施の形態に係る制御システム1の全体構成の一例を模式的に示す図である。 FIG. 1 is a diagram showing an example of the overall configuration of a control system 1 according to this embodiment.
 図1を参照して、制御システム1は生産ラインのFAを実現する。より具体的には、制御システム1では、ネットワークが複数レベルに接続されており、各レベルのネットワークには、それぞれ異なる機能が割り当てられる。具体的には、限定されないが、例えば4つのレベルのネットワーク11~14が設けられている。 Referring to FIG. 1, control system 1 realizes factory automation of a production line. More specifically, in control system 1, networks are connected at multiple levels, and different functions are assigned to the networks at each level. Specifically, but not limited to, for example, four levels of networks 11 to 14 are provided.
 コントロールレベルのネットワーク11は、複数の制御装置2A、2Bおよび2Cと、装置/ライン管理装置190よびSCADA(Supervisory Control And Data Acquisition)機能を提供する表示装置280とが接続されて、ネットワーク11では装置間でデータを遣り取りできるデータリンクが形成される。制御装置2A、2Bおよび2Cを区別しない場合は「制御装置2」と称する。ネットワーク11は、主に、時刻同期および制御系に係る情報を伝送する。 The control level network 11 is connected to multiple control devices 2A, 2B, and 2C, a device/line management device 190, and a display device 280 that provides a SCADA (Supervisory Control and Data Acquisition) function, forming a data link that allows data to be exchanged between the devices. 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 related to time synchronization and the control system.
 制御装置2は、フィールドレベルのネットワーク110を介して1または複数のフィールド機器90を接続する。これらのフィールド機器90は、制御装置2に直接接続されてもよい。1または複数のフィールド機器90の各々は、製造装置または生産ラインなど(以下、「フィールド」とも総称する。)に対して何らかの物理的な作用を与えるアクチュエータ、およびフィールドとの間で情報を遣り取りする入出力装置などを含む。 The control device 2 connects one or more field devices 90 via a field-level network 110. These field devices 90 may be directly connected to the control device 2. Each of the one or more field devices 90 includes an actuator that exerts some kind of physical action on a manufacturing device or a production line (hereinafter collectively referred to as the "field"), and an input/output device that exchanges information with the field.
 ネットワーク110を介して、制御装置2とフィールド機器90との間で遣り取りされるデータは、数100μsecオーダ~数10msecオーダのごく短い周期で更新されることになる。なお、このような遣り取りされるデータの更新処理は、入出力リフレッシュ処理とも称される。 The data exchanged between the control device 2 and the field device 90 via the network 110 is updated at very short intervals of the order of several hundred microseconds to several tens of milliseconds. This process of updating the exchanged data is also called input/output refresh processing.
 管理レベルのネットワーク12には、装置およびラインを管理する装置/ライン管理装置190、製造計画等を管理する製造管理装置380および390が接続される。装置/ライン管理装置190、製造管理装置380および390は、ネットワーク12を介して、製造計画等の管理情報の遣り取り、および装置またはラインの情報を遣り取りする。 The management-level network 12 is connected to an equipment/line management device 190 that manages equipment and lines, and manufacturing management devices 380 and 390 that manage manufacturing plans, etc. The 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 the network 12.
 コンピュータレベルのネットワーク13には、製造管理装置380および390、ならびに時系列DB(データベースの略)450を管理する製造実行システム(MES:Manufacturing Execution System)400が接続される。製造管理装置380および390、ならびに製造実行システム400は、ネットワーク13を介して、生産管理および情報系のデータを遣り取りする。 Connected to computer-level network 13 are manufacturing management devices 380 and 390, and a manufacturing execution system (MES) 400 that manages a time-series DB (short for database) 450. Manufacturing management devices 380 and 390, and manufacturing execution system 400 exchange production management and information system data via network 13.
 製造実行システム400は、ネットワーク13を介して収集するフィールド機器90からの入力値である観測値を、観測された順番に従う時系列のデータとして時系列DB450に格納する。具体的には、本実施の形態では、制御装置2は、指定された観測値と管理タイマの時刻のデータを含むフレームを生成し、ネットワーク11,12および13を介して製造実行システム400に転送する。 The manufacturing execution system 400 stores the observation 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 observation value and data on the time of the management timer, and transfers it to the manufacturing execution system 400 via the networks 11, 12, and 13.
 インターネットなどの外部ネットワークを含むネットワーク14には、製造実行システム400とクラウド上の外部装置などが接続される。製造実行システム400は、クラウド上の装置とデータを遣り取りすることにより、時系列DB450のデータをクラウド上の装置に転送する。 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 in the time series DB 450 to the devices on the cloud by exchanging data with the devices on the cloud.
 図1に示す制御システム1において、ネットワーク11~14およびネットワーク110には、このような要求される特性の違いに応じたプロトコルおよびフレームワークが採用される。例えば、ファクトリーネットワークに属するネットワーク11および12のプロトコルとしては、汎用的なEthernet(登録商標)上に制御用プロトコルを実装した産業用オープンネットワークであるEtherNet/IP(登録商標)を用いてもよい。また、ネットワーク110のプロトコルとしては、マシンコントロール用ネットワークの一例であるEtherCAT(登録商標)を採用してもよい。なお、ネットワーク11のプロトコルとネットワーク110には、同じまたは異なるプロトコルが適用される。このようなマシンコントロールに適したネットワーク技術を採用することで、機器間の伝送に要する時間が保証されたリアルタイム性を提供できる。 In the control system 1 shown in FIG. 1, networks 11-14 and network 110 adopt protocols and frameworks that correspond to the differences in the required characteristics. For example, EtherNet/IP (registered trademark), an industrial open network that implements a control protocol on a general-purpose Ethernet (registered trademark), may be used as the protocol for networks 11 and 12 belonging to the factory network. Furthermore, 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 applied to the protocols for networks 11 and 110. By adopting such network technology suitable for machine control, real-time performance with a guaranteed time required for transmission between devices can be provided.
 対照的に、コーポレートネットワークに属するネットワーク13および14は、接続先の多様性を担保するために、汎用的なEthernet等のプロトコルが適用される。汎用的なEthernetが採用されることで、送信可能なデータ量等の制限を排除できる。 In contrast, networks 13 and 14 belonging to the corporate network use protocols such as general-purpose Ethernet to ensure a diversity of connection destinations. By adopting general-purpose Ethernet, restrictions on the amount of data that can be transmitted can be eliminated.
 制御装置2または装置/ライン管理装置190は、サポート装置500が接続され得る。サポート装置500は、制御装置2が制御対象を制御するために必要な準備を支援する装置である。 The control device 2 or the device/line management device 190 may be connected to a support device 500. The support device 500 is a device that assists the control device 2 in making the necessary preparations to control the controlled object.
 制御システム1は、制御装置2A、2Bおよび2Cが、それぞれ、異なる工程3A、3Bおよび3Cに備えられる分散型システム300を備える。限定されないが、例えば、工程3Aは、ワーク(部品、部材)を整列させながら搬送するパーツフィーダの工程を示し、工程3Bは、工程3Aで整列されたワークをロボットのPick And Place動作によって移動させる工程を示し、工程3Cは移動後のワークを組立てる工程を示す。分散型システム300では、各工程の制御装置2に接続されるフィールド機器90の動作は、前後工程の制御装置2に接続されるフィールド機器90の動作とは異なる。分散型システム300における要求タクトタイムを満たすために、ある工程における動作は当該工程の前後工程の動作と同期して実施される。 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, but not limited to, process 3A indicates a part feeder process that aligns and transports workpieces (components, parts), process 3B indicates a process that moves the workpieces aligned in process 3A by a robot's pick-and-place operation, and process 3C indicates a process of assembling the moved workpieces. In the distributed system 300, the operation of the field devices 90 connected to the control device 2 of each process differs from the operation of the field devices 90 connected to the control device 2 of the previous and next processes. In order to meet the required takt time in the distributed system 300, the operation of a certain process is performed in synchronization with the operation of the process before and after the process.
 制御装置2は、当該制御装置2に接続されるフィールド機器90のシーケンス制御を実現するためのシーケンスプログラムおよびモーション制御を実現するためのモーションプログラムなどを含む制御に関するプログラムを、同期した時刻に基づく予め定められた周期(これを、制御周期ともいう)毎に実行することで、フィールド機器90のリアルタイム制御を実現する。 The control device 2 executes control programs, including a sequence program for implementing sequence control of the field devices 90 connected to the control device 2 and a motion program for implementing motion control, at predetermined intervals (also called control intervals) based on synchronized time, thereby achieving real-time control of the field devices 90.
 本開示において、「時刻」は、時の流れにおけるある一点を示すものを意図し、例えば、時分秒などの単位を用いて規定される。「タイマ」は、制御装置2および関連する装置内でタイミングを制御するための値を計測するために、基本的には、ハードウェアクロックが発生するクロックに基づき時刻を計測する。より具体的には、タイマは、クロック周波数に基づく予め定められた単位時間毎に所定値ずつインクリメントまたはデクリメントされるカウンタを含んで構成され得る。カウンタは、例えば整数値を表す予め定められたビット長を有する。基準タイマと制御装置2の管理タイマとの間の時刻の差(誤差または変位)に基づき「同期精度」を示すことができる。したがって、時刻の差(誤差または変位)が小さいほど「同期精度」は高く、時刻の差(誤差または変位)が大きいほど「同期精度」は低い。ユーザは、制御システム1において所望の同期精度を実現できるように、許容できる時刻差の範囲を「許容範囲」として設定することができる。以下では、このような許容範囲は「第1閾値」として示される。 In this disclosure, "time" is intended to indicate a certain point in the flow of time, and is specified using units such as hours, minutes, and seconds. A "timer" basically measures time based on a clock generated by a hardware clock in order to measure values for controlling timing within the control device 2 and related devices. More specifically, the timer may be configured to include a counter that is incremented or decremented by a predetermined value for each predetermined unit time based on the clock frequency. The counter has a predetermined bit length that represents, for example, an integer value. "Synchronization accuracy" can be indicated based on the time difference (error or displacement) between the reference timer and the management timer of the control device 2. Therefore, the smaller the time difference (error or displacement), the higher the "synchronization accuracy", and the larger the time difference (error or displacement), the lower the "synchronization accuracy". A user can set the allowable range of time difference as a "tolerance" so that the desired synchronization accuracy can be achieved in the control system 1. Hereinafter, such a tolerance range is referred to as a "first threshold".
 図1において時刻同期を実現する構成は、例えば、ネットワーク11が産業用ネットワークのプロトコルであるTSN(Time-Sensitive Networking)に従うデータ通信を実施するケースと、ネットワーク11がEtherCAT(登録商標:Ethernet for Control Automation Technology)に従うデータ通信を実施するケースとを含み得る。なお、ネットワーク11に適用される規格は、これらに限定されず、例えばIEEE1588であってもよい。 In FIG. 1, the configuration for achieving time synchronization may include, for example, a case where the network 11 performs data communication according to TSN (Time-Sensitive Networking), which is a protocol for industrial networks, and a case where the network 11 performs data communication according to 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.
 図1を参照して、「基準タイマ」となるマスタは、基準タイマが計測する基準時刻のデータを含む時刻配信メッセージ21をネットワーク11に送信する。基準タイマは、制御装置2A,2Bおよび2Cのいずれかが有するタイマまたはネットワーク11上の他の装置(例えば、装置/ライン管理装置190)のタイマであってよく、これらタイマのうち最も高い精度のタイマに相当する。本実施の形態では、例えば、装置/ライン管理装置190はマスタとして動作する。 Referring to FIG. 1, the master that serves as the "reference timer" 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 on the network 11 (e.g., device/line management device 190), and corresponds to the timer with the highest accuracy among these timers. In this embodiment, for example, device/line management device 190 operates as the master.
 サポート装置500は、後述するサポートプログラム590を実行することにより、同期プログラムを設計するための支援ツールを提供する。ユーザは、制御システム1(または分散型システム300)の設計時に、支援ツールを操作して後述する同期アプリケーション177を設計する。同期アプリケーション177は、時刻同期処理を実施するためのプログラムと設定された第1閾値の情報とを含む。制御装置2は、サポート装置500から転送された同期アプリケーション177を実行することにより時刻同期処理を実現する。ユーザは、第1閾値を、支援ツールを操作して設定する、なお、第1閾値の設定方法は、ユーザ操作に限定されず、例えば仕様において制御システムに要求される同期精度に基づき算出されてもよい。 The support device 500 provides a support tool for designing a synchronization program by executing a support program 590 described later. When designing the control system 1 (or the distributed system 300), the user operates the support tool to design a synchronization application 177 described later. The synchronization application 177 includes a program for implementing time synchronization processing and information on the set first threshold value. The control device 2 realizes time synchronization processing by executing the synchronization application 177 transferred from the support device 500. The user sets the first threshold value by operating the support tool. Note that the method for setting the first threshold value is not limited to user operation, and may be calculated based on the synchronization accuracy required for the control system in the specifications, for example.
 時刻同期処理では、制御装置2は、時刻差の予め定められた許容範囲を示す第1閾値に基づき、当該第1閾値以上の第2閾値を取得する(ステップST1)。制御装置2は、ネットワーク11を介して受信した時刻配信メッセージ21が有する時刻情報をもとに基準時刻を推定(算出)し、推定された基準時刻と管理タイマが計測した時刻との間の時刻差を算出する(ステップST2)。このような基準時刻の推定と時刻差の算出の詳細は後述する。制御装置2は、管理タイマの時刻を、基準時刻を示すように第1補正量で補正する第1補正処理または当該管理タイマの時刻を、当該基準時刻を示すように第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施する(ステップST3)。この補正では、制御装置2は、算出される時刻差が上記の第2閾値より大きいときは第2補正処理ではなく第1補正処理を実施し、算出される時刻差が上記の第2閾値以下であるときは第1補正処理ではなく第2補正処理を実施する。 In the time synchronization process, the control device 2 acquires a second threshold value equal to or greater than the first threshold value, based on a first threshold value indicating a predetermined tolerance range of the time difference (step ST1). The control device 2 estimates (calculates) the reference time based on the time information contained in the time distribution message 21 received via the network 11, and calculates the time difference between the estimated reference time and the time measured by the management timer (step ST2). Details of the estimation of the reference time and the calculation of the time difference will be described later. The control device 2 performs either a first correction process in which the time of the management timer is corrected by a first correction amount so as to indicate the reference time, or a second correction process in which the time of the management timer is corrected by a second correction amount smaller than the first correction amount so as to indicate the reference time (step ST3). In this correction, when the calculated time difference is greater than the second threshold value, the control device 2 performs the first correction process instead of the second correction process, and when the calculated time difference is equal to or less than the second threshold value, the control device 2 performs the second correction process instead of the first correction process.
 第2補正処理は、第1補正処理で用いる第1補正量より小さい第2補正量を用いて管理タイマの時刻を徐々に変化させて基準時刻に精度良く近づける補正処理である。対照的に第1補正処理は、第2補正量より大きい第1補正量を用いて管理タイマの時刻を速やかに変化させて基準時刻に近づける補正処理である。 The second correction process is a correction process that gradually changes the time on the management timer using a second correction amount that is smaller than the first correction amount used in the first correction process to accurately approach the reference time. In contrast, the first correction process is a correction process that quickly changes the time on the management timer using a first correction amount that is larger than the second correction amount to quickly approach the reference time.
 制御装置2は、このように、時刻同期完了を判断するための第1閾値によらずに、時刻差と第2閾値の間の値の大きさの関係に応じて、補正処理を、管理タイマの時刻を徐々に変化させて基準時刻に精度良く近づける第2補正処理と管理タイマの時刻を速やかに変化させて基準時刻に近づける第1補正処理との間で切替えて実施するから、時刻同期を精度良く速やかに完了させることができる。 In this way, the control device 2 switches between the second correction process, which gradually changes the time on the management timer to bring it closer to the reference time with high precision, and the first correction process, which quickly changes the time on the management timer to bring it closer to the reference time, depending on the relationship between the magnitude of the value between the time difference and the second threshold value, without relying on the first threshold value for determining whether time synchronization is complete. This allows time synchronization to be completed quickly and accurately.
 なお、本実施の形態では、時刻差の補正は、時刻差の値を加減する「調整」の概念を表す。その場合、第1補正量または第2補正量は、加減量を表す調整量の概念を表す。 In this embodiment, the correction of the time difference represents the concept of "adjustment" to add or subtract from the value of the time difference. In this case, the first correction amount or the second correction amount represents the concept of an adjustment amount that represents the amount of addition or subtraction.
 以下、本実施の形態のより具体的な応用例について説明する。
 <B.構成と時刻同期処理>
 分散型システム300を構成する機器の構成を説明する。図2は、本実施の形態に係る制御装置2のハードウェア構成例を示すブロック図である。図3は、本実施の形態に係るサポート装置500のハードウェア構成例を示すブロック図である。
A more specific application example of this embodiment will now be described.
<B. Configuration and time synchronization processing>
The configuration of the devices constituting the distributed system 300 will be described. Fig. 2 is a block diagram showing an example of the hardware configuration of the control device 2 according to the present embodiment. Fig. 3 is a block diagram showing an example of the hardware configuration of the support device 500 according to the present embodiment.
 (b1.制御装置2の構成)
 図2を参照して、制御装置2は、プロセッサ102と、チップセット104と、二次記憶装置106と、主記憶装置108と、上位ネットワークコントローラ105と、USB(Universal Serial Bus)コントローラ107と、メモリカードインターフェイス109と、フィールドネットワークコントローラ118と、カウンタ126と、RTC(Real Time Clock)128とを含む。
(b1. Configuration of control device 2)
Referring to FIG. 2 , the control device 2 includes a processor 102, a chipset 104, a secondary memory device 106, a main memory device 108, a host network controller 105, a Universal Serial Bus (USB) controller 107, a memory card interface 109, a field network controller 118, a counter 126, and a Real Time Clock (RTC) 128.
 プロセッサ102は、CPU(Central Processing Unit)、MPU(Microprocessor unit)、GPU(Graphics Processing Unit)などで構成され、二次記憶装置106に格納された各種プログラムを読出して、主記憶装置108に展開して実行することで、制御対象に応じた制御、および、後述するような各種処理を実現する。二次記憶装置106は、例えば、HDD(Hard Disk Drive)およびSSD(Solid State Drive)などの不揮発性記憶装置などで構成される。主記憶装置108は、DRAM(Dynamic Random Access Memory)およびSRAM(Static Random Access Memory)などの揮発性記憶装置などで構成される。 The processor 102 is composed of a CPU (Central Processing Unit), MPU (Microprocessor unit), GPU (Graphics Processing Unit), etc., and reads out various programs stored in the secondary storage device 106, deploys them in the main storage device 108, and executes them to realize control according to the control target and various processes as described below. The secondary storage device 106 is composed of non-volatile storage devices such as HDD (Hard Disk Drive) and SSD (Solid State Drive). The main storage device 108 is composed of volatile storage devices such as DRAM (Dynamic Random Access Memory) and SRAM (Static Random Access Memory).
 チップセット104は、プロセッサ102と各デバイスを制御することで、制御装置2全体としての処理を実現する。 The chipset 104 controls the processor 102 and each device to realize processing for the control device 2 as a whole.
 二次記憶装置106には、時刻配信メッセージ21を配信する周期を示す通信周期データ200が格納される。二次記憶装置106には、制御対象の製造装置または設備に応じて作成されるUPG(ユーザプログラムの略)201が格納される。主記憶装置108には、時刻同期の完了または未完了を示すフラグ40が格納される。フラグ40は例えば「0」が初期値として設定されて、時刻同期完了が判定されると「1」が設定される。 The secondary storage device 106 stores communication cycle data 200 indicating the cycle for distributing the time distribution message 21. The secondary storage device 106 stores a UPG (short for user program) 201 that is created according to the manufacturing device or facility to be controlled. The main storage device 108 stores a flag 40 that indicates whether time synchronization is complete or not. For example, the flag 40 is set to "0" as the initial value, and is set to "1" when it is determined that time synchronization is complete.
 上位ネットワークコントローラ105は、ネットワーク11を接続するコネクタと、タイマ103を有するNIC(Network Interface Card)等の回路を含む。上位ネットワークコントローラ105は、上位のネットワーク11を介して、製造実行システム400またはクラウド上の装置(図1参照)などとの間のデータを遣り取りする。USBコントローラ107は、USB接続を介してサポート装置500との間のデータの遣り取りを制御する。 The upper network controller 105 includes a connector for connecting 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 the manufacturing execution system 400 or a device on the cloud (see FIG. 1) via the upper network 11. The USB controller 107 controls the exchange of data with the support device 500 via a USB connection.
 メモリカードインターフェイス109は、メモリカード116を着脱可能に構成されており、メモリカード116に対してデータを書込み、メモリカード116から各種データ(ユーザプログラムまたはトレースデータなど)を読出すことが可能になっている。 The memory card interface 109 is configured to allow the memory card 116 to be attached and detached, and is capable of writing data to the memory card 116 and reading various data (such as user programs or trace data) from the memory card 116.
 カウンタ126は、制御装置2における各種処理の実行タイミングを管理するための時刻基準として用いられる。カウンタ126は、「管理タイマ」または「基準タイマ」となり得るクロックを構成する。カウンタ126は、クロックを有し、クロックに基づいて時刻を提供する。典型的には、カウンタ126は、クロックを発生し、クロックの周期毎にカウンタ値をインクリメントまたはデクリメントする。カウンタ126のカウント値は、タイマが計測する時刻を表す。カウンタ126は、例えばプロセッサ102を駆動するシステムバス上に配置された、ハードウェアタイマーである高精度イベントタイマー(HPET:High Precision Event Timer)などを用いて実装してもよいし、あるいは、ASIC(Application Specific Integrated Circuit)またはFPGA(Field-Programmable Gate Array)などの専用回路を用いて実装してもよい。制御装置2は、タイマ103、119、91Aおよび91Bを、カウンタ126に同期させる。 The counter 126 is used as a time reference for managing the execution timing of various processes in the control device 2. The counter 126 constitutes a clock that can be a "management timer" or a "reference timer". The counter 126 has a clock and provides time based on the clock. Typically, the counter 126 generates a clock and increments or decrements the counter value for each clock period. The count value of the counter 126 represents the time measured by the timer. The counter 126 may be implemented using a hardware timer such as a High Precision Event Timer (HPET) arranged on the system bus that drives the processor 102, or may be implemented using a dedicated circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array). The control device 2 synchronizes the timers 103, 119, 91A, and 91B with the counter 126.
 RTC128は、計時機能を有する一種のカウンタであり、現在時刻をプロセッサ102などへ提供する。 The RTC 128 is a type of counter with a timekeeping function, and provides the current time to the processor 102 etc.
 フィールドネットワークコントローラ118は、ネットワーク110を介したフィールド機器90を含む他のデバイスとの間のデータの遣り取りを制御する。フィールドネットワークコントローラ118は、ネットワーク110を接続するコネクタと、他のデバイスとの間でタイミングを管理するための時刻基準として用いられるタイマ119を有する。図4では、フィールド機器90のタイマ91はタイマ91A、91B…で示される。 The field network controller 118 controls data exchange with other devices, including the field device 90, via the network 110. The field network controller 118 has a connector that connects to the network 110, and a timer 119 that is used as a time reference for managing timing with other devices. In FIG. 4, the timers 91 of the field device 90 are indicated by timers 91A, 91B, etc.
 タイマ119ならびにフィールド機器90などのデバイスが有するカウンタ(タイマ91A,91B)については、上述のカウンタ126と同様の構成を採用できる。タイマ119は、カウンタ126と同期する。 The timer 119 and the counters ( timers 91A and 91B) of devices such as the field device 90 can have a configuration similar to that of the counter 126 described above. The timer 119 is synchronized with the counter 126.
 フィールドネットワークコントローラ118は、ネットワーク110を介した定周期通信を行うための通信マスタとして機能し、フィールドバスに接続されている各デバイスが有するカウンタが示すカウンタ値とタイマ119が示すカウンタ値との差分を逐次監視して、必要に応じて、カウンタ値にずれが発生するデバイスに対して補正を指示するための同期信号を出力する。このように、フィールドネットワークコントローラ118は、デバイスのカウンタが示すカウンタ値をタイマ119が示すカウンタ値と一致させるための指令をデバイスへ与える同期管理機能を有する。 The field network controller 118 functions as a communication master for periodic communication via the network 110, and 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 make a correction, if necessary. In this way, the field network controller 118 has a synchronization management function that issues a command to the device to make the counter value indicated by the device's counter match the counter value indicated by the timer 119.
 図2には、プロセッサ102がプログラムを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASIC(Application specific Integrated Circuit)またはFPGA(Field-Programmable Gate Array)など)を用いて実装してもよい。あるいは、制御装置2の主要部を、汎用的なアーキテクチャに従うハードウェア(例えば、汎用パソコンをベースとした産業用パソコン)を用いて実現してもよい。この場合には、仮想化技術を用いて、用途の異なる複数のOS(Operating System)を並列的に実行させるとともに、各OS上で必要なアプリケーションを実行させるようにしてもよい。 FIG. 2 shows an example of a configuration in which the necessary functions are provided by the processor 102 executing a program, but some or all of these provided functions may be implemented using dedicated hardware circuits (e.g., an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array)). Alternatively, the main part of the control device 2 may be realized using hardware that follows 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 OSs (Operating Systems) with different uses in parallel, and necessary applications may be executed on each OS.
 本実施の形態に係る制御システム1においては、制御装置2およびサポート装置500が別体として構成されているが、これらの機能の全部または一部を単一の装置に集約するような構成を採用してもよい。 In the control system 1 according to this embodiment, the control device 2 and the support device 500 are configured as separate entities, but a configuration in which all or part of these functions are integrated into a single device may also be adopted.
 (b2.サポート装置500の構成)
 図3を参照してサポート装置500は、コンピュータなどの情報処理装置に相当する。サポート装置500は、携帯型および据え置き型の情報処理装置を含む。サポート装置500は、CPU(Central Processing Unit)501、DRAM(Dynamic Random Access Memory)などの揮発性の記憶装置で構成されるメモリ502、タイマ503、HDDなどの不揮発性に記憶装置で構成されるハードディスク504、入力インターフェイス505、表示コントローラ506、通信インターフェイス507、データリーダ/ライタ508を含む。これらの各部は、バス509を介して互いにデータ通信が可能なように接続されている。
(b2. Configuration of Support Device 500)
3, the support device 500 corresponds to an information processing device such as a computer. The support device 500 includes portable and stationary information processing devices. The support device 500 includes a CPU (Central Processing Unit) 501, a memory 502 configured as a volatile storage device such as a DRAM (Dynamic Random Access Memory), a timer 503, a hard disk 504 configured as a non-volatile storage device such as a HDD, an input interface 505, a display controller 506, a communication interface 507, and a data reader/writer 508. These components are connected to each other via a bus 509 so as to be able to communicate data with each other.
 入力インターフェイス505は、CPU501とキーボード510、マウス(図示せず)、タッチパネル(図示せず)などの入力装置との間のデータ伝送を仲介する。表示コントローラ506は、ディスプレイ511と接続され、CPU501における処理の結果などを表示する。通信インターフェイス507は、USBを介して制御装置2または装置/ライン管理装置190と通信する。データリーダ/ライタ508は、CPU501と外部の記憶媒体であるメモリカード512との間のデータ伝送を仲介する。 The input interface 505 mediates data transmission between the CPU 501 and input devices such as a keyboard 510, a mouse (not shown), and a touch panel (not shown). The display controller 506 is connected to a display 511 and displays the results of processing by the CPU 501. The communication interface 507 communicates with the control device 2 or the device/line management device 190 via USB. The data reader/writer 508 mediates data transmission between the CPU 501 and a memory card 512, which is an external storage medium.
 なお、図2のメモリカード116と図3のメモリカード512は、揮発性記憶媒体または不揮発性記憶媒体を含み、例えば、CF(Compact Flash:登録商標)、SD(Secure Digital)などの汎用的な半導体記憶デバイス、またはフレキシブルディスク(Flexible Disk)などの磁気記憶媒体、またはCD-ROM(Compact Disk Read Only Memory)などの光学記憶媒体を含む。 Note that memory card 116 in FIG. 2 and memory card 512 in FIG. 3 include volatile or non-volatile storage media, such as general-purpose semiconductor storage devices such as CF (Compact Flash: registered trademark) and SD (Secure Digital), magnetic storage media such as flexible disks, or optical storage media such as CD-ROMs (Compact Disk Read Only Memory).
 ハードディスク504は、サポートプログラム590、転送プログラム595およびGUI(Graphical User Interface)プログラム550を含む各種プログラムおよびデータを格納する。実行されると転送プログラム595は、サポート装置500において設計されたUPG201およびデータを、制御装置2に転送する。GUIプログラム550は、サポートプログラム590または転送プログラム595が実行されることで提供されるツールを、ユーザが操作するためのインターフェイスを提供する。 Hard disk 504 stores various programs and data, including support program 590, transfer program 595, and GUI (Graphical User Interface) program 550. When executed, transfer program 595 transfers UPG 201 and data designed in support device 500 to control device 2. GUI program 550 provides an interface for the user to operate tools provided by executing support program 590 or transfer program 595.
 (b3.制御装置2のソフトウェア構成例)
 次に、本実施の形態に係る制御システム1を構成する制御装置2のソフトウェア構成例について説明する。
(b3. Software configuration example of control device 2)
Next, an example of the software configuration of the control device 2 constituting the control system 1 according to the present embodiment will be described.
 図4は、本実施の形態に係る制御装置2のソフトウェア構成例を示すブロック図である。図4を参照して、制御装置2は、実行エンジン150と、時系列データベース180と、上位接続プログラム192と、ゲートウェイプログラム194とを含む。 FIG. 4 is a block diagram showing an example of the software configuration of the control device 2 according to this embodiment. Referring to FIG. 4, the control device 2 includes an execution engine 150, a time series database 180, a higher-level connection program 192, and a gateway program 194.
 実行エンジン150は、各種プログラムの実行環境下において各種プログラムを実行する1種のプログラムを構成する。典型的には、この実行環境は、制御装置2のプロセッサ102が、二次記憶装置106に格納されているシステムプログラムを読出して主記憶装置108に展開して実行することで提供される。 The execution engine 150 constitutes a type of program that executes various programs in an execution environment for the various programs. Typically, this execution environment is provided by the processor 102 of the control device 2 reading out a system program stored in the secondary storage device 106, expanding it into the main storage device 108, and executing it.
 より具体的には、実行エンジン150は、フィールド機器90の制御に関連する制御関連処理を実現するための制御プログラム152と、変数管理プログラム160と、プログラムの実行順序を管理するスケジューラプログラム170と、入力プログラム172と、出力プログラム174とを含む。実行エンジン150は、さらに、時刻同期処理を実現するための同期アプリケーション177を含む。制御装置2は、制御に関するサービス処理を含む各種処理を実現するためのゲートウェイプログラム194および上位接続プログラム192を含む。 More specifically, the execution engine 150 includes a control program 152 for implementing control-related processing related to the control of the field device 90, a variable management program 160, a scheduler program 170 for managing the execution order of the programs, an input program 172, and an output program 174. The execution engine 150 further includes a synchronization application 177 for implementing time synchronization processing. The control device 2 includes a gateway program 194 and an upper connection program 192 for implementing various processing including service processing related to control.
 制御プログラム152は、典型的には、データベース書込みプログラム156と、シリアライズ通信プログラム158と接続される。制御プログラム152は、実行されると、制御演算処理を実施する主たる部分に相当し、制御プログラム152は制御装置2の制御対象の製造装置または設備などに応じて任意に構成することができる。 The control program 152 is typically connected to a database writing program 156 and a serialized communication program 158. When executed, the control program 152 corresponds to the main part that performs the control calculation process, and the control program 152 can be arbitrarily configured according to the manufacturing device or facility that is the object of control by the control device 2.
 データベース書込みプログラム156は、制御プログラム152内に規定された命令によって呼び出され、時系列データベース180に対して指定されたデータを書込む。シリアライズ通信プログラム158は、データベース書込みプログラム156から時系列データベース180に対して書込まれるデータに対してシリアライズ処理を行う。ゲートウェイプログラム194は、クラウド上の装置と通信する。例えば、クラウド上のIoTサービスを提供する装置に対して、時系列データベース180の時系列データ182を提供する。データベース書込みプログラム156と、シリアライズ通信プログラム158と、ゲートウェイプログラム194とは、オプショナルな構成であってもよい。 The database writing program 156 is called by an instruction defined in the control program 152, and writes specified data to the time series database 180. The serialization communication program 158 performs serialization processing on the data written to the time series database 180 by the database writing program 156. The gateway program 194 communicates with devices on the cloud. For example, it provides time series data 182 of the time series database 180 to a device that provides an IoT service on the cloud. The database writing program 156, the serialization communication program 158, and the gateway program 194 may be optional.
 変数管理プログラム160は、実行エンジン150で利用可能な値を変数の形で管理する。より具体的には、変数管理プログラム160は、制御装置2の状態などを示すシステム変数と、制御装置2と接続されるフィールド機器90等の各種デバイスが保持する値を示すデバイス変数と、制御装置2で実行される制御プログラム152が保持する値を示すユーザ変数とを管理する。 The variable management program 160 manages values available to the execution engine 150 in the form of variables. More specifically, the variable management program 160 manages system variables indicating the state of the control device 2, device variables indicating values held by various devices such as the field equipment 90 connected to the control device 2, and user variables indicating values held by the control program 152 executed by the control device 2.
 入力プログラム172は、制御装置2と接続されるアクチュエータ、センサなどのデバイスを含むフィールド機器90からの入力データを取得する機能を提供する。出力プログラム174は、制御装置2において実行される制御プログラム152によって算出される指令値(出力データ)を、ネットワーク110を介して接続される対象のデバイスであるフィールド機器90へ出力する。本実施の形態では、時刻同期処理のために同期アプリケーション177は、制御装置2の管理タイマの時刻を補正する補正プログラム178等の各種情報を含む。 The input program 172 provides a function for acquiring input data from field devices 90, including devices such as actuators and sensors connected to the control device 2. The output program 174 outputs command values (output data) calculated by the control program 152 executed in the control device 2 to the field devices 90, which are the target devices connected via the network 110. In this embodiment, the synchronization application 177 for time synchronization processing includes various information such as a correction program 178 that corrects the time of the management timer of the control device 2.
 スケジューラプログラム170は、実行されるとスケジューラを提供する。スケジューラは、制御装置2のプロセスまたはタスクなどに対して、プロセッサ102を含むリソース割当てと実行タイミングなどを、プロセスまたはタスクに割当てられた実行の優先度に従い管理する。このような、プロセスまたはタスクは、制御プログラム152および変数管理プログラム160、入力プログラム172、出力プログラム174、および同期アプリケーション177等が制御装置2により実行されることにより生成され得るプロセスまたはタスクが含まれる。 When the scheduler program 170 is executed, it provides a scheduler. The scheduler manages resource allocation, including the processor 102, and execution timing for processes or tasks of the control device 2 according to the execution priority assigned to the process or task. Such processes or tasks include processes or tasks that can be generated by the control device 2 executing the control program 152, variable management program 160, input program 172, output program 174, and synchronization application 177, etc.
 時系列データベース180は、典型的には、主記憶装置108または二次記憶装置106に配置され、データを格納する機能とともに、外部からの要求(クエリ)に応答して、指定されたデータを応答する検索機能を搭載する。時系列データベース180は、データベース書込みプログラム156により書込まれる時系列データ182を格納する。すなわち、時系列データベース180は、入力データ、出力データ、制御プログラム152による制御演算において算出される演算データ、製造データ、イベントデータの少なくとも一部を時系列に格納する。 The time series database 180 is typically placed in the main storage device 108 or the secondary storage device 106, and has a function for storing data as well as a search function for responding to an external request (query) with specified data. The time series database 180 stores time series data 182 written by the database writing program 156. In other words, the time series database 180 stores at least a portion of the input data, output data, calculation data calculated in the control calculation by the control program 152, manufacturing data, and event data in chronological order.
 上位接続プログラム192は、製造実行システム400などの上位のネットワーク13に接続された外部装置との間でデータを遣り取りする。本実施の形態に係る制御装置2においては、制御装置2から製造実行システム400に対して入力データと演算データが出力されるとともに、製造実行システム400から製造情報を受信することができる。 The upper connection program 192 exchanges data with external devices connected to the upper network 13, such as the manufacturing execution system 400. In the control device 2 according to this embodiment, input data and calculation data are output from the control device 2 to the manufacturing execution system 400, and manufacturing information can be received from the manufacturing execution system 400.
 本実施の形態では、製造実行システム400は図1の時系列DB450を有する。この場合には、上位接続プログラム192に代えて、あるいは、上位接続プログラム192の一部として、データベース接続プログラム193(図中ではデータベースを“DB”と示す)が設けられ得る。データベース接続プログラム193が実行されることにより、制御装置2内の時系列データベース180の時系列データ182は、製造実行システム400に転送されて、時系列DB450に格納され得る。 In this embodiment, the manufacturing execution system 400 has the time series DB 450 of FIG. 1. In this case, instead of the upper connection program 192 or as part of the upper connection program 192, a database connection program 193 (database is indicated as "DB" in the figure) can be provided. By executing the database connection program 193, the time series data 182 of the time series database 180 in the control device 2 can be transferred to the manufacturing execution system 400 and stored in the time series DB 450.
 変数管理プログラム160は、入力プログラム172がフィールドから取得する入力データ(状態値)および上位接続プログラム192が製造実行システム400から取得する製造データを変数として管理する。制御プログラム152は、変数管理プログラム160により管理されるシステム変数、デバイス変数、ユーザ変数を参照しつつ、予め指定された制御演算を実行し、その実行結果(出力データ)を変数管理プログラム160に出力する。制御システム1または制御装置2は、このような状態値または出力データを、フィールドの「観測値」として収集することができる。 The variable management program 160 manages, as variables, the input data (status values) that the input program 172 acquires from the field and the manufacturing data that the upper connection program 192 acquires from the manufacturing execution system 400. The control program 152 executes a pre-specified control operation while referencing the system variables, device variables, and user variables managed by the variable management program 160, and outputs the execution results (output data) to the variable management program 160. The control system 1 or the control device 2 can collect such status values or output data as "observation values" of the field.
 (b4.同期モジュールの構成)
 図5は、本実施の形態に係る同期モジュール560の構成を模式的に示す図である。図5に示す同期モジュール560は、図5の同期アプリケーション177が実行されることによって提供される。図5を参照して、同期モジュール560は、閾値取得モジュール521、補正モジュール522、時刻差算出モジュール523を含む。同期モジュール560において、これらモジュールは単一のモジュールで構成されてもよい。
(b4. Configuration of Synchronization Module)
Fig. 5 is a diagram illustrating a schematic configuration of a synchronization module 560 according to the present embodiment. The synchronization module 560 illustrated in Fig. 5 is provided by executing the synchronization application 177 in Fig. 5. Referring to Fig. 5, the synchronization module 560 includes a threshold acquisition module 521, a correction module 522, and a time difference calculation module 523. In the synchronization module 560, these modules may be configured as a single module.
 閾値取得モジュール521は、時刻差の予め定められた許容範囲を示す第1閾値に基づき、当該第1閾値以上の値を示す第2閾値を取得する。時刻差算出モジュール523は、基準時刻と管理タイマの時刻との間の時刻差を算出する。補正モジュール522は、カウンタ126の時刻を、基準時刻を示すように第1補正量で補正する第1補正処理またはカウンタ126の時刻を、当該基準時刻を示すように第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施する。より具体的には、補正モジュール522は、算出された時刻差と第2閾値とを比較し、その比較の結果に基づき、時刻差が第2閾値より大きいと判断したときは上記の第1補正処理を実施し、時刻差が前記第2閾値以下であると判断したときは上記の第2補正処理を実施する。 The threshold acquisition module 521 acquires a second threshold indicating a value equal to or greater than a first threshold, based on a first threshold indicating a predetermined acceptable range of the time difference. The time difference calculation module 523 calculates the time difference between the reference time and the time of the management timer. The correction module 522 performs either a first correction process for correcting the time of the counter 126 by a first correction amount so that it indicates the reference time, or a second correction process for correcting the time of the counter 126 by a second correction amount smaller than the first correction amount so that it indicates the reference time. More specifically, the correction module 522 compares the calculated time difference with the second threshold, and performs the first correction process when it determines based on the result of the comparison that the time difference is greater than the second threshold, and performs the second correction process when it determines that the time difference is equal to or less than the second threshold.
 <C.時刻同期のアプリケーション>
 図6は、本実施の形態に係るアプリケーション設計の概略処理フローチャートである。図7は、図6のアプリケーション設計の環境を模式的に示す図である。サポート装置500は、サポートプログラム590を実行することにより図6のアプリケーション設計を支援する処理を実行するとともに、GUIプログラム550を実行することにより図7のUI画面51をディスプレイ511に表示させる。図7のUI画面51は、ユーザ操作を受付可能に構成されるオブジェクトを表示するウインドウ51A、51Bおよび51Cを含む。ウインドウ51Aは、制御装置2において同期アプリケーション177を起動して時刻同期処理を実行するか否かを、有効または無効で指定するユーザ操作を受付けるボタン51Dを含む。図7のボタン51Dは、例えば「有効」が指定されたことを示す。
C. Time Synchronization Applications
FIG. 6 is a schematic process flow chart of application design according to this embodiment. FIG. 7 is a diagram showing the application design environment of FIG. 6. The support device 500 executes a support program 590 to execute a process for supporting the application design of FIG. 6, and executes a GUI program 550 to display the UI screen 51 of FIG. 7 on the display 511. The UI screen 51 of FIG. 7 includes windows 51A, 51B, and 51C that display objects configured to be able to accept user operations. The window 51A includes a button 51D that accepts a user operation to specify whether or not to start the synchronization application 177 in the control device 2 and execute the time synchronization process by valid or invalid. The button 51D of FIG. 7 indicates that, for example, "valid" has been specified.
 ウインドウ51Bは、制御装置2の第1閾値を設定するためのユーザ操作を受付けるテキストボックス51Eを含む。テキストボックス51Eには、例えば500μs(マイクロ秒)が設定される。ウインドウ51Cは制御プログラム152をエディットするユーザ操作を受け付ける領域である。ウインドウ51Cのプログラムは、時刻同期が完了したか否かをフラグ40に基づき判断し、判断結果に基づき処理Aと処理Bの一方を実行する制御構造を示す。このような制御構造を表すプログラムを、以下では「制御構造プログラム51F」と呼ぶ。サポート装置500の転送プログラム595が実行されると、UI画面51で設定された情報は制御装置2に転送される。 Window 51B includes a text box 51E that accepts a user operation for setting the first threshold of the control device 2. For example, 500 μs (microseconds) is set in text box 51E. Window 51C is an area that accepts a user operation for editing the control program 152. The program in window 51C shows a control structure that judges whether time synchronization has been completed based on flag 40, and executes one of process A and process B based on the judgment result. A program that expresses such a control structure is referred to below as "control structure program 51F". When transfer program 595 of support device 500 is executed, the information set on UI screen 51 is transferred to the control device 2.
 本実施の形態では、制御プログラム152は、予め定められたプログラミング言語の仕様に従い設計される。プログラミング言語は、典型的には、国際規格IEC61131-3に規定された、LD(ラダーダイアグラム:Ladder Diagram)、IL(インストラクションリスト:Instruction List)、ST(ストラクチャードテキスト:Structured Text)、FBD(ファンクションブロックダイアグラム:Function Block Diagram)、SFC(シーケンシャルファンクションチャート:Sequential Function Chart)等の任意の言語を用いて記述することができる。 In this embodiment, the control program 152 is designed according to the specifications of a predetermined programming language. The programming language can typically be written using any language defined in the international standard IEC 61131-3, such as LD (Ladder Diagram), IL (Instruction List), ST (Structured Text), FBD (Function Block Diagram), or SFC (Sequential Function Chart).
 図6を参照して、サポート装置500は、ウインドウ51Aおよび51Bにおけるユーザ操作に基づき、時刻同期処理の有効または無効の設定と、第1閾値の設定を受け付ける(ステップS1)。サポート装置500は、ウインドウ51Cのユーザ操作に基づく制御構造プログラム51Fを受け付ける(ステップS2)。サポート装置500は、ステップS1で受け付けた情報と制御構造プログラム51Fを制御装置2に転送する(ステップS3)。制御装置2では、サポート装置500から転送された制御構造プログラム51Fは、スケジューラプログラム170によって管理されるスケジュールに従って制御周期に同期して実行される。 Referring to FIG. 6, the support device 500 accepts a setting for enabling or disabling time synchronization processing and a setting for a first threshold value based on user operations in windows 51A and 51B (step S1). The support device 500 accepts a control structure program 51F based on user operations in window 51C (step S2). The support device 500 transfers the information accepted in step S1 and the control structure program 51F to the control device 2 (step S3). In the control device 2, the control structure program 51F transferred from the support device 500 is executed in synchronization with the control period according to a schedule managed by the scheduler program 170.
 制御装置2は、サポート装置500から受信した情報に基づき、時刻同期処理の実行が「有効」に設定されたことを判定すると、ステップS4以降の時刻同期処理を開始する(ステップS4)。制御装置2は時刻同期処理によって時刻同期が完了したときフラグ40を「1」にセットする。フラグ40は、時刻同期が完了しないときは「0」を示す。 When the control device 2 determines that the execution of the time synchronization process is set to "enabled" based on the information received from the support device 500, it starts the time synchronization process from step S4 onwards (step S4). When the control device 2 completes time synchronization through the time synchronization process, it sets flag 40 to "1". When time synchronization is not completed, flag 40 indicates "0".
 制御装置2は、時刻同期処理に並行して制御構造プログラム51Fを実行する。制御構造プログラム51Fの実行において、制御装置2は、フラグ40に基づき時刻同期は完了していないと判断する間は処理Aではなく処理Bを実施し(ステップS5)、フラグ40に基づき時刻同期が完了したと判断すると(ステップS6)、処理Bではなく処理Aを実施する(ステップS7)。処理Aと処理Bの詳細は後述する。 The control device 2 executes the control structure program 51F in parallel with the time synchronization process. In executing the control structure program 51F, the control device 2 executes process B instead of process A while it determines that time synchronization is not complete based on the flag 40 (step S5), and executes process A instead of process B when it determines that time synchronization is complete based on the flag 40 (step S6) (step S7). Details of process A and process B will be described later.
 <D.時刻差の取得>
 本実施の形態では、制御装置2のスケジューラは、タスクまたはプロセスの実行の優先度を管理する。より具体的には、制御構造プログラム51Fの処理を含む制御関連処理のプロセスまたはタスクは最も高い優先度が割り当てられて、時刻同期処理とサービス処理のプロセスまたはタスクは低い優先度が割り当てられる。スケジューラは、制御周期において、プロセッサ102を、制御関連処理に最優先で割当て、制御関連処理の実行が終了すると、余りの「余裕時間」において、プロセッサ102を、優先度の低い処理に割当てる。これにより、各制御装置2では制御関連処理を制御周期内で実行することが保証されるとともに、ネットワーク11には、制御装置2間で遣り取りされるデータが優先して伝送されて、データの到達時間を保証できる。本実施の形態では制御周期の「余裕時間」には主に時刻同期処理が実行される。
<D. Obtaining the time difference>
In this embodiment, the scheduler of the control device 2 manages the priority of the execution of tasks or processes. More specifically, the highest priority is assigned to the process or task of the control-related process including the processing of the control structure program 51F, and the low priority is assigned to the process or task of the time synchronization process and the service process. The scheduler assigns the processor 102 to the control-related process with the highest priority in the control period, and when the execution of the control-related process is completed, assigns the processor 102 to the process with the low priority in the remaining "slack time". This ensures that the control-related process is executed within the control period in each control device 2, and data exchanged between the control devices 2 is transmitted preferentially to the network 11, ensuring the arrival time of the data. In this embodiment, the time synchronization process is mainly executed in the "slack time" of the control period.
 (d1.時刻差の取得の通信シーケンス)
 制御システム1では、時刻同期のために、例えばIEEE1588、IEEE802.1AS,IEEE802.1AS-Revなどの高精度時刻同期プロトコルを採用することができる。高精度時刻同期プロトコルとして、例えば、IEEE1588には、gPTP(generalized Precision Time Protocol)が規定されている。gPTPは、基準タイマであるマスタと、基準タイマに同期するタイマであるスレーブとを含む通信システムに適用され得る。gPTPでは、マスタとスレーブとの間で定期的に時刻配信メッセージ21を有したフレームを遣り取りし、その過程で得られた時刻差等の情報に基づいて、スレーブの時刻をマスタの基準時刻に合わせる補正が行なわれる。本実施の形態では、制御装置2は、時刻の補正を、基準タイマのクロック周波数と管理タイマのクロック周波数との差である周波数差に基づき算出される時刻差(以下、周波数ベース時刻差という)と、時刻配信メッセージ21が示す基準時刻のタイムスタンプに基づき算出される時刻差(以下、メッセージベース時刻差という)との両方のうちの一方を用いて実施することができる。
(d1. Communication sequence for obtaining time difference)
In the control system 1, for time synchronization, a high-precision time synchronization protocol such as IEEE1588, IEEE802.1AS, or IEEE802.1AS-Rev can be adopted. As a high-precision time synchronization protocol, for example, IEEE1588 specifies gPTP (generalized Precision Time Protocol). gPTP can be applied to a communication system including a master, which is a reference timer, and a slave, which is a timer synchronized with the reference timer. In gPTP, frames having a time distribution message 21 are periodically exchanged between the master and the slave, and the slave's time is corrected to match the master's reference time based on information such as the time difference obtained in the process. In this embodiment, the control device 2 can correct the time using either a time difference calculated based on a frequency difference, which is the difference between the clock frequency of the reference timer and the clock frequency of the management timer (hereinafter referred to as a frequency-based time difference), or a time difference calculated based on a timestamp of the reference time indicated by the time distribution message 21 (hereinafter referred to as a message-based time difference).
 周波数ベース時刻差を、図8を参照し説明する。図8は本実施の形態に係る通信シーケンスの一例を示す図である。図8は、例えばgPTPに従う通信シーケンスを示す。この通信シーケンスでは、マスタMとスレーブSとが連係することにより、マスタとスレーブとの間の時刻同期のための通信が実現される。説明を簡単にするために、マスタMは、中継器を介さずにスレーブSと通信する。 The frequency-based time difference will be explained with reference to FIG. 8. FIG. 8 is a diagram showing an example of a communication sequence according to this embodiment. FIG. 8 shows a communication sequence according to gPTP, for example. In this communication sequence, the master M and the slave S work together to realize communication for time synchronization between the master and the slave. To simplify the explanation, the master M communicates with the slave S without going through a repeater.
 図8では、スレーブS(制御装置2)は、ネットワークに接続されたマスタ装置から周期的に配信されるメッセージ(Sync)を受信する。メッセージ(Sync)は、当該マスタ装置のクロックに基づく当該メッセージの送信時刻を含む。スレーブSは、時刻差算出モジュール523として、(i)周期的に配信される各メッセージ(Sync)について、(i-1)管理タイマが計測する時刻であって当該メッセージ(Sync)を受信したときを示す第1時刻を算出し、(i-2)メッセージ(Sync)が有する送信時刻とネットワークの伝搬遅延時間とに基づき、マスタ装置のクロックが計測する時刻であって、前記マスタ装置が前記配信メッセージを送信したときを示す第2時刻を算出し、(ii)メッセージ(Sync)と当該メッセージの配信から1周期後に配信されたメッセージ(Sync)とについて、(ii-1)両メッセージの間の第1時刻の差と、当該両メッセージの間の第2時刻の差とから、マスタ装置のクロックの周波数と管理タイマのクロックの周波数との間の差を算出し、(ii-2)算出された周波数の差と上記の周期とに基づき周波数ベース時刻差を算出する。 In FIG. 8, the slave S (control device 2) receives a message (Sync) periodically distributed from a master device connected to the network. The message (Sync) includes the transmission time of the message based on the clock of the master device. The slave S, as a time difference calculation module 523, (i) for each periodically distributed message (Sync), (i-1) calculates a first time measured by the management timer and indicating when the message (Sync) was received, (i-2) calculates a second time measured by the clock of the master device and indicating when the master device transmitted the distributed message based on the transmission time of the message (Sync) and the propagation delay time of the network, (ii) for the message (Sync) and a message (Sync) delivered one cycle after the delivery of the message, (ii-1) calculates the difference between the frequency of the clock of the master device and the frequency of the clock of the management timer from the difference in the first time between the two messages and the difference in the second time between the two messages, and (ii-2) calculates a frequency-based time difference based on the calculated frequency difference and the above cycle.
 より具体的には、スレーブSは、少なくとも2回(時刻T1、T2)、マスタMから時刻配信のメッセージ(Sync)を受信する。スレーブSは各メッセージ(Sync)について、Sync受信時刻とSync推定受信時刻を保存(格納)する。Sync受信時刻は、管理タイマが計測した時刻であってメッセージ(Sync)をスレーブSが受信した時刻を示し、Sync推定受信時刻は、マスタMの基準タイマが計測したと推定される時刻であって、メッセージ(Sync)をスレーブSが受信した時刻を示す。スレーブSは、Sync推定受信時刻をgPTPスタックに従って算出する。この算出は、後述する図21に示すようにメッセージのタイムスタンプとネットワーク上のメッセージの伝搬遅延時間とに基づき算出される。 More specifically, the slave S receives a time-distributed message (Sync) from the master M at least twice (at times T1 and T2). The slave S saves (stores) the Sync reception time and the Sync estimated reception time for each message (Sync). The Sync reception time is the time measured by the management timer and indicates the time when the slave S received the message (Sync), while the Sync estimated reception time is the time estimated to have been measured by the reference timer of the master M and indicates the time when the slave S received the message (Sync). The slave S calculates the Sync estimated reception time according to the gPTP stack. This calculation is based on the message timestamp and the propagation delay time of the message on the network, as shown in FIG. 21, which will be described later.
 スレーブSはSync受信周期も算出する。スレーブSは、次のメッセージ(Sync)受信までのマスタMとの時刻差を算出する。例えば、時刻差算出モジュール523は、(時刻差=周波数差×Sync受信周期)の演算式に従って時刻差を算出(推定)する。 The slave S also calculates the Sync reception period. The slave S calculates the time difference with the master M until the next message (Sync) is received. For example, the time difference calculation module 523 calculates (estimates) the time difference according to the formula (time difference = frequency difference × Sync reception period).
 スレーブSは周波数差を、演算式((Tref_d-Tlocal_d)/(Tlocal_d))に従い算出する。Tref_dは(Tref-Trev_prev)に従い算出されて、Tlocal_dは(Tlocal-Tlocal_prev)に従って算出される。ここで、Trefは2回目のメッセージ(Sync)をスレーブSが受信したときの推定される基準時刻を示し、Tlocalは2回目のメッセージ(Sync)をスレーブSが受信したときのスレーブSの管理タイマが計測する時刻を示す。また、Tref_prevは1回目のメッセージ(Sync)をスレーブSが受信したときの推定される基準時刻を示し、Tlocal_prevは1回目のメッセージ(Sync)をスレーブSが受信したときのスレーブSの管理タイマが計測する時刻を示す。 Slave S calculates the frequency difference according to the formula ((Tref_d - Tlocal_d) / (Tlocal_d)). Tref_d is calculated according to (Tref - Trev_prev), and Tlocal_d is calculated according to (Tlocal - Tlocal_prev). Here, Tref indicates the estimated reference time when slave S receives the second message (Sync), and Tlocal indicates the time measured by slave S's management timer when slave S receives the second message (Sync). Furthermore, Tref_prev indicates the estimated reference time when slave S receives the first message (Sync), and Tlocal_prev indicates the time measured by slave S's management timer when slave S receives the first message (Sync).
 図8に示す算出によれば、例えば、スレーブSの管理時刻が20秒進んだ時にマスタMの時間軸において25秒進んだ場合、周波数差は0.25と算出される。次にスレーブSの管理時刻が20秒進むとき、当該管理時刻とマスタMの基準時刻の間の時刻差は、スレーブSの管理時刻では0.25×20秒=5秒と算出される。このように、周波数ベース時刻差は、時刻配信メッセージ21の通信周期で基準タイマと管理タイマ間のクロック周波数差が1つの原因となって生じる時刻差を示す。 According to the calculation shown in FIG. 8, for example, if the management time of slave S advances by 20 seconds and advances by 25 seconds on the time axis of master M, the frequency difference is calculated to be 0.25. Next, when the management time of slave S advances by 20 seconds, the time difference between that management time and the reference time of master M is calculated to be 0.25 x 20 seconds = 5 seconds in terms of the management time of slave S. In this way, the frequency-based time difference indicates the time difference that occurs in part due to the clock frequency difference between the reference timer and the management timer during the communication cycle of the time distribution message 21.
 次に、メッセージベース時刻差を、図21を参照し説明する。図21は、本実施の形態に係る通信シーケンスの一例を示す図である。図21はgPTPの通信シーケンスを示す。この通信シーケンスにおいても、説明を簡単にするために、マスタMは、中継器を介さずにスレーブSと通信する。 Next, the message-based time difference will be explained with reference to FIG. 21. FIG. 21 is a diagram showing an example of a communication sequence according to this embodiment. FIG. 21 shows a gPTP communication sequence. In this communication sequence, for simplicity of explanation, the master M also communicates with the slave S without going through a repeater.
 図21では、スレーブS(制御装置2)は、ネットワークに接続されたマスタMから配信されるメッセージを受信する。このような配信メッセージは、マスタMが有するクロックに基づく当該メッセージの送信時刻を含む。スレーブSは、時刻差算出モジュール523として、マスタMから受信したメッセージの送信時刻とネットワークのメッセージ伝搬遅延時間とに基づき基準時刻を算出し、そして、管理タイマが計測した当該メッセージの受信時刻と上記の算出された基準時刻との差に基づきメッセージベース時刻差を算出する。 In FIG. 21, a slave S (control device 2) receives a message distributed from a master M connected to the network. Such a distributed message includes the transmission time of the message based on the clock possessed by the master M. The slave S, as a time difference calculation module 523, calculates a reference time based on the transmission time of the message received from the master M and the message propagation delay time of the network, and calculates a message-based time difference based on the difference between the reception time of the message measured by the management timer and the calculated reference time.
 より具体的には、スレーブSは、マスタMと遣り取りするgPTPの時刻配信メッセージ21により取得したタイムスタンプ(時刻)に基づき、メッセージベース時刻差を算出(推定)する。まず、マスタMはメッセージ(Sync)とメッセージ(FollowUp)をスレーブSに転送する。メッセージ(FollowUp)は、マスタMの基準タイマで計測されたメッセージ(Sync)の送信時刻t1を示す。スレーブSは、メッセージ(フレーム)の伝搬遅延時間を取得するために、時刻t3においてメッセージ(Pdelay_Req)をマスタMに送信し、その後、マスタMからメッセージ(Pdelay_Req)に対する応答のメッセージ(Pdelay_Resp)を受信し、続いて、メッセージ(Pdelay_Resp_FollowUp)を受信する。メッセージ(Pdelay_Resp)は、マスタMがメッセージ(Pdelay_Req)を受信した時の基準タイマで計測された時刻t4を示し、メッセージ(Pdelay_Resp_FollowUp)は、マスタMがメッセージ(Pdelay_Resp)を送信した時の基準タイマで計測された時刻t5を示す。スレーブSは、メッセージを受信した時刻t2と時刻t6およびマスタMから受信した各メッセージが示すタイムスタンプに基づき、上記の伝搬遅延時間tdを(td=((t6-t3)-(t5-t4))/2)によって算出する。スレーブSは、スレーブSの管理タイマがメッセージ(Sync)を受信した時の、マスタMの基準タイマが計測した時刻、すなわち基準時刻(t1+td)を推定し、時刻差を(t2-(t1+td))に従い算出(推定)する。図21の通信シーケンスを実施することで、スレーブSは、マスタMの基準時刻を推定し、推定された基準時刻からメッセージベース時刻差を推定できる。 More specifically, the slave S calculates (estimates) the message-based time difference based on the timestamp (time) obtained from the gPTP time distribution message 21 exchanged with the master M. First, the master M transfers the message (Sync) and the message (FollowUp) to the slave S. The message (FollowUp) indicates the transmission time t1 of the message (Sync) measured by the reference timer of the master M. In order to obtain the propagation delay time of the message (frame), the slave S transmits a message (Pdelay_Req) to the master M at time t3, and then receives a message (Pdelay_Resp) in response to the message (Pdelay_Req) from the master M, and subsequently receives the message (Pdelay_Resp_FollowUp). The message (Pdelay_Resp) indicates the time t4 measured by the reference timer when the master M received the message (Pdelay_Req), and the message (Pdelay_Resp_FollowUp) indicates the time t5 measured by the reference timer when the master M sent the message (Pdelay_Resp). The slave S calculates the above-mentioned propagation delay time td by (td = ((t6-t3)-(t5-t4))/2) based on the time t2 and time t6 when the message was received and the timestamps indicated by each message received from the master M. The slave S estimates the time measured by the master M's reference timer when the slave S's management timer received the message (Sync), that is, the reference time (t1+td), and calculates (estimates) the time difference according to (t2-(t1+td)). By implementing the communication sequence of FIG. 21, the slave S can estimate the master M's reference time and estimate the message-based time difference from the estimated reference time.
 本実施の形態では、「時刻同期処理」は、図8または図21の通信シーケンスを実施して基準時刻および時刻差を推定する処理を含む。時刻同期処理は通信周期に同期して実施される。「通信周期」は、マスタMとスレーブSとの間で、同期メッセージ(メッセージ(sync))を、ネットワーク11を介して伝送するための周期を示す。より具体的には、通信周期は、マスタMがメッセージ(Sync)をスレーブSに送信する周期またはスレーブSがマスタMからメッセージ(Sync)を受信する周期を示す。各制御装置2のスケジューラは、このような通信周期に同期して、プロセッサ102を通信シーケンスに従う処理に割当てる。 In this embodiment, the "time synchronization process" includes a process of estimating the reference time and the time difference by implementing the communication sequence of FIG. 8 or FIG. 21. The time synchronization process is implemented in synchronization with a communication cycle. The "communication cycle" refers to a cycle for transmitting a synchronization message (message (sync)) between the master M and the slave S via the network 11. More specifically, the communication cycle refers to a cycle in which the master M transmits a message (Sync) to the slave S, or a cycle in which the slave S receives a message (Sync) from the master M. The scheduler of each control device 2 allocates the processor 102 to a process that follows the communication sequence in synchronization with such a communication cycle.
 本実施の形態に係る時刻同期のプロトコルはgPTPまたはPTPに限定されず、有線または無線通信の他のプロトコルを適用できる。例えば、NTP(Network Time Protocol)またはSNTP(Simple Network Time Protocol)、GPS(Global Positioning System)または同期イーサネット(登録商標)のプロトコル、CS-NMS(Clock-sampling mutual network synchronization)、RBS(Reference Broadcast Synchronization)およびRBIS(Reference Broadcast Infrastructure Synchronization)のプロトコルを適用することもできる。 The time synchronization protocol in this embodiment is not limited to gPTP or PTP, and other wired or wireless communication protocols can be applied. For example, NTP (Network Time Protocol) or SNTP (Simple Network Time Protocol), GPS (Global Positioning System) or Synchronous Ethernet (registered trademark) protocols, CS-NMS (Clock-sampling mutual network synchronization), RBS (Reference Broadcast Synchronization) and RBIS (Reference Broadcast Infrastructure Synchronization) protocols can also be applied.
 <E.補正処理>
 本実施の形態では、制御装置2は管理時刻を基準時刻に合わせるような補正として、第1補正処理に相当する位相補正または第2補正処理に相当する周波数補正を実施する。このような補正処理で扱う時刻差は、周波数ベース時刻差またはメッセージベース時刻差であって正または負の値を示す。
<E. Correction Processing>
In this embodiment, the control device 2 performs a phase correction corresponding to the first correction process or a frequency correction corresponding to the second correction process as a correction to align the management time with the reference time. The time difference handled in such a correction process is a frequency-based time difference or a message-based time difference, and indicates a positive or negative value.
 (e1.位相補正と周波数補正)
 上記に述べた検出される時刻差を、時刻差Dとして補正処理を説明する。位相補正では、時刻差Dを第1補正量として扱い、制御装置2は管理タイマの時刻に当該時刻差を加算することにより、管理タイマを速やかに基準タイマに合わせる。これに対して、周波数補正では、制御装置2は管理タイマを構成するカウンタの1回あたりの増加値を上記の時刻差Dの大きさに基づく第2補正量で調整することで、徐々に時刻差を小さくして、管理タイマを基準タイマに合わせる。例えば、時刻差Dに基づきPID(Proportional-Integral-Differential)制御の算出式に従って増加値を算出する。
(e1. Phase correction and frequency correction)
The correction process will be described with the detected time difference described above as time difference D. In phase correction, the time difference D is treated as a first correction amount, and the control device 2 adds the time difference to the time of the management timer, thereby quickly matching the management timer to the reference timer. In contrast, in frequency correction, the control device 2 adjusts the increment value per increment of the counter constituting the management timer with a second correction amount based on the magnitude of the time difference D described above, thereby gradually decreasing the time difference and matching the management timer to the reference timer. For example, the increment value is calculated based on the time difference D according to a calculation formula for PID (Proportional-Integral-Differential) control.
 または例えば、制御装置2は、時刻差DをN(N≧2)個の値に分割し、分割された値Di(i=1,2,3,…N)の各値Diを周期的に管理タイマが計測する時刻の値に第2補正量に相当する値を加算または減算(インクリメントまたはデクリメント)してもよい。これにより、加算または減算がN回繰返されて、管理タイマの時刻を、徐々に(滑らかに)変化させることができる。 Alternatively, for example, the control device 2 may divide the time difference D into N (N≧2) values, and periodically add or subtract (increment or decrement) each of the divided values Di (i=1, 2, 3, ... N) to the time value measured by the management timer by a value corresponding to the second correction amount. In this way, the addition or subtraction is repeated N times, allowing the time on the management timer to change gradually (smoothly).
 また、第1補正処理で用いる第1補正量は時刻差Dに限定されない。例えば、制御装置2は、時刻差DをM(M>N≧2)個の値に分割し、分割された値Dj(j=1,2,3,…M)の各値Djを周期的に管理タイマが計測する時刻の値に加算または減算(インクリメントまたはデクリメント)してもよい。これにより、第1補正処理では、第2補正量よりも大きい第1補正量である値の加算または減算がM回繰返されて、管理タイマの時刻を変化させることができる。 Furthermore, the first correction amount used in the first correction process is not limited to the time difference D. For example, the control device 2 may divide the time difference D into M (M>N≧2) values and periodically add or subtract (increment or decrement) each of the divided values Dj (j=1, 2, 3, ... M) to the time value measured by the management timer. In this way, in the first correction process, the addition or subtraction of a value that is the first correction amount larger than the second correction amount is repeated M times, thereby changing the time on the management timer.
 なお、NおよびMの値または値DiおよびDjは可変であってよい。例えば、これらの値は時刻差Dの大きさに基づき可変であってよい。この値DiまたはDjを用いた加算または減算の周期は、制御周期に同期してもよい。この場合には、制御システム1を、N回またはM回の制御周期をかけて徐々に時刻同期の完了状態に移行させることができる。本実施の形態では、第2補正量は第1補正量よりも小さい値とすることで、第1補正処理によって制御システム1を時刻同期完了の状態に速やかに収束させることが可能となり、第2補正処理によって制御システム1を時刻同期完了の状態に徐々に近づけることで精度良く収束させることが可能となる。 The values of N and M or the values Di and Dj may be variable. For example, these values may be variable based on the magnitude of the time difference D. The period of addition or subtraction using the value Di or Dj may be synchronized with the control period. In this case, the control system 1 can be gradually transitioned to a time synchronization completion state over N or M control periods. In this embodiment, the second correction amount is set to a value smaller than the first correction amount, so that the first correction process can quickly converge the control system 1 to a time synchronization completion state, and the second correction process can gradually bring the control system 1 closer to the time synchronization completion state, allowing for accurate convergence.
 <F.時刻同期処理のフローチャート>
 制御装置2が実施する時刻同期処理について、位相補正または周波数補正が実施されるケースを説明する。図9は、本実施の形態に係る時刻同期処理のフローチャートである。図9を参照して、制御装置2は、起動すると、サポート装置500から受信した情報に基づき、時刻同期処理が有効かを判定し(ステップS10)、有効でないと判定すると(ステップS10でNO)処理を終了するが、有効と判定すると(ステップS10でYES)、ステップS11に移行する。
<F. Flowchart of time synchronization process>
A case where phase correction or frequency correction is performed in the time synchronization process performed by the control device 2 will be described. Fig. 9 is a flowchart of the time synchronization process according to this embodiment. Referring to Fig. 9, when the control device 2 is started, it determines whether the time synchronization process is valid based on the information received from the support device 500 (step S10). If it is determined that the time synchronization process is not valid (NO in step S10), the process ends, but if it is determined that the time synchronization process is valid (YES in step S10), the process proceeds to step S11.
 制御装置2は、サポート装置500から受信した情報から第1閾値を取得し(ステップS11)、時刻差を算出する(ステップS13)。より具体的には、制御装置2は、時刻配信メッセージ21を2回以上受信するかを判定し(ステップS12)、2回以上受信していないと判定すると(ステップS12でNO)、ステップS12を繰り返すが、時刻配信メッセージ21を2回以上受信したと判定すると(ステップS12でYES)、制御装置2は、時刻差を算出する(ステップS13)。ステップS13では、例えば周波数ベース時刻差が算出される。制御装置2は、第1閾値以上の値を示す第2閾値を取得し設定する(ステップS14、S15)。第2閾値の取得の詳細は後述する。 The control device 2 acquires a first threshold value from the information received from the support device 500 (step S11) and calculates the time difference (step S13). More specifically, the control device 2 determines whether the time distribution message 21 has been received two or more times (step S12). If it is determined that the time distribution message 21 has not been received two or more times (NO in step S12), the control device 2 repeats step S12, but if it is determined that the time distribution message 21 has been received two or more times (YES in step S12), the control device 2 calculates the time difference (step S13). In step S13, for example, a frequency-based time difference is calculated. The control device 2 acquires and sets a second threshold value indicating a value equal to or greater than the first threshold value (steps S14, S15). The acquisition of the second threshold value will be described in detail later.
 制御装置2は、時刻補正を開始するために補正モジュール522を起動する(ステップS16)。 The control device 2 activates the correction module 522 to start time correction (step S16).
 制御装置2は、時刻配信メッセージ21を受信するかを判定する(ステップS17)。時刻配信メッセージ21を受信しないと判定される(ステップS17でNO)間は、ステップS17を繰り返すが、時刻配信メッセージ21を受信したと判定すると(ステップS17でYES)、時刻差を算出する(ステップS18)。ステップS18では、例えば周波数ベース時刻差とメッセージベース時刻差が算出される。 The control device 2 determines whether to receive the time distribution message 21 (step S17). While it is determined that the time distribution message 21 has not been received (NO in step S17), step S17 is repeated, but when it is determined that the time distribution message 21 has been received (YES in step S17), the time difference is calculated (step S18). In step S18, for example, the frequency-based time difference and the message-based time difference are calculated.
 制御装置2は、ステップS18で算出された周波数ベース時刻差と第1閾値とを比較し、比較の結果に基づき、周波数ベース時刻差が第1閾値以下であるとの条件が一定期間継続して満たされるかを判定する(ステップS19)。ステップS18とS19では、制御装置2は、管理タイマが周期的に出力する時刻のそれぞれについて、周波数ベース時刻差を算出し、このように算出された各時刻差について上記の条件が満たされる期間が一定期間継続するか否かを判定する。 The control device 2 compares the frequency-based time difference calculated in step S18 with a first threshold value, and determines, based on the result of the comparison, whether the condition that the frequency-based time difference is less than or equal to the first threshold value continues to be satisfied for a certain period of time (step S19). In steps S18 and S19, the control device 2 calculates the frequency-based time difference for each of the times periodically output by the management timer, and determines whether the period during which the above condition is satisfied for each time difference calculated in this way continues for a certain period of time.
 上記の条件が満たされる状態が一定期間継続したと判定されると(ステップS19でYES)、制御装置2は時刻同期が完了したことを示すようフラグ40に「1」を設定し(ステップS20)、ステップS21に移行する。一方、上記の条件が満たされる状態が一定期間継続しないと判定されると(ステップS19でNO)、制御装置2はステップS20の処理を実行せずに、ステップS21に移行する。 If it is determined that the state in which the above conditions are satisfied has continued for a certain period of time (YES in step S19), the control device 2 sets flag 40 to "1" to indicate that time synchronization has been completed (step S20), and proceeds to step S21. On the other hand, if it is determined that the state in which the above conditions are satisfied has not continued for a certain period of time (NO in step S19), the control device 2 proceeds to step S21 without executing the processing in step S20.
 ステップS21では、制御装置2はステップS18とS19において算出された複数の周波数ベース時刻差の代表となる時刻差を第2閾値と比較し、比較結果に基づき、当該代表の時刻差が第2閾値以上かを判定する(ステップS21)。この代表の時刻差は、ステップS18とS19において算出された複数の周波数ベース時刻差の平均値、最頻値、中央値、最新値等を含む。 In step S21, the control device 2 compares a representative time difference of the multiple frequency-based time differences calculated in steps S18 and S19 with a second threshold value, and determines whether the representative time difference is equal to or greater than the second threshold value based on the comparison result (step S21). This representative time difference includes the average value, mode, median, latest value, etc. of the multiple frequency-based time differences calculated in steps S18 and S19.
 制御装置2は、代表の時刻差は第2閾値以上であるか否かを判定し、判定結果に基づき、ステップS18とステップS19で算出されたメッセージベース時刻差を用いて補正処理を実施する。より具体的には、制御装置2は、代表の時刻差は第2閾値以上であると判定すると(ステップS21でYES)位相補正処理を実施し(ステップS22)、代表の時刻差は第2閾値以上でない、すなわち第2閾値未満であると判定すると(ステップS21でNO)周波数補正処理を実施する(ステップS23)。その後、ステップS17に戻る。 The control device 2 determines whether the representative time difference is equal to or greater than the second threshold, and performs correction processing using the message-based time difference calculated in steps S18 and S19 based on the determination result. More specifically, if the control device 2 determines that the representative time difference is equal to or greater than the second threshold (YES in step S21), it performs phase correction processing (step S22), and if the control device 2 determines that the representative time difference is not equal to or greater than the second threshold, i.e., is less than the second threshold (NO in step S21), it performs frequency correction processing (step S23). Then, it returns to step S17.
 図9の処理では、制御装置2は時刻同期が完了したと判定した場合(ステップS19でYES)、常に時刻差は第2閾値以下を示すと判定し(ステップS21でNO)周波数補正(ステップS23)を実施する。このように、制御装置2において時刻同期が完了した状態では(ステップS19でYES)、補正処理が実施されるとしても周波数補正が実施されて位相補正処理は実施されないので、管理タイマの「時刻の後戻り」が生じることはない。本実施の形態では、管理タイマの時刻が基準時刻より進んでいる場合に、管理タイマの時刻に時刻差を加算する位相補正処理を実施すると、管理タイマの時刻の変動量が大きいために管理タイマの時刻が過去の時刻に戻ることがある。このようなケースを「時刻の後戻り」という。周波数補正処理では、時刻差を徐々に小さくするよう管理タイマの時刻を補正するので「時刻の後戻り」を生じさせることなく、管理タイマを精度良く時刻同期の完了状態に収束させることができ、その後は、時刻同期が完了した状態を維持することが可能となる。 9, when the control device 2 determines that time synchronization is complete (YES in step S19), it always determines that the time difference is equal to or less than the second threshold (NO in step S21) and performs frequency correction (step S23). In this way, when time synchronization is complete in the control device 2 (YES in step S19), even if a correction process is performed, frequency correction is performed and phase correction is not performed, so that "time backtracking" of the management timer does not occur. In this embodiment, when the time of the management timer is ahead of the reference time, if a phase correction process is performed to add the time difference to the time of the management timer, the time of the management timer may go back to an earlier time because the fluctuation amount of the time of the management timer is large. Such a case is called "time backtracking". In the frequency correction process, the time of the management timer is corrected to gradually reduce the time difference, so that the management timer can be converged to a time synchronization completion state with high accuracy without causing "time backtracking", and it is possible to maintain the time synchronization completion state thereafter.
 (f1.第2閾値の取得)
 図10~図13は、本実施の形態に係る第2閾値の取得を説明する図である。ステップS14およびステップS15で第2閾値を取得する仕組みを説明する。
(f1. Obtaining the second threshold)
10 to 13 are diagrams for explaining how the second threshold value is obtained according to the present embodiment. The mechanism for obtaining the second threshold value in steps S14 and S15 will be explained.
 まず、閾値取得モジュール521は、例えば、周波数ベース時刻差を用いた算出式に従い第2閾値を算出する第1算出モジュールを含む。第1算出モジュールによって、図9のステップS14では、制御装置2は、ステップS13で算出された周波数ベース時刻差を用いて第2閾値を取得する。より具体的には、制御装置2は、第2閾値を(第2閾値=時刻差×A)の式に従い算出する。ただし、係数Aは(A>1)の条件を満たす。例えば、A=1の場合に算出される第2閾値はステップS21の条件が満たされて位相補正を繰り返すことになることを回避するために(A>1)の条件が要求される。また、第2閾値が極端な値となることを防止するために(第2閾値≦上限値X)の条件を満たすことが要求される。また、「時刻の後戻り」を防止するために(第2閾値≧第1閾値)の条件を満たすことが要求される。値Aと値Xは、実験等に基づき設定される。 First, the threshold acquisition module 521 includes a first calculation module that calculates the second threshold according to a calculation formula using the frequency-based time difference, for example. In step S14 of FIG. 9, the control device 2 acquires the second threshold using the frequency-based time difference calculated in step S13 by the first calculation module. More specifically, the control device 2 calculates the second threshold according to the formula (second threshold = time difference x A). However, the coefficient A satisfies the condition (A > 1). For example, the second threshold calculated when A = 1 requires the condition (A > 1) to avoid the condition of step S21 being satisfied and phase correction being repeated. In addition, the second threshold is required to satisfy the condition (second threshold ≦ upper limit value X) to prevent an extreme value from being set. In addition, the condition (second threshold ≧ first threshold) is required to be satisfied to prevent "time backtracking". The values A and X are set based on experiments, etc.
 図14は、本実施の形態に係る時刻同期処理の他のフローチャートである。図14では、図9のフローチャートからステップS12およびS13の処理が省略されているが、他の処理は図9と同じであるから説明は繰り返さない。図14のステップS14では、制御装置2は、ユーザが設定した第1閾値に基づき第2閾値を取得する。 FIG. 14 is another flowchart of the time synchronization process according to the present embodiment. In FIG. 14, steps S12 and S13 are omitted from the flowchart in FIG. 9, but the other steps are the same as in FIG. 9 and therefore will not be described again. In step S14 in FIG. 14, the control device 2 obtains a second threshold value based on a first threshold value set by the user.
 閾値取得モジュール521は、第1閾値と予め定められた値の間の大きさの関係を取得し、この関係および第1閾値を用いた算出式に従い、第2閾値を算出する第2算出モジュール含む。例えば、制御装置2は、第1閾値が予め定められた値未満であるとの関係性が取得された場合と、第1閾値が当該予め定められた値以上であるとの関係性が取得された場合とで、第2閾値を異ならせる。例えば、図12のウインドウ51Bにおいて第1閾値は設定される。制御装置2は、図13のプロセスに示すように、第1閾値が1ms(ミリ秒)未満であるときは第2閾値に1msを設定し、第1閾値が1ms以下である場合は第2閾値に(第1閾値×2)の値を設定する。この設定方法であれば、第2閾値が第1閾値よりも小さくなりすぎることで位相補正が繰り返し実施されるようなケースを回避できる。また、第2閾値が極端な値となることを防止するために(第2閾値≦上限値X)の条件を満たすことが要求される。 The threshold acquisition module 521 includes a second calculation module that acquires the relationship between the magnitude of the first threshold and a predetermined value, and calculates the second threshold according to the relationship and a calculation formula using the first threshold. For example, the control device 2 sets the second threshold differently when the relationship is acquired that the first threshold is less than a predetermined value and when the relationship is acquired that the first threshold is equal to or greater than the predetermined value. For example, the first threshold is set in the window 51B of FIG. 12. As shown in the process of FIG. 13, when the first threshold is less than 1 ms (millisecond), the control device 2 sets the second threshold to 1 ms, and when the first threshold is 1 ms or less, sets the second threshold to a value of (first threshold x 2). With this setting method, it is possible to avoid a case where the second threshold becomes too small compared to the first threshold, causing repeated phase correction. In addition, in order to prevent the second threshold from becoming an extreme value, it is required to satisfy the condition (second threshold ≦ upper limit value X).
 他の方法として、第1算出モジュールまたは第2算出モジュールの算出に代えて、閾値取得モジュール521はLUT(look Up table)を利用して第2閾値を取得するよう構成されてもよい。より具体的には、制御装置2は、図10のUI画面のウインドウ51Bの複数の値のうちからユーザが選択した値を第1閾値として取得し、制御装置2は、当該第1閾値に基づき図11のテーブル44から第2閾値を検索する。テーブル44は制御装置2に予め格納される。テーブル44は、第1閾値と第2閾値の組を表す複数のレコードが登録される。第1閾値と第2閾値の組合わせは実験等により取得される。例えば、ウインドウ51Bにおいて第1閾値が選択された場合に、図11では、テーブル44からレコードR1の第2閾値が検索される。なお、テーブル44の第2閾値は、少なくとも第1閾値以上であるとの条件、および、上記に述べた上限値Xの条件を満たす。 As another method, instead of the calculation by the first calculation module or the second calculation module, the threshold acquisition module 521 may be configured to acquire the second threshold using a look up table (LUT). More specifically, the control device 2 acquires a value selected by the user from among the multiple values in the window 51B of the UI screen in FIG. 10 as the first threshold, and the control device 2 searches the table 44 in FIG. 11 for the second threshold based on the first threshold. The table 44 is stored in advance in the control device 2. In the table 44, multiple records representing combinations of the first threshold and the second threshold are registered. The combinations of the first threshold and the second threshold are acquired by experiments or the like. For example, when the first threshold is selected in the window 51B, the second threshold of the record R1 is searched for in the table 44 in FIG. 11. Note that the second threshold in the table 44 satisfies the condition that it is at least equal to or greater than the first threshold and the condition of the upper limit value X described above.
 図22は、本実施の形態に係る時刻差と第2閾値の関係を模式的に示すグラフである。このグラフの縦軸は、時刻差の値がとられ、横軸は経過時間がとられる。図22で説明される時刻差は、周波数ベース時刻差またはメッセージベース時刻差を示す。時刻差D3は、ステップS14で第2閾値を算出(推定)するために取得された時刻差を示す。図22では、一点鎖線で示す第2閾値と、グラフ221および222とが示される。一点鎖線で示す第2閾値は、制御装置2がステップS14で(第2閾値=時刻差D3×A、ただしA=5)に従い算出(推定)した値を示す。グラフ221は、ステップS14で第2閾値を算出(推定)するために取得した時刻差D3をベースにした場合の第2閾値の変化、すなわち(D3×A(ただし、Aの値を1,2,3,4,5と変化させた場合))の式で算出される値の変化を表す。また、グラフ222は、制御装置2が当該周期SYに同期してステップS18で算出(推定)する時刻差の変化を表す。 FIG. 22 is a graph showing a schematic relationship between the time difference and the second threshold in this embodiment. The vertical axis of this graph shows the time difference value, and the horizontal axis shows the elapsed time. The time difference described in FIG. 22 shows the frequency-based time difference or the message-based time difference. The time difference D3 shows the time difference obtained to calculate (estimate) the second threshold in step S14. FIG. 22 shows the second threshold shown by a dashed line and graphs 221 and 222. The second threshold shown by a dashed line shows the value calculated (estimated) by the control device 2 in step S14 according to (second threshold = time difference D3 x A, where A = 5). Graph 221 shows the change in the second threshold when based on the time difference D3 obtained to calculate (estimate) the second threshold in step S14, that is, the change in the value calculated by the formula (D3 x A (where A is changed to 1, 2, 3, 4, 5)). Additionally, graph 222 represents the change in the time difference calculated (estimated) by the control device 2 in step S18 in synchronization with the period SY.
 図22では、位相補正が実施された直後の時刻T1では、時刻差は0(ゼロ)であって、制御装置2の管理タイマは基準タイマに同期した状態である。この状態では、時刻差D3は、第2閾値より小さいはずなので、制御装置2は、当該位相補正の直後から、数回分の周期SYの長さに相当する期間TTの間(時刻T2~時刻T7)は周波数補正を実施する。すなわち、位相補正を実施直後の時刻差が0(ゼロ)の状態から次の位相補正を実施するまでの間(期間TT)は、複数回の周波数補正の実施が可能となる。このような周波数補正が実施されることで、グラフ222が示す時刻差が大きくなるスピードは時間が経過するに従いゆるやかになる。期間TTの経過後において、制御装置2は、時刻差が一点鎖線で示す第2閾値を超えたとことを判定し、当該判定に応じて位相補正を実施する。 In FIG. 22, at time T1 immediately after the phase correction, the time difference is 0 (zero), and the control timer of the control device 2 is synchronized with the reference timer. In this state, the time difference D3 should be smaller than the second threshold, so the control device 2 performs frequency correction for a period TT (time T2 to time T7) that corresponds to the length of several cycles SY immediately after the phase correction. In other words, during the period TT from when the time difference is 0 (zero) immediately after the phase correction until the next phase correction is performed, multiple frequency corrections can be performed. By performing such frequency corrections, the speed at which the time difference shown in graph 222 increases becomes slower as time passes. After the period TT has elapsed, the control device 2 determines that the time difference has exceeded the second threshold indicated by the dashed line, and performs phase correction in accordance with this determination.
 また、図22のケースとは異なり第2閾値は(第2閾値=時刻差D3×A、ただしA=1)に設定されるケースを想定すると、当該ケースでは、時刻T1で位相補正が実施された直後にメッセージ(Sync)を受信した時の時刻T2で時刻差が第2閾値を超える可能性がある。そのため、制御装置2は時刻T2で位相補正を実施する。このようなケースでは、位相補正が繰返し実施されることになるため、「時刻の後戻り」を生じさせる可能性が高く、時刻差が収束しない可能性がある。 Furthermore, assuming a case in which the second threshold is set to (second threshold = time difference D3 x A, where A = 1) unlike the case in FIG. 22, in that case, there is a possibility that the time difference will exceed the second threshold at time T2 when a message (Sync) is received immediately after phase correction is performed at time T1. Therefore, the control device 2 performs phase correction at time T2. In such a case, since phase correction is performed repeatedly, there is a high possibility that "time regression" will occur and the time difference may not converge.
 <G.具体的なケース>
 本実施の形態では、制御装置2は、周波数ベース時刻差に基づき第2閾値を設定する。この場合、制御装置2は、周波数ベース時刻差の大きさに応じて第2閾値を変更して、位相補正と周波数補正を切替るための第2閾値を、第1閾値または周波数ベース時刻差の大きさに応じて変更することができる。
<G. Specific Cases>
In this embodiment, the control device 2 sets the second threshold based on the frequency-based time difference. In this case, the control device 2 changes the second threshold according to the magnitude of the frequency-based time difference, and can change the second threshold for switching between phase correction and frequency correction according to the first threshold or the magnitude of the frequency-based time difference.
 図15~図20は本実施の形態に係る第2閾値が可変に設定されることによる利点を説明するグラフである。図15、図16および図17は、本実施の形態とは異なり第2閾値を固定としたケースを示す。これらケースでは、第2閾値が固定値であるため、第2閾値の大きさ、または、第1閾値と第2閾値の値の大きさの関係が要因となって、時刻同期の完了までに時間を要する。図15では、第2閾値は第1閾値に比べて大きすぎるために、位相補正が実施された後もメッセージベース時刻差は大きい状態のままであるが、そのような状態で周波数補正が開始されるので、時刻同期の完了までに長時間を要する。図16では、第2閾値が小さすぎるために、メッセージベース時刻差が小さい状態でも位相補正のみが繰り返し実施され、その結果、時刻同期の完了までに長時間を要する。図17では、第2閾値は(第2閾値<第1閾値)の関係性を有するために、時刻同期が完了した後の時刻同期中においても位相補正が実施される。その結果、「時刻の後戻り」が生じる可能性が高い。 Figures 15 to 20 are graphs that explain the advantages of setting the second threshold to a variable value according to this embodiment. Figures 15, 16, and 17 show cases where the second threshold is fixed, unlike this embodiment. In these cases, since the second threshold is a fixed value, it takes time to complete time synchronization due to the magnitude of the second threshold or the relationship between the magnitude of the first threshold and the second threshold. In Figure 15, the second threshold is too large compared to the first threshold, so the message-based time difference remains large even after phase correction is performed, but frequency correction is started in such a state, so it takes a long time to complete time synchronization. In Figure 16, the second threshold is too small, so only phase correction is repeatedly performed even when the message-based time difference is small, and as a result, it takes a long time to complete time synchronization. In Figure 17, since the second threshold has a relationship of (second threshold < first threshold), phase correction is performed even during time synchronization after time synchronization is completed. As a result, there is a high possibility that "time backwards" will occur.
 これに対して図18、図19および図20は、第2閾値を固定ではなく周波数時刻差の大きさに応じて変更するケースを示す。図18は、図15のケースにおいて第2閾値を周波数ベース時刻差に基づき設定する場合を示す。より具体的には、図18では、第1閾値に比べて第2閾値に大きすぎない値が設定されるので、位相補正と周波数補正とを組み合わせて実施可能となり、図15のケースに比べて時刻同期の完了までに要する時間を短くできる。図19は、図16のケースにおいて第2閾値を周波数ベース時刻差に基づき設定する場合を示す。より具体的には、図19では、第1閾値に比べて第2閾値は大きすぎず、且つ小さすぎない値が設定されるので、位相補正と周波数補正とを組み合わせて実施可能となり、図15または図16のケースに比べて時刻同期の完了までに要する時間を短くできる。図20は、図17のケースにおいて第2閾値を周波数ベース時刻差に基づき設定する場合を示す。より具体的には、図20では、第2閾値は(第1閾値=第2閾値)の関係を有するよう設定されるので、図17で示したような「時刻の後戻り」を防止できる。 In contrast, Figs. 18, 19, and 20 show cases in which the second threshold is not fixed but is changed according to the magnitude of the frequency-time difference. Fig. 18 shows a case in which the second threshold is set based on the frequency-based time difference in the case of Fig. 15. More specifically, in Fig. 18, a value that is not too large compared to the first threshold is set for the second threshold, so that phase correction and frequency correction can be combined and implemented, and the time required to complete time synchronization can be shortened compared to the case of Fig. 15. Fig. 19 shows a case in which the second threshold is set based on the frequency-based time difference in the case of Fig. 16. More specifically, in Fig. 19, a value that is not too large and not too small compared to the first threshold is set for the second threshold, so that phase correction and frequency correction can be combined and implemented, and the time required to complete time synchronization can be shortened compared to the case of Fig. 15 or Fig. 16. Fig. 20 shows a case in which the second threshold is set based on the frequency-based time difference in the case of Fig. 17. More specifically, in FIG. 20, the second threshold is set to have the relationship (first threshold = second threshold), which makes it possible to prevent "time going backwards" as shown in FIG. 17.
 <H.制御構造プログラムの処理例>
 制御構造プログラム51Fが実行されると、制御装置2は制御関連処理を実施する。例えば、この制御関連処理は、制御装置2は時系列DB450に格納するために、製造実行システム400にクエリを発行する処理を含む。このクエリは、時系列にデータを格納するためにデータベース操作言語(SQL:Structured Query Language)に従っている。データには、制御装置2が収集した観測値および各観測値に対応付けられるタイムスタンプとして管理時刻が含まれる。各制御装置2において時刻同期が完了した場合、各制御装置2からのタイムスタンプは互いに同期した時刻を示す。したがって、製造実行システム400は時系列DB450において、タイムスタンプに基づき、観測されたタイミングを一致させて各制御装置2からの観測値の時系列データを集約(すなわち、統合)することができる。このように集約されたデータを用いれば、観測値の解析が容易になる。
<H. Example of Processing of Control Structure Program>
When the control structure program 51F is executed, the control device 2 performs control-related processing. For example, this control-related processing includes processing in which the control device 2 issues a query to the manufacturing execution system 400 in order to store the data in the time-series DB 450. This query follows a database manipulation language (SQL: Structured Query Language) in order to store data in a time series. The data includes the observed values collected by the control device 2 and the management time as a timestamp associated with each observed value. When time synchronization is completed in each control device 2, the timestamps from each control device 2 indicate the time synchronized with each other. Therefore, the manufacturing execution system 400 can aggregate (i.e., integrate) the time-series data of the observed values from each control device 2 in the time-series DB 450 by matching the observed timing based on the timestamp. Using the data aggregated in this way makes it easier to analyze the observed values.
 これに対して、制御装置2において時刻同期が完了していない場合、各制御装置2のタイムスタンプの時刻は同期していないので、製造実行システム400は時系列DB450において観測値の時系列データを集約したとしても、集約されたデータを観測時刻に基づき解析することはできない。 In contrast, if time synchronization has not been completed in the control device 2, the time stamps of each control device 2 will not be synchronized, and even if the manufacturing execution system 400 aggregates the time series data of observed values in the time series DB 450, it will not be possible to analyze the aggregated data based on the observation time.
 制御構造プログラム51Fの処理Aは時刻同期が完了したときに実施される処理を含む。より具体的には、処理Aでは、制御装置2は管理タイマが出力する時刻のタイムスタンプと観測値を有した時系列データを生成し、製造実行システム400に送信する。処理Bは、時刻同期が完了していないときに実施される処理を含む。より具体的には、処理Bでは、制御装置2は処理Aを実行しない。または、処理Bでは、制御装置2はタイムスタンプと観測値と「時刻同期未完了」の識別子を有した時系列データを生成し、製造実行システム400に送信する。 Process A of the control structure program 51F includes a process that is performed when time synchronization is complete. More specifically, in process A, the control device 2 generates time series data having a timestamp and an observation value of the time output by the management timer, and transmits it to the manufacturing execution system 400. Process B includes a process that is performed when time synchronization is not complete. More specifically, in process B, the control device 2 does not execute process A. Alternatively, in process B, the control device 2 generates time series data having a timestamp, an observation value, and an identifier of "time synchronization not complete", and transmits it to the manufacturing execution system 400.
 このように、時刻同期処理において設定されるフラグ40を、制御構造プログラム51Fの実行時に制御装置2が参照することで、上記のように時刻同期が未完了であるときに実施する制御関連処理を、時刻同期が完了したときに実施する制御関連処理とは異ならせることができる。なお、フラグ40に基づき実行される処理Aと処理Bは、上記に述べた製造実行システム400への観測値の転送に限定されない。 In this way, by the control device 2 referring to the flag 40 set in the time synchronization process when executing the control structure program 51F, it is possible to differentiate the control-related process that is performed when time synchronization is incomplete as described above from the control-related process that is performed when time synchronization is complete. Note that the processes A and B that are performed based on the flag 40 are not limited to the transfer of observed values to the manufacturing execution system 400 described above.
 上記に述べた時刻同期処理では、第2閾値は周波数ベース時刻差に基づき設定されたが第2閾値はメッセージベース時刻差に基づき設定されてもよい。また、上記に述べた時刻補正処理に用いる補正量はメッセージベース時刻差に基づき設定されるが、補正量は周波数ベース時刻差に基づき設定されてもよい。なお、このような設定の仕方は、gPTPの時刻補正を、周波数ベース時刻差を用いた時刻補正に限定するものではない。 In the time synchronization process described above, the second threshold was set based on the frequency-based time difference, but the second threshold may also be set based on the message-based time difference. Also, the correction amount used in the time correction process described above is set based on the message-based time difference, but the correction amount may also be set based on the frequency-based time difference. Note that this method of setting does not limit gPTP time correction to time correction using the frequency-based time difference.
 <I.プログラム>
 制御装置2のプロセッサ102は、二次記憶装置106のプログラムを実行することにより、上記に述べた時刻同期の処理および制御関連処理または方法を実現する。
<I. Program>
The processor 102 of the control device 2 executes the programs in the secondary storage device 106 to realize the time synchronization process and the control-related processes or methods described above.
 これら処理を実現するために実行されるプログラムおよびデータは、外部装置から二次記憶装置106にダウンロードされてもよい。より具体的には、メモリカード116から、メモリカードインターフェイス109を介してダウンロードされる、または、ネットワークに接続される外部装置から上位ネットワークコントローラ105を介してダウンロードされる。 The programs and data executed to realize these processes 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.
 サポート装置500のCPU501は、ユーザに対し支援ツールを提供する。ハードディスク504には支援ツールを実現するためのプログラムおよびデータなどを記憶し得る。支援ツールを実現するためのプログラムおよびデータは、通信インターフェイス507および各種通信回線を介してハードディスク504にダウンロードされてもよい。または、メモリカード512を介してハードディスク504にダウンロードされるとしてもよい。 The CPU 501 of the support device 500 provides the support tool to the user. The hard disk 504 may store programs and data for implementing the support tool. The programs and data for implementing the support tool may be downloaded to the hard disk 504 via the communication interface 507 and various communication lines. Alternatively, they may be downloaded to the hard disk 504 via the memory card 512.
 メモリカード116またはメモリカード512は、コンピュータその他装置、機械等が記録されたプログラム等の情報を読み取り可能なように、当該プログラム等の情報を、電気的、磁気的、光学的、機械的または化学的作用によって蓄積する媒体である。 Memory card 116 or memory card 512 is a medium that stores information such as a program through electrical, magnetic, optical, mechanical, or chemical action so that the information can be read by a computer or other device or machine.
 <J.付記>
 上述したような本実施の形態は、以下のような技術思想を含む。
[構成1]
 FA(ファクトリオートメーション)の制御装置(2)であって、
 ネットワーク(11)を接続するコネクタ(105)と、
 タイマ(126)と、
 対象の制御に関連する処理を実施する制御処理部(152)と、
 時刻同期の処理を実施する時刻同期処理部(560)と、を備え、
 前記時刻同期処理部は、
 基準時刻と前記タイマが計測した時刻との間の時刻差を算出する時刻差算出部(523)と、
 前記時刻差の許容範囲を示す第1閾値以上である第2閾値を取得する閾値取得部(521)と、
 前記タイマの時刻を、前記基準時刻を示すように第1補正量で補正する第1補正処理(S22)または当該タイマの時刻を、前記基準時刻を示すように前記第1補正量よりも小さい第2補正量で補正する第2補正処理(S23)の一方を実施する補正部(522)と、を含み、
 前記補正部は、
 前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施する、制御装置。
[構成2]
 前記タイマの時刻は、当該タイマが有するクロックに基づいた時刻を示し、
 前記基準時刻は、前記ネットワークに接続されるマスタ装置のクロックに基づいた時刻を示し、
 前記時刻差算出部は、前記タイマのクロックの周波数と前記マスタ装置のクロックの周波数の差に基づき前記時刻差を算出する、構成1に記載の制御装置。
[構成3]
 前記制御装置は、前記ネットワークに接続されたマスタ装置から配信されるメッセージ(21)を受信する通信部を、さらに備え、
 前記マスタ装置からの配信メッセージは、当該マスタ装置のマスタクロックに基づく当該メッセージの送信時刻を含み、
 前記時刻差算出部は、
  前記マスタ装置から受信した前記配信メッセージの前記送信時刻と前記ネットワークの伝搬遅延時間とに基づき前記基準時刻を算出し、
  前記タイマが計測した前記配信メッセージの受信時刻と算出された前記基準時刻との差に基づき前記時刻差を算出する、構成1または2に記載の制御装置。
[構成4]
 前記時刻同期処理部は、
 前記時刻差が前記第1閾値以下であることの同期条件が満たされるか否かを判定し、
 前記補正部は、前記同期条件が満たされたことの判定に応じて、前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施する、構成1から3のいずれか1に記載の制御装置。
[構成5]
 前記閾値取得部は、
 前記時刻差を用いた算出式に従い前記第2閾値を算出する、構成1から4のいずれか1に記載の制御装置。
[構成6]
 前記閾値取得部は、
 前記第1閾値と予め定められた値の間の大きさの関係および前記第1閾値を用いた算出式に従い、前記第2閾値を算出する、構成1~5のいずれか1に記載の制御装置。
[構成7]
 前記第1補正処理は、
 前記タイマの時刻を前記第1補正量で補正する処理を、M回(ただし、M≧2)繰り返し、
 前記第1補正量は、前記時刻差の値をM個に分割した値に基づく補正量を含む、構成1~6のいずれか1に記載の制御装置。
[構成8]
 前記第2補正処理は、
 前記タイマの時刻を前記第2補正量で補正する処理を、N回(ただし、N≧2)繰り返し、
 前記第2補正量は、前記時刻差の値をN個に分割した値に基づく補正量を含む、構成1~7のいずれか1に記載の制御装置。
[構成9]
 前記時刻同期処理部は、前記時刻差が前記第1閾値以下であることの同期条件が満たされるか否かを判定し、
 前記対象の制御に関連する処理は、前記同期条件が満たされと判定されたときに実施される第1処理と、当該同期条件が満たされと判定されたことに応じて実施される処理であって前記第1処理とは異なる第2処理を含む、構成1~8のいずれか1に記載の制御装置。
[構成10]
 前記第1処理は、前記対象の制御に関連した観測値と観測されたタイミングを示す前記タイマの時刻を有するデータの収集処理を含む、構成9に記載の制御装置。
[構成11]
 FA(ファクトリオートメーション)の制御システムであって、構成1~10のいずれか1に記載の複数の制御装置を備える制御システム。
[構成12]
 FA(ファクトリオートメーション)の制御装置(2)が実施する方法であって、
 前記制御装置は、ネットワーク(11)を接続するコネクタ(105)と、タイマ(126)とを備え、
 前記方法は、
 対象の制御に関連する処理を実施すること、および
 時刻同期の処理を実施すること、を備え、
 前記時刻同期の処理を実施することは、
 基準時刻と前記タイマが計測した時刻との間の時刻差を算出すること、
 前記時刻差の許容範囲を示す第1閾値以上である第2閾値を取得すること、
 前記タイマの時刻を、前記基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、前記基準時刻を示すように前記第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施すること、を含み、
 前記一方を実施することは、
 前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施することを含む、方法。
[構成13]
 FA(ファクトリオートメーション)の制御装置(2)のプロセッサ(102)に方法を実施させるためのプログラム(177)であって、
 前記制御装置は、ネットワーク(11)を接続するコネクタ(105)と、タイマ(126)を備え、
 前記方法は、
 対象の制御に関連する処理を実施すること、および
 時刻同期の処理を実施すること、を備え、
 前記時刻同期の処理を実施することは、
 基準時刻と前記タイマが計測した時刻との間の時刻差を算出すること、
 前記時刻差の許容範囲を示す第1閾値以上である第2閾値を取得すること、
 前記タイマの時刻を、前記基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、前記基準時刻を示すように前記第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施すること、を含み、
 前記一方を実施することは、
 前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施することを含む、プログラム。
<J. Notes>
The present embodiment as described above includes the following technical idea.
[Configuration 1]
A control device (2) for FA (factory automation),
A connector (105) for connecting to a network (11);
A timer (126);
A control processing unit (152) that performs processing related to the control of the target;
A time synchronization processing unit (560) that performs a time synchronization process;
The time synchronization processing unit
A time difference calculation unit (523) that calculates a time difference between a reference time and a time measured by the timer;
a threshold acquisition unit (521) that acquires a second threshold that is equal to or greater than a first threshold indicating an allowable range of the time difference;
a correction unit (522) that performs one of a first correction process (S22) that corrects the time of the timer by a first correction amount so that the time indicates the reference time, and a second correction process (S23) that corrects the time of the timer by a second correction amount smaller than the first correction amount so that the time indicates the reference time,
The correction unit is
A control device that performs the first correction process when the time difference is equal to or greater than the second threshold value, and performs the second correction process when the time difference is less than the second threshold value.
[Configuration 2]
the time of the timer indicates a time based on a clock included in the timer,
the reference time indicates a time based on a clock of a master device connected to the network,
2. The control device according to configuration 1, wherein the time difference calculation unit calculates the time difference based on a difference between a clock frequency of the timer and a clock frequency of the master device.
[Configuration 3]
The control device further includes a communication unit for receiving a message (21) delivered from a master device connected to the network,
a broadcast message from the master device including a transmission time of the message based on a master clock of the master device;
The time difference calculation unit
Calculating the reference time based on the transmission time of the delivery message received from the master device and a propagation delay time of the network;
3. The control device according to configuration 1 or 2, wherein the time difference is calculated based on a difference between a reception time of the delivery message measured by the timer and the calculated reference time.
[Configuration 4]
The time synchronization processing unit
determining whether a synchronization condition is satisfied, that is, the time difference is equal to or smaller than the first threshold value;
A control device described in any one of configurations 1 to 3, wherein the correction unit performs the first correction process when the time difference is greater than or equal to the second threshold value, and performs the second correction process when the time difference is less than the second threshold value, depending on whether the synchronization condition is satisfied.
[Configuration 5]
The threshold acquisition unit
The control device according to any one of configurations 1 to 4, wherein the control device calculates the second threshold value according to a calculation formula using the time difference.
[Configuration 6]
The threshold acquisition unit
The control device according to any one of configurations 1 to 5, wherein the second threshold value is calculated according to a calculation formula using a magnitude relationship between the first threshold value and a predetermined value and the first threshold value.
[Configuration 7]
The first correction process includes:
Repeating the process of correcting the time of the timer by the first correction amount M times (where M≧2);
The control device according to any one of configurations 1 to 6, wherein the first correction amount includes a correction amount based on a value obtained by dividing the value of the time difference into M parts.
[Configuration 8]
The second correction process includes:
Repeating the process of correcting the time of the timer by the second correction amount N times (N≧2);
The control device according to any one of configurations 1 to 7, wherein the second correction amount includes a correction amount based on a value obtained by dividing the value of the time difference by N.
[Configuration 9]
The time synchronization processing unit determines whether or not a synchronization condition that the time difference is equal to or less than the first threshold is satisfied;
The control device according to any one of configurations 1 to 8, wherein the processing related to the control of the target includes a first processing that is performed when it is determined that the synchronization condition is satisfied, and a second processing that is performed in response to it being determined that the synchronization condition is satisfied and is different from the first processing.
[Configuration 10]
10. The control device of configuration 9, wherein the first process includes a process of collecting data having observed values related to control of the object and times of the timer indicative of observed timing.
[Configuration 11]
A factory automation (FA) control system comprising a plurality of control devices according to any one of configurations 1 to 10.
[Configuration 12]
A method implemented by a control device (2) of a factory automation (FA), comprising:
The control device includes a connector (105) for connecting to a network (11) and a timer (126);
The method comprises:
performing a process related to the control of the target; and performing a process of time synchronization;
The execution of the time synchronization process includes:
Calculating a time difference between a reference time and a time measured by the timer;
obtaining a second threshold value that is equal to or greater than the first threshold value and indicates an acceptable range of the time difference;
performing one of a first correction process for correcting the time of the timer by a first correction amount so as to indicate the reference time, and a second correction process for correcting the time of the timer by a second correction amount smaller than the first correction amount so as to indicate the reference time;
The implementation of one of the above
performing the first correction process when the time difference is equal to or greater than the second threshold, and performing the second correction process when the time difference is less than the second threshold.
[Configuration 13]
A program (177) for causing a processor (102) of a control device (2) for FA (factory automation) to execute a method,
The control device includes a connector (105) for connecting to a network (11) and a timer (126);
The method comprises:
performing a process related to the control of the target; and performing a process of time synchronization;
The execution of the time synchronization process includes:
Calculating a time difference between a reference time and a time measured by the timer;
obtaining a second threshold value that is equal to or greater than the first threshold value and indicates an acceptable range of the time difference;
performing one of a first correction process for correcting the time of the timer by a first correction amount so as to indicate the reference time, and a second correction process for correcting the time of the timer by a second correction amount smaller than the first correction amount so as to indicate the reference time;
The implementation of one of the above
The program includes: performing the first correction process when the time difference is equal to or greater than the second threshold; and performing the second correction process when the time difference is less than the second threshold.
 今回開示された実施の形態は全ての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内での全ての変更が含まれることが意図される。 The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present invention is indicated by the claims, not by the above description, and is intended to include all modifications within the meaning and scope of the claims.
 1 制御システム 2,2A,2B,2C 制御装置、3A,3B,3C 工程、11,12,13,14,110 ネットワーク、21 時刻配信メッセージ、40 フラグ、44 テーブル、51 画面、51A,51B,51C ウインドウ、51D ボタン、51E テキストボックス、51F 制御構造プログラム、90 フィールド機器、91,91A,91B,103,119,503 タイマ、102 プロセッサ、104 チップセット、105 上位ネットワークコントローラ、106 二次記憶装置、107 コントローラ、108 主記憶装置、109 メモリカードインターフェイス、116,512 メモリカード、118 フィールドネットワークコントローラ、126 カウンタ、150 実行エンジン、152 制御プログラム、156 データベース書込みプログラム、158 シリアライズ通信プログラム、160 変数管理プログラム、170 スケジューラプログラム、172 入力プログラム、174 出力プログラム、177 同期アプリケーション、178 補正プログラム、180 時系列データベース、182 時系列データ、190 ライン管理装置、192 上位接続プログラム、193 データベース接続プログラム、194 ゲートウェイプログラム、200 通信周期データ、280 表示装置、300 分散型システム、380 製造管理装置、400 製造実行システム、500 サポート装置、502 メモリ、504 ハードディスク、505 入力インターフェイス、506 表示コントローラ、507 通信インターフェイス、510 キーボード、511 ディスプレイ、521 閾値取得モジュール、522 補正モジュール、523 時刻差算出モジュール、560 同期モジュール、590 サポートプログラム、595 転送プログラム。 1 Control system 2, 2A, 2B, 2C Control device 3A, 3B, 3C Process 11, 12, 13, 14, 110 Network 21 Time distribution message 40 Flag 44 Table 51 Screen 51A, 51B, 51C Window 51D Button 51E Text box 51F Control structure program 90 Field equipment 91, 91A, 91B, 103, 119, 503 Timer 102 Processor 104 chip set, 105 upper network controller, 106 secondary storage device, 107 controller, 108 main storage device, 109 memory card interface, 116, 512 memory card, 118 field network controller, 126 counter, 150 execution engine, 152 control program, 156 database writing program, 158 serialized communication program, 160 variable management management program, 170 scheduler program, 172 input program, 174 output program, 177 synchronization application, 178 correction program, 180 time series database, 182 time series data, 190 line management device, 192 upper connection program, 193 database connection program, 194 gateway program, 200 communication cycle data, 280 display device, 300 distributed system, 380 manufacturing management device, 400 manufacturing execution system, 500 support device, 502 memory, 504 hard disk, 505 input interface, 506 display controller, 507 communication interface, 510 keyboard, 511 display, 521 threshold acquisition module, 522 correction module, 523 time difference calculation module, 560 synchronization module, 590 support program, 595 transfer program.

Claims (13)

  1.  FA(ファクトリオートメーション)の制御装置であって、
     ネットワークを接続するコネクタと、
     タイマと、
     対象の制御に関連する処理を実施する制御処理部と、
     時刻同期の処理を実施する時刻同期処理部と、を備え、
     前記時刻同期処理部は、
     基準時刻と前記タイマが計測した時刻との間の時刻差を算出する時刻差算出部と、
     前記時刻差の許容範囲を示す第1閾値以上である第2閾値を取得する閾値取得部と、
     前記タイマの時刻を、前記基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、前記基準時刻を示すように前記第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施する補正部と、を含み、
     前記補正部は、
     前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施する、制御装置。
    A control device for FA (factory automation),
    A connector for connecting a network;
    A timer;
    A control processing unit that performs processing related to the control of the target;
    A time synchronization processing unit that performs a time synchronization process,
    The time synchronization processing unit
    a time difference calculation unit that calculates a time difference between a reference time and a time measured by the timer;
    a threshold acquisition unit that acquires a second threshold that is equal to or greater than a first threshold and indicates an allowable range of the time difference;
    a correction unit that performs one of a first correction process that corrects the time of the timer by a first correction amount so that the time of the timer indicates the reference time, and a second correction process that corrects the time of the timer by a second correction amount smaller than the first correction amount so that the time of the timer indicates the reference time,
    The correction unit is
    A control device that performs the first correction process when the time difference is equal to or greater than the second threshold value, and performs the second correction process when the time difference is less than the second threshold value.
  2.  前記タイマの時刻は、当該タイマが有するクロックに基づいた時刻を示し、
     前記基準時刻は、前記ネットワークに接続されるマスタ装置のクロックに基づいた時刻を示し、
     前記時刻差算出部は、前記タイマのクロックの周波数と前記マスタ装置のクロックの周波数の差に基づき前記時刻差を算出する、請求項1に記載の制御装置。
    the time of the timer indicates a time based on a clock included in the timer,
    the reference time indicates a time based on a clock of a master device connected to the network,
    The control device according to claim 1 , wherein the time difference calculation unit calculates the time difference based on a difference between a clock frequency of the timer and a clock frequency of the master device.
  3.  前記制御装置は、前記ネットワークに接続されたマスタ装置から配信されるメッセージを受信する通信部を、さらに備え、
     前記マスタ装置からの配信メッセージは、当該マスタ装置のマスタクロックに基づく当該メッセージの送信時刻を含み、
     前記時刻差算出部は、
      前記マスタ装置から受信した前記配信メッセージの前記送信時刻と前記ネットワークの伝搬遅延時間とに基づき前記基準時刻を算出し、
      前記タイマが計測した前記配信メッセージの受信時刻と算出された前記基準時刻との差に基づき前記時刻差を算出する、請求項1に記載の制御装置。
    The control device further includes a communication unit that receives a message delivered from a master device connected to the network,
    a broadcast message from the master device including a transmission time of the message based on a master clock of the master device;
    The time difference calculation unit
    Calculating the reference time based on the transmission time of the delivery message received from the master device and a propagation delay time of the network;
    The control device according to claim 1 , wherein the time difference is calculated based on a difference between a reception time of the distribution message measured by the timer and the calculated reference time.
  4.  前記時刻同期処理部は、
     前記時刻差が前記第1閾値以下であることの同期条件が満たされるか否かを判定し、
     前記補正部は、前記同期条件が満たされたことの判定に応じて、前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施する、請求項1~3のいずれか1項に記載の制御装置。
    The time synchronization processing unit
    determining whether a synchronization condition is satisfied, that is, the time difference is equal to or smaller than the first threshold value;
    A control device as described in any one of claims 1 to 3, wherein the correction unit performs the first correction process when the time difference is greater than or equal to the second threshold value, and performs the second correction process when the time difference is less than the second threshold value, depending on whether the synchronization condition is satisfied.
  5.  前記閾値取得部は、
     前記時刻差を用いた算出式に従い前記第2閾値を算出する、請求項1~3のいずれか1項に記載の制御装置。
    The threshold acquisition unit
    The control device according to claim 1 , wherein the second threshold value is calculated according to a calculation formula that uses the time difference.
  6.  前記閾値取得部は、
     前記第1閾値と予め定められた値の間の大きさの関係および前記第1閾値を用いた算出式に従い、前記第2閾値を算出する、請求項1~3のいずれか1項に記載の制御装置。
    The threshold acquisition unit
    The control device according to any one of claims 1 to 3, wherein the second threshold value is calculated according to a calculation formula using a magnitude relationship between the first threshold value and a predetermined value and the first threshold value.
  7.  前記第1補正処理は、
     前記タイマの時刻を前記第1補正量で補正する処理を、M回(ただし、M≧2)繰り返し、
     前記第1補正量は、前記時刻差の値をM個に分割した値に基づく補正量を含む、請求項1~3のいずれか1項に記載の制御装置。
    The first correction process includes:
    Repeating the process of correcting the time of the timer by the first correction amount M times (where M≧2);
    4. The control device according to claim 1, wherein the first correction amount includes a correction amount based on a value obtained by dividing the value of the time difference into M parts.
  8.  前記第2補正処理は、
     前記タイマの時刻を前記第2補正量で補正する処理を、N回(ただし、N≧2)繰り返し、
     前記第2補正量は、前記時刻差の値をN個に分割した値に基づく補正量を含む、請求項1~3のいずれか1項に記載の制御装置。
    The second correction process includes:
    Repeating the process of correcting the time of the timer by the second correction amount N times (N≧2);
    4. The control device according to claim 1, wherein the second correction amount includes a correction amount based on a value obtained by dividing the value of the time difference by N.
  9.  前記時刻同期処理部は、前記時刻差が前記第1閾値以下であることの同期条件が満たされるか否かを判定し、
     前記対象の制御に関連する処理は、前記同期条件が満たされと判定されたときに実施される第1処理と、当該同期条件が満たされと判定されたことに応じて実施される処理であって前記第1処理とは異なる第2処理を含む、請求項1~3のいずれか1項に記載の制御装置。
    The time synchronization processing unit determines whether or not a synchronization condition that the time difference is equal to or less than the first threshold is satisfied;
    The control device according to any one of claims 1 to 3, wherein the processing related to the control of the target includes a first processing that is performed when it is determined that the synchronization condition is satisfied, and a second processing that is performed in response to it being determined that the synchronization condition is satisfied and is different from the first processing.
  10.  前記第1処理は、前記対象の制御に関連した観測値と観測されたタイミングを示す前記タイマの時刻を有するデータの収集処理を含む、請求項9に記載の制御装置。 The control device according to claim 9, wherein the first process includes a process of collecting data having an observed value related to the control of the object and a time of the timer indicating the observed timing.
  11.  FA(ファクトリオートメーション)の制御システムであって、請求項1~3のいずれか1項に記載の複数の制御装置を備える制御システム。 A factory automation (FA) control system comprising a plurality of control devices according to any one of claims 1 to 3.
  12.  FA(ファクトリオートメーション)の制御装置が実施する方法であって、
     前記制御装置は、ネットワークを接続するコネクタと、タイマとを備え、
     前記方法は、
     対象の制御に関連する処理を実施すること、および
     時刻同期の処理を実施すること、を備え、
     前記時刻同期の処理を実施することは、
     基準時刻と前記タイマが計測した時刻との間の時刻差を算出すること、
     前記時刻差の許容範囲を示す第1閾値以上である第2閾値を取得すること、
     前記タイマの時刻を、前記基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、前記基準時刻を示すように前記第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施すること、を含み、
     前記一方を実施することは、
     前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施することを含む、方法。
    A method implemented by a control device of a factory automation (FA), comprising:
    The control device includes a connector for connecting a network and a timer;
    The method comprises:
    performing a process related to the control of the target; and performing a process of time synchronization;
    The execution of the time synchronization process includes:
    Calculating a time difference between a reference time and a time measured by the timer;
    obtaining a second threshold value that is equal to or greater than the first threshold value and indicates an acceptable range of the time difference;
    performing one of a first correction process for correcting the time of the timer by a first correction amount so as to indicate the reference time, and a second correction process for correcting the time of the timer by a second correction amount smaller than the first correction amount so as to indicate the reference time;
    The implementation of one of the above
    performing the first correction process when the time difference is equal to or greater than the second threshold, and performing the second correction process when the time difference is less than the second threshold.
  13.  FA(ファクトリオートメーション)の制御装置のプロセッサに方法を実施させるためのプログラムであって、
     前記制御装置は、ネットワークを接続するコネクタと、タイマを備え、
     前記方法は、
     対象の制御に関連する処理を実施すること、および
     時刻同期の処理を実施すること、を備え、
     前記時刻同期の処理を実施することは、
     基準時刻と前記タイマが計測した時刻との間の時刻差を算出すること、
     前記時刻差の許容範囲を示す第1閾値以上である第2閾値を取得すること、
     前記タイマの時刻を、前記基準時刻を示すように第1補正量で補正する第1補正処理または当該タイマの時刻を、前記基準時刻を示すように前記第1補正量よりも小さい第2補正量で補正する第2補正処理の一方を実施すること、を含み、
     前記一方を実施することは、
     前記時刻差が前記第2閾値以上であるとき前記第1補正処理を実施し、前記時刻差が前記第2閾値未満であるとき前記第2補正処理を実施することを含む、プログラム。
    A program for causing a processor of a control device for FA (factory automation) to execute a method,
    The control device includes a connector for connecting a network and a timer,
    The method comprises:
    performing a process related to the control of the target; and performing a process of time synchronization;
    The execution of the time synchronization process includes:
    Calculating a time difference between a reference time and a time measured by the timer;
    obtaining a second threshold value that is equal to or greater than the first threshold value and indicates an acceptable range of the time difference;
    performing one of a first correction process for correcting the time of the timer by a first correction amount so as to indicate the reference time, and a second correction process for correcting the time of the timer by a second correction amount smaller than the first correction amount so as to indicate the reference time;
    The implementation of one of the above
    The program includes: performing the first correction process when the time difference is equal to or greater than the second threshold; and performing the second correction process when the time difference is less than the second threshold.
PCT/JP2024/002831 2023-02-01 2024-01-30 Control device, control system, method, and program WO2024162337A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2023013969A JP2024109258A (en) 2023-02-01 2023-02-01 Control device, control system, method, and program
JP2023-013969 2023-02-01

Publications (1)

Publication Number Publication Date
WO2024162337A1 true WO2024162337A1 (en) 2024-08-08

Family

ID=92146946

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2024/002831 WO2024162337A1 (en) 2023-02-01 2024-01-30 Control device, control system, method, and program

Country Status (2)

Country Link
JP (1) JP2024109258A (en)
WO (1) WO2024162337A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000215188A (en) * 1999-01-27 2000-08-04 Fuji Electric Co Ltd Network controller
WO2014199729A1 (en) * 2013-06-12 2014-12-18 富士電機株式会社 Distribution device, distribution system, and distribution method
JP2017022526A (en) * 2015-07-09 2017-01-26 株式会社東芝 Time synchronization client and protection system
WO2021002421A1 (en) * 2019-07-04 2021-01-07 オムロン株式会社 Control system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000215188A (en) * 1999-01-27 2000-08-04 Fuji Electric Co Ltd Network controller
WO2014199729A1 (en) * 2013-06-12 2014-12-18 富士電機株式会社 Distribution device, distribution system, and distribution method
JP2017022526A (en) * 2015-07-09 2017-01-26 株式会社東芝 Time synchronization client and protection system
WO2021002421A1 (en) * 2019-07-04 2021-01-07 オムロン株式会社 Control system

Also Published As

Publication number Publication date
JP2024109258A (en) 2024-08-14

Similar Documents

Publication Publication Date Title
JP7484912B2 (en) Control System
US7904184B2 (en) Motion control timing models
US7983769B2 (en) Time stamped motion control network protocol that enables balanced single cycle timing and utilization of dynamic data structures
JP6962099B2 (en) Control system and control device
WO2015128981A1 (en) Programmable controller system and controller therefor
KR101636496B1 (en) Signal synchronization system, node synchronization system, signal synchronization method, and node synchronization method
Lesi et al. Towards plug-n-play numerical control for reconfigurable manufacturing systems
WO2022185589A1 (en) Information processing device, method, and program
US20130013951A1 (en) Method for Synchronizing an Operating Clock with a Time Clock of an Automation Network
EP3851925B1 (en) A synchronised control system
US12105551B2 (en) Control system
WO2024162337A1 (en) Control device, control system, method, and program
EP4020104A1 (en) Control system, control device, and program
CN113711511B (en) Industrial equipment supporting multi-time synchronization protocol
WO2023026431A1 (en) Communication control device, communication control method and program
CN112564841A (en) Method for controlling equipment with different communication protocols in mode of synchronizing clocks
US12140932B2 (en) Industrial device supporting multiple time synchronization protocols
WO2024079892A1 (en) Data collecting apparatus, data collecting system, database creating method and program
CN117792558B (en) Method, apparatus, device and medium for integrating high precision time
CN117200927A (en) MCU clock synchronous control system based on CAN network
CN116184920A (en) Multi-PLC controller instruction output high-precision synchronization method based on soft timer

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24750286

Country of ref document: EP

Kind code of ref document: A1