Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6801598B2 - Open / close detection device and machine tools - Google Patents
[go: Go Back, main page]

JP6801598B2 - Open / close detection device and machine tools - Google Patents

Open / close detection device and machine tools Download PDF

Info

Publication number
JP6801598B2
JP6801598B2 JP2017144611A JP2017144611A JP6801598B2 JP 6801598 B2 JP6801598 B2 JP 6801598B2 JP 2017144611 A JP2017144611 A JP 2017144611A JP 2017144611 A JP2017144611 A JP 2017144611A JP 6801598 B2 JP6801598 B2 JP 6801598B2
Authority
JP
Japan
Prior art keywords
input
switch
code
open
identification code
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.)
Active
Application number
JP2017144611A
Other languages
Japanese (ja)
Other versions
JP2019029095A (en
Inventor
康吉 磯田
康吉 磯田
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2017144611A priority Critical patent/JP6801598B2/en
Priority to CN201810836015.XA priority patent/CN109308034B/en
Publication of JP2019029095A publication Critical patent/JP2019029095A/en
Application granted granted Critical
Publication of JP6801598B2 publication Critical patent/JP6801598B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Program-control systems
    • G05B19/02Program-control systems electric
    • G05B19/04Program control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Program control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/34Director, elements to supervisory
    • G05B2219/34222Computer sends displacement and selected device to output register

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Keying Circuit Devices (AREA)
  • Machine Tool Sensing Apparatuses (AREA)
  • Electronic Switches (AREA)

Description

本発明は、スイッチの開閉を検出する開閉検出装置及び工作機械に関する。 The present invention relates to an open / close detection device and a machine tool for detecting the open / close of a switch.

従来、開閉検出装置はスイッチを介して接続した出力端子及び入力端子を備える。開閉検出装置は、スイッチのチャタリングによる影響を抑制する為の構成を備える。例えば、予めスイッチのオン又はオフを示す所定回数を設定し、前記所定回数オン又はオフを示す信号を入力した場合、開閉検出装置はスイッチの開又は閉を検出する。スイッチの劣化によってチャタリングの時間が長くなることを考慮し、開閉検出装置は所定時間経過後、前記所定回数を増加する(特許文献1参照)。 Conventionally, an open / close detection device includes an output terminal and an input terminal connected via a switch. The open / close detection device has a configuration for suppressing the influence of chattering of the switch. For example, when a predetermined number of times indicating on or off of the switch is set in advance and a signal indicating the on or off of the predetermined number of times is input, the open / close detection device detects the opening or closing of the switch. Considering that the chattering time becomes longer due to the deterioration of the switch, the open / close detection device increases the predetermined number of times after the lapse of a predetermined time (see Patent Document 1).

特開2012−124006号公報Japanese Unexamined Patent Publication No. 2012-124006

しかし前記開閉検出装置は所定回数が増加するので、スイッチの開又は閉を検出するまでに長時間を要する。 However, since the open / close detection device increases a predetermined number of times, it takes a long time to detect the opening or closing of the switch.

またチャタリングによる影響を抑制する為に、開閉検出装置は抵抗及びコンデンサを有するローパスフィルタを使用することがある。ローパスフィルタを使用する場合、出力端子から出力した信号から高周波の波形が低減し、開閉検出装置は高周波のパルスを認識できない。高周波のパルスを認識する為に、パルス波形の波長を長くして低周波にした場合、スイッチの開又は閉を検出するまでに長時間を要する。 Further, in order to suppress the influence of chattering, the open / close detection device may use a low-pass filter having a resistor and a capacitor. When a low-pass filter is used, the high-frequency waveform is reduced from the signal output from the output terminal, and the open / close detection device cannot recognize the high-frequency pulse. When the wavelength of the pulse waveform is lengthened to a low frequency in order to recognize a high-frequency pulse, it takes a long time to detect the opening or closing of the switch.

本発明は斯かる事情に鑑みてなされたものであり、スイッチの開又は閉を短時間で検出可能な開閉検出装置及び工作機械を提供することを目的とする。 The present invention has been made in view of such circumstances, and an object of the present invention is to provide an open / close detection device and a machine tool capable of detecting the opening or closing of a switch in a short time.

本発明に係る開閉検出装置は、信号を出力する出力端子と、該出力端子にスイッチを介して接続した入力端子と、該入力端子からの入力信号に基づき、スイッチの開閉を検出する検出部とを備える開閉検出装置であって、前記スイッチに対応した識別符号を記憶した記憶部を備え、前記出力端子は前記識別符号を示す信号を出力し、前記検出部は、前記入力信号が示す入力符号が前記識別符号と一致する場合、前記スイッチの閉を検出し、前記入力信号が示す入力符号が前記識別符号と不一致である場合、前記スイッチの開を検出する。 The open / close detection device according to the present invention includes an output terminal that outputs a signal, an input terminal connected to the output terminal via a switch, and a detection unit that detects open / close of the switch based on an input signal from the input terminal. An opening / closing detection device comprising a storage unit that stores an identification code corresponding to the switch, the output terminal outputs a signal indicating the identification code, and the detection unit outputs an input code indicated by the input signal. When matches the identification code, the closing of the switch is detected, and when the input code indicated by the input signal does not match the identification code, the opening of the switch is detected.

本発明においては、スイッチに対応した識別符号と入力符号の一致又は不一致に基づき、検出部はスイッチの開閉を検出する。チャタリングが発生している場合、識別符号と入力符号は不一致であり、検出部はスイッチの開を検出する。チャタリングが収束した場合、識別符号と入力符号は一致し、検出部は直ちにスイッチの閉を検出する。 In the present invention, the detection unit detects the opening / closing of the switch based on the match or mismatch between the identification code corresponding to the switch and the input code. When chattering has occurred, the identification code and the input code do not match, and the detection unit detects the opening of the switch. When the chattering converges, the identification code and the input code match, and the detection unit immediately detects that the switch is closed.

本発明に係る開閉検出装置は、前記出力端子及び入力端子を夫々複数備え、複数の前記出力端子及び入力端子は複数の前記スイッチを介して夫々接続してあり、各スイッチに固有の複数の前記識別符号を前記記憶部は記憶しており、前記検出部は前記複数の識別符号夫々と複数の前記入力符号夫々との比較を並行に実行する。 The open / close detection device according to the present invention is provided with a plurality of output terminals and input terminals, respectively, and the plurality of output terminals and input terminals are connected to each other via the plurality of switches, and the plurality of said devices unique to each switch are connected. The storage unit stores the identification code, and the detection unit executes comparison between the plurality of identification codes and the plurality of input codes in parallel.

本発明においては、複数の出力端子及び入力端子が複数のスイッチに夫々接続してある。検出部は、各スイッチに固有の複数の識別符号夫々と各入力端子からの複数の入力符号それぞれとの比較を並行に実行する。故に、複数の識別符号と各入力端子からの複数の入力符号を順に比較する場合に比べて、検出部は短時間でスイッチの開閉を検出できる。 In the present invention, a plurality of output terminals and input terminals are connected to the plurality of switches, respectively. The detection unit executes a comparison between each of the plurality of identification codes unique to each switch and the plurality of input codes from each input terminal in parallel. Therefore, the detection unit can detect the opening / closing of the switch in a short time as compared with the case where a plurality of identification codes and a plurality of input codes from each input terminal are sequentially compared.

本発明に係る開閉検出装置は、前記識別符号は二進数によって構成してあり、複数ビットを有し、前記入力符号を格納する入力レジスタを備え、前記検出部は、前記識別符号と前記入力レジスタに格納した入力符号を比較して、前記スイッチの開閉を検出する。 The open / close detection device according to the present invention includes an input register in which the identification code is composed of a binary number, has a plurality of bits, and stores the input code, and the detection unit includes the identification code and the input register. The opening / closing of the switch is detected by comparing the input codes stored in.

本発明においては、二進数の識別符号と入力符号を比較するので、検出部は識別符号と入力符号一致又は不一致を短時間で判定できる。 In the present invention, since the binary identification code and the input code are compared, the detection unit can determine the identification code and the input code match or mismatch in a short time.

本発明に係る開閉検出装置は、複数ビットを有する第二入力レジスタを備え、前記スイッチが閉じている場合、前記識別符号における1及び0のいずれの符号も格納可能な第一サンプリング周期で前記入力レジスタに前記入力符号を格納し、前記スイッチが閉じている場合、前記識別符号における1又0のいずれか一方を格納可能な第二サンプリング周期で前記第二入力レジスタに前記入力符号を格納する。 The open / close detection device according to the present invention includes a second input register having a plurality of bits, and when the switch is closed, the input has a first sampling cycle capable of storing any of 1 and 0 in the identification code. The input code is stored in the register, and when the switch is closed, the input code is stored in the second input register at a second sampling cycle capable of storing either 1 or 0 in the identification code.

本発明においては、識別符号全体のビット数よりも少ない連続した所定ビットにて、第二入力レジスタに格納した入力符号と予め定めたスイッチの開又は閉を示す符号との一致又は不一致を判定する。そのため、第一サンプリング周期で入力レジスタに格納した入力符号と識別符号の一致又は不一致を判定する場合に比べて、検出部は所定の信頼性をもってスイッチの開閉を短時間で検出できる。 In the present invention, it is determined that the input code stored in the second input register and the code indicating the opening or closing of the predetermined switch match or do not match with a continuous predetermined bit smaller than the total number of bits of the identification code. .. Therefore, the detection unit can detect the opening and closing of the switch in a short time with predetermined reliability as compared with the case of determining the match or mismatch between the input code and the identification code stored in the input register in the first sampling cycle.

本発明に係る工作機械は、スイッチと、該スイッチの開閉を検出する上述の開閉検出装置とを備える。 The machine tool according to the present invention includes a switch and the above-mentioned open / close detection device for detecting the open / close of the switch.

本発明においては、スイッチに対応した識別符号と入力符号の一致又は不一致に基づき、検出部はスイッチの開閉を検出する。チャタリングが発生している場合、識別符号と入力符号は不一致であり、検出部はスイッチの開を検出する。チャタリングが収束した場合、識別符号と入力符号は一致し、検出部は直ちにスイッチの閉を検出する。 In the present invention, the detection unit detects the opening / closing of the switch based on the match or mismatch between the identification code corresponding to the switch and the input code. When chattering has occurred, the identification code and the input code do not match, and the detection unit detects the opening of the switch. When the chattering converges, the identification code and the input code match, and the detection unit immediately detects that the switch is closed.

本発明に係る開閉検出装置及び工作機械にあっては、スイッチに対応した識別符号と入力符号の一致又は不一致に基づき、検出部はスイッチの開閉を検出する。チャタリングが発生している場合、識別符号と入力符号は不一致であり、検出部はスイッチの開を検出する。チャタリングが収束した場合、識別符号と入力符号は一致し、検出部は直ちにスイッチの閉を検出する。開閉検出装置はチャタリングの収束後直ちにスイッチの閉を検出する。また識別符号の長さは一定であり、識別符号と入力符号の一致又は不一致の判定に要する時間は長くならない。また開閉検出装置はローパスフィルタを使用する必要もない。故に開閉検出装置はスイッチの開又は閉を短時間で検出できる。 In the open / close detection device and machine tool according to the present invention, the detection unit detects the open / close of the switch based on the match or mismatch between the identification code and the input code corresponding to the switch. When chattering has occurred, the identification code and the input code do not match, and the detection unit detects the opening of the switch. When the chattering converges, the identification code and the input code match, and the detection unit immediately detects that the switch is closed. The open / close detector detects the closing of the switch immediately after the chattering converges. Further, the length of the identification code is constant, and the time required for determining the match or mismatch between the identification code and the input code is not long. Further, the open / close detection device does not need to use a low-pass filter. Therefore, the open / close detection device can detect the opening or closing of the switch in a short time.

実施の形態1に係る開閉検出装置を略示するブロック図である。It is a block diagram which shows the opening / closing detection device which concerns on Embodiment 1. 出力レジスタからの符号の出力及び入力レジスタへの符号の入力を説明する説明図である。It is explanatory drawing explaining the output of the code from the output register, and the input of the code to the input register. 判定周期、識別符号、スイッチの開閉、入力信号、第一サンプリング周期及び入力符号を示すタイミングチャートである。It is a timing chart which shows the determination cycle, identification code, switch open / close, input signal, the first sampling period and input code. スイッチの開閉を検出する開閉検出処理を説明するフローチャートである。It is a flowchart explaining the open / close detection process which detects the open / close of a switch. 実施の形態2に係る開閉検出装置を略示するブロック図である。It is a block diagram which shows the opening / closing detection device which concerns on Embodiment 2. FIG. 出力レジスタ及び入力レジスタを略示するブロック図である。It is a block diagram which shows the output register and the input register. 第一スイッチを誤って第二入力端子に接続した開閉検出装置を略示するブロック図である。It is a block diagram which shows the opening / closing detection device which connected the 1st switch to the 2nd input terminal by mistake. 第一スイッチを誤って第二入力端子に接続した開閉検出装置における第一出力端子、第一入力端子、第二出力端子及び第二入力端子の信号波形の一例を示す図である。It is a figure which shows an example of the signal waveform of the 1st output terminal, the 1st input terminal, the 2nd output terminal and the 2nd input terminal in the open / close detection apparatus which connected the 1st switch to the 2nd input terminal by mistake. 実施の形態3に係る開閉検出装置を略示するブロック図である。It is a block diagram which shows the opening / closing detection device which concerns on Embodiment 3. 判定周期、識別符号、スイッチの開閉、入力信号、第一サンプリング周期、第二サンプリング周期、第二入力符号、入力符号、開閉信号を示すタイミングチャートである。It is a timing chart which shows the determination cycle, identification code, switch open / close, input signal, first sampling cycle, second sampling cycle, second input code, input code, open / close signal. スイッチの開閉を検出する開閉検出処理を説明するフローチャートである。It is a flowchart explaining the open / close detection process which detects the open / close of a switch. スイッチの開閉を検出する第二開閉検出処理を説明するフローチャートである。It is a flowchart explaining the 2nd open / close detection process which detects open / close of a switch.

(実施の形態1)
以下本発明を実施の形態1に係る開閉検出装置を示す図面に基づいて説明する。図1は、開閉検出装置を略示するブロック図である。開閉検出装置は基板20と、該基板20に実装したFPGA1(Field Programmable Gate Array)と、基板20及びスイッチ14を接続するコネクタ13とを備える。
(Embodiment 1)
Hereinafter, the present invention will be described with reference to the drawings showing the open / close detection device according to the first embodiment. FIG. 1 is a block diagram illustrating an open / close detection device. The open / close detection device includes a substrate 20, an FPGA 1 (Field Programmable Gate Array) mounted on the substrate 20, and a connector 13 for connecting the substrate 20 and the switch 14.

FPGA1は、出力端子7、入力端子8、出力レジスタ2、入力レジスタ3、記憶部4、タイマ5、検出部6及び送信端子9を備える。出力端子7は、物理的に絶縁した信号変換器10及びFET11(Field Effect Transistor)を介してスイッチ14の一端部に接続している。入力端子8は、物理的に絶縁した信号変換器15及び増幅器16を介してスイッチ14の他端部に接続している。信号変換器10、15は、例えばフォトカプラを有する光アイソレータ、トランス・コイルを有するトランス・アイソレーション又はコンデンサを有する容量性アイソレーションである。信号変換器10、15は高電圧で動作するスイッチ14側領域と低電圧で動作するFPGA1側領域を絶縁する。 The FPGA 1 includes an output terminal 7, an input terminal 8, an output register 2, an input register 3, a storage unit 4, a timer 5, a detection unit 6, and a transmission terminal 9. The output terminal 7 is connected to one end of the switch 14 via a physically isolated signal converter 10 and a FET 11 (Field Effect Transistor). The input terminal 8 is connected to the other end of the switch 14 via a physically isolated signal converter 15 and an amplifier 16. The signal converters 10 and 15 are, for example, an optical isolator having a photocoupler, a transformer isolation having a transformer coil, or a capacitive isolation having a capacitor. The signal converters 10 and 15 insulate the switch 14 side region operating at a high voltage from the FPGA 1 side region operating at a low voltage.

出力端子7はFET11のゲート11aに接続する。FET11のドレイン11bに電源12が接続する。FET11のソース11cはコネクタ13を介してスイッチ14の一端部に接続する。スイッチ14の他端部はコネクタ13及び信号変換器15を介して増幅器16の入力側に接続する。増幅器16の出力側は入力端子8に接続する。 The output terminal 7 is connected to the gate 11a of the FET 11. The power supply 12 is connected to the drain 11b of the FET 11. The source 11c of the FET 11 is connected to one end of the switch 14 via the connector 13. The other end of the switch 14 is connected to the input side of the amplifier 16 via the connector 13 and the signal converter 15. The output side of the amplifier 16 is connected to the input terminal 8.

出力レジスタ2及び入力レジスタ3は8ビットの符号を夫々格納する。出力レジスタ2及び入力レジスタ3は8ビット以外のビット数で符号を格納してもよい。記憶部4は、前記スイッチ14に対応した固有の識別符号を記憶する。タイマ5は、判定周期及びサンプリング周期を測定する。検出部6は、識別符号と入力レジスタ3に格納した入力符号とに基づき、スイッチ14の開閉を検出する。 The output register 2 and the input register 3 each store an 8-bit code. The output register 2 and the input register 3 may store the code in a number of bits other than 8 bits. The storage unit 4 stores a unique identification code corresponding to the switch 14. The timer 5 measures the determination cycle and the sampling cycle. The detection unit 6 detects the opening / closing of the switch 14 based on the identification code and the input code stored in the input register 3.

図2は、出力レジスタ2からの符号の出力及び入力レジスタ3への符号の入力を説明する説明図である。FPGA1は、記憶部4に記憶した識別符号を出力レジスタ2に設定する。出力レジスタ2は出力端子7から識別符号を左から順に1ビットずつ出力し、図2の矢印に示す如く、FPGA1は出力レジスタ2を一つずつ左にシフトする。入力レジスタ3は入力端子8から右から順に符号を1ビットずつ順に入力し、図2の矢印に示す如く、FPGA1は入力レジスタ3を一つずつ左にシフトする。 FIG. 2 is an explanatory diagram illustrating the output of the code from the output register 2 and the input of the code to the input register 3. The FPGA 1 sets the identification code stored in the storage unit 4 in the output register 2. The output register 2 outputs the identification code bit by bit from the output terminal 7 in order from the left, and the FPGA 1 shifts the output register 2 to the left one by one as shown by the arrow in FIG. The input register 3 inputs the code bit by bit in order from the input terminal 8 from the right, and the FPGA 1 shifts the input register 3 to the left one by one as shown by the arrow in FIG.

出力レジスタ2から出力した識別符号は信号変換器10を介してFET11のゲート11aに入力し、ソース11cは識別符号を示す信号を出力する。スイッチ14が閉じている場合、識別符号を示す信号は信号変換器15及び増幅器16を介して入力端子8に入力する。入力レジスタ3は入力端子8に入力した信号、即ち入力符号を格納する。スイッチ14が開いている場合、識別符号は入力端子8に入力しない。 The identification code output from the output register 2 is input to the gate 11a of the FET 11 via the signal converter 10, and the source 11c outputs a signal indicating the identification code. When the switch 14 is closed, the signal indicating the identification code is input to the input terminal 8 via the signal converter 15 and the amplifier 16. The input register 3 stores the signal input to the input terminal 8, that is, the input code. When the switch 14 is open, the identification code is not input to the input terminal 8.

出力レジスタ2又はFET11等とは異なる構成、例えば別回路の電源を出力端子7に誤って接続した場合又は断線が生じている場合、スイッチ14の開閉に拘わらず、識別符号は入力端子8に入力しない。即ち、スイッチ14が開いている場合と同じ状態になる。 If the configuration is different from that of the output register 2 or FET 11, for example, if the power supply of another circuit is erroneously connected to the output terminal 7 or if the wire is broken, the identification code is input to the input terminal 8 regardless of whether the switch 14 is opened or closed. do not do. That is, the state is the same as when the switch 14 is open.

図3は、判定周期、識別符号、スイッチ14の開閉、入力信号、第一サンプリング周期及び入力符号を示すタイミングチャートである。図3において、最上段に示す判定周期の隣合う二つのパルスの間T1〜T3は判定周期を示す。識別符号、即ち出力信号は波形をなし、その上側は1を示し、下側は0を示す。スイッチ14の開閉は、上側が閉を示し、下側が開を示す。スイッチ14の開閉において、チャタリングが発生している部分を破線で示す。入力信号の上側は1を示し、下側は0を示す。t1〜t8は入力信号をサンプリングする時点を示し、隣合う時点間は第一サンプリング周期を示す。第一サンプリング周期は、識別符号における1及び0のいずれの符号も格納可能な周期である。各判定周期T1〜T3はサンプリング時点t1〜t8を含む。入力符号の上側は1を示し、下側は0を示す。 FIG. 3 is a timing chart showing a determination cycle, an identification code, opening / closing of a switch 14, an input signal, a first sampling cycle, and an input code. In FIG. 3, T1 to T3 indicate the determination cycle between two adjacent pulses of the determination cycle shown in the uppermost row. The identification code, that is, the output signal, has a waveform, the upper side of which indicates 1 and the lower side of which indicates 0. When the switch 14 is opened or closed, the upper side indicates closed and the lower side indicates open. A broken line indicates a portion where chattering occurs when the switch 14 is opened and closed. The upper side of the input signal indicates 1, and the lower side indicates 0. t1 to t8 indicate the time points at which the input signal is sampled, and the first sampling period is indicated between the adjacent time points. The first sampling period is a period in which any code 1 or 0 in the identification code can be stored. Each determination cycle T1 to T3 includes sampling time points t1 to t8. The upper side of the input code indicates 1 and the lower side indicates 0.

図4は、スイッチ14の開閉を検出する開閉検出処理を説明するフローチャートである。FPGA1は記憶部4に記憶した8ビットの識別符号、例えば「10101100」を出力レジスタ2に格納し(ステップS1)、入力レジスタ3をクリアする(ステップS2)。FPGA1はタイマ5を参照し、前回の入力信号のサンプリング時点からサンプリング周期が経過するまで待機する(ステップS3:NO)。例えば、前回のサンプリング時点がt1である場合、時点t2までFPGA1は待機し、前回のサンプリング時点がt8である場合、次の判定周期の時点t1までFPGA1は待機する。サンプリング周期が経過した場合(ステップS3:YES)、FPGA1は出力レジスタ2から1ビットの信号を出力し(ステップS4)、入力レジスタ3に1ビットの入力信号を格納する(ステップS5)。 FIG. 4 is a flowchart illustrating an opening / closing detection process for detecting the opening / closing of the switch 14. The FPGA 1 stores an 8-bit identification code stored in the storage unit 4, for example, "10101100" in the output register 2 (step S1), and clears the input register 3 (step S2). The FPGA 1 refers to the timer 5 and waits until the sampling cycle elapses from the sampling time of the previous input signal (step S3: NO). For example, if the previous sampling time point is t1, the FPGA 1 waits until the time point t2, and if the previous sampling time point is t8, the FPGA 1 waits until the time point t1 in the next determination cycle. When the sampling cycle has elapsed (step S3: YES), the FPGA 1 outputs a 1-bit signal from the output register 2 (step S4), and stores the 1-bit input signal in the input register 3 (step S5).

FPGA1は判定周期が経過したか否か判定する(ステップS6)。判定周期が経過してない場合(ステップS6:NO)、FPGA1は出力レジスタ2を1ビット左にシフトし(ステップS7)、入力レジスタ3を1ビット左にシフトして(ステップS8、図2参照)、ステップS3に処理を戻す。 FPGA 1 determines whether or not the determination cycle has elapsed (step S6). When the determination cycle has not elapsed (step S6: NO), the FPGA 1 shifts the output register 2 to the left by 1 bit (step S7) and the input register 3 to the left by 1 bit (see step S8, FIG. 2). ), Return the process to step S3.

判定周期が経過した場合(ステップS6:YES)、検出部6は、入力レジスタ3に格納した入力符号が記憶部4に記憶した識別符号と一致するか否か判定する(ステップS9)。判定周期が経過した場合、各サンプリング時点t1〜t8において、入力レジスタ3は1ビットの入力信号を格納し、8ビットの入力符号を格納している。 When the determination cycle has elapsed (step S6: YES), the detection unit 6 determines whether or not the input code stored in the input register 3 matches the identification code stored in the storage unit 4 (step S9). When the determination cycle has elapsed, at each sampling time point t1 to t8, the input register 3 stores a 1-bit input signal and stores an 8-bit input code.

入力符号が識別符号に一致する場合(ステップS9:YES)、検出部6はスイッチ14の閉を検出し、送信端子9から外部装置にスイッチ14の閉を示す信号を送信し(ステップS10)、ステップS3に処理を戻す。入力符号が識別符号に一致しない場合(ステップS9:NO)、検出部6はスイッチ14の開を検出し、送信端子9から外部装置にスイッチ14の開を示す信号を送信し(ステップS11)、ステップS3に処理を戻す。尚、誤った配線を行った場合、例えば別回路の電源を出力端子7に誤って接続した場合又は断線が生じている場合、識別符号は入力端子8に入力せず、入力符号が識別符号に一致しない(ステップS9:NO)。この場合も、検出部6はスイッチ14の開を検出し、送信端子9から外部装置にスイッチ14の開を示す信号を送信する(ステップS11)。スイッチ14の開を示す信号は、スイッチ14の開とみなす信号を含む。 When the input code matches the identification code (step S9: YES), the detection unit 6 detects the closing of the switch 14 and transmits a signal indicating the closing of the switch 14 from the transmission terminal 9 to the external device (step S10). The process returns to step S3. When the input code does not match the identification code (step S9: NO), the detection unit 6 detects the opening of the switch 14 and transmits a signal indicating the opening of the switch 14 from the transmission terminal 9 to the external device (step S11). The process returns to step S3. If the wiring is erroneous, for example, if the power supply of another circuit is erroneously connected to the output terminal 7 or if the wire is broken, the identification code is not input to the input terminal 8 and the input code becomes the identification code. Does not match (step S9: NO). Also in this case, the detection unit 6 detects the opening of the switch 14 and transmits a signal indicating the opening of the switch 14 from the transmission terminal 9 to the external device (step S11). The signal indicating the opening of the switch 14 includes a signal considered to be the opening of the switch 14.

判定周期T1において、スイッチ14は開いている。判定周期T1の各サンプリング時点t1〜t8において、入力信号は0である。入力レジスタ3は8ビットの入力符号「00000000」であり、識別符号「10101100」に一致しない。検出部6はスイッチ14の開を検出する。 In the determination cycle T1, the switch 14 is open. The input signal is 0 at each sampling time point t1 to t8 in the determination cycle T1. The input register 3 has an 8-bit input code “00000000000” and does not match the identification code “10101100”. The detection unit 6 detects the opening of the switch 14.

判定周期T2において、スイッチ14は閉じ、チャタリングが発生している。判定周期T2の各サンプリング時点t1〜t8にて、FPGA1は入力信号をサンプリングし、入力レジスタ3は8ビットの入力符号「00101000」を格納する。入力符号は識別符号「10101100」に一致しない。検出部6はスイッチ14の開を検出する。スイッチ14が閉じ、チャタリングが発生している場合、検出部6はスイッチ14の開を検出する。なお判定周期はチャタリングが発生している時間よりも長い。 In the determination cycle T2, the switch 14 is closed and chattering is occurring. At each sampling time point t1 to t8 in the determination cycle T2, the FPGA 1 samples the input signal, and the input register 3 stores the 8-bit input code “00101000”. The input code does not match the identification code "10101100". The detection unit 6 detects the opening of the switch 14. When the switch 14 is closed and chattering is occurring, the detection unit 6 detects the opening of the switch 14. The judgment cycle is longer than the time during which chattering occurs.

判定周期T3において、スイッチ14は閉じ、チャタリングは発生していない。判定周期T3の各サンプリング時点t1〜t8にて、FPGA1は入力信号をサンプリングし、入力レジスタ3は8ビットの入力符号「10101100」を格納する。入力符号は識別符号に一致し、検出部6はスイッチ14の閉を検出する。 In the determination cycle T3, the switch 14 is closed and chattering has not occurred. At each sampling time point t1 to t8 in the determination cycle T3, the FPGA 1 samples the input signal, and the input register 3 stores the 8-bit input code “10101100”. The input code matches the identification code, and the detection unit 6 detects that the switch 14 is closed.

実施の形態1に係る開閉検出装置にあっては、スイッチ14に対応した識別符号と入力符号の一致又は不一致に基づき、検出部6はスイッチ14の開閉を検出する。チャタリングが発生している場合、識別符号と入力符号は不一致であり、検出部6はスイッチ14の開を検出する。チャタリングが収束した場合、識別符号と入力符号は一致し、検出部6は直ちにスイッチ14の閉を検出する。開閉検出装置はチャタリングの収束後直ちにスイッチ14の閉を検出する。また識別符号の長さは一定であり、識別符号と入力符号の一致又は不一致の判定に要する時間は長くならない。また開閉検出装置はローパスフィルタを使用する必要もない。故に開閉検出装置はスイッチ14の開又は閉を短時間で検出できる。また誤配線又は断線が生じている場合も、スイッチ14は開いているとみなすので、安全性を高めることができる。 In the open / close detection device according to the first embodiment, the detection unit 6 detects the open / close of the switch 14 based on the match or mismatch between the identification code and the input code corresponding to the switch 14. When chattering has occurred, the identification code and the input code do not match, and the detection unit 6 detects the opening of the switch 14. When the chattering converges, the identification code and the input code match, and the detection unit 6 immediately detects the closing of the switch 14. The open / close detection device detects the closing of the switch 14 immediately after the chattering converges. Further, the length of the identification code is constant, and the time required for determining the match or mismatch between the identification code and the input code is not long. Further, the open / close detection device does not need to use a low-pass filter. Therefore, the open / close detection device can detect the opening or closing of the switch 14 in a short time. Further, even if the wiring or disconnection occurs, the switch 14 is considered to be open, so that the safety can be improved.

また二進数の識別符号と入力符号を比較するので、検出部6は識別符号と入力符号一致又は不一致を短時間で判定できる。またローパスフィルタを使用する必要がないので、ローパスフィルタの時定数を検討する必要がない。また単に出力端子7からパルス信号を出力し、出力したパルス信号を入力端子8に入力して、スイッチ14の開閉を検出する場合よりも、識別符号を使用するので、判定の信頼性が高い。 Further, since the binary identification code and the input code are compared, the detection unit 6 can determine the identification code and the input code match or mismatch in a short time. Moreover, since it is not necessary to use a low-pass filter, it is not necessary to consider the time constant of the low-pass filter. Further, since the identification code is used as compared with the case where the pulse signal is simply output from the output terminal 7 and the output pulse signal is input to the input terminal 8 to detect the opening / closing of the switch 14, the determination is highly reliable.

(実施の形態2)
以下本発明を実施の形態2に係る開閉検出装置を示す図面に基づいて説明する。図5は、開閉検出装置を略示するブロック図である。図5に示す如く、FPGA1は第一出力端子7(1)〜第n出力端子7(n)及び第一入力端子8(1)〜第n入力端子8(n)を備える。第一出力端子7(1)〜第n出力端子7(n)及び第一入力端子8(1)〜第n入力端子8(n)は第一スイッチ14(1)〜第nスイッチ14(n)に夫々接続する。即ち、第一出力端子7(1)及び第一入力端子8(1)は第一スイッチ14(1)に接続する。同様に、第n出力端子7(n)及び第n入力端子8(n)は第nスイッチ14(n)に接続する。図5において、信号変換器10、15、FET11、電源12、増幅器16の記載を省略する。
(Embodiment 2)
Hereinafter, the present invention will be described with reference to the drawings showing the open / close detection device according to the second embodiment. FIG. 5 is a block diagram illustrating an open / close detection device. As shown in FIG. 5, the FPGA 1 includes first output terminals 7 (1) to nth output terminals 7 (n) and first input terminals 8 (1) to nth input terminals 8 (n). The first output terminal 7 (1) to the nth output terminal 7 (n) and the first input terminal 8 (1) to the nth input terminal 8 (n) are the first switch 14 (1) to the nth switch 14 (n). ) Are connected to each. That is, the first output terminal 7 (1) and the first input terminal 8 (1) are connected to the first switch 14 (1). Similarly, the nth output terminal 7 (n) and the nth input terminal 8 (n) are connected to the nth switch 14 (n). In FIG. 5, the description of the signal converters 10, 15, FET 11, power supply 12, and amplifier 16 is omitted.

記憶部4は、第一スイッチ14(1)〜第nスイッチ14(n)夫々に固有のn個の識別符号を記憶する。識別符号が8ビットで構成してある場合、記憶部4は最大256個の固有の識別符号を記憶できる。 The storage unit 4 stores n identification codes unique to each of the first switch 14 (1) to the nth switch 14 (n). When the identification code is composed of 8 bits, the storage unit 4 can store up to 256 unique identification codes.

図6は、出力レジスタ2及び入力レジスタ3を略示するブロック図である。図6に示す如く、出力レジスタ2は、第一スイッチ14(1)〜第nスイッチ14(n)に対応した第一出力レジスタ部2(1)〜第n出力レジスタ部2(n)を備え、入力レジスタ3は、第一スイッチ14(1)〜第nスイッチ14(n)に対応した第一入力レジスタ部3(1)〜第n入力レジスタ部3(n)を備える。FPGA1は、第一スイッチ14(1)〜第nスイッチ14(n)夫々について、上述した開閉検出処理を並行に実行する。即ち、検出部6は第一入力レジスタ部3(1)〜第n入力レジスタ部3(n)夫々に格納した入力符号と、n個の識別符号夫々との比較を並行に実行する。 FIG. 6 is a block diagram illustrating the output register 2 and the input register 3. As shown in FIG. 6, the output register 2 includes a first output register unit 2 (1) to an nth output register unit 2 (n) corresponding to the first switch 14 (1) to the nth switch 14 (n). The input register 3 includes a first input register unit 3 (1) to an nth input register unit 3 (n) corresponding to the first switch 14 (1) to the nth switch 14 (n). The FPGA 1 executes the above-mentioned open / close detection process in parallel for each of the first switch 14 (1) to the nth switch 14 (n). That is, the detection unit 6 executes the comparison between the input codes stored in the first input register units 3 (1) to the nth input register units 3 (n) and the n identification codes in parallel.

単に第一出力端子7(1)〜第n出力端子7(n)から順にパルス信号を出力し、出力した各パルス信号を第一入力端子8(1)〜第n入力端子8(n)に順に入力して、第一スイッチ14(1)〜第nスイッチ14(n)全ての開閉を検出する場合、パルス信号の出力時点と次のパルス信号の出力時点の間に待ち時間が発生する。待ち時間は累積するので、開閉検出処理が終了するまでに長時間を要する。一方、実施の形態2の検出部6は第一入力レジスタ部3(1)〜第n入力レジスタ部3(n)夫々に格納した入力符号と、n個の識別符号との比較を並行に実行するので、各スイッチについて順に開閉を検出する場合に比べて、短時間で第一スイッチ14(1)〜第nスイッチ14(n)の開閉を検出できる。 The pulse signals are simply output from the first output terminal 7 (1) to the nth output terminal 7 (n), and each output pulse signal is sent to the first input terminal 8 (1) to the nth input terminal 8 (n). When inputting in order and detecting the opening / closing of all the first switch 14 (1) to the nth switch 14 (n), a waiting time occurs between the output time of the pulse signal and the output time of the next pulse signal. Since the waiting time is cumulative, it takes a long time to complete the open / close detection process. On the other hand, the detection unit 6 of the second embodiment compares the input codes stored in the first input register units 3 (1) to the nth input register units 3 (n) with the n identification codes in parallel. Therefore, the opening / closing of the first switch 14 (1) to the nth switch 14 (n) can be detected in a shorter time than in the case of detecting the opening / closing of each switch in order.

図7は、第一スイッチ14(1)を誤って第二入力端子8(2)に接続した開閉検出装置を略示するブロック図、図8は、第一スイッチ14(1)を誤って第二入力端子8(2)に接続した開閉検出装置における第一出力端子7(1)、第一入力端子8(1)、第二出力端子7(2)及び第二入力端子8(2)の信号波形の一例を示す図である。 FIG. 7 is a block diagram illustrating an open / close detection device in which the first switch 14 (1) is mistakenly connected to the second input terminal 8 (2), and FIG. 8 is a block diagram in which the first switch 14 (1) is mistakenly connected to the second input terminal 8 (2). Of the first output terminal 7 (1), the first input terminal 8 (1), the second output terminal 7 (2), and the second input terminal 8 (2) in the open / close detection device connected to the two input terminals 8 (2). It is a figure which shows an example of a signal waveform.

図7に示す如く、第一スイッチ14(1)を誤って第二入力端子8(2)に接続した場合、図8に示す如く、第一出力端子7(1)の出力信号は第一入力端子8(1)に入力せず、第二入力端子8(2)に入力する。故に、第一入力端子8(1)に入力した入力符号は、第一スイッチ14(1)に対応した識別符号、換言すれば第一出力端子7(1)の出力信号に一致しない。第二入力端子8(2)に入力した入力符号は、第二スイッチ14(2)に対応した識別符号、換言すれば第二出力端子7(2)の出力信号に一致しない。入力符号が一致しない各入力信号を比較することによって、ユーザは誤って接続した端子を特定することができる。 As shown in FIG. 7, when the first switch 14 (1) is mistakenly connected to the second input terminal 8 (2), the output signal of the first output terminal 7 (1) is the first input as shown in FIG. Do not input to terminal 8 (1), but input to second input terminal 8 (2). Therefore, the input code input to the first input terminal 8 (1) does not match the identification code corresponding to the first switch 14 (1), in other words, the output signal of the first output terminal 7 (1). The input code input to the second input terminal 8 (2) does not match the identification code corresponding to the second switch 14 (2), in other words, the output signal of the second output terminal 7 (2). By comparing each input signal whose input codes do not match, the user can identify the terminal connected incorrectly.

実施の形態2に係る開閉検出装置の構成の内、実施の形態1と同様な構成については同じ符号を付し、その詳細な説明を省略する。 Of the configurations of the open / close detection device according to the second embodiment, the same configurations as those of the first embodiment are designated by the same reference numerals, and detailed description thereof will be omitted.

(実施の形態3)
以下本発明を実施の形態3に係る開閉検出装置を示す図面に基づいて説明する。図9は、開閉検出装置を略示するブロック図である。開閉検出装置は、第二入力レジスタ30と、第二送信端子19とを備える。FPGA1は、識別符号における1及び0のいずれの符号も格納可能な第一サンプリング周期で入力レジスタ3に入力符号を格納する。FPGA1は、識別符号における1又0のいずれか一方を格納可能な第二サンプリング周期で第二入力レジスタ30に入力符号を格納する。以下、第二入力レジスタ30に格納した入力符号を第二入力符号と称する。
(Embodiment 3)
Hereinafter, the present invention will be described with reference to the drawings showing the open / close detection device according to the third embodiment. FIG. 9 is a block diagram illustrating an open / close detection device. The open / close detection device includes a second input register 30 and a second transmission terminal 19. The FPGA 1 stores the input code in the input register 3 in the first sampling cycle in which both the codes 1 and 0 in the identification code can be stored. The FPGA 1 stores the input code in the second input register 30 in the second sampling cycle capable of storing either 1 or 0 in the identification code. Hereinafter, the input code stored in the second input register 30 will be referred to as a second input code.

図10は、判定周期、識別符号、スイッチ14の開閉、入力信号、第一サンプリング周期、第二サンプリング周期、第二入力符号、入力符号、開閉信号を示すタイミングチャートである。図10に示す如く、k1〜k8は入力信号をサンプリングする時点を示し、最上段に示す判定周期の隣合う時点間は第二サンプリング周期を示す。各判定周期T1〜T3はサンプリング時点k1〜k8を含む。第二入力符号の上側は1を示し、下側は0を示す。開閉信号は、第二開閉検出処理によって、第二送信端子19が送信する開信号又は閉信号を示す。 FIG. 10 is a timing chart showing a determination cycle, an identification code, opening / closing of a switch 14, an input signal, a first sampling cycle, a second sampling cycle, a second input code, an input code, and an opening / closing signal. As shown in FIG. 10, k1 to k8 indicate the time points at which the input signal is sampled, and the second sampling period is indicated between the adjacent time points of the determination cycles shown in the uppermost stage. Each determination period T1 to T3 includes sampling time points k1 to k8. The upper side of the second input code indicates 1, and the lower side indicates 0. The open / close signal indicates an open signal or a close signal transmitted by the second transmission terminal 19 by the second open / close detection process.

FPGA1は、サンプリング時点k1〜k8において、入力信号をサンプリングし、第二入力レジスタ30に格納する。図10に示す如く、スイッチ14が閉じている場合、例えば判定周期T3におけるサンプリング時点k1〜k8において、FPGA1は、識別符号の1のみを第二入力レジスタ30に格納することができ、識別符号の0を第二入力レジスタ30に格納することができない。換言すれば、出力端子7は、サンプリング時点k1〜k8において1となるような波形で出力信号、即ち識別符号を出力する。出力信号の波形がサンプリング時点k1〜k8において0となる場合、チャタリングが発生している。 The FPGA 1 samples the input signal at the sampling time points k1 to k8 and stores it in the second input register 30. As shown in FIG. 10, when the switch 14 is closed, for example, at sampling time points k1 to k8 in the determination cycle T3, the FPGA 1 can store only the identification code 1 in the second input register 30, and the identification code can be stored in the second input register 30. 0 cannot be stored in the second input register 30. In other words, the output terminal 7 outputs an output signal, that is, an identification code, with a waveform such that the waveform becomes 1 at the sampling time points k1 to k8. When the waveform of the output signal becomes 0 at the sampling time points k1 to k8, chattering has occurred.

図11は、スイッチ14の開閉を検出する開閉検出処理を説明するフローチャートである。FPGA1は記憶部4に記憶した8ビットの識別符号、例えば「10101100」を出力レジスタ2に格納し(ステップS21)、入力レジスタ3をクリアする(ステップS22)。FPGA1はタイマ5を参照し、前回の入力信号のサンプリング時点からサンプリング周期が経過するまで待機する(ステップS23:NO)。サンプリング周期が経過した場合(ステップS23:YES)、FPGA1は出力レジスタ2から1ビットの信号を出力し(ステップS24)、入力レジスタ3に1ビットの入力信号を格納する(ステップS25)。 FIG. 11 is a flowchart illustrating an opening / closing detection process for detecting the opening / closing of the switch 14. The FPGA 1 stores an 8-bit identification code stored in the storage unit 4, for example, "10101100" in the output register 2 (step S21), and clears the input register 3 (step S22). The FPGA 1 refers to the timer 5 and waits until the sampling cycle elapses from the sampling time of the previous input signal (step S23: NO). When the sampling cycle has elapsed (step S23: YES), the FPGA 1 outputs a 1-bit signal from the output register 2 (step S24), and stores the 1-bit input signal in the input register 3 (step S25).

FPGA1はタイマ5を参照し、前回の入力信号の第二サンプリング時点から第二サンプリング周期が経過するまで待機する(ステップS26:NO)。第二サンプリング周期が経過した場合(ステップS26:YES)、FPGA1は第二入力レジスタ30に1ビットの入力信号を格納する(ステップS27)。なお第二入力レジスタ30は入力レジスタ3と同様に8ビットの符号を格納し、1ビットの入力信号、即ち符号を格納する都度、左にシフトする(図2参照)。第二入力レジスタ30は8ビット以外のビット数で符号を格納してもよい。 The FPGA 1 refers to the timer 5 and waits until the second sampling cycle elapses from the second sampling time of the previous input signal (step S26: NO). When the second sampling cycle has elapsed (step S26: YES), the FPGA 1 stores a 1-bit input signal in the second input register 30 (step S27). The second input register 30 stores an 8-bit code like the input register 3, and shifts to the left each time a 1-bit input signal, that is, a code is stored (see FIG. 2). The second input register 30 may store the code in a number of bits other than 8 bits.

FPGA1は判定周期が経過したか否か判定する(ステップS28)。判定周期が経過してない場合(ステップS28:NO)、FPGA1は出力レジスタ2を1ビット左にシフトし(ステップS29)、入力レジスタ3を1ビット左にシフトして(ステップS30、図2参照)、ステップS23に処理を戻す。 FPGA 1 determines whether or not the determination cycle has elapsed (step S28). When the determination cycle has not elapsed (step S28: NO), the FPGA 1 shifts the output register 2 to the left by 1 bit (step S29) and the input register 3 to the left by 1 bit (step S30, see FIG. 2). ), The process is returned to step S23.

判定周期が経過した場合(ステップS28:YES)、検出部6は、入力レジスタ3に格納した入力符号が記憶部4に記憶した識別符号と一致するか否か判定する(ステップS31)。判定周期が経過した場合、各サンプリング時点t1〜t8において、入力レジスタ3は1ビットの入力信号を格納し、8ビットの入力符号を格納している。 When the determination cycle has elapsed (step S28: YES), the detection unit 6 determines whether or not the input code stored in the input register 3 matches the identification code stored in the storage unit 4 (step S31). When the determination cycle has elapsed, at each sampling time point t1 to t8, the input register 3 stores a 1-bit input signal and stores an 8-bit input code.

入力符号が識別符号に一致する場合(ステップS31:YES)、検出部6はスイッチ14の閉を検出し、送信端子9から外部装置にスイッチ14の閉を示す信号を送信し(ステップS32)、ステップS23に処理を戻す。入力符号が識別符号に一致しない場合(ステップS31:NO)、検出部6はスイッチ14の開を検出し、送信端子9から外部装置にスイッチ14の開を示す信号を送信し(ステップS33)、ステップS23に処理を戻す。 When the input code matches the identification code (step S31: YES), the detection unit 6 detects the closing of the switch 14 and transmits a signal indicating the closing of the switch 14 from the transmission terminal 9 to the external device (step S32). The process returns to step S23. When the input code does not match the identification code (step S31: NO), the detection unit 6 detects the opening of the switch 14 and transmits a signal indicating the opening of the switch 14 from the transmission terminal 9 to the external device (step S33). The process returns to step S23.

図12は、スイッチ14の開閉を検出する第二開閉検出処理を説明するフローチャートである。FPGA1は、開閉検出処理とは別ルーチンで第二開閉検出処理を実行する。FPGA1の検出部6は、第二入力レジスタ30を読み込み(ステップS41)、右側4ビット、即ち下位4ビットが1111であるか否か判定する(ステップS42)。なお前述のステップS27において、FPGA1は第二入力レジスタ30に入力信号を格納している。下位4ビットが1111である場合(ステップS42:YES)、検出部6は第二送信端子19から外部装置にスイッチ14の閉を示す信号を送信し(ステップS43)、ステップS41に処理を戻す。 FIG. 12 is a flowchart illustrating a second open / close detection process for detecting the open / close of the switch 14. The FPGA 1 executes the second open / close detection process in a routine different from the open / close detection process. The detection unit 6 of the FPGA 1 reads the second input register 30 (step S41) and determines whether or not the right 4 bits, that is, the lower 4 bits are 1111 (step S42). In step S27 described above, the FPGA 1 stores the input signal in the second input register 30. When the lower 4 bits are 1111 (step S42: YES), the detection unit 6 transmits a signal indicating that the switch 14 is closed from the second transmission terminal 19 to the external device (step S43), and returns the process to step S41.

下位4ビットが1111でない場合(ステップS42:NO)、検出部6は、下位4ビットが0000であるか否か判定する(ステップS44)。下位4ビットが0000である場合(ステップS44:YES)、検出部6は第二送信端子19から外部装置にスイッチ14の開を示す信号を送信し(ステップS45)、ステップS41に処理を戻す。下位4ビットが0000でない場合(ステップS44:NO)、検出部6はステップS41に処理を戻す。 When the lower 4 bits are not 1111 (step S42: NO), the detection unit 6 determines whether or not the lower 4 bits are 0000 (step S44). When the lower 4 bits are 0000 (step S44: YES), the detection unit 6 transmits a signal indicating the opening of the switch 14 from the second transmission terminal 19 to the external device (step S45), and returns the process to step S41. If the lower 4 bits are not 0000 (step S44: NO), the detection unit 6 returns the process to step S41.

判定周期T1において、スイッチ14は開いている。判定周期T1の各サンプリング時点k1〜k8において、入力信号は全て0である。第二入力レジスタ30の下位4ビットの入力符号は「0000」であり(ステップS44:YES)、検出部6はスイッチ14の開を検出する(ステップS45)。 In the determination cycle T1, the switch 14 is open. At each sampling time point k1 to k8 in the determination cycle T1, all the input signals are 0. The input code of the lower 4 bits of the second input register 30 is "0000" (step S44: YES), and the detection unit 6 detects the opening of the switch 14 (step S45).

判定周期T2において、スイッチ14は閉じ、チャタリングが発生している。判定周期T2の各サンプリング時点k1〜k8にて、FPGA1は入力信号をサンプリングし、第二入力レジスタ30に入力符号を格納する。時点k1〜k4にて、第二入力符号は「0010」であり、0及び1を含む(ステップS42:NO、ステップS44:NO)。時点k5〜k8にて、第二入力符号は「1111」である(ステップS42:YES)。判定周期T2のサンプリング時点k8において、第二入力レジスタ30の下位4ビットに「1111」が格納され、検出部6はスイッチ14の閉を検出する(ステップS43)。 In the determination cycle T2, the switch 14 is closed and chattering is occurring. At each sampling time point k1 to k8 in the determination cycle T2, the FPGA 1 samples the input signal and stores the input code in the second input register 30. At time points k1 to k4, the second input code is "0010" and includes 0 and 1 (step S42: NO, step S44: NO). At time points k5 to k8, the second input code is "1111" (step S42: YES). At the sampling time k8 in the determination cycle T2, “1111” is stored in the lower 4 bits of the second input register 30, and the detection unit 6 detects that the switch 14 is closed (step S43).

スイッチ14が閉じ、チャタリングが発生している間、検出部6はスイッチ14の開閉を検出しない。チャタリングが収束した場合、検出部6はスイッチ14の閉を検出する。判定周期T2の間に、検出部6はスイッチ14の開閉を複数回判断できるので、判定周期の経過後に判断する場合よりも、検出部6はスイッチ14の開閉を早く検出できる。 While the switch 14 is closed and chattering is occurring, the detection unit 6 does not detect the opening / closing of the switch 14. When the chattering converges, the detection unit 6 detects that the switch 14 is closed. Since the detection unit 6 can determine the opening / closing of the switch 14 a plurality of times during the determination cycle T2, the detection unit 6 can detect the opening / closing of the switch 14 earlier than the case where the determination is made after the elapse of the determination cycle.

判定周期T3において、スイッチ14は閉じ、チャタリングは発生していない。判定周期T3の各サンプリング時点k1〜k8にて、FPGA1は入力信号をサンプリングし、第二入力レジスタ30の下位4ビットに入力符号「1111」を格納する(ステップS42:YES)。検出部6はスイッチ14の閉を検出する(ステップS43)。 In the determination cycle T3, the switch 14 is closed and chattering has not occurred. At each sampling time point k1 to k8 in the determination cycle T3, the FPGA 1 samples the input signal and stores the input code "1111" in the lower 4 bits of the second input register 30 (step S42: YES). The detection unit 6 detects that the switch 14 is closed (step S43).

なお第二開閉検出処理において、第二入力レジスタ30の下位4ビットに基づいて、スイッチ14の開閉を検出しているが、下位3ビット以下又は下位5ビット以上に基づいて、スイッチ14の開閉を検出してもよい。 In the second open / close detection process, the open / close of the switch 14 is detected based on the lower 4 bits of the second input register 30, but the open / close of the switch 14 is detected based on the lower 3 bits or less or the lower 5 bits or more. It may be detected.

実施の形態3に係る開閉検出装置にあっては、識別符号全体のビット数よりも少ない連続した所定ビットにて、第二入力レジスタ30に格納した入力符号と予め定めたスイッチ14の開又は閉を示す符号との一致又は不一致を判定する。そのため、第一サンプリング周期で入力レジスタ3に格納した入力符号と識別符号の一致又は不一致を判定する場合に比べて、検出部6は所定の信頼性をもってスイッチ14の開閉を短時間で検出できる。 In the open / close detection device according to the third embodiment, the input code stored in the second input register 30 and the predetermined switch 14 are opened or closed with consecutive predetermined bits smaller than the total number of bits of the identification code. It is determined whether or not the code matches the symbol indicating. Therefore, the detection unit 6 can detect the opening and closing of the switch 14 in a short time with predetermined reliability as compared with the case of determining the match or mismatch between the input code and the identification code stored in the input register 3 in the first sampling cycle.

開閉検出装置は外部機器に設ける。例えばスイッチ14が開の場合、外部機器は停止し、閉の場合、外部機器は動作する。安全の為には、スイッチ14の開の検出よりも、閉の検出が重要である。外部機器が動作するスイッチ14の閉の検出は、第一サンプリング周期で入力レジスタ3に格納した入力符号と識別符号の一致によって、確実に行う。 The open / close detection device is installed in an external device. For example, when the switch 14 is open, the external device stops, and when the switch 14 is closed, the external device operates. For safety, detection of closing is more important than detection of opening of switch 14. The closing of the switch 14 in which the external device operates is reliably detected by matching the input code and the identification code stored in the input register 3 in the first sampling cycle.

一方、外部機器の動作に関係しない場合、例えば制御プログラムにおいてエラーの判定を行う場合、又は警告を出す場合には、スイッチ14の開閉を短時間で検出することが望ましい。この場合、より少ない連続した所定ビットにて、第二サンプリング周期で第二入力レジスタ30に格納した入力符号と予め定めたスイッチ14の開又は閉を示す符号との一致又は不一致を判定する。検出部6は所定の信頼性をもってスイッチ14の開閉を短時間で検出できる。 On the other hand, it is desirable to detect the opening and closing of the switch 14 in a short time when it is not related to the operation of the external device, for example, when determining an error in the control program or when issuing a warning. In this case, with fewer consecutive predetermined bits, it is determined in the second sampling cycle that the input code stored in the second input register 30 matches or does not match the predetermined code indicating the opening or closing of the switch 14. The detection unit 6 can detect the opening and closing of the switch 14 in a short time with predetermined reliability.

実施の形態3に係る開閉検出装置の構成の内、実施の形態1又は2と同様な構成については同じ符号を付し、その詳細な説明を省略する。 Among the configurations of the open / close detection device according to the third embodiment, the same components as those of the first or second embodiment are designated by the same reference numerals, and detailed description thereof will be omitted.

上述した開閉検出装置は、例えば主軸、ワーク保持部、制御装置及び緊急停止スイッチを備える工作機械に設ける。開閉検出装置は緊急停止スイッチの開閉を検出する。緊急停止スイッチが閉じ、第一サンプリング周期で入力レジスタ3に格納した入力符号と識別符号が一致し、開閉検出装置が閉を検出した場合、制御装置は主軸及びワーク保持部を停止する。制御装置は停止実行装置として機能する。開閉検出装置が開を検出した場合、停止実行装置は停止し、閉を検出した場合、停止実行装置は動作する。 The above-mentioned open / close detection device is provided on a machine tool including, for example, a spindle, a work holding unit, a control device, and an emergency stop switch. The open / close detection device detects the open / close of the emergency stop switch. When the emergency stop switch closes, the input code stored in the input register 3 and the identification code match in the first sampling cycle, and the open / close detection device detects closing, the control device stops the spindle and the work holding unit. The control device functions as a stop execution device. When the open / close detection device detects open, the stop execution device stops, and when it detects close, the stop execution device operates.

緊急停止スイッチが閉じ、第二入力レジスタ30に格納した入力符号がスイッチ14の閉を示す符号に一致し、開閉検出装置が閉を検出した場合、制御装置は、例えば制御プログラムにおいてエラーの判定を行うか又は警告を出す。なお開閉検出装置は緊急停止スイッチ以外のスイッチ、例えば工作機械の表示部の画面切替スイッチ、ワーク保持部へのワークの着脱を行う時に開閉する扉に設けたリミットスイッチの開閉を検出してもよい。 When the emergency stop switch is closed, the input code stored in the second input register 30 matches the code indicating the closing of the switch 14, and the open / close detection device detects the closing, the control device determines an error, for example, in the control program. Do or issue a warning. The open / close detection device may detect the open / close of a switch other than the emergency stop switch, for example, a screen changeover switch on the display unit of the machine tool, or a limit switch provided on the door that opens / closes when the work is attached / detached to / from the work holding portion. ..

今回開示した実施の形態は、全ての点で例示であって、制限的なものではないと考えられるべきである。各実施例にて記載されている技術的特徴は互いに組み合わせることができ、本発明の範囲は、特許請求の範囲内での全ての変更及び特許請求の範囲と均等の範囲が含まれることが意図される。 The embodiments disclosed this time should be considered to be exemplary in all respects and not restrictive. The technical features described in each example can be combined with each other and the scope of the invention is intended to include all modifications within the claims and scope equivalent to the claims. Will be done.

1 FPGA
3 入力レジスタ
4 記憶部
6 検出部
7 出力端子
7(1)〜7(n) 第一出力端子〜第n出力端子
8 入力端子
8(1)〜8(n) 第一入力端子〜第n入力端子
14 スイッチ
14(1)〜14(n) 第一スイッチ〜第nスイッチ
30 第二入力レジスタ
1 FPGA
3 Input register 4 Storage unit 6 Detection unit 7 Output terminal 7 (1) to 7 (n) 1st output terminal to nth output terminal 8 Input terminal 8 (1) to 8 (n) 1st input terminal to nth input Terminal 14 Switch 14 (1) -14 (n) First switch to nth switch 30 Second input register

Claims (5)

信号を出力する出力端子と、該出力端子にスイッチを介して接続した入力端子と、該入力端子からの入力信号に基づき、スイッチの開閉を検出する検出部とを備える開閉検出装置であって、
前記スイッチに対応した識別符号を記憶した記憶部を備え、
前記出力端子は前記識別符号を示す信号を出力し、
前記検出部は、前記入力信号が示す入力符号が前記識別符号と一致する場合、前記スイッチの閉を検出し、前記入力信号が示す入力符号が前記識別符号と不一致である場合、前記スイッチの開を検出する
開閉検出装置。
An open / close detection device including an output terminal that outputs a signal, an input terminal connected to the output terminal via a switch, and a detection unit that detects the open / close of the switch based on the input signal from the input terminal.
A storage unit that stores an identification code corresponding to the switch is provided.
The output terminal outputs a signal indicating the identification code, and outputs a signal indicating the identification code.
The detection unit detects the closing of the switch when the input code indicated by the input signal matches the identification code, and opens the switch when the input code indicated by the input signal does not match the identification code. Open / close detection device that detects.
前記出力端子及び入力端子を夫々複数備え、
複数の前記出力端子及び入力端子は複数の前記スイッチを介して夫々接続してあり、
各スイッチに固有の複数の前記識別符号を前記記憶部は記憶しており、
前記検出部は前記複数の識別符号夫々と複数の前記入力符号夫々との比較を並行に実行する
請求項1に記載の開閉検出装置。
A plurality of output terminals and input terminals are provided, respectively.
The plurality of output terminals and input terminals are connected to each other via the plurality of switches.
The storage unit stores a plurality of the identification codes unique to each switch.
The open / close detection device according to claim 1, wherein the detection unit performs comparison between the plurality of identification codes and the plurality of input codes in parallel.
前記識別符号は二進数によって構成してあり、
複数ビットを有し、前記入力符号を格納する入力レジスタを備え、
前記検出部は、前記識別符号と前記入力レジスタに格納した入力符号を比較して、前記スイッチの開閉を検出する
請求項1又は2に記載の開閉検出装置。
The identification code is composed of binary numbers.
It has a plurality of bits and has an input register for storing the input code.
The opening / closing detection device according to claim 1 or 2, wherein the detection unit compares the identification code with the input code stored in the input register to detect the opening / closing of the switch.
複数ビットを有する第二入力レジスタを備え、
前記スイッチが閉じている場合、前記識別符号における1及び0のいずれの符号も格納可能な第一サンプリング周期で前記入力レジスタに前記入力符号を格納し、
前記スイッチが閉じている場合、前記識別符号における1又0のいずれか一方を格納可能な第二サンプリング周期で前記第二入力レジスタに前記入力符号を格納し、
前記識別符号全体のビット数よりも少ない連続した所定ビットにて、前記第二入力レジスタに格納した入力符号と予め定めた前記スイッチの開又は閉を示す符号との一致又は不一致を判定し、前記スイッチの開閉を検出する
請求項3に記載の開閉検出装置。
It has a second input register with multiple bits
When the switch is closed, the input code is stored in the input register in the first sampling cycle in which both the codes 1 and 0 in the identification code can be stored.
When the switch is closed, the input code is stored in the second input register at a second sampling cycle capable of storing either 1 or 0 in the identification code.
With consecutive predetermined bits smaller than the total number of bits of the identification code, it is determined whether or not the input code stored in the second input register matches or does not match the predetermined code indicating the opening or closing of the switch. The open / close detection device according to claim 3, which detects the open / close of a switch.
安全な状態で接点が開となり、その他の状態で接点が閉となるスイッチと、
該スイッチの開閉を検出する請求項1から4のいずれか一つに記載の開閉検出装置と
を備える工作機械。
A switch that opens the contacts in a safe state and closes the contacts in other states,
A machine tool including the open / close detection device according to any one of claims 1 to 4, which detects the open / close of the switch.
JP2017144611A 2017-07-26 2017-07-26 Open / close detection device and machine tools Active JP6801598B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2017144611A JP6801598B2 (en) 2017-07-26 2017-07-26 Open / close detection device and machine tools
CN201810836015.XA CN109308034B (en) 2017-07-26 2018-07-26 Opening/closing detection device and machine tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017144611A JP6801598B2 (en) 2017-07-26 2017-07-26 Open / close detection device and machine tools

Publications (2)

Publication Number Publication Date
JP2019029095A JP2019029095A (en) 2019-02-21
JP6801598B2 true JP6801598B2 (en) 2020-12-16

Family

ID=65225998

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017144611A Active JP6801598B2 (en) 2017-07-26 2017-07-26 Open / close detection device and machine tools

Country Status (2)

Country Link
JP (1) JP6801598B2 (en)
CN (1) CN109308034B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7484538B2 (en) * 2020-07-31 2024-05-16 ブラザー工業株式会社 Condition determination system and machine tool
JP7694357B2 (en) * 2021-11-22 2025-06-18 東京電力ホールディングス株式会社 Circuit breaker status diagnosis device, circuit breaker status diagnosis method, and program

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04132414A (en) * 1990-09-25 1992-05-06 Nec Corp Prevention circuit for unstable setting
JP3682497B2 (en) * 2001-01-31 2005-08-10 村田機械株式会社 Image forming apparatus
JP4728823B2 (en) * 2006-02-06 2011-07-20 株式会社北電子 Input signal processing apparatus, game hall management system, input signal processing method, and input signal processing program
JP2011095949A (en) * 2009-10-29 2011-05-12 Sanyo Electric Co Ltd Input device
JP5627428B2 (en) * 2010-12-08 2014-11-19 矢崎総業株式会社 ON / OFF judgment device for contact switch
JP6557086B2 (en) * 2015-07-31 2019-08-07 ファナック株式会社 Control device with rotary switch

Also Published As

Publication number Publication date
JP2019029095A (en) 2019-02-21
CN109308034A (en) 2019-02-05
CN109308034B (en) 2021-12-28

Similar Documents

Publication Publication Date Title
JP2007164765A (en) IIC bus communication system, slave device, and IIC bus communication control method
US20100100799A1 (en) Fault detection apparatus, fault detection method, and fault detection program
JP6801598B2 (en) Open / close detection device and machine tools
CN110612453A (en) Wire break detection in digital input receivers
USRE50428E1 (en) Input module of industrial control apparatus
CN205027875U (en) Digital circuit failure detector circuit
EP3435100B1 (en) Method for testing an electronic device and an interface circuit therefore
CN115116385B (en) Display system and display control method thereof
JP2009175092A (en) Disconnection detector
TW201626183A (en) Touch panel and method for detecting the same
KR20180108497A (en) Monitoring circuit
KR101447221B1 (en) Chip applied to serial transmission system and associated fail safe method
KR100442625B1 (en) Apparatus and method for controlling the malfunction of hall effect switch used for sensing open or close of the flip or polder of terminal equipment
US20070038403A1 (en) Electronic circuit, system with an electronic circuit and method for testing an electronic circuit
CN109901513A (en) Switching device and numerical control system with dual switching signal generating unit
KR101919139B1 (en) Security control apparatus and method thereof
JP2020145356A (en) Integrated circuit equipment
RU2642397C2 (en) Device for monitoring electrical installation
JP7596867B2 (en) Switch system and switch
KR20120083458A (en) Method for operating an electromechanical converter system and electromechanical converter system
JP2006301041A (en) Switch circuit and image forming apparatus
KR20010088102A (en) Abnormality power source sensing apparatus and method for programmable logic controller
KR200146210Y1 (en) Fire detection circuit
KR20170042242A (en) Nonvolatile memory device
CN110389539A (en) Safety switch

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200218

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20201019

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20201027

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20201109

R150 Certificate of patent or registration of utility model

Ref document number: 6801598

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150