JP2020080463A - Numerical control device with error correction function during communication - Google Patents
Numerical control device with error correction function during communication Download PDFInfo
- Publication number
- JP2020080463A JP2020080463A JP2018212624A JP2018212624A JP2020080463A JP 2020080463 A JP2020080463 A JP 2020080463A JP 2018212624 A JP2018212624 A JP 2018212624A JP 2018212624 A JP2018212624 A JP 2018212624A JP 2020080463 A JP2020080463 A JP 2020080463A
- Authority
- JP
- Japan
- Prior art keywords
- frame
- crc
- data
- unit
- received frame
- 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
Links
Images
Landscapes
- Numerical Control (AREA)
- Detection And Prevention Of Errors In Transmission (AREA)
Abstract
Description
本発明は、制御対象物を制御するためにユニット間で通信によるデータの受け渡しを行う数値制御装置に関する。 The present invention relates to a numerical control device that exchanges data by communication between units in order to control an object to be controlled.
工作機械の数値制御装置では、数値制御装置から離れた位置にモータを駆動する駆動装置やソレノイド等を制御するためのI/O装置が存在するため、指令等のデータを通信する必要がある。 In a numerical control device for a machine tool, an I/O device for controlling a drive device for driving a motor, a solenoid, etc. exists at a position distant from the numerical control device, and therefore it is necessary to communicate data such as commands.
イーサネット(登録商標)に関して規定されたIEEE802.3を利用する場合において、データが格納されたフレームが破壊された場合に誤ったフレームに基づき制御対象物が動作することを防ぐために、フレームが破壊されたことを検出する手段としてバースト誤りを検出しやすいCRC(Cyclic Redundancy Check:巡回冗長検査)が用いられることがある。 When IEEE802.3 defined for Ethernet (registered trademark) is used, if a frame storing data is destroyed, the frame is destroyed in order to prevent the controlled object from operating based on an erroneous frame. A CRC (Cyclic Redundancy Check) that can easily detect a burst error may be used as a means for detecting this.
また、ノイズ等によってフレームが破壊されたことにより正しいフレームを受け取ることができなかった場合の対策として、フレームの再送により正常にフレームを受け取ることができる確率を高めることが行われる場合がある。 Further, as a measure against the case where a correct frame cannot be received due to the frame being destroyed by noise or the like, there is a case where the probability that the frame can be normally received is increased by retransmitting the frame.
ところで、CRCによる誤り検出では、誤り箇所を特定することができず、誤りを訂正することができないため、正しいフレームを受け取るために再送が必要になる。しかし、リアルタイム性が重要になる数値制御装置における通信では、同一フレームの再送を複数回実施すると規定時間内に通信を完了することができないため、機械が停止する。 By the way, in the error detection by CRC, the error location cannot be specified and the error cannot be corrected, so that the retransmission is necessary to receive the correct frame. However, in communication in a numerical control device in which real-time property is important, if the same frame is retransmitted a plurality of times, the communication cannot be completed within a specified time, and the machine stops.
本発明の目的は、数値制御装置における通信において、再送されたフレームも破壊されていた場合に、再送回数を抑制しつつ機械の停止を防ぐことにある。 An object of the present invention is to prevent the machine from stopping while suppressing the number of retransmissions when the retransmitted frame is also destroyed in the communication in the numerical control device.
本発明に係る数値制御装置は、CRCによる誤り検出機能を備えた機械の数値制御装置であって、少なくとも1回分の受信フレームを保存することができる受信バッファと、1回目の受信フレームと再送された2回目の受信フレームとを比較して不一致箇所を検出する比較部と、受信フレームに基づいてCRCを計算する複数のCRC計算部と、前記複数のCRC計算部のそれぞれに送るデータであって受信フレームに含まれるデータを制御するデータ選択部と、前記複数のCRC計算部のそれぞれのCRC計算結果に基づいて、使用するデータを選択する結果選択部と、を有し、2回目の受信フレームの受信時に、1回目の受信フレームと2回目の受信フレームとを組み合わせたパターンのCRCも並行して計算することで誤り訂正する機能を有する。 A numerical control device according to the present invention is a numerical control device for a machine having an error detection function by CRC, and has a reception buffer capable of storing at least one reception frame, a first reception frame and a retransmitted frame. A comparison unit for comparing the received frame of the second time to detect a mismatched portion; a plurality of CRC calculation units for calculating a CRC based on the received frame; and data to be sent to each of the plurality of CRC calculation units. The second reception frame includes a data selection unit that controls data included in the reception frame, and a result selection unit that selects data to be used based on the CRC calculation results of the plurality of CRC calculation units. Has a function of correcting an error by concurrently calculating a CRC of a pattern obtained by combining the first received frame and the second received frame.
本発明によれば、少ない遅延で誤り訂正を行うことが可能となり、機械の停止を防止することが可能となる。 According to the present invention, it becomes possible to perform error correction with a small delay and prevent the machine from stopping.
以下、本発明の実施形態について、図に基づいて説明する。 Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
図1に示すように、制御装置1は、制御部11と、送信部12と、受信部13と、を備える。送信部12は、送信するデータを格納する送信バッファ121と、送信フレームの生成を行う送信制御部122と、フレームに付与するCRCを計算するCRC計算部123と、フレームを送信するフレーム送信部124と、を備える。受信部13は、フレームを受信するフレーム受信部134と、受信フレームのCRCをチェックするCRC計算部133aと、フレームの情報に応じてデータ格納先等を制御する受信制御部132と、受信したデータを格納する受信バッファ131と、を備え、通常の受信処理を行う。また、受信部13は、受信フレーム同士を比較して不一致箇所を検出する比較部135と、不一致箇所と不一致時のフレームを一時的に保存する不一致バッファ136と、誤り訂正用のCRC計算部133b,133cと、不一致回数をカウントし、CRC計算部133b,133cに送るデータを切り替えるデータ選択部137と、CRC計算部133a,133b,133cで計算した結果から使用するデータパターンを選択する結果選択部138と、を更に備える。駆動装置2も制御装置1と同様に、制御部21と、送信部22と、受信部23と、を備える。送信部22の構成は、送信部12の構成と同じである。受信部23の構成は、受信部13の構成と同じである。
As shown in FIG. 1, the control device 1 includes a control unit 11, a
エラーが発生しない正常な通信時は、制御装置1が生成した指令値を駆動装置2へと送信し、駆動装置2は指令値を受け取り、指令に応じて機械を駆動させ、応答を制御装置1へと送信する。具体的には、制御装置1の制御部11は、駆動装置2に対する指令値を生成し、送信バッファ121に指令値を書き込む。その後、制御部11は、送信制御部122に対して送信開始指令を送る。送信開始指令を受け付けた送信制御部122は、送信バッファ121のデータをCRC計算部123に送る。CRC計算部123は、受け取ったデータからCRCを計算し、データにCRC情報を付加したフレームを、フレーム送信部124へと送る。フレーム送信部124は、送られてきたフレームを駆動装置2に送信する。
During normal communication in which no error occurs, the command value generated by the control device 1 is transmitted to the
駆動装置2内のフレーム受信部234は、制御装置1から受信したフレームをCRC計算部233aを介して受信制御部232へと送る。CRC計算部233aは、受信フレームのCRCを計算し、受信フレームのデータが正しいかを判定し、その判定結果を受信制御部232に通知する。受信制御部232は、受信フレームを受信バッファ231に保存し、CRC計算部233aから受信フレームが正常である判定を受けた場合は、制御部21へ受信が完了したことを通知する。制御部21は、受信バッファ231に保存されたフレーム内にある指令情報に基づいて装置を駆動させ、その応答の情報を送信バッファ221に保存し、制御装置1宛に送信するように送信制御部222へと指示する。指示を受けた送信制御部222は送信部12と同様の動作で制御装置1にフレームを送信する。
The
前記通信の流れにおいて、制御装置1から送信されたフレームが破壊された場合は、受信制御部232は、受信フレームを受信バッファ231に保存し、CRC計算部233aから受信フレームが異常であることを通知されたため、送信制御部222に対して再送要求のフレームの送信を指令する。指令を受けた送信制御部222は、再送要求のフレームを生成し、制御装置1に対して送信する。再送要求を受信した制御装置1は、要求に応じて、同一のフレームを駆動装置2に再送する。
In the communication flow, when the frame transmitted from the control device 1 is destroyed, the
再送されたフレームを受信した駆動装置2は、フレームの受信処理時に誤り訂正処理を並行して実行する。この誤り訂正処理に関して図2も参照して説明する。図2(a)は、再送前の受信フレームにおいてA0バイト目からA1バイト目までの区間でデータが破壊されたことを示している。図2(b)は、再送時の受信フレームにおいてB0バイト目からB1バイト目までの区間でデータが破壊されたことを示している。図2(c)と図2(d)は、再送前と再送時の2回の受信フレームを組み合わせて作成されたフレームを示している。本実施形態では、CRCの性質上、CRC長より長いバースト誤りがあり、単一フレームで2箇所以上の誤りがある場合は、信頼性が低下するため、誤り訂正を行わない。そのため、以下では、フレームが破壊された区間がCRC長より短い場合について説明する。
The
フレーム受信部234は、受信したフレームをCRC計算部233aを介して受信制御部232へと渡す。再送時受信フレームを受け取った受信制御部232は、受信バッファ231に保存されていた再送前受信フレームを読み出し、再送前受信フレームと再送時受信フレームを、比較部235とデータ選択部237へと送信し、また、受信バッファ231に再送時受信フレームを保存する。比較部235は、受け取った再送前受信フレームと再送時受信フレームとを比較し、それらのフレーム同士が不一致だった場合は、不一致検出信号をデータ選択部237に出力する。図2の例の場合は、A0バイトからA1バイトまでの区間、及び、B0バイトからB1バイトまでの区間において、再送前受信フレームと再送時受信フレームとの間に不一致が生じているため、これらの区間に関して不一致検出信号が出力される。データ選択部237は、図2(c)に示されているCRC計算をCRC計算部233bに実行させ、図2(d)に示されているCRC計算をCRC計算部233cに実行させるように、データの振り分けを行う。
The
具体的には、データ選択部237は、再送時受信フレームの受信開始時はCRC計算部233bには、再送時受信フレーム(b)を送信し、CRC計算部233cには、再送前受信フレーム(a)を送信する。そして、データ選択部237は、不一致検出信号(A0)を受け取った場合は、そこからCRC長(本実施例ではCLByte)までの間は、前記送信先(CRC計算部233b,233c)に前記データを送信し、A0+CLの位置から受信フレームを入れ替え、CRC計算部233bには再送前受信フレーム(a)を送信し、CRC計算部233cには再送時受信フレーム(b)を送信する。また、その際に、データ選択部237は、データ選択部237内部にあるフレーム内のデータの不一致数を記録するカウンタ(以下、不一致カウンタ)を1増加させ、不一致バッファ236に不一致位置の先頭を示すA0のデータと、CLバイト分のデータであるA0からA0+CL−1のデータを保存する。データ選択部237は、次の不一致検出信号(B0)を受け取った場合も、上記と同様の動作を行う。つまり、データ選択部237は、B0+CLの位置からCRC計算部233bとCRC計算部233cに送るデータを再度入れ替え、前記と同様に不一致カウンタを増加させ、不一致バッファ236に不一致箇所の先頭を示すB0のデータと、CLバイト分のデータであるB0からB0+CL−1のデータを保存する。これ以降は受信完了まで不一致検出信号は現れないため、各CRC計算部(CRC計算部233a,233b,233c)は、自身に振り分けられたデータに基づいてCRCを計算し、そのCRC結果を結果選択部238へと送る。
Specifically, the data selection unit 237 transmits the retransmission reception frame (b) to the CRC calculation unit 233b at the start of reception of the retransmission reception frame, and the
結果選択部238は、3個のCRC計算部(CRC計算部233a,233b,233c)から計算結果を受け取り、有効な結果の判定を行う。再送時受信フレームのCRC計算結果であるCRC計算部233aの結果が正しい場合は、結果選択部238は、受信バッファ231に格納した再送時受信フレームをそのまま使用する。CRC計算部233bのCRC計算結果のみが正しかった場合は、CRC計算部233bが計算した受信フレーム(図2(c)に示されている受信フレーム)が正しいため、結果選択部238は、不一致バッファ236に保存した不一致箇所Bの再送前受信データ(B0からB0+CL−1のデータ)を受信バッファ231に書き込み、誤り訂正を行う。CRC計算部233cのCRC計算結果のみが正しい場合は、結果選択部238は、不一致バッファに保存した不一致箇所Aの再送前受信データ(A0からA0+CL−1のデータ)を受信バッファ231に書き込み、誤り訂正を行う。CRC計算部233bとCRC計算部233cの両方のCRC計算結果が正しい場合は、どちらかが2箇所誤った結果CRC計算結果が一致しているため、結果選択部238は、誤り訂正を行わず、受信制御部232に受信エラーであることを通知し、再び再送要求を行う。同様に、結果選択部238は、全てのCRC計算部の結果が誤りの場合も誤り訂正を行わず、受信制御部232に受信エラーであることを通知し、再び再送要求を行う。
The
誤り訂正を行わないCRC長以上の誤りがある場合、及び、同一のフレームで2カ所以上の誤りが存在する場合は、不一致箇所が3箇所以上となる(CRC長を超えた誤りは2箇所として数える)ため、不一致カウンタが3以上であるならば、受信フレームの信頼性が低いため誤り訂正を無効化する。無効化は、データ選択部237がCRC計算部233bとCRC計算部233cに対し、リセット入力を続け、CRC計算結果を固定値とすることで行う。
If there is an error of CRC length or more without error correction, and if there are two or more errors in the same frame, there will be three or more mismatched points (two errors exceed the CRC length. Therefore, if the mismatch counter is 3 or more, the reliability of the received frame is low and the error correction is invalidated. The invalidation is performed by the data selection unit 237 continuing the reset input to the CRC calculation unit 233b and the
<変形例1>
上記の実施形態では、フレームを正常に受信できなかった場合に再送要求を送ることで再送処理を行う場合について説明したが、再送要求に応じて再送するのではなく、常に同一フレームを複数回送信する等の方法によって、2回以上のフレームを受信してもよい。
<Modification 1>
In the above embodiment, the case where the retransmission process is performed by sending the retransmission request when the frame cannot be received normally has been described, but the same frame is always transmitted a plurality of times instead of being retransmitted in response to the retransmission request. The frame may be received more than once by a method such as.
<変形例2>
上記の実施形態では、制御装置1と駆動装置2が1対1通信で接続されている場合について説明したが、例えばリング接続等の1対1通信以外で接続されたネットワークが用いられてもよい。この場合、受信バッファを通信相手毎に用意することで、フレームと再送フレームとの間に、他の通信相手との通信フレームが割り込んでも誤り訂正を行うことが可能になる。
<
In the above embodiment, the case where the control device 1 and the
上記の制御装置1及び駆動装置2は、一例としてハードウェア資源とソフトウェアとの協働により実現される。具体的には、制御装置1及び駆動装置2は、図示しないCPU等のプロセッサを備えている。当該プロセッサが、図示しない記憶装置に記憶されたプログラムを読み出して実行することにより、制御装置1及び駆動装置2の各部の機能が実現される。上記プログラムは、CDやDVD等の記録媒体を経由して、又は、ネットワーク等の通信経路を経由して、記憶装置に記憶される。または、制御装置1及び駆動装置2の各部は、例えばプロセッサや電子回路等のハードウェア資源により実現されてもよい。その実現においてメモリ等のデバイスが利用されてもよい。別の例として、制御装置1及び駆動装置2の各部は、DSP(Digital Signal Processor)やFPGA(Field Programmable Gate Array)等によって実現されてもよい。
The control device 1 and the
1 制御装置、2 駆動装置、11,21 制御部、12,22 送信部、13,23 受信部、121,221 送信バッファ、122,222 送信制御部、123,133a,133b,133c,223,233a,233b,233c CRC計算部、124,224 フレーム送信部、131,231 受信バッファ、132,232 受信制御部、134,234 フレーム受信部、135,235 比較部、136,236 不一致バッファ、137,237 データ選択部、138,238 結果選択部。 DESCRIPTION OF REFERENCE NUMERALS 1 control device, 2 drive device, 11,21 control unit, 12,22 transmission unit, 13,23 reception unit, 121,221 transmission buffer, 122,222 transmission control unit, 123,133a, 133b, 133c, 223, 233a , 233b, 233c CRC calculation unit, 124, 224 frame transmission unit, 131, 231 reception buffer, 132, 232 reception control unit, 134, 234 frame reception unit, 135, 235 comparison unit, 136, 236 mismatch buffer, 137, 237 Data selection unit, 138, 238 result selection unit.
Claims (1)
少なくとも1回分の受信フレームを保存することができる受信バッファと、
1回目の受信フレームと再送された2回目の受信フレームとを比較して不一致箇所を検出する比較部と、
受信フレームに基づいてCRCを計算する複数のCRC計算部と、
前記複数のCRC計算部のそれぞれに送るデータであって受信フレームに含まれるデータを制御するデータ選択部と、
前記複数のCRC計算部のそれぞれのCRC計算結果に基づいて、使用するデータを選択する結果選択部と、
を有し、
2回目の受信フレームの受信時に、1回目の受信フレームと2回目の受信フレームとを組み合わせたパターンのCRCも並行して計算することで誤り訂正する機能を有する、
数値制御装置。 In the numerical control device of the machine equipped with the error detection function by CRC,
A reception buffer capable of storing at least one reception frame,
A comparing unit that compares the first received frame with the retransmitted second received frame to detect a mismatched portion;
A plurality of CRC calculation units that calculate a CRC based on the received frame;
A data selection unit that controls data included in the received frame, which is data to be sent to each of the plurality of CRC calculation units;
A result selection unit that selects data to be used based on the CRC calculation result of each of the plurality of CRC calculation units;
Have
When the second received frame is received, the CRC of the pattern obtained by combining the first received frame and the second received frame is also calculated in parallel to have an error correction function.
Numerical control device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018212624A JP2020080463A (en) | 2018-11-13 | 2018-11-13 | Numerical control device with error correction function during communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018212624A JP2020080463A (en) | 2018-11-13 | 2018-11-13 | Numerical control device with error correction function during communication |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2020080463A true JP2020080463A (en) | 2020-05-28 |
Family
ID=70801971
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018212624A Pending JP2020080463A (en) | 2018-11-13 | 2018-11-13 | Numerical control device with error correction function during communication |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2020080463A (en) |
-
2018
- 2018-11-13 JP JP2018212624A patent/JP2020080463A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0762705A2 (en) | Method for transmitting data via a network | |
JP5256855B2 (en) | Data transfer device and data transfer method control method | |
WO2020055616A1 (en) | Memory system with error detection | |
TWI442733B (en) | Communication device and system | |
JPH01228340A (en) | Error control system | |
US7120846B2 (en) | Data transmission device, data receiving device, data transfer device and method | |
CN101656595B (en) | Transmitting system, apparatus, and method | |
US20120328038A1 (en) | Transmission system, transmission device and method for controlling transmission device | |
US10516789B2 (en) | Information processing apparatus and image processing apparatus that perform transmission and reception of data, and method of controlling information processing apparatus | |
CN107852275B (en) | Data transmission device, data transmission method, reception device, and reception method | |
JP2017208710A (en) | Communication device, communication method, program, and communication system | |
JPH09247132A (en) | Wireless packet communication device and transmission device | |
JP2020080463A (en) | Numerical control device with error correction function during communication | |
US20030154288A1 (en) | Server-client system and data transfer method used in the same system | |
US20160080111A1 (en) | Receiver, transmitter and data transmission system | |
JP4807828B2 (en) | Envelope packet architecture for broadband engines | |
US10270705B1 (en) | Transmission of stateful data over a stateless communications channel | |
JP3794800B2 (en) | Data communication method and apparatus | |
US10999006B2 (en) | Communications having reduced latency | |
JP3281202B2 (en) | Error control system | |
WO2010103607A1 (en) | Data transfer device and data transfer device control method | |
JP3852600B2 (en) | Communication interface device and program | |
JP4239482B2 (en) | Data transfer system, LSI and data transfer method | |
JPH0535616A (en) | Data transfer system | |
JP5182417B2 (en) | Transmission data error checking device and method |