WO2022168475A1 - Control device - Google Patents
Control device Download PDFInfo
- Publication number
- WO2022168475A1 WO2022168475A1 PCT/JP2021/047276 JP2021047276W WO2022168475A1 WO 2022168475 A1 WO2022168475 A1 WO 2022168475A1 JP 2021047276 W JP2021047276 W JP 2021047276W WO 2022168475 A1 WO2022168475 A1 WO 2022168475A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- unit
- value
- difference
- counter
- synchronization signal
- Prior art date
Links
- 238000012937 correction Methods 0.000 claims abstract description 54
- 238000004364 calculation method Methods 0.000 claims abstract description 27
- 230000001360 synchronised effect Effects 0.000 description 22
- 238000012986 modification Methods 0.000 description 21
- 230000004048 modification Effects 0.000 description 21
- 238000010586 diagram Methods 0.000 description 19
- 238000012545 processing Methods 0.000 description 18
- 238000000034 method Methods 0.000 description 17
- 230000003068 static effect Effects 0.000 description 17
- 230000010355 oscillation Effects 0.000 description 16
- 238000003860 storage Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 9
- 230000015654 memory Effects 0.000 description 8
- 230000004044 response Effects 0.000 description 8
- 238000005259 measurement Methods 0.000 description 6
- 230000004397 blinking Effects 0.000 description 4
- 230000014759 maintenance of location Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
Definitions
- the present disclosure relates to a control device.
- a PLC generally includes a basic unit (CPU (Central Processing Unit) unit) and an expansion unit.
- CPU Central Processing Unit
- a counter (timer) of the CPU unit and a counter of the expansion unit are synchronized so that there is no time lag between the data acquired from the CPU unit and the data acquired from the expansion unit.
- Patent Document 1 discloses a technique for synchronizing the time of the CPU unit timer and the time of the expansion unit timer. Specifically, a synchronization signal is transmitted from the CPU unit to the expansion unit. The expansion unit synchronizes the time of the expansion unit timer with the time of the CPU unit timer according to the synchronization signal.
- the CPU of the CPU unit executes the process of transmitting the synchronization signal by executing firmware. Therefore, the CPU unit timer and the expansion unit timer cannot be synchronized until after the firmware has started. Therefore, the CPU unit timer and the expansion unit timer are out of sync before the firmware starts. As a result, if a problem occurs before the firmware is started, it becomes difficult to arrange the order of occurrence of events among a plurality of units, and it takes time to investigate the cause of the problem.
- the present disclosure has been made in view of the above problems, and its purpose is to provide a control device that can shorten the time required to investigate the cause of a problem that occurred before starting the firmware.
- the control device includes a first unit and a second unit that exchange data.
- the first unit includes a first hardware circuit.
- a second unit includes a second hardware circuit.
- a first hardware circuit includes a first counter, a signal output section for outputting a synchronization signal to the second unit, and a first value of the first counter when the synchronization signal is output to a second unit. and a time information output unit for outputting to the unit.
- the second hardware circuit includes: a second counter; a difference calculator that calculates a first difference between a second value and a first value of the second counter when receiving the synchronization signal; and a correction unit that corrects the second counter based on the difference of 1.
- synchronization processing between the first counter and the second counter is performed by the first hardware circuit of the first unit and the second hardware circuit of the second unit. Therefore, immediately after the control device is powered on, synchronization processing between the first counter and the second counter is started. Therefore, the first and second counters are synchronized before the firmware is activated. Therefore, even before the firmware is activated, it becomes easy to arrange the order of occurrence of events in the first unit and the second unit. As a result, it is possible to shorten the time required to investigate the cause of a problem that occurred before the firmware was started.
- the first hardware circuit further comprises a third counter.
- the second hardware circuit further has a fourth counter.
- the signal output section repeatedly outputs the synchronization signal.
- the time information output unit further outputs a second difference between the value of the third counter when the previous synchronization signal was output and the value of the third counter when the current synchronization signal was output as a second difference.
- the difference calculation unit further calculates a third difference between the value of the fourth counter when receiving the previous synchronization signal and the value of the fourth counter when receiving the synchronization signal this time. Compute a fourth difference between the difference of and the third difference.
- the correction unit corrects the second counter based on the fourth difference.
- the fourth difference is the count number of the third counter and the count number of the fourth counter in the target period from the output of the previous synchronization signal to the output of the current synchronization signal. Show the difference with the number. Since the first counter and the third counter are included in the same hardware circuit, they count up in the same period according to the clock from the same clock oscillation source. Similarly, since the second counter and the fourth counter are included in the same hardware circuit, they count up in the same cycle according to the clock from the same clock oscillation source. Therefore, the difference between the count number of the first counter and the count number of the second counter in the target period is also the fourth difference.
- the correction unit corrects the second counter based on the fourth difference, thereby correcting the difference between the values of the first counter and the second counter caused by the oscillation error of the clock source.
- the signal output unit may output the synchronization signal each time the value of the first counter increases by a constant value.
- the time information output section also outputs a constant value to the second unit.
- the second hardware circuit measures a second difference between the value of the second counter when the previous synchronization signal was output and the value of the second counter when the current synchronization signal was output. It further has a measurement part.
- the difference calculator further calculates a third difference between the second difference and the constant value.
- the correction unit corrects the second counter based on the third difference.
- the third difference is the difference between the count number of the first counter and the count number of the second counter in the target period in which the value of the first counter increases by a constant value.
- the correction unit corrects the second counter based on the third difference, thereby correcting the difference between the values of the first counter and the second counter caused by the oscillation error of the clock source.
- the scale of the first and second hardware circuits can be reduced as compared with the form having the third and fourth counters.
- the first unit further includes a first light emitting element that blinks according to the value of the first counter.
- the second unit further comprises a second light emitting element that blinks according to the value of the second counter.
- the blinking cycles of the first light emitting element and the second light emitting element are synchronized, and a sense of unity can be given to the user. Conversely, the user can recognize that some kind of abnormality has occurred by visually confirming that the blinking cycles of the first light emitting element and the second light emitting element are not synchronized.
- the first unit further comprises a processor executing firmware.
- the firmware includes instructions for setting the timing of outputting the synchronization signal to the signal output section.
- the signal output unit outputs a synchronization signal when the value of the first counter reaches the timing.
- the firmware further includes instructions to calculate a fifth difference between the second value and the timing, and instructions to correct the second counter based on the fifth difference.
- the processor disables the operation of the time information output section after starting the firmware.
- the processor can synchronize the first counter and the second counter according to the firmware.
- the first hardware circuit is an ASIC or FPGA.
- the second hardware circuit is an ASIC or FPGA.
- FIG. 3 is a schematic diagram showing a configuration example of a unit of the control device according to the embodiment;
- FIG. It is a figure which shows the signal waveform using UART.
- FIG. 4 is a diagram showing a signal waveform corresponding to time information (value X1);
- FIG. 4 is a diagram showing the flow of data accompanying the waveform of a synchronizing signal;
- FIG. 5 is a diagram schematically showing the configuration of a control device according to modification 1;
- FIG. 11 is a diagram schematically showing the configuration of a control device according to modification 2;
- FIG. 13 is a diagram schematically showing the configuration of a control device 1C according to Modification 3;
- FIG. 10 is a diagram showing a data flow accompanying a waveform of a synchronization signal in Modification 3;
- FIG. 10 is a diagram showing a signal distribution method when there are a plurality of extension units;
- FIG. 1 is a diagram schematically showing an example of the configuration of a control device 1 according to this embodiment.
- the control device 1 corresponds to a PLC, for example.
- a PLC will be described as a specific example as a typical example of the "control device", but the technical idea disclosed in this specification is not limited to the PLC, and can be applied to any control device. Applicable.
- control device 1 includes a CPU unit 100 and an expansion unit 200 that exchange data.
- control device 1 includes one expansion unit 200 in FIG. 1 , it may be provided with a plurality of expansion units 200 .
- CPU unit 100 is connected to expansion unit 200 via data bus 2 and signal lines 3 and 4 .
- the CPU unit 100 has a program execution section that executes a program created according to the object to be controlled. More specifically, the CPU unit 100 corresponds to an arithmetic processing section that executes system programs and various user programs.
- the extension unit 200 can be detachably externally attached to the CPU unit 100 in order to extend the functions of the control device 1 .
- the expansion unit 200 is arranged to mediate between the network and the control device 1, for example performing communication processing or information processing.
- the CPU unit 100 includes a CPU 10, a memory 11, a storage 12, and a hardware circuit 13.
- Expansion unit 200 includes CPU 20 , memory 21 , storage 22 and hardware circuit 23 .
- the CPU 10 reads the firmware and various user programs stored in the storage 12, develops them in the memory 11, and executes them.
- the CPU 20 reads various programs stored in the storage 22, develops them in the memory 21, and executes them.
- the hardware circuit 13 and the hardware circuit 23 are, for example, FPGA (Field-Programmable Gate Array) or ASIC (Application Specific Integrated Circuit).
- the hardware circuit 13 has a free-running counter (hereinafter referred to as "FRC") 131, a synchronization signal output section 132, and a latch section 133.
- FRC free-running counter
- the FRC 131 is a counter that counts up at regular intervals.
- FRC 131 is, for example, a 64-bit counter.
- Various counters may be employed instead of the FRC 131 .
- the synchronization signal output section 132 uses the signal line 3 to output the synchronization signal to the expansion unit 200 at arbitrary timing.
- the synchronization signal output unit 132 arbitrarily generates the output timing of the synchronization signal.
- the synchronization signal output unit 132 may set the timing at which the value of the FRC 131 reaches the set value as the timing for outputting the synchronization signal.
- the synchronization signal output from the synchronization signal output section 132 is also input to the latch section 133 .
- the latch section 133 latches the value X1 of the FRC 131 when the synchronization signal is output. Furthermore, the latch section 133 outputs the held value X1 to the expansion unit 200 using the signal line 4 .
- the value X1 latched by the latch section 133 is time information indicating the time when the synchronization signal was output.
- the hardware circuit 23 has an FRC 231 , a latch section 232 , a difference calculation section 233 and an FRC correction section 234 .
- the FRC 231 is a counter that counts up at regular intervals.
- FRC 231 is, for example, a 64-bit counter.
- Various counters may be employed instead of the FRC 231 .
- the latch section 232 latches the value X2 of the FRC 231 when receiving the synchronization signal from the signal line 3 .
- the latch section 232 outputs the held value X2 to the difference calculation section 233 .
- the difference calculator 233 outputs the difference Y1 to the FRC corrector 234 .
- the FRC correction unit 234 corrects the FRC 231 based on the difference Y1. That is, the FRC correction unit 234 corrects the value of the FRC231 by the difference Y1 so that the FRC131 and the FRC231 are synchronized.
- the synchronous signal output section 132 of the CPU unit 100 outputs the synchronous signal to the extension unit 200 .
- the synchronization signal is also output to the latch section 133 (see (1) in the figure).
- the latch section 133 of the CPU unit 100 latches the value X1 of the FRC 131 when the synchronization signal was output according to the input of the synchronization signal (see (2) in the figure).
- the latch section 232 of the extension unit 200 latches the value X2 of the FRC 231 when receiving the synchronization signal in response to the input of the synchronization signal (see (3) in the figure).
- the latch unit 133 outputs the held value X1 (time information indicating the timing at which the synchronization signal was output) to the extension unit 200 (see (4) in the figure). That is, the latch section 133 outputs to the extension unit 200 the value X1 of the FRC 131 when the synchronization signal is output.
- the latch unit 232 outputs the held value X2 to the difference calculation unit 233 (see (5) in the figure).
- the difference calculation section 233 calculates the difference Y1 between the value X2 held by the latch section 232 and the value X1 received from the CPU unit 100 (see (6) in the drawing).
- the difference calculator 233 outputs the calculated difference Y1 to the FRC corrector 234 (see (7) in the figure).
- the FRC correction unit 234 corrects the FRC 231 based on the difference Y1 (see (8) in the figure). Thereby, FRC231 and FRC131 are synchronized. The processes (1) to (8) are repeatedly executed.
- the synchronization processing between the FRC231 and the FRC131 is executed by the hardware circuit 13 of the CPU unit 100 and the hardware circuit 23 of the expansion unit 200. Therefore, synchronization processing between the FRC231 and the FRC131 is started immediately after the control device 1 is powered on. Therefore, the FRC231 and the FRC131 are synchronized before the firmware stored in the storage 12 is activated.
- FIG. 2 is a diagram schematically showing the configuration of the control device 1Z according to the reference embodiment.
- the controller 1Z differs from the controller 1 shown in FIG. 1 in that it includes a CPU unit 100Z and an expansion unit 200Z instead of the CPU unit 100 and the expansion unit 200. .
- the CPU unit 100Z differs from the CPU unit 100 in that it includes a hardware circuit 13Z instead of the hardware circuit 13.
- the hardware circuit 13Z differs from the hardware circuit 13 in that it does not have the latch section 133.
- the extension unit 200Z differs from the extension unit 200 in that it includes a hardware circuit 23Z instead of the hardware circuit 23.
- the hardware circuit 23Z is different from the hardware circuit 23 in that it does not have the difference calculator 233 .
- the hardware circuits 13Z and 23Z do not include the latch section 133 and the difference calculation section 233, so the FRC 231 and the FRC 131 are not synchronized with the hardware circuits 13Z and 23Z alone. Therefore, the firmware stored in the storage 12 is used to synchronize the FRC231 and the FRC131.
- the firmware includes an instruction to set the timing X1 for outputting the synchronization signal to the synchronization signal output section 132 of the hardware circuit 13Z and an instruction to read the value X1 held in the latch section 232. Further, the firmware includes an instruction to calculate the difference Y1 between the value X2 and the timing X1, and an instruction to cause the FRC corrector 234 to correct the FRC 231 based on the difference Y1.
- the CPU 10 executes synchronization processing as follows according to firmware including such instructions.
- the CPU 10 of the CPU unit 100Z sets the synchronization signal output timing X1 in the synchronization signal output section 132 (see (11) in the figure).
- the synchronization signal output section 132 outputs the synchronization signal to the expansion unit 200Z (see (12) in the figure).
- the latch section 232 of the expansion unit 200Z latches the value X2 of the FRC 231 when receiving the synchronization signal in response to the input of the synchronization signal (see (13) in the figure).
- the CPU 10 reads out the value X2 held in the latch section 232 via the data bus 2 (see (14) in the figure).
- the FRC correction unit 234 corrects the FRC 231 based on the difference Y1 (see (16) in the figure). Thereby, FRC231 and FRC131 are synchronized. The processes (11) to (16) are repeatedly executed.
- the CPU 10 performs the processes (11), (14) and (15) in the figure by executing the firmware. That is, after the firmware is activated, the synchronization processing between the FRC231 and the FRC131 is started. Therefore, the FRC131 and the FRC231 are not synchronized from when the control device 1Z is powered on until the firmware is activated. As a result, if a problem occurs during this period, it becomes difficult to arrange the order of occurrence of events in the CPU unit 100Z and the expansion unit 200Z, and it takes time to investigate the cause of the problem.
- the FRC231 and the FRC131 are synchronized before the firmware is activated. Therefore, it becomes easy to arrange the order of occurrence of events in the CPU unit 100 and the expansion unit 200 even after the power is turned on until the firmware is activated. As a result, it is possible to shorten the time required to investigate the cause of a problem that occurred before the firmware was started.
- FIG. 3 is a schematic diagram showing a configuration example of units of the control device 1 according to the present embodiment.
- the control device 1 includes a CPU unit 100 , one or more expansion units 200 and one or more functional units 300 .
- CPU unit 100 is connected to one or more expansion units 200 via data bus 2 and signal lines 3 and 4 .
- the CPU unit 100 also connects with one or more functional units 300 via the data bus 5 .
- the functional unit 300 has the function of a so-called I/O unit that exchanges signals between equipment and devices to be controlled and various devices (sensors, actuators, etc.) arranged therein.
- the data bus 2 is, but not limited to, an I/O serial interface bus conforming to PCIe (PCI Express), for example.
- the signal line 3 is an optical fiber cable or an electrical signal cable and transmits a synchronous signal.
- Signal line 3 is connected between signal port 110 P of CPU unit 100 and signal port 210 P of expansion unit 200 .
- the CPU unit 100 uses the signal line 3 to transmit the synchronization signal to the extension unit 200 .
- the signal line 4 is an optical fiber cable or an electrical signal cable, and transmits time information (value X1).
- Signal line 4 is connected between signal port 111P of CPU unit 100 and signal port 211P of expansion unit 200 .
- the CPU unit 100 uses the signal line 4 to transmit the time information (value X1) to the expansion unit 200 .
- Hardware circuits 13 and 23 communicate time information (value X1) using, for example, an asynchronous serial communication UART (Universal Asynchronous Receiver Transmitter).
- UART Universal Asynchronous Receiver Transmitter
- FIG. 4 is a diagram showing signal waveforms using UART. As shown in FIG. 4, the UART communicates in units of 8-bit data chunks. A Start bit and a Stop bit are respectively communicated before and after the 8-bit data block.
- FIG. 5 is a diagram showing a signal waveform corresponding to time information (value X1).
- value X1 of the FRC 131 is represented by 64 bits, eight 8-bit data chunks are transmitted as shown in FIG.
- FIG. 6 is a diagram showing the flow of data accompanying the waveform of the synchronization signal.
- the synchronization signal is output at regular intervals.
- the constant period is, for example, several ms to several tens of ms.
- the latch section 133 latches the value X1 of the FRC131 and the latch section 232 latches the value X2 of the FRC231.
- the time information indicating the value X1 held in the latch section 133 is transmitted to the expansion unit 200 using, for example, UART.
- the value of the FRC 231 is corrected by the FRC corrector 234 using the difference Y1.
- the FRC correction unit 234 corrects the FRC231 value by subtracting the difference Y1 from the FRC231 value.
- the FRC correction unit 234 may collectively subtract the difference Y1 from the value of the FRC231. Alternatively, the FRC correction unit 234 may divide the difference Y1 into a plurality of correction units, and subtract the correction units from the value of the FRC 231 multiple times in the correction period. A correction unit and a correction cycle are set in advance. For example, if the difference Y1 is 2 ns, the correction unit is 1 ns, and the correction period is 100 ns, the FRC correction unit 234 subtracts 1 ns from the FRC 231 value at time t1 immediately after the difference Y1 is calculated.
- the FRC corrector 234 subtracts 1 ns from the value of the FRC 231 at time t1+100 ns.
- FRC231 and FRC131 are gradually synchronized.
- extreme changes in the value of FRC231 can be suppressed.
- the FRC 131 included in the hardware circuit 13 counts up according to a clock generated using a clock oscillation source (not shown) outside the hardware circuit 13 .
- FRC 231 included in hardware circuit 23 counts up according to a clock generated using a clock oscillation source (not shown) outside hardware circuit 23 . Therefore, due to an oscillation error (also referred to as static jitter) between the clock oscillation source of the CPU unit 100 and the clock oscillation source of the expansion unit 200, the period in which the FRC 131 counts up and the period in which the FRC 231 counts up may differ. There may be slight deviations in between.
- the control device corrects the difference between the values of FRC131 and FRC231 (hereinafter referred to as "clock deviation") caused by static jitter.
- FIG. 7 is a diagram schematically showing the configuration of a control device 1A according to Modification 1.
- the control device 1A includes a CPU unit 100A and an extension unit 200A.
- the CPU unit 100A differs from the CPU unit 100 shown in FIG. 1 in that it includes a hardware circuit 13A instead of the hardware circuit 13.
- FIG. Expansion unit 200A is different from expansion unit 200 shown in FIG. 1 in that it includes hardware circuit 23A instead of hardware circuit 23 . Note that the memories 11 and 21 and the storages 12 and 22 are omitted from FIG.
- the hardware circuit 13A differs from the hardware circuit 13 in that it has a latch section 133A instead of the latch section 133 and further has an FRC 134. Note that the synchronization signal output unit 132 of the hardware circuit 13A repeatedly outputs the synchronization signal.
- the FRC 134 is a counter that counts up at regular intervals, such as a 64-bit counter. Various counters may be employed instead of the FRC 134 .
- FRCs 131 and 134 count up according to a clock generated using a clock oscillation source (not shown) provided in CPU unit 100A. Therefore, the FRCs 131 and 134 count up in the same period.
- the hardware circuit 23A has a latch section 232A, a difference calculation section 233A and an FRC correction section 234A in place of the latch section 232, the difference calculation section 233 and the FRC correction section 234 compared to the hardware circuit 23. It is different in that it has
- the FRC 235 is a counter that counts up at regular intervals, such as a 64-bit counter. Various counters may be employed instead of the FRC 235 .
- FRCs 231 and 235 count up according to a clock generated using a clock oscillation source (not shown) provided in expansion unit 200A. Therefore, the FRCs 231 and 235 count up in the same period.
- the latch section 232A performs the following operations. That is, the latch section 232A latches the value X4 of the FRC 235 when receiving the synchronization signal from the signal line 3.
- the FRC correction unit 234A performs the following operations in addition to the operations of the FRC correction unit 234. That is, the FRC corrector 234A corrects the FRC 231 based on the difference Y2.
- the synchronization signal output section 132 of the CPU unit 100A outputs the synchronization signal to the expansion unit 200A.
- the synchronization signal is also output to the latch section 133A (see (21) in the figure).
- the latch section 133A of the CPU unit 100A latches the value X3 of the FRC 134 when the synchronization signal was output in response to the synchronization signal input (see (22) in the figure).
- the latch section 232A of the extension unit 200A latches the value X4 of the FRC 235 when the synchronization signal is received (see (23) in the figure) in response to the synchronization signal input.
- the latch unit 133A calculates the difference dX3 between the value X3′ of the FRC 134 latched when the synchronization signal was output last time and the value X3 newly latched, and outputs the difference dX3 to the expansion unit 200A ((24 )reference).
- the latch unit 232A calculates the difference dX4 between the value X4' of the FRC 235 latched when the previous synchronization signal was input and the newly latched value X4, and outputs the difference dX4 to the difference calculation unit 233A (( 25)).
- the difference calculator 233A calculates the difference Y2 between the difference dX4 and the difference dX3 (see (26) in the figure).
- the difference calculator 233A outputs the calculated difference Y2 to the FRC corrector 234 (see (27) in the figure).
- the FRC correction unit 234A corrects the FRC 231 based on the difference Y2 (see (28) in the figure).
- the difference Y2 indicates the difference between the count number of FRC134 and the count number of FRC235 in the target period from the output of the previous synchronization signal to the output of the current synchronization signal.
- FRCs 131 and 134 count up in the same period.
- FRCs 231 and 235 count up in the same cycle. Therefore, the difference between the FRC131 count number and the FRC231 count number in the target period is also the difference Y2.
- the FRC corrector 234A corrects the value of the FRC 231 by the difference Y2, thereby correcting the clock deviation caused by the static jitter.
- the FRC231 is once synchronized with the FRC131 according to the synchronization processes (1) to (7) shown in FIG.
- clock deviation due to static jitter continues to occur. Therefore, the FRC correction unit 234A continues to periodically correct the FRC 231 based on the difference Y2.
- the FRC corrector 234 corrects the clock deviation at a predetermined correction cycle. Assuming that the target period from the output of the previous synchronization signal to the output of the current synchronization signal is T1, and the correction period is T2, the FRC correction unit 234 performs (Y2/T1) ⁇ T2 for each correction period. FRC231 should be corrected. This always cancels clock deviations due to static jitter.
- Dynamic jitter includes, for example, transmission delay of synchronization signals. According to Modification 1, the clock deviation caused by static jitter is always cancelled. Therefore, even if the output cycle of the synchronization signal is lengthened, it is possible to avoid excessive deviation between the values of FRC131 and FRC231 due to dynamic jitter. This reduces the load required for the synchronization processing by the CPU 10 when the synchronization processing according to (11) to (16) shown in FIG. 2 is repeatedly executed after the firmware is activated.
- the CPU 10 may disable only the output operation of the time information by the latch section 133A and enable the output operation of the difference dX3 by the latch section 133A. This allows the hardware circuits 13A and 23A to continue correcting clock deviations caused by static jitter even after the firmware has started.
- the CPU 10 may disable the operation of outputting the difference dX3 by the latch section 133A after the firmware is activated.
- the firmware includes an instruction to calculate the difference Y2 between the difference dX3 calculated by the latch section 133A and the difference dX4 calculated by the latch section 232A, and an instruction to correct the FRC 231 based on the difference Y2.
- the CPU 10 may correct the FRC 231 based on the difference Y2 according to these commands of the firmware. This allows the CPU 10 to continue correcting the clock deviation caused by static jitter after the firmware is started.
- modification of the firmware is required.
- the CPU 10 preferably enables the output operation of the difference dX3 by the latch section 133A after the firmware is started.
- FIG. 8 is a diagram schematically showing the configuration of a control device 1B according to Modification 2.
- the control device 1B includes a CPU unit 100B and an expansion unit 200B.
- the CPU unit 100B differs from the CPU unit 100 shown in FIG. 1 in that it includes a hardware circuit 13B instead of the hardware circuit 13.
- FIG. Expansion unit 200B is different from expansion unit 200 shown in FIG. 1 in that it includes hardware circuit 23B instead of hardware circuit 23 .
- the memories 11 and 21 and the storages 12 and 22 are omitted from FIG.
- Modification 2 may be combined with Modification 1.
- FIG. 1 the control device 1B includes a CPU unit 100B and an expansion unit 200B.
- the CPU unit 100B differs from the CPU unit 100 shown in FIG. 1 in that it includes a hardware circuit 13B instead of the hardware circuit 13.
- FIG. Expansion unit 200B is different from expansion unit 200 shown in FIG. 1 in that it includes hardware circuit 23B instead of hardware circuit 23 .
- the hardware circuit 13B differs from the hardware circuit 13 in that it includes a light emitting element 135.
- the hardware circuit 23B differs from the hardware circuit 23 in that it includes a light-emitting element 236 .
- the light emitting elements 135, 236 are, for example, light emitting diodes. Light-emitting elements 135 and 236 blink according to the values of FRC 131 and 231, respectively. Specifically, the light emitting elements 135 and 236 emit light when the FRCs 131 and 231 reach preset values. Before starting the firmware, the FRCs 131 and 231 are synchronized by the processes (1) to (7) shown in FIG. After starting the firmware, the FRCs 131 and 231 are synchronized by the processes (11) to (15) shown in FIG. Therefore, the light emitting elements 135 and 236 emit light at the same timing.
- the blinking cycles of the light emitting elements of the units are synchronized, and a sense of unity can be given to the user. Conversely, the user can recognize that some kind of abnormality has occurred by visually confirming that the blinking cycles of the light emitting elements of the units are not synchronized.
- Modification 3 In Modification 1, each of the CPU unit 100A and the expansion unit 200A has two FRCs. Therefore, the scale of the hardware circuit increases. Modification 3 is a mode in which the clock deviation caused by static jitter is continuously corrected while suppressing an increase in the scale of the hardware circuit.
- FIG. 9 is a diagram schematically showing the configuration of a control device 1C according to Modification 3.
- the control device 1C includes a CPU unit 100C and an expansion unit 200C.
- the CPU unit 100C differs from the CPU unit 100A shown in FIG. 7 in that it includes a hardware circuit 13C instead of the hardware circuit 13A.
- Expansion unit 200C differs from expansion unit 200A shown in FIG. 7 in that it includes hardware circuit 23C instead of hardware circuit 23A. 9, the memories 11 and 21 and the storages 12 and 22 are omitted in the same manner as in FIG.
- the hardware circuit 13C differs from the hardware circuit 13A in that it has a synchronization signal output section 132C, a latch section 133C and a signal interval counting section 136 instead of the synchronization signal output section 132, the latch section 133A and the FRC 134. do.
- the signal interval counting unit 136 includes a counter that counts up according to a clock generated using a clock oscillation source (not shown) provided in the CPU unit 100C.
- the signal interval counting section 136 outputs an output instruction to the synchronization signal output section 132C at the timing when the counter value reaches a certain value T.
- FIG. The signal interval counting section 136 resets the counter value to 0 when outputting the output instruction to the synchronization signal output section 132C.
- the value T corresponds to a constant cycle for outputting the synchronization signal and is set in advance. If the frequency of the clock generated using the clock oscillation source (not shown) is 125 MHz, the value T is, for example, 125000 (corresponding to 1 ms).
- the signal interval counting section 136 may include a 16-bit counter. That is, the signal interval counting unit 136 includes a counter smaller in scale than the 64-bit FRC 134 (see FIG. 7). Therefore, as compared with Modification 1, an increase in the scale of the hardware circuit 13C is suppressed.
- the synchronization signal output section 132C outputs the synchronization signal to the expansion unit 200C in response to receiving the output instruction from the signal interval counting section 136.
- the synchronization signal output from the synchronization signal output section 132C is also input to the latch section 133C.
- the FRC 131 also counts up according to a clock generated using a clock oscillation source (not shown) provided in the CPU unit 100C. Therefore, the counter included in the signal interval counting unit 136 and the FRC 131 count up at the same period.
- the latch section 133C performs the same operation as the latch section 133 shown in FIG. That is, the latch section 133C latches the value X1 of the FRC 131 when the synchronization signal is output, and outputs time information including the held value X1 to the extension unit 200C. Furthermore, the latch section 133C causes the value T set in the signal interval counting section 136 to be included in the time information.
- the hardware circuit 23C includes a latch unit 232A, a difference calculation unit 233A, an FRC correction unit 234A and a latch unit 232 instead of the FRC correction unit 235, a difference calculation unit 233C, an FRC correction unit 234C, and a signal interval measurement. It differs in that it has a portion 237 .
- the signal interval measuring section 237 includes a counter that counts up according to a clock generated using a clock oscillation source (not shown) provided in the expansion unit 200C.
- the signal interval measurement unit 237 outputs the counter value T1 to the difference calculation unit 233C at the timing of receiving the synchronization signal, and resets the counter value to 0.
- the value T1 output from the signal interval measuring section 237 represents the count-up from the timing at which the previous synchronization signal was received to the timing at which the current synchronization signal was received.
- the signal interval measuring section 237 may include a counter of the same scale as the signal interval counting section 136 . That is, the signal interval measurement unit 237 may include a counter smaller in scale than the 64-bit FRC 235 (see FIG. 7). Therefore, as compared with Modification 1, an increase in the scale of the hardware circuit 23C is suppressed.
- the FRC 231 also counts up according to a clock generated using a clock oscillation source (not shown) provided in the expansion unit 200C. Therefore, the counter included in signal interval measuring section 237 and FRC 231 count up at the same period. Therefore, the signal interval measuring section 237 measures the value T1 as the difference between the value of the FRC 231 when the previous synchronization signal was output and the value of the FRC 231 when the current synchronization signal was output.
- the FRC correction unit 234C corrects the FRC 231 based on the difference Z in addition to the operation of the FRC correction unit 234 shown in FIG.
- the signal interval counting section 136 of the CPU unit 100C outputs an output instruction to the synchronization signal output section 132C at the timing when the counter value reaches a preset value T, and resets the counter value to 0 (see (31)).
- the synchronization signal output section 132C outputs the synchronization signal to the expansion unit 200C according to the output instruction.
- the synchronization signal is also output to the latch section 133C of the CPU unit 100C (see (32) in the figure).
- the latch unit 133C latches the value X1 of the FRC 131 when the synchronization signal is output in response to the input of the synchronization signal, and extends the time information including the value X1 and the value T set in the signal interval counting unit 136. Output to the unit 200C (see (33) in the figure).
- the latch section 232 of the extension unit 200C latches the value X2 of the FRC 231 when receiving the synchronization signal in response to the input of the synchronization signal, and outputs the value X2 to the difference calculation section 233C (see (34) in the figure). .
- the signal interval measuring section 237 of the extension unit 200C measures the value T1, which is the count-up from the timing at which the previous synchronization signal is received to the timing at which the current synchronization signal is received, in response to the input of the synchronization signal.
- T1 is output to the difference calculator 233C (see (35) in the figure).
- the difference calculator 233C calculates the difference Y1 between the values X2 and X1 and the difference Z between the values T1 and T (see (36) in the figure).
- the difference calculator 233C outputs the calculated differences Y1 and Z to the FRC corrector 234C (see (37) in the figure).
- the FRC correction unit 234C corrects the FRC 231 based on the differences Y1 and Z (see (38) in the figure).
- the method of correcting the FRC 231 based on the difference Y1 is as described above.
- the method of correcting FRC231 based on difference Z is the same as the method of correcting FRC231 based on difference Y2.
- the difference Z indicates the difference between the count number of the signal interval counting section 136 and the count number of the signal interval measuring section 237 in the target period from the output of the previous synchronization signal to the output of the current synchronization signal.
- the counter included in the signal interval counting section 136 and the FRC 131 count up at the same period.
- the counter included in the signal interval measuring section 237 and the FRC 231 count up at the same period.
- the difference Z is therefore the clock deviation due to static jitter.
- the FRC correction unit 234C continues to periodically correct the FRC 231 based on the difference Z. For example, the FRC corrector 234C corrects the clock deviation at a predetermined correction period. Assuming that the target period from the output of the previous synchronization signal to the output of the current synchronization signal is T1, and the correction period is T2, the FRC correction unit 234C performs (Z/T1) ⁇ T2 for each correction period. FRC231 should be corrected. This always cancels clock deviations due to static jitter.
- FIG. 10 is a diagram showing the flow of data accompanying the waveform of the synchronization signal in Modification 3.
- FIG. 10 shows the data flow for correction of clock deviation due to static jitter.
- the synchronizing signal is output at a constant cycle indicated by the value T.
- time information including the value T is output from the CPU unit 100C to the extension unit 200C.
- the signal interval measuring section 237 of the extension unit 200C measures a value T1 that is the count-up from the timing at which the previous synchronization signal was received to the timing at which the current synchronization signal is received. For example, when a synchronization signal is received at timing t1, a value T11 is measured which is a count-up from timing t0 at which the previous synchronization signal was received to timing t1. Then, the difference Z1 between the value T11 and the value T is calculated, and the FRC 231 is corrected based on the difference Z1 .
- the clock deviation caused by static jitter also depends on temperature and other factors. Therefore, the value T1 measured each time the synchronization signal is received may change depending on the environment. Therefore, by measuring the value T1 at regular intervals, the clock deviation caused by the static jitter is appropriately corrected according to the environment.
- FIG. 11 is a diagram showing a signal distribution method when there are a plurality of extension units. As shown in FIG. 11, each of signal lines 3 and 4 connects CPU unit 100 and a plurality of expansion units 200 in a multi-drop configuration. Therefore, the synchronizing signal and time information output from the CPU unit 100 are distributed to the plurality of expansion units 200 via the signal lines 3 and 4, respectively.
- the data bus 2 conforming to PCIe connects the CPU unit 100 and each of the plurality of expansion units 200 on a one-to-one basis.
- the CPU unit 100 may be replaced with any one of the CPU units 100A, 100B, and 100C.
- each of the plurality of expansion units 200 may be replaced with one of expansion units 200A, 200B, and 200C.
- the first hardware circuit comprises: a first counter (131); a signal output unit (132, 132C) that outputs a synchronization signal to the second unit; a time information output unit (133, 133A, 133C) that outputs a first value of the first counter when the synchronization signal is output to the second unit;
- the second hardware circuit comprises: a second counter (231); a difference calculator (233, 233A, 233C) for calculating a first difference between the second value of the second counter and the first value when the synchronization signal is received; and a correction unit (234, 234A, 234C) that corrects the second counter
- said first hardware circuit (13A) further comprising a third counter (134);
- the second hardware circuit (23A) further comprises a fourth counter (235),
- the signal output unit (132) repeatedly outputs the synchronization signal,
- the time information output unit (133A) further outputs the value of the third counter when the previous synchronization signal was output and the value of the third counter when the current synchronization signal was output.
- the difference calculator (233A) further calculating a third difference between the value of the fourth counter when receiving the previous synchronization signal and the value of the fourth counter when receiving the synchronization signal this time; calculating a fourth difference between the second difference and the third difference;
- the signal output unit (132C) outputs the synchronization signal each time the value of the first counter increases by a constant value
- the time information output section (133C) further outputs the constant value to the second unit
- the second hardware circuit (23C) stores the value of the second counter when the previous synchronization signal was output and the value of the second counter when the current synchronization signal was output.
- the difference calculator (233C) further calculates a third difference between the second difference and the constant value
- the control device (1C) according to claim 1, wherein said correction section (234C) corrects said second counter based on said third difference.
- the first unit (100B) further comprises a first light emitting element (135) that blinks according to the value of the first counter, 4.
- the control device (1B) according to any one of configurations 1 to 3, wherein the second unit (100C) further comprises a second light emitting element (236) that blinks according to the value of the second counter.
- Composition 5 said first unit further comprising a processor (10) executing firmware
- the firmware includes an instruction for setting the timing for outputting the synchronization signal to the signal output unit, The signal output unit outputs the synchronization signal when the value of the first counter reaches the timing,
- the firmware further: instructions for calculating a fifth difference between the second value and the timing; an instruction to correct the second counter based on the fifth difference;
- the control device according to configuration 1, wherein the processor disables the operation of the time information output unit after the firmware is activated.
- composition 6 the first hardware circuit is an ASIC or FPGA; 6.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
This control device is provided with a first unit and a second unit. A first hardware circuit of the first unit has a first counter, a signal output part that outputs a synchronization signal to the second unit, and a time information output part that outputs a first value of the first counter to the second unit when the synchronization signal has been output. A second hardware circuit of the second unit has a second counter, a difference calculation part that calculates a first difference between the first value and a second value of the second counter when the synchronization signal has been received, and a correction part that corrects the second counter on the basis of the first difference. This allows for a reduction in the time required to determine the cause of an error that may have occurred before startup of the firmware.
Description
本開示は、制御装置に関する。
The present disclosure relates to a control device.
様々な生産現場において、PLC(プログラマブルロジックコントローラ)などの制御装置を用いたFA(Factory Automation)技術が広く普及している。PLCは、一般に基本ユニット(CPU(Central Processing Unit)ユニット)と拡張ユニットとを含む。CPUユニットから取得したデータと拡張ユニットから取得したデータとの間に時間的なずれが生じないように、CPUユニットのカウンタ(タイマー)と拡張ユニットのカウンタとが同期される。
FA (Factory Automation) technology using control devices such as PLCs (Programmable Logic Controllers) is widely used in various production sites. A PLC generally includes a basic unit (CPU (Central Processing Unit) unit) and an expansion unit. A counter (timer) of the CPU unit and a counter of the expansion unit are synchronized so that there is no time lag between the data acquired from the CPU unit and the data acquired from the expansion unit.
たとえば、特開2017-79009号公報(特許文献1)には、CPUユニットタイマーの時刻と拡張ユニットタイマーの時刻とを同期させる技術が開示されている。具体的には、CPUユニットから拡張ユニットに同期信号が送信される。拡張ユニットは、同期信号に応じて、拡張ユニットタイマーの時刻をCPUユニットタイマーの時刻に同期させる。
For example, Japanese Patent Application Laid-Open No. 2017-79009 (Patent Document 1) discloses a technique for synchronizing the time of the CPU unit timer and the time of the expansion unit timer. Specifically, a synchronization signal is transmitted from the CPU unit to the expansion unit. The expansion unit synchronizes the time of the expansion unit timer with the time of the CPU unit timer according to the synchronization signal.
特開2017-79009号公報に記載の技術では、CPUユニットのCPUは、ファームウェアを実行することにより、同期信号を送信する処理を実行する。そのため、ファームウェアの起動後でなければ、CPUユニットタイマーと拡張ユニットタイマーとが同期できない。したがって、ファームウェアの起動前において、CPUユニットタイマーと拡張ユニットタイマーとが同期していない。その結果、ファームウェアの起動前に不具合が発生した場合、複数のユニット間でのイベントの発生順序を整理することが困難となり、不具合の原因究明に時間がかかる。
In the technique described in Japanese Patent Application Laid-Open No. 2017-79009, the CPU of the CPU unit executes the process of transmitting the synchronization signal by executing firmware. Therefore, the CPU unit timer and the expansion unit timer cannot be synchronized until after the firmware has started. Therefore, the CPU unit timer and the expansion unit timer are out of sync before the firmware starts. As a result, if a problem occurs before the firmware is started, it becomes difficult to arrange the order of occurrence of events among a plurality of units, and it takes time to investigate the cause of the problem.
本開示は、上記の問題に鑑みてなされたものであり、その目的は、ファームウェアの起動前に発生した不具合の原因究明に要する時間を短縮できる制御装置を提供することである。
The present disclosure has been made in view of the above problems, and its purpose is to provide a control device that can shorten the time required to investigate the cause of a problem that occurred before starting the firmware.
本開示の一例によれば、制御装置は、データを遣り取りする第1のユニットおよび第2のユニットを備える。第1のユニットは、第1のハードウェア回路を含む。第2のユニットは、第2のハードウェア回路を含む。第1のハードウェア回路は、第1のカウンタと、同期信号を前記第2のユニットに出力する信号出力部と、同期信号が出力されたときの第1のカウンタの第1の値を第2のユニットに出力する時刻情報出力部と、を有する。第2のハードウェア回路は、第2のカウンタと、同期信号を受けたときの第2のカウンタの第2の値と第1の値との第1の差分を計算する差分計算部と、第1の差分に基づいて、第2のカウンタを補正する補正部と、を有する。
According to one example of the present disclosure, the control device includes a first unit and a second unit that exchange data. The first unit includes a first hardware circuit. A second unit includes a second hardware circuit. A first hardware circuit includes a first counter, a signal output section for outputting a synchronization signal to the second unit, and a first value of the first counter when the synchronization signal is output to a second unit. and a time information output unit for outputting to the unit. The second hardware circuit includes: a second counter; a difference calculator that calculates a first difference between a second value and a first value of the second counter when receiving the synchronization signal; and a correction unit that corrects the second counter based on the difference of 1.
上記の開示によれば、第1のカウンタと第2のカウンタとの同期処理は、第1のユニットの第1のハードウェア回路および第2のユニットの第2のハードウェア回路によって実行される。そのため、制御装置に電源を投入した直後から、第1のカウンタと第2のカウンタとの同期処理が開始される。したがって、ファームウェアが起動される前において、第1のカウンタと第2のカウンタとが同期する。そのため、ファームウェアが起動するまでの間であっても、第1のユニットおよび第2のユニットにおけるイベントの発生順序を整理することが容易となる。その結果、ファームウェアの起動前に発生した不具合の原因究明に要する時間を短縮できる。
According to the above disclosure, synchronization processing between the first counter and the second counter is performed by the first hardware circuit of the first unit and the second hardware circuit of the second unit. Therefore, immediately after the control device is powered on, synchronization processing between the first counter and the second counter is started. Therefore, the first and second counters are synchronized before the firmware is activated. Therefore, even before the firmware is activated, it becomes easy to arrange the order of occurrence of events in the first unit and the second unit. As a result, it is possible to shorten the time required to investigate the cause of a problem that occurred before the firmware was started.
上述の開示において、第1のハードウェア回路は、第3のカウンタをさらに有する。第2のハードウェア回路は、第4のカウンタをさらに有する。信号出力部は、同期信号を繰り返し出力する。時刻情報出力部は、さらに、前回の同期信号が出力されたときの第3のカウンタの値と今回の同期信号が出力されたときの第3のカウンタの値との第2の差分を第2のユニットに出力する。差分計算部は、さらに、前回の同期信号を受けたときの第4のカウンタの値と今回の同期信号を受けたときの第4のカウンタの値との第3の差分を計算し、第2の差分と第3の差分との第4の差分を計算する。補正部は、第4の差分に基づいて、第2のカウンタを補正する。
In the above disclosure, the first hardware circuit further comprises a third counter. The second hardware circuit further has a fourth counter. The signal output section repeatedly outputs the synchronization signal. The time information output unit further outputs a second difference between the value of the third counter when the previous synchronization signal was output and the value of the third counter when the current synchronization signal was output as a second difference. output to the unit of The difference calculation unit further calculates a third difference between the value of the fourth counter when receiving the previous synchronization signal and the value of the fourth counter when receiving the synchronization signal this time. Compute a fourth difference between the difference of and the third difference. The correction unit corrects the second counter based on the fourth difference.
上記の開示によれば、第4の差分は、前回の同期信号が出力されてから今回の同期信号が出力されるまでの対象期間における、第3のカウンタのカウント数と第4のカウンタのカウント数との差を示す。第1のカウンタと第3のカウンタとは、同じハードウェア回路に含まれるため、同じクロック発振源のクロックに従って同一周期でカウントアップする。同様に、第2のカウンタと第4のカウンタとは、同じハードウェア回路に含まれるため、同じクロック発振源のクロックに従って同一周期でカウントアップする。そのため、対象期間における第1のカウンタのカウント数と第2のカウンタのカウント数との差も第4の差分となる。補正部によって第4の差分に基づいて第2のカウンタが補正されることにより、クロック発信源の発振誤差に起因する、第1のカウンタと第2のカウンタとの値のずれが補正される。
According to the above disclosure, the fourth difference is the count number of the third counter and the count number of the fourth counter in the target period from the output of the previous synchronization signal to the output of the current synchronization signal. Show the difference with the number. Since the first counter and the third counter are included in the same hardware circuit, they count up in the same period according to the clock from the same clock oscillation source. Similarly, since the second counter and the fourth counter are included in the same hardware circuit, they count up in the same cycle according to the clock from the same clock oscillation source. Therefore, the difference between the count number of the first counter and the count number of the second counter in the target period is also the fourth difference. The correction unit corrects the second counter based on the fourth difference, thereby correcting the difference between the values of the first counter and the second counter caused by the oscillation error of the clock source.
あるいは、信号出力部は、第1のカウンタの値が一定値だけ増大するたびに、同期信号を出力してもよい。時刻情報出力部は、さらに一定値を第2のユニットに出力する。第2のハードウェア回路は、前回の同期信号が出力されたときの第2のカウンタの値と今回の同期信号が出力されたときの第2のカウンタの値との第2の差分を測定する測定部をさらに有する。差分計算部は、さらに、第2の差分と一定値との第3の差分を計算する。補正部は、第3の差分に基づいて、第2のカウンタを補正する。
Alternatively, the signal output unit may output the synchronization signal each time the value of the first counter increases by a constant value. The time information output section also outputs a constant value to the second unit. The second hardware circuit measures a second difference between the value of the second counter when the previous synchronization signal was output and the value of the second counter when the current synchronization signal was output. It further has a measurement part. The difference calculator further calculates a third difference between the second difference and the constant value. The correction unit corrects the second counter based on the third difference.
上記の開示によれば、第3の差分は、第1のカウンタの値が一定値だけ増大する対象期間における、第1のカウンタのカウント数と第2のカウンタのカウント数との差となる。補正部によって第3の差分に基づいて第2のカウンタが補正されることにより、クロック発信源の発振誤差に起因する、第1のカウンタと第2のカウンタとの値のずれが補正される。また、第3,第4のカウンタを備える形態と比較して、第1,第2のハードウェア回路の規模を小さくすることができる。
According to the above disclosure, the third difference is the difference between the count number of the first counter and the count number of the second counter in the target period in which the value of the first counter increases by a constant value. The correction unit corrects the second counter based on the third difference, thereby correcting the difference between the values of the first counter and the second counter caused by the oscillation error of the clock source. Also, the scale of the first and second hardware circuits can be reduced as compared with the form having the third and fourth counters.
上述の開示において、第1のユニットは、第1のカウンタの値に従って点滅する第1の発光素子をさらに備える。第2のユニットは、第2のカウンタの値に従って点滅する第2の発光素子をさらに備える。
In the above disclosure, the first unit further includes a first light emitting element that blinks according to the value of the first counter. The second unit further comprises a second light emitting element that blinks according to the value of the second counter.
上記の開示によれば、第1の発光素子と第2の発光素子との点滅周期が同期し、ユーザに統一感を与えることができる。逆に、ユーザは、第1の発光素子と第2の発光素子との点滅周期が同期していないことを視認することにより、何らかの異常が発生していることを把握できる。
According to the above disclosure, the blinking cycles of the first light emitting element and the second light emitting element are synchronized, and a sense of unity can be given to the user. Conversely, the user can recognize that some kind of abnormality has occurred by visually confirming that the blinking cycles of the first light emitting element and the second light emitting element are not synchronized.
上述の開示において、第1のユニットは、ファームウェアを実行するプロセッサをさらに備える。ファームウェアは、信号出力部に対して、同期信号を出力するタイミングを設定する命令を含む。信号出力部は、第1のカウンタの値がタイミングに到達したときに同期信号を出力する。ファームウェアは、さらに、第2の値と上記のタイミングとの第5の差分を計算する命令と、第5の差分に基づいて第2のカウンタを補正させる命令と、を含む。プロセッサは、ファームウェアの起動後に、時刻情報出力部の動作を無効にする。
In the above disclosure, the first unit further comprises a processor executing firmware. The firmware includes instructions for setting the timing of outputting the synchronization signal to the signal output section. The signal output unit outputs a synchronization signal when the value of the first counter reaches the timing. The firmware further includes instructions to calculate a fifth difference between the second value and the timing, and instructions to correct the second counter based on the fifth difference. The processor disables the operation of the time information output section after starting the firmware.
上記の開示によれば、ファームウェアの起動後には、プロセッサは、ファームウェアに従って、第1のカウンタと第2のカウンタとを同期できる。
According to the above disclosure, after the firmware is activated, the processor can synchronize the first counter and the second counter according to the firmware.
上述の開示において、第1のハードウェア回路は、ASICまたはFPGAである。第2のハードウェア回路は、ASICまたはFPGAである。
In the above disclosure, the first hardware circuit is an ASIC or FPGA. The second hardware circuit is an ASIC or FPGA.
本開示によれば、ファームウェアの起動前に発生した不具合の原因究明に要する時間を短縮できる。
According to this disclosure, it is possible to reduce the time required to investigate the cause of a problem that occurred before the firmware was started.
本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。
Embodiments of the present invention will be described in detail with reference to the drawings. The same or corresponding parts in the drawings are denoted by the same reference numerals, and the description thereof will not be repeated.
§1 適用例
まず、本発明が適用される場面の一例について説明する。図1は、本実施の形態に係る制御装置1の構成の一例を模式的に示す図である。制御装置1は、たとえばPLCに相当する。以下の説明においては、「制御装置」の典型例として、PLCを具体例として説明するが、PLCに限定されることなく、本明細書に開示された技術思想は、任意の制御装置に対して適用可能である。 §1 Application Example First, an example of a scene to which the present invention is applied will be described. FIG. 1 is a diagram schematically showing an example of the configuration of acontrol device 1 according to this embodiment. The control device 1 corresponds to a PLC, for example. In the following description, a PLC will be described as a specific example as a typical example of the "control device", but the technical idea disclosed in this specification is not limited to the PLC, and can be applied to any control device. Applicable.
まず、本発明が適用される場面の一例について説明する。図1は、本実施の形態に係る制御装置1の構成の一例を模式的に示す図である。制御装置1は、たとえばPLCに相当する。以下の説明においては、「制御装置」の典型例として、PLCを具体例として説明するが、PLCに限定されることなく、本明細書に開示された技術思想は、任意の制御装置に対して適用可能である。 §1 Application Example First, an example of a scene to which the present invention is applied will be described. FIG. 1 is a diagram schematically showing an example of the configuration of a
図1に示されるように、制御装置1は、データを遣り取りするCPUユニット100および拡張ユニット200を備える。なお、図1において、制御装置1は、1台の拡張ユニット200を備えているが、複数台の拡張ユニット200を備えていてもよい。CPUユニット100は、データバス2および信号線3,4を介して、拡張ユニット200と接続する。
As shown in FIG. 1, the control device 1 includes a CPU unit 100 and an expansion unit 200 that exchange data. In addition, although the control device 1 includes one expansion unit 200 in FIG. 1 , it may be provided with a plurality of expansion units 200 . CPU unit 100 is connected to expansion unit 200 via data bus 2 and signal lines 3 and 4 .
CPUユニット100は、制御対象に応じて作成されたプログラムを実行するプログラム実行部を有している。より具体的には、CPUユニット100は、システムプログラムおよび各種のユーザプログラムを実行する演算処理部に相当する。
The CPU unit 100 has a program execution section that executes a program created according to the object to be controlled. More specifically, the CPU unit 100 corresponds to an arithmetic processing section that executes system programs and various user programs.
拡張ユニット200は、制御装置1の機能を拡張するために、CPUユニット100に対して、着脱自在に外付けされ得る。拡張ユニット200は、たとえば、通信処理または情報処理を実施し、ネットワークと制御装置1との間を仲介するように配置される。
The extension unit 200 can be detachably externally attached to the CPU unit 100 in order to extend the functions of the control device 1 . The expansion unit 200 is arranged to mediate between the network and the control device 1, for example performing communication processing or information processing.
CPUユニット100は、CPU10と、メモリ11と、ストレージ12と、ハードウェア回路13と、を含む。拡張ユニット200は、CPU20と、メモリ21と、ストレージ22と、ハードウェア回路23と、を含む。
The CPU unit 100 includes a CPU 10, a memory 11, a storage 12, and a hardware circuit 13. Expansion unit 200 includes CPU 20 , memory 21 , storage 22 and hardware circuit 23 .
CPU10は、ストレージ12に記憶されたファームウェアおよび各種のユーザプログラムを読み出し、メモリ11に展開して実行する。同様に、CPU20は、ストレージ22に記憶された各種のプログラムを読み出し、メモリ21に展開して実行する。
The CPU 10 reads the firmware and various user programs stored in the storage 12, develops them in the memory 11, and executes them. Similarly, the CPU 20 reads various programs stored in the storage 22, develops them in the memory 21, and executes them.
ハードウェア回路13およびハードウェア回路23は、たとえばFPGA(Field-Programmable Gate Array)またはASIC(Application Specific Integrated Circuit)である。
The hardware circuit 13 and the hardware circuit 23 are, for example, FPGA (Field-Programmable Gate Array) or ASIC (Application Specific Integrated Circuit).
ハードウェア回路13は、フリーランカウンタ(以下、「FRC」と称する。)131と、同期信号出力部132と、ラッチ部133と、を有する。
The hardware circuit 13 has a free-running counter (hereinafter referred to as "FRC") 131, a synchronization signal output section 132, and a latch section 133.
FRC131は、一定の周期でカウントアップするカウンタである。FRC131は、例えば64bitのカウンタである。なお、FRC131の代わりに、各種のカウンタが採用されてもよい。
The FRC 131 is a counter that counts up at regular intervals. FRC 131 is, for example, a 64-bit counter. Various counters may be employed instead of the FRC 131 .
同期信号出力部132は、信号線3を用いて、任意のタイミングで同期信号を拡張ユニット200に出力する。同期信号出力部132は、同期信号の出力タイミングを任意に生成する。あるいは、同期信号出力部132は、FRC131の値が設定値に到達したタイミングを、同期信号の出力タイミングとしてもよい。同期信号出力部132から出力された同期信号は、ラッチ部133にも入力される。
The synchronization signal output section 132 uses the signal line 3 to output the synchronization signal to the expansion unit 200 at arbitrary timing. The synchronization signal output unit 132 arbitrarily generates the output timing of the synchronization signal. Alternatively, the synchronization signal output unit 132 may set the timing at which the value of the FRC 131 reaches the set value as the timing for outputting the synchronization signal. The synchronization signal output from the synchronization signal output section 132 is also input to the latch section 133 .
ラッチ部133は、同期信号が出力されたときのFRC131の値X1をラッチする。さらに、ラッチ部133は、信号線4を用いて、保持している値X1を拡張ユニット200に出力する。ラッチ部133によってラッチされた値X1は、同期信号が出力されたときの時刻を示す時刻情報である。
The latch section 133 latches the value X1 of the FRC 131 when the synchronization signal is output. Furthermore, the latch section 133 outputs the held value X1 to the expansion unit 200 using the signal line 4 . The value X1 latched by the latch section 133 is time information indicating the time when the synchronization signal was output.
ハードウェア回路23は、FRC231と、ラッチ部232と、差分計算部233と、FRC補正部234と、を有する。
The hardware circuit 23 has an FRC 231 , a latch section 232 , a difference calculation section 233 and an FRC correction section 234 .
FRC231は、一定の周期でカウントアップするカウンタである。FRC231は、例えば64bitのカウンタである。なお、FRC231の代わりに、各種のカウンタが採用されてもよい。
The FRC 231 is a counter that counts up at regular intervals. FRC 231 is, for example, a 64-bit counter. Various counters may be employed instead of the FRC 231 .
ラッチ部232は、信号線3から同期信号を受けたときのFRC231の値X2をラッチする。ラッチ部232は、保持している値X2を差分計算部233に出力する。
The latch section 232 latches the value X2 of the FRC 231 when receiving the synchronization signal from the signal line 3 . The latch section 232 outputs the held value X2 to the difference calculation section 233 .
差分計算部233は、ラッチ部232から出力される値X2(つまり、同期信号を受けたときのFRC231の値)と信号線4から受けた値X1(つまり、同期信号が出力されたときのFRC131の値)との差分Y1(=X2-X1)を計算する。差分計算部233は、差分Y1をFRC補正部234に出力する。
The difference calculation unit 233 calculates the value X2 output from the latch unit 232 (that is, the value of the FRC 231 when the synchronization signal is received) and the value X1 received from the signal line 4 (that is, the value of the FRC 131 when the synchronization signal is output). ) and the difference Y1 (=X2-X1) is calculated. The difference calculator 233 outputs the difference Y1 to the FRC corrector 234 .
FRC補正部234は、差分Y1に基づいて、FRC231を補正する。すなわち、FRC補正部234は、FRC131とFRC231とが同期するように、差分Y1だけFRC231の値を補正する。
The FRC correction unit 234 corrects the FRC 231 based on the difference Y1. That is, the FRC correction unit 234 corrects the value of the FRC231 by the difference Y1 so that the FRC131 and the FRC231 are synchronized.
次に、制御装置1において実行される、FRC131,231の同期処理の流れについて説明する。
Next, the flow of synchronization processing of the FRCs 131 and 231 executed by the control device 1 will be described.
まず、CPUユニット100の同期信号出力部132は、同期信号を拡張ユニット200に出力する。同期信号は、ラッチ部133にも出力される(図中(1)参照)。
First, the synchronous signal output section 132 of the CPU unit 100 outputs the synchronous signal to the extension unit 200 . The synchronization signal is also output to the latch section 133 (see (1) in the figure).
次に、CPUユニット100のラッチ部133は、同期信号の入力に応じて、同期信号が出力されたときのFRC131の値X1をラッチする(図中(2)参照)。拡張ユニット200のラッチ部232は、同期信号の入力に応じて、同期信号を受けたときのFRC231の値X2をラッチする(図中(3)参照)。
Next, the latch section 133 of the CPU unit 100 latches the value X1 of the FRC 131 when the synchronization signal was output according to the input of the synchronization signal (see (2) in the figure). The latch section 232 of the extension unit 200 latches the value X2 of the FRC 231 when receiving the synchronization signal in response to the input of the synchronization signal (see (3) in the figure).
ラッチ部133は、保持している値X1(同期信号が出力されたタイミングを示す時刻情報)を拡張ユニット200に出力する(図中(4)参照)。すなわち、ラッチ部133は、同期信号が出力されたときのFRC131の値X1を拡張ユニット200に出力する。
The latch unit 133 outputs the held value X1 (time information indicating the timing at which the synchronization signal was output) to the extension unit 200 (see (4) in the figure). That is, the latch section 133 outputs to the extension unit 200 the value X1 of the FRC 131 when the synchronization signal is output.
ラッチ部232は、保持している値X2を差分計算部233に出力する(図中(5)参照)。差分計算部233は、ラッチ部232が保持している値X2とCPUユニット100から受けた値X1との差分Y1を計算する(図中(6)参照)。差分計算部233は、計算結果である差分Y1をFRC補正部234に出力する(図中(7)参照)。
The latch unit 232 outputs the held value X2 to the difference calculation unit 233 (see (5) in the figure). The difference calculation section 233 calculates the difference Y1 between the value X2 held by the latch section 232 and the value X1 received from the CPU unit 100 (see (6) in the drawing). The difference calculator 233 outputs the calculated difference Y1 to the FRC corrector 234 (see (7) in the figure).
FRC補正部234は、差分Y1に基づいて、FRC231を補正する(図中(8)参照)。これにより、FRC231とFRC131とが同期される。(1)~(8)の処理は、繰り返し実行される。
The FRC correction unit 234 corrects the FRC 231 based on the difference Y1 (see (8) in the figure). Thereby, FRC231 and FRC131 are synchronized. The processes (1) to (8) are repeatedly executed.
このように、本実施の形態によれば、FRC231とFRC131との同期処理は、CPUユニット100のハードウェア回路13および拡張ユニット200のハードウェア回路23によって実行される。そのため、制御装置1に電源を投入した直後から、FRC231とFRC131との同期処理が開始される。したがって、ストレージ12に記憶されるファームウェアが起動される前において、FRC231とFRC131とが同期する。
Thus, according to the present embodiment, the synchronization processing between the FRC231 and the FRC131 is executed by the hardware circuit 13 of the CPU unit 100 and the hardware circuit 23 of the expansion unit 200. Therefore, synchronization processing between the FRC231 and the FRC131 is started immediately after the control device 1 is powered on. Therefore, the FRC231 and the FRC131 are synchronized before the firmware stored in the storage 12 is activated.
図2は、参考形態に係る制御装置1Zの構成を模式的に示す図である。図2に示されるように、制御装置1Zは、図1に示す制御装置1と比較して、CPUユニット100および拡張ユニット200の代わりに、CPUユニット100Zおよび拡張ユニット200Zをそれぞれ備える点で相違する。
FIG. 2 is a diagram schematically showing the configuration of the control device 1Z according to the reference embodiment. As shown in FIG. 2, the controller 1Z differs from the controller 1 shown in FIG. 1 in that it includes a CPU unit 100Z and an expansion unit 200Z instead of the CPU unit 100 and the expansion unit 200. .
CPUユニット100Zは、CPUユニット100と比較して、ハードウェア回路13の代わりにハードウェア回路13Zを含む点で相違する。ハードウェア回路13Zは、ハードウェア回路13と比較して、ラッチ部133を有さない点で相違する。
The CPU unit 100Z differs from the CPU unit 100 in that it includes a hardware circuit 13Z instead of the hardware circuit 13. The hardware circuit 13Z differs from the hardware circuit 13 in that it does not have the latch section 133. FIG.
拡張ユニット200Zは、拡張ユニット200と比較して、ハードウェア回路23の代わりにハードウェア回路23Zを含む点で相違する。ハードウェア回路23Zは、ハードウェア回路23と比較して、差分計算部233を有さない点で相違する。
The extension unit 200Z differs from the extension unit 200 in that it includes a hardware circuit 23Z instead of the hardware circuit 23. The hardware circuit 23Z is different from the hardware circuit 23 in that it does not have the difference calculator 233 .
このように、制御装置1Zでは、ハードウェア回路13Z,23Zにラッチ部133および差分計算部233が含まれないため、ハードウェア回路13Z,23Zだけでは、FRC231とFRC131とが同期されない。そのため、ストレージ12に記憶されるファームウェアを用いて、FRC231とFRC131とが同期される。
Thus, in the control device 1Z, the hardware circuits 13Z and 23Z do not include the latch section 133 and the difference calculation section 233, so the FRC 231 and the FRC 131 are not synchronized with the hardware circuits 13Z and 23Z alone. Therefore, the firmware stored in the storage 12 is used to synchronize the FRC231 and the FRC131.
ファームウェアは、ハードウェア回路13Zの同期信号出力部132に対して、同期信号を出力するタイミングX1を設定する命令と、ラッチ部232に保持される値X1を読み出す命令と、を含む。さらに、ファームウェアは、値X2とタイミングX1との差分Y1を計算する命令と、FRC補正部234に対して、差分Y1に基づいてFRC231を補正させる命令と、を含む。CPU10は、このような命令を含むファームウェアに従って、以下のように同期処理を実行する。
The firmware includes an instruction to set the timing X1 for outputting the synchronization signal to the synchronization signal output section 132 of the hardware circuit 13Z and an instruction to read the value X1 held in the latch section 232. Further, the firmware includes an instruction to calculate the difference Y1 between the value X2 and the timing X1, and an instruction to cause the FRC corrector 234 to correct the FRC 231 based on the difference Y1. The CPU 10 executes synchronization processing as follows according to firmware including such instructions.
まず、CPUユニット100ZのCPU10は、同期信号を出力するタイミングX1を同期信号出力部132に設定する(図中(11)参照)。同期信号出力部132は、FRC131の値がタイミングX1に到達すると、同期信号を拡張ユニット200Zに出力する(図中(12)参照)。
First, the CPU 10 of the CPU unit 100Z sets the synchronization signal output timing X1 in the synchronization signal output section 132 (see (11) in the figure). When the value of FRC131 reaches timing X1, the synchronization signal output section 132 outputs the synchronization signal to the expansion unit 200Z (see (12) in the figure).
拡張ユニット200Zのラッチ部232は、同期信号の入力に応じて、同期信号を受けたときのFRC231の値X2をラッチする(図中(13)参照)。
The latch section 232 of the expansion unit 200Z latches the value X2 of the FRC 231 when receiving the synchronization signal in response to the input of the synchronization signal (see (13) in the figure).
CPU10は、データバス2を介して、ラッチ部232に保持されている値X2を読み出す(図中(14)参照)。CPU10は、読み出したX2と同期信号出力部132に設定したタイミングX1との差分Y1(=X2-X1)を計算し、差分Y1をFRC補正部234に設定する(図中(15)参照)。
The CPU 10 reads out the value X2 held in the latch section 232 via the data bus 2 (see (14) in the figure). The CPU 10 calculates the difference Y1 (=X2-X1) between the read X2 and the timing X1 set in the synchronization signal output section 132, and sets the difference Y1 in the FRC correction section 234 (see (15) in the drawing).
FRC補正部234は、差分Y1に基づいて、FRC231を補正する(図中(16)参照)。これにより、FRC231とFRC131とが同期される。(11)~(16)の処理は、繰り返し実行される。
The FRC correction unit 234 corrects the FRC 231 based on the difference Y1 (see (16) in the figure). Thereby, FRC231 and FRC131 are synchronized. The processes (11) to (16) are repeatedly executed.
CPU10は、ファームウェアを実行することにより、図中(11)、(14)および(15)の処理を行なう。すなわち、ファームウェアが起動してから、FRC231とFRC131との同期処理が開始される。そのため、制御装置1Zに電源を投入してからファームウェアが起動するまでの間、FRC131とFRC231とが同期しない。その結果、この期間に不具合が発生した場合、CPUユニット100Zおよび拡張ユニット200Zにおけるイベントの発生順序を整理することが困難となり、不具合の原因究明に時間がかかる。
The CPU 10 performs the processes (11), (14) and (15) in the figure by executing the firmware. That is, after the firmware is activated, the synchronization processing between the FRC231 and the FRC131 is started. Therefore, the FRC131 and the FRC231 are not synchronized from when the control device 1Z is powered on until the firmware is activated. As a result, if a problem occurs during this period, it becomes difficult to arrange the order of occurrence of events in the CPU unit 100Z and the expansion unit 200Z, and it takes time to investigate the cause of the problem.
これに対し、本実施の形態に係る制御装置1では、ファームウェアが起動される前において、FRC231とFRC131とが同期する。そのため、電源を投入してからファームウェアが起動するまでの間であっても、CPUユニット100および拡張ユニット200におけるイベントの発生順序を整理することが容易となる。その結果、ファームウェアの起動前に発生した不具合の原因究明に要する時間を短縮できる。
On the other hand, in the control device 1 according to the present embodiment, the FRC231 and the FRC131 are synchronized before the firmware is activated. Therefore, it becomes easy to arrange the order of occurrence of events in the CPU unit 100 and the expansion unit 200 even after the power is turned on until the firmware is activated. As a result, it is possible to shorten the time required to investigate the cause of a problem that occurred before the firmware was started.
§2 具体例
<A.制御装置のユニットの構成例>
図3は、本実施の形態に係る制御装置1のユニットの構成例を示す模式図である。図3に示されるように、制御装置1は、CPUユニット100、1または複数の拡張ユニット200、および1または複数の機能ユニット300を含む。CPUユニット100は、データバス2および信号線3,4を介して、1または複数の拡張ユニット200と接続する。また、CPUユニット100は、データバス5を介して1または複数の機能ユニット300と接続する。 §2 Concrete example <A. Configuration example of unit of control device>
FIG. 3 is a schematic diagram showing a configuration example of units of thecontrol device 1 according to the present embodiment. As shown in FIG. 3 , the control device 1 includes a CPU unit 100 , one or more expansion units 200 and one or more functional units 300 . CPU unit 100 is connected to one or more expansion units 200 via data bus 2 and signal lines 3 and 4 . The CPU unit 100 also connects with one or more functional units 300 via the data bus 5 .
<A.制御装置のユニットの構成例>
図3は、本実施の形態に係る制御装置1のユニットの構成例を示す模式図である。図3に示されるように、制御装置1は、CPUユニット100、1または複数の拡張ユニット200、および1または複数の機能ユニット300を含む。CPUユニット100は、データバス2および信号線3,4を介して、1または複数の拡張ユニット200と接続する。また、CPUユニット100は、データバス5を介して1または複数の機能ユニット300と接続する。 §2 Concrete example <A. Configuration example of unit of control device>
FIG. 3 is a schematic diagram showing a configuration example of units of the
機能ユニット300は、制御対象の設備および装置、ならびに、それらに配置されている各種デバイス(センサやアクチュエータなど)との間で信号を遣り取りする、いわゆるI/Oユニットの機能を備える。
The functional unit 300 has the function of a so-called I/O unit that exchanges signals between equipment and devices to be controlled and various devices (sensors, actuators, etc.) arranged therein.
データバス2は、限定されないが、たとえばPCIe(PCI Express(ピーシーアイエクスプレス))に従うI/Oシリアルインタフェースのバスである。
The data bus 2 is, but not limited to, an I/O serial interface bus conforming to PCIe (PCI Express), for example.
信号線3は、光ファイバケーブルまたは電気的な信号ケーブルであり、同期信号を伝送する。信号線3は、CPUユニット100の信号ポート110Pと拡張ユニット200の信号ポート210Pとの間に接続される。CPUユニット100は、信号線3を用いて同期信号を拡張ユニット200に伝送する。
The signal line 3 is an optical fiber cable or an electrical signal cable and transmits a synchronous signal. Signal line 3 is connected between signal port 110 P of CPU unit 100 and signal port 210 P of expansion unit 200 . The CPU unit 100 uses the signal line 3 to transmit the synchronization signal to the extension unit 200 .
信号線4は、光ファイバケーブルまたは電気的な信号ケーブルであり、時刻情報(値X1)を伝送する。信号線4は、CPUユニット100の信号ポート111Pと拡張ユニット200の信号ポート211Pとの間に接続される。CPUユニット100は、信号線4を用いて時刻情報(値X1)を拡張ユニット200に伝送する。
The signal line 4 is an optical fiber cable or an electrical signal cable, and transmits time information (value X1). Signal line 4 is connected between signal port 111P of CPU unit 100 and signal port 211P of expansion unit 200 . The CPU unit 100 uses the signal line 4 to transmit the time information (value X1) to the expansion unit 200 .
<B.時刻情報の伝送>
ハードウェア回路13,23は、たとえば非同期シリアル通信UART(Universal Asynchronous Receiver Transmitter)を用いて、時刻情報(値X1)を通信する。 <B. Transmission of time information>
Hardware circuits 13 and 23 communicate time information (value X1) using, for example, an asynchronous serial communication UART (Universal Asynchronous Receiver Transmitter).
ハードウェア回路13,23は、たとえば非同期シリアル通信UART(Universal Asynchronous Receiver Transmitter)を用いて、時刻情報(値X1)を通信する。 <B. Transmission of time information>
図4は、UARTを用いた信号波形を示す図である。図4に示されるように、UARTでは、8bitのデータ塊の単位で通信が行なわれる。8bitのデータ塊の前後には、Start bitとStop bitとがそれぞれ通信される。
FIG. 4 is a diagram showing signal waveforms using UART. As shown in FIG. 4, the UART communicates in units of 8-bit data chunks. A Start bit and a Stop bit are respectively communicated before and after the 8-bit data block.
図5は、時刻情報(値X1)に対応する信号波形を示す図である。FRC131の値X1が64bitで表される場合、図5に示されるように、8bitのデータ塊が8個伝送される。
FIG. 5 is a diagram showing a signal waveform corresponding to time information (value X1). When the value X1 of the FRC 131 is represented by 64 bits, eight 8-bit data chunks are transmitted as shown in FIG.
<C.信号波形の例>
図6は、同期信号の波形に伴うデータの流れを示す図である。図6に示す例では、同期信号は、一定周期で出力される。一定周期は、たとえば数ms~数十msである。 <C. Example of signal waveform>
FIG. 6 is a diagram showing the flow of data accompanying the waveform of the synchronization signal. In the example shown in FIG. 6, the synchronization signal is output at regular intervals. The constant period is, for example, several ms to several tens of ms.
図6は、同期信号の波形に伴うデータの流れを示す図である。図6に示す例では、同期信号は、一定周期で出力される。一定周期は、たとえば数ms~数十msである。 <C. Example of signal waveform>
FIG. 6 is a diagram showing the flow of data accompanying the waveform of the synchronization signal. In the example shown in FIG. 6, the synchronization signal is output at regular intervals. The constant period is, for example, several ms to several tens of ms.
同期信号がアサートされるタイミングにおいて、FRC131の値X1がラッチ部133によってラッチされるとともに、FRC231の値X2がラッチ部232によってラッチされる。
At the timing when the synchronization signal is asserted, the latch section 133 latches the value X1 of the FRC131 and the latch section 232 latches the value X2 of the FRC231.
ラッチ部133に保持された値X1を示す時刻情報は、たとえばUARTを用いて、拡張ユニット200に伝送される。
The time information indicating the value X1 held in the latch section 133 is transmitted to the expansion unit 200 using, for example, UART.
差分計算部233は、ラッチ部232に保持された値X2と、伝送された時刻情報によって示される値X1との差分Y1(=X2-X1)を計算する。FRC231の値は、FRC補正部234によって、差分Y1を用いて補正される。
The difference calculation unit 233 calculates the difference Y1 (=X2-X1) between the value X2 held in the latch unit 232 and the value X1 indicated by the transmitted time information. The value of the FRC 231 is corrected by the FRC corrector 234 using the difference Y1.
<D.FRCの補正方法>
FRC補正部234は、FRC231の値から差分Y1を差し引くことにより、FRC231の値を補正する。 <D. FRC Correction Method>
TheFRC correction unit 234 corrects the FRC231 value by subtracting the difference Y1 from the FRC231 value.
FRC補正部234は、FRC231の値から差分Y1を差し引くことにより、FRC231の値を補正する。 <D. FRC Correction Method>
The
なお、FRC補正部234は、FRC231の値から差分Y1を一括で差し引いてもよい。あるいは、FRC補正部234は、差分Y1を複数の補正単位に分割し、FRC231の値から補正単位を差し引くことを補正周期で複数回繰り返してもよい。補正単位および補正周期は、予め設定される。たとえば、差分Y1が2nsであり、補正単位が1nsであり、補正周期が100nsである場合、FRC補正部234は、差分Y1が計算された直後の時刻t1においてFRC231の値から1ns差し引く。それから、FRC補正部234は、時刻t1+100nsにおいてFRC231の値から1ns差し引く。これにより、FRC231とFRC131とは、徐々に同期される。その結果、FRC231の値が極端に変化することを抑制できる。
Note that the FRC correction unit 234 may collectively subtract the difference Y1 from the value of the FRC231. Alternatively, the FRC correction unit 234 may divide the difference Y1 into a plurality of correction units, and subtract the correction units from the value of the FRC 231 multiple times in the correction period. A correction unit and a correction cycle are set in advance. For example, if the difference Y1 is 2 ns, the correction unit is 1 ns, and the correction period is 100 ns, the FRC correction unit 234 subtracts 1 ns from the FRC 231 value at time t1 immediately after the difference Y1 is calculated. Then, the FRC corrector 234 subtracts 1 ns from the value of the FRC 231 at time t1+100 ns. As a result, FRC231 and FRC131 are gradually synchronized. As a result, extreme changes in the value of FRC231 can be suppressed.
<E.ファームウェアの起動後の処理>
CPUユニット100のストレージ12が、図2に示す(11)、(14)および(15)の処理のための命令を含むファームウェアを記憶している場合、当該ファームウェアの起動後において、図2に示す(11)~(16)に従った同期処理が実行される。そのため、ストレージ12が当該ファームウェアを記憶している場合、CPU10は、当該ファームウェアの起動後に、ラッチ部133による時刻情報の出力動作を無効にする。たとえば、ラッチ部133は、フラグを有しており、フラグが「1」の場合に時刻情報の出力動作を行ない、フラグが「0」の場合に時刻情報の出力動作を行なわないように設定される。CPU10は、ファームウェアの起動後に当該フラグを「0」に切り替えればよい。フラグを「0」に切り替えられると、CPUユニット100から拡張ユニット200に時刻情報が出力されないため、拡張ユニット200において、差分計算部233の動作も無効化される。これにより、ファームウェアの起動後には、図1に示す(1)~(8)に従った同期処理が実行されない。 <E. Processing after starting the firmware>
If thestorage 12 of the CPU unit 100 stores firmware containing instructions for the processes (11), (14) and (15) shown in FIG. Synchronization processing according to (11) to (16) is executed. Therefore, when the storage 12 stores the firmware, the CPU 10 disables the output operation of the time information by the latch unit 133 after starting the firmware. For example, the latch unit 133 has a flag, and is set to output the time information when the flag is "1" and not to output the time information when the flag is "0". be. The CPU 10 may switch the flag to "0" after starting the firmware. When the flag is switched to "0", time information is not output from the CPU unit 100 to the extension unit 200, so the operation of the difference calculation section 233 is also disabled in the extension unit 200. FIG. As a result, synchronization processing according to (1) to (8) shown in FIG. 1 is not executed after the firmware is started.
CPUユニット100のストレージ12が、図2に示す(11)、(14)および(15)の処理のための命令を含むファームウェアを記憶している場合、当該ファームウェアの起動後において、図2に示す(11)~(16)に従った同期処理が実行される。そのため、ストレージ12が当該ファームウェアを記憶している場合、CPU10は、当該ファームウェアの起動後に、ラッチ部133による時刻情報の出力動作を無効にする。たとえば、ラッチ部133は、フラグを有しており、フラグが「1」の場合に時刻情報の出力動作を行ない、フラグが「0」の場合に時刻情報の出力動作を行なわないように設定される。CPU10は、ファームウェアの起動後に当該フラグを「0」に切り替えればよい。フラグを「0」に切り替えられると、CPUユニット100から拡張ユニット200に時刻情報が出力されないため、拡張ユニット200において、差分計算部233の動作も無効化される。これにより、ファームウェアの起動後には、図1に示す(1)~(8)に従った同期処理が実行されない。 <E. Processing after starting the firmware>
If the
このように、ファームウェアの起動前には、図1に示す(1)~(8)に従った同期処理が繰り返し実行され、ファームウェアの起動後には、図2に示す(11)~(16)に従った同期処理が繰り返し実行される。
In this way, before the firmware is activated, the synchronization processes according to (1) to (8) shown in FIG. Synchronization processing is executed repeatedly.
<F.変形例1>
CPUユニット100において、ハードウェア回路13に含まれるFRC131は、ハードウェア回路13の外部にある図示しないクロック発振源を用いて生成されるクロックに従ってカウントアップする。同様に、拡張ユニット200において、ハードウェア回路23に含まれるFRC231は、ハードウェア回路23の外部にある図示しないクロック発振源を用いて生成されるクロックに従ってカウントアップする。そのため、CPUユニット100のクロック発振源と拡張ユニット200のクロック発振源との間の発振誤差(静的ジッタとも称される。)により、FRC131がカウントアップする周期とFRC231がカウントアップする周期との間にわずかなずれが生じうる。これにより、FRC131の値とFRC231の値とは、一旦同期された場合であっても、その後に少しずつずれていく。変形例1に係る制御装置は、静的ジッタに起因する、FRC131とFRC231との値のずれ(以下、「クロック偏差」を称する。)を補正する。 <F. Modification 1>
In theCPU unit 100 , the FRC 131 included in the hardware circuit 13 counts up according to a clock generated using a clock oscillation source (not shown) outside the hardware circuit 13 . Similarly, in expansion unit 200 , FRC 231 included in hardware circuit 23 counts up according to a clock generated using a clock oscillation source (not shown) outside hardware circuit 23 . Therefore, due to an oscillation error (also referred to as static jitter) between the clock oscillation source of the CPU unit 100 and the clock oscillation source of the expansion unit 200, the period in which the FRC 131 counts up and the period in which the FRC 231 counts up may differ. There may be slight deviations in between. As a result, even when the values of FRC131 and FRC231 are once synchronized, they gradually deviate after that. The control device according to Modification 1 corrects the difference between the values of FRC131 and FRC231 (hereinafter referred to as "clock deviation") caused by static jitter.
CPUユニット100において、ハードウェア回路13に含まれるFRC131は、ハードウェア回路13の外部にある図示しないクロック発振源を用いて生成されるクロックに従ってカウントアップする。同様に、拡張ユニット200において、ハードウェア回路23に含まれるFRC231は、ハードウェア回路23の外部にある図示しないクロック発振源を用いて生成されるクロックに従ってカウントアップする。そのため、CPUユニット100のクロック発振源と拡張ユニット200のクロック発振源との間の発振誤差(静的ジッタとも称される。)により、FRC131がカウントアップする周期とFRC231がカウントアップする周期との間にわずかなずれが生じうる。これにより、FRC131の値とFRC231の値とは、一旦同期された場合であっても、その後に少しずつずれていく。変形例1に係る制御装置は、静的ジッタに起因する、FRC131とFRC231との値のずれ(以下、「クロック偏差」を称する。)を補正する。 <
In the
図7は、変形例1に係る制御装置1Aの構成を模式的に示す図である。図7に示されるように、制御装置1Aは、CPUユニット100Aと拡張ユニット200Aとを備える。CPUユニット100Aは、図1に示すCPUユニット100と比較して、ハードウェア回路13の代わりにハードウェア回路13Aを含む点で相違する。拡張ユニット200Aは、図1に示す拡張ユニット200と比較して、ハードウェア回路23の代わりにハードウェア回路23Aを含む点で相違する。なお、図7では、メモリ11,21、ストレージ12,22の図示を省略している。
FIG. 7 is a diagram schematically showing the configuration of a control device 1A according to Modification 1. As shown in FIG. As shown in FIG. 7, the control device 1A includes a CPU unit 100A and an extension unit 200A. The CPU unit 100A differs from the CPU unit 100 shown in FIG. 1 in that it includes a hardware circuit 13A instead of the hardware circuit 13. FIG. Expansion unit 200A is different from expansion unit 200 shown in FIG. 1 in that it includes hardware circuit 23A instead of hardware circuit 23 . Note that the memories 11 and 21 and the storages 12 and 22 are omitted from FIG.
ハードウェア回路13Aは、ハードウェア回路13と比較して、ラッチ部133の代わりにラッチ部133Aを有し、さらにFRC134を有する点で相違する。なお、ハードウェア回路13Aの同期信号出力部132は、同期信号を繰り返し出力する。
The hardware circuit 13A differs from the hardware circuit 13 in that it has a latch section 133A instead of the latch section 133 and further has an FRC 134. Note that the synchronization signal output unit 132 of the hardware circuit 13A repeatedly outputs the synchronization signal.
FRC134は、一定の周期でカウントアップするカウンタであり、例えば64bitのカウンタである。なお、FRC134の代わりに、各種のカウンタが採用されてもよい。FRC131,134は、CPUユニット100Aに備えられるクロック発振源(図示せず)を用いて生成されるクロックに従ってカウントアップする。そのため、FRC131,134は、同一周期でカウントアップする。
The FRC 134 is a counter that counts up at regular intervals, such as a 64-bit counter. Various counters may be employed instead of the FRC 134 . FRCs 131 and 134 count up according to a clock generated using a clock oscillation source (not shown) provided in CPU unit 100A. Therefore, the FRCs 131 and 134 count up in the same period.
ラッチ部133Aは、ラッチ部133の動作に加えて、以下の動作を行なう。すなわち、ラッチ部133Aは、同期信号が出力されたときのFRC134の値X3をラッチする。さらに、ラッチ部133Aは、前回同期信号が出力されたときにラッチしたFRC134の値X3’と、新たにラッチした値X3との差分dX3(=X3-X3’)を計算し、差分dX3を拡張ユニット200Aに出力する。
In addition to the operation of the latch section 133, the latch section 133A performs the following operations. That is, the latch section 133A latches the value X3 of the FRC 134 when the synchronization signal is output. Further, the latch unit 133A calculates the difference dX3 (=X3-X3') between the value X3' of the FRC 134 latched when the synchronization signal was output last time and the newly latched value X3, and extends the difference dX3. Output to unit 200A.
ハードウェア回路23Aは、ハードウェア回路23と比較して、ラッチ部232、差分計算部233およびFRC補正部234の代わりにラッチ部232A、差分計算部233AおよびFRC補正部234Aを有し、さらにFRC235を有する点で相違する。
The hardware circuit 23A has a latch section 232A, a difference calculation section 233A and an FRC correction section 234A in place of the latch section 232, the difference calculation section 233 and the FRC correction section 234 compared to the hardware circuit 23. It is different in that it has
FRC235は、一定の周期でカウントアップするカウンタであり、例えば64bitのカウンタである。なお、FRC235の代わりに、各種のカウンタが採用されてもよい。FRC231,235は、拡張ユニット200Aに備えられるクロック発振源(図示せず)を用いて生成されるクロックに従ってカウントアップする。そのため、FRC231,235は、同一周期でカウントアップする。
The FRC 235 is a counter that counts up at regular intervals, such as a 64-bit counter. Various counters may be employed instead of the FRC 235 . FRCs 231 and 235 count up according to a clock generated using a clock oscillation source (not shown) provided in expansion unit 200A. Therefore, the FRCs 231 and 235 count up in the same period.
ラッチ部232Aは、ラッチ部232の動作に加えて、以下の動作を行なう。すなわち、ラッチ部232Aは、信号線3から同期信号を受けたときのFRC235の値X4をラッチする。ラッチ部232Aは、前回同期信号を受けたときにラッチしたFRC235の値X4’と、新たにラッチした値X4との差分dX4(=X4-X4’)を計算し、差分dX4を差分計算部233Aに出力する。
In addition to the operation of the latch section 232, the latch section 232A performs the following operations. That is, the latch section 232A latches the value X4 of the FRC 235 when receiving the synchronization signal from the signal line 3. FIG. The latch section 232A calculates the difference dX4 (=X4-X4') between the value X4' of the FRC 235 latched when the synchronization signal was received last time and the newly latched value X4, and the difference dX4 is calculated by the difference calculation section 233A. output to
差分計算部233Aは、差分計算部233の動作に加えて、以下の動作を行なう。すなわち、差分計算部233Aは、ラッチ部232Aから出力される差分dX4と信号線4から受けた差分dX3との差分Y2(=dX4-dX3)を計算する。差分計算部233Aは、差分Y2をFRC補正部234Aに出力する。
In addition to the operation of the difference calculation unit 233, the difference calculation unit 233A performs the following operations. That is, the difference calculation section 233A calculates the difference Y2 (=dX4-dX3) between the difference dX4 output from the latch section 232A and the difference dX3 received from the signal line 4. FIG. The difference calculator 233A outputs the difference Y2 to the FRC corrector 234A.
FRC補正部234Aは、FRC補正部234の動作に加えて、以下の動作を行なう。すなわち、FRC補正部234Aは、差分Y2に基づいて、FRC231を補正する。
The FRC correction unit 234A performs the following operations in addition to the operations of the FRC correction unit 234. That is, the FRC corrector 234A corrects the FRC 231 based on the difference Y2.
次に、制御装置1Aにおいて実行される、静的ジッタに起因するクロック偏差の補正処理の流れについて説明する。
Next, the flow of correction processing for clock deviation caused by static jitter, which is executed in the control device 1A, will be described.
まず、CPUユニット100Aの同期信号出力部132は、同期信号を拡張ユニット200Aに出力する。同期信号は、ラッチ部133Aにも出力される(図中(21)参照)。
First, the synchronization signal output section 132 of the CPU unit 100A outputs the synchronization signal to the expansion unit 200A. The synchronization signal is also output to the latch section 133A (see (21) in the figure).
次に、CPUユニット100Aのラッチ部133Aは、同期信号の入力に応じて、同期信号が出力されたときのFRC134の値X3をラッチする(図中(22)参照)。拡張ユニット200Aのラッチ部232Aは、同期信号の入力に応じて、同期信号を受けたときのFRC235の値X4をラッチする(図中(23)参照)。
Next, the latch section 133A of the CPU unit 100A latches the value X3 of the FRC 134 when the synchronization signal was output in response to the synchronization signal input (see (22) in the figure). The latch section 232A of the extension unit 200A latches the value X4 of the FRC 235 when the synchronization signal is received (see (23) in the figure) in response to the synchronization signal input.
ラッチ部133Aは、前回同期信号が出力されたときにラッチしたFRC134の値X3’と新たにラッチした値X3との差分dX3を計算し、差分dX3を拡張ユニット200Aに出力する(図中(24)参照)。
The latch unit 133A calculates the difference dX3 between the value X3′ of the FRC 134 latched when the synchronization signal was output last time and the value X3 newly latched, and outputs the difference dX3 to the expansion unit 200A ((24 )reference).
ラッチ部232Aは、前回同期信号が入力されたときにラッチしたFRC235の値X4’と新たにラッチした値X4との差分dX4を計算し、差分dX4を差分計算部233Aに出力する(図中(25)参照)。差分計算部233Aは、差分dX4と差分dX3との差分Y2を計算する(図中(26)参照)。差分計算部233Aは、計算結果である差分Y2をFRC補正部234に出力する(図中(27)参照)。
The latch unit 232A calculates the difference dX4 between the value X4' of the FRC 235 latched when the previous synchronization signal was input and the newly latched value X4, and outputs the difference dX4 to the difference calculation unit 233A (( 25)). The difference calculator 233A calculates the difference Y2 between the difference dX4 and the difference dX3 (see (26) in the figure). The difference calculator 233A outputs the calculated difference Y2 to the FRC corrector 234 (see (27) in the figure).
FRC補正部234Aは、差分Y2に基づいて、FRC231を補正する(図中(28)参照)。
The FRC correction unit 234A corrects the FRC 231 based on the difference Y2 (see (28) in the figure).
差分Y2は、前回の同期信号が出力されてから今回の同期信号が出力されるまでの対象期間における、FRC134のカウント数とFRC235のカウント数との差を示す。上述したように、FRC131,134は、同一周期でカウントアップする。さらに、FRC231,235は、同一周期でカウントアップする。そのため、対象期間におけるFRC131のカウント数とFRC231のカウント数との差も差分Y2となる。FRC補正部234Aによって差分Y2だけFRC231の値が補正されることにより、静的ジッタに起因するクロック偏差が補正される。
The difference Y2 indicates the difference between the count number of FRC134 and the count number of FRC235 in the target period from the output of the previous synchronization signal to the output of the current synchronization signal. As described above, FRCs 131 and 134 count up in the same period. Furthermore, FRCs 231 and 235 count up in the same cycle. Therefore, the difference between the FRC131 count number and the FRC231 count number in the target period is also the difference Y2. The FRC corrector 234A corrects the value of the FRC 231 by the difference Y2, thereby correcting the clock deviation caused by the static jitter.
制御装置1Aにおいても、図1に示す(1)~(7)の同期処理に従って、FRC231がFRC131に一旦同期される。しかしながら、静的ジッタに起因するクロック偏差は、常に発生し続ける。そのため、FRC補正部234Aは、差分Y2に基づいて、周期的にFRC231を補正し続ける。たとえば、FRC補正部234は、予め定められた補正周期でクロック偏差を補正する。前回の同期信号が出力されてから今回の同期信号が出力されるまでの対象期間をT1、補正周期をT2とすると、FRC補正部234は、補正周期毎に、(Y2/T1)×T2だけFRC231を補正すればよい。これにより、静的ジッタに起因するクロック偏差が常にキャンセルされる。
Also in the control device 1A, the FRC231 is once synchronized with the FRC131 according to the synchronization processes (1) to (7) shown in FIG. However, clock deviation due to static jitter continues to occur. Therefore, the FRC correction unit 234A continues to periodically correct the FRC 231 based on the difference Y2. For example, the FRC corrector 234 corrects the clock deviation at a predetermined correction cycle. Assuming that the target period from the output of the previous synchronization signal to the output of the current synchronization signal is T1, and the correction period is T2, the FRC correction unit 234 performs (Y2/T1)×T2 for each correction period. FRC231 should be corrected. This always cancels clock deviations due to static jitter.
なお、FRC131とFRC231との値のずれの発生原因として、静的ジッタの他に動的ジッタが存在する。動的ジッタは、たとえば同期信号の伝送遅延などを含む。変形例1によれば、静的ジッタに起因するクロック偏差が常にキャンセルされる。そのため、同期信号の出力周期を長くしても、動的ジッタに起因する、FRC131とFRC231との値のずれが大きくなりすぎることを避けることができる。これにより、ファームウェアが起動した後、図2に示す(11)~(16)に従った同期処理が繰り返し実行されるとき、CPU10による同期処理に要する負荷が軽減される。
In addition to static jitter, there is dynamic jitter as a cause of the difference between the values of FRC131 and FRC231. Dynamic jitter includes, for example, transmission delay of synchronization signals. According to Modification 1, the clock deviation caused by static jitter is always cancelled. Therefore, even if the output cycle of the synchronization signal is lengthened, it is possible to avoid excessive deviation between the values of FRC131 and FRC231 due to dynamic jitter. This reduces the load required for the synchronization processing by the CPU 10 when the synchronization processing according to (11) to (16) shown in FIG. 2 is repeatedly executed after the firmware is activated.
CPU10は、ファームウェアが起動した後、ラッチ部133Aによる時刻情報の出力動作のみを無効にし、ラッチ部133Aによる差分dX3の出力動作を有効にしてもよい。これにより、ファームウェアが起動した後であっても、ハードウェア回路13A,23Aは、静的ジッタに起因するクロック偏差を補正し続けることができる。
After the firmware is activated, the CPU 10 may disable only the output operation of the time information by the latch section 133A and enable the output operation of the difference dX3 by the latch section 133A. This allows the hardware circuits 13A and 23A to continue correcting clock deviations caused by static jitter even after the firmware has started.
あるいは、CPU10は、ファームウェアが起動した後、ラッチ部133Aによる差分dX3の出力動作を無効にしてもよい。この場合、ファームウェアは、ラッチ部133Aによって計算される差分dX3とラッチ部232Aによって計算される差分dX4との差分Y2を計算する命令と、差分Y2に基づいてFRC231を補正させる命令と、を含む。CPU10は、ファームウェアのこれらの命令に従って、差分Y2に基づいてFRC231を補正させればよい。これにより、ファームウェア起動後において、CPU10は、静的ジッタに起因するクロック偏差を補正し続けることができる。ただし、この場合、ファームウェアの改変が必要となる。ファームウェアの改変を省略するためには、CPU10は、ファームウェアが起動した後、ラッチ部133Aによる差分dX3の出力動作を有効にすることが好ましい。
Alternatively, the CPU 10 may disable the operation of outputting the difference dX3 by the latch section 133A after the firmware is activated. In this case, the firmware includes an instruction to calculate the difference Y2 between the difference dX3 calculated by the latch section 133A and the difference dX4 calculated by the latch section 232A, and an instruction to correct the FRC 231 based on the difference Y2. The CPU 10 may correct the FRC 231 based on the difference Y2 according to these commands of the firmware. This allows the CPU 10 to continue correcting the clock deviation caused by static jitter after the firmware is started. However, in this case, modification of the firmware is required. In order to omit modification of the firmware, the CPU 10 preferably enables the output operation of the difference dX3 by the latch section 133A after the firmware is started.
<G.変形例2>
図8は、変形例2に係る制御装置1Bの構成を模式的に示す図である。図8に示されるように、制御装置1Bは、CPUユニット100Bおよび拡張ユニット200Bを備える。CPUユニット100Bは、図1に示すCPUユニット100と比較して、ハードウェア回路13の代わりにハードウェア回路13Bを含む点で相違する。拡張ユニット200Bは、図1に示す拡張ユニット200と比較して、ハードウェア回路23の代わりにハードウェア回路23Bを含む点で相違する。なお、図8では、メモリ11,21、ストレージ12,22の図示を省略している。また、変形例2は、変形例1と組み合わされてもよい。 <G. Modification 2>
FIG. 8 is a diagram schematically showing the configuration of acontrol device 1B according to Modification 2. As shown in FIG. As shown in FIG. 8, the control device 1B includes a CPU unit 100B and an expansion unit 200B. The CPU unit 100B differs from the CPU unit 100 shown in FIG. 1 in that it includes a hardware circuit 13B instead of the hardware circuit 13. FIG. Expansion unit 200B is different from expansion unit 200 shown in FIG. 1 in that it includes hardware circuit 23B instead of hardware circuit 23 . Note that the memories 11 and 21 and the storages 12 and 22 are omitted from FIG. Also, Modification 2 may be combined with Modification 1. FIG.
図8は、変形例2に係る制御装置1Bの構成を模式的に示す図である。図8に示されるように、制御装置1Bは、CPUユニット100Bおよび拡張ユニット200Bを備える。CPUユニット100Bは、図1に示すCPUユニット100と比較して、ハードウェア回路13の代わりにハードウェア回路13Bを含む点で相違する。拡張ユニット200Bは、図1に示す拡張ユニット200と比較して、ハードウェア回路23の代わりにハードウェア回路23Bを含む点で相違する。なお、図8では、メモリ11,21、ストレージ12,22の図示を省略している。また、変形例2は、変形例1と組み合わされてもよい。 <
FIG. 8 is a diagram schematically showing the configuration of a
ハードウェア回路13Bは、ハードウェア回路13と比較して、発光素子135を含む点で相違する。ハードウェア回路23Bは、ハードウェア回路23と比較して、発光素子236を含む点で相違する。
The hardware circuit 13B differs from the hardware circuit 13 in that it includes a light emitting element 135. The hardware circuit 23B differs from the hardware circuit 23 in that it includes a light-emitting element 236 .
発光素子135,236は、たとえば発光ダイオードである。発光素子135,236は、FRC131,231の値に従ってそれぞれ点滅する。具体的には、発光素子135,236は、FRC131,231が予め設定された値に到達したタイミングで発光する。ファームウェアの起動前では、図1に示す(1)~(7)の処理によりFRC131,231が同期している。ファームウェアの起動後では、図2に示す(11)~(15)の処理によりFRC131,231が同期している。そのため、発光素子135,236は同じタイミングで発光する。これにより、制御装置1Bにおいて、各ユニットの発光素子の点滅周期が同期し、ユーザに統一感を与えることができる。逆に、ユーザは、各ユニットの発光素子の点滅周期が同期していないことを視認することにより、何らかの異常が発生していることを把握できる。
The light emitting elements 135, 236 are, for example, light emitting diodes. Light-emitting elements 135 and 236 blink according to the values of FRC 131 and 231, respectively. Specifically, the light emitting elements 135 and 236 emit light when the FRCs 131 and 231 reach preset values. Before starting the firmware, the FRCs 131 and 231 are synchronized by the processes (1) to (7) shown in FIG. After starting the firmware, the FRCs 131 and 231 are synchronized by the processes (11) to (15) shown in FIG. Therefore, the light emitting elements 135 and 236 emit light at the same timing. As a result, in the control device 1B, the blinking cycles of the light emitting elements of the units are synchronized, and a sense of unity can be given to the user. Conversely, the user can recognize that some kind of abnormality has occurred by visually confirming that the blinking cycles of the light emitting elements of the units are not synchronized.
<H.変形例3>
変形例1では、CPUユニット100Aおよび拡張ユニット200Aの各々が2つのFRCを備える。そのため、ハードウェア回路の規模が増大する。変形例3は、ハードウェア回路の規模の増大を抑制しつつ、静的ジッタに起因するクロック偏差を補正し続ける形態である。 <H. Modification 3>
InModification 1, each of the CPU unit 100A and the expansion unit 200A has two FRCs. Therefore, the scale of the hardware circuit increases. Modification 3 is a mode in which the clock deviation caused by static jitter is continuously corrected while suppressing an increase in the scale of the hardware circuit.
変形例1では、CPUユニット100Aおよび拡張ユニット200Aの各々が2つのFRCを備える。そのため、ハードウェア回路の規模が増大する。変形例3は、ハードウェア回路の規模の増大を抑制しつつ、静的ジッタに起因するクロック偏差を補正し続ける形態である。 <
In
図9は、変形例3に係る制御装置1Cの構成を模式的に示す図である。図9に示されるように、制御装置1Cは、CPUユニット100Cと拡張ユニット200Cとを備える。CPUユニット100Cは、図7に示すCPUユニット100Aと比較して、ハードウェア回路13Aの代わりにハードウェア回路13Cを含む点で相違する。拡張ユニット200Cは、図7に示す拡張ユニット200Aと比較して、ハードウェア回路23Aの代わりにハードウェア回路23Cを含む点で相違する。なお、図9でも、図7と同様に、メモリ11,21、ストレージ12,22の図示を省略している。
FIG. 9 is a diagram schematically showing the configuration of a control device 1C according to Modification 3. As shown in FIG. As shown in FIG. 9, the control device 1C includes a CPU unit 100C and an expansion unit 200C. The CPU unit 100C differs from the CPU unit 100A shown in FIG. 7 in that it includes a hardware circuit 13C instead of the hardware circuit 13A. Expansion unit 200C differs from expansion unit 200A shown in FIG. 7 in that it includes hardware circuit 23C instead of hardware circuit 23A. 9, the memories 11 and 21 and the storages 12 and 22 are omitted in the same manner as in FIG.
ハードウェア回路13Cは、ハードウェア回路13Aと比較して、同期信号出力部132、ラッチ部133AおよびFRC134の代わりに同期信号出力部132C、ラッチ部133Cおよび信号間隔カウント部136をそれぞれ有する点で相違する。
The hardware circuit 13C differs from the hardware circuit 13A in that it has a synchronization signal output section 132C, a latch section 133C and a signal interval counting section 136 instead of the synchronization signal output section 132, the latch section 133A and the FRC 134. do.
信号間隔カウント部136は、CPUユニット100Cに備えられるクロック発振源(図示せず)を用いて生成されるクロックに従ってカウントアップするカウンタを含む。信号間隔カウント部136は、カウンタ値が一定の値Tに到達したタイミングで出力指示を同期信号出力部132Cに出力する。信号間隔カウント部136は、出力指示を同期信号出力部132Cに出力すると、カウンタ値を0に戻す。
The signal interval counting unit 136 includes a counter that counts up according to a clock generated using a clock oscillation source (not shown) provided in the CPU unit 100C. The signal interval counting section 136 outputs an output instruction to the synchronization signal output section 132C at the timing when the counter value reaches a certain value T. FIG. The signal interval counting section 136 resets the counter value to 0 when outputting the output instruction to the synchronization signal output section 132C.
値Tは、同期信号を出力する一定周期に対応し、予め設定される。クロック発振源(図示せず)を用いて生成されるクロックの周波数が125MHzである場合、値Tは、例えば125000(1msに相当)である。この場合、信号間隔カウント部136は、16bitのカウンタを含めばよい。すなわち、信号間隔カウント部136は、64bitのFRC134(図7参照)よりも規模の小さいカウンタを含む。そのため、変形例1と比較して、ハードウェア回路13Cの規模の増大が抑制される。
The value T corresponds to a constant cycle for outputting the synchronization signal and is set in advance. If the frequency of the clock generated using the clock oscillation source (not shown) is 125 MHz, the value T is, for example, 125000 (corresponding to 1 ms). In this case, the signal interval counting section 136 may include a 16-bit counter. That is, the signal interval counting unit 136 includes a counter smaller in scale than the 64-bit FRC 134 (see FIG. 7). Therefore, as compared with Modification 1, an increase in the scale of the hardware circuit 13C is suppressed.
同期信号出力部132Cは、信号間隔カウント部136から出力指示を受けたことに応じて、同期信号を拡張ユニット200Cに出力する。同期信号出力部132Cから出力された同期信号は、ラッチ部133Cにも入力される。
The synchronization signal output section 132C outputs the synchronization signal to the expansion unit 200C in response to receiving the output instruction from the signal interval counting section 136. The synchronization signal output from the synchronization signal output section 132C is also input to the latch section 133C.
FRC131も、CPUユニット100Cに備えられるクロック発振源(図示せず)を用いて生成されるクロックに従ってカウントアップする。そのため、信号間隔カウント部136に含まれるカウンタとFRC131とは、同一周期でカウントアップする。
The FRC 131 also counts up according to a clock generated using a clock oscillation source (not shown) provided in the CPU unit 100C. Therefore, the counter included in the signal interval counting unit 136 and the FRC 131 count up at the same period.
ラッチ部133Cは、図1に示すラッチ部133と同様の動作を行なう。すなわち、ラッチ部133Cは、同期信号が出力されたときのFRC131の値X1をラッチし、保持している値X1を含む時刻情報を拡張ユニット200Cに出力する。さらに、ラッチ部133Cは、信号間隔カウント部136に設定された値Tを時刻情報に含ませる。
The latch section 133C performs the same operation as the latch section 133 shown in FIG. That is, the latch section 133C latches the value X1 of the FRC 131 when the synchronization signal is output, and outputs time information including the held value X1 to the extension unit 200C. Furthermore, the latch section 133C causes the value T set in the signal interval counting section 136 to be included in the time information.
ハードウェア回路23Cは、ハードウェア回路23Aと比較して、ラッチ部232A、差分計算部233A、FRC補正部234AおよびFRC235の代わりにラッチ部232、差分計算部233C、FRC補正部234Cおよび信号間隔測定部237を有する点で相違する。
Compared to the hardware circuit 23A, the hardware circuit 23C includes a latch unit 232A, a difference calculation unit 233A, an FRC correction unit 234A and a latch unit 232 instead of the FRC correction unit 235, a difference calculation unit 233C, an FRC correction unit 234C, and a signal interval measurement. It differs in that it has a portion 237 .
信号間隔測定部237は、拡張ユニット200Cに備えられるクロック発振源(図示せず)を用いて生成されるクロックに従ってカウントアップするカウンタを含む。信号間隔測定部237は、同期信号を受けたタイミングにおいて、カウンタの値T1を差分計算部233Cに出力し、カウンタ値を0に戻す。これにより、信号間隔測定部237から出力される値T1は、前回の同期信号を受けたタイミングから今回の同期信号を受けたタイミングまでのカウントアップ分を表す。
The signal interval measuring section 237 includes a counter that counts up according to a clock generated using a clock oscillation source (not shown) provided in the expansion unit 200C. The signal interval measurement unit 237 outputs the counter value T1 to the difference calculation unit 233C at the timing of receiving the synchronization signal, and resets the counter value to 0. As a result, the value T1 output from the signal interval measuring section 237 represents the count-up from the timing at which the previous synchronization signal was received to the timing at which the current synchronization signal was received.
値T1は、同期信号が出力される一定周期とほぼ一致する。値T1は、値Tと同程度である。そのため、信号間隔測定部237は、信号間隔カウント部136と同規模のカウンタを含めばよい。すなわち、信号間隔測定部237は、64bitのFRC235(図7参照)よりも規模の小さいカウンタを含めばよい。そのため、変形例1と比較して、ハードウェア回路23Cの規模の増大が抑制される。
The value T1 almost coincides with the constant period in which the synchronization signal is output. The value T1 is comparable to the value T. Therefore, the signal interval measuring section 237 may include a counter of the same scale as the signal interval counting section 136 . That is, the signal interval measurement unit 237 may include a counter smaller in scale than the 64-bit FRC 235 (see FIG. 7). Therefore, as compared with Modification 1, an increase in the scale of the hardware circuit 23C is suppressed.
FRC231も、拡張ユニット200Cに備えられるクロック発振源(図示せず)を用いて生成されるクロックに従ってカウントアップする。そのため、信号間隔測定部237に含まれるカウンタとFRC231とは、同一周期でカウントアップする。従って、信号間隔測定部237は、前回の同期信号が出力されたときのFRC231の値と今回の同期信号が出力されたときのFRC231の値との差分として値T1を測定している。
The FRC 231 also counts up according to a clock generated using a clock oscillation source (not shown) provided in the expansion unit 200C. Therefore, the counter included in signal interval measuring section 237 and FRC 231 count up at the same period. Therefore, the signal interval measuring section 237 measures the value T1 as the difference between the value of the FRC 231 when the previous synchronization signal was output and the value of the FRC 231 when the current synchronization signal was output.
差分計算部233Cは、図1に示す差分計算部233と同様の動作を行なう。すなわち、差分計算部233Cは、ラッチ部232から出力される値X2(つまり、同期信号を受けたときのFRC231の値)とCPUユニット100Cから受けた値X1(つまり、同期信号が出力されたときのFRC131の値)との差分Y1(=X2-X1)を計算する。さらに、差分計算部233Cは、信号間隔測定部237から受けた値T1とCPUユニット100Cから受けた値Tとの差分Z(=T1-T)を計算する。差分計算部233Cは、差分Y1,ZをFRC補正部234Cに出力する。
The difference calculation unit 233C performs the same operation as the difference calculation unit 233 shown in FIG. That is, the difference calculation unit 233C calculates the value X2 output from the latch unit 232 (that is, the value of the FRC 231 when the synchronization signal is received) and the value X1 received from the CPU unit 100C (that is, when the synchronization signal is output). FRC131 value of ) and the difference Y1 (=X2-X1) is calculated. Further, the difference calculation section 233C calculates the difference Z (=T1-T) between the value T1 received from the signal interval measurement section 237 and the value T received from the CPU unit 100C. The difference calculator 233C outputs the differences Y1 and Z to the FRC corrector 234C.
FRC補正部234Cは、図1に示すFRC補正部234の動作に加えて、差分Zに基づいてFRC231を補正する。
The FRC correction unit 234C corrects the FRC 231 based on the difference Z in addition to the operation of the FRC correction unit 234 shown in FIG.
次に、制御装置1Cにおいて実行される補正処理の流れについて説明する。まず、CPUユニット100Cの信号間隔カウント部136は、カウンタ値が予め設定された値Tに到達したタイミングにおいて、出力指示を同期信号出力部132Cに出力するとともに、カウンタ値を0に戻す(図中(31)参照)。
Next, the flow of correction processing executed by the control device 1C will be described. First, the signal interval counting section 136 of the CPU unit 100C outputs an output instruction to the synchronization signal output section 132C at the timing when the counter value reaches a preset value T, and resets the counter value to 0 (see (31)).
次に、同期信号出力部132Cは、出力指示に応じて、同期信号を拡張ユニット200Cに出力する。同期信号は、CPUユニット100Cのラッチ部133Cにも出力される(図中(32)参照)。
Next, the synchronization signal output section 132C outputs the synchronization signal to the expansion unit 200C according to the output instruction. The synchronization signal is also output to the latch section 133C of the CPU unit 100C (see (32) in the figure).
ラッチ部133Cは、同期信号の入力に応じて、同期信号が出力されたときのFRC131の値X1をラッチし、値X1と信号間隔カウント部136に設定された値Tとを含む時刻情報を拡張ユニット200Cに出力する(図中(33)参照)。
The latch unit 133C latches the value X1 of the FRC 131 when the synchronization signal is output in response to the input of the synchronization signal, and extends the time information including the value X1 and the value T set in the signal interval counting unit 136. Output to the unit 200C (see (33) in the figure).
拡張ユニット200Cのラッチ部232は、同期信号の入力に応じて、同期信号を受けたときのFRC231の値X2をラッチし、値X2を差分計算部233Cに出力する(図中(34)参照)。
The latch section 232 of the extension unit 200C latches the value X2 of the FRC 231 when receiving the synchronization signal in response to the input of the synchronization signal, and outputs the value X2 to the difference calculation section 233C (see (34) in the figure). .
拡張ユニット200Cの信号間隔測定部237は、同期信号の入力に応じて、前回の同期信号を受けたタイミングから今回の同期信号を受けたタイミングまでのカウントアップ分である値T1を測定し、値T1を差分計算部233Cに出力する(図中(35)参照)。
The signal interval measuring section 237 of the extension unit 200C measures the value T1, which is the count-up from the timing at which the previous synchronization signal is received to the timing at which the current synchronization signal is received, in response to the input of the synchronization signal. T1 is output to the difference calculator 233C (see (35) in the figure).
次に、差分計算部233Cは、値X2と値X1との差分Y1と、値T1と値Tとの差分Zとを計算する(図中(36)参照)。差分計算部233Cは、計算結果である差分Y1,ZをFRC補正部234Cに出力する(図中(37)参照)。
Next, the difference calculator 233C calculates the difference Y1 between the values X2 and X1 and the difference Z between the values T1 and T (see (36) in the figure). The difference calculator 233C outputs the calculated differences Y1 and Z to the FRC corrector 234C (see (37) in the figure).
次に、FRC補正部234Cは、差分Y1,Zに基づいて、FRC231を補正する(図中(38)参照)。差分Y1に基づくFRC231の補正方法は、上述した通りである。
Next, the FRC correction unit 234C corrects the FRC 231 based on the differences Y1 and Z (see (38) in the figure). The method of correcting the FRC 231 based on the difference Y1 is as described above.
差分Zに基づくFRC231の補正方法は、差分Y2に基づくFRC231の補正方法と同じである。
The method of correcting FRC231 based on difference Z is the same as the method of correcting FRC231 based on difference Y2.
差分Zは、前回の同期信号が出力されてから今回の同期信号が出力されるまでの対象期間における、信号間隔カウント部136のカウント数と信号間隔測定部237のカウント数との差を示す。上述したように、信号間隔カウント部136に含まれるカウンタとFRC131とは、同一周期でカウントアップする。さらに、信号間隔測定部237に含まれるカウンタとFRC231とは、同一周期でカウントアップする。そのため、差分Zは、静的ジッタに起因するクロック偏差である。
The difference Z indicates the difference between the count number of the signal interval counting section 136 and the count number of the signal interval measuring section 237 in the target period from the output of the previous synchronization signal to the output of the current synchronization signal. As described above, the counter included in the signal interval counting section 136 and the FRC 131 count up at the same period. Furthermore, the counter included in the signal interval measuring section 237 and the FRC 231 count up at the same period. The difference Z is therefore the clock deviation due to static jitter.
静的ジッタに起因するクロック偏差は、常に発生し続ける。そのため、FRC補正部234Cは、差分Zに基づいて、周期的にFRC231を補正し続ける。たとえば、FRC補正部234Cは、予め定められた補正周期でクロック偏差を補正する。前回の同期信号が出力されてから今回の同期信号が出力されるまでの対象期間をT1、補正周期をT2とすると、FRC補正部234Cは、補正周期毎に、(Z/T1)×T2だけFRC231を補正すればよい。これにより、静的ジッタに起因するクロック偏差が常にキャンセルされる。
Clock deviation caused by static jitter continues to occur. Therefore, the FRC correction unit 234C continues to periodically correct the FRC 231 based on the difference Z. For example, the FRC corrector 234C corrects the clock deviation at a predetermined correction period. Assuming that the target period from the output of the previous synchronization signal to the output of the current synchronization signal is T1, and the correction period is T2, the FRC correction unit 234C performs (Z/T1)×T2 for each correction period. FRC231 should be corrected. This always cancels clock deviations due to static jitter.
図10は、変形例3における同期信号の波形に伴うデータの流れを示す図である。図10には、静的ジッタに起因するクロック偏差の補正に関するデータの流れが示される。
FIG. 10 is a diagram showing the flow of data accompanying the waveform of the synchronization signal in Modification 3. FIG. FIG. 10 shows the data flow for correction of clock deviation due to static jitter.
図10に示されるように、同期信号は、値Tで示される一定周期で出力される。同期信号がアサートされるタイミングにおいて、値Tを含む時刻情報がCPUユニット100Cから拡張ユニット200Cに出力される。
As shown in FIG. 10, the synchronizing signal is output at a constant cycle indicated by the value T. At the timing at which the synchronization signal is asserted, time information including the value T is output from the CPU unit 100C to the extension unit 200C.
拡張ユニット200Cの信号間隔測定部237は、前回の同期信号を受けたタイミングから今回の同期信号を受けたタイミングまでのカウントアップ分である値T1を測定する。例えば、タイミングt1に同期信号を受けた場合、前回の同期信号を受けたタイミングt0からタイミングt1までのカウントアップ分である値T11が測定される。そして、値T11と値Tとの差分Z1が計算され、差分Z1に基づいてFRC231が補正される。
The signal interval measuring section 237 of the extension unit 200C measures a value T1 that is the count-up from the timing at which the previous synchronization signal was received to the timing at which the current synchronization signal is received. For example, when a synchronization signal is received at timing t1, a value T11 is measured which is a count-up from timing t0 at which the previous synchronization signal was received to timing t1. Then, the difference Z1 between the value T11 and the value T is calculated, and the FRC 231 is corrected based on the difference Z1 .
静的ジッタに起因するクロック偏差は、温度等にも依存する。そのため、同期信号を受けるたびに測定される値T1は、環境に応じて変化し得る。そのため、一定周期で値T1が測定されることにより、環境に応じて、静的ジッタに起因するクロック偏差が適切に補正される。
The clock deviation caused by static jitter also depends on temperature and other factors. Therefore, the value T1 measured each time the synchronization signal is received may change depending on the environment. Therefore, by measuring the value T1 at regular intervals, the clock deviation caused by the static jitter is appropriately corrected according to the environment.
<I.拡張ユニットが複数台の場合>
図11は、拡張ユニットが複数台である場合の信号の配信方法を示す図である。図11に示されるように、信号線3,4の各々は、CPUユニット100と複数の拡張ユニット200とをマルチドロップ形態で接続する。そのため、CPUユニット100から出力された同期信号および時刻情報は、信号線3,4を介して複数の拡張ユニット200にそれぞれ配信される。 <I. If there are multiple expansion units >
FIG. 11 is a diagram showing a signal distribution method when there are a plurality of extension units. As shown in FIG. 11, each of signal lines 3 and 4 connects CPU unit 100 and a plurality of expansion units 200 in a multi-drop configuration. Therefore, the synchronizing signal and time information output from the CPU unit 100 are distributed to the plurality of expansion units 200 via the signal lines 3 and 4, respectively.
図11は、拡張ユニットが複数台である場合の信号の配信方法を示す図である。図11に示されるように、信号線3,4の各々は、CPUユニット100と複数の拡張ユニット200とをマルチドロップ形態で接続する。そのため、CPUユニット100から出力された同期信号および時刻情報は、信号線3,4を介して複数の拡張ユニット200にそれぞれ配信される。 <I. If there are multiple expansion units >
FIG. 11 is a diagram showing a signal distribution method when there are a plurality of extension units. As shown in FIG. 11, each of
一方、PCIeに従うデータバス2は、CPUユニット100と複数の拡張ユニット200の各々とを1対1で接続する。
On the other hand, the data bus 2 conforming to PCIe connects the CPU unit 100 and each of the plurality of expansion units 200 on a one-to-one basis.
なお、図11において、CPUユニット100は、CPUユニット100A,100B,100Cのいずれかに置換されてもよい。また、複数の拡張ユニット200の各々は、拡張ユニット200A,200B,200Cのいずれかに置換されてもよい。
Note that in FIG. 11, the CPU unit 100 may be replaced with any one of the CPU units 100A, 100B, and 100C. Also, each of the plurality of expansion units 200 may be replaced with one of expansion units 200A, 200B, and 200C.
§3 付記
以上のように、本実施の形態は以下のような開示を含む。 §3 Supplementary Note As described above, the present embodiment includes the following disclosures.
以上のように、本実施の形態は以下のような開示を含む。 §3 Supplementary Note As described above, the present embodiment includes the following disclosures.
(構成1)
制御装置(1,1A,1B,1C)であって、
データを遣り取りする第1のユニット(100,100A,100B,100C)および第2のユニット(200,200A,200B,200C)を備え、
前記第1のユニットは、第1のハードウェア回路(13,13A,13B,13C)を含み、
前記第2のユニットは、第2のハードウェア回路(23,23A,23B,23C)を含み、
前記第1のハードウェア回路は、
第1のカウンタ(131)と、
同期信号を前記第2のユニットに出力する信号出力部(132,132C)と、
前記同期信号が出力されたときの前記第1のカウンタの第1の値を前記第2のユニットに出力する時刻情報出力部(133,133A,133C)と、を有し、
前記第2のハードウェア回路は、
第2のカウンタ(231)と、
前記同期信号を受けたときの前記第2のカウンタの第2の値と前記第1の値との第1の差分を計算する差分計算部(233,233A,233C)と、
前記第1の差分に基づいて、前記第2のカウンタを補正する補正部(234,234A,234C)と、を有する、制御装置。 (Configuration 1)
A control device (1, 1A, 1B, 1C),
A first unit (100, 100A, 100B, 100C) and a second unit (200, 200A, 200B, 200C) for exchanging data,
said first unit includes a first hardware circuit (13, 13A, 13B, 13C);
the second unit includes a second hardware circuit (23, 23A, 23B, 23C);
The first hardware circuit comprises:
a first counter (131);
a signal output unit (132, 132C) that outputs a synchronization signal to the second unit;
a time information output unit (133, 133A, 133C) that outputs a first value of the first counter when the synchronization signal is output to the second unit;
The second hardware circuit comprises:
a second counter (231);
a difference calculator (233, 233A, 233C) for calculating a first difference between the second value of the second counter and the first value when the synchronization signal is received;
and a correction unit (234, 234A, 234C) that corrects the second counter based on the first difference.
制御装置(1,1A,1B,1C)であって、
データを遣り取りする第1のユニット(100,100A,100B,100C)および第2のユニット(200,200A,200B,200C)を備え、
前記第1のユニットは、第1のハードウェア回路(13,13A,13B,13C)を含み、
前記第2のユニットは、第2のハードウェア回路(23,23A,23B,23C)を含み、
前記第1のハードウェア回路は、
第1のカウンタ(131)と、
同期信号を前記第2のユニットに出力する信号出力部(132,132C)と、
前記同期信号が出力されたときの前記第1のカウンタの第1の値を前記第2のユニットに出力する時刻情報出力部(133,133A,133C)と、を有し、
前記第2のハードウェア回路は、
第2のカウンタ(231)と、
前記同期信号を受けたときの前記第2のカウンタの第2の値と前記第1の値との第1の差分を計算する差分計算部(233,233A,233C)と、
前記第1の差分に基づいて、前記第2のカウンタを補正する補正部(234,234A,234C)と、を有する、制御装置。 (Configuration 1)
A control device (1, 1A, 1B, 1C),
A first unit (100, 100A, 100B, 100C) and a second unit (200, 200A, 200B, 200C) for exchanging data,
said first unit includes a first hardware circuit (13, 13A, 13B, 13C);
the second unit includes a second hardware circuit (23, 23A, 23B, 23C);
The first hardware circuit comprises:
a first counter (131);
a signal output unit (132, 132C) that outputs a synchronization signal to the second unit;
a time information output unit (133, 133A, 133C) that outputs a first value of the first counter when the synchronization signal is output to the second unit;
The second hardware circuit comprises:
a second counter (231);
a difference calculator (233, 233A, 233C) for calculating a first difference between the second value of the second counter and the first value when the synchronization signal is received;
and a correction unit (234, 234A, 234C) that corrects the second counter based on the first difference.
(構成2)
前記第1のハードウェア回路(13A)は、第3のカウンタ(134)をさらに有し、
前記第2のハードウェア回路(23A)は、第4のカウンタ(235)をさらに有し、
前記信号出力部(132)は、前記同期信号を繰り返し出力し、
前記時刻情報出力部(133A)は、さらに、前回の前記同期信号が出力されたときの前記第3のカウンタの値と今回の前記同期信号が出力されたときの前記第3のカウンタの値との第2の差分を前記第2のユニット(200A)に出力し、
前記差分計算部(233A)は、さらに、
前回の前記同期信号を受けたときの前記第4のカウンタの値と今回の前記同期信号を受けたときの前記第4のカウンタの値との第3の差分を計算し、
前記第2の差分と前記第3の差分との第4の差分を計算し、
前記補正部(234A)は、前記第4の差分に基づいて、前記第2のカウンタを補正する、構成1に記載の制御装置(1A)。 (Configuration 2)
said first hardware circuit (13A) further comprising a third counter (134);
The second hardware circuit (23A) further comprises a fourth counter (235),
The signal output unit (132) repeatedly outputs the synchronization signal,
The time information output unit (133A) further outputs the value of the third counter when the previous synchronization signal was output and the value of the third counter when the current synchronization signal was output. outputting the second difference of to the second unit (200A),
The difference calculator (233A) further
calculating a third difference between the value of the fourth counter when receiving the previous synchronization signal and the value of the fourth counter when receiving the synchronization signal this time;
calculating a fourth difference between the second difference and the third difference;
The control device (1A) according toConfiguration 1, wherein the correction section (234A) corrects the second counter based on the fourth difference.
前記第1のハードウェア回路(13A)は、第3のカウンタ(134)をさらに有し、
前記第2のハードウェア回路(23A)は、第4のカウンタ(235)をさらに有し、
前記信号出力部(132)は、前記同期信号を繰り返し出力し、
前記時刻情報出力部(133A)は、さらに、前回の前記同期信号が出力されたときの前記第3のカウンタの値と今回の前記同期信号が出力されたときの前記第3のカウンタの値との第2の差分を前記第2のユニット(200A)に出力し、
前記差分計算部(233A)は、さらに、
前回の前記同期信号を受けたときの前記第4のカウンタの値と今回の前記同期信号を受けたときの前記第4のカウンタの値との第3の差分を計算し、
前記第2の差分と前記第3の差分との第4の差分を計算し、
前記補正部(234A)は、前記第4の差分に基づいて、前記第2のカウンタを補正する、構成1に記載の制御装置(1A)。 (Configuration 2)
said first hardware circuit (13A) further comprising a third counter (134);
The second hardware circuit (23A) further comprises a fourth counter (235),
The signal output unit (132) repeatedly outputs the synchronization signal,
The time information output unit (133A) further outputs the value of the third counter when the previous synchronization signal was output and the value of the third counter when the current synchronization signal was output. outputting the second difference of to the second unit (200A),
The difference calculator (233A) further
calculating a third difference between the value of the fourth counter when receiving the previous synchronization signal and the value of the fourth counter when receiving the synchronization signal this time;
calculating a fourth difference between the second difference and the third difference;
The control device (1A) according to
(構成3)
前記信号出力部(132C)は、前記第1のカウンタの値が一定値だけ増大するたびに、前記同期信号を出力し、
前記時刻情報出力部(133C)は、さらに前記一定値を前記第2のユニットに出力し、
前記第2のハードウェア回路(23C)は、前回の前記同期信号が出力されたときの前記第2のカウンタの値と今回の前記同期信号が出力されたときの前記第2のカウンタの値との第2の差分を測定する測定部(237)をさらに有し、
前記差分計算部(233C)は、さらに、前記第2の差分と前記一定値との第3の差分を計算し、
前記補正部(234C)は、前記第3の差分に基づいて、前記第2のカウンタを補正する、請求項1に記載の制御装置(1C)。 (Composition 3)
The signal output unit (132C) outputs the synchronization signal each time the value of the first counter increases by a constant value,
The time information output section (133C) further outputs the constant value to the second unit,
The second hardware circuit (23C) stores the value of the second counter when the previous synchronization signal was output and the value of the second counter when the current synchronization signal was output. further comprising a measurement unit (237) for measuring the second difference of
The difference calculator (233C) further calculates a third difference between the second difference and the constant value,
The control device (1C) according toclaim 1, wherein said correction section (234C) corrects said second counter based on said third difference.
前記信号出力部(132C)は、前記第1のカウンタの値が一定値だけ増大するたびに、前記同期信号を出力し、
前記時刻情報出力部(133C)は、さらに前記一定値を前記第2のユニットに出力し、
前記第2のハードウェア回路(23C)は、前回の前記同期信号が出力されたときの前記第2のカウンタの値と今回の前記同期信号が出力されたときの前記第2のカウンタの値との第2の差分を測定する測定部(237)をさらに有し、
前記差分計算部(233C)は、さらに、前記第2の差分と前記一定値との第3の差分を計算し、
前記補正部(234C)は、前記第3の差分に基づいて、前記第2のカウンタを補正する、請求項1に記載の制御装置(1C)。 (Composition 3)
The signal output unit (132C) outputs the synchronization signal each time the value of the first counter increases by a constant value,
The time information output section (133C) further outputs the constant value to the second unit,
The second hardware circuit (23C) stores the value of the second counter when the previous synchronization signal was output and the value of the second counter when the current synchronization signal was output. further comprising a measurement unit (237) for measuring the second difference of
The difference calculator (233C) further calculates a third difference between the second difference and the constant value,
The control device (1C) according to
(構成4)
前記第1のユニット(100B)は、前記第1のカウンタの値に従って点滅する第1の発光素子(135)をさらに備え、
前記第2のユニット(100C)は、前記第2のカウンタの値に従って点滅する第2の発光素子(236)をさらに備える、構成1から3のいずれかに記載の制御装置(1B)。 (Composition 4)
The first unit (100B) further comprises a first light emitting element (135) that blinks according to the value of the first counter,
4. The control device (1B) according to any one ofconfigurations 1 to 3, wherein the second unit (100C) further comprises a second light emitting element (236) that blinks according to the value of the second counter.
前記第1のユニット(100B)は、前記第1のカウンタの値に従って点滅する第1の発光素子(135)をさらに備え、
前記第2のユニット(100C)は、前記第2のカウンタの値に従って点滅する第2の発光素子(236)をさらに備える、構成1から3のいずれかに記載の制御装置(1B)。 (Composition 4)
The first unit (100B) further comprises a first light emitting element (135) that blinks according to the value of the first counter,
4. The control device (1B) according to any one of
(構成5)
前記第1のユニットは、ファームウェアを実行するプロセッサ(10)をさらに備え、
前記ファームウェアは、前記信号出力部に対して、前記同期信号を出力するタイミングを設定する命令を含み、
前記信号出力部は、前記第1のカウンタの値が前記タイミングに到達したときに前記同期信号を出力し、
前記ファームウェアは、さらに、
前記第2の値と前記タイミングとの第5の差分を計算する命令と、
前記第5の差分に基づいて前記第2のカウンタを補正させる命令と、を含み、
前記プロセッサは、前記ファームウェアの起動後に、前記時刻情報出力部の動作を無効にする、構成1に記載の制御装置。 (Composition 5)
said first unit further comprising a processor (10) executing firmware,
The firmware includes an instruction for setting the timing for outputting the synchronization signal to the signal output unit,
The signal output unit outputs the synchronization signal when the value of the first counter reaches the timing,
The firmware further:
instructions for calculating a fifth difference between the second value and the timing;
an instruction to correct the second counter based on the fifth difference;
The control device according toconfiguration 1, wherein the processor disables the operation of the time information output unit after the firmware is activated.
前記第1のユニットは、ファームウェアを実行するプロセッサ(10)をさらに備え、
前記ファームウェアは、前記信号出力部に対して、前記同期信号を出力するタイミングを設定する命令を含み、
前記信号出力部は、前記第1のカウンタの値が前記タイミングに到達したときに前記同期信号を出力し、
前記ファームウェアは、さらに、
前記第2の値と前記タイミングとの第5の差分を計算する命令と、
前記第5の差分に基づいて前記第2のカウンタを補正させる命令と、を含み、
前記プロセッサは、前記ファームウェアの起動後に、前記時刻情報出力部の動作を無効にする、構成1に記載の制御装置。 (Composition 5)
said first unit further comprising a processor (10) executing firmware,
The firmware includes an instruction for setting the timing for outputting the synchronization signal to the signal output unit,
The signal output unit outputs the synchronization signal when the value of the first counter reaches the timing,
The firmware further:
instructions for calculating a fifth difference between the second value and the timing;
an instruction to correct the second counter based on the fifth difference;
The control device according to
(構成6)
前記第1のハードウェア回路は、ASICまたはFPGAであり、
前記第2のハードウェア回路は、ASICまたはFPGAである、構成1から5のいずれかに記載の制御装置。 (Composition 6)
the first hardware circuit is an ASIC or FPGA;
6. The controller of any of configurations 1-5, wherein the second hardware circuit is an ASIC or FPGA.
前記第1のハードウェア回路は、ASICまたはFPGAであり、
前記第2のハードウェア回路は、ASICまたはFPGAである、構成1から5のいずれかに記載の制御装置。 (Composition 6)
the first hardware circuit is an ASIC or FPGA;
6. The controller of any of configurations 1-5, wherein the second hardware circuit is an ASIC or FPGA.
本発明の実施の形態について説明したが、今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
Although the embodiment of the present invention has been described, it should be considered that the embodiment disclosed this time is illustrative in all respects and not restrictive. The scope of the present invention is indicated by the claims, and is intended to include all changes within the meaning and range of equivalents to the claims.
1,1A,1B,1C,1Z 制御装置、2,5 データバス、3,4 信号線、10,20 CPU、11,21 メモリ、12,22 ストレージ、13,13A,13B,13C,13Z,23,23A,23B,23C,23Z ハードウェア回路、100,100A,100B,100C,100Z CPUユニット、110P,111P,210P,211P 信号ポート、132,132C 同期信号出力部、133,133A,133C,232,232A ラッチ部、135,236 発光素子、136 信号間隔カウント部、200,200A,200B,200C,200Z 拡張ユニット、233,233A,233C 差分計算部、234,234A,234C 補正部、237 信号間隔測定部、300 機能ユニット。
1, 1A, 1B, 1C, 1Z control device, 2, 5 data bus, 3, 4 signal line, 10, 20 CPU, 11, 21 memory, 12, 22 storage, 13, 13A, 13B, 13C, 13Z, 23 , 23A, 23B, 23C, 23Z hardware circuits, 100, 100A, 100B, 100C, 100Z CPU units, 110P, 111P, 210P, 211P signal ports, 132, 132C synchronization signal output units, 133, 133A, 133C, 232, 232A latch section, 135, 236 light emitting elements, 136 signal interval counting section, 200, 200A, 200B, 200C, 200Z expansion unit, 233, 233A, 233C difference calculating section, 234, 234A, 234C correcting section, 237 signal interval measuring section , 300 functional units.
Claims (6)
- 制御装置であって、
データを遣り取りする第1のユニットおよび第2のユニットを備え、
前記第1のユニットは、第1のハードウェア回路を含み、
前記第2のユニットは、第2のハードウェア回路を含み、
前記第1のハードウェア回路は、
第1のカウンタと、
同期信号を前記第2のユニットに出力する信号出力部と、
前記同期信号が出力されたときの前記第1のカウンタの第1の値を前記第2のユニットに出力する時刻情報出力部と、を有し、
前記第2のハードウェア回路は、
第2のカウンタと、
前記同期信号を受けたときの前記第2のカウンタの第2の値と前記第1の値との第1の差分を計算する差分計算部と、
前記第1の差分に基づいて、前記第2のカウンタを補正する補正部と、を有する、制御装置。 a controller,
comprising a first unit and a second unit for exchanging data;
the first unit includes a first hardware circuit;
the second unit includes a second hardware circuit;
The first hardware circuit comprises:
a first counter;
a signal output unit that outputs a synchronization signal to the second unit;
a time information output unit that outputs a first value of the first counter when the synchronization signal is output to the second unit;
The second hardware circuit comprises:
a second counter;
a difference calculator that calculates a first difference between the second value of the second counter and the first value when the synchronization signal is received;
and a correction unit that corrects the second counter based on the first difference. - 前記第1のハードウェア回路は、第3のカウンタをさらに有し、
前記第2のハードウェア回路は、第4のカウンタをさらに有し、
前記信号出力部は、前記同期信号を繰り返し出力し、
前記時刻情報出力部は、さらに、前回の前記同期信号が出力されたときの前記第3のカウンタの値と今回の前記同期信号が出力されたときの前記第3のカウンタの値との第2の差分を前記第2のユニットに出力し、
前記差分計算部は、さらに、
前回の前記同期信号を受けたときの前記第4のカウンタの値と今回の前記同期信号を受けたときの前記第4のカウンタの値との第3の差分を計算し、
前記第2の差分と前記第3の差分との第4の差分を計算し、
前記補正部は、前記第4の差分に基づいて、前記第2のカウンタを補正する、請求項1に記載の制御装置。 the first hardware circuit further comprising a third counter;
the second hardware circuit further comprises a fourth counter;
The signal output unit repeatedly outputs the synchronization signal,
The time information output unit further outputs a second value between the value of the third counter when the previous synchronization signal was output and the value of the third counter when the current synchronization signal was output. outputting the difference of to the second unit;
The difference calculation unit further
calculating a third difference between the value of the fourth counter when receiving the previous synchronization signal and the value of the fourth counter when receiving the synchronization signal this time;
calculating a fourth difference between the second difference and the third difference;
The control device according to claim 1, wherein said correction unit corrects said second counter based on said fourth difference. - 前記信号出力部は、前記第1のカウンタの値が一定値だけ増大するたびに、前記同期信号を出力し、
前記時刻情報出力部は、さらに前記一定値を前記第2のユニットに出力し、
前記第2のハードウェア回路は、前回の前記同期信号が出力されたときの前記第2のカウンタの値と今回の前記同期信号が出力されたときの前記第2のカウンタの値との第2の差分を測定する測定部をさらに有し、
前記差分計算部は、さらに、前記第2の差分と前記一定値との第3の差分を計算し、
前記補正部は、前記第3の差分に基づいて、前記第2のカウンタを補正する、請求項1に記載の制御装置。 The signal output unit outputs the synchronization signal each time the value of the first counter increases by a constant value;
The time information output unit further outputs the constant value to the second unit,
The second hardware circuit stores a second value between the value of the second counter when the previous synchronization signal was output and the value of the second counter when the current synchronization signal was output. further having a measuring unit for measuring the difference of
The difference calculation unit further calculates a third difference between the second difference and the constant value,
The control device according to claim 1, wherein said correction unit corrects said second counter based on said third difference. - 前記第1のユニットは、前記第1のカウンタの値に従って点滅する第1の発光素子をさらに備え、
前記第2のユニットは、前記第2のカウンタの値に従って点滅する第2の発光素子をさらに備える、請求項1から3のいずれか1項に記載の制御装置。 The first unit further comprises a first light emitting element that blinks according to the value of the first counter;
4. The control device according to any one of claims 1 to 3, wherein said second unit further comprises a second light emitting element that blinks according to the value of said second counter. - 前記第1のユニットは、ファームウェアを実行するプロセッサをさらに備え、
前記ファームウェアは、前記信号出力部に対して、前記同期信号を出力するタイミングを設定する命令を含み、
前記信号出力部は、前記第1のカウンタの値が前記タイミングに到達したときに前記同期信号を出力し、
前記ファームウェアは、さらに、
前記第2の値と前記タイミングとの第5の差分を計算する命令と、
前記第5の差分に基づいて前記第2のカウンタを補正させる命令と、を含み、
前記プロセッサは、前記ファームウェアの起動後に、前記時刻情報出力部の動作を無効にする、請求項1に記載の制御装置。 the first unit further comprising a processor executing firmware;
The firmware includes an instruction for setting the timing for outputting the synchronization signal to the signal output unit,
The signal output unit outputs the synchronization signal when the value of the first counter reaches the timing,
The firmware further:
instructions for calculating a fifth difference between the second value and the timing;
and an instruction to correct the second counter based on the fifth difference;
2. The control device according to claim 1, wherein said processor disables operation of said time information output unit after starting said firmware. - 前記第1のハードウェア回路は、ASICまたはFPGAであり、
前記第2のハードウェア回路は、ASICまたはFPGAである、請求項1から5のいずれか1項に記載の制御装置。 the first hardware circuit is an ASIC or FPGA;
6. The control device according to any one of claims 1 to 5, wherein said second hardware circuit is an ASIC or FPGA.
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021-016473 | 2021-02-04 | ||
JP2021016473 | 2021-02-04 | ||
JP2021154989A JP2022119703A (en) | 2021-02-04 | 2021-09-24 | Control apparatus |
JP2021-154989 | 2021-09-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022168475A1 true WO2022168475A1 (en) | 2022-08-11 |
Family
ID=82742119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2021/047276 WO2022168475A1 (en) | 2021-02-04 | 2021-12-21 | Control device |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2022168475A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115080495A (en) * | 2022-08-22 | 2022-09-20 | 北京普太科技有限公司 | Time synchronization method and system for standard peripheral extension interface equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017079009A (en) * | 2015-10-21 | 2017-04-27 | 株式会社キーエンス | Monitor device of programmable logic controller |
JP2018064219A (en) * | 2016-10-14 | 2018-04-19 | オムロン株式会社 | Control device and communication device |
JP2018173710A (en) * | 2017-03-31 | 2018-11-08 | オムロン株式会社 | Control device, control program, and control system |
CN111158867A (en) * | 2018-11-07 | 2020-05-15 | 阿里巴巴集团控股有限公司 | Time synchronization processing method, thread scheduling device and electronic equipment |
-
2021
- 2021-12-21 WO PCT/JP2021/047276 patent/WO2022168475A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017079009A (en) * | 2015-10-21 | 2017-04-27 | 株式会社キーエンス | Monitor device of programmable logic controller |
JP2018064219A (en) * | 2016-10-14 | 2018-04-19 | オムロン株式会社 | Control device and communication device |
JP2018173710A (en) * | 2017-03-31 | 2018-11-08 | オムロン株式会社 | Control device, control program, and control system |
CN111158867A (en) * | 2018-11-07 | 2020-05-15 | 阿里巴巴集团控股有限公司 | Time synchronization processing method, thread scheduling device and electronic equipment |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115080495A (en) * | 2022-08-22 | 2022-09-20 | 北京普太科技有限公司 | Time synchronization method and system for standard peripheral extension interface equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3076251B1 (en) | Information processing apparatus, information processing program, and information processing method | |
EP3309647B1 (en) | Control device and communication device | |
JP5794449B2 (en) | Programmable controller | |
CN111052006B (en) | Control device and control method | |
WO2022168475A1 (en) | Control device | |
JP2007058736A (en) | Robot cooperative control method and system | |
JP2013156987A (en) | Device for transmitting sensor data | |
EP3361635A1 (en) | Control system and pulse output device | |
JP2016110458A (en) | Programmable logic controller, basic unit, control method and program | |
US9081371B2 (en) | Method for synchronizing an operating clock with a time clock of an automation network | |
KR20180006285A (en) | Optical measuring apparatus | |
JP6704548B1 (en) | Communication system, communication device and program | |
WO2022168338A1 (en) | Control device | |
US11689347B2 (en) | Communication apparatus, communication system, communication method, and computer readable medium | |
KR101847366B1 (en) | Time synchronization device and time synchronization system | |
US20230023970A1 (en) | Control system | |
JP2019215818A (en) | Controller and method for controlling the same | |
JP2006309693A (en) | Multivariate transmitter | |
JP6587566B2 (en) | Semiconductor device | |
JP2006340371A (en) | Method and communication module for controlling access time to system bus | |
JP6132097B2 (en) | Measuring system and measuring method | |
WO2022259381A1 (en) | Time synchronization device, time synchronization method, and program | |
US20230308514A1 (en) | Input unit, control system, communication method, and recording medium | |
JPWO2020049698A1 (en) | Communication systems, communication devices, and programs | |
JP6217478B2 (en) | Control system and control device |
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: 21924860 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21924860 Country of ref document: EP Kind code of ref document: A1 |