JP2023074675A - Safety PLC - Google Patents

Safety PLC Download PDF

Info

Publication number
JP2023074675A
JP2023074675A JP2021187717A JP2021187717A JP2023074675A JP 2023074675 A JP2023074675 A JP 2023074675A JP 2021187717 A JP2021187717 A JP 2021187717A JP 2021187717 A JP2021187717 A JP 2021187717A JP 2023074675 A JP2023074675 A JP 2023074675A
Authority
JP
Japan
Prior art keywords
microcomputer
timer
time
predetermined period
measurement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2021187717A
Other languages
Japanese (ja)
Inventor
里保 内沢
Riho Uchisawa
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Wave Inc
Original Assignee
Denso Wave Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Wave Inc filed Critical Denso Wave Inc
Priority to JP2021187717A priority Critical patent/JP2023074675A/en
Publication of JP2023074675A publication Critical patent/JP2023074675A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Safety Devices In Control Systems (AREA)
  • Programmable Controllers (AREA)

Abstract

To give at least one timer the possibility of dual use for time measurement of another control while suppressing a delay from a desired timer synchronization start timing to an actual timer synchronization start timing.SOLUTION: In a safety PLC (100), when a first time measured by a first timer (11) is a first predetermined period, a first microcomputer (10) transmits a synchronization signal to a second microcomputer and resets the first timer to zero to repeat a measurement start; and when a second time measured by a second timer (21) does not exceed a second predetermined period which is longer than the first predetermined period, and the synchronization signal is received from the first microcomputer, a second microcomputer (20) continues the measurement by the second timer without resetting the second timer to zero and determines whether the first microcomputer and the second microcomputer are in a normal condition based on whether or not an intermediate target time in which the number of receiving times of the synchronization signal from the start of the measurement by the second timer is multiplied by the first predetermined period can be considered to be equal to the second time.SELECTED DRAWING: Figure 1

Description

本発明は、安全PLC(Programmable Logic Controller)に関する。 The present invention relates to a safety PLC (Programmable Logic Controller).

従来、外部機器から入力される入力信号の処理をそれぞれ同一のプログラムで同期実行する少なくとも2つのマイコンを有し、一方のマイコンは自身の処理状態を示すデータと他のマイコンの処理状態を示すデータとを比較し、両データが不一致であれば異常があるとして制御対象機器への制御出力を停止する安全PLCがある(特許文献1参照)。 Conventionally, there are at least two microcomputers that synchronously execute processing of an input signal input from an external device with the same program, and one microcomputer has data indicating its own processing state and data indicating the processing state of the other microcomputer. There is a safety PLC that compares the two data and stops the control output to the controlled device if the two data do not match (see Patent Document 1).

特開2009-259134号公報JP 2009-259134 A

ところで、一般に、各マイコンは自身のタイマを用いてウオッチドッグ動作を実行し、タイマの制限時間内に信号が入力されることでタイマをリセットして相手マイコンの処理時間を監視する処置を、周期的に継続して行っている。その際に、各マイコンは、各周期をタイマにより計測し、各周期開始時にマイコン同士でハンドシェイク通信をしてタイマ同期させている。 By the way, in general, each microcomputer executes a watchdog operation using its own timer, and when a signal is input within the time limit of the timer, the timer is reset to monitor the processing time of the other microcomputer. continue to do so. At that time, each microcomputer measures each cycle by a timer, and performs handshake communication between the microcomputers at the start of each cycle to synchronize the timers.

このタイマ同期を詳しく説明すると、まず一方のマイコン(第1マイコンと呼称)がタイマ同期開始を希望するタイミングで、他方のマイコン(第2マイコンと呼称)にハンドシェイク信号を送る。それを受けた第2マイコンは、タイマのゼロリセット及び計測開始(タイマ同期開始)を行うと共に、第1マイコンにハンドシェイク信号を送る。それを受けた第1マイコンは、タイマのゼロリセット及び計測開始(タイマ同期開始)を行う。 To explain this timer synchronization in detail, first, one microcomputer (referred to as the first microcomputer) sends a handshake signal to the other microcomputer (referred to as the second microcomputer) at the timing at which it wishes to start timer synchronization. The second microcomputer receiving it resets the timer to zero and starts measurement (timer synchronization start), and also sends a handshake signal to the first microcomputer. The first microcomputer receiving this resets the timer to zero and starts measurement (timer synchronization start).

しかし、この方法では、タイマ同期開始を希望するタイミングに対して、第1マイコン及び第2マイコンの双方のタイマ同期開始タイミングが、毎周期必ず一定時間遅延することとなる。 However, with this method, the timer synchronization start timings of both the first microcomputer and the second microcomputer are always delayed by a certain period of time with respect to the timing at which timer synchronization is desired.

また、現状のウオッチドッグ動作のタイマは、第1マイコンも第2マイコンも極めて短周期でゼロリセットされるので別制御への併用には向いていない。近年PLCの制御が高度化してきているため、このようなウオッチドッグ動作のためのタイマに、別制御の時間計測への併用可能性を付与することを本願発明者は考案した。 In addition, the current watchdog operation timer is not suitable for use in separate control because both the first microcomputer and the second microcomputer are reset to zero in an extremely short period. Since PLC control has become more sophisticated in recent years, the inventors of the present invention devised the possibility of using a timer for such a watchdog operation in combination with time measurement for another control.

本発明は、上記課題を解決するためになされたものであり、その主たる目的は、安全PLCにおいて、複数のマイコンでのタイマ同期に際し、タイマ同期開始を希望するタイミングから実際のタイマ同期開始タイミングまでの遅延を抑制しつつ、少なくとも1つのタイマに別制御の時間計測への併用可能性を付与することにある。 The present invention has been made to solve the above problems, and its main purpose is to provide a safety PLC in which, when synchronizing the timers of a plurality of microcomputers, the timing from the timing at which timer synchronization is desired to the actual timer synchronization start timing is controlled. To provide at least one timer with the possibility of being used together for time measurement of another control while suppressing the delay of .

上記課題を解決するための第1の手段は、
第1マイコン及び第2マイコンを含む二重化回路を備える安全PLCであって、
前記第1マイコンは、第1タイマを備え、前記第1タイマにより計測した第1時間が第1所定周期である場合に、同期信号を前記第2マイコンへ送信するとともに前記第1タイマをゼロリセットして計測を開始することを繰り返し、
前記第2マイコンは、第2タイマを備え、前記第2タイマにより計測した第2時間が前記第1所定周期よりも長い第2所定周期を超えて且つ前記第1マイコンから前記同期信号を受信した場合に、前記第2タイマをゼロリセットして計測を開始することを繰り返し、
前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記第2タイマをゼロリセットせず前記第2タイマによる計測を継続し、且つ前記第2タイマによる計測開始から前記同期信号を受信した回数に前記第1所定周期を掛けた中間目標時間と前記第2時間とが等しいとみなせるか否かに基づいて、前記第1マイコン及び前記第2マイコンが正常であるか否か判定する。
The first means for solving the above problems is
A safety PLC comprising a redundant circuit including a first microcomputer and a second microcomputer,
The first microcomputer has a first timer, and transmits a synchronization signal to the second microcomputer and resets the first timer to zero when the first time measured by the first timer is a first predetermined period. to start measurement,
The second microcomputer has a second timer, and the second time measured by the second timer exceeds a second predetermined period longer than the first predetermined period and receives the synchronization signal from the first microcomputer. In the case, repeat resetting the second timer to zero and starting measurement,
The second microcomputer performs measurement by the second timer without resetting the second timer to zero when the second time does not exceed the second predetermined period and the synchronization signal is received from the first microcomputer. Based on whether the intermediate target time obtained by multiplying the number of times the synchronization signal is received from the start of measurement by the second timer by the first predetermined period can be regarded as equal to the second time. It is determined whether or not the first microcomputer and the second microcomputer are normal.

上記構成によれば、安全PLCは、第1マイコン及び第2マイコンを含む二重化回路を備えている。このため、第1マイコン及び第2マイコンの一方が故障した場合であっても、他方によりプログラム等を実行することができ、安全PLCの安全性を確保することができる。 According to the above configuration, the safety PLC has a redundant circuit including the first microcomputer and the second microcomputer. Therefore, even if one of the first microcomputer and the second microcomputer fails, the other can execute a program or the like, and the safety of the safety PLC can be ensured.

前記第1マイコンは、第1タイマを備え、前記第1タイマにより計測した第1時間が第1所定周期である場合に、同期信号を前記第2マイコンへ送信するとともに前記第1タイマをゼロリセットして計測を開始することを繰り返す。このため、第1所定周期毎に第1マイコンから第2マイコンへ、ウオッチドッグ動作及びタイマ同期に用いる同期信号を送信することができる。前記第2マイコンは、第2タイマを備え、前記第2タイマにより計測した第2時間が前記第1所定周期よりも長い第2所定周期を超えて且つ前記第1マイコンから前記同期信号を受信した場合に、前記第2タイマをゼロリセットして計測を開始することを繰り返す。このため、第1所定周期がウオッチドッグ動作用に短く設定されていても、第1所定周期よりも長い任意の第2所定周期まで、第2タイマにより時間を計測することが可能となる。したがって、第2タイマに別制御の時間計測への併用可能性を付与することができる。 The first microcomputer has a first timer, and transmits a synchronization signal to the second microcomputer and resets the first timer to zero when the first time measured by the first timer is a first predetermined period. to start measurement. Therefore, the synchronization signal used for the watchdog operation and timer synchronization can be transmitted from the first microcomputer to the second microcomputer every first predetermined period. The second microcomputer has a second timer, and the second time measured by the second timer exceeds a second predetermined period longer than the first predetermined period and receives the synchronization signal from the first microcomputer. In this case, resetting the second timer to zero and starting measurement are repeated. Therefore, even if the first predetermined period is set short for the watchdog operation, the second timer can measure time up to an arbitrary second predetermined period longer than the first predetermined period. Therefore, the second timer can be given the possibility of being used together for time measurement of another control.

さらに、第1マイコンが同期信号を第2マイコンへ送信した時に第1タイマのゼロリセット及び計測開始(タイマ同期開始)が行われ、第2時間が第2所定周期を超えて第2マイコンが同期信号を受信した時に第2タイマのゼロリセット及び計測開始(タイマ同期開始)が行われる。このため、タイマ同期開始を希望するタイミング(第1マイコンによる同期信号の送信タイミング)から実際のタイマ同期開始タイミング(第2マイコンによる同期信号の受信タイミング)までの遅延を、第2所定周期の開始から終了までに、第2所定周期の開始時に第2マイコンに生じる1回のみにすることができる。したがって、タイマ同期開始を希望するタイミングに対して第1マイコン及び第2マイコンの双方のタイマ同期開始タイミングが第1所定周期毎に必ず一定時間遅延する従来技術と比較して、タイマ同期開始を希望するタイミングから実際のタイマ同期開始タイミングまでの遅延を大幅に抑制することができる。 Furthermore, when the first microcomputer transmits a synchronization signal to the second microcomputer, the first timer is reset to zero and measurement is started (timer synchronization is started), and when the second time exceeds the second predetermined period, the second microcomputer is synchronized. When the signal is received, the second timer is reset to zero and measurement is started (timer synchronization is started). For this reason, the delay from the timing at which timer synchronization is desired (timing for transmitting the synchronization signal by the first microcomputer) to the actual timing for starting timer synchronization (timing for receiving the synchronization signal by the second microcomputer) is set to the start of the second predetermined cycle. to end can be only one time, which occurs in the second microcomputer at the beginning of the second predetermined period. Therefore, compared to the conventional technology in which the timer synchronization start timings of both the first microcomputer and the second microcomputer are always delayed by a certain period of time with respect to the desired timer synchronization start timing, the timer synchronization start is desired. It is possible to greatly reduce the delay from the timing to start timer synchronization to the actual timer synchronization start timing.

しかも、前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記第2タイマをゼロリセットせず前記第2タイマによる計測を継続し、且つ前記第2タイマによる計測開始から前記同期信号を受信した回数に前記第1所定周期を掛けた中間目標時間と前記第2時間とが等しいとみなせるか否かに基づいて、前記第1マイコン及び前記第2マイコンが正常であるか否か判定する。ここで、前記第1マイコン及び前記第2マイコンの一方でも異常が生じると、前記第2タイマによる計測開始から前記同期信号を受信した回数に前記第1所定周期を掛けた中間目標時間と前記第2時間とが等しいとみなせなくなる。したがって、第2所定周期の中間においても第1所定周期毎に、前記第1マイコン及び前記第2マイコンの双方が正常であるか否か判定することができ、すなわちウオッチドッグ動作を実行することができる。 Moreover, the second microcomputer does not reset the second timer to zero when the second time does not exceed the second predetermined period and the synchronization signal is received from the first microcomputer. Based on whether or not the intermediate target time obtained by continuing measurement and multiplying the number of times the synchronization signal is received from the start of measurement by the second timer by the first predetermined period and the second time can be considered equal, It is determined whether or not the first microcomputer and the second microcomputer are normal. Here, if an abnormality occurs in either one of the first microcomputer and the second microcomputer, an intermediate target time obtained by multiplying the number of times the synchronization signal is received from the start of measurement by the second timer by the first predetermined period and the second microcomputer 2 hours can no longer be considered equal. Therefore, it is possible to determine whether or not both the first microcomputer and the second microcomputer are normal at each first predetermined cycle even in the middle of the second predetermined cycle, that is, to execute the watchdog operation. can.

第2の手段では、
前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記中間目標時間と前記第2時間との差の絶対値が第1所定値よりも小さければ、前記中間目標時間と前記第2時間とが等しいとみなせるとし、前記差の絶対値が前記第1所定値よりも大きければ、前記中間目標時間と前記第2時間とが等しいとみなせないとし、
前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記差の絶対値が前記第1所定値よりも小さい第2所定値よりも小さければ、前記第2タイマをゼロリセットせず前記第2タイマによる計測を継続し、前記差の絶対値が前記第2所定値よりも大きく且つ前記第1所定値よりも小さければ、前記第2時間を前記中間目標時間に優先的に修正して前記第2タイマによる計測を継続する、請求項1に記載の安全PLC。
In a second way,
When the second time does not exceed the second predetermined period and the synchronization signal is received from the first microcomputer, the second microcomputer determines that the absolute value of the difference between the intermediate target time and the second time is If it is smaller than the first predetermined value, the intermediate target time and the second time can be regarded as equal, and if the absolute value of the difference is larger than the first predetermined value, the intermediate target time and the second time cannot be considered equal, and
The second microcomputer, when the second period does not exceed the second predetermined period and receives the synchronization signal from the first microcomputer, provides a second microcomputer in which the absolute value of the difference is smaller than the first predetermined value. If it is smaller than the predetermined value, the measurement by the second timer is continued without resetting the second timer to zero, and if the absolute value of the difference is larger than the second predetermined value and smaller than the first predetermined value 2. The safety PLC according to claim 1, wherein said second time is preferentially corrected to said intermediate target time and measurement by said second timer is continued.

上記構成によれば、第2マイコンは、第2所定周期の中間において前記中間目標時間と前記第2時間との差の絶対値が第1所定値よりも小さければ、前記中間目標時間と前記第2時間とが等しいとみなせるとして、第1マイコン及び第2マイコンが正常であると判定する。一方、第2マイコンは、第2所定周期の中間において前記差の絶対値が前記第1所定値よりも大きければ、前記中間目標時間と前記第2時間とが等しいとみなせないとして、第1マイコン及び第2マイコンの少なくとも一方が正常でないと判定する。 According to the above configuration, if the absolute value of the difference between the intermediate target time and the second time in the middle of the second predetermined period is smaller than the first predetermined value, the second microcomputer determines the intermediate target time and the second time. It is determined that the first microcomputer and the second microcomputer are normal, assuming that two hours are equal. On the other hand, if the absolute value of the difference is greater than the first predetermined value in the middle of the second predetermined cycle, the second microcomputer determines that the intermediate target time and the second time cannot be considered equal. and at least one of the second microcomputer is not normal.

ここで、第2タイマによる計測時間は、第2所定周期を超えるまでゼロリセットされない。このため、第1マイコン及び第2マイコンが正常であっても、第2所定周期の間に第1タイマによる計測時間と第2タイマによる計測時間とのずれが積算され、第1マイコン及び第2マイコンの少なくとも一方が正常でないと誤判定されるおそれがある。 Here, the time measured by the second timer is not reset to zero until the second predetermined cycle is exceeded. Therefore, even if the first microcomputer and the second microcomputer are normal, the difference between the time measured by the first timer and the time measured by the second timer is accumulated during the second predetermined period, and the first microcomputer and the second microcomputer At least one of the microcomputers may be erroneously determined to be abnormal.

この点、前記第2マイコンは、第2所定周期の中間において前記差の絶対値が前記第1所定値よりも小さい第2所定値よりも小さければ、前記第2タイマをゼロリセットせず前記第2タイマによる計測を継続する。一方、前記第2マイコンは、第2所定周期の中間において前記差の絶対値が前記第2所定値よりも大きく且つ前記第1所定値よりも小さければ、前記第2時間を前記中間目標時間に優先的に修正して前記第2タイマによる計測を継続する。このため、第1マイコン及び第2マイコンが正常であると判定した場合であっても、前記中間目標時間と前記第2時間との差の絶対値が第2所定値よりも大きければ、第1タイマに基づいて第2タイマの計測時間を修正することができる。 In this regard, the second microcomputer does not reset the second timer to zero if the absolute value of the difference is smaller than a second predetermined value smaller than the first predetermined value in the middle of the second predetermined period. 2 Continue the measurement by the timer. On the other hand, if the absolute value of the difference is larger than the second predetermined value and smaller than the first predetermined value in the middle of the second predetermined period, the second microcomputer adjusts the second time to the intermediate target time. Correction is given priority and the measurement by the second timer is continued. Therefore, even if it is determined that the first microcomputer and the second microcomputer are normal, if the absolute value of the difference between the intermediate target time and the second time is greater than the second predetermined value, the first The measurement time of the second timer can be corrected based on the timer.

第3の手段では、前記第2マイコンは、前記第1マイコンによる前記同期信号の送信タイミングから前記第2マイコンによる前記同期信号の受信タイミングまでの遅れ時間を予め取得し、前記第2タイマをゼロリセットしてから前記第2タイマにより計測された時間に前記遅れ時間を足した時間を前記第2時間とする。こうした構成によれば、第2マイコンのタイマ同期開始タイミングを、実質的にタイマ同期開始を希望するタイミング(第1マイコンによる同期信号の送信タイミング)に一致させることができる。したがって、タイマ同期開始を希望するタイミングから実際のタイマ同期開始タイミングまでの遅延をさらに抑制することができる。 In the third means, the second microcomputer obtains in advance a delay time from the transmission timing of the synchronization signal by the first microcomputer to the reception timing of the synchronization signal by the second microcomputer, and sets the second timer to zero. A time obtained by adding the delay time to the time measured by the second timer after resetting is defined as the second time. According to such a configuration, the timer synchronization start timing of the second microcomputer can substantially match the desired timing of timer synchronization start (transmission timing of the synchronization signal by the first microcomputer). Therefore, it is possible to further reduce the delay from the timing at which timer synchronization is desired to the timing at which timer synchronization is actually started.

安全PLC及び周辺機器を示す模式図。Schematic diagram showing a safety PLC and peripheral devices. 各信号及び各タイマの計測時間を示すタイムチャート。A time chart showing measurement time of each signal and each timer. 各タイマの同期態様を示すタイムチャート。The time chart which shows the synchronous aspect of each timer. 比較例の各信号及び各タイマの計測時間を示すタイムチャート。4 is a time chart showing measurement times of each signal and each timer in a comparative example; 比較例の各タイマの同期態様を示すタイムチャート。4 is a time chart showing synchronization modes of respective timers in a comparative example;

以下、安全PLCに具現化した一実施形態について、図面を参照しつつ説明する。 An embodiment embodied in a safety PLC will be described below with reference to the drawings.

図1に示すように、安全PLC100は、安全入力機器30から信号を入力し、入力した信号に基づいてプログラムを実行して、実行結果に基づいて制御対象機器40へ信号を出力する。安全入力機器30は、例えば非常停止ボタン、安全ドアスイッチ、セーフティセンサ等である。制御対象機器40は、例えばロボット、工作機械、バルブ、モータ等である。 As shown in FIG. 1, the safety PLC 100 receives a signal from the safety input device 30, executes a program based on the input signal, and outputs a signal to the controlled device 40 based on the execution result. The safety input device 30 is, for example, an emergency stop button, a safety door switch, a safety sensor, or the like. The controlled device 40 is, for example, a robot, a machine tool, a valve, a motor, or the like.

安全PLC100は、第1マイコン10、第1水晶発振子18、第2マイコン20、第2水晶発振子28等を備えている。第1水晶発振子18及び第2水晶発振子28は、共通の所定周波数でクロック信号を発信する。ただし、第1水晶発振子18と第2水晶発振子28との精度の違いから、第1水晶発振子18のクロック信号の周波数と第2水晶発振子28のクロック信号の周波数とに僅かなずれが存在する。 The safety PLC 100 includes a first microcomputer 10, a first crystal oscillator 18, a second microcomputer 20, a second crystal oscillator 28, and the like. The first crystal oscillator 18 and the second crystal oscillator 28 generate a clock signal at a common predetermined frequency. However, due to the difference in accuracy between the first crystal oscillator 18 and the second crystal oscillator 28, there is a slight difference between the frequency of the clock signal of the first crystal oscillator 18 and the frequency of the clock signal of the second crystal oscillator 28. exists.

第1マイコン10は、第1タイマ11、メモリ12、CPU13、シリアル通信ポートUART、GPIO(General Purpose Input/Output)ポート等を備えている。 The first microcomputer 10 includes a first timer 11, a memory 12, a CPU 13, a serial communication port UART, a GPIO (General Purpose Input/Output) port, and the like.

第1タイマ11は、第1水晶発振子18からのクロック信号に基づいて時間を計測する。以後、第1タイマ11により計測した時間を第1時間Tm1という。第1タイマ11の計測開始、リセット等は、CPU13により制御される。 The first timer 11 measures time based on the clock signal from the first crystal oscillator 18 . Hereinafter, the time measured by the first timer 11 will be referred to as a first time Tm1. The CPU 13 controls the start of measurement, reset, etc. of the first timer 11 .

メモリ12は、CPU13により実行する各種プログラムや、データ等を記憶する。各種プログラムは、第1マイコン10と第2マイコン20とが共通で実行する所定プログラムと、それ以外のプログラムとを含んでいる。プログラムは、一纏まりの命令(処理)であるタスクを複数含んでいる。 The memory 12 stores various programs executed by the CPU 13, data, and the like. Various programs include a predetermined program commonly executed by the first microcomputer 10 and the second microcomputer 20 and other programs. A program includes a plurality of tasks, which are a set of instructions (processes).

CPU13は、第1水晶発振子18からのクロック信号により動作する。CPU13は、メモリ12に記憶された各種プログラムを実行する。すなわち、CPU13(第1マイコン10)は、上記所定プログラムに含まれる各タスクを実行する。第1マイコン10は、安全入力機器30から入力された信号を処理し、その処理結果に基づいて制御対象機器40への信号を作成する。 The CPU 13 operates with a clock signal from the first crystal oscillator 18 . The CPU 13 executes various programs stored in the memory 12 . That is, the CPU 13 (first microcomputer 10) executes each task included in the predetermined program. The first microcomputer 10 processes the signal input from the safety input device 30 and creates a signal to the controlled device 40 based on the processing result.

第2マイコン20も、第1マイコン10と同様の構成を備えており、第1マイコン10と同様のタスクを実行する。すなわち、安全PLC100は、第1マイコン10及び第2マイコン20を含む二重化回路を備えている。 The second microcomputer 20 also has a configuration similar to that of the first microcomputer 10 and executes tasks similar to those of the first microcomputer 10 . That is, the safety PLC 100 has a duplexed circuit including the first microcomputer 10 and the second microcomputer 20 .

安全PLC100は、第1マイコン10が作成した信号と第2マイコン20が作成した信号とが一致する場合に、その信号を制御対象機器40へ出力する。一方、安全PLC100は、第1マイコン10が作成した信号と第2マイコン20が作成した信号とが一致しない場合に、異常を検知し、所定のフェールセーフ処理を実行する。所定のフェールセーフ処理は、例えばロボットへの電力供給を停止する等の処理である。 When the signal created by the first microcomputer 10 and the signal created by the second microcomputer 20 match, the safety PLC 100 outputs the signal to the controlled device 40 . On the other hand, when the signal generated by the first microcomputer 10 and the signal generated by the second microcomputer 20 do not match, the safety PLC 100 detects an abnormality and executes predetermined fail-safe processing. The predetermined fail-safe process is, for example, a process of stopping power supply to the robot.

まず、図4を参照して、比較例の各信号及び各タイマ11,21の計測時間について説明する。 First, referring to FIG. 4, each signal and the measurement time of each timer 11 and 21 in the comparative example will be described.

第1マイコン10及び第2マイコン20は、第1所定周期Pd1毎にGPIOハンドシェイクを実行する。具体的には、第1マイコン10及び第2マイコン20は、第1所定周期Pd1毎にGPIOポートを介してハンドシェイク信号を送受信して、それぞれ第1タイマ11及び第2タイマ21をゼロリセットしてそれらによる計測を開始する。第1所定周期Pd1は、ウオッチドッグ動作における各タイマ11,21の上限値に対応して設定されており、例えば100[μs]である。マイコン10,20は、ウオッチドッグ動作の上限値に達するまでに、ハンドシェイク信号を受信しなかった場合に異常を検知する。 The first microcomputer 10 and the second microcomputer 20 execute the GPIO handshake every first predetermined period Pd1. Specifically, the first microcomputer 10 and the second microcomputer 20 transmit and receive a handshake signal via the GPIO port every first predetermined period Pd1, and reset the first timer 11 and the second timer 21 to zero, respectively. to start measuring with them. The first predetermined period Pd1 is set corresponding to the upper limit value of each timer 11, 21 in the watchdog operation, and is 100 [μs], for example. The microcomputers 10 and 20 detect an abnormality when the handshake signal is not received before reaching the upper limit of the watchdog operation.

また、CPU13,23は、各第1所定周期Pd1において、所定プログラムに含まれる同一のタスクの処理をそれぞれ実行する。そして、CPU13,23は、各第1所定周期Pd1において所定のタイミングで、シリアル通信ポートUARTを介して、互いに実行した処理の履歴を交換する。CPU13,23は、履歴が一致しない場合に異常を検知し、所定のフェールセーフ処理を実行する。 Also, the CPUs 13 and 23 each execute the same task process included in the predetermined program in each of the first predetermined cycles Pd1. Then, the CPUs 13 and 23 exchange histories of processes executed with each other via the serial communication port UART at a predetermined timing in each first predetermined period Pd1. The CPUs 13 and 23 detect an abnormality when the histories do not match, and execute predetermined fail-safe processing.

図5は、比較例の各タイマ11,21の同期態様を示すタイムチャートである。 FIG. 5 is a time chart showing how the timers 11 and 21 of the comparative example are synchronized.

第1マイコン10は、タイマ同期開始を希望するタイミングt21において、GPIOポートを介してハンドシェイク信号を第2マイコン20へ送信する。第2マイコン20は、タイミングt21から遅れ時間Δt1後のタイミングt22において、GPIOポートを介してハンドシェイク信号を受信する。 The first microcomputer 10 transmits a handshake signal to the second microcomputer 20 via the GPIO port at the timing t21 at which the timer synchronization start is desired. The second microcomputer 20 receives the handshake signal via the GPIO port at timing t22 after the delay time Δt1 from timing t21.

第2マイコン20は、ハンドシェイク信号を受信すると、第2タイマ21をゼロリセットして計測を開始するとともに、GPIOポートを介してハンドシェイク信号を第1マイコン10へ送信する。第1マイコン10は、タイミングt21から遅れ時間Δt2後のタイミングt23において、GPIOポートを介してハンドシェイク信号を受信する。第1マイコン10は、ハンドシェイク信号を受信すると、第1タイマ11をゼロリセットして計測を開始する。 Upon receiving the handshake signal, the second microcomputer 20 resets the second timer 21 to zero, starts measurement, and transmits the handshake signal to the first microcomputer 10 via the GPIO port. The first microcomputer 10 receives the handshake signal via the GPIO port at timing t23 after delay time Δt2 from timing t21. Upon receiving the handshake signal, the first microcomputer 10 resets the first timer 11 to zero and starts measurement.

このように比較例では、タイマ同期開始を希望するタイミングt21に対して、第2タイマ21の同期開始タイミング(t22)は遅れ時間Δt1だけ遅れ、第1タイマ11の同期開始タイミング(t23)は遅れ時間Δt2だけ遅れる。しかも、これらの同期開始タイミングの遅れは、第1所定周期Pd1の開始時に毎回生じる。 Thus, in the comparative example, the synchronization start timing (t22) of the second timer 21 is delayed by the delay time Δt1, and the synchronization start timing (t23) of the first timer 11 is delayed with respect to the timing t21 at which timer synchronization is desired. It is delayed by time Δt2. Moreover, these synchronization start timing delays occur every time the first predetermined period Pd1 starts.

そこで、本実施形態では、以下のように各タイマ11,21の同期を実行する。図2は、各信号及び各タイマ11,21の計測時間を示すタイムチャートである。なお、ここでは、説明の簡便化のために、第2タイマ21をゼロリセットする第2所定周期Pd2を、第1所定周期Pd1の2倍にした例を示している。第2所定周期Pd2は、第1所定周期Pd1の何万倍や、何億倍(任意の倍数)に設定することもできる。なお、第2所定周期Pd2は、第1所定周期Pd1の何万倍や、何億倍に所定値を加減した値に設定することもできる。 Therefore, in this embodiment, the timers 11 and 21 are synchronized as follows. FIG. 2 is a time chart showing the measurement time of each signal and each timer 11, 21. As shown in FIG. Here, for simplification of explanation, an example is shown in which the second predetermined period Pd2 for resetting the second timer 21 to zero is twice the first predetermined period Pd1. The second predetermined period Pd2 can also be set to tens of thousands or hundreds of millions of times (any multiple) the first predetermined period Pd1. The second predetermined period Pd2 can also be set to a value obtained by adding or subtracting a predetermined value by tens of thousands or hundreds of millions of times the first predetermined period Pd1.

第1マイコン10は、第1所定周期Pd1毎に第2マイコン20へ一方的に指示をする。具体的には、第1マイコン10は、第1所定周期Pd1毎にGPIOポートを介して同期信号Syを送信するとともに、第1タイマ11をゼロリセットして計測を開始する。第1所定周期Pd1は、上記比較例と同様に設定されている。第2マイコン20は、第2所定周期Pd2の中間において、同期信号Syを受信した場合に第2タイマ21をゼロリセットせず第2タイマ21による計測を継続する。第2マイコン20は、同期信号Syを受信した回数nに第1所定周期Pd1を掛けた中間目標時間T(n)と第2タイマ21による計測時間とが等しいとみなせるか否か判定する(T(n)=n×Pd1)。第2マイコン20は、中間目標時間T(n)と第2タイマ21による計測時間とが等しいとみなせないと判定した場合に異常を検知する。 The first microcomputer 10 unilaterally instructs the second microcomputer 20 every first predetermined period Pd1. Specifically, the first microcomputer 10 transmits the synchronization signal Sy via the GPIO port at each first predetermined period Pd1, resets the first timer 11 to zero, and starts measurement. The first predetermined period Pd1 is set in the same manner as in the comparative example. The second microcomputer 20 continues the measurement by the second timer 21 without resetting the second timer 21 to zero when the synchronization signal Sy is received in the middle of the second predetermined period Pd2. The second microcomputer 20 determines whether or not the intermediate target time T(n) obtained by multiplying the number n of times the synchronization signal Sy is received by the first predetermined period Pd1 is equal to the time measured by the second timer 21 (T (n)=n×Pd1). The second microcomputer 20 detects an abnormality when it determines that the intermediate target time T(n) and the time measured by the second timer 21 are not equal.

また、CPU13,23は、各第1所定周期Pd1において、所定プログラムに含まれる同一のタスクの処理をそれぞれ実行する。そして、CPU13,23は、各第1所定周期Pd1において所定のタイミングで、シリアル通信ポートUARTを介して、互いに実行した処理の履歴を交換する。CPU13,23は、履歴が一致しない場合に異常を検知し、所定のフェールセーフ処理を実行する。 Also, the CPUs 13 and 23 each execute the same task process included in the predetermined program in each of the first predetermined cycles Pd1. Then, the CPUs 13 and 23 exchange histories of processes executed with each other via the serial communication port UART at a predetermined timing in each first predetermined period Pd1. The CPUs 13 and 23 detect an abnormality when the histories do not match, and execute predetermined fail-safe processing.

図3は、各タイマ11,21の同期態様を示すタイムチャートである。 FIG. 3 is a time chart showing how the timers 11 and 21 are synchronized.

第1マイコン10は、タイマ同期開始を希望するタイミングt11において、GPIOポートを介して同期信号Syを第2マイコン20へ送信する。第2マイコン20は、タイミングt21から遅れ時間Δt1後のタイミングt12において、GPIOポートを介して同期信号Syを受信する。第2マイコン20は、同期信号Syを受信すると、第2タイマ21をゼロリセットして計測を開始する。なお、タイミングt12において、第2タイマ21により計測した時間(以下、「第2時間Tm2」という)が、第2所定周期Pd2を超えているとする。 The first microcomputer 10 transmits the synchronization signal Sy to the second microcomputer 20 via the GPIO port at the timing t11 at which the timer synchronization start is desired. The second microcomputer 20 receives the synchronization signal Sy via the GPIO port at timing t12 after the delay time Δt1 from timing t21. Upon receiving the synchronization signal Sy, the second microcomputer 20 resets the second timer 21 to zero and starts measurement. It is assumed that the time measured by the second timer 21 (hereinafter referred to as "second time Tm2") exceeds the second predetermined period Pd2 at timing t12.

第1マイコン10は、次にタイマ同期開始を希望するタイミングt13において、GPIOポートを介して同期信号Syを第2マイコン20へ送信する。第2マイコン20は、タイミングt13から遅れ時間Δt1後のタイミングt14において、GPIOポートを介して同期信号Syを受信する。 The first microcomputer 10 next transmits the synchronization signal Sy to the second microcomputer 20 via the GPIO port at the timing t13 at which the start of timer synchronization is desired. The second microcomputer 20 receives the synchronization signal Sy via the GPIO port at timing t14 after the delay time Δt1 from timing t13.

第2マイコン20は、第2時間Tm2が第2所定周期Pd2を超えず且つ第1マイコン10から同期信号Syを受信した場合に、第2タイマ21をゼロリセットせず第2タイマ21による計測を継続する。さらに、第2マイコン20は、第2タイマ21による計測開始(タイミングt12)から同期信号Syを受信した回数n(ここではn=1)に第1所定周期Pd1を掛けた中間目標時間T(n)と第2時間Tm2とが等しいとみなせるか否かに基づいて、第1マイコン10及び第2マイコン20が正常であるか否か判定する。 When the second time Tm2 does not exceed the second predetermined period Pd2 and the synchronization signal Sy is received from the first microcomputer 10, the second microcomputer 20 does not reset the second timer 21 to zero and performs measurement by the second timer 21. continue. Further, the second microcomputer 20 multiplies the number of times n (here, n=1) that the synchronization signal Sy is received from the start of measurement by the second timer 21 (timing t12) by the first predetermined period Pd1, to obtain an intermediate target time T(n ) is equal to the second time Tm2, it is determined whether the first microcomputer 10 and the second microcomputer 20 are normal.

詳しくは、第2マイコン20は、中間目標時間T(n)と第2時間Tm2との差の絶対値(|T(n)-Tm2|)が第1所定値Tr1よりも小さければ、中間目標時間T(n)と第2時間Tm2とが等しいとみなせるとする。第2マイコン20は、|T(n)-Tm2|が第1所定値Tr1よりも大きければ、中間目標時間T(n)と第2時間Tm2とが等しいとみなせないとする。 Specifically, if the absolute value of the difference (|T(n)-Tm2|) between the intermediate target time T(n) and the second time Tm2 is smaller than the first predetermined value Tr1, the second microcomputer 20 sets the intermediate target time T(n). Assume that the time T(n) and the second time Tm2 can be considered equal. If |T(n)-Tm2| is greater than the first predetermined value Tr1, the second microcomputer 20 does not consider that the intermediate target time T(n) and the second time Tm2 are equal.

第2マイコン20は、中間目標時間T(n)と第2時間Tm2とが等しいとみなせる場合に、第1マイコン10及び第2マイコン20の双方が正常であると判定する。第2マイコン20は、中間目標時間T(n)と第2時間Tm2とが等しいとみなせない場合に、第1マイコン10及び第2マイコン20の少なくとも一方が異常であると判定する。 The second microcomputer 20 determines that both the first microcomputer 10 and the second microcomputer 20 are normal when the intermediate target time T(n) and the second time Tm2 can be considered equal. The second microcomputer 20 determines that at least one of the first microcomputer 10 and the second microcomputer 20 is abnormal when the intermediate target time T(n) and the second time Tm2 cannot be considered equal.

第1マイコン10は、次にタイマ同期開始を希望するタイミングt15において、GPIOポートを介して同期信号Syを第2マイコン20へ送信する。第2マイコン20は、タイミングt15から遅れ時間Δt1後のタイミングt16において、GPIOポートを介して同期信号Syを受信する。タイミングt16において、第2時間Tm2は第2所定周期Pd2を超えている。このため、第2マイコン20は、第2タイマ21をゼロリセットして計測を開始する。 The first microcomputer 10 next transmits the synchronization signal Sy to the second microcomputer 20 via the GPIO port at the timing t15 at which the start of timer synchronization is desired. The second microcomputer 20 receives the synchronization signal Sy via the GPIO port at timing t16 after the delay time Δt1 from timing t15. At timing t16, the second time Tm2 exceeds the second predetermined period Pd2. Therefore, the second microcomputer 20 resets the second timer 21 to zero and starts measurement.

以上詳述した本実施形態は、以下の利点を有する。 The embodiment detailed above has the following advantages.

・第1マイコン10は、第1タイマ11を備え、第1タイマ11により計測した第1時間Tm1が第1所定周期Pd1である場合に、同期信号Syを第2マイコン20へ送信するとともに第1タイマ11をゼロリセットして計測を開始することを繰り返す。このため、第1所定周期Pd1毎に第1マイコン10から第2マイコン20へ、ウオッチドッグ動作及びタイマ同期に用いる同期信号Syを送信することができる。第2マイコン20は、第2タイマ21を備え、第2タイマ21により計測した第2時間Tm2が第1所定周期Pd1よりも長い第2所定周期Pd2を超えて且つ第1マイコン10から同期信号Syを受信した場合に、第2タイマ21をゼロリセットして計測を開始することを繰り返す。このため、第1所定周期Pd1がウオッチドッグ動作用に短く設定されていても、第1所定周期Pd1よりも長い任意の第2所定周期Pd2まで、第2タイマ21により時間を計測することが可能となる。したがって、第2タイマ21に別制御の時間計測への併用可能性を付与することができる。なお、第1所定周期Pd1はウオッチドッグ動作用に短く設定されているため、別制御の時間計測への併用は困難である。 The first microcomputer 10 has a first timer 11, and when the first time Tm1 measured by the first timer 11 is the first predetermined period Pd1, the first microcomputer 10 transmits the synchronization signal Sy to the second microcomputer 20 and Repeat the process of resetting the timer 11 to zero and starting measurement. Therefore, the synchronization signal Sy used for watchdog operation and timer synchronization can be transmitted from the first microcomputer 10 to the second microcomputer 20 every first predetermined period Pd1. The second microcomputer 20 has a second timer 21, and the second time Tm2 measured by the second timer 21 exceeds a second predetermined period Pd2 longer than the first predetermined period Pd1 and the synchronization signal Sy from the first microcomputer 10 is exceeded. is received, the second timer 21 is reset to zero and measurement is started. Therefore, even if the first predetermined period Pd1 is set short for watchdog operation, the second timer 21 can measure time up to an arbitrary second predetermined period Pd2 longer than the first predetermined period Pd1. becomes. Therefore, it is possible to give the second timer 21 the possibility of being used together for time measurement of another control. Since the first predetermined period Pd1 is set short for the watchdog operation, it is difficult to use it for time measurement of another control.

・第1マイコン10が同期信号Syを第2マイコン20へ送信した時に第1タイマ11のゼロリセット及び計測開始(タイマ同期開始)が行われ、第2時間Tm2が第2所定周期Pd2を超えて第2マイコン20が同期信号Syを受信した時に第2タイマ21のゼロリセット及び計測開始(タイマ同期開始)が行われる。このため、タイマ同期開始を希望するタイミング(第1マイコン10による同期信号Syの送信タイミング)から実際のタイマ同期開始タイミング(第2マイコン20による同期信号Syの受信タイミング)までの遅延を、第2所定周期Pd2の開始から終了までに、第2所定周期Pd2の開始時に第2マイコン20に生じる1回のみにすることができる。したがって、タイマ同期開始を希望するタイミングに対して第1マイコン10及び第2マイコン20の双方のタイマ同期開始タイミングが第1所定周期Pd1毎に必ず一定時間遅延する従来技術と比較して、タイマ同期開始を希望するタイミングから実際のタイマ同期開始タイミングまでの遅延を大幅に抑制することができる。 ・When the first microcomputer 10 transmits the synchronization signal Sy to the second microcomputer 20, the first timer 11 is reset to zero and measurement is started (timer synchronization is started), and the second time Tm2 exceeds the second predetermined period Pd2. When the second microcomputer 20 receives the synchronization signal Sy, the second timer 21 is reset to zero and measurement is started (timer synchronization is started). For this reason, the delay from the timing at which timer synchronization is desired (the transmission timing of the synchronization signal Sy by the first microcomputer 10) to the actual timer synchronization start timing (the timing at which the synchronization signal Sy is received by the second microcomputer 20) is set to the second From the start to the end of the predetermined period Pd2, it is possible to have only one occurrence in the second microcomputer 20 at the start of the second predetermined period Pd2. Therefore, compared with the prior art in which the timer synchronization start timings of both the first microcomputer 10 and the second microcomputer 20 are always delayed by a certain period of time with respect to the desired timing of timer synchronization start every first predetermined period Pd1, timer synchronization It is possible to greatly reduce the delay from the desired start timing to the actual timer synchronization start timing.

・第2マイコン20は、第2時間Tm2が第2所定周期Pd2を超えず且つ第1マイコン10から同期信号Syを受信した場合に、第2タイマ21をゼロリセットせず第2タイマ21による計測を継続し、且つ第2タイマ21による計測開始から同期信号Syを受信した回数nに第1所定周期Pd1を掛けた中間目標時間T(n)と第2時間Tm2とが等しいとみなせるか否かに基づいて、第1マイコン10及び第2マイコン20が正常であるか否か判定する。ここで、第1マイコン10及び第2マイコン20の一方でも異常が生じると、第2タイマ21による計測開始から同期信号Syを受信した回数nに第1所定周期Pd1を掛けた中間目標時間T(n)と第2時間Tm2とが等しいとみなせなくなる。したがって、第2所定周期Pd2の中間においても第1所定周期Pd1毎に、第1マイコン10及び第2マイコン20の双方が正常であるか否か判定することができ、すなわちウオッチドッグ動作を実行することができる。 When the second time Tm2 does not exceed the second predetermined period Pd2 and the synchronization signal Sy is received from the first microcomputer 10, the second microcomputer 20 does not reset the second timer 21 to zero and performs measurement by the second timer 21. and the intermediate target time T(n) obtained by multiplying the number n of times the synchronization signal Sy is received from the start of measurement by the second timer 21 by the first predetermined period Pd1 is considered to be equal to the second time Tm2. Based on, it is determined whether the first microcomputer 10 and the second microcomputer 20 are normal. Here, if an abnormality occurs in either the first microcomputer 10 or the second microcomputer 20, an intermediate target time T ( n) and the second time Tm2 cannot be considered equal. Therefore, it is possible to determine whether or not both the first microcomputer 10 and the second microcomputer 20 are normal every first predetermined period Pd1 even in the middle of the second predetermined period Pd2. be able to.

なお、上記実施形態を、以下のように変更して実施することもできる。上記実施形態と同一の部分については、同一の符号を付すことにより説明を省略する。 It should be noted that the above embodiment can be modified as follows. Parts that are the same as those in the above embodiment are denoted by the same reference numerals, and descriptions thereof are omitted.

・第2マイコン20は、第2時間Tm2が第2所定周期Pd2を超えず且つ第1マイコン10から同期信号Syを受信した場合に、中間目標時間T(n)と第2時間Tm2との差の絶対値(|T(n)-Tm2|)が第1所定値Tr1よりも小さい第2所定値Tr2よりも小さければ、第2タイマ21をゼロリセットせず第2タイマ21による計測を継続し、|T(n)-Tm2|が第2所定値Tr2よりも大きく且つ第1所定値Tr1よりも小さければ、第2時間Tm2を中間目標時間T(n)に優先的に修正して第2タイマ21による計測を継続してもよい。 The second microcomputer 20 detects the difference between the intermediate target time T(n) and the second time Tm2 when the second time Tm2 does not exceed the second predetermined period Pd2 and the synchronization signal Sy is received from the first microcomputer 10. is smaller than a second predetermined value Tr2 which is smaller than the first predetermined value Tr1, the second timer 21 is not reset to zero and the measurement by the second timer 21 is continued. , |T(n)−Tm2| is larger than the second predetermined value Tr2 and smaller than the first predetermined value Tr1, the second time Tm2 is preferentially corrected to the intermediate target time T(n) and the second Measurement by the timer 21 may be continued.

ここで、第2タイマ21による計測時間は、第2所定周期Pd2を超えるまでゼロリセットされない。このため、第1マイコン10及び第2マイコン20が正常であっても、第2所定周期Pd2の間に第1タイマ11による計測時間(第1時間Tm1)と第2タイマ21による計測時間(第2時間Tm2)とのずれが積算され、第1マイコン10及び第2マイコン20の少なくとも一方が正常でないと誤判定されるおそれがある。 Here, the time measured by the second timer 21 is not reset to zero until it exceeds the second predetermined period Pd2. Therefore, even if the first microcomputer 10 and the second microcomputer 20 are normal, the time measured by the first timer 11 (the first time Tm1) and the time measured by the second timer 21 (the time Tm1) during the second predetermined period Pd2 The difference from the two hours Tm2) is accumulated, and there is a possibility that at least one of the first microcomputer 10 and the second microcomputer 20 is erroneously determined to be abnormal.

この点、第2マイコン20は、第2所定周期Pd2の中間において|T(n)-Tm2|が第1所定値Tr1よりも小さい第2所定値Tr2よりも小さければ、第2タイマ21をゼロリセットせず第2タイマ21による計測を継続する。一方、第2マイコン20は、第2所定周期Pd2の中間において|T(n)-Tm2|が第2所定値Tr2よりも大きく且つ第1所定値Tr1よりも小さければ、第2時間Tm2を中間目標時間T(n)に優先的に修正して第2タイマ21による計測を継続する。このため、第1マイコン10及び第2マイコン20が正常であると判定した場合であっても、|T(n)-Tm2|が第2所定値Tr2よりも大きければ、第1タイマ11に基づいて第2タイマ21の計測時間を修正することができる。 In this regard, the second microcomputer 20 sets the second timer 21 to zero if |T(n)-Tm2| The measurement by the second timer 21 is continued without resetting. On the other hand, if |T(n)-Tm2| The target time T(n) is preferentially corrected and the measurement by the second timer 21 is continued. Therefore, even if it is determined that the first microcomputer 10 and the second microcomputer 20 are normal, if |T(n)-Tm2| is greater than the second predetermined value Tr2, the first timer 11 can be used to correct the measurement time of the second timer 21 .

なお、中間目標時間T(n)と第2時間Tm2との差の絶対値(|T(n)-Tm2|)に代えて、中間目標時間T(n)と第2時間Tm2との比(T(n)/Tm2)を用いることもできる。その場合は、|T(n)-Tm2|が第1所定値Tr1よりも小さいか否かに代えて、T(n)/Tm2が1よりも小さい第3所定値Tr3よりも大きく、且つT(n)/Tm2が1よりも大きい第4所定値Tr4よりも小さいか否か判定すればよい。また、|T(n)-Tm2|が第2所定値Tr2よりも小さいか否かに代えて、T(n)/Tm2が、1よりも小さく且つ第3所定値Tr3よりも大きい第5所定値Tr5よりも大きく、且つT(n)/Tm2が、1よりも大きく且つ第4所定値Tr4よりも小さい第6所定値Tr6よりも小さいか否か判定すればよい。 Instead of the absolute value of the difference between the intermediate target time T(n) and the second time Tm2 (|T(n)-Tm2|), the ratio T(n)/Tm2) can also be used. In that case, instead of determining whether |T(n)-Tm2| It is only necessary to determine whether (n)/Tm2 is smaller than a fourth predetermined value Tr4 greater than one. is smaller than the second predetermined value Tr2, T(n)/Tm2 is smaller than 1 and greater than the third predetermined value Tr3. It may be determined whether T(n)/Tm2 is larger than the value Tr5 and smaller than a sixth predetermined value Tr6 which is larger than 1 and smaller than the fourth predetermined value Tr4.

・第2マイコン20は、第1マイコン10による同期信号Syの送信タイミングから第2マイコン20による同期信号Syの受信タイミングまでの遅れ時間Δt1を予め取得し、第2タイマ21をゼロリセットしてから第2タイマ21により計測された時間に遅れ時間Δt1を足した時間を第2時間Tm2とすることもできる。なお、遅れ時間Δt1は、予め試験等に基づいて取得しておくことができる。こうした構成によれば、第2時間Tm2は、タイミングt11から第2タイマ21により計測を開始した場合の計測時間と等しくなる。このため、第2マイコン20のタイマ同期開始タイミングを、実質的にタイマ同期開始を希望するタイミングT1(第1マイコン10による同期信号Syの送信タイミング)に一致させることができる。したがって、タイマ同期開始を希望するタイミングT1から実際のタイマ同期開始タイミングまでの遅延をさらに抑制することができる。 ・The second microcomputer 20 obtains in advance the delay time Δt1 from the timing of transmitting the synchronization signal Sy by the first microcomputer 10 to the timing of receiving the synchronization signal Sy by the second microcomputer 20, and resets the second timer 21 to zero. A time obtained by adding the delay time Δt1 to the time measured by the second timer 21 may be set as the second time Tm2. Note that the delay time Δt1 can be obtained in advance based on tests or the like. According to such a configuration, the second time Tm2 is equal to the measurement time when the second timer 21 starts measuring from timing t11. Therefore, the timer synchronization start timing of the second microcomputer 20 can substantially coincide with the timing T1 at which the timer synchronization start is desired (the transmission timing of the synchronization signal Sy by the first microcomputer 10). Therefore, it is possible to further suppress the delay from the timing T1 at which the timer synchronization start is desired to the actual timer synchronization start timing.

・安全PLC100は、第2マイコン20と同様の機能を有する第3マイコン、第4マイコン等を備えていてもよい。 - The safety PLC 100 may include a third microcomputer, a fourth microcomputer, etc. having the same functions as the second microcomputer 20 .

なお、上記の各変更例を組み合わせて実施することもできる。 It should be noted that it is also possible to implement a combination of the above modified examples.

10…第1マイコン、11…第1タイマ、20…第2マイコン、21…第2タイマ、100…安全PLC。 10... First microcomputer, 11... First timer, 20... Second microcomputer, 21... Second timer, 100... Safety PLC.

Claims (3)

第1マイコン及び第2マイコンを含む二重化回路を備える安全PLCであって、
前記第1マイコンは、第1タイマを備え、前記第1タイマにより計測した第1時間が第1所定周期である場合に、同期信号を前記第2マイコンへ送信するとともに前記第1タイマをゼロリセットして計測を開始することを繰り返し、
前記第2マイコンは、第2タイマを備え、前記第2タイマにより計測した第2時間が前記第1所定周期よりも長い第2所定周期を超えて且つ前記第1マイコンから前記同期信号を受信した場合に、前記第2タイマをゼロリセットして計測を開始することを繰り返し、
前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記第2タイマをゼロリセットせず前記第2タイマによる計測を継続し、且つ前記第2タイマによる計測開始から前記同期信号を受信した回数に前記第1所定周期を掛けた中間目標時間と前記第2時間とが等しいとみなせるか否かに基づいて、前記第1マイコン及び前記第2マイコンが正常であるか否か判定する、安全PLC。
A safety PLC comprising a redundant circuit including a first microcomputer and a second microcomputer,
The first microcomputer has a first timer, and transmits a synchronization signal to the second microcomputer and resets the first timer to zero when the first time measured by the first timer is a first predetermined period. to start measurement,
The second microcomputer has a second timer, and the second time measured by the second timer exceeds a second predetermined period longer than the first predetermined period and receives the synchronization signal from the first microcomputer. In the case, repeat resetting the second timer to zero and starting measurement,
The second microcomputer performs measurement by the second timer without resetting the second timer to zero when the second time does not exceed the second predetermined period and the synchronization signal is received from the first microcomputer. Based on whether the intermediate target time obtained by multiplying the number of times the synchronization signal is received from the start of measurement by the second timer by the first predetermined period can be regarded as equal to the second time. A safety PLC that determines whether the first microcomputer and the second microcomputer are normal.
前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記中間目標時間と前記第2時間との差の絶対値が第1所定値よりも小さければ、前記中間目標時間と前記第2時間とが等しいとみなせるとし、前記差の絶対値が前記第1所定値よりも大きければ、前記中間目標時間と前記第2時間とが等しいとみなせないとし、
前記第2マイコンは、前記第2時間が前記第2所定周期を超えず且つ前記第1マイコンから前記同期信号を受信した場合に、前記差の絶対値が前記第1所定値よりも小さい第2所定値よりも小さければ、前記第2タイマをゼロリセットせず前記第2タイマによる計測を継続し、前記差の絶対値が前記第2所定値よりも大きく且つ前記第1所定値よりも小さければ、前記第2時間を前記中間目標時間に優先的に修正して前記第2タイマによる計測を継続する、請求項1に記載の安全PLC。
When the second time does not exceed the second predetermined period and the synchronization signal is received from the first microcomputer, the second microcomputer determines that the absolute value of the difference between the intermediate target time and the second time is If it is smaller than the first predetermined value, the intermediate target time and the second time can be regarded as equal, and if the absolute value of the difference is larger than the first predetermined value, the intermediate target time and the second time cannot be considered equal, and
The second microcomputer, when the second period does not exceed the second predetermined period and receives the synchronization signal from the first microcomputer, provides a second microcomputer in which the absolute value of the difference is smaller than the first predetermined value. If it is smaller than the predetermined value, the measurement by the second timer is continued without resetting the second timer to zero, and if the absolute value of the difference is larger than the second predetermined value and smaller than the first predetermined value 2. The safety PLC according to claim 1, wherein said second time is preferentially corrected to said intermediate target time and measurement by said second timer is continued.
前記第2マイコンは、前記第1マイコンによる前記同期信号の送信タイミングから前記第2マイコンによる前記同期信号の受信タイミングまでの遅れ時間を予め取得し、前記第2タイマをゼロリセットしてから前記第2タイマにより計測された時間に前記遅れ時間を足した時間を前記第2時間とする、請求項1又は2に記載の安全PLC。 The second microcomputer obtains in advance a delay time from the transmission timing of the synchronization signal by the first microcomputer to the reception timing of the synchronization signal by the second microcomputer, and after resetting the second timer to zero, 3. The safety PLC according to claim 1, wherein said second time is a time obtained by adding said delay time to the time measured by two timers.
JP2021187717A 2021-11-18 2021-11-18 Safety PLC Pending JP2023074675A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021187717A JP2023074675A (en) 2021-11-18 2021-11-18 Safety PLC

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021187717A JP2023074675A (en) 2021-11-18 2021-11-18 Safety PLC

Publications (1)

Publication Number Publication Date
JP2023074675A true JP2023074675A (en) 2023-05-30

Family

ID=86541313

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021187717A Pending JP2023074675A (en) 2021-11-18 2021-11-18 Safety PLC

Country Status (1)

Country Link
JP (1) JP2023074675A (en)

Similar Documents

Publication Publication Date Title
EP3026515B1 (en) Programmable controller system
WO2021035867A1 (en) Redundancy control method for main and standby controllers
JP2011257889A (en) Safety control system
US11307553B2 (en) Control device and control method
JP2011199420A (en) Ring-shape synchronous network system
CA2530149C (en) Starting control method, duplex platform system, and information processor
JP2023074675A (en) Safety PLC
US8060769B2 (en) Duplexed field controller
JP2003296133A (en) Controller
JP4616054B2 (en) Measuring system
US11137794B2 (en) Systems and methods for synchronization of multiple processors
JP2013033374A (en) Distributed monitoring control system
TW202137728A (en) Communication device, communication system, communication method and program
JP6722055B2 (en) Process synchronization control system and process synchronization control method
JP2018106513A (en) Detection device
JP6377659B2 (en) Semiconductor device and control method thereof
JP6357806B2 (en) Controller redundancy system, its controller
JP2014157386A (en) Data processing system
JPH08305664A (en) Method and device for cpu monitoring
JPH08305611A (en) Cpu monitoring method and device
JP2011234212A (en) Task control device
JP2020067685A (en) Computer system
JPH07141307A (en) Synchronizing circuit of multiprocessor system
JP4290067B2 (en) Data synchronization method and program for serial communication system
EP3814868A1 (en) Precision timing between systems