Controller, time synchronization method and device control system
Through the synergy of the controller clock management unit and the flag management unit, the controller clock and the global clock are gradually synchronized, and the local device is notified through periodic communication, which solves the problem of inconsistent time management in the device control system and achieves the stability and synchronization of the system time.
Patent Information
- Application Number
- CN202210155769.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-02-26
- Filing Date
- 2022-02-21
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-02-21
Smart Images

Figure CN114967524B_ABST
Abstract
Description
Technical Field
[0001] One aspect of the present disclosure relates to a controller, a device control system, a time synchronization method, and a time synchronization program. Background Art
[0002] Japanese Patent No. 4840455 discloses a field control system that synchronizes and executes calculations for controlling field devices and data communications with the field devices at a timing according to a timer clock based on a network time. Summary of the Invention
[0003] In one aspect of the present disclosure, a mechanism for uniformly managing time in a system is desired.
[0004] A controller according to one aspect of the present disclosure includes: a controller clock management unit, configured to receive global time data indicating a global time associated with an external global clock, synchronize a controller clock inside the controller with the global clock based on the global time, and set the controller time based on the synchronized controller clock; and a notification unit, configured to send the controller time data indicating the controller time to at least one local device through periodic communication.
[0005] A time synchronization method according to one aspect of the present disclosure includes: receiving global time data indicating a global time associated with an external global clock; synchronizing a controller clock inside a controller with the global clock based on the global time; setting a controller time based on the synchronized controller clock; and sending the controller time data indicating the controller time to at least one local device through periodic communication.
[0006] According to one aspect of the present disclosure, a computer-readable storage medium stores processor-executable instructions, wherein the processor-executable instructions are used to: receive global time data indicating a global time associated with an external global clock; synchronize a controller clock inside a controller with the global clock based on the global time; set a controller time based on the synchronized controller clock; and send the controller time data indicating the controller time to at least one local device through periodic communication.
[0007] According to one aspect of the present disclosure, time in a system can be managed in a unified manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 is a diagram showing the overall configuration of an example device control system.
[0009] Figure 2is a diagram illustrating a functional configuration of an example device control system.
[0010] Figure 3 is a diagram illustrating the hardware configuration of an example computer used in the example device control system.
[0011] Figure 4 is a sequence diagram illustrating an example process of time synchronization in a device control system.
[0012] Figure 5 is a flow chart illustrating an example process for correcting controller time.
[0013] Figure 6 is a diagram illustrating a functional configuration of another example device control system.
[0014] Figure 7 is a timing diagram illustrating an example process of time synchronization in a master controller. DETAILED DESCRIPTION
[0015] In the following description with reference to the accompanying drawings, the same reference numerals are assigned to the same components or similar components having the same functions, and repeated descriptions are omitted.
[0016] System Overview
[0017] Figure 1 is a diagram illustrating the overall configuration of a device control system 1 according to some examples. Device control system 1 is a mechanism for controlling local devices 3 placed in an actual work environment (i.e., on-site). In some examples, device control system 1 includes at least one main controller 10 and at least one local device 3. Each main controller 10 sends commands to at least one local device 3 to control the local device 3. One main controller 10 corresponds to at least one local device 3. Multiple main controllers 10 can correspond to one local device 3.
[0018] The device control system 1 may include various types of local devices 3 . Figure 1A mobile robot 4, a stationary robot 5, an NC machine tool 6, an environmental sensor 7, and a conveyor 8 are shown as examples of local devices 3. The mobile robot 4 is a robot capable of autonomous movement. In some examples, the mobile robot 4 includes an automated guided vehicle (AGV) that autonomously moves according to movement commands, and a robot that performs work on a workpiece according to work commands. For example, the AGV may be an electric AGV. The stationary robot 5 is a robot fixed to a work environment (e.g., a floor). Both the mobile robot 4 and the stationary robot 5 may be a 6-axis vertical multi-jointed robot, a 7-axis redundant robot with an additional axis joint, a so-called scalar joint robot, or a so-called parallel link robot. In some examples, both the mobile robot 4 and the stationary robot 5 have an end portion to which a tool corresponding to the processing purpose is attached. Examples of tools include a suction nozzle, a manipulator, a processing tool, and a welding gun. The NC machine tool 6 is a device that performs processing (e.g., cutting) on a workpiece according to a processing command. The environmental sensor 7 is a device that acquires information about the work environment according to a sensing command. For example, the environmental sensor 7 may be a camera that captures images of the work environment or a temperature sensor that captures the temperature of the work environment. The conveyor 8 is a device that transports the workpiece according to a transport command. Examples of the conveyor 8 include a belt conveyor and a roller conveyor.
[0019] In some examples, each local device 3 includes a device body 20 that performs the primary functions of the local device 3, and a local controller 30 that controls the device body 20. The local controller 30 controls the device body 20 based on commands from the main controller 10 and sends responses to the commands to the main controller 10. In this example, the local controller 30 is a component of the local device 3. As another example, the local controller 30 itself may exist as a local device 3 in the device control system 1. The local controller 30 that controls the mobile robot 4 or the stationary robot 5 is also referred to as a robot controller.
[0020] In some examples, the device control system 1 synchronizes the time between each host controller 10 and each local device 3 to operate each local device 3 based on periodic communication. When periodic communication is used, the host controller 10 outputs commands at a given period, and the local device 3 operates based on the commands in that period. The local device 3 outputs a response to the host controller 10 during that period, and the host controller 10 receives the response during that period.
[0021] In some examples, the device control system 1 obtains global time based on an external global clock Cg and performs time synchronization based on the global time. By using the global time, the device control system 1 can manage the time in the system in a unified manner, for example, control each local device 3 based on a unique time. In some examples, the main controller 10 is connected to a time server 9 having a global clock Cg via a first communication network Na and obtains the global time from the time server 9. The main controller 10 and the local device 3 are connected to each other through a second communication network Nb and perform communication and control based on the synchronized time according to the global time. Various methods (such as the Precision Time Protocol (PTP) and the Generalized PTP (gPTP)) can be adopted to achieve time synchronization in the device control system 1. The main controller 10 can obtain the global time through a device or method other than the time server 9.
[0022] Both the first communication network Na and the second communication network Nb can be a wired network, a wireless network or a combination thereof. Both the first communication network Na and the second communication network Nb can be constructed in such a way that at least a portion thereof includes a mobile communication system. In some examples, the first communication network Na and the second communication network Nb are networks that adopt aperiodic communication. In this example, the device control system 1 utilizes the second communication network Nb (i.e., aperiodic communication) to perform synchronization processing between the main controller 10 and the local device 3, and also implements periodic communication. Periodic communication refers to a communication method that performs information communication at regular time intervals according to a predetermined format. On the other hand, aperiodic communication refers to a communication method that does not require determining the timing of data communication.
[0023] In some examples, the device control system 1 includes a mechanism for reducing the impact of fluctuations (error levels) in the global time on time synchronization in the device control system 1. Even if the fluctuations are greater than a given reference value, the mechanism can reduce the impact of the fluctuations on time synchronization in the device control system 1. In some examples, applying a controller according to one aspect of the present disclosure to the main controller 10 can synchronize the time in the device control system 1 with the global time while absorbing the fluctuations.
[0024] In this disclosure, a clock refers to a mechanism that continuously indicates various points in the flow of time, either discretely or continuously. A timer that indicates the passage of time is a clock. Time is a value that indicates a point in the flow of time. Time can be indicated in common units (such as hours, minutes, or seconds), or it can be indicated by another method (such as a counter value or a calendar value (system time)). In this disclosure, for example, "clock-based time" refers to the time indicated by a clock.
[0025] Main controller configuration
[0026] Figure 2is a diagram showing a functional configuration of the device control system 1. In this example, a local controller 30 is shown as at least a part of the local device 3.
[0027] In some examples, the main controller 10 has an internal clock called a controller clock Cr for time synchronization.In some examples, the main controller 10 includes a controller clock management unit 11 and a notification unit 12 as functional modules.
[0028] The controller clock management unit 11 is a functional module that synchronizes the controller clock Cr with the global clock Cg. In some examples, the controller clock management unit 11 receives the global time from the time server 9 via the first communication network (non-periodic communication), performs time synchronization based on the global time, and sets the controller time based on the synchronized controller clock Cr. When the time change corresponding to the time difference between the global clock Cg and the controller clock Cr is greater than a given threshold, the controller clock management unit 11 sets the controller time by eliminating the time difference using a step-by-step process rather than a single-step process (i.e., by gradually correcting the time difference). In the present disclosure, this step-by-step process is referred to as adjusting the controller time. The time change refers to the change in the controller time required to synchronize the controller time with the global time. In some examples, the controller clock management unit 11 corrects the controller clock Cr based on the time change as at least part of the adjustment of the controller time. Correction of the controller clock refers to the process of reducing the time difference between the controller time and the global time in a step-by-step manner.
[0029] In some examples, the controller clock management unit 11 includes a flag management unit 13. The flag management unit 13 is a functional module that sets a flag used in correcting the controller clock Cr. This flag indicates that the controller clock Cr is being corrected. The flag management unit 13 sets the flag in response to a time change exceeding a threshold value and clears the flag in response to the controller clock Cr being synchronized with the global clock Cg. In this disclosure, this flag is also referred to as a correction flag.
[0030] The notification unit 12 is a functional module that notifies the at least one local device 3 of the controller time based on the synchronized controller clock Cr through periodic communication using the second communication network Nb. In some examples, the notification unit 12 notifies the adjusted controller time (e.g., the controller time based on the corrected controller clock Cr).
[0031] In some examples, the local controller 30 has an internal clock called a local clock Ce for time synchronization. In some examples, the local controller 30 includes a local clock management unit 31 as a functional module. The local clock management unit 31 is a functional module that synchronizes the local clock Ce in the local controller 30 with the controller clock Cr based on the controller clock Cr notified by the notification unit 12.
[0032] Figure 3 1 is a diagram showing one example of the hardware configuration of the computer 100 used in the device control system 1. For example, the main controller 10 and the local controllers 30 are realized by the computer 100.
[0033] Computer 100 includes circuitry 110. Circuitry 110 includes a processor 111, memory 112, storage device 113, timer 114, input / output port 115, and communication port 116. Each of these hardware components can be one, two, or more. Storage device 113 stores programs used to configure the various functional modules on computer 100. Storage device 113 is a computer-readable storage medium, such as a hard disk, non-volatile semiconductor memory, magnetic disk, or optical disk. Memory 112 temporarily stores programs loaded from storage device 113, calculation results from processor 111, and the like. Processor 111 implements the various functional modules by executing the programs in cooperation with memory 112. In response to commands from processor 111, input / output port 115 receives and outputs electrical signals from target device 120, such as a device body, monitor, or input device. Input / output port 115 can also be used to supply power to the device body. The communication port 116 performs data communication with other devices via the communication network N (eg, at least one of the first communication network Na and the second communication network Nb) according to a command from the processor 111 .
[0034] System Operation
[0035] As an example of the time synchronization method according to the present disclosure, reference will be made to Figure 4 and Figure 5 An example operation of the device control system 1 is described. Figure 4 1 is a sequence diagram showing an example process of time synchronization in the device control system 1 as a process flow S1. In other words, the device control system 1 executes the process flow S1. Figure 5 1 is a flowchart showing an example process of correcting the controller time as the process flow S2. In other words, the device control system 1 (main controller 10) executes the process flow S2.
[0036] Time synchronization
[0037] Will refer to Figure 4Describe the time synchronization in the device control system 1. For convenience, Figure 4 Only one master controller 10 and one local controller 30 are shown.
[0038] In step S11, the time server 9 sends the global time to the main controller 10 via the first communication network (aperiodic communication) Na, and the controller clock management unit 11 receives the global time. In some examples, the time server 9 sends global time data indicating the global time to the main controller 10 via the first communication network Na, and the controller clock management unit 11 receives the global time data.
[0039] In step S12, the controller clock management unit 11 synchronizes the controller clock Cr with the global clock Cg based on the global time, and the notification unit 12 notifies the at least one local controller 30 of the controller time based on the synchronized controller clock Cr. In some examples, the notification unit 12 transmits controller time data indicating the controller time to the at least one local controller 30. In the local controller 30, the local clock management unit 31 synchronizes the local clock Ce with the controller clock Cr based not only on the controller time but also on the time delay through periodic communication (so-called transmission time delay).
[0040] In some examples, in step S12, the controller clock management unit 11 sets the controller clock Cr forward (i.e., updates the controller time) based on an internal signal with a given internal cycle. The notification unit 12 notifies or sends the latest controller time to at least one local controller 30 in each communication cycle of the periodic communication. The communication cycle is shorter than the cycle for receiving the global time. For example, when the reception cycle of the global time is tens of milliseconds or longer, the communication cycle is hundreds of microseconds to several milliseconds. The communication cycle can be longer, shorter, or the same as the internal cycle. The communication cycle can be synchronized with N times or 1 / N (N is an integer of 2 or greater) of the internal cycle, or can be asynchronous with the internal cycle. The local clock management unit 31 synchronizes the local clock Ce with the controller clock Cr in each communication cycle.
[0041] Every time the global time is transmitted from the time server 9 to the main controller 10 , the processing of steps S11 and S12 is repeated. Figure 4 At least a portion of this repetition is shown in steps S13 and S14.
[0042] Controller time correction
[0043] Will refer to Figure 5An example of correcting the controller time is described. This example shows a series of processes for correcting the controller time and ultimately synchronizing the controller clock Cr with the global clock Cg when the time change corresponding to the time difference between the global clock Cg and the controller clock Cr exceeds a given threshold. In some examples, the process S2 is repeated for each given communication cycle of the periodic communication. Figure 5 In the embodiment, the expression "correction flag = OFF" means that the correction flag is cleared or in a cleared state. The expression "correction flag = ON" means that the correction flag is set or in a set state.
[0044] The following description will be made assuming that the controller clock management unit 11 has acquired the global time and the correction flag has been initially cleared ("Yes" in both steps S201 and S202). In this case, the process proceeds to step S203.
[0045] In step S203, the controller clock management unit 11 calculates the time difference between the global clock Cg and the controller clock Cr and sets a time change corresponding to the time difference. The controller clock management unit 11 may set the time difference as the time change. Alternatively, the controller clock management unit 11 may set the time change based on the time difference and at least one of a transmission delay in the first communication network Na and an internal delay of the master controller 10.
[0046] In step S204, the controller clock management unit 11 determines whether the time change is less than or equal to a given upper correction limit. In some examples, the upper correction limit is an acceptable value within one communication cycle of periodic communication and is an example of a threshold value to which the time change is compared. In response to the time change exceeding the upper correction limit ("No" in step S204), the process proceeds to step S205.
[0047] In step S205, the controller clock management unit 11 corrects the controller clock Cr based on the correction upper limit. The controller clock management unit 11 adds the correction upper limit to the controller time to change the controller time (if the correction upper limit is a negative value, the controller clock Cr is delayed by that value).
[0048] In step S206, the controller clock management unit 11 updates the time change. The controller clock management unit 11 calculates the uncorrected time change by subtracting the correction upper limit from the current time change. The calculated time change is used in the processing flow S2 in the next communication cycle.
[0049] In step S207, the flag management unit 13 sets a correction flag. This setting allows the controller clock management unit 11 to recognize that the controller clock Cr is being corrected.
[0050] In step S208, the notification unit 12 notifies or sends the corrected controller time to at least one local controller 30. In the local controller 30, the local clock management unit 31 synchronizes the local clock Ce with the controller clock Cr based on the controller time.
[0051] In the processing flow S2 in the next communication cycle, no new global time is acquired (No in step S201), and the process proceeds to step S209. Since the correction flag is set (Yes in step S209), the process proceeds to step S204.
[0052] In step S204, the controller clock management unit 11 determines whether the time change amount updated in step S206 is equal to or less than the correction upper limit. In response to the time change amount exceeding the correction upper limit ("No" in step S204), the process proceeds to step S205, and the processes of steps S205 to S208 are performed. On the other hand, in the case where the time change amount is equal to or less than the correction upper limit ("Yes" in step S204), the process proceeds to step S210.
[0053] In step S210, the controller clock management unit 11 synchronizes the controller clock Cr with the global clock Cg. This process can be referred to as a process of correcting the controller clock Cr based on the remaining time change. As a result, the controller time matches the global time.
[0054] In step S211, the flag management unit 13 clears the correction flag. This setting allows the controller clock management unit 11 to recognize that the controller clock Cr is not in the correction state.
[0055] In step S212, the notification unit 12 notifies or transmits the corrected controller time to at least one local controller 30. Based on the notification or transmission, the local clock management unit 31 synchronizes the local clock Ce with the controller clock Cr.
[0056] As shown in process flow S2, in response to the time change exceeding a given threshold, the controller clock management unit 11 does not synchronize the controller clock Cr with the global clock Cg by eliminating the time change in a single step. Instead, it corrects the controller clock Cr by a correction amount obtained by dividing the time change over multiple communication cycles. For example, the correction amount is the correction upper limit used in step S205 or the remaining time change in step S210. In other words, the controller clock management unit 11 sets the correction amount within a given correction upper limit in each of the multiple communication cycles. The controller clock management unit 11 repeats the correction of the controller clock Cr until the correction amount becomes equal to or less than the correction upper limit, and in response to the correction amount becoming equal to or less than the correction upper limit, synchronizes the controller clock Cr with the global clock Cg.
[0057] When the correction flag is set (when the correction flag is ON), the controller clock management unit 11 corrects the controller clock Cr based on the time change amount without using the global time (ie, without referring to the global clock Cg).
[0058] In the processing flow S2 , the controller clock management unit 11 may also synchronize the controller clock Cr with the global clock Cg based on the internal delay in the main controller 10 .
[0059] Modified form of the main controller
[0060] The controller may include at least one other internal clock in addition to the controller clock, and use the at least two internal clocks to synchronize the controller clock with the global clock. Figure 6 A main controller 10A is shown as a modified form. The main controller 10A has a master clock Cm in addition to the controller clock Cr. The main controller 10A includes a controller clock management unit 11A and a notification unit 12 as functional modules.
[0061] The controller clock management unit 11A includes a first clock management unit 14, a second clock management unit 15, and a flag management unit 13A. The first clock management unit 14 is a functional module that synchronizes the master clock Cm with the global clock Cg and sets the master time based on the master clock Cm. The second clock management unit 15 is a functional module that synchronizes the controller clock Cr with the master clock Cm and sets the controller time based on the controller clock Cr. The flag management unit 13A is a functional module that sets flags used to calibrate at least one of the master clock Cm and the controller clock Cr, and has the same functions as the flag management unit 13.
[0062] Figure 710A is a timing chart showing an example process of time synchronization in the main controller 10A as a process flow S3. In other words, the main controller 10A executes the process flow S3.
[0063] In step S31, the first clock management unit 14 sets the start time Ts of the master clock Cm based on the global time and outputs the start time Ts to the second clock management unit 15. In step S32, the second clock management unit 15 obtains the start time Ts and also obtains the internal delay Di related to the second clock management unit 15.
[0064] In step S33, the first clock management unit 14 sets a master clock period Tm of the master clock signal and outputs the master clock period Tm to the second clock management unit 15. In step S34, the second clock management unit 15 obtains the master clock period Tm. The second clock management unit 15 can set an internal period of an internal signal corresponding to the controller time based on the master clock period Tm. In some examples, the second clock management unit 15 sets an internal period shorter than the master clock period Tm, for example, an internal period that is 1 / N of the master clock period Tm (N is an integer of 2 or greater).
[0065] Then, the first clock management unit 14 and the second clock management unit 15 cooperate to perform time synchronization on the master clock Cm and the controller clock Cr. Hereinafter, the processes in the first clock management unit 14 and the second clock management unit 15 will be described as steps S35 and S36, respectively.
[0066] In step S35 , the first clock management unit 14 starts time synchronization and notifies or outputs a master clock signal having a master clock period Tm to the second clock management unit 15 .
[0067] In step S36, the second clock management unit 15 synchronizes the controller clock Cr with the master clock Cm based on the master clock signal. During this synchronization, the second clock management unit 15 sets the sum of the start time Ts and the internal delay Di as the initial value of the controller time. Thereafter, the second clock management unit 15 updates the controller time in each master clock cycle Tm by adding the master clock cycle Tm to the previous value of the controller time. In addition to this update, the second clock management unit 15 also updates the controller time based on the internal cycle.
[0068] In some examples, the controller clock management unit 11A performs the processing flow S2 in at least one of steps S35 and S36. Therefore, even in a mechanism in which the master clock Cm is introduced to synchronize the controller clock Cr with the global clock Cg in two stages, if the amount of time change becomes relatively large, the influence on the control of the local device 3 can be minimized. This is also true when the controller has three or more internal clocks.
[0069] program
[0070] The various functional modules of the main controller 10 and main controller 10A are implemented by reading a time synchronization program from the processor 111 or memory 112 and causing the processor 111 to execute the program. The time synchronization program includes code for implementing the various functional modules of the main controller 10 or main controller 10A. The processor 111 operates the input / output port 115 or communication port 116 according to the time synchronization program and reads and writes data to the memory 112 or storage device 113. This process implements the various functional modules of the device control system 1.
[0071] The time synchronization program may be provided after being fixedly stored on a non-transitory storage medium such as a CD-ROM, DVD-ROM, or semiconductor memory. Alternatively, the time synchronization program may be provided as a data signal superimposed on a carrier wave via a communication network.
[0072] As described above, a controller according to one aspect of the present disclosure includes: a controller clock management unit, configured to receive global time data indicating a global time associated with an external global clock, synchronize a controller clock inside the controller with the global clock based on the global time, and set the controller time based on the synchronized controller clock; and a notification unit, configured to send the controller time data indicating the controller time to at least one local device through periodic communication.
[0073] A time synchronization method according to one aspect of the present disclosure includes: receiving global time data indicating a global time associated with an external global clock; synchronizing a controller clock inside a controller with the global clock based on the global time; setting a controller time based on the synchronized controller clock; and sending the controller time data indicating the controller time to at least one local device through periodic communication.
[0074] According to one aspect of the present disclosure, a computer-readable storage medium stores processor-executable instructions, and the processor-executable instructions are used to: receive global time data indicating a global time associated with an external global clock; synchronize a controller clock inside a controller with the global clock based on the global time; set a controller time based on the synchronized controller clock; and send the controller time data indicating the controller time to at least one local device through periodic communication.
[0075] According to such an example, since the controller time based on the controller clock synchronized with the global clock is sent to the local device, the time in the system can be uniformly managed. For example, at least one local device can be controlled based on a unique time.
[0076] In some examples, the controller clock management unit may be further configured to: determine a time difference between the global clock and the controller clock; and adjust the controller time based on a time change corresponding to the time difference between the global clock and the controller clock. Since the time difference is eliminated by adjusting the controller time based on the time change, the influence of the time difference on the control of the local device can be suppressed.
[0077] In some examples, the controller clock management unit may be further configured to: correct the controller clock based on the time change as at least part of adjusting the controller time; and set the controller time based at least in part on the corrected controller clock. Because the time of the control clock is adjusted while synchronizing the clocks between the controller and the local device, the influence of the controller on the control of the local device can be suppressed.
[0078] In some examples, the controller clock management unit can be configured to: compare the time change with a given threshold; in response to determining that the time change exceeds the given threshold, divide the time change over multiple communication cycles of the periodic communication to set a correction amount; correct the controller clock based on the correction amount; and synchronize the corrected controller clock with the global clock. Because large time changes are gradually eliminated over multiple communication cycles, large changes in controller time can be avoided while adjusting time, where large changes in controller time can affect control of local devices. As a result, the accuracy of time synchronization can be maintained at a specific level or higher.
[0079] In some examples, the controller clock management unit may be further configured to set the correction amount within a given correction upper limit in each of the plurality of communication cycles. Since fluctuations in the correction amount can be suppressed by setting the correction upper limit, correction can be performed smoothly while stabilizing the degree of change in controller time.
[0080] In some examples, the controller clock management unit may be further configured to: repeatedly correct the controller clock until the correction amount becomes less than or equal to the correction upper limit; and in response to determining that the correction amount becomes less than or equal to the correction upper limit, synchronize the controller clock with the global clock. By repeatedly correcting and then ultimately synchronizing the controller clock with the global clock, large changes in the controller time can be avoided while adjusting the time.
[0081] In some examples, the controller may further include a flag management unit configured to, in response to determining that the time change exceeds the threshold, set a flag indicating that the controller clock is being corrected. The controller clock management unit may also be configured to, in response to setting the flag, correct the controller clock based on the time change without reference to the global clock. By not utilizing the global clock when correcting the time difference, significant changes in the controller time can be avoided while adjusting the time.
[0082] In some examples, the flag management unit may be further configured to clear the flag in response to determining that the controller clock is synchronized with the global clock. By setting the flag in this manner, after completing a series of correction and synchronization processes for the controller clock, the global clock is re-referenced. Thus, time synchronization can be stabilized.
[0083] In some examples, the controller time data may be sent to the at least one local device in each communication cycle of the periodic communication.By sending the controller time in each communication cycle, the synchronized controller time may be sent to the local device at an appropriate timing.
[0084] In some examples, the controller clock management unit may also be configured to receive the global time data from a time server via aperiodic communication. In this case, the global time obtained via aperiodic communication may be used to uniformly manage the time in the system.
[0085] In some examples, the controller clock management unit may include: a first clock management unit configured to synchronize the controller's master clock with the global clock to set a master time based on the master clock; and a second clock management unit configured to synchronize the controller clock with the master clock to set the controller time. By introducing a master clock to synchronize clocks in two stages, the effects of fluctuations associated with time synchronization can be suppressed, thereby achieving robust time synchronization.
[0086] In some examples, the first clock management unit may be further configured to generate a master clock signal corresponding to the master time and having a master clock period. The second clock management unit may be configured to: generate an internal signal corresponding to the controller time and having a given internal period based on the master clock period; set a start time based on the master clock; and synchronize the controller clock with the master clock based on the start time and at least one of the master clock period and the internal period. By generating the internal signal based on the period of the master clock signal and performing synchronization using at least one of the periods of the two signals, accurate time synchronization can be achieved.
[0087] In some examples, the second clock management unit may be further configured to: set the internal period to be shorter than the master clock period; and generate the internal signal having the set internal period. By using the internal signal, the controller time can be synchronized with the master time at shorter intervals, thereby more reliably suppressing the effects of clock signal fluctuations and achieving robust time synchronization.
[0088] In some examples, the controller clock can also be synchronized with the global clock based on internal delays in the controller. Since the internal delays of the controller are taken into account, the controller clock can be synchronized with the global clock more accurately.
[0089] In some examples, a device control system including the above controller may further include at least one local device. Each of the at least one local device may include a local clock management unit configured to synchronize a local clock of the local device with a clock of the controller based on the transmitted controller time data.
[0090] In this example, a controller time based on a controller clock synchronized with a global clock is transmitted to a local device, and the local device synchronizes its local clock with the controller clock based on the controller time. This allows unified management of time within the system. For example, at least one local device can be controlled based on a unique time.
[0091] In some examples, the local clock may also be synchronized with the controller clock based on a time delay of the periodic communication.By taking the time delay into account, synchronization of the local clock may be performed more accurately.
[0092] In some examples, at least one of the at least one local device may be a robot controller. In this case, time can be managed uniformly in a device control system having a robot controller.
[0093] Other Examples
[0094] It should be understood that not all aspects, advantages, and features described herein are necessarily achieved by or included in any one particular example. In fact, having described and illustrated various examples herein, it will be apparent that other examples may be modified in arrangement and details may be omitted.
[0095] In the above example, the main controller 10 gradually reduces the time difference between the controller clock Cr and the global clock Cg. In some examples, the controller can eliminate the time difference in a single step and perform a correction on the time to be notified or transmitted to at least one local device. This time may temporarily deviate from the time indicated by the controller clock Cr. In other words, the controller can synchronize the controller clock with the global clock regardless of the size of the time difference and gradually reduce the time difference relative to the time to be notified or transmitted to each local device.
[0096] The hardware configuration of the system is not limited to the example of implementing each functional module by executing a program. In some examples, at least a portion of the functional modules described above may be configured by a logic circuit dedicated to performing the function, or may be configured by an application-specific integrated circuit (ASIC) in which a logic circuit is integrated.
[0097] The process of the method executed by at least one processor is not limited to the above examples. For example, some of the above steps or processes may be omitted or performed in a different order. In addition, two or more of the above steps may be combined, or some of the above steps may be modified or deleted. Alternatively, other steps in addition to the above steps may be performed.
[0098] When the magnitude relationship between two numerical values is compared in a computer system or a computer, either of the two criteria of "greater than or equal to" and "greater than" may be used, and either of the two criteria of "less than or equal to" and "less than" may be used.
[0099] We claim all modifications and variations that come within the spirit and scope of the subject matter claimed herein.
[0100] Regarding the above example, the following appendix is provided as further explanation.
[0101] (Appendix 1) A controller comprising:
[0102] a controller clock management unit configured to synchronize a controller clock in the controller with an external global clock; and
[0103] The notification unit is configured to notify at least one local device of a controller time based on the synchronized controller clock through periodic communication.
[0104] (Appendix 2) The controller according to Appendix 1,
[0105] The controller clock management unit is further configured to adjust the controller time based on a time change amount corresponding to a time difference between the global clock and the controller clock.
[0106] (Appendix 3) The controller according to Appendix 2,
[0107] wherein the controller clock management unit is further configured to correct the controller clock based on the time change as at least a part of adjusting the controller time;
[0108] The notification unit is configured to notify the at least one local device of the controller time based on the corrected controller clock.
[0109] (Appendix 4) The controller according to Appendix 3,
[0110] The controller clock management unit is configured to correct the controller clock by a correction amount obtained by dividing the time change amount over a plurality of communication cycles of the periodic communication in response to the time change amount exceeding a given threshold.
[0111] (Appendix 5) The controller according to Appendix 4,
[0112] The controller clock management unit is further configured to set the correction amount within a given correction upper limit in each of the plurality of communication cycles.
[0113] (Appendix 6) The controller according to Appendix 5,
[0114] Wherein, the controller clock management unit is further configured to:
[0115] repeating correction of the controller clock until the correction amount becomes smaller than or equal to the correction upper limit; and
[0116] In response to determining that the correction amount becomes less than or equal to the correction upper limit, the controller clock is synchronized to the global clock.
[0117] (Appendix 7) The controller according to any one of Appendices 4 to 6, further comprising: a flag management unit configured to set a flag indicating that the controller clock is being corrected in response to the time change amount exceeding the threshold value,
[0118] The controller clock management unit is configured to correct the controller clock based on the time change without reference to the global clock in response to the flag being set.
[0119] (Appendix 8) The controller according to Appendix 7,
[0120] The flag management unit is further configured to clear the flag in response to the controller clock being synchronized with the global clock.
[0121] (Appendix 9) A controller according to any one of Appendices 1 to 8,
[0122] The notification unit is configured to notify the at least one local device of the controller time in each communication cycle of the periodic communication.
[0123] (Appendix 10) A controller according to any one of Appendices 1 to 9,
[0124] Wherein, the controller clock management unit is further configured to:
[0125] receiving a global time based on the global clock from a time server through aperiodic communication; and
[0126] The controller clock is synchronized with the global clock according to the global time.
[0127] (Appendix 11) A controller according to any one of Appendices 1 to 10,
[0128] Wherein, the controller clock management unit includes:
[0129] a first clock management unit configured to synchronize a master clock in the controller with the global clock to set a master time based on the master clock; and
[0130] The second clock management unit is configured to synchronize the controller clock with the master clock to set the controller time.
[0131] (Appendix 12) The controller according to Appendix 11,
[0132] The first clock management unit is further configured to generate a master clock signal corresponding to the master time and having a master clock period.
[0133] Wherein, the second clock management unit is further configured to:
[0134] generating an internal signal corresponding to the controller time and having a given internal period based on the main clock period; and
[0135] The controller clock is synchronized with the master clock based on a start time according to the master clock and based on at least one of the master clock period and the internal period.
[0136] (Appendix 13) The controller according to Appendix 12,
[0137] The second clock management unit is configured to generate the internal signal with the internal cycle being shorter than the main clock cycle.
[0138] (Appendix 14) A controller according to any one of Appendices 1 to 13,
[0139] The controller clock management unit is configured to synchronize the controller clock with the global clock based on an internal delay in the controller.
[0140] (Appendix 15) An equipment control system comprising:
[0141] A controller according to any one of Appendices 1 to 14; and
[0142] the at least one local device,
[0143] Each of the at least one local device includes a local clock management unit configured to synchronize a local clock in the local device with the controller clock based on the controller time notified by the notification unit.
[0144] (Appendix 16) The device control system according to Appendix 15,
[0145] The local clock management unit is configured to synchronize the local clock with the controller clock further based on a time delay of the periodic communication.
[0146] (Appendix 17) The device control system according to Appendix 15 or 16,
[0147] Wherein, at least one of the at least one local device is a robot controller.
[0148] (Appendix 18) A time synchronization method comprising:
[0149] Synchronizing the controller clock in the controller with an external global clock; and
[0150] At least one local device is informed of a controller time based on the synchronized controller clock through periodic communication.
[0151] (Appendix 19) A time synchronization program configured to cause a computer to perform the following operations:
[0152] Synchronizing the controller clock in the controller with an external global clock; and
[0153] At least one local device is informed of a controller time based on the synchronized controller clock through periodic communication.
Claims
1. A controller comprising: a controller clock management unit configured to receive global time data indicating a global time associated with an external global clock, synchronize a controller clock within the controller with the global clock based on the global time, and set the controller time based on the synchronized controller clock; as well as a notification unit configured to transmit controller time data indicating the controller time to at least one local device through periodic communication, Wherein, the controller clock management unit is further configured to: determining a time difference between the global clock and the controller clock; comparing a time change amount corresponding to the time difference with a given threshold; In response to determining that the time change amount exceeds the given threshold, dividing the time change amount over a plurality of communication cycles of the periodic communication to set a correction amount; correcting the controller clock based on the correction amount; setting the controller time based at least in part on the corrected controller clock; and The corrected controller clock is synchronized with the global clock.
2. The controller according to claim 1, in, The controller clock management unit is further configured to set the correction amount within a given correction upper limit in each of the plurality of communication cycles.
3. The controller according to claim 2, wherein: The controller clock management unit is further configured to: repeating correction of the controller clock until the correction amount becomes smaller than or equal to the correction upper limit; and In response to determining that the correction amount becomes less than or equal to the correction upper limit, the controller clock is synchronized to the global clock.
4. The controller according to any one of claims 1 to 3, further comprising: a flag management unit configured to, in response to determining that the time change amount exceeds the threshold, set a flag indicating that the controller clock is being corrected; The controller clock management unit is further configured to: in response to the flag being set, correct the controller clock based on the time change without reference to the global clock.
5. The controller according to claim 4, in, The flag management unit is further configured to clear the flag in response to determining that the controller clock is synchronized with the global clock.
6. The controller according to any one of claims 1 to 3, in, The controller time data is sent to the at least one local device in each communication cycle of the periodic communication.
7. The controller according to any one of claims 1 to 3, in, The controller clock management unit is further configured to receive the global time data from a time server through aperiodic communication.
8. The controller according to any one of claims 1 to 3, wherein: The controller clock management unit includes: a first clock management unit configured to synchronize a master clock of the controller with the global clock to set a master time based on the master clock; and The second clock management unit is configured to synchronize the controller clock with the master clock to set the controller time.
9. The controller according to claim 8, in, The first clock management unit is further configured to generate a master clock signal corresponding to the master time and having a master clock period, and Wherein, the second clock management unit is further configured to: Based on the main clock cycle, generating an internal signal corresponding to the controller time and having a given internal cycle; Setting a start time based on the master clock; and The controller clock is synchronized with the master clock based on the start time and based on at least one of the master clock period and the internal period.
10. The controller according to claim 9, wherein: The second clock management unit is further configured to: Setting the internal cycle to be shorter than the main clock cycle; and The internal signal having the set internal period is generated.
11. The controller according to any one of claims 1 to 3, in, The controller clock is also synchronized with the global clock based on internal delays in the controller.
12. A device control system comprising the controller according to any one of claims 1 to 3, and further comprising the at least one local device, in, Each of the at least one local device includes a local clock management unit configured to synchronize a local clock of the local device with the controller clock based on the transmitted controller time data.
13. The device control system according to claim 12, in, The local clock is also synchronized with the controller clock based on a time delay of the periodic communication.
14. The device control system according to claim 12, in, At least one of the at least one local device is a robot controller.
15. A time synchronization method, comprising: receiving global time data indicating a global time associated with an external global clock; Synchronizing a controller clock inside the controller with the global clock based on the global time; setting a controller time based on the synchronized controller clock; as well as sending controller time data indicating the controller time to at least one local device through periodic communication, The synchronization includes: determining a time difference between the global clock and the controller clock; comparing a time change amount corresponding to the time difference with a given threshold; In response to determining that the time change amount exceeds the given threshold, dividing the time change amount over a plurality of communication cycles of the periodic communication to set a correction amount; correcting the controller clock based on the correction amount; setting the controller time based at least in part on the corrected controller clock; and The corrected controller clock is synchronized with the global clock.
16. A computer-readable storage medium storing processor-executable instructions for: receiving global time data indicating a global time associated with an external global clock; Synchronizing a controller clock inside the controller with the global clock based on the global time; setting a controller time based on the synchronized controller clock; as well as sending controller time data indicating the controller time to at least one local device through periodic communication, The storage medium further stores instructions executable by the processor, and the instructions executable by the processor are used for the following operations: determining a time difference between the global clock and the controller clock; comparing a time change amount corresponding to the time difference with a given threshold; In response to determining that the time change amount exceeds the given threshold, dividing the time change amount over a plurality of communication cycles of the periodic communication to set a correction amount; correcting the controller clock based on the correction amount; setting the controller time based at least in part on the corrected controller clock; and The corrected controller clock is synchronized with the global clock.
Citation Information
Patent Citations
Time synchronizing method, apparatus and system for master, slave time clock side in synchronous network
CN101364863A
Systems and methods for distributing GPS clock to communications devices
CN101971557A