JP2010081152A - Communication device, communication system, communication method, and can node - Google Patents
Communication device, communication system, communication method, and can node Download PDFInfo
- Publication number
- JP2010081152A JP2010081152A JP2008245340A JP2008245340A JP2010081152A JP 2010081152 A JP2010081152 A JP 2010081152A JP 2008245340 A JP2008245340 A JP 2008245340A JP 2008245340 A JP2008245340 A JP 2008245340A JP 2010081152 A JP2010081152 A JP 2010081152A
- Authority
- JP
- Japan
- Prior art keywords
- error
- transmission
- node
- state
- 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
- Small-Scale Networks (AREA)
- Maintenance And Management Of Digital Transmission (AREA)
Abstract
Description
本発明は、CAN(Controller Area Network)システムにおける通信技術に関する。 The present invention relates to a communication technique in a CAN (Controller Area Network) system.
昨今の自動車には、エンジンの点火タイミング制御、ギアボックス、ABS(Anti−Block Sysytem)など多種多様な電子制御システムが搭載されている。搭載されるシステムの増大に従い配線数の増大、センサーの重複などの問題がある。また、さらに高度な性能を追求した結果、これらのシステムを統合または協調して制御する必要が生じる。 A variety of electronic control systems such as engine ignition timing control, gearboxes, and ABS (Anti-Block System) are installed in recent automobiles. There are problems such as an increase in the number of wires and duplication of sensors as the number of installed systems increases. Further, as a result of pursuing higher performance, it becomes necessary to control these systems in an integrated or coordinated manner.
統合または協調して制御するために、上記システム間でデータ通信を行う必要がある。CAN(Controller Area Network)は、このために開発された通信プロトコルであり、自動車に限らず、船舶、医療機器などの広い分野に利用されている。ここでCANプロトコルを簡単に説明する。 In order to perform integration or coordinated control, it is necessary to perform data communication between the systems. CAN (Controller Area Network) is a communication protocol developed for this purpose, and is used not only in automobiles but also in a wide range of fields such as ships and medical devices. Here, the CAN protocol will be briefly described.
図9は、CANシステムの接続例を示す模式図である。図9に示すように、CANシステム10は、複数のCANノード(以下単にノードという)12が、CANバス14により接続してなる。CANバス14は、2本のワイヤ(ワイヤ16とワイヤ18)により構成され、各ノードにおけるCANコントローラ(図示せず)は、CANバス14の2本のワイヤの電位差によりそのバスのレベルを判断する。送信側のノード12は、このレベルを変化させることによって、別のノード12にメッセージを送信できる。
FIG. 9 is a schematic diagram illustrating a connection example of a CAN system. As shown in FIG. 9, the
後述するバスオフ状態にあるノードを除き、CANバス14が空いているときは、CANバス14に接続されたすべてのノード12がメッセージの送信を開始することができ、CANバス14に対して最初に送信を開始したノードが送信権を得る。また、同時に複数のノードが送信を開始した場合は、優先順位の最も高いメッセージを送信しているノードが送信権を得る。優先順位について、CANプロトコルで定められるフレームの構造と共に説明する。
When the
CANプロトコルでは、データフレーム、リモートフレーム、エラーフレーム、オーバーロードフレーム、インターフレームスペースの5種類のフレームが定められている。データフレームは、送信側のノード(送信ノード)が受信側のノード(受信ノード)へメッセージを送るためのフレームであり、リモートフレームは同じ優先順位をもつメッセージを送信ノードへ要求するためのフレームである。また、エラーフレームは、エラーを検出したときに他のノードへエラーを通知するためのフレームであり、オーバーロードフレームは、受信ノードが受信準備未完了を通知するためのフレームであり、インターフレームスペースは、データフレームおよびリモートフレームを前のフレームと分離させるためのフレームである。ここで、データフレームのフォーマットを例に説明する。 The CAN protocol defines five types of frames: a data frame, a remote frame, an error frame, an overload frame, and an inter frame space. The data frame is a frame for sending a message from the transmitting node (transmitting node) to the receiving node (receiving node), and the remote frame is a frame for requesting a message having the same priority to the transmitting node. is there. The error frame is a frame for notifying other nodes of an error when an error is detected, and the overload frame is a frame for notifying the reception node that reception preparation is not completed, and is an interframe space. Is a frame for separating the data frame and the remote frame from the previous frame. Here, the format of the data frame will be described as an example.
図10は、CANプロトコルで定められるデータフレームの標準フォーマットを示す。図示のように、CANのデータフレームは、複数のフィールドを含む。「SOF」と「EOF」は、フレームの開始と終了をそれぞれ示すフィールドである。「調停フィールド」は、フレームの優先順位を表すフィールドであり、優先順位を示し識別IDが格納される。同時に複数のノードが送信を開始した場合、送信される各データフレームのIDに基づいて調停が行われる。調停の結果、優先順位が最も高いIDを有するデータフレームを送信するノードはそのまま送信を続け、他のノードは直ちに送信をやめ受信動作に移る。制御フィールドは、予約ビットとデータのバイト数を表すフィールドであり、データフィールドは、メッセージの中身である。また、CRCフィールドは、フレームの伝送誤りをチェックするフィールドであり、ACKフィールドは、正常受信した確認の合図を表すフィールドである。 FIG. 10 shows a standard format of a data frame defined by the CAN protocol. As shown, the CAN data frame includes a plurality of fields. “SOF” and “EOF” are fields indicating the start and end of a frame, respectively. The “arbitration field” is a field indicating the priority order of frames, and indicates the priority order and stores an identification ID. When a plurality of nodes start transmission at the same time, arbitration is performed based on the ID of each transmitted data frame. As a result of the arbitration, the node that transmits the data frame having the ID with the highest priority continues transmitting as it is, and the other nodes immediately stop transmitting and proceed to the receiving operation. The control field is a field indicating the reserved bits and the number of bytes of data, and the data field is the content of the message. The CRC field is a field for checking a frame transmission error, and the ACK field is a field indicating a signal for confirmation of normal reception.
各ノード12は、送信エラーと受信エラーをそれぞれカウントする送信エラーカウンタと受信エラーカウンタを備える。送信エラーカウンタと受信エラーカウンタのカウントアップおよびカウントダウンのタイミングおよびカウント数は、CANプロトコルの規格を参照されたいが、概して、送信エラーカウンタは、送信エラーを検出したときにはカウントアップし、正常送信できたときにはカウントダウンする。同様に、受信エラーカウンタは、受信エラーを検出したときにはカウントアップし、正常受信できたときにはカウントダウンする。
Each
各ノードは、その受信エラーカウンタのカウント値(REC)と、送信エラーカウンタのカウント値(TEC)に応じて、エラーアクティブ状態、エラーパッシブ状態、バスオフ状態の3つのエラー状態間で遷移する。エラーアクティブ状態は、バス上の通信に正常に参加できる状態であり、エラーパッシブ状態は、エラーアクティブ状態よりエラーを起こしやすい状態である。エラーパッシブ状態にあるノードは、エラーアクティブ状態のノードと比べ、送信時に制限が設けられる。また、バスオフ状態は、エラーパッシブ状態よりさらにエラーを起こしやすい状態であり、この状態にあるノードは、送受信すべての動作が禁止され、バス上の通信に参加できない。ここで、送信間隔に重点をおいてエラーアクティブ状態とエラーパッシブ状態の違いについて説明する。 Each node transitions between three error states of an error active state, an error passive state, and a bus off state according to the count value (REC) of the reception error counter and the count value (TEC) of the transmission error counter. The error active state is a state in which communication on the bus can be normally joined, and the error passive state is a state in which an error is more likely to occur than the error active state. Nodes in the error passive state are more restricted during transmission than nodes in the error active state. The bus off state is a state in which an error is more likely to occur than the error passive state, and a node in this state is prohibited from performing all transmission and reception operations and cannot participate in communication on the bus. Here, the difference between the error active state and the error passive state will be described with emphasis on the transmission interval.
CANシステムにおいて、バスオフ状態にあるノードを除き、現在CANバス上に流れているフレームを送信したノード以外の全てのノードはこのフレームを受信する。また、CANプロトコルでは、CANバス上に流れるフレームの送信終了時点から次のフレームの送信が送信されるまでの最短期間が設けられており、この期間においていずれのノードからも送信できない。本明細書において、現在CANバス上に流れるフレームの送信終了時点から、次のフレームの送信開始までの期間を「送信間隔」といい、CANプロトコルで規定された最短の送信間隔を「最小送信間隔」という。
エラーアクティブ状態に対して、連続送信と非連続送信のいずれに対しても、最小送信間隔としてインターミッション期間が規定されている。「連続送信」とは、CANバス上に現在流れるフレームを送信したノードが引き続き送信することを意味し、「非連続送信」とは、CANバス上に現在流れるフレームを送信したノード以外のノードが送信することを意味する。
インターミッション期間は、通常3ビットであり、以下第1の間隔という。この状態にあるノードは、現在のフレームの受信側と送信側のいずれであっても、該フレームの送信終了時点から3ビットのインターミッション期間を置けば送信可能になる。また、この状態にあるノードは、エラーを検出した際に、アクティブエラーフラグを出力することにより、他のノードにエラーを通知する。
In the CAN system, except for the node in the bus off state, all the nodes other than the node that has transmitted the frame currently flowing on the CAN bus receive this frame. In the CAN protocol, a shortest period from the end of transmission of a frame flowing on the CAN bus to the transmission of the next frame is provided, and transmission from any node is not possible during this period. In this specification, the period from the end of transmission of a frame currently flowing on the CAN bus to the start of transmission of the next frame is referred to as “transmission interval”, and the shortest transmission interval defined by the CAN protocol is referred to as “minimum transmission interval”. "
For the error active state, an intermission period is defined as the minimum transmission interval for both continuous transmission and non-continuous transmission. “Continuous transmission” means that the node that has transmitted the frame that currently flows on the CAN bus continues to transmit, and “non-continuous transmission” means that a node other than the node that has transmitted the frame currently flowing on the CAN bus Means to send.
The intermission period is usually 3 bits, hereinafter referred to as the first interval. A node in this state can transmit at any reception side or transmission side of the current frame after a 3-bit intermission period from the end of transmission of the frame. When a node in this state detects an error, it outputs an active error flag to notify the other nodes of the error.
エラーパッシブ状態に対して、非連続送信か連続送信かによって異なる最小送信間隔が規定されている。非連続送信の場合には、エラーアクティブ状態のときと同様に3ビットのインターミッション期間として最小送信間隔が規定されている。一方、連続送信の場合には、インターミッション期間後にさらにサスペンドトランスミッション期間を置く制限が設けられている。サスペンドトランスミッション期間は、通常8ビットである。すなわち、連続送信の場合、インターミッション期間とサスペンドミッション期間を合わせた11ビットの最小送信間隔が規定されている。以下、この11ビットの最小送信間隔を第2の間隔という。
そのため、エラーパッシブ状態にあるノードは、現在CANバス上に流れるフレームの受信側である場合には、該フレームの送信終了時点から3ビットの第1の間隔が過ぎれば送信可能であるが、現在のフレームの送信側であれば、該フレームの送信終了時点から11ビットの第2の間隔が経過しないと送信できない。
また、エラーパッシブ状態に対して、積極的なエラー通知を行わない制限も設けられている。例えば、エラーパッシブ状態にあるノードがエラーを検出したときに、パッシブエラーフラグを出力することによりエラーを通知するが、他のエラーアクティブ状態のノードがエラーを検出していなければ、バス全体としてはエラーが無かったと判断される。
For the error passive state, a minimum transmission interval that differs depending on whether the transmission is discontinuous or continuous is defined. In the case of non-continuous transmission, the minimum transmission interval is defined as a 3-bit intermission period as in the error active state. On the other hand, in the case of continuous transmission, there is a restriction to place a suspend transmission period after the intermission period. The suspend transmission period is usually 8 bits. That is, in the case of continuous transmission, an 11-bit minimum transmission interval that combines the intermission period and the suspend mission period is defined. Hereinafter, the minimum transmission interval of 11 bits is referred to as a second interval.
Therefore, if the node in the error passive state is the receiving side of the frame currently flowing on the CAN bus, it can transmit if the first interval of 3 bits has passed since the end of transmission of the frame. If it is the transmission side of the frame, transmission cannot be performed unless the second interval of 11 bits elapses from the transmission end time of the frame.
In addition, there is a restriction that active error notification is not performed for the error passive state. For example, when a node in the error passive state detects an error, the error is notified by outputting a passive error flag, but if no other error active node detects an error, the entire bus is It is determined that there were no errors.
上述した3つのエラー状態の遷移は、送信エラーカウンタと受信エラーカウンタのカウント値に基づいてなされる。図11に示すように、送信エラーカウンタのカウント値TECと受信エラーカウンタのカウント値RECが共に0〜127であるときには、該ノードはエラーアクティブ状態にあり、TECとRECのいずれか一方が128〜255であるときには、該ノードはエラーパッシブ状態になる。また、RECに関わらず、TECが256以上になったときには、該ノードはバスオフ状態になり、CANバス上の通信から切り離される。 The above three error state transitions are made based on the count values of the transmission error counter and the reception error counter. As shown in FIG. 11, when the count value TEC of the transmission error counter and the count value REC of the reception error counter are both 0 to 127, the node is in an error active state, and either TEC or REC is 128 to If it is 255, the node is in an error passive state. Regardless of the REC, when the TEC becomes 256 or more, the node enters the bus off state and is disconnected from the communication on the CAN bus.
CANでは、このようにして、エラーを起しやすい程度に応じたエラー状態を規定し、エラー状態に応じた制限を当該ノードの送受信動作に加えることにより、エラーを起こしやすいノードによる通信の妨害を回避する。 In this way, in the CAN, an error state corresponding to the degree that an error is likely to occur is specified, and a restriction according to the error state is added to the transmission / reception operation of the node, thereby preventing communication by the node that is likely to cause an error. To avoid.
近年、CANシステム上におけるトラフィック量が増大する一途を辿っており、バスオフが頻発すると、リカバリされるまでそのノードとの通信が途絶えてしまい、システム全体の効率が低下する。そのため、不必要なバスオフをできるだけ回避することが望まれる。 In recent years, the amount of traffic on the CAN system has been increasing, and if bus-off frequently occurs, communication with the node is interrupted until recovery, and the efficiency of the entire system decreases. Therefore, it is desirable to avoid unnecessary bus-off as much as possible.
CANシステムにおけるエラーは、ノイズなどの外乱によるエラーと、ノードの内部故障、ドライバの故障、断線故障などによるエラーがある。外乱に起因するエラーによるバスオフは、不必要なバスオフに該当する。 Errors in the CAN system include errors due to noise and other disturbances, and errors due to internal node failures, driver failures, disconnection failures, and the like. A bus off due to an error caused by a disturbance corresponds to an unnecessary bus off.
特許文献1は、外乱かノードの故障かを判別する手法が開示されている。この手法は、エラーパッシブになったノードについて、その状態が所定時間継続するか否かを監視する。そして、エラーパッシブ状態が所定時間継続した場合には、ノードの故障と判断する。
特許文献1では、ノードが故障したかの判定を行った後の処置について開示していないが、例えば、特許文献1の手法によりノードの故障ではないと判定した場合に、当該ノードがバスオフ状態に遷移することを阻止し、不必要なバスオフを回避することが考えられる。
ところで、CANプロトコルでは、送信エラーのときに該ノードの送信エラーカウンタが「8」インクリメントするが、正常に送信できたときには「1」デクリメントする。すなわち、エラーパッシブ状態にあるノードは、送信が相当回数成功しないと、エラーパッシブ状態からエラーアクティブ状態に遷移することができない。例えば、あるノードは、TECが250であり、バスオフ状態に移行する可能性が高まった状態、すなわちバスオフリスクが高い状態にあるとき、送信が連続的に多数回成功すれば、バスオフリスクを回避することができるが、外乱により一回のみ送信エラーが生じただけでも、TECが258になり、バスオフになってしまう。 By the way, in the CAN protocol, the transmission error counter of the node is incremented by “8” when a transmission error occurs, but is decremented by “1” when transmission is successful. That is, a node in the error passive state cannot make a transition from the error passive state to the error active state unless transmission is successful a considerable number of times. For example, when a node has a TEC of 250 and has a high possibility of transitioning to a bus-off state, that is, in a state where the bus-off risk is high, if a transmission succeeds many times in succession, the bus-off risk is increased. Although it can be avoided, even if a transmission error occurs only once due to disturbance, the TEC becomes 258 and the bus is turned off.
しかし、前述したように、CANプロトコルでは、故障のあるノードによる他のノードの通信への妨害を軽減するために、エラーパッシブ状態にあるノードに対して、非連続送信の場合には、第1の間隔を置く一方、連続送信する場合には、第1の間隔より第2の間隔を置くことが規定されている。すなわち、エラーパッシブ状態にあるノードは、そのIDが示す優先順次に関わらず、エラーアクティブ状態にある他の連続送信するノードと比べて送信タイミングが遅れている。これでは、バスオフリスクが高まったノードは、自身に故障が無いにも関わらず、正常送信ができた回数を増やすことによりバスオフを回避するチャンスが少ない。この場合、特許文献1の手法によれば、該ノードに故障があると判断され、不必要なバスオフが生じてしまう。
However, as described above, in the CAN protocol, the first in the case of non-continuous transmission to a node in an error passive state in order to reduce interference with other nodes by a failed node. On the other hand, in the case of continuous transmission, it is specified that the second interval is set rather than the first interval. That is, the node in the error passive state is delayed in transmission timing as compared with the other nodes performing continuous transmission in the error active state regardless of the priority order indicated by the ID. In this case, a node whose bus-off risk has increased has a small chance of avoiding the bus-off by increasing the number of times of normal transmission even though the node itself has no failure. In this case, according to the method of
本発明の1つの態様は、CAN(Controller Area Network)バスに接続され、複数のエラー状態間で遷移しうる通信装置である。この通信装置は、受信エラーカウンタと、送信エラーカウンタと、エラー状態制御部と、送信間隔制御部を備える。 One aspect of the present invention is a communication device connected to a CAN (Controller Area Network) bus and capable of transitioning between a plurality of error states. The communication apparatus includes a reception error counter, a transmission error counter, an error state control unit, and a transmission interval control unit.
エラー状態制御部は、受信エラーカウンタと送信エラーカウンタのカウント値を判定条件に、現在のエラー状態が継続するか、現在のエラー状態から他のエラー状態に遷移するかの制御を行う。 The error state control unit controls whether the current error state continues or transitions from the current error state to another error state using the count values of the reception error counter and the transmission error counter as determination conditions.
送信間隔制御部は、現在のエラー状態が上記複数のエラー状態に含まれたエラーアクティブ状態であり、かつ、上記判定条件が、エラーアクティブ状態が継続するようにエラー状態制御部に制御させるものである際に、受信エラーカウンタのカウント値が所定値以上になったことを条件に、最小送信間隔が、エラーアクティブ状態に対して規定された最小送信間隔の長さより長い所定長になるように送信間隔を制御する。
本発明の別の態様は、送信エラーの発生回数をカウントする送信エラーカウンタと、受信エラーの発生回数をカウントする受信エラーカウンタとを備え、送信エラーカウンタまたは受信エラーカウンタのカウント値が第1基準値よりも大きい値を示す場合には、CANバスに流れるフレームが他ノードから出力されたものであるときには、該フレームの送信が終了した時点から第1期間の経過後に自ノードからフレーム送信を開始し、CANバスに流れるフレームが自ノードから出力されたものであるときには、該フレームの送信が終了した時点から前記第1期間よりも長い第2期間の経過後に自ノードからのフレーム送信を開始するCANノードである。このCANノードは、送信カウンタのカウント値が第1基準値以下であり、かつ、受信カウンタのカウント値が第1基準値以下、第1基準値よりも小さい第2基準値以上の値を示す場合には、CANバスに流れるフレームの送信が終了した時点から第1期間よりも長い期間である第3期間の経過後に自ノードからのフレーム送信を開始する。
The transmission interval control unit controls the error state control unit so that the current error state is an error active state included in the plurality of error states, and the determination condition continues the error active state. In some cases, the transmission is performed so that the minimum transmission interval is longer than the minimum transmission interval specified for the error active state, on condition that the count value of the reception error counter is equal to or greater than the predetermined value. Control the interval.
Another aspect of the present invention includes a transmission error counter that counts the number of occurrences of a transmission error and a reception error counter that counts the number of occurrences of a reception error, and the count value of the transmission error counter or the reception error counter is a first reference When a value larger than the value is indicated, if the frame flowing on the CAN bus is output from another node, frame transmission from the own node starts after the first period has elapsed since the transmission of the frame was completed. If the frame flowing on the CAN bus is output from the own node, frame transmission from the own node is started after a lapse of a second period longer than the first period from the end of transmission of the frame. It is a CAN node. In this CAN node, the count value of the transmission counter is less than or equal to the first reference value, and the count value of the reception counter is less than or equal to the first reference value and indicates a value greater than or equal to the second reference value that is smaller than the first reference value. First, frame transmission from the own node is started after the elapse of a third period, which is a period longer than the first period from the end of transmission of the frame flowing through the CAN bus.
なお、上記態様の通信装置とCANノードを方法や、コンピュータを当該装置またはノードとして動作せしめるプログラムとして置き換えて表現したものも、本発明の態様として有効である。また、上記態様の装置またはCANノードを複数備えたシステムも、本発明の態様として有効である。 It is also effective as an aspect of the present invention that the communication apparatus and the CAN node in the above aspect are replaced with a method or a program that causes a computer to operate as the apparatus or the node. A system including a plurality of apparatuses or CAN nodes according to the above aspect is also effective as an aspect of the present invention.
本発明の技術によれば、CANシステムにおいて、不必要なバスオフを回避し、通信効率を向上させることができる。 According to the technology of the present invention, unnecessary bus-off can be avoided and communication efficiency can be improved in a CAN system.
以下、図面を参照して本発明の実施の形態を説明する。なお、以下の説明に用いられる図面に、様々な処理を行う機能ブロックとして記載される各要素は、ハードウェア的には、プロセッサ、メモリ、その他の回路で構成することができ、ソフトウェア的には、メモリに記録された、またはロードされたプログラムなどによって実現される。したがって、これらの機能ブロックがハードウェアのみ、ソフトウェアのみ、またはそれらの組合せによっていろいろな形で実現できることは当業者には理解されるところであり、いずれかに限定されるものではない。また、分かりやすいように、これらの図面において、本発明にかかる技術を説明するために必要なもののみを示す。 Embodiments of the present invention will be described below with reference to the drawings. In addition, each element described as a functional block for performing various processes in the drawings used in the following description can be configured with a processor, a memory, and other circuits in terms of hardware, and in terms of software It is realized by a program recorded in a memory or loaded. Therefore, it is understood by those skilled in the art that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof, and is not limited to any one. Further, for easy understanding, in these drawings, only those necessary for explaining the technique according to the present invention are shown.
本願発明者は、CANシステムにおいて不必要なバスオフリスクを回避するために鋭意研究模索した結果、あるノードの受信エラーカウンタのカウント値RECと、他のノードのバスオフリスクの高さとの間に関連性があることを知見した。これについて、まず、図1を参照してCANシステムにおけるエラーカウント値の変動について説明する。 As a result of earnest research to avoid unnecessary bus-off risk in the CAN system, the present inventor has found that the count value REC of the reception error counter of one node and the height of the bus-off risk of another node. I found that there is a relationship. Regarding this, first, the fluctuation of the error count value in the CAN system will be described with reference to FIG.
図1に示すように、送信ノードは、TECをインクリメントすべきあらゆる場合においてTECを「8」インクリメントし、正常に送信できた場合にはTECを「1」デクリメントする。それに対して、受信ノードは、RECを「8」をインクリメントする場合もあるが、図1の「1」に示すように、RECを「1」のみインクリメントする場合もある。そのため、外乱の発生中に、送信ノードのTECの増加は、受信ノードのRECの増加より速い傾向にあり、送信回数が多いノードほど、そのTECが大きく増大する。 As shown in FIG. 1, the transmitting node increments the TEC by “8” in every case where the TEC should be incremented, and decrements the TEC by “1” if the transmission is successful. On the other hand, the receiving node may increment REC by “8”, but may increment REC by only “1” as indicated by “1” in FIG. Therefore, during the occurrence of disturbance, the increase in the TEC of the transmitting node tends to be faster than the increase in the REC of the receiving node, and the TEC increases greatly as the number of transmissions increases.
送信ノードは、一度正常に送信ができれば、TECを「1」デクリメントするが、前の送信失敗によりメッセージがたまっている場合、連続送信する。ところで、もし、該送信ノードが既にエラーパッシブ状態にある場合は、連続送信時の最小送信間隔がエラーアクティブ状態にあるノードより長く定められているため、連続送信しようとしても、IDが示す優先順位により調停の前に、エラーアクティブ状態にあるノードに負けてしまい、送信できない。これでは、バスオフリスクが高まる一方である。 The transmission node decrements the TEC by “1” once it can be normally transmitted, but continuously transmits the message if the message has accumulated due to the previous transmission failure. By the way, if the transmitting node is already in the error passive state, the minimum transmission interval at the time of continuous transmission is set longer than that of the node in the error active state. Therefore, before arbitration, the node loses to the node in the error active state and cannot transmit. This is increasing the risk of bus-off.
他方、前述したように、外乱の発生期間中には、送信ノードのTECよりは程度が小さいものの、受信ノードのRECも増大する。すなわち、外乱の発生により受信ノードのRECが増大した場合、同じCANシステムにおいて送信回数の多いノードがあれば、このノードが、TECが増大してバスオフリスクが高まっている可能性がある。 On the other hand, as described above, during the disturbance occurrence period, the REC of the receiving node increases although the degree is smaller than the TEC of the transmitting node. That is, when the REC of the receiving node increases due to the occurrence of a disturbance, if there is a node with a large number of transmissions in the same CAN system, this node may increase the TEC and increase the bus-off risk.
本願発明者は、このことに着目して、下記の手法を提案する。エラーアクティブ状態にあるノードに対して、そのTECとRECが、エラーパッシブ状態に遷移する条件(TEC>127またはREC>127)にならなくても、RECが127以下の所定の閾値例えば120以上になったことを条件に、該ノードの最小送信間隔を、エラーアクティブ状態にあるノードに対して定められた最小送信間隔より長くなるように制御する。
そのため、本発明の技術によれば、TECが127以下であり、RECが上記閾値より小さいノードは、連続送信と非連続送信のいずれの場合においても最小送信間隔が、CANプロトコルでエラーアクティブ状態に対して規定された3ビットの第1の間隔になる。一方、TECが127以下であり、RECが上記の閾値以上、127以下であるノードは、連続送信と非連続送信のいずれの場合においても最小送信間隔が、第1の送信間隔より長くなる。エラーパッシブ状態に対してCANプロトコルで規定された連続送信時の最小送信間隔となる第2の送信間隔(11ビット)と区別するために、この場合の最小送信間隔を以下第3の送信間隔という。
図2は、本発明の技術を適用した場合、エラーアクティブ状態にあるノードの最小送信間隔を示す。比較のため、エラーパッシブ状態にあるノードの最小送信間隔も示されている。
図2に示すように、エラーパッシブ状態にあるノードの最小送信間隔は、CANプロトコルの規定通り、連続送信時には11ビットの第2の間隔であり、非連続送信時には3ビットの第1の間隔である。
エラーアクティブ状態にあるノードの最小送信間隔は、受信カウンタのカウント値RECによって異なる。具体的には、RECが所定の閾値より小さいときには、CANプロトコルの規定通りに、連続送信時と非連続送信時のいずれの場合においても、最小送信間隔は3ビットの第1の間隔である。一方、RECが所定の閾値以上になったときには、連続送信時と非連続送信時のいずれにおいて、最小送信間隔は3ビットの第1の間隔より長い第3の間隔になる。
The inventors of the present application pay attention to this and propose the following method. For a node in the error active state, even if the TEC and REC do not satisfy the condition for transitioning to the error passive state (TEC> 127 or REC> 127), the REC becomes a predetermined threshold value of 127 or less, for example, 120 or more. The minimum transmission interval of the node is controlled to be longer than the minimum transmission interval determined for the node in the error active state.
Therefore, according to the technique of the present invention, a node whose TEC is 127 or less and whose REC is smaller than the above threshold value has a minimum transmission interval in an error active state according to the CAN protocol in both cases of continuous transmission and non-continuous transmission. The first interval of 3 bits defined for the first interval. On the other hand, a node having a TEC of 127 or less and a REC of not less than the above threshold and 127 or less has a minimum transmission interval longer than the first transmission interval in both cases of continuous transmission and non-continuous transmission. In order to distinguish from the second transmission interval (11 bits), which is the minimum transmission interval at the time of continuous transmission defined by the CAN protocol for the error passive state, the minimum transmission interval in this case is hereinafter referred to as a third transmission interval. .
FIG. 2 shows a minimum transmission interval of a node in an error active state when the technique of the present invention is applied. For comparison, the minimum transmission interval of a node in an error passive state is also shown.
As shown in FIG. 2, the minimum transmission interval of the node in the error passive state is the second interval of 11 bits at the time of continuous transmission and the first interval of 3 bits at the time of non-continuous transmission as defined by the CAN protocol. is there.
The minimum transmission interval of the node in the error active state varies depending on the count value REC of the reception counter. Specifically, when REC is smaller than a predetermined threshold, the minimum transmission interval is the first interval of 3 bits in both cases of continuous transmission and non-continuous transmission as defined by the CAN protocol. On the other hand, when REC becomes equal to or greater than a predetermined threshold value, the minimum transmission interval is a third interval longer than the first interval of 3 bits in either continuous transmission or non-continuous transmission.
こうすることにより、最小送信間隔を除き、エラーアクティブ状態においてRECが閾値以上になったノードのエラーアクティブ状態を維持しながら、該ノードとは別の、送信回数が多く、外乱によりバスオフリスクが高まったノードに、優先順位による調停に基づいた送信チャンスを多く与えることができ、そのノードのバスオフリスクの軽減を図ることができる。 In this way, except for the minimum transmission interval, while maintaining the error active state of the node in which the REC is equal to or greater than the threshold in the error active state, the number of transmissions is different from that node, and the bus off risk is caused by disturbance. It is possible to give the increased node many transmission opportunities based on arbitration based on the priority order, and it is possible to reduce the bus off risk of the node.
さらに、もし、その別のノードは、外乱ではなく、自身の問題によりバスオフリスクが高まっているのならば、当該ノードは多くの送信エラーを起こすため、TECが増大し、より早くバスオフ状態に遷移するという効果も得られる。
ここで、本発明の技術を適用する場合と適用しない場合とを比較しながら、本発明の技術に用いられる第3の間隔の具体的な長さについて検討する。エラーパッシブ状態のノードAと、エラーアクティブ状態のノードBが存在し、それぞれ送信メッセージを有し、連続送信する場合を例にする。分かりやすいように、システム上にノードAとノードBのみがあるとする。また、以下の説明と図示において、「A」が付く「フレーム」と「B」が付く「フレーム」でノードAが送信したフレームとノードBが送信したフレームをそれぞれ表記する。なお、優先順位調整を経て送信されたフレームを点線枠で示し、優先順位調整を経ずに送信されたフレームを実線矩形で示す。
図3は、本発明を適用しない場合に、ノードAからのフレームA0の送信終了後、3つのフレームが送信される期間内に起こり得る3つのパターンを示すタイミングチャートである。
この場合、ノードAがフレームを送信した後、必ずノードBが次のフレームの送信権を得て送信する。また、ノードBがフレームを送信した後は、優先順位調停を経てノードAとノードBのいずれかが次フレームの送信権を得る。
<パターン1>
ノードAがエラーパッシブ状態にあり、連続送信時の最小間隔が第2の間隔(インターミッション期間とサスペンドトランスミッション期間を合わせた11ビット)であるため、フレームA0の送信終了時点(t0)から第1の間隔(3ビット)のインターミッション期間が経過したとき(時点t1)において、優先順位調停を経ずにノードBからフレームB1が送信される。
フレームB1の送信終了時点t2からインターミッション期間が過ぎた時点t3において、ノードAとノードBが送信権を得るための優先順位調停が行われる。
ノードAとノードBのいずれも送信権を得る可能性があるが、このパターンでは、ノードAが送信権を得てフレームA1を送信する。
フレームA1の送信終了時点t4からインターミッション期間が過ぎた時点t5において、また優先順位調停を経ずにノードBからフレームB2が送信される。
<パターン2>
時刻t1において、パターン1のときと同様に、優先順位調停を経ずにノードBからフレームB1が送信される。
時刻t3においては、パターン1と異なり、優先順位調停を経てノードBが送信権を得てフレームB2を送信する。
フレームB2の送信終了時点t4からインターミッション期間が過ぎた時点t5においても、パターン1と異なり、ノードAとノードBの優先順位調停が行われる。このパターンでは、ノードAが送信権を得てフレームA1を送信する。
<パターン3>
フレームB2の送信終了時点t4まで、パターン2と同様である。時点t5において、パターン2と異なり、ノードBが送信権を得てフレームB3を送信する。
このように、ノードAがフレームを送信したら、優先順位調停を経ずに必ずノードBが次のフレームの送信権を得る。ノードBがフレームを送信した後は、優先順位調停を経て、ノードAとノードBのいずれかが次のフレームの送信権を得る。そのため、ノードAが送信できる確率は、ノードBより低い。
図3に示す例の場合、時刻t0から、3フレームが送信される間に、ノードAが送信できる確率は、2/9である。
図4は、本発明を適用した場合に、ノードAからのフレームA0の送信終了後、3つのフレームが送信される期間内に起こり得る5つのパターンを示すタイミングチャートである。なお、本発明の技術は、エラーアクティブ状態にあるノードの受信カウンタのカウント値RECが127以上である場合に、該ノードの最小送信間隔を3ビットの第1の間隔より長い第3の間隔にするものであるため、図4では、ノードBのRECが127閾値以上である場合のみを示す。また、図4の例において、第3の間隔の長さを、CANプロトコルでエラーパッシブ状態に対して規定された連続送信時の最小間隔すなわち第3の間隔の11ビットにしている。
この場合、ノードAがフレームを送信した後、優先順位調停を経てノードAとノードBのいずれかが次のフレームの送信権を得る。また、ノードBがフレームを送信した後は、必ずノードAが次のフレームの送信権を得て送信する。
<パターン1>
ノードAは、エラーパッシブ状態にあり、連続送信時の最小送信間隔が11ビットの第2の間隔である。また、ノードBは、エラーアクティブ状態にあるが、本発明の技術の適用により、最小送信間隔が第3の間隔(ここでは第2の間隔と同長の11ビット)になる。そのため、時刻t0から11ビットが過ぎた時点t1において、ノードAとノードが送信権を得るための優先順位調停が行われる。
ノードAとノードBのいずれも送信権を得る可能性があるが、このパターンでは、ノードAが送信権を得てフレームA1を送信する。
同様に、フレームA1の送信終了時点t2から11ビット過ぎた時点t4において、優先順位調停を経てノードAは送信権を得てフレームA2を送信する。また、フレームA2の送信終了時点t6から11ビット過ぎた時点t8において、優先順位調停を経てノードAは送信権を得てフレームA3を送信する。
<パターン2>
このパターンは、フレームA2の送信終了時点t6まで、パターン1と同様である。
時点t8において、パターン1のときと異なり、優先順位調停を経てノードBが送信権を得てフレームB1を送信する。
<パターン3>
このパターンは、フレームA1の送信終了時点t2まで、パターン1と同様である。
時点t4において、パターン1のときと異なり、優先順位調停を経てノードBが送信権利を得てフレームB1を送信する。
このとき、ノードBは、次のフレームを送信するために、フレームB1の送信終了時点t6から11ビットの第3の間隔を置く必要がある。一方、ノードAは、フレームB1の次のフレームを送信するためには、時点t6から3ビットの第1の間隔のみ置けばよい。そのため、フレームB1の送信終了時点t6から3ビットの第1の間隔が過ぎた時点t7において、優先順位調停を経ずにノードAからフレームA2が送信される。
<パターン4>
時刻t1における優先順位調停を経てノードBは送信権を得てフレームB1を送信する。
フレームB1の送信終了時点t2から3ビットの第1の間隔が過ぎた時点t3において、優先順位調停を経ずにノードAからフレームA1が送信される。
フレームA1の送信終了時点t5から11ビットが過ぎた時点t7において、ノードAとノードBの優先順位調停が行われる。このパターンでは、ノードAが送信権を得てフレームA2を送信する。
<パターン5>
このパターンは、フレームA1の送信終了時点t5まで、パターン4と同様である。
時点t7において、パターン4のときと異なり、優先順位調停を経てノードBが送信権を得てフレームB2を送信する。
このように、ノードAがフレームを送信した後、優先順位調停を経てノードAとノードBのいずれかが次のフレームの送信権を得る。ノードBがフレームを送信した後は、必ずノードAが次のフレームの送信権を得て送信する。そのため、ノードAが送信できる確率は、ノードB場合より高い。
図4に示す例の場合、時刻t0から、3フレームが送信される間に、ノードAが送信できる確率は、2/3である。これは、図3に示す場合より高い確率である。
図5は、図4と同じように、本発明を適用した場合に、ノードAからのフレームA0の送信終了後、3つのフレームが送信される期間内に起こり得るパターンを示すタイミングチャートである。図4の場合と異なるのは、第3の間隔の長さが、3ビットの第1の間隔より長く、11ビットの第2の間隔より短い点である。ここの例では、第3の間隔を6ビットとする。
この場合、起こり得るパターンは、図5に示すように1つである。
ノードAは、エラーパッシブ状態にあり、連続送信時の最小送信間隔が11ビットの第2の間隔である。ノードBは、エラーアクティブ状態にあるが、本発明の技術の適用により、最小送信間隔が第1の間隔より長く第2の間隔より短い第3の間隔(ここでは6ビット)になる。そのため、時刻t0から6ビットの第3の間隔が過ぎた時点t1において、優先順位調停を経ずにノードBからフレームB1が送信される。
ノードAは、フレームB1の後にフレームを送信する場合、第1の間隔の3ビットを置く必要がある。一方、ノードBは、フレームB1の後にフレームを送信する場合、第3の間隔の6ビットを置く必要がある。そのため、フレームB1の送信終了時点t2から3ビット過ぎた時点t3において、優先順位調停を経ずにノードAからフレームA1が送信される。
そして、フレームA1の送信終了時点t4から第3の間隔の6ビットが過ぎた時点t5において、優先順位調停を経ずにノードBからフレームB2が送信される。
すなわち、ノードAがフレームを送信した後に、必ずノードBが次のフレームの送信権を得て送信する。また、ノードBがフレーム送信した後は、必ずノードAが次のフレームの送信権を得る。図5に示す例の場合、時刻t0から、3フレームが送信される間に、ノードAが送信できる確率は、1/3である。これも、図3に示す場合より高い確率である。
また、図示していないが、第3の間隔が第2の間隔の11ビットより長い場合は、ノードAが送信できる確率が100%になり、ノードAが連続送信する間、ノードBは送信できない。
このように、エラーアクティブ状態にあるノードBの受信カウンタのカウント値RECが所定の閾値以上である場合、該ノードの最小送信間隔が3ビットの第1の間隔より長い第3の間隔になり、エラーパッシブ状態にあるノードAは、送信できる確率が高くなる。そのため、ノードAは、外乱によりバスオフリスクが高まったのであれば、送信回数が増えることによりバスオフリスクを回避することができる。これは、第3の間隔が、エラーパッシブ状態に対して規定された連続送信時の最小送信間隔(11ビットの第2の間隔)より短い場合にも得られる効果である。
第3の間隔が長ければ、ノードAの送信できる確率が高くなる。ところで、第3の間隔が、エラーパッシブ状態に対して規定された連続送信時の最小送信間隔(11ビットの第2の間隔)よりも長い場合、ノードAが連続送信している間、ノードBは、エラーアクティブ状態にあるにも関わらず、まったく送信できない。これでは、システムに与える影響が大きい。
第3の間隔が第2の間隔と同長の11ビットである場合、ノードAの送信できる確率が、第3の間隔が第2の間隔より小さい場合より高くなると共に、ノードAの連続送信時に、ノードBとの優先順位調停が行われるので、ノードBにも送信できる可能性がある。こうすることにより、本発明の技術の効果を発揮しながら、システムに与える影響を抑制することができる。そのため、本発明の技術を適用する際に、第3の間隔を第2の間隔と同長にすることが好ましい。
以上の説明を踏まえて、本発明の実施の形態について説明する。
In addition, if the other node is not a disturbance and the risk of bus-off is increased due to its own problem, the node will cause many transmission errors, so the TEC will increase and it will go into the bus-off state sooner. The effect of transition is also obtained.
Here, the specific length of the third interval used in the technique of the present invention will be examined while comparing the case where the technique of the present invention is applied and the case where the technique of the present invention is not applied. An example is a case where there are a node A in an error passive state and a node B in an error active state, each having a transmission message and continuously transmitting. For simplicity, it is assumed that there are only node A and node B on the system. Further, in the following description and illustration, a frame transmitted by the node A and a frame transmitted by the node B are respectively represented by a “frame” attached with “A” and a “frame” attached with “B”. A frame transmitted after the priority adjustment is indicated by a dotted frame, and a frame transmitted without the priority adjustment is indicated by a solid rectangle.
FIG. 3 is a timing chart showing three patterns that can occur within a period in which three frames are transmitted after the end of transmission of the frame A0 from the node A when the present invention is not applied.
In this case, after the node A transmits the frame, the node B always obtains and transmits the transmission right of the next frame. Further, after node B transmits a frame, either node A or node B obtains the right to transmit the next frame through priority arbitration.
<
Since node A is in the error passive state and the minimum interval during continuous transmission is the second interval (11 bits including the intermission period and the suspended transmission period), the first interval from the transmission end time (t0) of frame A0 is When the intermission period of the interval (3 bits) elapses (time point t1), the frame B1 is transmitted from the node B without passing through the priority order arbitration.
At the time t3 when the intermission period has passed from the transmission end time t2 of the frame B1, priority order arbitration for the node A and the node B to obtain the transmission right is performed.
Although both the node A and the node B may obtain the transmission right, in this pattern, the node A obtains the transmission right and transmits the frame A1.
At the time t5 when the intermission period has passed from the transmission end time t4 of the frame A1, the frame B2 is transmitted from the node B without passing through the priority order arbitration.
<
At time t1, as in the case of
At the time t3, unlike the
Unlike the
<Pattern 3>
This is the same as
Thus, when node A transmits a frame, node B always obtains the right to transmit the next frame without passing through priority arbitration. After node B transmits a frame, either node A or node B obtains the right to transmit the next frame through priority arbitration. Therefore, the probability that node A can transmit is lower than that of node B.
In the case of the example illustrated in FIG. 3, the probability that the node A can transmit during the transmission of 3 frames from time t0 is 2/9.
FIG. 4 is a timing chart showing five patterns that can occur within a period in which three frames are transmitted after transmission of the frame A0 from the node A when the present invention is applied. In the technology of the present invention, when the count value REC of the reception counter of the node in the error active state is 127 or more, the minimum transmission interval of the node is set to a third interval longer than the 3-bit first interval. Therefore, FIG. 4 shows only the case where the REC of the node B is equal to or greater than the 127 threshold value. In the example of FIG. 4, the length of the third interval is set to the minimum interval for continuous transmission defined by the CAN protocol for the error passive state, that is, 11 bits of the third interval.
In this case, after node A transmits a frame, either node A or node B obtains the right to transmit the next frame through priority arbitration. In addition, after node B transmits a frame, node A always obtains the transmission right for the next frame and transmits it.
<
Node A is in an error passive state, and the minimum transmission interval during continuous transmission is a second interval of 11 bits. In addition, although the node B is in an error active state, the minimum transmission interval becomes a third interval (here, 11 bits having the same length as the second interval) by applying the technique of the present invention. Therefore, at the time t1 when 11 bits have passed since the time t0, priority order arbitration is performed for the node A and the node to obtain a transmission right.
Although both the node A and the node B may obtain the transmission right, in this pattern, the node A obtains the transmission right and transmits the frame A1.
Similarly, at time point t4 when 11 bits have passed from the transmission end time point t2 of the frame A1, the node A obtains the transmission right and transmits the frame A2 through priority arbitration. In addition, at time t8 when 11 bits have passed since the transmission end time t6 of the frame A2, the node A obtains the transmission right and transmits the frame A3 through priority arbitration.
<
This pattern is the same as
At the time t8, unlike the case of the
<Pattern 3>
This pattern is the same as
At the time t4, unlike the case of the
At this time, in order to transmit the next frame, the node B needs to have a third interval of 11 bits from the transmission end time t6 of the frame B1. On the other hand, in order to transmit the frame next to the frame B1, the node A has to leave only the first 3-bit interval from the time point t6. Therefore, the frame A2 is transmitted from the node A without passing through the priority order arbitration at the time t7 when the first interval of 3 bits has passed from the transmission end time t6 of the frame B1.
<Pattern 4>
Node B obtains a transmission right through priority arbitration at time t1, and transmits frame B1.
At the time point t3 when the first interval of 3 bits has passed from the transmission end time point t2 of the frame B1, the frame A1 is transmitted from the node A without passing through the priority order arbitration.
At the time t7 when 11 bits have passed from the transmission end time t5 of the frame A1, priority order arbitration between the node A and the node B is performed. In this pattern, the node A obtains the transmission right and transmits the frame A2.
<Pattern 5>
This pattern is the same as the pattern 4 until the transmission end time t5 of the frame A1.
At the time t7, unlike the case of the pattern 4, the node B obtains the transmission right and transmits the frame B2 through the priority order arbitration.
Thus, after node A transmits a frame, either node A or node B obtains the right to transmit the next frame through priority arbitration. After node B transmits a frame, node A always obtains and transmits the next frame transmission right. Therefore, the probability that node A can transmit is higher than that of node B.
In the case of the example shown in FIG. 4, the probability that the node A can transmit during the transmission of 3 frames from time t0 is 2/3. This is a higher probability than in the case shown in FIG.
FIG. 5 is a timing chart showing patterns that can occur within a period in which three frames are transmitted after the transmission of the frame A0 from the node A when the present invention is applied, as in FIG. A difference from the case of FIG. 4 is that the length of the third interval is longer than the first interval of 3 bits and shorter than the second interval of 11 bits. In this example, the third interval is 6 bits.
In this case, there is one possible pattern as shown in FIG.
Node A is in an error passive state, and the minimum transmission interval during continuous transmission is a second interval of 11 bits. Although the node B is in an error active state, the minimum transmission interval becomes longer than the first interval and shorter than the second interval (here, 6 bits) by applying the technique of the present invention. Therefore, the frame B1 is transmitted from the node B without passing through the priority order arbitration at the time t1 when the third 6-bit interval has passed from the time t0.
When the node A transmits a frame after the frame B1, it is necessary to put 3 bits in the first interval. On the other hand, when transmitting a frame after the frame B1, the node B needs to put 6 bits in the third interval. Therefore, the frame A1 is transmitted from the node A without passing through the priority order arbitration at the time t3 when 3 bits have passed from the transmission end time t2 of the frame B1.
Then, at time point t5 when 6 bits of the third interval have passed since the transmission end time point t4 of the frame A1, the frame B2 is transmitted from the node B without passing through priority order arbitration.
That is, after node A transmits a frame, node B always obtains and transmits the transmission right for the next frame. In addition, after node B transmits a frame, node A always obtains the right to transmit the next frame. In the case of the example shown in FIG. 5, the probability that node A can transmit during the transmission of 3 frames from time t0 is 1/3. This is also a higher probability than in the case shown in FIG.
Although not shown, when the third interval is longer than 11 bits of the second interval, the probability that node A can transmit is 100%, and node B cannot transmit while node A continuously transmits. .
As described above, when the count value REC of the reception counter of the node B in the error active state is equal to or larger than the predetermined threshold, the minimum transmission interval of the node becomes a third interval longer than the first interval of 3 bits, Node A in the error passive state has a higher probability of transmission. Therefore, if the bus A risk increases due to disturbance, the node A can avoid the bus OFF risk by increasing the number of transmissions. This is an effect obtained even when the third interval is shorter than the minimum transmission interval (second interval of 11 bits) at the time of continuous transmission specified for the error passive state.
The longer the third interval, the higher the probability that node A can transmit. By the way, when the third interval is longer than the minimum transmission interval (second interval of 11 bits) at the time of continuous transmission defined for the error passive state, while node A is continuously transmitting, node B Cannot transmit at all even though it is in the error active state. This has a large impact on the system.
When the third interval is 11 bits having the same length as the second interval, the probability that the node A can transmit is higher than when the third interval is smaller than the second interval. Since priority order arbitration with the node B is performed, there is a possibility of transmission to the node B as well. By doing so, it is possible to suppress the influence on the system while exhibiting the effects of the technology of the present invention. Therefore, when applying the technique of the present invention, it is preferable to make the third interval the same length as the second interval.
Based on the above description, embodiments of the present invention will be described.
図6は、本発明の実施の形態にかかるCANシステム100を示す。CANシステム100は、CANプロトコルに準拠し、複数のCANノード(以下単にノードという)120が、CANバス110により接続されている。
FIG. 6 shows a
図7は、図6に示すCANシステム100におけるノード120を示す。ノード120は、トランシーバ122と、CPU124と、周辺チップ126と、CANコントローラ130を備える。CPU124と、周辺チップ126と、CANコントローラ130は、ローカルバス128により接続される。
FIG. 7 shows the
トランシーバ122は、CANバス110と接続し、CANバス110上のフレームを受信してCANコントローラ130に転送すると共に、CANコントローラ130から送出されるフレームをCANバス110に出力する。ノード120とCANバス110間のすべての送受信は、トランシーバ122を介して行われる。
The
CANコントローラ130は、ビットストリーム制御部132と、エラー状態制御部134と、受信エラーカウンタ136と、送信エラーカウンタ138と、送信タイミング制御部140と、メッセージハンドラ150と、メッセージバッファ152を有する。メッセージバッファ152は、さらに受信バッファ154と送信バッファ156を備える。
The
ビットストリーム制御部132は、通信(送信/受信)にエラーが生じたか否かを検知する機能を備え、通信エラーが発生すると、その旨をエラー状態制御部134に通知する。ビットストリーム制御部132は、通信が正常に終了した際にも、その旨をエラー状態制御部134に通知する。また、ビットストリーム制御部132は、受信が完了した時には受信完了を示すEOF信号を、送信が完了した時には送信完了を示すEOF信号を送信タイミング制御部140に出力する。さらに、ビットストリーム制御部132は、受信したフレーム(受信フレーム)をメッセージハンドラ150に転送すると共に、メッセージハンドラ150からのフレーム(送信フレーム)を、トランシーバ122を介してCANバス110に送出する。なお、ビットストリーム制御部132がフレームをCANバス110に送出するタイミングは、送信タイミング制御部140により制御される。
The bit
メッセージハンドラ150は、ビットストリーム制御部132とメッセージバッファ152間に接続され、ビットストリーム制御部132から転送された受信フレームをメッセージバッファ152における受信バッファ154に格納させ、送信バッファ156に格納された未送信の送信フレームをCANコントローラ130に出力する。受信バッファ154に格納された受信フレームは、ローカルバス128を介して後にCPU124と周辺チップ126に供される。また、送信バッファ156に格納された未送信の送信フレームは、ローカルバス128を介してCPU124または周辺チップ126から受け取ったものである。
The
エラー状態制御部134は、ビットストリーム制御部132から受信した信号に基づいて受信エラーカウンタ136と送信エラーカウンタ138のカウントアップまたはカウントダウンを制御する。具体的には、ビットストリーム制御部132から受信エラーの通知信号を受信すると、受信エラーカウンタ136にインクリメントさせる信号を出力し、送信エラーの通知を受信すると、送信エラーカウンタ138にインクリメントさせる信号を出力する。また、ビットストリーム制御部132から受信が正常に終了した信号を受信すると、受信エラーカウンタ136にデクリメントさせる信号を出力し、送信が正常に終了した信号を受信すると、送信エラーカウンタ138にデクリメントさせる信号を出力する。
The error
さらに、エラー状態制御部134は、受信エラーカウンタ136のカウント値RECと送信エラーカウンタ138のカウント値TECに基づいてノード120のエラー状態を管理する。具体的には、図11に示すようにRECとTECに基づいてノード120のエラー状態を、エラーアクティブ状態、エラーパッシブ状態、バスオフ状態間で遷移させる。
Further, the error
エラー状態制御部134は、ノード120の現在のエラー状態を示す信号(エラー状態通知信号)を送信タイミング制御部140に通知する。また、受信エラーカウンタ136も、現在のRECを送信タイミング制御部140に通知する。
The error
送信タイミング制御部140は、ノード120から、具体的にはCANコントローラ130からCANバス110に送信するタイミングの制御をするものであり、この制御は、ビットストリーム制御部132からのEOF信号、エラー状態制御部134からのエラー状態通知信号と、受信エラーカウンタ136からのRECとに基づく。
The transmission
図8は、送信タイミング制御部140の構成例を示す。送信タイミング制御部140は、送信タイミングタイマ141と、サスペンドトランスミッション用タイマ142と、比較器143と、反転入力付きORゲート144と、セレクタ145を備える。
FIG. 8 shows a configuration example of the transmission
送信タイミングタイマ141は、エラー状態通知信号と、CANコントローラ130から正常送信が終了したことを示すEOF信号(以下送信EOFという)と、他のノードが送信したフレームの受信完了を示すEOF信号(以下受信EOF)とを入力とし、エラー状態通知信号が示すエラー状態に応じて、CANプロトコルで規定された送信タイミングを発生する。具体的には、エラーアクティブ状態において、送信EOFまたは受信EOFを受信すると計時を開始し、3ビットの第1の間隔に達したときに、第1のタイミング信号T1をセレクタ145に出力する。すなわち、このとき、連続送信と非連続送信のいずれの場合においても、第1のタイミング信号T1により示される最小送信間隔は3ビットである。
また、エラーパッシブ状態においては、第1のタイミング信号T1により示される最小送信間隔は、非連続送信時時には3ビットであり、連続送信時には第2の間隔の11ビットである。
The
In the error passive state, the minimum transmission interval indicated by the first timing signal T1 is 3 bits at the time of non-continuous transmission and 11 bits at the second interval at the time of continuous transmission.
サスペンドトランスミッション用タイマ142は、送信EOFと受信EOFのいずれかを受信すると計時を開始し、第3の間隔に達したときに、第2のタイミング信号T2をセレクタ145に出力する。なお、本実施の形態において、第3の間隔は第2の間隔と同長の11ビットである。
すなわち、連続送信と非連続送信のいずれの場合においても、第2のタイミング信号T2により示される最小送信間隔は、11ビットである。
The suspend
That is, in any case of continuous transmission and non-continuous transmission, the minimum transmission interval indicated by the second timing signal T2 is 11 bits.
セレクタ145は、反転入力付きORゲートの出力Sに基づいて、第1のタイミング信号T1と第2のタイミング信号T2のいずれかを送信タイミング信号Tとして選択してビットストリーム制御部132に出力する。具体的には、反転入力付きORゲート144の出力SがHighであるときには、第1のタイミング信号T1を選択し、反転入力付きORゲートの出力SがLowであるときには、第2のタイミング信号T2を選択する。
The
反転入力付きORゲート144には、エラー状態制御部134からのエラー状態通知信号が入力されると共に、比較器143の出力S1が反転されて入力される。本実施の形態において、エラー状態通知信号は、ノード120がエラーアクティブ状態にあるときにはLowであり、ノード120がエラーパッシブ状態にあるときにはHighである。
The error state notification signal from the error
比較器143は、受信エラーカウンタ136のカウント値RECと、予め設定された、エラーパッシブ状態に遷移する閾値「127」より小さい閾値(たとえば120)とを比較し、比較結果を示す信号S1を出力する。比較器143の出力S1は、RECが閾値より小さいときにはLowであり、RECが閾値以上になったときにはHighである。
The
送信タイミング制御部140の作用をまとめて説明する。
ノード120がエラーパッシブ状態にある場合、比較器143の出力S1に関わらず、反転入力付きORゲート144の出力SがHighになる。そのため、送信タイミング信号Tとして第1のタイミング信号T1が選択される。これにより、連続送信時の最小間隔が11ビットになり、非連続送信時の最小送信間隔が3ビットになる。
ノード120がエラーアクティブ状態にあり、RECが閾値より小さいために比較器143の出力S1がLowである場合、反転入力付きORゲート144の出力SがHighになる。そのため、送信タイミング信号Tとして第1のタイミング信号T1が選択される。これにより、連続送信と非連続送信のいずれの場合においても、最小送信間隔が3ビットになる。
一方、ノード120がエラーアクティブ状態にあり、RECが閾値以上になったために比較器143の出力S1がHighである場合、反転入力付きORゲート144の出力SがLowになる。そのため、送信タイミング信号Tとして第2のタイミング信号T2が選択される。これにより、連続送信と非連続送信のいずれの場合においても、最小送信間隔は11ビットになる。
The operation of the transmission
When the
When the
On the other hand, when the
こうすることにより、エラーアクティブ状態のときに、RECが閾値を超えたら、該ノード120の最小送信間隔が、エラーパッシブ状態のノードに対して規定された最小送信間隔と同一になる。そのため、CANシステム100において、バスオフリスクが高まったエラーパッシブ状態のノードがあれば、そのノードは、優先順位による調停に基づく送信ができる。したがって、そのノードは、外乱によりバスオフリスクが高まったのであれば、バスオフリスクを軽減するチャンスを得ることができると共に、自身の故障によりバスオフリスクが高まったのであれば、早くバスオフに遷移することができる。
By doing so, if the REC exceeds a threshold value in the error active state, the minimum transmission interval of the
以上、実施の形態をもとに本発明を説明した。実施の形態は例示であり、本発明の主旨から逸脱しない限り、さまざまな変更、増減を加えてもよい。これらの変更、増減が加えられた変形例も本発明の範囲にあることは当業者に理解されるところである。 The present invention has been described above based on the embodiment. The embodiment is an exemplification, and various changes and increases / decreases may be added without departing from the gist of the present invention. It will be understood by those skilled in the art that modifications to which these changes and increases / decreases are also within the scope of the present invention.
10 CANシステム 12 ノード
14 CANバス 16 ワイヤ
18 ワイヤ 100 CANシステム
110 CANバス 120 ノード
122 トランシーバ 124 CPU
126 周辺チップ 128 ローカルバス
130 CANコントローラ 132 ビットストリーム制御部
134 エラー状態制御部 136 受信エラーカウンタ
138 送信エラーカウンタ 140 送信タイミング制御部
141 送信タイミングタイマ 143 サスペンドトランスミッション用タイマ
143 比較器 144 反転入力付きORゲート
145 セレクタ 150 メッセージハンドラ
152 メッセージバッファ 154 受信バッファ
156 送信バッファ S1 比較器143の出力
S2 エラー状態信号 S 反転入力付きORゲート144の出力
T 送信タイミング信号 T1 第1のタイミング信号
T2 第2のタイミング信号
10
126
Claims (13)
受信エラーカウンタと、
送信エラーカウンタと、
前記受信エラーカウンタと前記送信エラーカウンタのカウント値を判定条件に、現在のエラー状態が継続するか、現在のエラー状態から他のエラー状態に遷移するかの制御を行うエラー状態制御部と、
現在のエラー状態が前記複数のエラー状態に含まれたエラーアクティブ状態であり、かつ、前記判定条件が、エラーアクティブ状態が継続するように前記エラー状態制御部に制御させるものである際に、前記受信エラーカウンタのカウント値が所定値以上になったことを条件に、最小送信間隔が、エラーアクティブ状態に対して規定された最小送信間隔の長さより長い所定長になるように送信間隔を制御する送信間隔制御部とを備えることを特徴とする通信装置。 A communication device connected to a CAN (Controller Area Network) bus and capable of transitioning between a plurality of error states,
A reception error counter,
A transmission error counter,
An error state control unit that controls whether the current error state continues or transitions from the current error state to another error state based on the count values of the reception error counter and the transmission error counter as determination conditions;
When the current error state is an error active state included in the plurality of error states, and the determination condition is to cause the error state control unit to control the error active state to continue, the The transmission interval is controlled so that the minimum transmission interval becomes a predetermined length longer than the minimum transmission interval defined for the error active state on condition that the count value of the reception error counter becomes equal to or greater than the predetermined value. A communication apparatus comprising: a transmission interval control unit.
複数のエラー状態間で遷移しうる各前記通信装置は、
受信エラーカウンタと、
送信エラーカウンタと、
前記受信エラーカウンタと前記送信エラーカウンタのカウント値を判定条件に、現在のエラー状態が継続するか、現在のエラー状態から他のエラー状態に遷移するかの制御を行うエラー状態制御部と、
現在のエラー状態が前記複数のエラー状態に含まれたエラーアクティブ状態であり、かつ、前記判定条件が、エラーアクティブ状態が継続するように前記エラー状態制御部に制御させるものである際に、前記受信エラーカウンタのカウント値が所定値以上になったことを条件に、最小送信間隔が、エラーアクティブ状態に対して規定された最小送信間隔の長さより長い所定長になるように送信間隔を制御する送信間隔制御部とを備えることを特徴とする通信システム。 In a communication system in which a plurality of communication devices are connected by a CAN (Controller Area Network) bus,
Each of the communication devices that can transition between a plurality of error states,
A reception error counter,
A transmission error counter,
An error state control unit that controls whether the current error state continues or transitions from the current error state to another error state based on the count values of the reception error counter and the transmission error counter as determination conditions;
When the current error state is an error active state included in the plurality of error states, and the determination condition is to cause the error state control unit to control the error active state to continue, the The transmission interval is controlled so that the minimum transmission interval becomes a predetermined length longer than the minimum transmission interval defined for the error active state on condition that the count value of the reception error counter becomes equal to or greater than the predetermined value. A communication system comprising a transmission interval control unit.
該通信装置に備えられた受信エラーカウンタと送信エラーカウンタのカウント値を判定条件に、現在のエラー状態が継続するか、現在のエラー状態から他のエラー状態に遷移するかの制御を行うエラー状態制御工程と、
現在のエラー状態が前記複数のエラー状態に含まれたエラーアクティブ状態であり、かつ、前記判定条件が、エラーアクティブ状態が継続するように前記エラー状態制御工程に制御させるものである際に、前記受信エラーカウンタのカウント値が所定値以上になったことを条件に、最小送信間隔が、エラーアクティブ状態に対して規定された最小送信間隔の長さより長い所定長になるように送信間隔を制御する送信間隔制御工程とを備えることを特徴とする通信方法。 For a communication device connected to a CAN (Controller Area Network) bus and capable of transitioning between a plurality of error states,
An error state that controls whether the current error state continues or transitions from the current error state to another error state based on the count values of the reception error counter and the transmission error counter provided in the communication device Control process;
When the current error state is an error active state included in the plurality of error states, and the determination condition is to cause the error state control step to control the error active state to continue, The transmission interval is controlled so that the minimum transmission interval becomes a predetermined length longer than the minimum transmission interval defined for the error active state on condition that the count value of the reception error counter becomes equal to or greater than the predetermined value. A communication method comprising: a transmission interval control step.
受信エラーの発生回数をカウントする受信エラーカウンタとを備え、
前記送信エラーカウンタまたは受信エラーカウンタのカウント値が第1基準値よりも大きい値を示す場合に、CAN(Controller Area Network)バスに流れるフレームが他ノードから出力されたものであるときには、該フレームの送信が終了した時点から第1期間の経過後に自ノードからフレーム送信を開始し、CANバスに流れるフレームが自ノードから出力されたものであるときには、該フレームの送信が終了した時点から前記第1期間よりも長い第2期間の経過後に自ノードからのフレーム送信を開始するCANノードであって、
前記送信カウンタのカウント値が前記第1基準値以下であり、前記受信カウンタのカウント値が前記第1基準値以下、前記第1基準値よりも小さい第2基準値以上の値を示す場合には、CANバスに流れるフレームの送信が終了した時点から前記第1期間よりも長い期間である第3期間の経過後に自ノードからのフレーム送信を開始することを特徴とするCANノード。 A transmission error counter that counts the number of occurrences of transmission errors;
A reception error counter that counts the number of occurrences of reception errors,
When the count value of the transmission error counter or the reception error counter indicates a value larger than the first reference value, if the frame flowing on the CAN (Controller Area Network) bus is output from another node, The frame transmission is started from the own node after the elapse of the first period from the end of transmission, and when the frame flowing in the CAN bus is output from the own node, the first frame is transmitted from the end of transmission of the frame. A CAN node that starts frame transmission from its own node after the elapse of a second period longer than the period,
When the count value of the transmission counter is less than or equal to the first reference value, and the count value of the reception counter is less than or equal to the first reference value and is greater than or equal to a second reference value that is smaller than the first reference value A CAN node which starts frame transmission from its own node after a lapse of a third period, which is a period longer than the first period from the end of transmission of a frame flowing on the CAN bus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008245340A JP2010081152A (en) | 2008-09-25 | 2008-09-25 | Communication device, communication system, communication method, and can node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008245340A JP2010081152A (en) | 2008-09-25 | 2008-09-25 | Communication device, communication system, communication method, and can node |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010081152A true JP2010081152A (en) | 2010-04-08 |
Family
ID=42211122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008245340A Pending JP2010081152A (en) | 2008-09-25 | 2008-09-25 | Communication device, communication system, communication method, and can node |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010081152A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012020761A1 (en) * | 2010-08-09 | 2012-02-16 | 国立大学法人名古屋大学 | Communication system and communication apparatus |
US9843523B2 (en) | 2012-05-14 | 2017-12-12 | Toyota Jidosha Kabushiki Kaisha | Communication management apparatus and communication management method for vehicle network |
JP2018074257A (en) * | 2016-10-25 | 2018-05-10 | トヨタ自動車株式会社 | On-vehicle network system and communication control method in on-vehicle network system |
JPWO2021014995A1 (en) * | 2019-07-19 | 2021-01-28 | ||
JP2021034828A (en) * | 2019-08-21 | 2021-03-01 | トヨタ自動車株式会社 | Communication device and protocol switching method |
WO2021116921A1 (en) * | 2019-12-09 | 2021-06-17 | Thales Canada Inc. | Method and system for high integrity can bus traffic supervision in safety critical application |
KR20220129364A (en) * | 2021-03-16 | 2022-09-23 | 한성대학교 산학협력단 | Bus off detection method and electronic control unit performing the same |
-
2008
- 2008-09-25 JP JP2008245340A patent/JP2010081152A/en active Pending
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012020761A1 (en) * | 2010-08-09 | 2012-02-16 | 国立大学法人名古屋大学 | Communication system and communication apparatus |
JP2012039446A (en) * | 2010-08-09 | 2012-02-23 | Nagoya Univ | Communication system and communication apparatus |
CN103155492A (en) * | 2010-08-09 | 2013-06-12 | 国立大学法人名古屋大学 | Communication system and communication apparatus |
CN103155492B (en) * | 2010-08-09 | 2015-11-25 | 国立大学法人名古屋大学 | Communication system and communicator |
US9209942B2 (en) | 2010-08-09 | 2015-12-08 | National University Corporation Nagoya University | Communication system and communication apparatus |
US9843523B2 (en) | 2012-05-14 | 2017-12-12 | Toyota Jidosha Kabushiki Kaisha | Communication management apparatus and communication management method for vehicle network |
JP2018074257A (en) * | 2016-10-25 | 2018-05-10 | トヨタ自動車株式会社 | On-vehicle network system and communication control method in on-vehicle network system |
WO2021014995A1 (en) * | 2019-07-19 | 2021-01-28 | 日立オートモティブシステムズ株式会社 | Gateway device, data frame transmission method, and program |
JPWO2021014995A1 (en) * | 2019-07-19 | 2021-01-28 | ||
JP7189349B2 (en) | 2019-07-19 | 2022-12-13 | 日立Astemo株式会社 | Gateway device, data frame transmission method and program |
JP2021034828A (en) * | 2019-08-21 | 2021-03-01 | トヨタ自動車株式会社 | Communication device and protocol switching method |
JP7207231B2 (en) | 2019-08-21 | 2023-01-18 | トヨタ自動車株式会社 | Communication device and protocol switching method |
WO2021116921A1 (en) * | 2019-12-09 | 2021-06-17 | Thales Canada Inc. | Method and system for high integrity can bus traffic supervision in safety critical application |
US11422962B2 (en) | 2019-12-09 | 2022-08-23 | Thales Canada Inc. | Method and system for high integrity can bus traffic supervision in safety critical application |
KR20220129364A (en) * | 2021-03-16 | 2022-09-23 | 한성대학교 산학협력단 | Bus off detection method and electronic control unit performing the same |
KR102610234B1 (en) | 2021-03-16 | 2023-12-06 | 한성대학교 산학협력단 | Bus off detection method and electronic control unit performing the same |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10693905B2 (en) | Invalidity detection electronic control unit, in-vehicle network system, and communication method | |
JP2010081152A (en) | Communication device, communication system, communication method, and can node | |
JP5919205B2 (en) | Network device and data transmission / reception system | |
JP2006287738A (en) | Network system | |
JP5308802B2 (en) | CAN node | |
EP2439878B1 (en) | Method and system for network congestion management | |
WO2010079538A1 (en) | Data transmission device | |
JP5486131B2 (en) | Method and apparatus for data transmission with variable bit length | |
JP2009161148A (en) | Fault location detecting device, communication device, and fault location detecting method | |
JP4594124B2 (en) | Communication system and communication method | |
JP2001119416A (en) | Communication controller and communication method | |
JP6455220B2 (en) | Communications system | |
JP2018174451A (en) | Communication system, bus load monitoring device, and bus load monitoring method | |
JP5018396B2 (en) | Communication apparatus and communication system | |
JP2007195040A (en) | Node abnormality determination method | |
JP2010141819A (en) | Communication device, communication method, and communication program | |
JP6477438B2 (en) | Communication apparatus and communication system | |
JP2018137637A (en) | Communication network and communication terminal | |
JP2006319381A (en) | Method for transmitting urgent message | |
JP6365876B2 (en) | node | |
JP6866317B2 (en) | Electronics, message sending methods and programs | |
JP4884490B2 (en) | Communication system and communication method | |
JP4086839B2 (en) | Network communication system and failure detection notification method | |
JP2010056716A (en) | Interface device and topology construction method | |
JP2008022079A (en) | Communication network system and notice method of reception diagnostic result |