JP6757182B2 - Vehicle electronic control unit and timer diagnostic method - Google Patents

Vehicle electronic control unit and timer diagnostic method Download PDF

Info

Publication number
JP6757182B2
JP6757182B2 JP2016110901A JP2016110901A JP6757182B2 JP 6757182 B2 JP6757182 B2 JP 6757182B2 JP 2016110901 A JP2016110901 A JP 2016110901A JP 2016110901 A JP2016110901 A JP 2016110901A JP 6757182 B2 JP6757182 B2 JP 6757182B2
Authority
JP
Japan
Prior art keywords
timer
pulse signal
reference pulse
cycle
edge detection
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
JP2016110901A
Other languages
Japanese (ja)
Other versions
JP2017214912A (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.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Automotive Systems 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 Hitachi Automotive Systems Ltd filed Critical Hitachi Automotive Systems Ltd
Priority to JP2016110901A priority Critical patent/JP6757182B2/en
Publication of JP2017214912A publication Critical patent/JP2017214912A/en
Application granted granted Critical
Publication of JP6757182B2 publication Critical patent/JP6757182B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Electrical Control Of Air Or Fuel Supplied To Internal-Combustion Engine (AREA)
  • Combined Controls Of Internal Combustion Engines (AREA)
  • Safety Devices In Control Systems (AREA)

Description

本発明は、車両用電子制御装置及びタイマ診断方法に関し、詳しくは、複数のタイマを備えた車両用電子制御装置においてタイマの異常の有無を検出するための技術に関する。 The present invention relates to an electronic control unit for a vehicle and a timer diagnosis method, and more particularly to a technique for detecting the presence or absence of an abnormality in an electronic control device for a vehicle including a plurality of timers.

特許文献1には、マイコンの外部の監視回路に所定周期のパルス信号を発生するパルス信号発生源を設け、マイコン側で前記パルス信号の周期を計測し、計測された周期が所定範囲外となったときにタイマ機能の異常を診断する、車両用電子制御システムの故障検出装置が開示されている。 In Patent Document 1, a pulse signal generation source for generating a pulse signal having a predetermined cycle is provided in a monitoring circuit outside the microcomputer, the cycle of the pulse signal is measured on the microcomputer side, and the measured cycle is out of the predetermined range. A failure detection device for an electronic control system for a vehicle that diagnoses an abnormality in the timer function at that time is disclosed.

特開2002−089336号公報Japanese Unexamined Patent Publication No. 2002-089336

ところで、外部から入力したパルス信号の周期計測を行う機能などを有する複数のタイマを備えたマイクロコンピュータを含む車両用電子制御装置において、外部から入力した基準パルス信号の周期計測を複数のタイマそれぞれで行わせ、係る周期計測値が基準パルス信号の設定周期に一致するか否かを検出することで、それぞれのタイマが正常であるか否かを検出することが可能である。
しかし、各タイマで基準パルス信号の周期計測を行わせるためには、マイクロコンピュータの複数の入力端子を、基準パルス信号を入力するために割り当てる必要が生じ、これによって、診断時には制御用として割り当てることができる入力端子が減り、車両の制御機能が損なわれる可能性があった。
By the way, in an electronic control device for a vehicle including a microcomputer equipped with a plurality of timers having a function of measuring the cycle of a pulse signal input from the outside, the cycle measurement of a reference pulse signal input from the outside is performed by each of the plurality of timers. It is possible to detect whether or not each timer is normal by detecting whether or not the cycle measurement value corresponds to the set cycle of the reference pulse signal.
However, in order for each timer to measure the period of the reference pulse signal, it is necessary to allocate a plurality of input terminals of the microcomputer for inputting the reference pulse signal, so that the reference pulse signal is assigned for control at the time of diagnosis. There was a possibility that the number of input terminals that could be used was reduced and the control function of the vehicle was impaired.

本発明は上記問題点に鑑みなされたものであり、複数のタイマを有するマイクロコンピュータを含む車両用電子制御装置において、制御用として割り当てることができる入力端子(ハードウェア資源)がタイマ診断時に減ることを抑制しつつ、複数のタイマそれぞれについて異常の有無を診断できる、車両用電子制御装置及びタイマ診断方法を提供することを目的とする。 The present invention has been made in view of the above problems, and in an electronic control unit for a vehicle including a microcomputer having a plurality of timers, the number of input terminals (hardware resources) that can be assigned for control is reduced at the time of timer diagnosis. It is an object of the present invention to provide an electronic control unit for a vehicle and a timer diagnosis method capable of diagnosing the presence or absence of an abnormality in each of a plurality of timers while suppressing the above.

そのため、本願発明に係る車両用電子制御装置は、第1タイマ及び第2タイマを有するマイクロコンピュータを含む車両用電子制御装置であって、前記第1タイマ及び前記第2タイマは、基準クロックの入力数を計数するタイマカウンタと、外部からのパルス信号のエッジを検出するエッジ検出回路と、前記エッジの入力に応じてタイマカウンタの値をエッジ検出時刻の情報として取り込むキャプチャレジスタとを含み、前記マイクロコンピュータは、外部からの基準パルス信号を前記第1タイマのエッジ検出回路に入力させ、前記基準パルス信号のエッジ検出時刻の情報を前記第1タイマのキャプチャレジスタに格納させ、定周期処理にて、前記第1タイマのキャプチャレジスタに格納されている前記基準パルス信号のエッジ検出時刻の情報を取り込んで前記基準パルス信号の周期を算出し、算出した周期が所定範囲に含まれるときに前記第1タイマが正常であると判定し、前記第1タイマが正常であると判定したとき、定周期処理にて前記第2タイマのタイマカウンタの値を取り込み、取り込んだ前記第2タイマのタイマカウンタの値が、前記第2タイマのタイマカウンタの値の取り込みを実施した定周期処理の実行周期に応じて変化しているか否かに基づき、前記第2タイマの異常の有無を判定する。 Therefore, the vehicle electronic control device according to the present invention is a vehicle electronic control device including a first timer and a microcomputer having a second timer, and the first timer and the second timer input a reference clock. The micro includes a timer counter that counts numbers, an edge detection circuit that detects the edge of a pulse signal from the outside, and a capture register that captures the value of the timer counter as edge detection time information in response to the input of the edge. The computer causes the edge detection circuit of the first timer to input a reference pulse signal from the outside, stores the edge detection time information of the reference pulse signal in the capture register of the first timer, and performs constant cycle processing. The edge detection time information of the reference pulse signal stored in the capture register of the first timer is taken in to calculate the cycle of the reference pulse signal, and when the calculated cycle is included in a predetermined range, the first timer Is normal, and when it is determined that the first timer is normal, the value of the timer counter of the second timer is taken in by the constant cycle processing, and the value of the timer counter of the second timer taken in is taken. It is determined whether or not there is an abnormality in the second timer based on whether or not the value of the timer counter of the second timer is changed according to the execution cycle of the fixed cycle processing in which the value is taken in.

また、本願発明に係る車両用電子制御装置のタイマ診断方法は、車両用電子制御装置を構成するマイクロコンピュータが備えるタイマを診断するタイマ診断方法であって、前記タイマは、第1タイマ及び第2タイマを含み、前記第1タイマ及び前記第2タイマは、基準クロックの入力数を計数するタイマカウンタと、外部からのパルス信号のエッジを検出するエッジ検出回路と、前記エッジの入力に応じてタイマカウンタの値をエッジ検出時刻の情報として取り込むキャプチャレジスタとを含み、外部からの基準パルス信号を前記第1タイマのエッジ検出回路に入力させて、前記基準パルス信号のエッジ検出時刻の情報を前記第1タイマのキャプチャレジスタに格納させるステップと、定周期処理にて、前記第1タイマのキャプチャレジスタに格納されている前記基準パルス信号のエッジ検出時刻の情報を取り込んで前記基準パルス信号の周期を算出するステップと、算出した周期が所定範囲に含まれるときに前記第1タイマが正常であると判定するステップと、前記第1タイマが正常であると判定したとき、定周期処理にて前記第2タイマのタイマカウンタの値を取り込むステップと、取り込んだ前記第2タイマのタイマカウンタの値が、前記第2タイマのタイマカウンタの値の取り込みを実施した定周期処理の実行周期に応じて変化しているか否かに基づき、前記第2タイマの異常の有無を判定するステップと、を含む。 Further, the timer diagnosis method of the vehicle electronic control device according to the present invention is a timer diagnosis method for diagnosing a timer included in a microcomputer constituting the vehicle electronic control device, and the timers are the first timer and the second timer. The first timer and the second timer include a timer, a timer counter that counts the number of inputs of a reference clock, an edge detection circuit that detects an edge of a pulse signal from the outside, and a timer according to the input of the edge. The capture register that captures the value of the counter as the edge detection time information is included, the reference pulse signal from the outside is input to the edge detection circuit of the first timer, and the edge detection time information of the reference pulse signal is input to the first timer. The cycle of the reference pulse signal is calculated by taking in the information of the edge detection time of the reference pulse signal stored in the capture register of the first timer in the step of storing in the capture register of one timer and the constant cycle processing. Steps to be performed, a step of determining that the first timer is normal when the calculated cycle is included in a predetermined range, and a step of determining that the first timer is normal, the second by a constant cycle process. The step of fetching the value of the timer counter of the timer and the value of the timer counter of the second timer that has been fetched change according to the execution cycle of the fixed cycle process in which the value of the timer counter of the second timer is fetched. A step of determining the presence or absence of an abnormality of the second timer based on whether or not the timer is present is included.

上記発明によると、制御用として割り当てることができる入力端子(ハードウェア資源)がタイマ診断時に減ることを抑制しつつ、複数のタイマそれぞれについて異常の有無を診断できる。 According to the above invention, it is possible to diagnose the presence or absence of an abnormality in each of a plurality of timers while suppressing the decrease of the input terminals (hardware resources) that can be allocated for control at the time of timer diagnosis.

本発明の実施形態における車両用電子制御装置の構成ブロック図である。It is a block diagram of the block of the electronic control unit for a vehicle in embodiment of this invention. 本発明の実施形態におけるハードウェアタイマの構成ブロック図である。It is a block diagram of the hardware timer in embodiment of this invention. 本発明の実施形態におけるタイマ診断処理の概要を示すフローチャートである。It is a flowchart which shows the outline of the timer diagnosis processing in embodiment of this invention. 本発明の実施形態における第1タイマの診断処理を示すフローチャートである。It is a flowchart which shows the diagnostic process of the 1st timer in embodiment of this invention. 本発明の実施形態における第2タイマの診断処理を示すフローチャートである。It is a flowchart which shows the diagnosis process of the 2nd timer in embodiment of this invention. 本発明の実施形態における時間周期TIとタイマ割込み周期との相関を示す図である。It is a figure which shows the correlation between the time period TI and the timer interrupt period in embodiment of this invention. 本発明の実施形態におけるタイマ異常発生時における時間周期TIとタイマ割込み周期との相関を示す図である。It is a figure which shows the correlation between the time cycle TI and the timer interrupt cycle at the time of occurrence of a timer abnormality in embodiment of this invention. 本発明の実施形態における第2タイマの診断処理を示すフローチャートである。It is a flowchart which shows the diagnosis process of the 2nd timer in embodiment of this invention.

以下に本発明の実施の形態を説明する。
図1は、本発明に係る車両用電子制御装置の一態様を示すブロック図である。
図1の車両用電子制御装置100は、各種センサからの信号を入力し、車両に搭載されるエンジンなどの制御対象に操作量を出力する装置である。
Embodiments of the present invention will be described below.
FIG. 1 is a block diagram showing an aspect of an electronic control unit for a vehicle according to the present invention.
The vehicle electronic control device 100 of FIG. 1 is a device that inputs signals from various sensors and outputs an operation amount to a controlled object such as an engine mounted on the vehicle.

車両用電子制御装置100は、マイクロコンピュータ(主マイコン)200と、監視回路300とを含んで構成される。
マイクロコンピュータ200は、CPU,RAM,ROM,インターフェースなどを含んで構成され、更に、各種センサなどの外部機器から入力端子213A−213Cに入力されるパルス信号の周期計測などに用いる複数のハードウェアタイマ210A−210Cを内蔵する。
The vehicle electronic control device 100 includes a microcomputer (main microcomputer) 200 and a monitoring circuit 300.
The microcomputer 200 is configured to include a CPU, RAM, ROM, an interface, etc., and further, a plurality of hardware timers used for periodic measurement of pulse signals input to input terminals 213A-213C from external devices such as various sensors. Built-in 210A-210C.

タイマ210A−210Cは、その一態様として、図2に示すような回路構成のものであり、内部又は外部の基準クロックの入力数を計数するタイマカウンタ211、タイマカウンタ211のカウント周期を調整するためにクロックを分周する分周器212、マイクロコンピュータ200の入力端子213A−213Cに入力される外部からのパルス信号のエッジ(立ち上がり及び/又は立ち下がり)を検出するエッジ検出回路214、外部からのエッジ入力に応じてタイマカウンタ211の値を取り込むキャプチャレジスタ215などを含んで構成される。 As one aspect of the timer 210A-210C, the circuit configuration is as shown in FIG. 2, and the timer counter 211 and the timer counter 211 for counting the number of inputs of the internal or external reference clock are adjusted. The frequency divider 212 that divides the clock to the outside, the edge detection circuit 214 that detects the edge (rising and / or falling) of the pulse signal from the outside input to the input terminals 213A-213C of the microcomputer 200, and the external It is configured to include a capture register 215 and the like that capture the value of the timer counter 211 according to the edge input.

マイクロコンピュータ200の外部回路である監視回路(ウォッチドッグタイマ)300は、マイクロコンピュータ200の監視機能を有するマイクロコンピュータ(副マイコン)又はICにより構成される。
監視回路300は、マイクロコンピュータ200がソフトウェア処理によって生成して出力するプログラムラン信号P-RUNを入力し、プログラムラン信号P-RUNが正常であるか否かをチェックし、プログラムラン信号P-RUNに異常が発生したときにマイクロコンピュータ200にリセット信号を出力する機能を有する。
The monitoring circuit (watchdog timer) 300, which is an external circuit of the microcomputer 200, is composed of a microcomputer (sub-microcomputer) or an IC having a monitoring function of the microcomputer 200.
The monitoring circuit 300 inputs the program run signal P-RUN generated and output by the microcomputer 200 by software processing, checks whether the program run signal P-RUN is normal, and checks whether the program run signal P-RUN is normal. It has a function of outputting a reset signal to the microcomputer 200 when an abnormality occurs in the program.

また、監視回路300は、予め決められた周期の基準パルス信号SPを発生するパルス信号発生源310を備え、このパルス信号発生源310が発生した基準パルス信号SPをマイクロコンピュータ200に出力する。
前記基準パルス信号SPは、マイクロコンピュータ200におけるタイマ機能の診断に用いられ、マイクロコンピュータ200は、タイマ210A−210Cの異常の有無を検出する機能(診断手段220)をソフトウェアとして備えている。
Further, the monitoring circuit 300 includes a pulse signal generation source 310 that generates a reference pulse signal SP having a predetermined period, and outputs the reference pulse signal SP generated by the pulse signal generation source 310 to the microcomputer 200.
The reference pulse signal SP is used for diagnosing a timer function in the microcomputer 200, and the microcomputer 200 includes a function (diagnosis means 220) for detecting the presence or absence of an abnormality in the timers 210A-210C as software.

以下では、マイクロコンピュータ200(診断手段220)によるタイマ機能の診断処理を詳細に説明する。
図3のフローチャートは、マイクロコンピュータ200(診断手段220)によるタイマ機能の診断処理の手順を概略的に示す図である。
Hereinafter, the diagnostic process of the timer function by the microcomputer 200 (diagnostic means 220) will be described in detail.
The flowchart of FIG. 3 is a diagram schematically showing a procedure of diagnostic processing of a timer function by a microcomputer 200 (diagnostic means 220).

マイクロコンピュータ200は、ステップS500で、第1タイマ210A(メインタイマ)の機能診断、つまり、第1タイマ210Aが正常であるか異常であるかを判別する処理を行う。
第1タイマ210Aの機能診断において、マイクロコンピュータ200は、第1タイマ210Aのエッジ検出回路に入力端子213Aを経由して基準パルス信号SPを入力させ、基準パルス信号SPのエッジ検出時刻の情報をキャプチャレジスタに格納させる。
In step S500, the microcomputer 200 performs a function diagnosis of the first timer 210A (main timer), that is, a process of determining whether the first timer 210A is normal or abnormal.
In the functional diagnosis of the first timer 210A, the microcomputer 200 causes the edge detection circuit of the first timer 210A to input the reference pulse signal SP via the input terminal 213A, and captures the information of the edge detection time of the reference pulse signal SP. Store in the register.

そして、マイクロコンピュータ200は、図示しないインターバルタイマにより起動される定周期処理(タイマ割込み処理)にて、第1タイマ210Aのキャプチャレジスタに格納されている基準パルス信号SPのエッジ検出時刻の情報を取り込んで、基準パルス信号SPの周期を算出し、係る第1タイマ210Aによる周期計測値と所定範囲(正常範囲)とを比較する。 Then, the microcomputer 200 takes in the information of the edge detection time of the reference pulse signal SP stored in the capture register of the first timer 210A by the fixed cycle processing (timer interrupt processing) activated by the interval timer (not shown). Then, the period of the reference pulse signal SP is calculated, and the period measurement value by the first timer 210A is compared with the predetermined range (normal range).

次いで、マイクロコンピュータ200は、ステップS600に進み、第1タイマ210Aによる基準パルス信号SPの周期計測値が所定範囲内であって第1タイマ210Aの正常状態が検出されたか否かを判別する。
第1タイマ210Aの正常状態であることを検出したとき、マイクロコンピュータ200は、ステップS700に進み、定周期処理にて第2タイマ210B及び第3タイマ210Cによる計測時刻を監視して、第2タイマ210B及び第3タイマ210Cの異常の有無を検出する。
Next, the microcomputer 200 proceeds to step S600 to determine whether or not the periodic measurement value of the reference pulse signal SP by the first timer 210A is within a predetermined range and the normal state of the first timer 210A is detected.
When it is detected that the first timer 210A is in the normal state, the microcomputer 200 proceeds to step S700, monitors the measurement time by the second timer 210B and the third timer 210C in a fixed cycle process, and monitors the measurement time by the second timer 210C. The presence or absence of abnormality in 210B and the third timer 210C is detected.

つまり、マイクロコンピュータ200は、第1タイマ210Aの機能診断においては、第1タイマ210Aで基準パルス信号SPの周期計測を行わせるが、他のタイマ210B,210Cについては、基準パルス信号SPの周期計測を行わせず(基準パルス信号SPを入力させず)、定周期処理の実行周期が保証されているものとして、係る定周期処理の実行周期と他のタイマ210B,210Cによる計測時刻との相関に基づき、第2タイマ210B及び第3タイマ210Cの異常の有無をそれぞれに検出する。 That is, in the functional diagnosis of the first timer 210A, the microcomputer 200 causes the first timer 210A to measure the cycle of the reference pulse signal SP, but for the other timers 210B and 210C, the cycle measurement of the reference pulse signal SP is performed. (Without inputting the reference pulse signal SP), assuming that the execution cycle of the constant cycle processing is guaranteed, the correlation between the execution cycle of the fixed cycle processing and the measurement time by the other timers 210B and 210C Based on this, the presence or absence of abnormality in the second timer 210B and the third timer 210C is detected respectively.

第1タイマ210Aによる基準パルス信号SPの周期計測値が正常値を示したということは、第1タイマ210Aの各構成回路(タイマカウンタ211、分周器212など)が正常であると共に基準クロックが正常であることになり、更に、定周期処理の実行周期は、監視回路300によるプログラムラン信号P-RUNの監視で保証されることになり、定周期処理の実行周期は設定周期に一致しているものと見做すことができる。
したがって、定周期処理の実行周期毎の第2タイマ210B,第3タイマ210Cによる計測時刻が、定周期処理の実行周期に対応して変化しない場合は、基準クロックは正常であるものの、第2タイマ210B,第3タイマ210Cを構成する回路のいずれかに異常が発生していることになる。
The fact that the periodic measurement value of the reference pulse signal SP by the first timer 210A shows a normal value means that each component circuit (timer counter 211, frequency divider 212, etc.) of the first timer 210A is normal and the reference clock is set. Furthermore, the execution cycle of the fixed cycle processing is guaranteed by monitoring the program run signal P-RUN by the monitoring circuit 300, and the execution cycle of the fixed cycle processing matches the set cycle. It can be regarded as being.
Therefore, if the measurement time by the second timer 210B and the third timer 210C for each execution cycle of the fixed cycle processing does not change corresponding to the execution cycle of the fixed cycle processing, the reference clock is normal, but the second timer An error has occurred in either the 210B or the circuit constituting the third timer 210C.

一方、第1タイマ210Aを用いた基準パルス信号SPの周期計測値が所定範囲外であって第1タイマ210Aの異常状態を検出したとき、マイクロコンピュータ200は、ステップS800に進み、第1タイマ210Aの異常を検知したときの異常時処理を実施する。
前記異常時処理として、マイクロコンピュータ200は、第1タイマ210Aの異常状態を示すフラグを立てるなどして第1タイマ210Aの異常状態を記憶保持する一方、第2タイマ210B及び第3タイマ210Cの機能診断を行うことができる。
On the other hand, when the periodic measurement value of the reference pulse signal SP using the first timer 210A is out of the predetermined range and an abnormal state of the first timer 210A is detected, the microcomputer 200 proceeds to step S800 and proceeds to the first timer 210A. When an abnormality is detected, the processing at the time of abnormality is executed.
As the error processing, the microcomputer 200 stores the abnormal state of the first timer 210A by setting a flag indicating the abnormal state of the first timer 210A, while the functions of the second timer 210B and the third timer 210C. Diagnosis can be made.

具体的には、第2タイマ210B及び第3タイマ210Cの診断において、マイクロコンピュータ200は、基準パルス信号SPを第2タイマ210Bに入力させて基準パルス信号SPの周期計測を行わせることで第2タイマ210Bの診断を行い、第2タイマ210Bによる周期計測値が所定範囲内である場合(第2タイマ210B及びクロックが正常である場合)、定周期処理にて第3タイマ210Cの計測時刻を監視して、第3タイマ210Cの異常の有無を検出する。
なお、定周期処理にて第2タイマ210B,第3タイマ210Cの計測時刻を監視して異常の有無を検出する診断処理については、後で詳細に説明する。
Specifically, in the diagnosis of the second timer 210B and the third timer 210C, the microcomputer 200 causes the second timer 210B to input the reference pulse signal SP to perform the periodic measurement of the reference pulse signal SP. When the timer 210B is diagnosed and the periodic measurement value by the second timer 210B is within the predetermined range (when the second timer 210B and the clock are normal), the measurement time of the third timer 210C is monitored by the constant cycle processing. Then, the presence or absence of an abnormality in the third timer 210C is detected.
The diagnostic process of monitoring the measurement time of the second timer 210B and the third timer 210C in the fixed cycle process to detect the presence or absence of an abnormality will be described in detail later.

一方、マイクロコンピュータ200は、第1タイマ210Aに続き、第2タイマ210Bについても周期計測値に基づき異常を検出すると、クロックの異常状態である可能性があるので、制御動作(制御出力)の停止などのフェイルセーフ動作を実施することができる。
また、第1タイマ210Aによる周期計測値が異常であったときの異常時処理として、マイクロコンピュータ200は、第2タイマ210B,第3タイマ210Cの診断を行うことなく、制御動作(制御出力)の停止、制御対象へのフェイルセーフ信号の出力、制御対象の電源リレーのオフ操作などのフェイルセーフ動作を実施することができる。
On the other hand, if the microcomputer 200 detects an abnormality in the second timer 210B following the first timer 210A based on the periodic measurement value, the clock may be in an abnormal state, so that the control operation (control output) is stopped. It is possible to carry out fail-safe operations such as.
Further, as an abnormality processing when the periodic measurement value by the first timer 210A is abnormal, the microcomputer 200 performs the control operation (control output) without diagnosing the second timer 210B and the third timer 210C. Fail-safe operations such as stopping, outputting a fail-safe signal to the controlled object, and turning off the power relay to be controlled can be performed.

更に、マイクロコンピュータ200は、第1タイマ210A及びクロックが正常であるときに、第2タイマ210B及び/又は第3タイマ210Cの異常を検出した場合は、異常検出したタイマ210B,210Cを使用する制御を禁止し、正常なタイマを用いた制御を継続させることができる。 Further, when the microcomputer 200 detects an abnormality of the second timer 210B and / or the third timer 210C when the first timer 210A and the clock are normal, the control using the timers 210B and 210C which have detected the abnormality is used. Can be prohibited and control using a normal timer can be continued.

ここで、ステップS500におけるマイクロコンピュータ200による第1タイマ210Aの診断処理を詳細に説明する。
マイクロコンピュータ200は、第1タイマ210Aの機能診断を実施するときに、第1タイマ210Aに基準パルス信号SPを入力させる。これにより、第1タイマ210Aは、基準パルス信号SPのエッジ入力時に、タイマカウンタ211の値(エッジ検出時刻)をキャプチャレジスタ215に格納し、その後、タイマカウンタ211をクリアする。
Here, the diagnostic process of the first timer 210A by the microcomputer 200 in step S500 will be described in detail.
The microcomputer 200 causes the first timer 210A to input the reference pulse signal SP when performing the functional diagnosis of the first timer 210A. As a result, the first timer 210A stores the value of the timer counter 211 (edge detection time) in the capture register 215 at the time of edge input of the reference pulse signal SP, and then clears the timer counter 211.

一方、マイクロコンピュータ200は、図4のフローチャートに示した定周期処理(タイマ割込み処理)で、第1タイマ210Aの診断を実行する。なお、図4のフローチャートに示した定周期処理は、図示しないインターバルタイマによって一定時間間隔で起動される。
マイクロコンピュータ200は、ステップS531で、第1タイマ210Aのキャプチャレジスタ215に格納されているタイマカウンタ211の値(エッジ検出時刻)を取得する。
On the other hand, the microcomputer 200 executes the diagnosis of the first timer 210A by the fixed cycle processing (timer interrupt processing) shown in the flowchart of FIG. The fixed-period processing shown in the flowchart of FIG. 4 is started at regular time intervals by an interval timer (not shown).
In step S531, the microcomputer 200 acquires the value (edge detection time) of the timer counter 211 stored in the capture register 215 of the first timer 210A.

ここで、タイマカウンタ211は、基準パルス信号SPのエッジ入力時にクリアされるから、クリア直前でのタイマカウンタ211の値は、前回のエッジ入力時から今回のエッジ入力時までの時間を表すことになる。換言すれば、第1タイマ210Aのキャプチャレジスタ215に格納されているタイマカウンタ211の値は、基準パルス信号SPの周期計測値TSPに相当することになる。 Here, since the timer counter 211 is cleared when the edge of the reference pulse signal SP is input, the value of the timer counter 211 immediately before clearing represents the time from the previous edge input to the current edge input. Become. In other words, the value of the timer counter 211 stored in the capture register 215 of the first timer 210A corresponds to the periodic measurement value TSP of the reference pulse signal SP.

次いで、マイクロコンピュータ200は、ステップS532に進み、第1タイマ210Aを用いて計測された周期計測値TSPが所定範囲内の値であるか否かを判別する。
なお、前記所定範囲は、既知である基準パルス信号SPの周期を含む範囲であって、分周設定などに因る計測ばらつきの許容範囲を規定する下限値TMIN(最小周期計測値)と上限値TMAX(最大周期計測値)とで挟まれる範囲である。
Next, the microcomputer 200 proceeds to step S532 and determines whether or not the periodic measurement value TSP measured by using the first timer 210A is within a predetermined range.
The predetermined range is a range including the period of the known reference pulse signal SP, and is a lower limit value TMIN (minimum period measurement value) and an upper limit value that define an allowable range of measurement variation due to a frequency division setting or the like. It is a range sandwiched between TMAX (maximum period measurement value).

つまり、前記所定範囲は、第1タイマ210A及び基準クロックが正常状態であるときに、基準パルス信号SPの周期計測値TSPが含まれる範囲であって、第1タイマ210A及び/又は基準クロックが異常状態になって周期計測値TSPが所定以上の誤差が発生したときに基準パルス信号SPの周期計測値TSPが外れる範囲である。
そして、マイクロコンピュータ200は、ステップS532で、TMIN≦TSP≦TMAXが成立しているか否かを判別する。
That is, the predetermined range is a range including the periodic measurement value TSP of the reference pulse signal SP when the first timer 210A and the reference clock are in the normal state, and the first timer 210A and / or the reference clock is abnormal. This is the range in which the periodic measurement value TSP of the reference pulse signal SP deviates when an error of a predetermined value or more occurs in the periodic measurement value TSP in the state.
Then, in step S532, the microcomputer 200 determines whether or not TMIN ≦ TSP ≦ TMAX is satisfied.

TMIN≦TSP≦TMAXが成立している場合、第1タイマ210Aは、基準パルス信号SPの周期を正しく計測したことになるので、マイクロコンピュータ200は、ステップS533に進み、第1タイマ210Aの異常状態の検出回数を計数するための異常検知カウンタCTを零にリセットし、次のステップS534では、第1タイマ210Aの正常状態を判定する。 When TMIN ≤ TSP ≤ TMAX is satisfied, the first timer 210A correctly measures the cycle of the reference pulse signal SP. Therefore, the microcomputer 200 proceeds to step S533 and proceeds to the abnormal state of the first timer 210A. The abnormality detection counter CT for counting the number of detections is reset to zero, and in the next step S534, the normal state of the first timer 210A is determined.

一方、TMIN>TSP又はTSP>TMAXが成立する場合、第1タイマ210Aは、基準パルス信号SPの周期を正しく計測できなかったことになるので、マイクロコンピュータ200は、ステップS535に進み、異常検知カウンタCTの値をインクリメントし、次のステップS536では、異常検知カウンタCTの値が閾値以上であるか否かを判別する。
異常検知カウンタCTの値が閾値未満であるときは、マイクロコンピュータ200は、ステップS534に進み、第1タイマ210Aの正常判定を維持する。
On the other hand, when TMIN> TSP or TSP> TMAX is established, the first timer 210A cannot correctly measure the cycle of the reference pulse signal SP, so that the microcomputer 200 proceeds to step S535 and the abnormality detection counter. The value of CT is incremented, and in the next step S536, it is determined whether or not the value of the abnormality detection counter CT is equal to or greater than the threshold value.
When the value of the abnormality detection counter CT is less than the threshold value, the microcomputer 200 proceeds to step S534 and maintains the normal determination of the first timer 210A.

一方、異常検知カウンタCTの値が閾値以上であるとき、マイクロコンピュータ200は、周期計測値TSPの異常が第1タイマ210A及び/又は基準クロックの異常に因って発生したものと見做し、ステップS537に進み、第1タイマ210Aの異常状態を判定する。
ここで、閾値≧2とすれば、マイクロコンピュータ200は、複数回連続して周期計測値TSPの異常を検知したときに第1タイマ210Aの異常を判定することになり、ノイズなどに因る一時的な周期計測値TSPの異常を第1タイマ210Aの異常として誤検出することを抑制できる。
On the other hand, when the value of the abnormality detection counter CT is equal to or higher than the threshold value, the microcomputer 200 considers that the abnormality of the periodic measurement value TSP is caused by the abnormality of the first timer 210A and / or the reference clock. The process proceeds to step S537, and the abnormal state of the first timer 210A is determined.
Here, if the threshold value is ≥2, the microcomputer 200 will determine the abnormality of the first timer 210A when it detects the abnormality of the periodic measurement value TSP a plurality of times in succession, and is temporarily caused by noise or the like. It is possible to suppress erroneous detection of an abnormality in the periodic measurement value TSP as an abnormality in the first timer 210A.

但し、閾値=1として、マイクロコンピュータ200は、周期計測値TSPの異常を検知したときに直ちに第1タイマ210Aの異常を判定することができる。
なお、図4のフローチャートに示した定周期処理の起動は、監視回路300によるプログラムラン信号P-RUNの監視などによって保証される。
However, with the threshold value = 1, the microcomputer 200 can immediately determine the abnormality of the first timer 210A when the abnormality of the periodic measurement value TSP is detected.
The activation of the constant cycle processing shown in the flowchart of FIG. 4 is guaranteed by monitoring the program run signal P-RUN by the monitoring circuit 300.

また、第1タイマ210Aのタイマカウンタ211がフリーランカウンタである場合、マイクロコンピュータ200は、基準パルス信号SPのエッジ検出に基づく割込み処理(外部割込み処理)で、第1タイマ210Aのキャプチャレジスタ215に格納されているタイマカウンタ211の値を取得し、前回の割込み処理で取得したタイマカウンタ211の値と、今回の割込み処理で取得したタイマカウンタ211の値との差として、基準パルス信号SPの周期計測値を求め、係る周期計測値と所定範囲とを比較して第1タイマ210Aの異常の有無を診断することができる。 When the timer counter 211 of the first timer 210A is a free-run counter, the microcomputer 200 performs interrupt processing (external interrupt processing) based on edge detection of the reference pulse signal SP to the capture register 215 of the first timer 210A. The value of the stored timer counter 211 is acquired, and the period of the reference pulse signal SP is used as the difference between the value of the timer counter 211 acquired in the previous interrupt processing and the value of the timer counter 211 acquired in the current interrupt processing. It is possible to obtain the measured value and compare the periodic measured value with the predetermined range to diagnose the presence or absence of an abnormality in the first timer 210A.

次に、図4のフローチャートのステップS700における第2タイマ210Bの異常診断の手順を、図5のフローチャートにしたがって説明する。
図5のフローチャートに示すルーチンは、インターバルタイマによって一定時間間隔で起動される定周期処理(タイマ割込み処理)である。
Next, the procedure for diagnosing the abnormality of the second timer 210B in step S700 of the flowchart of FIG. 4 will be described according to the flowchart of FIG.
The routine shown in the flowchart of FIG. 5 is a fixed cycle process (timer interrupt process) that is started at regular time intervals by an interval timer.

マイクロコンピュータ200は、ステップS711で、本ルーチンの前回の実行時に読んだ第2タイマ210Bのタイマカウンタ211の値CL2N(第2タイマ210Bによる計測時刻)を前回値CL2Oにセットし、次のステップS712では、今回の割込み起動時点における第2タイマ210Bのタイマカウンタ211の値(第2タイマ210Bによる計測時刻)を読んで今回値CL2Nにセットする。
なお、マイクロコンピュータ200は、割込み処理プログラムの中でタイマカウンタ211の値をソフトウェア処理によって読み出すことができ、また、例えば、定周期処理の割込み要求パルスに基づきタイマカウンタ211の値をレジスタに格納させることができる。
In step S711, the microcomputer 200 sets the value CL2N (measured time by the second timer 210B) of the timer counter 211 of the second timer 210B read at the time of the previous execution of this routine to the previous value CL2O, and sets the value CL2N to the previous value CL2O. Then, the value of the timer counter 211 of the second timer 210B (measured time by the second timer 210B) at the time of this interrupt activation is read and set to the current value CL2N.
The microcomputer 200 can read the value of the timer counter 211 in the interrupt processing program by software processing, and for example, stores the value of the timer counter 211 in a register based on the interrupt request pulse of the constant cycle processing. be able to.

そして、次のステップS713で、マイクロコンピュータ200は、今回値CL2Nと前回値CL2Oとの差分を求めて、時間周期TI2にセットする。
ここで、図5のフローチャートに示すルーチンは定周期処理であり、基準クロックが正常でしかも定周期処理の実行周期が監視回路300によるプログラムラン信号P-RUNの監視で保証されているので、図5のフローチャートに示すルーチンの起動周期の正確性は保証される。つまり、図5のフローチャートに示すルーチンは、設定時間間隔で正確に割込み実行されているものと見なすことができる。
Then, in the next step S713, the microcomputer 200 obtains the difference between the current value CL2N and the previous value CL2O and sets it in the time cycle TI2.
Here, the routine shown in the flowchart of FIG. 5 is a constant cycle process, and the reference clock is normal and the execution cycle of the fixed cycle process is guaranteed by the monitoring of the program run signal P-RUN by the monitoring circuit 300. The accuracy of the activation cycle of the routine shown in the flowchart of 5 is guaranteed. That is, the routine shown in the flowchart of FIG. 5 can be regarded as being accurately interrupted at the set time interval.

したがって、第2タイマ210Bが正常であれば、第2タイマ210Bを用いて計測した時間周期TI2は、本ルーチンの割込み周期の設定値に相当する値になり(図6参照)、第2タイマ210Bを用いて計測した時間周期TI2が、本ルーチンの割込み周期の設定値に相当する値から許容される誤差以上にずれている場合は、第2タイマ210Bに何らかの異常が発生し、計時誤差が発生していることになる。
そこで、マイクロコンピュータ200は、次のステップS714で、第2タイマ210Bを用いて計測した時間周期TI2が所定範囲(第2の所定範囲)内であるか否かを判別する。
Therefore, if the second timer 210B is normal, the time cycle TI2 measured using the second timer 210B becomes a value corresponding to the set value of the interrupt cycle of this routine (see FIG. 6), and the second timer 210B If the time cycle TI2 measured using the above is deviated from the value corresponding to the interrupt cycle setting value of this routine by more than the allowable error, some abnormality occurs in the second timer 210B and a timing error occurs. You will be doing.
Therefore, in the next step S714, the microcomputer 200 determines whether or not the time cycle TI2 measured by using the second timer 210B is within the predetermined range (second predetermined range).

ステップS714における所定範囲とは、本ルーチンの割込み周期の設定値に相当する値を含み、分周設定などに因る計測ばらつきの許容範囲を規定する下限値TI2MIN(最小時間周期)と上限値TI2MAX(最大時間周期)とで挟まれる範囲である。
マイクロコンピュータ200は、ステップS714において、TI2MIN≦TI2≦TI2MAXが成立するか否かを判別する。換言すれば、マイクロコンピュータ200は、ステップS714にて、時間周期TI2と本ルーチンの割込み周期の設定値との差分が許容値以下であるか否かを判別する。
The predetermined range in step S714 includes a lower limit value TI2MIN (minimum time cycle) and an upper limit value TI2MAX that include a value corresponding to the set value of the interrupt cycle of this routine and define an allowable range of measurement variation due to the frequency division setting and the like. It is the range between (maximum time cycle) and.
In step S714, the microcomputer 200 determines whether or not TI2MIN ≦ TI2 ≦ TI2MAX is satisfied. In other words, in step S714, the microcomputer 200 determines whether or not the difference between the time cycle TI2 and the set value of the interrupt cycle of this routine is equal to or less than the allowable value.

ここで、TI2MIN≦TI2≦TI2MAXが成立する場合、第2タイマ210Bは、図5のフローチャートに示すルーチンの割込み周期(起動周期)を正しく計測したことになるので、マイクロコンピュータ200は、ステップS715に進み、第2タイマ210Bの異常状態の検出回数を計数するための異常検知カウンタCT2を零にリセットし、次のステップS716では、第2タイマ210Bの正常状態を判定する。 Here, when TI2MIN ≦ TI2 ≦ TI2MAX is satisfied, the second timer 210B correctly measures the interrupt cycle (startup cycle) of the routine shown in the flowchart of FIG. 5, so that the microcomputer 200 performs the step S715. The process proceeds, the abnormality detection counter CT2 for counting the number of detections of the abnormal state of the second timer 210B is reset to zero, and in the next step S716, the normal state of the second timer 210B is determined.

一方、TI2MIN>TI2又はTI2>TI2MAXが成立する場合、第2タイマ210Bは、図5のフローチャートに示すルーチンの割込み周期(起動周期)を誤って計測したことになるので、マイクロコンピュータ200は、ステップS717に進み、異常検知カウンタCT2の値をインクリメントし、次のステップS718では、異常検知カウンタCT2の値が閾値(閾値≧1)以上であるか否かを判別する。 On the other hand, when TI2MIN> TI2 or TI2> TI2MAX is established, the second timer 210B erroneously measures the interrupt cycle (startup cycle) of the routine shown in the flowchart of FIG. 5, so that the microcomputer 200 has stepped. The process proceeds to S717, the value of the abnormality detection counter CT2 is incremented, and in the next step S718, it is determined whether or not the value of the abnormality detection counter CT2 is equal to or greater than the threshold value (threshold value ≧ 1).

異常検知カウンタCT2の値が閾値未満であるときは、マイクロコンピュータ200は、ステップS716に進み、第2タイマ210Bの正常判定を維持する。
一方、異常検知カウンタCT2の値が閾値以上になったとき、マイクロコンピュータ200は、ステップS719に進み、第2タイマ210Bの異常状態を判定する。
When the value of the abnormality detection counter CT2 is less than the threshold value, the microcomputer 200 proceeds to step S716 and maintains the normal determination of the second timer 210B.
On the other hand, when the value of the abnormality detection counter CT2 becomes equal to or higher than the threshold value, the microcomputer 200 proceeds to step S719 and determines the abnormal state of the second timer 210B.

第2タイマ210Bの異常としては、分周器212による分周後のクロックの周期異常や、タイマカウンタ211のカウンタ動作の停止などがある。
そして、図7に示すように、分周後のクロックの周期が設定よりも短くなると時間周期TI2は割込み周期よりも長くなり、分周後のクロックの周期が設定よりも長くなると時間周期TI2は割込み周期よりも短くなり、更に、カウンタ動作が停止すると時間周期TI2≠0になって、いずれの場合もマイクロコンピュータ200は、第2タイマ210Bの異常を判定することになる。
Examples of the abnormality of the second timer 210B include an abnormality of the clock cycle after the frequency division by the frequency divider 212 and a stop of the counter operation of the timer counter 211.
Then, as shown in FIG. 7, when the clock cycle after division becomes shorter than the setting, the time cycle TI2 becomes longer than the interrupt period, and when the clock cycle after division becomes longer than the setting, the time cycle TI2 becomes longer. It becomes shorter than the interrupt cycle, and when the counter operation is stopped, the time cycle TI2 ≠ 0. In either case, the microcomputer 200 determines the abnormality of the second timer 210B.

次に、図3のフローチャートのステップS700における第3タイマ210Cの異常診断の手順を、図8のフローチャートにしたがって説明する。
図8のフローチャートに示すルーチンは、インターバルタイマによって一定時間間隔で起動される定周期処理(タイマ割込み処理)であり、図5のフローチャートに示した第2タイマ210Bの異常診断の手順と同様にして、第3タイマ210Cの異常診断を行う。
Next, the procedure for diagnosing the abnormality of the third timer 210C in step S700 of the flowchart of FIG. 3 will be described according to the flowchart of FIG.
The routine shown in the flowchart of FIG. 8 is a fixed cycle process (timer interrupt process) started at regular time intervals by an interval timer, and is the same as the procedure for diagnosing an abnormality of the second timer 210B shown in the flowchart of FIG. , Performs an abnormality diagnosis of the third timer 210C.

マイクロコンピュータ200は、ステップS751で、本ルーチンの前回の実行時に読んだ第3タイマ210Cのタイマカウンタ211の値CL3N(第3タイマ210Cによる計測時刻)を前回値CL3Oにセットし、次のステップS752では、今回の割込み起動時点における第3タイマ210Cのタイマカウンタ211の値(第3タイマ210Cによる計測時刻)を読んで今回値CL3Nにセットする。
そして、次のステップS753で、マイクロコンピュータ200は、今回値CL3Nと前回値CL3Oとの差分を、時間周期TI3にセットする。
In step S751, the microcomputer 200 sets the value CL3N (measured time by the third timer 210C) of the timer counter 211 of the third timer 210C read at the time of the previous execution of this routine to the previous value CL3O, and sets the value CL3N to the previous value CL3O. Then, the value of the timer counter 211 of the third timer 210C (measured time by the third timer 210C) at the time of this interrupt activation is read and set to the current value CL3N.
Then, in the next step S753, the microcomputer 200 sets the difference between the current value CL3N and the previous value CL3O in the time cycle TI3.

ここで、図8のフローチャートに示すルーチンは定周期処理であり、クロックが正常でしかも定周期処理の実行周期が監視回路300によるプログラムラン信号P-RUNの監視で保証されているので、図8のフローチャートに示すルーチンの起動周期の正確性は保証される。つまり、図8のフローチャートに示すルーチンは、設定時間間隔で正確に割込み実行されているものと見なすことができる。 Here, the routine shown in the flowchart of FIG. 8 is a constant cycle processing, and the clock is normal and the execution cycle of the fixed cycle processing is guaranteed by the monitoring of the program run signal P-RUN by the monitoring circuit 300. The accuracy of the activation cycle of the routine shown in the flowchart of is guaranteed. That is, the routine shown in the flowchart of FIG. 8 can be regarded as being accurately interrupted at the set time interval.

したがって、第3タイマ210Cが正常であれば、第3タイマ210Cを用いて計測した時間周期TI3は、本ルーチンの割込み周期の設定値に相当する値になり、第3タイマ210Cを用いて計測した時間周期TI3が、本ルーチンの割込み周期の設定値に相当する値から許容される誤差以上にずれている場合は、第3タイマ210Cに何らかの異常が発生し、計時誤差が発生していることになる。 Therefore, if the third timer 210C is normal, the time cycle TI3 measured using the third timer 210C becomes a value corresponding to the set value of the interrupt cycle of this routine, and is measured using the third timer 210C. If the time cycle TI3 deviates from the value corresponding to the interrupt cycle set value of this routine by more than the allowable error, it means that some abnormality has occurred in the third timer 210C and a timing error has occurred. Become.

そこで、マイクロコンピュータ200は、次のステップS754で、第3タイマ210Cを用いて計測した時間周期TI3が所定範囲内であるか否かを判別する。
ステップS754における所定範囲とは、本ルーチンの割込み周期の設定値に相当する値を含み、分周設定などに因る計測ばらつきの許容範囲を規定する下限値TI3MIN(最小時間周期)と上限値TI3MAX(最大時間周期)とで挟まれる範囲である。
Therefore, in the next step S754, the microcomputer 200 determines whether or not the time cycle TI3 measured by using the third timer 210C is within a predetermined range.
The predetermined range in step S754 includes a lower limit value TI3MIN (minimum time cycle) and an upper limit value TI3MAX that include a value corresponding to the set value of the interrupt cycle of this routine and define an allowable range of measurement variation due to the frequency division setting and the like. It is the range between (maximum time cycle) and.

マイクロコンピュータ200は、ステップS754において、TI3MIN≦TI3≦TI3MAXが成立するか否かを判別する。換言すれば、マイクロコンピュータ200は、ステップS754にて、時間周期TI3と本ルーチンの割込み周期の設定値との差分が許容値以下であるか否かを判別する。
ここで、TI3MIN≦TI3≦TI3MAXが成立する場合、第3タイマ210Cは、図8のフローチャートに示すルーチンの割込み周期(起動周期)を正しく計測したことになるので、マイクロコンピュータ200は、ステップS755に進み、第3タイマ210Cの異常状態の検出回数を計数するための異常検知カウンタCT3を零にリセットし、次のステップS756では、第3タイマ210Cの正常状態を判定する。
In step S754, the microcomputer 200 determines whether or not TI3MIN ≦ TI3 ≦ TI3MAX is satisfied. In other words, in step S754, the microcomputer 200 determines whether or not the difference between the time cycle TI3 and the set value of the interrupt cycle of this routine is equal to or less than the allowable value.
Here, when TI3MIN ≦ TI3 ≦ TI3MAX is satisfied, the third timer 210C correctly measures the interrupt cycle (startup cycle) of the routine shown in the flowchart of FIG. 8, so that the microcomputer 200 moves to step S755. The process proceeds, and the abnormality detection counter CT3 for counting the number of detections of the abnormal state of the third timer 210C is reset to zero, and in the next step S756, the normal state of the third timer 210C is determined.

一方、TI3MIN>TI3又はTI3>TI3MAXが成立する場合、第3タイマ210Cは、図8のフローチャートに示すルーチンの割込み周期(起動周期)を誤って計測したことになるので、マイクロコンピュータ200は、ステップS757に進み、異常検知カウンタCT3の値をインクリメントし、次のステップS758では、異常検知カウンタCT3の値が閾値(閾値≧1)以上であるか否かを判別する。 On the other hand, when TI3MIN> TI3 or TI3> TI3MAX is established, the third timer 210C erroneously measures the interrupt cycle (startup cycle) of the routine shown in the flowchart of FIG. 8, so that the microcomputer 200 has stepped. The process proceeds to S757, the value of the abnormality detection counter CT3 is incremented, and in the next step S758, it is determined whether or not the value of the abnormality detection counter CT3 is equal to or greater than the threshold value (threshold value ≧ 1).

異常検知カウンタCT3の値が閾値未満であるときは、マイクロコンピュータ200は、ステップS756に進み、第3タイマ210Cの正常判定を維持する。
一方、異常検知カウンタCT3の値が閾値以上になったとき、マイクロコンピュータ200は、ステップS759に進み、第3タイマ210Cの異常状態を判定する。
When the value of the abnormality detection counter CT3 is less than the threshold value, the microcomputer 200 proceeds to step S756 and maintains the normal determination of the third timer 210C.
On the other hand, when the value of the abnormality detection counter CT3 becomes equal to or higher than the threshold value, the microcomputer 200 proceeds to step S759 and determines the abnormal state of the third timer 210C.

上記で説明した第1タイマ210A−第3タイマ210Cの診断において、基準パルス信号SPを入力させて周期計測させるのは第1タイマ210Aに限定され、他の第2タイマ210B及び第3タイマ210Cについては、基準パルス信号SPの周期計測は行わず、診断中もセンサからのパルス信号の周期計測などを第2タイマ210B及び第3タイマ210Cで行わせることができる。 In the diagnosis of the first timer 210A-third timer 210C described above, the reference pulse signal SP is input and the period is measured only for the first timer 210A, and for the other second timer 210B and the third timer 210C. Does not measure the cycle of the reference pulse signal SP, and allows the second timer 210B and the third timer 210C to measure the cycle of the pulse signal from the sensor even during the diagnosis.

このため、タイマ210A−210Cの診断中に制御用として割り当てることができる入力端子が減ることを抑制でき、診断中における制御性の低下を抑制できる。
また、各タイマ210A−210Cの診断処理は、定周期処理(タイマ割込み)で実施されるから、診断処理に伴って外部割込み処理が発生してマイクロコンピュータ200の処理負荷が増えることを抑制できる。
Therefore, it is possible to suppress a decrease in the number of input terminals that can be assigned for control during the diagnosis of the timers 210A-210C, and it is possible to suppress a decrease in controllability during the diagnosis.
Further, since the diagnostic processing of each timer 210A-210C is performed by a fixed cycle process (timer interrupt), it is possible to suppress an increase in the processing load of the microcomputer 200 due to an external interrupt process generated in association with the diagnostic process.

以上、好ましい実施形態を参照して本発明の内容を具体的に説明したが、本発明の基本的技術思想及び教示に基づいて、当業者であれば種々の変形態様を採り得ることは自明である。
例えば、上記実施形態では、診断対象とするタイマが3個であるが、タイマの数は3個に限定されないことは明らかである。
Although the contents of the present invention have been specifically described with reference to the preferred embodiments, it is obvious that those skilled in the art can adopt various modifications based on the basic technical idea and teaching of the present invention. is there.
For example, in the above embodiment, the number of timers to be diagnosed is three, but it is clear that the number of timers is not limited to three.

また、診断対象とするタイマがn個(n≧3)以上であるときに、基準パルス信号SPの周期計測を行わせて診断するタイマの数を2個以上n個未満とすることができる。
また、基準パルス信号SPの周期計測を行わせて診断するタイマの数を2個以上とするときに、基準パルス信号SPの周期計測に基づき異常を検出したタイマが複数になったときに、定周期処理で計測時刻を監視しての他のタイマの異常診断をキャンセルし、基準パルス信号SPの周期計測に基づき異常を検出したタイマと正常を検出したタイマとがあるときに、定周期処理で計測時刻を監視しての他のタイマの異常診断を実施する構成とすることができる。
Further, when the number of timers to be diagnosed is n (n ≧ 3) or more, the number of timers to be diagnosed by performing periodic measurement of the reference pulse signal SP can be 2 or more and less than n.
In addition, when the number of timers diagnosed by performing periodic measurement of the reference pulse signal SP is two or more, it is fixed when there are a plurality of timers that detect an abnormality based on the periodic measurement of the reference pulse signal SP. When there is a timer that detects an abnormality based on the periodic measurement of the reference pulse signal SP and a timer that detects normality by monitoring the measurement time in the periodic processing and canceling the abnormality diagnosis of other timers, the fixed periodic processing is used. It can be configured to monitor the measurement time and perform an abnormality diagnosis of another timer.

ここで、上述した実施形態から把握し得る技術的思想について、以下に記載する。
車両用電子制御装置は、その一態様として、複数のタイマを有するマイクロコンピュータを含む車両用電子制御装置であって、前記マイクロコンピュータは、外部から入力した基準パルス信号の周期を前記複数のタイマのうちの一部を用いて計測し、周期計測値が所定範囲内であるときに、定周期処理にて他のタイマによる計測時刻を監視して前記他のタイマの異常の有無を検出する診断手段を備える。
Here, the technical ideas that can be grasped from the above-described embodiments will be described below.
The vehicle electronic control unit is, as one aspect, an electronic control unit for a vehicle including a microcomputer having a plurality of timers, and the microcomputer sets a period of a reference pulse signal input from the outside to the plurality of timers. A diagnostic means that measures using a part of them, and when the periodic measurement value is within a predetermined range, monitors the measurement time by another timer by constant periodic processing and detects the presence or absence of an abnormality in the other timer. To be equipped with.

前記車両用電子制御装置の好ましい態様において、前記診断手段は、定周期処理において前記他のタイマによる計測時刻を取得し、取得した計測時刻から定周期処理の時間間隔を求め、前記時間間隔が第2の所定範囲内であるときに前記他のタイマの正常状態を検出し、前記時間間隔が前記第2の所定範囲外であるときに前記他のタイマの異常状態を検出する。
別の好ましい態様では、前記複数のタイマは、外部から前記マイクロコンピュータの入力端子に入力されるパルス信号のエッジを検出するエッジ検出回路を含むハードウェアタイマである。
In a preferred embodiment of the vehicle electronic control unit, the diagnostic means acquires a measurement time by the other timer in the constant cycle processing, obtains a time interval of the fixed cycle processing from the acquired measurement time, and the time interval is the first. When it is within the predetermined range of 2, the normal state of the other timer is detected, and when the time interval is outside the second predetermined range, the abnormal state of the other timer is detected.
In another preferred embodiment, the plurality of timers are hardware timers including an edge detection circuit that detects an edge of a pulse signal input from the outside to the input terminal of the microcomputer.

また、車両用電子制御装置のタイマ診断方法は、車両用電子制御装置を構成する複数のタイマを備えたマイクロコンピュータにおいて、外部から入力した基準パルス信号の周期を前記複数のタイマのうちの一部を用いて計測するステップと、前記基準パルス信号の周期計測値が所定範囲内であるか否かを検出するステップと、前記基準パルス信号の周期計測値が所定範囲内であるときに、定周期処理にて他のタイマによる計測時刻を監視するステップと、前記計測時刻に基づき前記他のタイマの異常の有無を検出するステップと、を含む。 Further, in the timer diagnosis method of the electronic control device for vehicles, in a microcomputer provided with a plurality of timers constituting the electronic control device for vehicles, the period of a reference pulse signal input from the outside is set as a part of the plurality of timers. A step of measuring using the above, a step of detecting whether or not the periodic measurement value of the reference pulse signal is within a predetermined range, and a constant period when the periodic measurement value of the reference pulse signal is within a predetermined range. The process includes a step of monitoring the measurement time by another timer and a step of detecting the presence or absence of an abnormality of the other timer based on the measurement time.

前記タイマ診断方法の好ましい態様において、前記計測時刻を監視するステップは、定周期処理で前記他のタイマによる計測時刻を取得するステップと、前記取得した計測時刻について定周期処理の時間間隔を求めるステップと、を含む。
別の好ましい態様では、前記他のタイマの異常の有無を検出するステップは、前記時間間隔と第2の所定範囲とを比較するステップと、前記時間間隔が前記第2の所定範囲内であるときに前記他のタイマの正常状態を検出するステップと、前記時間間隔が前記第2の所定範囲外であるときに前記他のタイマの異常状態を検出するステップと、を含む。
In a preferred embodiment of the timer diagnosis method, the step of monitoring the measurement time is a step of acquiring the measurement time by the other timer in the fixed cycle processing and a step of obtaining the time interval of the fixed cycle processing for the acquired measurement time. And, including.
In another preferred embodiment, the step of detecting the presence or absence of abnormality of the other timer is a step of comparing the time interval with the second predetermined range and when the time interval is within the second predetermined range. Includes a step of detecting the normal state of the other timer and a step of detecting an abnormal state of the other timer when the time interval is outside the second predetermined range.

100…車両用電子制御装置、200…マイクロコンピュータ、210A…第1タイマ、210B…第2タイマ、210C…第3タイマ、211…タイマカウンタ、212…分周器、220…診断手段、300…監視回路、310…パルス信号発生源 100 ... Electronic control device for vehicles, 200 ... Microcomputer, 210A ... 1st timer, 210B ... 2nd timer, 210C ... 3rd timer, 211 ... Timer counter, 212 ... Divider, 220 ... Diagnostic means, 300 ... Monitoring Circuit, 310 ... Pulse signal source

Claims (6)

第1タイマ及び第2タイマを有するマイクロコンピュータを含む車両用電子制御装置であって、
前記第1タイマ及び前記第2タイマは、
基準クロックの入力数を計数するタイマカウンタと、外部からのパルス信号のエッジを検出するエッジ検出回路と、前記エッジの入力に応じてタイマカウンタの値をエッジ検出時刻の情報として取り込むキャプチャレジスタとを含み、
前記マイクロコンピュータは、
外部からの基準パルス信号を前記第1タイマのエッジ検出回路に入力させ、前記基準パルス信号のエッジ検出時刻の情報を前記第1タイマのキャプチャレジスタに格納させ、
定周期処理にて、前記第1タイマのキャプチャレジスタに格納されている前記基準パルス信号のエッジ検出時刻の情報を取り込んで前記基準パルス信号の周期を算出し、
算出した周期が所定範囲に含まれるときに前記第1タイマが正常であると判定し、
前記第1タイマが正常であると判定したとき、定周期処理にて前記第2タイマのタイマカウンタの値を取り込み、
取り込んだ前記第2タイマのタイマカウンタの値が、前記第2タイマのタイマカウンタの値の取り込みを実施した定周期処理の実行周期に応じて変化しているか否かに基づき、前記第2タイマの異常の有無を判定する
車両用電子制御装置。
An electronic control unit for a vehicle including a microcomputer having a first timer and a second timer.
The first timer and the second timer
A timer counter that counts the number of inputs of the reference clock, an edge detection circuit that detects the edge of the pulse signal from the outside, and a capture register that captures the value of the timer counter as edge detection time information according to the input of the edge. Including
The microcomputer
An external reference pulse signal is input to the edge detection circuit of the first timer, and information on the edge detection time of the reference pulse signal is stored in the capture register of the first timer.
In the constant cycle processing, the cycle of the reference pulse signal is calculated by taking in the information of the edge detection time of the reference pulse signal stored in the capture register of the first timer.
When the calculated cycle is included in the predetermined range, it is determined that the first timer is normal, and
When it is determined that the first timer is normal, the value of the timer counter of the second timer is taken in by the constant cycle processing.
Based on whether or not the value of the timer counter of the second timer that has been taken in changes according to the execution cycle of the fixed cycle processing in which the value of the timer counter of the second timer is taken in, the second timer Determine if there is an abnormality ,
Electronic control unit for vehicles.
請求項1記載の車両用電子制御装置であって、
前記マイクロコンピュータは、
前記第1タイマのキャプチャレジスタに格納された前記基準パルス信号のエッジ検出時刻の情報に基づき算出した前記基準パルス信号の周期が、前記所定範囲から外れるとき、前記第1タイマの異常を判定し、
前記第1タイマの異常を判定したとき、前記基準パルス信号を前記第2タイマのエッジ検出回路に入力させて、前記基準パルス信号のエッジ検出時刻の情報を前記第2タイマのキャプチャレジスタに格納させ、
定周期処理にて、前記第2タイマのキャプチャレジスタに格納されている前記基準パルス信号のエッジ検出時刻の情報を取り込んで前記基準パルス信号の周期を算出し、
算出した周期が前記所定範囲に含まれるときに前記第2タイマが正常であると判定し、
算出した周期が前記所定範囲から外れるときに前記第2タイマが異常であると判定する、
車両用電子制御装置。
The vehicle electronic control unit according to claim 1.
The microcomputer
When the period of the reference pulse signal calculated based on the edge detection time information of the reference pulse signal stored in the capture register of the first timer deviates from the predetermined range, an abnormality of the first timer is determined.
When the abnormality of the first timer is determined, the reference pulse signal is input to the edge detection circuit of the second timer, and the edge detection time information of the reference pulse signal is stored in the capture register of the second timer. ,
In the constant cycle processing, the cycle of the reference pulse signal is calculated by taking in the information of the edge detection time of the reference pulse signal stored in the capture register of the second timer.
When the calculated cycle is included in the predetermined range, it is determined that the second timer is normal, and
When the calculated cycle deviates from the predetermined range, it is determined that the second timer is abnormal.
Electronic control unit for vehicles.
請求項2記載の車両用電子制御装置であって、
前記マイクロコンピュータは、
前記第2タイマによる前記基準パルス信号のエッジ検出時刻の情報に基づき、前記第2タイマの異常を判定したときに、制御出力を停止する、
車両用電子制御装置。
The vehicle electronic control unit according to claim 2.
The microcomputer
The control output is stopped when an abnormality of the second timer is determined based on the information of the edge detection time of the reference pulse signal by the second timer.
Electronic control unit for vehicles.
車両用電子制御装置を構成するマイクロコンピュータが備えるタイマを診断するタイマ診断方法であって、
前記タイマは、第1タイマ及び第2タイマを含み、
前記第1タイマ及び前記第2タイマは、
基準クロックの入力数を計数するタイマカウンタと、外部からのパルス信号のエッジを検出するエッジ検出回路と、前記エッジの入力に応じてタイマカウンタの値をエッジ検出時刻の情報として取り込むキャプチャレジスタとを含み、
外部からの基準パルス信号を前記第1タイマのエッジ検出回路に入力させて、前記基準パルス信号のエッジ検出時刻の情報を前記第1タイマのキャプチャレジスタに格納させるステップと、
定周期処理にて、前記第1タイマのキャプチャレジスタに格納されている前記基準パルス信号のエッジ検出時刻の情報を取り込んで前記基準パルス信号の周期を算出するステップと、
算出した周期が所定範囲に含まれるときに前記第1タイマが正常であると判定するステップと、
前記第1タイマが正常であると判定したとき、定周期処理にて前記第2タイマのタイマカウンタの値を取り込むステップと、
取り込んだ前記第2タイマのタイマカウンタの値が、前記第2タイマのタイマカウンタの値の取り込みを実施した定周期処理の実行周期に応じて変化しているか否かに基づき、前記第2タイマの異常の有無を判定するステップと、
を含む、タイマ診断方法。
It is a timer diagnosis method for diagnosing a timer provided in a microcomputer that constitutes an electronic control unit for a vehicle .
The timer includes a first timer and a second timer.
The first timer and the second timer
A timer counter that counts the number of inputs of the reference clock, an edge detection circuit that detects the edge of the pulse signal from the outside, and a capture register that captures the value of the timer counter as edge detection time information according to the input of the edge. Including
A step of inputting an external reference pulse signal to the edge detection circuit of the first timer and storing information on the edge detection time of the reference pulse signal in the capture register of the first timer.
In the fixed cycle processing, a step of fetching the edge detection time information of the reference pulse signal stored in the capture register of the first timer and calculating the cycle of the reference pulse signal, and
A step of determining that the first timer is normal when the calculated cycle is included in the predetermined range, and
When it is determined that the first timer is normal, a step of fetching the value of the timer counter of the second timer in a fixed cycle process and
Based on whether or not the value of the timer counter of the second timer that has been taken in changes according to the execution cycle of the fixed cycle processing in which the value of the timer counter of the second timer is taken in, the second timer Steps to determine if there is an abnormality and
Timer diagnostic methods, including.
請求項4記載のタイマ診断方法であって、
前記第1タイマのキャプチャレジスタに格納された前記基準パルス信号のエッジ検出時刻の情報に基づき算出した前記基準パルス信号の周期が、前記所定範囲から外れるとき、前記第1タイマの異常を判定するステップと、
前記第1タイマの異常を判定したとき、前記基準パルス信号を前記第2タイマのエッジ検出回路に入力させて、前記基準パルス信号のエッジ検出時刻の情報を前記第2タイマのキャプチャレジスタに格納させるステップと、
定周期処理にて、前記第2タイマのキャプチャレジスタに格納されている前記基準パルス信号のエッジ検出時刻の情報を取り込んで前記基準パルス信号の周期を算出するステップと、
算出した周期が前記所定範囲に含まれるときに前記第2タイマが正常であると判定するステップと、
算出した周期が前記所定範囲から外れるときに前記第2タイマが異常であると判定するステップと、
を更に含む、タイマ診断方法。
The timer diagnostic method according to claim 4.
A step of determining an abnormality of the first timer when the period of the reference pulse signal calculated based on the edge detection time information of the reference pulse signal stored in the capture register of the first timer deviates from the predetermined range. When,
When the abnormality of the first timer is determined, the reference pulse signal is input to the edge detection circuit of the second timer, and the edge detection time information of the reference pulse signal is stored in the capture register of the second timer. Steps and
In the fixed cycle processing, a step of taking in the edge detection time information of the reference pulse signal stored in the capture register of the second timer and calculating the cycle of the reference pulse signal, and
A step of determining that the second timer is normal when the calculated cycle is included in the predetermined range, and
A step of determining that the second timer is abnormal when the calculated cycle deviates from the predetermined range, and
A timer diagnostic method further comprising .
請求項5記載のタイマ診断方法であって、
前記第2タイマによる前記基準パルス信号のエッジ検出時刻の情報に基づき、前記第2タイマの異常を判定したときに、制御出力を停止するステップ、
を更に含む、タイマ診断方法。
The timer diagnostic method according to claim 5.
A step of stopping the control output when an abnormality of the second timer is determined based on the information of the edge detection time of the reference pulse signal by the second timer.
A timer diagnostic method further comprising.
JP2016110901A 2016-06-02 2016-06-02 Vehicle electronic control unit and timer diagnostic method Active JP6757182B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016110901A JP6757182B2 (en) 2016-06-02 2016-06-02 Vehicle electronic control unit and timer diagnostic method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016110901A JP6757182B2 (en) 2016-06-02 2016-06-02 Vehicle electronic control unit and timer diagnostic method

Publications (2)

Publication Number Publication Date
JP2017214912A JP2017214912A (en) 2017-12-07
JP6757182B2 true JP6757182B2 (en) 2020-09-16

Family

ID=60575504

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016110901A Active JP6757182B2 (en) 2016-06-02 2016-06-02 Vehicle electronic control unit and timer diagnostic method

Country Status (1)

Country Link
JP (1) JP6757182B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020195192A1 (en) * 2019-03-26 2020-10-01 日立オートモティブシステムズ株式会社 Electronic control device and diagnostic method for electronic control device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02297226A (en) * 1989-05-10 1990-12-07 Fujitsu Ltd Timer fault detecting system
JPH09204239A (en) * 1996-01-25 1997-08-05 Hitachi Ltd Digital processor
JP2002089336A (en) * 2000-09-19 2002-03-27 Nissan Motor Co Ltd Failure detection device for electronic control system of vehicle
JP2010113544A (en) * 2008-11-06 2010-05-20 Fujitsu Ten Ltd Timer value generation device and timer value generation method

Also Published As

Publication number Publication date
JP2017214912A (en) 2017-12-07

Similar Documents

Publication Publication Date Title
US7359776B2 (en) Apparatus for correcting and diagnosing angular rate sensors installed in an automotive vehicle
US6845468B2 (en) Aircraft fault monitoring system and method
JP4638916B2 (en) Method and apparatus for monitoring process execution
JP2013073414A (en) Sensor diagnostic device and sensor diagnostic method for plant
KR102667923B1 (en) Condition diagnosing method of diagnosing status of motor driven power steering system and electronic device thereof
JP6757182B2 (en) Vehicle electronic control unit and timer diagnostic method
US10775209B2 (en) Control circuit and method for checking the plausibility of a rotor position angle
JP5792667B2 (en) Sensor diagnostic device and sensor diagnostic method
JP5731141B2 (en) Analog signal input device
JPWO2018193508A1 (en) Failure diagnosis device and failure diagnosis method
JP6329648B2 (en) Failure detection device
JP2007026028A (en) Device for detecting abnormality in microcomputer
JP5299312B2 (en) Inertial force sensor device
JP4777875B2 (en) Method and device for detecting rotational speed, in particular vehicle wheel rotational speed
JP2019168835A (en) Electronic control device
WO2020204043A1 (en) Blast furnace abnormality assessment device, blast furnace abnormality assessment method, and blast furnace operation method
US20140058617A1 (en) Acceleration Detection Apparatus
JP2009003686A (en) Apparatus, method and program for analyzing software operation
JP3147054B2 (en) Microprocessor diagnostic device
JP2020007920A (en) Device and method for detecting abnormality of liquid pump
KR101605640B1 (en) Apparatus and method for prevention worng-diagnosis of cam position sensor
JPH04361330A (en) Diagnostic device for counter
JPH02276955A (en) Process analyzer
KR101519351B1 (en) Task execution diagnosis apparatus
JP6135483B2 (en) Sensor device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190520

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200407

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200608

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: 20200804

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200828

R150 Certificate of patent or registration of utility model

Ref document number: 6757182

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250