JP2020112104A - Internal combustion engine control device - Google Patents

Internal combustion engine control device Download PDF

Info

Publication number
JP2020112104A
JP2020112104A JP2019003702A JP2019003702A JP2020112104A JP 2020112104 A JP2020112104 A JP 2020112104A JP 2019003702 A JP2019003702 A JP 2019003702A JP 2019003702 A JP2019003702 A JP 2019003702A JP 2020112104 A JP2020112104 A JP 2020112104A
Authority
JP
Japan
Prior art keywords
edge
edges
crank
flag
acquisition
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.)
Granted
Application number
JP2019003702A
Other languages
Japanese (ja)
Other versions
JP7251151B2 (en
Inventor
裕理 堤
Yuri Tsutsumi
裕理 堤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2019003702A priority Critical patent/JP7251151B2/en
Priority to DE102019220373.6A priority patent/DE102019220373A1/en
Publication of JP2020112104A publication Critical patent/JP2020112104A/en
Application granted granted Critical
Publication of JP7251151B2 publication Critical patent/JP7251151B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F02COMBUSTION ENGINES; HOT-GAS OR COMBUSTION-PRODUCT ENGINE PLANTS
    • F02DCONTROLLING COMBUSTION ENGINES
    • F02D41/00Electrical control of supply of combustible mixture or its constituents
    • F02D41/009Electrical control of supply of combustible mixture or its constituents using means for generating position or synchronisation signals
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F02COMBUSTION ENGINES; HOT-GAS OR COMBUSTION-PRODUCT ENGINE PLANTS
    • F02DCONTROLLING COMBUSTION ENGINES
    • F02D41/00Electrical control of supply of combustible mixture or its constituents
    • F02D41/24Electrical control of supply of combustible mixture or its constituents characterised by the use of digital means
    • F02D41/26Electrical control of supply of combustible mixture or its constituents characterised by the use of digital means using computer, e.g. microprocessor
    • F02D41/28Interface circuits
    • F02D2041/281Interface circuits between sensors and control unit
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F02COMBUSTION ENGINES; HOT-GAS OR COMBUSTION-PRODUCT ENGINE PLANTS
    • F02DCONTROLLING COMBUSTION ENGINES
    • F02D2250/00Engine control related to specific problems or objectives
    • F02D2250/12Timing of calculation, i.e. specific timing aspects when calculation or updating of engine parameter is performed

Landscapes

  • Engineering & Computer Science (AREA)
  • Chemical & Material Sciences (AREA)
  • Combustion & Propulsion (AREA)
  • Mechanical Engineering (AREA)
  • General Engineering & Computer Science (AREA)
  • Combined Controls Of Internal Combustion Engines (AREA)

Abstract

To provide an internal combustion engine control device capable of suppressing the deviation of a crank angle even when switching a signal which is a generation source of an angle clock.SOLUTION: An engine ECU 1 includes an input switching unit 112, an acquisition unit 113, and a mask edge calculation unit 114. The acquisition unit 113 acquires an interrupt request flag and a change in the number of edges of a crank signal before the input switching unit 112 switches a signal that is a generation source of an angle clock. The mask edge calculation unit 114 corrects an increase amount of the number of edges according to the necessity of executing a crank interrupt processing, which is determined according to the interrupt request flag acquired by the acquisition unit 113 and the presence or absence of a change in the number of edges of the crank signal, and calculates the number of mask edges.SELECTED DRAWING: Figure 2

Description

本開示は、アングルクロックを生成する内燃機関制御装置に関する。 The present disclosure relates to an internal combustion engine control device that generates an angle clock.

特許文献1には、エンジンの制御に用いられる電子制御装置が開示されている。特許文献1の電子制御装置は、アングルクロック生成回路と、プロセッサとを有する。アングルクロック生成回路は、入力された信号のエッジ間隔を、プロセッサにより設定された生成倍率で逓倍して生成したアングルクロックを出力する。アングルクロック生成回路は、通常時にはクランク信号の入力を受け、クランク信号のエッジ間隔に基づいてアングルクロックを生成する。アングルクロック生成回路は、クランク信号の異常などの所定の状況において、クランク信号に代えてカム信号の入力を受け、カム信号のエッジ間隔に基づきアングルクロックを生成する。 Patent Document 1 discloses an electronic control device used for controlling an engine. The electronic control device of Patent Document 1 has an angle clock generation circuit and a processor. The angle clock generation circuit outputs the angle clock generated by multiplying the edge interval of the input signal by the generation rate set by the processor. The angle clock generation circuit normally receives a crank signal and generates an angle clock based on the edge interval of the crank signal. The angle clock generation circuit receives an input of a cam signal instead of the crank signal in a predetermined situation such as an abnormality of the crank signal, and generates an angle clock based on the edge interval of the cam signal.

プロセッサにおいて実行されるソフトウェアの処理には、クランク信号のエッジ発生に基づいて起動されるクランク割り込み処理が含まれる。クランク割り込み処理を起動したプロセッサは、エッジ数に基づく現在のクランク角の算出や、算出したクランク角に基づく各種の制御を実施する。 The software processing executed by the processor includes crank interrupt processing started based on the occurrence of an edge of the crank signal. The processor that has started the crank interrupt process calculates the current crank angle based on the number of edges and performs various controls based on the calculated crank angle.

特開2006−200484号公報Japanese Patent Laid-Open No. 2006-200484

こうした内燃機関制御装置においては、割り込み処理の実行頻度の抑制により、プロセッサの処理負荷を軽減する構成が採用される場合がある。具体的には、クランク信号を所定の分周比で分周した分周エッジの発生時のみ、プロセッサにクランク割り込み処理を起動させる構成が採用される。こうした構成では、各分周エッジの間に、クランク割り込み処理を起動させていないエッジ(以下、マスクエッジ)が所定数存在する。分周エッジにより起動されたクランク割り込み処理は、前回の分周エッジから今回の分周エッジまでに所定数のマスクエッジが発生していたとみなして、エッジ数に従うクランク角の算出やクランク角に同期した処理を実施する。 In such an internal combustion engine control device, a configuration may be adopted in which the processing load of the processor is reduced by suppressing the execution frequency of interrupt processing. Specifically, a configuration is adopted in which the processor activates the crank interrupt process only when a frequency division edge generated by dividing the crank signal by a predetermined frequency division ratio occurs. In such a configuration, a predetermined number of edges (hereinafter referred to as mask edges) for which the crank interrupt processing is not activated exist between each divided edge. The crank interrupt processing started by the frequency division edge is considered to have generated a predetermined number of mask edges from the previous frequency division edge to the current frequency division edge, and the crank angle is calculated according to the number of edges and synchronized with the crank angle. Perform the process.

上述の処理負荷を軽減する構成において特許文献1のようにアングルクロック生成部への入力をクランク信号からカム信号に切替えた場合、クランク割り込み処理は、分周エッジのみでの実行から、エッジごとの実行に変更される。この結果、切替え時において、クランク割り込み処理を起動したエッジとマスクエッジ数との関係が正しく維持されないおそれがある。従って、算出されるクランク角に、実際のクランク角に対するズレが生じえた。 When the input to the angle clock generator is switched from the crank signal to the cam signal as in Patent Document 1 in the configuration for reducing the processing load described above, the crank interrupt processing is executed only by the divided edge, Changed to run. As a result, at the time of switching, there is a possibility that the relationship between the edge that started the crank interrupt process and the number of mask edges may not be maintained correctly. Therefore, the calculated crank angle may deviate from the actual crank angle.

本開示は、アングルクロックの生成源となる信号を切替える場合においても、クランク角のズレを抑制可能な内燃機関制御装置の提供を目的とする。 An object of the present disclosure is to provide an internal combustion engine control device capable of suppressing a crank angle deviation even when switching a signal that is a generation source of an angle clock.

上記目的は独立請求項に記載の特徴の組み合わせにより達成され、また、下位請求項は、本開示の更なる有利な具体例を規定する。特許請求の範囲に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、本開示の技術的範囲を限定するものではない。 The above objective is achieved by a combination of features described in independent claims, and the subclaims define further advantageous embodiments of the present disclosure. The reference numerals in parentheses in the claims indicate the correspondence with the specific means described in the embodiments described later as one aspect, and do not limit the technical scope of the present disclosure. ..

上記目的を達成するための本開示の内燃機関制御装置は、入力された内燃機関からのクランク信号またはカム信号に基づいてアングルクロックを生成するアングルクロック生成部(141)と、内燃機関の現在のクランク角に基づく処理を行うクランク角処理部(111)と、アングルクロック生成部への入力をクランク信号からカム信号に切替えさせる入力切替部(112)と、クランク信号のエッジをカウントしたエッジ数を保持するエッジカウンタ(142)と、クランク信号のエッジに基づくフラグであって、クランク角処理部の起床を要求する割り込み要求フラグを保持するフラグレジスタ(161)と、切替部による入力切替期間に、フラグレジスタの保持状況と、エッジ数の変化とを取得する取得部(113)と、取得部の取得したフラグレジスタの保持状況と、エッジ数の変化とに基づいて、マスクエッジ数を算出するマスクエッジ算出部(114)と、を備える。 An internal combustion engine control device of the present disclosure for achieving the above object includes an angle clock generation unit (141) that generates an angle clock based on a crank signal or a cam signal that is input from an internal combustion engine, and a current internal combustion engine. The crank angle processing unit (111) that performs processing based on the crank angle, the input switching unit (112) that switches the input to the angle clock generation unit from the crank signal to the cam signal, and the number of edges counting the edges of the crank signal are displayed. An edge counter (142) that holds the flag, a flag register (161) that holds an interrupt request flag that is a flag based on the edge of the crank signal and that requests wake-up of the crank angle processing unit, and an input switching period by the switching unit, An acquisition unit (113) that acquires the holding status of the flag register and the change in the number of edges, and a mask that calculates the number of mask edges based on the holding status of the flag register and the change in the number of edges acquired by the acquiring unit. An edge calculation unit (114).

以上の構成によれば、エッジカウンタはエッジ数をカウントしており、フラグレジスタはエッジに基づくクランク角処理部を起床させる割り込み要求フラグを保持している。故にマスクエッジ算出部は、フラグレジスタの保持する割り込み要求フラグと、エッジ数の変化の有無とに従って、マスクエッジ数を算出可能となる。従って内燃機関制御装置は、アングルクロックの生成源となる信号を切替える場合においても、クランク角のズレを抑制可能となる。 According to the above configuration, the edge counter counts the number of edges, and the flag register holds the interrupt request flag for waking up the crank angle processing unit based on the edge. Therefore, the mask edge calculation unit can calculate the number of mask edges according to the interrupt request flag held by the flag register and the presence or absence of a change in the number of edges. Therefore, the internal combustion engine control device can suppress the deviation of the crank angle even when switching the signal that is the generation source of the angle clock.

エンジンECUの構成を示す図である。It is a figure which shows the structure of an engine ECU. マイコンの構成を示す図である。It is a figure which shows the structure of a microcomputer. 信号切替え処理を示すフローチャートである。It is a flowchart which shows a signal switching process. 図3のクランク信号設定サブルーチンを示すフローチャートである。4 is a flowchart showing a crank signal setting subroutine of FIG. 3. 割り込み処理とマスクエッジ数との対応例を示すタイミングチャートである。6 is a timing chart showing an example of correspondence between interrupt processing and the number of mask edges. 割り込み処理とマスクエッジ数との別の対応例を示すタイミングチャートである。7 is a timing chart showing another example of correspondence between interrupt processing and the number of mask edges. 割り込み処理とマスクエッジとの更に別の対応例を示すタイミングチャートである。It is a timing chart which shows another example of correspondence of interrupt processing and a mask edge. 第二実施形態のクランク信号設定サブルーチンを示すフローチャートである。It is a flow chart which shows a crank signal setting subroutine of a second embodiment. 第三実施形態のクランク信号設定サブルーチンを示すフローチャートである。It is a flow chart which shows a crank signal setting subroutine of a third embodiment. 第四実施形態のクランク信号設定サブルーチンを示すフローチャートである。It is a flowchart which shows the crank signal setting subroutine of 4th embodiment.

以下、本開示の複数の実施形態を図面に基づいて説明する。なお、各実施形態の説明において、対応する構成要素には同一番号の符号を付して重複する説明を省略する場合がある。構成の一部のみを説明している場合、構成の他の部分については先に説明した実施形態を適用できる。また、各実施形態の説明において明示している構成の組み合わせばかりでなく、特に組み合わせに支障が生じなければ、明示していなくても部分的に構成を組み合わせることも可能である。 Hereinafter, a plurality of embodiments of the present disclosure will be described with reference to the drawings. In the description of each embodiment, corresponding components may be denoted by the same reference numerals and redundant description may be omitted. When only a part of the configuration is described, the above-described embodiments can be applied to other parts of the configuration. Further, not only the combination of the configurations explicitly described in the description of each embodiment, but also the configuration may be partially combined even if it is not explicitly described unless the combination causes any trouble.

<第一実施形態>
図1に示す本開示の第一実施形態によるエンジンECU1は、例えば車両用のガソリンエンジンやディーゼルエンジンなどの内燃機関の制御に用いられる電子制御装置であり、「内燃機関制御装置」に相当する。エンジンECU1は、クランク軸センサ2やカム軸センサ3などからの検出信号に基づいてクランク軸の回転角(以下、クランク角)などの内燃機関の状態を逐次把握し、内燃機関を制御する。
<First embodiment>
The engine ECU 1 according to the first embodiment of the present disclosure shown in FIG. 1 is an electronic control device used for controlling an internal combustion engine such as a gasoline engine or a diesel engine for a vehicle, and corresponds to an “internal combustion engine control device”. The engine ECU 1 sequentially grasps the state of the internal combustion engine such as the rotation angle of the crankshaft (hereinafter referred to as crank angle) based on the detection signals from the crankshaft sensor 2 and the camshaft sensor 3, and controls the internal combustion engine.

クランク軸センサ2は、クランク角に応じて電圧レベルの変動するクランク信号をエンジンECU1に出力する。クランク軸センサ2は、例えば磁気センサであり、クランク軸4に設けられたクランクシグナルロータ5によるクランク角に応じた磁界強度の変動を検出する。クランクシグナルロータ5は、外周に所定の角度間隔で突出する歯を設けられた、クランク軸4と一体に回転する略円板状の磁性部材である。 The crankshaft sensor 2 outputs a crank signal whose voltage level varies according to the crank angle to the engine ECU 1. The crankshaft sensor 2 is, for example, a magnetic sensor, and detects a variation in magnetic field strength according to a crank angle by a crank signal rotor 5 provided on the crankshaft 4. The crank signal rotor 5 is a substantially disk-shaped magnetic member that is provided with teeth protruding on the outer periphery at predetermined angular intervals and that rotates integrally with the crankshaft 4.

クランク軸センサ2は、クランクシグナルロータ5の歯と対向する位置に設けられ、クランクシグナルロータ5の回転に伴う歯の通過によって生じる磁界強度の変動を検出する。クランクシグナルロータ5の歯は、例えば外周の一部を除いて10度ごとに設けられている。この結果、クランク信号の立ち上がりのエッジは、外周の一部を除いてクランク軸4の10度回転ごとの実質的に均等な角度間隔で発生する。 The crankshaft sensor 2 is provided at a position facing the teeth of the crank signal rotor 5, and detects a change in magnetic field strength caused by the passage of the teeth as the crank signal rotor 5 rotates. The teeth of the crank signal rotor 5 are provided every 10 degrees except for a part of the outer circumference, for example. As a result, the rising edges of the crank signal occur at substantially equal angular intervals every 10 degrees rotation of the crankshaft 4 except for a part of the outer circumference.

カム軸センサ3は、内燃機関のカム軸6の回転に応じて電圧レベルの変動するカム信号をエンジンECU1に出力する。カム軸センサ3は、例えばクランク軸センサ2と同様の磁気センサであり、カム軸6に設けられたカムシグナルロータ7の歯の通過による磁界強度の変動を検出する。カム軸6は、クランク軸4に対して半分の速度で回転しており、クランク軸4の二回転、すなわち内燃機関の一回の燃焼サイクルごとに一回転する。 The cam shaft sensor 3 outputs to the engine ECU 1 a cam signal whose voltage level varies according to the rotation of the cam shaft 6 of the internal combustion engine. The cam shaft sensor 3 is, for example, a magnetic sensor similar to the crank shaft sensor 2 and detects a change in magnetic field strength due to passage of teeth of a cam signal rotor 7 provided on the cam shaft 6. The camshaft 6 rotates at a speed half that of the crankshaft 4, and makes one rotation every two rotations of the crankshaft 4, that is, one combustion cycle of the internal combustion engine.

カムシグナルロータ7の歯は、均等でない角度の幅および間隔で設けられている。この結果、カム信号の立ち上がりおよび立ち下がりのエッジは、カム軸6の回転に従い均等でない角度間隔で発生する。なお、図1にはエンジンECU1に対する入力として一つのカム軸センサ3を示しているが、内燃機関のカム軸6の数や制御アルゴリズムなどに応じてカム軸センサ3の数は適宜変更可能である。 The teeth of the cam signal rotor 7 are provided with uneven angular widths and intervals. As a result, the rising and falling edges of the cam signal occur at uneven angular intervals as the cam shaft 6 rotates. Although one camshaft sensor 3 is shown as an input to the engine ECU 1 in FIG. 1, the number of camshaft sensors 3 can be appropriately changed according to the number of camshafts 6 of the internal combustion engine, a control algorithm, and the like. ..

エンジンECU1は、入力回路10、出力回路20、およびマイコン100を備えた電子制御装置である。入力回路10は、クランク軸センサ2およびカム軸センサ3から入力されるクランク信号およびカム信号をマイコン100に取り込むための回路である。入力回路10は、例えばクランク信号およびカム信号の波形を二値の矩形波状に整形してマイコン100に入力する。 The engine ECU 1 is an electronic control device that includes an input circuit 10, an output circuit 20, and a microcomputer 100. The input circuit 10 is a circuit for fetching the crank signal and the cam signal input from the crankshaft sensor 2 and the camshaft sensor 3 into the microcomputer 100. The input circuit 10 shapes, for example, the waveforms of the crank signal and the cam signal into a binary rectangular wave shape and inputs them to the microcomputer 100.

出力回路20は、マイコン100による判断に基づき、インジェクタやイグナイタなどのエンジンECU1の制御対象に対して駆動信号を出力する回路である。例えば出力回路は、マイコン100から制御対象ごとに駆動信号の出力指示を受け、対応する制御対象に駆動信号を出力する。 The output circuit 20 is a circuit that outputs a drive signal to a control target of the engine ECU 1, such as an injector or an igniter, based on the determination by the microcomputer 100. For example, the output circuit receives a drive signal output instruction for each control target from the microcomputer 100 and outputs the drive signal to the corresponding control target.

マイコン100は、図2に示すように、例えば半導体メモリなどの記憶部101と、CPUなどのプロセッサコア110を備えたマイクロコンピュータである。記憶部101は、プロセッサコア110で実行されるソフトウェアを非一時的に記録した非遷移的かつ実体的な記憶媒体に相当する。マイコン100は、タイマアレイユニット120および割り込みコントローラ160をはじめとする各種の周辺機能回路を、上述の記憶部101およびプロセッサコア110に加えて備えている。各種の周辺機能回路、記憶部101、およびプロセッサコア110は内部バスを介して相互に接続されている。プロセッサコア110は、記憶部101に記憶されたソフトウェアに定義されている各種の処理の実行により、周辺機能回路などと協働して内燃機関を制御するための各種の機能を実現する。 As shown in FIG. 2, the microcomputer 100 is a microcomputer including a storage unit 101 such as a semiconductor memory and a processor core 110 such as a CPU. The storage unit 101 corresponds to a non-transitional and substantive storage medium that non-temporarily records software executed by the processor core 110. The microcomputer 100 includes various peripheral function circuits including a timer array unit 120 and an interrupt controller 160, in addition to the storage unit 101 and the processor core 110 described above. The various peripheral function circuits, the storage unit 101, and the processor core 110 are connected to each other via an internal bus. The processor core 110 realizes various functions for controlling the internal combustion engine in cooperation with peripheral function circuits and the like by executing various kinds of processing defined by software stored in the storage unit 101.

タイマアレイユニット120は、多数の論理回路などにより構成された、各種のタイマ機能を提供する周辺機能回路である。タイマアレイユニット120は、エッジ検出タイマ130、アングルクロック生成タイマ140、および出力タイマ150を含んでいる。 The timer array unit 120 is a peripheral function circuit configured of a large number of logic circuits and the like and providing various timer functions. The timer array unit 120 includes an edge detection timer 130, an angle clock generation timer 140, and an output timer 150.

エッジ検出タイマ130は、マイコン100に入力されたクランク信号およびカム信号に生じたエッジを検出し、アングルクロック生成タイマ140に入力させるタイマである。エッジ検出タイマ130は、クランクエッジ検出部131、カムエッジ検出部132、およびチャネル選択部133を含む。 The edge detection timer 130 is a timer that detects an edge generated in the crank signal and the cam signal input to the microcomputer 100 and inputs the detected edge to the angle clock generation timer 140. The edge detection timer 130 includes a crank edge detection unit 131, a cam edge detection unit 132, and a channel selection unit 133.

クランクエッジ検出部131は、例えばシフトレジスタなどを含んで構成された、入力回路10からクランク信号の入力を受け付けるチャネルである。クランクエッジ検出部131は、クランク信号のエッジのうち、各立ち上がりエッジ、各立ち下がりエッジ、または各両エッジのいずれかを検出する。本実施形態のクランクエッジ検出部131は、立ち上がりエッジを検出し、立ち上がりエッジの検出の有無を示すクランクエッジ信号を出力する。クランクエッジ信号は、立ち上がりエッジが検出された場合に、電圧レベルを一時的に変更するパルス状の信号である。クランクエッジ信号のパルス幅、すなわち電圧レベルを一時的に変更される期間は、マイコン100の動作クロック一周期に相当する。 The crank edge detection unit 131 is a channel that is configured to include, for example, a shift register or the like, and that receives an input of a crank signal from the input circuit 10. The crank edge detection unit 131 detects any of the rising edges, the falling edges, or both edges of the crank signal edges. The crank edge detection unit 131 of the present embodiment detects a rising edge and outputs a crank edge signal indicating whether or not a rising edge has been detected. The crank edge signal is a pulsed signal that temporarily changes the voltage level when a rising edge is detected. The pulse width of the crank edge signal, that is, the period during which the voltage level is temporarily changed corresponds to one cycle of the operation clock of the microcomputer 100.

ここで、動作クロックの一周期は、内燃機関の最高回転数における立ち上がりエッジの間隔、すなわちクランク軸の10度回転に要する最短時間よりも十分に短い時間となるように設定されている。例えば一周期は、最短時間の数十分の一以下に設定されている。故に、クランクエッジ信号の各パルスは、クランク信号の立ち上がりエッジと一対一で対応する。従って、クランクエッジ信号のパルスの数は、クランク信号の立ち上がりエッジ数と一致する。クランクエッジ検出部131は、立ち上がりエッジを検出するたびに、割り込みコントローラ160に立ち上がりエッジの検出を通知する。 Here, one cycle of the operation clock is set to be sufficiently shorter than the interval between the rising edges at the maximum rotation speed of the internal combustion engine, that is, the shortest time required to rotate the crankshaft by 10 degrees. For example, one cycle is set to be less than a few tenths of the shortest time. Therefore, each pulse of the crank edge signal has a one-to-one correspondence with the rising edge of the crank signal. Therefore, the number of pulses of the crank edge signal matches the number of rising edges of the crank signal. The crank edge detection unit 131 notifies the interrupt controller 160 of the detection of the rising edge each time the rising edge is detected.

カムエッジ検出部132は、例えばシフトレジスタなどを含んで構成された、入力回路10からカム信号の入力を受け付けるチャネルである。カムエッジ検出部132は、例えばカム信号の立ち上がりエッジおよび立ち下がりエッジの両方を検出し、検出の有無を示すカムエッジ信号を出力する。カムエッジ信号は、立ち上がりまたは立ち下がりのエッジが検出された場合に電圧レベルを一時的に変更されるパルス状の信号である。カムエッジ信号のパルス幅は、クランク信号と同様に動作クロックの一周期に相当する。 The cam edge detection unit 132 is a channel configured to include a shift register or the like, for example, and receives a cam signal input from the input circuit 10. The cam edge detection unit 132 detects, for example, both a rising edge and a falling edge of the cam signal, and outputs a cam edge signal indicating the presence or absence of detection. The cam edge signal is a pulsed signal whose voltage level is temporarily changed when a rising or falling edge is detected. The pulse width of the cam edge signal corresponds to one cycle of the operation clock, like the crank signal.

チャネル選択部133は、例えばマルチプレクサなどを含んで構成された、アングルクロック生成タイマ140に入力する信号のチャネルを選択する回路である。チャネル選択部133は、プロセッサコア110からの選択信号に従って、選択するチャネルを切替える。すなわちチャネル選択部133は、プロセッサコア110からの指示に従い、クランクエッジ検出部131およびカムエッジ検出部132のうち、アングルクロック生成タイマ140に接続されて信号を入力させる回路を切替える。チャネル選択部133は、クランク信号が正常である場合には、クランク信号のチャネル、すなわちクランクエッジ検出部131を、アングルクロック生成タイマ140に対する入力として選択している。 The channel selection unit 133 is a circuit configured to include a multiplexer, for example, and selects a channel of a signal input to the angle clock generation timer 140. The channel selection unit 133 switches the channel to be selected according to the selection signal from the processor core 110. That is, the channel selection unit 133 switches a circuit of the crank edge detection unit 131 and the cam edge detection unit 132, which is connected to the angle clock generation timer 140 and inputs a signal, according to an instruction from the processor core 110. When the crank signal is normal, the channel selection unit 133 selects the crank signal channel, that is, the crank edge detection unit 131, as the input to the angle clock generation timer 140.

アングルクロック生成タイマ140は、アングルクロックを生成するためのタイマである。アングルクロックは、クランク信号の立ち上がりエッジ間隔よりも小さい間隔でクランク角の遷移を推定するための信号である。アングルクロックは、例えばクランク角の遷移を16分の1度の分解能で推定可能となるように設定されている。 The angle clock generation timer 140 is a timer for generating an angle clock. The angle clock is a signal for estimating the transition of the crank angle at intervals smaller than the rising edge interval of the crank signal. The angle clock is set so that the transition of the crank angle can be estimated with a resolution of 1/16 degree, for example.

具体的には、アングルクロックは、クランク角が一度変動したと推定されるごとに出力されるパルス状の信号であり、動作クロック一周期に相当するパルス幅で出力される。ただし、アングルクロックのパルスは、急加速に伴うパルス間隔の短縮を補正する場合に、前後のパルスと一体となり動作クロックの複数周期に相当するパルス幅となりうる。アングルクロック生成タイマ140は、アングルクロック生成部141、エッジカウンタ142、および分周コンペア部143を有する。 Specifically, the angle clock is a pulse-shaped signal that is output each time the crank angle is estimated to have changed once, and is output with a pulse width corresponding to one cycle of the operation clock. However, the pulse of the angle clock can be integrated with the preceding and succeeding pulses to have a pulse width corresponding to a plurality of cycles of the operation clock when correcting the shortening of the pulse interval due to the rapid acceleration. The angle clock generation timer 140 includes an angle clock generation unit 141, an edge counter 142, and a frequency division compare unit 143.

アングルクロック生成部141は、アングルクロック生成タイマ140への入力信号のパルス間隔を所定の生成倍率に従って逓倍することにより、アングルクロックを生成する回路である。生成倍率は、出力するアングルクロックの角度間隔に対する入力信号にパルスの生じる角度間隔の比を示す数値であり、プロセッサコア110からの指示に従って設定される。例えばアングルクロック生成部141にクランクエッジ信号が入力されている場合には、一部のクランク角範囲を除いて160倍が生成倍率として設定される。またアングルクロック生成部141にカムエッジ信号が入力されている場合には、パルス間隔ごとに個別の数値が生成倍率として設定される。例えば、あるパルス間隔がカム軸の30度回転分に相当する場合、すなわちクランク軸の60度回転分に相当する場合、そのパルス間隔に対して960倍が生成倍率として設定される。 The angle clock generation unit 141 is a circuit that generates an angle clock by multiplying the pulse interval of the input signal to the angle clock generation timer 140 according to a predetermined generation ratio. The generation rate is a numerical value indicating the ratio of the angular interval in which a pulse is generated in the input signal with respect to the angular interval of the output angle clock, and is set according to the instruction from the processor core 110. For example, when the crank edge signal is input to the angle clock generation unit 141, 160 times is set as the generation magnification except for a part of the crank angle range. When a cam edge signal is input to the angle clock generation unit 141, an individual numerical value is set as a generation rate for each pulse interval. For example, when a certain pulse interval corresponds to 30° rotation of the cam shaft, that is, corresponds to 60° rotation of the crankshaft, 960 times the pulse interval is set as the generation magnification.

アングルクロック生成部141は、入力信号のパルス間隔をパルス間に発生した動作クロック数としてカウントすることにより計測する。アングルクロック生成部141は、例えば入力信号にパルスが生じるたびに、次のパルス発生までの期間におけるアングルクロックのパルス間隔を更新する。パルス間隔には、直前のパルスからカウントされた動作クロック数を生成倍率で割った数値が設定される。アングルクロック生成部141は、例えば動作クロック数をカウントし、設定されたパルス間隔と一致するたびにアングルクロックのパルスを発生させてカウントをリセットする。 The angle clock generation unit 141 measures by counting the pulse interval of the input signal as the number of operation clocks generated between the pulses. The angle clock generation unit 141 updates the pulse interval of the angle clock in the period until the next pulse is generated, for example, every time a pulse occurs in the input signal. The pulse interval is set to a value obtained by dividing the number of operating clocks counted from the immediately preceding pulse by the generation rate. The angle clock generation unit 141 counts the number of operation clocks, for example, and generates a pulse of the angle clock and resets the count each time the set pulse interval matches.

エッジカウンタ142は、クランク信号のエッジ数を計測するカウンタである。エッジカウンタ142は、例えばクランクエッジ信号にパルスが生じる度にカウントアップすることにより、立ち上がりエッジの数を計測する。エッジカウンタ142でカウント可能な数の上限は、後述する分周比以上に設定されている。 The edge counter 142 is a counter that measures the number of edges of the crank signal. The edge counter 142 measures the number of rising edges by counting up each time a pulse is generated in the crank edge signal, for example. The upper limit of the number that can be counted by the edge counter 142 is set to be equal to or higher than the frequency division ratio described later.

分周コンペア部143は、クランク信号の立ち上がりエッジのうち、一部のエッジを分周エッジとして検出し、割り込みコントローラ160に通知するための回路である。換言すれば、分周コンペア部143は、分周エッジ以外のエッジを、割り込みコントローラ160に通知しないマスクエッジとする機能を発揮する。分周エッジは、例えば30度間隔となるように立ち上がりエッジの中から選択されている。 The frequency division compare unit 143 is a circuit for detecting a part of the rising edges of the crank signal as a frequency division edge and notifying it to the interrupt controller 160. In other words, the frequency division compare unit 143 exerts a function of using an edge other than the frequency division edge as a mask edge that does not notify the interrupt controller 160. The dividing edges are selected from the rising edges at intervals of 30 degrees, for example.

分周コンペア部143は、例えば次の分周エッジに相当するエッジ数を保持するレジスタを含む。分周コンペア部143は、エッジカウンタ142でカウントされているパルス数が、レジスタに保持されているエッジ数と一致すると、分周エッジの発生を割り込みコントローラ160に通知する。通知により実行された後述のクランク割り込み処理により、その次の分周エッジに相当するエッジ数がレジスタに新たに書き込まれる。新たに書き込まれるエッジ数は、一部のクランク角範囲を除いて、立ち上がりエッジの角度間隔に対する分周エッジの角度間隔の比(以下、分周比)を、書き換え前のエッジ数に加算した値となる。分周エッジの間には、分周比−1個のマスクエッジが存在する。 The frequency division compare unit 143 includes, for example, a register that holds the number of edges corresponding to the next frequency division edge. When the number of pulses counted by the edge counter 142 matches the number of edges held in the register, the frequency division compare unit 143 notifies the interrupt controller 160 of the generation of the frequency division edge. The number of edges corresponding to the next frequency division edge is newly written in the register by the crank interrupt processing described later executed by the notification. The number of newly written edges is the value obtained by adding the ratio of the angular interval of the dividing edge to the angular interval of the rising edge (hereinafter, the dividing ratio) to the number of edges before rewriting, except for some crank angle ranges. Becomes Between the dividing edges, there are mask edges with a dividing ratio of -1.

出力タイマ150は、出力回路20に対して駆動信号の出力を指示する機能を有するタイマである。出力タイマ150は、アングルカウンタおよび出力期間レジスタなどを含む。アングルカウンタは、現在のクランク角を推定した数値をカウントするためのカウンタである。アングルカウンタは、例えばアングルクロックのパルス発生ごとにカウントアップする。 The output timer 150 is a timer having a function of instructing the output circuit 20 to output a drive signal. The output timer 150 includes an angle counter and an output period register. The angle counter is a counter for counting the numerical value of the estimated current crank angle. The angle counter counts up each time a pulse of the angle clock is generated, for example.

出力期間レジスタは、出力期間、すなわち各制御対象に駆動信号を出力するクランク角の範囲を保持するためのレジスタである。出力期間レジスタは、プロセッサコア110により設定される駆動信号の出力の開始および終了タイミングを示す数値を保持する領域を制御対象ごとに有している。出力タイマ150は、アングルカウンタのカウント値が出力期間レジスタの保持する数値と一致すると、対応する駆動対象への駆動信号について出力の開始または停止を出力回路20に指示する。 The output period register is a register for holding an output period, that is, a crank angle range for outputting a drive signal to each control target. The output period register has, for each control target, an area for holding a numerical value indicating the start and end timings of the output of the drive signal set by the processor core 110. When the count value of the angle counter matches the value held by the output period register, the output timer 150 instructs the output circuit 20 to start or stop the output of the drive signal to the corresponding drive target.

こうしたタイマアレイユニット120の制御のため、プロセッサコア110の機能には、クランク角処理部111としての機能が含まれる。 Due to the control of the timer array unit 120, the function of the processor core 110 includes the function of the crank angle processing unit 111.

クランク角処理部111は、記憶部101に格納されたソフトウェアに含まれる処理のうち、クランク割り込み処理を実行中のプロセッサコア110により発揮される機能である。クランク割り込み処理は、割り込みコントローラ160からの割り込み要求に従って実施される割り込み処理の一種である。クランク割り込み処理は、クランク角の遷移に同期して、特定のクランク角となるたびに実施される。換言すれば、クランク角処理部111は、特定のクランク角となるたびに起床するプロセッサコア110の機能である。 The crank angle processing unit 111 is a function performed by the processor core 110 that is executing the crank interrupt process among the processes included in the software stored in the storage unit 101. The crank interrupt process is a type of interrupt process performed according to an interrupt request from the interrupt controller 160. The crank interrupt process is performed every time a specific crank angle is reached in synchronization with the transition of the crank angle. In other words, the crank angle processing unit 111 is a function of the processor core 110 that wakes up each time a specific crank angle is reached.

クランク割り込み処理は、クランク信号の立ち上がりエッジ発生に従って実行される。より具体的には、通常状態では、分周エッジの発生ごとに実行される。ただし、通常状態は、アングルクロック生成タイマ140への入力信号としてクランクエッジ信号が入力されている状態を意味する。アングルクロック生成タイマ140への入力信号としてカムエッジ信号が入力されている場合には、立ち上がりエッジの発生ごとに実施される。 The crank interrupt process is executed according to the occurrence of the rising edge of the crank signal. More specifically, in the normal state, it is executed every time a frequency division edge occurs. However, the normal state means a state in which the crank edge signal is input as the input signal to the angle clock generation timer 140. When the cam edge signal is input as the input signal to the angle clock generation timer 140, it is executed every time the rising edge is generated.

クランク割り込み処理は、実行されるたびに、前回の起動で算出したクランク角に、前回の実行からのクランク角の変化量を加算して現在のクランク角を算出する。クランク角の変化量は、前回の実行から今回の実行までにクランク信号に生じたエッジ数に従う。すなわち、前回の実行以降のエッジ数×10度が、前回の実行からのクランク角の変化量となる。 Each time the crank interrupt process is executed, the current crank angle is calculated by adding the amount of change in the crank angle from the previous execution to the crank angle calculated in the previous startup. The amount of change in the crank angle depends on the number of edges generated in the crank signal from the previous execution to the current execution. That is, the number of edges since the previous execution×10 degrees is the amount of change in the crank angle from the previous execution.

例えば通常状態では、クランク割り込み処理を実行させた分周エッジに加えて2つのマスクエッジが発生しているため、前回の実行からの3つのエッジが発生している。従ってクランク角処理部111は、実行されるたびに前回のクランク角に30度を加算してクランク角を算出する。 For example, in the normal state, two mask edges have occurred in addition to the frequency division edge for which the crank interrupt processing has been executed, so that three edges from the previous execution have occurred. Therefore, the crank angle processing unit 111 calculates the crank angle by adding 30 degrees to the previous crank angle each time it is executed.

アングルクロック生成タイマ140への入力信号がカムエッジ信号である場合には、割り込み処理を実行させたエッジ以外のエッジが発生していないため、前回の実行からのエッジ数が1となる。従ってクランク角処理部111は、実行されるたびに前回のクランク角に10度を加算してクランク角を算出する。 When the input signal to the angle clock generation timer 140 is the cam edge signal, no edge other than the edge for which the interrupt processing has been executed has occurred, so the number of edges from the previous execution is 1. Therefore, the crank angle processing unit 111 calculates the crank angle by adding 10 degrees to the previous crank angle each time it is executed.

またクランク角処理部111は、マスクエッジ数として特定の数値が算出されている場合には、算出されたマスクエッジ数に従って変化量を補正してクランク角を算出する。すなわちクランク角処理部111は、マスクエッジ数に1を加算した数×10度を、前回の実行からの変化量として算出する。従ってマスクエッジ数として特定の数値が算出されている場合の変化量は、大きいマスクエッジ数であるほど大きくなる。 Further, when a specific numerical value is calculated as the number of mask edges, the crank angle processing unit 111 corrects the amount of change according to the calculated number of mask edges and calculates the crank angle. That is, the crank angle processing unit 111 calculates the number obtained by adding 1 to the number of mask edges×10 degrees as the amount of change from the previous execution. Therefore, the change amount when a specific numerical value is calculated as the number of mask edges increases as the number of mask edges increases.

クランク割り込み処理は、現在のクランク角を算出すると、そのクランク角で実行する処理として対応付けられた処理の実行に移る。クランク角に対応付けられた処理、換言すればクランク角に同期して実行される処理には、例えば燃焼サイクルに合わせた燃料噴射処理などが含まれる。またクランク割り込み処理は、次の分周エッジに相当するエッジ数を分周コンペア部143のレジスタに書き込むことにより、次にクランク割り込み処理の実行されるクランク角を設定する処理を含む。 When the current crank angle is calculated, the crank interrupt process moves to execution of a process associated with the crank angle. The process associated with the crank angle, in other words, the process executed in synchronization with the crank angle includes, for example, a fuel injection process matched to the combustion cycle. The crank interrupt process includes a process of setting the crank angle at which the crank interrupt process is to be executed next by writing the number of edges corresponding to the next frequency division edge into the register of the frequency division compare unit 143.

割り込みコントローラ160は、プロセッサコア110で実行されるソフトウェアに設定されている各種の割り込み処理について、実行の可否や優先順などについて管理する機能を有する周辺機能回路である。割り込みコントローラ160は、マイコン100の内部および外部からの送信された割り込み要求を受信し、対応する割り込み処理をプロセッサコア110に実行させる。割り込みコントローラ160には、割り込み要求を受けた旨を保持するためのレジスタが各割り込み処理ごとに設けられている。 The interrupt controller 160 is a peripheral function circuit having a function of managing whether or not to execute various interrupt processes set in software executed by the processor core 110, the priority order, and the like. The interrupt controller 160 receives the interrupt request transmitted from the inside and outside of the microcomputer 100, and causes the processor core 110 to execute a corresponding interrupt process. The interrupt controller 160 is provided with a register for holding that an interrupt request has been received for each interrupt process.

割り込みコントローラ160には、クランク割り込み処理を実行させるための割り込みフラグを保持するフラグレジスタ161として、分周フラグレジスタ161aおよびエッジフラグレジスタ161bが設けられている。 The interrupt controller 160 is provided with a frequency division flag register 161a and an edge flag register 161b as flag registers 161 for holding interrupt flags for executing crank interrupt processing.

分周フラグレジスタ161aのフラグの切替え条件は、クランク信号の立ち上がりエッジのうち、分周エッジの発生ごとにクランク割り込み処理を実行させるように設定されている。分周フラグレジスタ161aは、例えば分周エッジが生じた場合に、割り込み要求があった旨を示すオンに設定される。分周フラグレジスタ161aは、フラグをクランク割り込み処理の実行に用いられた場合に、要求があった旨をクリアされ、オフに設定される。 The condition for switching the flag of the frequency division flag register 161a is set so that the crank interrupt process is executed every time the frequency division edge is generated among the rising edges of the crank signal. The frequency division flag register 161a is set to ON indicating that an interrupt request has been made, for example, when a frequency division edge occurs. The frequency division flag register 161a is cleared to have been requested and is set to OFF when the flag is used for executing the crank interrupt process.

分周フラグレジスタ161aによる割り込み要求は、アングルクロック生成タイマ140への入力信号がカムエッジ信号である場合には、無効な状態に切替えられる。すなわち分周フラグレジスタ161aは、割り込みフラグオンの状態となっている場合であっても、入力信号がカムエッジ信号の状態では、クランク割り込み処理の実行には用いられない。 The interrupt request by the frequency division flag register 161a is switched to an invalid state when the input signal to the angle clock generation timer 140 is a cam edge signal. That is, the frequency division flag register 161a is not used for executing the crank interrupt process when the input signal is the cam edge signal even when the interrupt flag is in the on state.

エッジフラグレジスタ161bのフラグの切替え条件は、クランク信号における立ち上がりエッジの発生ごとにクランク割り込み処理を実行させるように設定されている。エッジフラグレジスタ161bは、例えばクランクエッジ信号にパルスが生じた場合に、割り込みの要求があった旨を示すオンに設定される。またエッジフラグレジスタ161bは、クランク割り込み処理の実行に用いられた場合に、要求があった旨をクリアされ、オフに設定される。 The flag switching condition of the edge flag register 161b is set so that the crank interrupt process is executed each time a rising edge in the crank signal occurs. The edge flag register 161b is set to ON indicating that an interrupt request has been made, for example, when a pulse occurs in the crank edge signal. Further, the edge flag register 161b is cleared to have been requested and is set to OFF when used for executing the crank interrupt process.

エッジフラグレジスタ161bの割り込みフラグによる割り込み要求は、通常状態においては無効な状態に設定されている。すなわちエッジフラグレジスタ161bは、割り込みフラグオンの状態となっている場合であっても、通常状態においてはクランク割り込み処理の実行には用いられない。 The interrupt request by the interrupt flag of the edge flag register 161b is set to the invalid state in the normal state. That is, the edge flag register 161b is not used for executing the crank interrupt process in the normal state even when the interrupt flag is on.

アングルクロック生成タイマ140への入力信号の切替えに係る機能として、プロセッサコア110の機能には、入力切替部112、取得部113、およびマスクエッジ算出部114としての機能が含まれる。 As a function related to switching of an input signal to the angle clock generation timer 140, the functions of the processor core 110 include a function as an input switching unit 112, an acquisition unit 113, and a mask edge calculation unit 114.

入力切替部112は、アングルクロック生成タイマ140への入力信号切替えを行う信号切替え処理を実行したプロセッサコア110により発揮される機能である。信号切替え処理は、クランク信号の異常が検出されるなどの、所定の入力切替条件が成立していると判断された場合に実行される、アングルクロック生成タイマ140への入力信号を切替える処理である。信号切替え処理の実行されている期間が、入力切替期間に相当する。 The input switching unit 112 is a function exhibited by the processor core 110 that has executed a signal switching process for switching the input signal to the angle clock generation timer 140. The signal switching process is a process of switching the input signal to the angle clock generation timer 140, which is executed when it is determined that a predetermined input switching condition is satisfied, such as when an abnormality in the crank signal is detected. .. The period during which the signal switching process is executed corresponds to the input switching period.

入力切替条件の成立判断、すなわちクランク信号異常検出は周期的に実行され、クランク信号が異常の場合に信号切替え処理を実行させてプロセッサコア110に入力切替部112としての機能を発揮させる。信号切替え処理は、例えばクランク割り込み処理よりも優先度を高く設定されており、実行完了までクランク割り込み処理の実行を待機させる。また信号切替え処理の実行中には、マイコン100の動作クロックの周期がエッジ間隔に対して十分短いため、クランク信号のエッジは一つのみ発生するまたは発生しない状態となる。すなわち、信号切替え処理の実行中には、エッジは複数発生しない。 Whether the input switching condition is satisfied or not, that is, the crank signal abnormality detection is periodically executed. When the crank signal is abnormal, signal switching processing is executed to cause the processor core 110 to perform the function as the input switching unit 112. The signal switching process is set to have a higher priority than, for example, the crank interrupt process, and makes the execution of the crank interrupt process wait until the execution is completed. Further, during the execution of the signal switching process, the cycle of the operation clock of the microcomputer 100 is sufficiently shorter than the edge interval, so that only one edge of the crank signal is generated or not generated. That is, a plurality of edges do not occur during execution of the signal switching process.

入力切替部112は、チャネル選択部133に対して選択チャネルの切替信号を出力し、入力信号をクランクエッジ信号からカムエッジ信号に切替えさせる切替え指示処理を行う。入力切替部112は、入力切替条件が成立すると、取得部113に各種の情報を取得させてから切替え指示処理を行う。 The input switching unit 112 outputs a switching signal for the selected channel to the channel selection unit 133 and performs a switching instruction process for switching the input signal from the crank edge signal to the cam edge signal. When the input switching condition is satisfied, the input switching unit 112 causes the acquisition unit 113 to acquire various information and then performs the switching instruction process.

入力切替部112は、切替え指示処理の前に、フラグレジスタ161の保持する割り込み要求フラグについて、有効または無効な状態の設定を変更させる処理を行う。より具体的には、入力切替部112は、分周フラグレジスタ161aの割り込み要求を、有効な状態から無効な状態に変更させる無効化処理を行う。また入力切替部112は、エッジフラグレジスタ161bの割り込み要求を、無効な状態から有効な状態に変更させる有効化処理を行う。さらに入力切替部112は、カムエッジ信号への切替え前に、エッジフラグレジスタ161bのフラグをクリアさせるクリア処理を行う。 The input switching unit 112 performs a process of changing the setting of the valid or invalid state of the interrupt request flag held by the flag register 161 before the switching instruction process. More specifically, the input switching unit 112 performs an invalidation process for changing the interrupt request of the frequency division flag register 161a from the valid state to the invalid state. The input switching unit 112 also performs an activation process for changing the interrupt request of the edge flag register 161b from the invalid state to the valid state. Further, the input switching unit 112 performs a clear process of clearing the flag of the edge flag register 161b before switching to the cam edge signal.

取得部113は、取得処理を実行したプロセッサコア110により発揮される機能である。取得処理は、信号切替え処理のサブルーチンとして設定されている、信号の切替えに係るクランク信号側の設定処理の一部である。 The acquisition unit 113 is a function exhibited by the processor core 110 that has executed the acquisition process. The acquisition process is a part of the crank signal side setting process related to signal switching, which is set as a subroutine of the signal switching process.

取得部113は、入力切替部112による入力信号の切替え前に、フラグレジスタ161における割り込みフラグの保持状況と、エッジカウンタ142のエッジ数の変化とを取得する。具体的には、今回の信号切替処理の開始から、入力信号の切替えを実施するまでの期間に、上述の情報を取得する。 The acquisition unit 113 acquires the status of holding the interrupt flag in the flag register 161 and the change in the number of edges of the edge counter 142 before switching the input signal by the input switching unit 112. Specifically, the above information is acquired during the period from the start of the current signal switching process to the switching of the input signal.

より具体的には、フラグレジスタ161のうち、分周フラグレジスタ161aの保持する割り込みフラグの状態を取得するフラグ取得処理を行う。また取得部113は、エッジカウンタ142のカウントするエッジ数を二回取得する。取得部113は、エッジ数を取得するエッジ数取得処理を、フラグ取得処理の前後にそれぞれ一回ずつ行う。これ以降、第一エッジ数取得処理に相当するフラグ取得処理以前のエッジ数取得処理で取得されたエッジ数を前エッジ数と呼ぶ。前エッジ数の取得は、入力切替部112によるフラグのクリア以前に実施される。また、第二エッジ数取得処理に相当するフラグ取得処理以前のエッジ数取得処理で取得されたエッジ数を後エッジ数と呼ぶ。後エッジ数の取得は、入力切替部112によるフラグのクリア以降に実施される。 More specifically, in the flag register 161, a flag acquisition process for acquiring the state of the interrupt flag held by the frequency division flag register 161a is performed. The acquisition unit 113 also acquires twice the number of edges counted by the edge counter 142. The acquisition unit 113 performs the edge number acquisition process for acquiring the edge number once each before and after the flag acquisition process. Hereinafter, the number of edges acquired by the edge number acquisition process before the flag acquisition process corresponding to the first edge number acquisition process will be referred to as the previous edge number. The acquisition of the number of front edges is performed before the flag is cleared by the input switching unit 112. Further, the number of edges acquired by the edge number acquisition process before the flag acquisition process corresponding to the second edge number acquisition process is referred to as the rear edge number. The acquisition of the number of trailing edges is performed after the flag is cleared by the input switching unit 112.

マスクエッジ算出部114は、マスクエッジ算出処理を実行したプロセッサコア110により発揮される機能である。マスクエッジ算出処理は、信号切替え処理のサブルーチンとして設定されている、信号の切替えに係るクランク信号側の設定処理の一部である。 The mask edge calculation unit 114 is a function performed by the processor core 110 that has executed the mask edge calculation process. The mask edge calculation process is a part of the setting process on the crank signal side related to signal switching, which is set as a subroutine of the signal switching process.

マスクエッジ算出部114は、入力信号の切替えに伴い、マスクエッジ数を算出する。入力信号の切替えにあたって、クランク割り込み処理の実行条件の変更に伴い、マスクエッジ数が一時的に分周比−1とは異なる数となりうる。マスクエッジ算出部114は、こうした一時的な変化を補正したマスクエッジ数を算出する。 The mask edge calculation unit 114 calculates the number of mask edges according to the switching of the input signal. When switching the input signal, the number of mask edges may temporarily become a number different from the frequency division ratio −1 due to a change in the execution condition of the crank interrupt process. The mask edge calculation unit 114 calculates the number of mask edges in which such a temporary change is corrected.

マスクエッジ算出部114は、取得部113で取得された、割り込みフラグの保持状況と、エッジ数の変化とに基づいてマスクエッジ数を算出する。上述の通り、マスクエッジは、発生したエッジのうち、割り込みコントローラ160に通知されず、クランク割り込み処理に用いられなかったエッジである。従ってマスクエッジ数の算出は、直前のクランク割り込み処理以降におけるエッジ数の増加量の判断と、増加量から処理に用いられたエッジの差し引きの要否の判断とにより実行される。 The mask edge calculation unit 114 calculates the number of mask edges based on the interrupt flag holding status acquired by the acquisition unit 113 and the change in the number of edges. As described above, the mask edge is an edge that has not been used in crank interrupt processing without being notified to the interrupt controller 160 among the generated edges. Therefore, the number of mask edges is calculated by determining the amount of increase in the number of edges since the immediately preceding crank interrupt process and determining whether or not the edge used in the process needs to be subtracted from the amount of increase.

エッジ数の増加量は、直前のクランク割り込み処理以降に、クランク信号に発生したエッジ数を示す。マスクエッジ算出部114は、後エッジ数から、直前のクランク割り込み処理の時点におけるエッジ数を差し引くことにより、エッジ数の増加量を算出する。 The amount of increase in the number of edges indicates the number of edges generated in the crank signal since the immediately preceding crank interrupt process. The mask edge calculation unit 114 calculates the amount of increase in the number of edges by subtracting the number of edges at the time of the immediately preceding crank interrupt processing from the number of rear edges.

マスクエッジの算出にあたって増加量からの差し引くべきエッジは、増加量としてカウントされているエッジのうち、クランク割り込み処理の実行に用いるべきエッジである。すなわち、後エッジ数の取得以前に発生したエッジのうち、入力替え処理の開始以降に発生したため、要求したクランク割り込み処理をまだ実行されていないエッジである。従ってマスクエッジ算出部114は、入力替え処理の開始から後エッジ数の取得までの期間について、割り込み処理の実行の要否を判断することにより、差し引きの要否を判断する。 The edge to be subtracted from the increase amount in calculating the mask edge is an edge to be used for executing the crank interrupt process, among the edges counted as the increase amount. That is, among the edges that have occurred before the acquisition of the number of trailing edges, the edges that have occurred after the start of the input change processing and have not yet executed the requested crank interrupt processing. Therefore, the mask edge calculation unit 114 determines whether or not the subtraction is necessary by determining whether or not the interrupt processing is required to be executed in the period from the start of the input change processing to the acquisition of the number of rear edges.

具体的には、マスクエッジ算出部114は、取得部113により取得された分周フラグレジスタ161aの割り込みフラグがオンである場合、または前エッジ数と後エッジ数とが異なっている場合に、クランク割り込み処理の実行を要すると判断する。マスクエッジ算出部114は、割り込みフラグがオフであり、かつ前エッジ数と後エッジ数とが一致している場合に、クランク割り込み処理の実行を要しないと判断する。 More specifically, the mask edge calculation unit 114 determines whether or not the interrupt flag of the frequency division flag register 161a acquired by the acquisition unit 113 is ON, or when the number of front edges and the number of rear edges are different. Judge that execution of interrupt processing is required. The mask edge calculation unit 114 determines that the crank interrupt process does not need to be executed when the interrupt flag is off and the number of front edges and the number of rear edges match.

マスクエッジ算出部114は、クランク割り込み処理の実行を要すると判断した場合には、その分のエッジを差し引いてマスクエッジ数を算出する。すなわち、エッジ数の増加量から1を差し引いた数をマスクエッジ数として決定する。なお、マスクエッジ算出部114は、割り込みフラグがオンかつ前エッジ数と後エッジ数が異なっている場合にも、クランク割り込み処理を1回のみ実行させるとして、1を差し引く。マスクエッジ算出部114は、クランク割り込み処理の実行を要しないと判断した場合には、エッジを差し引くことなくマスクエッジ数を算出する。すなわち、エッジ数の増加量をマスクエッジ数として決定する。 When the mask edge calculation unit 114 determines that the crank interrupt process needs to be executed, the mask edge calculation unit 114 subtracts the corresponding edges to calculate the number of mask edges. That is, the number obtained by subtracting 1 from the amount of increase in the number of edges is determined as the number of mask edges. Even when the interrupt flag is on and the number of front edges and the number of rear edges are different, the mask edge calculation unit 114 determines that the crank interrupt process should be executed only once, and subtracts 1 from the crank interrupt process. When the mask edge calculation unit 114 determines that the crank interrupt process does not need to be executed, the mask edge calculation unit 114 calculates the number of mask edges without subtracting the edges. That is, the amount of increase in the number of edges is determined as the number of mask edges.

マスクエッジ算出部114は、例えばエッジフラグレジスタ161bの保持する割り込みフラグの書き換えにより、判断した実行の要否に従ってクランク割り込み処理を実施させる。すなわちマスクエッジ算出部114は、実行を要すると判断した場合には、エッジフラグレジスタ161bをオンに書き換えさせる。オンに書き換えられたエッジフラグレジスタ161bにより、クランク割り込み処理が切替え処理の完了後に強制的に実行される。 The mask edge calculation unit 114 executes the crank interrupt process according to the determined necessity of execution, for example, by rewriting the interrupt flag held in the edge flag register 161b. That is, when the mask edge calculation unit 114 determines that the execution is required, the mask edge calculation unit 114 rewrites the edge flag register 161b to ON. With the edge flag register 161b rewritten to be ON, the crank interrupt process is forcibly executed after the completion of the switching process.

マスクエッジ算出部114は、実行を要しないと判断した場合には、エッジフラグレジスタ161bの割り込みフラグの書き換えを行わない。すなわち、エッジフラグレジスタ161bを、入力切替部112によりクリアされた状態のままとする。書き換えられていないエッジフラグレジスタ161bは、クリア後に発生したエッジに従いオンとなると、信号切替え処理とは独立してクランク割り込み処理を実行させる。クランク割り込み処理は、信号切替え処理の完了後に最初に実行された場合のみ、マスクエッジ算出部114により算出された一時的なマスクエッジ数に従ってクランク角を算出する。 The mask edge calculation unit 114 does not rewrite the interrupt flag of the edge flag register 161b when it is determined that the execution is not necessary. That is, the edge flag register 161b remains in the state cleared by the input switching unit 112. When the edge flag register 161b which has not been rewritten is turned on in accordance with the edge generated after clearing, the crank interrupt processing is executed independently of the signal switching processing. The crank interrupt process calculates the crank angle according to the temporary mask edge number calculated by the mask edge calculation unit 114 only when it is first executed after the completion of the signal switching process.

[プロセッサコア110の作動]
プロセッサコア110の作動を、図3および図4のフローチャートに沿って説明する。プロセッサコア110は、内燃機関の制御中に、信号切替え処理として図3に示す処理をS101から周期的に実行する。
[Operation of processor core 110]
The operation of the processor core 110 will be described with reference to the flowcharts of FIGS. 3 and 4. The processor core 110 periodically executes the process shown in FIG. 3 from S101 as the signal switching process during the control of the internal combustion engine.

S101では、クランク信号に異常が生じているか否かを判断する。異常が生じていると判断した場合には、アングルクロック生成タイマ140への入力信号をカム信号に切替える必要があるとしてS102に進む。異常が生じていないと判断した場合には、図3に示す処理を終了する。S101から入力切替期間が開始する。 In S101, it is determined whether or not the crank signal is abnormal. If it is determined that an abnormality has occurred, it is necessary to switch the input signal to the angle clock generation timer 140 to the cam signal, and the process proceeds to S102. If it is determined that no abnormality has occurred, the processing shown in FIG. 3 is terminated. The input switching period starts from S101.

S102では、カム信号への切替えにあたってクランク信号について種々の設定を行うために、図4に示すクランク信号設定サブルーチンを実行する。クランク信号設定サブルーチンでは、図4に示す処理をS110から実行する。 In S102, the crank signal setting subroutine shown in FIG. 4 is executed in order to make various settings for the crank signal when switching to the cam signal. In the crank signal setting subroutine, the processing shown in FIG. 4 is executed from S110.

S110では、割り込みコントローラ160に対し、エッジフラグレジスタ161bによるクランク割り込み処理を有効にさせる。すなわち、有効化処理として、クランク信号のエッジ検出ごとのクランク割り込み処理の実行を有効にする処理を実行する。 In S110, the interrupt controller 160 enables the crank interrupt processing by the edge flag register 161b. That is, as the validation process, a process for validating the execution of the crank interrupt process for each edge detection of the crank signal is executed.

S111では、エッジカウンタ142から現在のエッジ数を取得する。すなわち、第一エッジ数取得処理として、分周フラグレジスタ161aからのフラグ取得前のエッジ数である前エッジ数を取得する処理を実行する。これ以降に発生したエッジは、分周エッジに相当するか否かに拘わらずエッジ数の変化として検出され、クランク割り込み処理を実行させる。従って、この処理は割り込み要求を発生させるエッジの分周を解除する処理と言える。 In S111, the current number of edges is acquired from the edge counter 142. That is, as the first edge number acquisition process, a process of acquiring the number of front edges which is the number of edges before the flag is acquired from the frequency division flag register 161a is executed. Edges generated thereafter are detected as a change in the number of edges regardless of whether they correspond to frequency division edges, and the crank interrupt process is executed. Therefore, this process can be said to be a process for canceling the frequency division of the edge that generates the interrupt request.

S112では、クリア処理として、エッジフラグレジスタ161bの保持する割り込み要求フラグをクリアする処理を実行する。すなわち、この処理以前のエッジがエッジフラグレジスタ161bの割り込み要求フラグをオンとしていても、信号切替え処理完了後のクランク割り込み処理の実行に影響を与えない状態とする。 In S112, as the clearing process, a process of clearing the interrupt request flag held by the edge flag register 161b is executed. That is, even if the edge before this processing turns on the interrupt request flag of the edge flag register 161b, it does not affect the execution of the crank interrupt processing after the completion of the signal switching processing.

S113では、フラグ取得処理として。分周フラグレジスタ161aの保持する割り込み要求フラグを取得する処理を実行する。すなわち、今回の信号切替え処理開始から、この処理までの期間に分周エッジが発生しているか否かを取得する。 In S113, as flag acquisition processing. Processing for acquiring the interrupt request flag held by the frequency division flag register 161a is executed. That is, it is acquired whether or not a frequency division edge has occurred during the period from the start of the current signal switching process to this process.

S114では、エッジカウンタ142から現在のエッジ数を再度取得する。すなわち、第二エッジ数取得処理として、分周フラグレジスタ161aからのフラグ取得後のエッジ数である後エッジ数を取得する処理を実行する。 In S114, the current number of edges is acquired again from the edge counter 142. That is, as the second edge number acquisition process, a process of acquiring the rear edge number, which is the number of edges after the flag is acquired from the frequency division flag register 161a, is executed.

S115では、クランク割り込み処理の実行させる必要があるか否かを判断する。すなわち、分周フラグレジスタ161aから取得したフラグがオンであるか、または前エッジ数と後エッジ数との間に差があるかを判断する。フラグがオンであるか、またはエッジ数に差がある場合には、クランク割り込み処理を実行させるエッジが発生している、すなわち実行を要するとしてS116に進む。フラグがオフであり、かつエッジ数が一致している場合には、クランク割り込み処理の実行を要しないとしてS118に進む。 In S115, it is determined whether it is necessary to execute the crank interrupt process. That is, it is determined whether the flag acquired from the frequency division flag register 161a is on or there is a difference between the number of front edges and the number of rear edges. If the flag is on or there is a difference in the number of edges, it is determined that an edge for executing the crank interrupt process has occurred, that is, execution is required, and the process proceeds to S116. If the flag is off and the numbers of edges match, it is determined that the crank interrupt process does not need to be executed, and the process proceeds to S118.

S116では、エッジフラグレジスタ161bの保持する割り込み要求フラグをオンにさせる。すなわち、信号切替え処理の完了時に、発生したエッジ分のクランク割り込み処理を強制的に一回実施させるように予約する。 In S116, the interrupt request flag held by the edge flag register 161b is turned on. That is, when the signal switching process is completed, the crank interrupt process for the generated edges is forcibly executed once.

S117では、エッジ数の増加量から1を差し引いた数を、マスクエッジ数と判断する。すなわち、エッジ数の増加量からS116でクランク割り込み処理を実施させた分のエッジを差し引いた数を、マスクエッジ数として算出する。 In S117, the number obtained by subtracting 1 from the amount of increase in the number of edges is determined as the number of mask edges. That is, the number of mask edges is calculated by subtracting the number of edges for which the crank interrupt process is performed in S116 from the increase amount of the number of edges.

S118では、エッジ数の増加量をマスクエッジ数と判断する。すなわち、クランク割り込み処理の実施を予約しないため、エッジ数の増加量そのものをマスクエッジ数として算出する。 In S118, the amount of increase in the number of edges is determined to be the number of mask edges. That is, since the execution of the crank interrupt process is not reserved, the increase amount of the edge number itself is calculated as the mask edge number.

S119では、分周フラグレジスタ161aの割り込みフラグによる割り込み要求を許可されていない状態に変更させ、図4のサブルーチンを終了して図3の処理に戻る。すなわちこの処理以降、分周フラグレジスタ161aは、割り込みフラグオンの状態となっている場合であっても、有効な割り込み要求としては扱われず、クランク割り込み処理の実行には用いられない状態となる。 In step S119, the interrupt request by the interrupt flag of the frequency division flag register 161a is changed to a non-permitted state, the subroutine of FIG. 4 is terminated, and the process returns to the process of FIG. That is, after this process, the frequency division flag register 161a is not treated as a valid interrupt request even when the interrupt flag is on, and is not used for executing the crank interrupt process.

図3の処理に戻ると、S103の処理に進む。S103の処理では、カム信号への切替えにあたってカム信号について種々の設定を行う。 Returning to the processing of FIG. 3, the processing proceeds to S103. In the process of S103, various settings are made for the cam signal when switching to the cam signal.

S104では、チャネル選択部133に、アングルクロック生成タイマ140への入力信号をカム信号に切替えさせる。S104で入力切替期間が完了する。 In S104, the channel selection unit 133 is caused to switch the input signal to the angle clock generation timer 140 to the cam signal. The input switching period is completed in S104.

S105では、エッジフラグレジスタ161bの割り込み要求フラグがオンとなっているかを判断する。すなわち、S116でクランク割り込み処理を予約している、または後エッジ数の取得後にエッジが発生しているか否かを判断する。オンの場合、クランク割り込み処理の実行のためS106に進む。オフの場合、図4に示す処理を終了し、次のエッジ発生までクランク割り込み処理の実施を待つ。 In S105, it is determined whether the interrupt request flag of the edge flag register 161b is turned on. That is, it is determined whether or not the crank interrupt process is reserved in S116 or an edge has occurred after the number of rear edges is acquired. If it is on, the process proceeds to S106 to execute the crank interrupt process. If it is off, the processing shown in FIG. 4 is terminated and the execution of the crank interrupt processing is waited until the next edge is generated.

S106では、クランク割り込み処理を実行する。すなわち、S117またはS118で算出されたマスクエッジ数に基づくクランク角算出などを実施する。 In S106, crank interrupt processing is executed. That is, the crank angle is calculated based on the number of mask edges calculated in S117 or S118.

[第一実施形態のまとめ]
以上、説明した第一実施形態によれば、エッジカウンタ142はエッジ数をカウントしている。また、フラグレジスタ161は、エッジの発生に基づいてオンとなる、クランク角処理部111を起床させるための割り込み要求フラグを保持している。故にマスクエッジ算出部114は、エッジ数の変化として検出された直前のクランク割り込み処理から発生したエッジ数の変化量と、フラグレジスタ161の保持する割り込み要求フラグとに従って、マスクエッジ数を算出可能となる。従ってエンジンECU1は、アングルクロックの生成源となる信号を切替える場合においても、算出されるクランク角のズレを抑制可能となる。
[Summary of First Embodiment]
According to the first embodiment described above, the edge counter 142 counts the number of edges. In addition, the flag register 161 holds an interrupt request flag that is turned on when an edge occurs and that wakes up the crank angle processing unit 111. Therefore, the mask edge calculation unit 114 can calculate the number of mask edges according to the amount of change in the number of edges generated from the crank interrupt process immediately before detected as the change in the number of edges and the interrupt request flag held by the flag register 161. Become. Therefore, the engine ECU 1 can suppress the deviation of the calculated crank angle even when switching the signal that is the generation source of the angle clock.

すなわち、マスクエッジ算出部114は、割り込み要求フラグのオン、またはエッジ数の変化発生に従いクランク割り込み処理を実行させる場合には、そのエッジを変化量から差し引いてマスクエッジ数を算出する。 That is, the mask edge calculation unit 114 calculates the number of mask edges by subtracting the edge from the change amount when executing the crank interrupt processing in accordance with the turning on of the interrupt request flag or the change in the number of edges.

またマスクエッジ算出部114は、割り込み要求フラグのオフかつエッジ数の変化なしのためクランク割り込み処理を実行させない場合には、変化量から実行させた分のエッジを差し引くことなくマスクエッジ数を算出する。このように、マスクエッジ算出部114は、クランク割り込み処理の実行の要否に従い、実行させた分のエッジを差し引いてマスクエッジ数を算出する。従って、マスクエッジ算出部114は、クランク割り込み処理の実行の有無と同期させてマスクエッジ数を算出しうる。 When the crank interrupt processing is not executed because the interrupt request flag is off and the number of edges has not changed, the mask edge calculation unit 114 calculates the number of mask edges without subtracting the executed edge from the change amount. .. As described above, the mask edge calculation unit 114 calculates the number of mask edges by subtracting the executed edges according to the necessity of executing the crank interrupt process. Therefore, the mask edge calculation unit 114 can calculate the number of mask edges in synchronization with the presence/absence of execution of the crank interrupt process.

加えて本実施形態では、マスクエッジ算出部114による予約、または信号切替え処理以降のエッジにより起床されたクランク角処理部111は、マスクエッジ算出部114により算出されたマスクエッジ数に基づいてクランク角を補正する。従ってエンジンECU1では、各種の処理に用いられるクランク角のズレが抑制され、制御の精度低下がより抑制される。 In addition, in the present embodiment, the crank angle processing unit 111, which is woken up by the reservation by the mask edge calculation unit 114 or the edge after the signal switching process, uses the crank angle calculated based on the number of mask edges calculated by the mask edge calculation unit 114. To correct. Therefore, in the engine ECU 1, the deviation of the crank angle used for various processes is suppressed, and the deterioration of control accuracy is further suppressed.

さらに本実施形態では、取得部113は、分周フラグレジスタ161aの保持する割り込み要求フラグを保持状況として取得し、保持状況の取得前後におけるエッジ数をそれぞれ前エッジ数および後エッジ数として取得する。またマスクエッジ算出部114は、分周フラグレジスタ161aの割り込み要求オンの場合、または前エッジ数と後エッジ数とが異なっている場合に、クランク割り込み処理を実行させてその分をエッジ増加量から差し引く。この結果、信号切替え処理の実行期間のいつエッジが発生した場合であっても、マスクエッジ算出部114は、クランク割り込み処理の実行の有無と同期させてマスクエッジ数を算出しうる。 Further, in the present embodiment, the acquisition unit 113 acquires the interrupt request flag held by the frequency division flag register 161a as a holding status, and acquires the number of edges before and after acquiring the holding status as the number of front edges and the number of rear edges, respectively. Further, when the interrupt request of the frequency division flag register 161a is turned on, or when the number of front edges and the number of rear edges are different, the mask edge calculation unit 114 executes crank interrupt processing and calculates the amount from the edge increase amount. Subtract. As a result, the mask edge calculation unit 114 can calculate the number of mask edges in synchronization with the presence/absence of execution of the crank interrupt process, even when an edge occurs during the execution period of the signal switching process.

クランク割り込み処理の実行の有無と同期させたマスクエッジ数の算出について、図5〜7を用いて詳細に説明する。図5〜7は、信号切替え処理の実行期間にエッジが発生した場合の、クランク割り込み処理を発生させたエッジとマスクエッジ数との対応例を示す。なお、クランク信号のエッジのうち、矢印は分周エッジに相当するクランク角で発生したエッジを示す。また、矢印でない直線は分周エッジに相当しないエッジ(以下、非分周エッジ)を示す。また、各エッジから延びる破線の矢印は、そのエッジが割り込み処理を実行させたエッジである旨を示す。 Calculation of the number of mask edges synchronized with the presence or absence of execution of the crank interrupt process will be described in detail with reference to FIGS. FIGS. 5 to 7 show examples of correspondence between the edge causing the crank interrupt process and the number of mask edges when the edge occurs during the execution period of the signal switching process. In addition, among the edges of the crank signal, the arrow indicates the edge generated at the crank angle corresponding to the frequency division edge. A straight line that is not an arrow indicates an edge that does not correspond to a frequency division edge (hereinafter, a non-frequency division edge). A dashed arrow extending from each edge indicates that the edge is an edge that has executed interrupt processing.

図5に、分周エッジに相当するエッジが信号切替え処理の実行期間に発生した場合の作動を示す。分周エッジに相当するエッジは、分周フラグレジスタ161aのフラグ取得前に発生した場合にはフラグのオンとして検出可能であり、前エッジ数取得から後エッジ数取得までに発生した場合にはエッジ数の変化として検出可能である。従って分周エッジは、信号切替え処理の開始から、後エッジ数の取得までの期間までのいつ発生した場合においても、割り込み処理を発生させる。従って、マスクエッジ数はこのエッジを含めず算出される。 FIG. 5 shows the operation when an edge corresponding to the frequency division edge occurs during the execution period of the signal switching process. The edge corresponding to the frequency division edge can be detected as the flag being turned on when it occurs before the flag of the frequency division flag register 161a is acquired, and the edge when it occurs from the front edge number acquisition to the rear edge number acquisition. It can be detected as a change in the number. Therefore, the frequency division edge causes the interrupt processing even when it occurs from the start of the signal switching processing to the acquisition of the number of rear edges. Therefore, the number of mask edges is calculated without including this edge.

図6および図7に、非分周エッジが信号切替え処理の実行期間に発生した場合の作動を示す。非分周エッジは、分周フラグレジスタ161aのフラグを用いて検出できず、エッジ数の変化で検出可能である。従って、前エッジ数の取得までの期間に発生した非分周エッジは、割り込み処理を発生させず、マスクエッジ数に含められる。一方、前エッジ数の取得から後エッジ数の取得までの期間に発生した非分周エッジは、分周エッジではないが割り込み処理の発生に用いられる。従って、この期間に発生した非分周エッジは、マスクエッジ数に含められない。 6 and 7 show the operation in the case where the non-divided edge occurs during the execution period of the signal switching process. The non-frequency-divided edge cannot be detected using the flag of the frequency-division flag register 161a, but can be detected by the change in the number of edges. Therefore, the non-frequency-divided edge that has occurred until the acquisition of the number of front edges is included in the number of mask edges without causing interrupt processing. On the other hand, the non-frequency-divided edge generated during the period from the acquisition of the number of front edges to the acquisition of the number of rear edges is not a frequency-divided edge but is used for generating interrupt processing. Therefore, the non-divided edges generated in this period are not included in the number of mask edges.

なお、信号切替え処理の実行期間のうち後エッジ数取得以降に発生したエッジは、分周エッジであるか非分周エッジであるかに拘わらず、マスクエッジ算出部114の判断するエッジ数の増加量には含まれない。故にこの期間に発生したエッジは、マスクエッジ算出部114による増加量から差し引くか否かの判断では参照されず、独立してクランク割り込み処理を実行させる。 It should be noted that the number of edges determined by the mask edge calculation unit 114 increases regardless of whether the edges generated after the acquisition of the number of rear edges during the signal switching process is the divided edges or the non-divided edges. Not included in the quantity. Therefore, the edge generated during this period is not referred to by the mask edge calculation unit 114 in determining whether or not to subtract from the increase amount, and the crank interrupt process is executed independently.

さらに、マスクエッジ算出部114は、後エッジ数取得以前にクリアされたエッジフラグレジスタ161bへのオン書き込みにより、クランク割り込み処理の実行を予約する。この結果、マスクエッジ算出部114はエッジフラグレジスタ161bのクリアから後エッジ数取得までのエッジ発生によりオンに書き換わっていても、クランク割り込み処理を1回のみ実行させる。故にマスクエッジ算出部114は、エッジの数と実行回数とのズレを抑制しうる。 Further, the mask edge calculation unit 114 reserves the execution of the crank interrupt processing by the ON writing to the edge flag register 161b that is cleared before the acquisition of the number of trailing edges. As a result, the mask edge calculation unit 114 causes the crank interrupt process to be executed only once even if the mask edge calculation unit 114 has been rewritten to ON due to the occurrence of an edge from the clearing of the edge flag register 161b to the acquisition of the number of rear edges. Therefore, the mask edge calculation unit 114 can suppress the deviation between the number of edges and the number of executions.

加えてマスクエッジ算出部114は、クリア処理以前に取得した前エッジ数をクリア処理以降の後エッジ数と比較して、割り込み処理実行の要否を判断する。本実施形態の構成に反して、クリア処理以降に前エッジ数を取得して、後エッジ数と比較し要否判断する構成を採用した場合、マスクエッジ算出部114による要否判断の結果と、エッジフラグレジスタ161bの状態とが相違しうる。具体的には、クリア処理から前エッジ数の取得までに非分周エッジが発生した場合、この非分周エッジは分周フラグレジスタ161aをオンにせず、前エッジ数と後エッジ数との差も生じさせない。故にこの非分周エッジは、マスクエッジ算出部114ではクランク割り込み処理実行不要と判断されマスクエッジ数に含められるにも拘わらず、エッジフラグレジスタ161bをオンとし割り込み処理の実行に用いられる。 In addition, the mask edge calculation unit 114 compares the number of front edges acquired before the clearing process with the number of trailing edges after the clearing process to determine whether or not to execute the interrupt process. Contrary to the configuration of the present embodiment, when the configuration for determining the necessity by comparing the number of trailing edges with the number of front edges acquired after the clearing process is adopted, the result of the determination of necessity by the mask edge calculation unit 114, The state of the edge flag register 161b may be different. Specifically, when a non-divided edge occurs between the clearing process and the acquisition of the number of front edges, the non-divided edge does not turn on the frequency division flag register 161a, and the difference between the number of front edges and the number of rear edges is calculated. Does not occur. Therefore, this non-frequency-divided edge is used by the mask edge calculation unit 114 to turn on the edge flag register 161b, even though it is determined by the mask edge calculation unit 114 that crank interrupt processing is not required to be executed and is included in the number of mask edges.

この懸念に対し本実施形態では、マスクエッジ算出部114は、クリア処理から後エッジ数取得までのいつエッジが発生した場合であっても、前エッジ数と後エッジ数との差に基づいてクランク割込み処理の実行を要すると判断しうる。故にマスクエッジ算出部114は、そのエッジが非分周エッジであっても検出し、オンに書き換わったエッジフラグレジスタ161bの状態と、クランク割り込み処理の実行の要否判断の結果とを一致させうる。故にマスクエッジ算出部114は、クリア後にエッジフラグレジスタ161bのフラグが書き換わった場合においても、エッジの数と実行回数とのズレを抑制しうる。 In contrast to this concern, in the present embodiment, the mask edge calculation unit 114 determines the crank based on the difference between the number of front edges and the number of rear edges, regardless of when an edge occurs from the clearing process to the acquisition of the number of rear edges. It can be determined that execution of interrupt processing is required. Therefore, the mask edge calculation unit 114 detects the edge even if it is a non-frequency-divided edge, and matches the state of the edge flag register 161b, which has been rewritten to ON, with the result of the determination as to whether or not to execute the crank interrupt process. sell. Therefore, even if the flag of the edge flag register 161b is rewritten after clearing, the mask edge calculation unit 114 can suppress the deviation between the number of edges and the number of executions.

以上のように、マスクエッジ算出部114は、どのタイミングにおいてクランク信号にエッジが発生した場合においても、エッジによるクランク割り込み処理の実行と同期させてマスクエッジ数を算出しうる。故にクランク角処理部111は、算出されたマスクエッジ数に基づきクランク角のズレを抑制可能となる。 As described above, the mask edge calculation unit 114 can calculate the number of mask edges in synchronization with the execution of the crank interrupt processing by the edge, at which timing the edge occurs in the crank signal. Therefore, the crank angle processing unit 111 can suppress the deviation of the crank angle based on the calculated mask edge number.

<第二実施形態>
第二実施形態は、第一実施形態の変形例である。第二実施形態では、図8に示すクランク信号設定サブルーチンの処理が、図4に示した処理に換えてプロセッサコア110により実行される。図8に示す第二実施形態におけるクランク信号設定サブルーチンの処理では、図4のS110〜S114の処理が、S210〜S214に置き換えられている。
<Second embodiment>
The second embodiment is a modification of the first embodiment. In the second embodiment, the processing of the crank signal setting subroutine shown in FIG. 8 is executed by the processor core 110 instead of the processing shown in FIG. In the process of the crank signal setting subroutine in the second embodiment shown in FIG. 8, the processes of S110 to S114 of FIG. 4 are replaced with S210 to S214.

S210は、図4のS111に相当する処理である。すなわちS210では、エッジカウンタ142から、現在のエッジ数を取得する。S210は、S213での分周フラグレジスタ161aのフラグ取得以前に実施される。従ってS210で取得されたエッジ数は、前エッジ数に相当する。 S210 is a process corresponding to S111 of FIG. That is, in S210, the current number of edges is acquired from the edge counter 142. S210 is executed before the acquisition of the flag of the frequency division flag register 161a in S213. Therefore, the number of edges acquired in S210 corresponds to the number of front edges.

S211は、図4のS110に相当する処理である。すなわちS211では、割り込みコントローラ160に対し、エッジフラグレジスタ161bによるクランク割り込み処理を有効にさせる。 S211 is a process corresponding to S110 of FIG. That is, in S211, the interrupt controller 160 is made to enable the crank interrupt processing by the edge flag register 161b.

S212は、図4のS112に相当する処理である。すなわちS212では、エッジフラグレジスタ161bの保持する割り込み要求フラグをクリアする。 S212 is a process corresponding to S112 of FIG. That is, in S212, the interrupt request flag held by the edge flag register 161b is cleared.

S213は、図4のS113に相当する処理である。すなわちS213では、分周フラグレジスタ161aの保持する割り込み要求フラグを取得する。 S213 is a process corresponding to S113 of FIG. That is, in S213, the interrupt request flag held by the frequency division flag register 161a is acquired.

S214は、図4のS114に相当する処理である。すなわちS214では、エッジカウンタ142から、現在のエッジ数を再度取得する。S214は、S213での分周フラグレジスタ161aのフラグ取得以降に実施される。従ってS214で取得されたエッジ数は、後エッジ数に相当する。S214は、S212でのエッジフラグレジスタ161bのクリア以降に実施される。 S214 is a process corresponding to S114 of FIG. That is, in S214, the current number of edges is acquired again from the edge counter 142. S214 is performed after the acquisition of the flag of the frequency division flag register 161a in S213. Therefore, the number of edges acquired in S214 corresponds to the number of rear edges. S214 is performed after the edge flag register 161b is cleared in S212.

[第二実施形態のまとめ]
以上、説明した第二実施形態によれば、第一実施形態と同様に、エンジンECU1は、マスクエッジ算出部114で算出されたマスクエッジ数に基づき、クランク角のズレを抑制して制御を実施しうる。
[Summary of Second Embodiment]
As described above, according to the second embodiment described above, the engine ECU 1 controls the crank angle deviation based on the number of mask edges calculated by the mask edge calculation unit 114, similarly to the first embodiment. You can.

また第二実施形態においても、マスクエッジ算出部114は分周フラグレジスタ161aのフラグと、前エッジ数と後エッジ数との差の有無と、に基づいてクランク割り込み処理の実行の要否を判断し、実行の要否に従ってマスクエッジ数を補正可能である。加えて第二実施形態においても、マスクエッジ算出部114は、前エッジ数の取得と後エッジ数の取得との間にクリアしたエッジフラグレジスタ161bのへの書き込みにより、クランク割り込み処理の実行を予約する。従って第二実施形態においても、第一実施形態と同様に、マスクエッジ算出部114は、どのタイミングにおいてクランク信号にエッジが発生した場合においても、クランク割り込み処理の実行と同期させてマスクエッジ数を算出しうる。 Also in the second embodiment, the mask edge calculation unit 114 determines whether to execute the crank interrupt process based on the flag of the frequency division flag register 161a and the presence/absence of the difference between the front edge number and the rear edge number. However, the number of mask edges can be corrected according to the necessity of execution. In addition, also in the second embodiment, the mask edge calculation unit 114 reserves the execution of the crank interrupt process by writing to the edge flag register 161b that is cleared between the acquisition of the number of front edges and the acquisition of the number of rear edges. To do. Therefore, also in the second embodiment, as in the first embodiment, the mask edge calculation unit 114 determines the number of mask edges in synchronization with the execution of the crank interrupt process at any timing when an edge occurs in the crank signal. It can be calculated.

<第三実施形態>
第三実施形態は、第一実施形態の別の変形例である。第三実施形態では、図9に示すクランク信号設定サブルーチンの処理が、図4に示した処理に換えてプロセッサコア110により実行される。図9に示す第三実施形態におけるクランク信号設定サブルーチンの処理では、図4のS110〜S114の処理が、S310〜S314に置き換えられている。
<Third embodiment>
The third embodiment is another modification of the first embodiment. In the third embodiment, the processing of the crank signal setting subroutine shown in FIG. 9 is executed by the processor core 110 instead of the processing shown in FIG. In the process of the crank signal setting subroutine in the third embodiment shown in FIG. 9, the processes of S110 to S114 of FIG. 4 are replaced with S310 to S314.

S310は、図4のS110に相当する処理である。すなわちS310では、割り込みコントローラ160に対し、エッジフラグレジスタ161bによるクランク割り込み処理を有効にさせる。 S310 is a process corresponding to S110 of FIG. That is, in S310, the interrupt controller 160 is made to enable the crank interrupt processing by the edge flag register 161b.

S311は、図4のS111に相当する処理である。すなわちS311では、エッジカウンタ142から、現在のエッジ数を取得する。S311は、S312での分周フラグレジスタ161aのフラグ取得以前に実施される。従ってS311で取得されたエッジ数は、前エッジ数に相当する。またS311は、S313でのエッジフラグレジスタ161bのクリア以前に実施される。 S311 is a process corresponding to S111 of FIG. That is, in S311, the current edge number is acquired from the edge counter 142. S311 is executed before the acquisition of the flag of the frequency division flag register 161a in S312. Therefore, the number of edges acquired in S311 corresponds to the number of front edges. Further, S311 is executed before the edge flag register 161b is cleared in S313.

S312は、図4のS113に相当する処理である。すなわちS312では、分周フラグレジスタ161aの保持する割り込み要求フラグを取得する。 S312 is a process corresponding to S113 of FIG. That is, in S312, the interrupt request flag held by the frequency division flag register 161a is acquired.

S313は、図4のS112に相当する処理である。すなわちS313では、エッジフラグレジスタ161bの保持する割り込み要求フラグをクリアする。 S313 is a process corresponding to S112 of FIG. That is, in S313, the interrupt request flag held by the edge flag register 161b is cleared.

S314は、図4のS114に相当する処理である。すなわちS314では、エッジカウンタ142から、現在のエッジ数を再度取得する。S314は、S312での分周フラグレジスタ161aのフラグ取得以降に実施される。従ってS314で取得されたエッジ数は、後エッジ数に相当する。またS314は、S313でのエッジフラグレジスタ161bのクリア以降に実施される。 S314 is a process corresponding to S114 of FIG. That is, in S314, the current number of edges is acquired again from the edge counter 142. S314 is performed after the acquisition of the flag of the frequency division flag register 161a in S312. Therefore, the number of edges acquired in S314 corresponds to the number of rear edges. Further, S314 is executed after the edge flag register 161b is cleared in S313.

[第三実施形態のまとめ]
以上、説明した第三実施形態によれば、第一実施形態と同様に、エンジンECU1は、マスクエッジ算出部114で算出されたマスクエッジ数に基づき、クランク角のズレを抑制して制御を実施しうる。
[Summary of Third Embodiment]
As described above, according to the third embodiment described above, the engine ECU 1 controls the crank angle deviation based on the number of mask edges calculated by the mask edge calculation unit 114, similarly to the first embodiment. You can.

また第三実施形態においても、マスクエッジ算出部114は、分周フラグレジスタ161aのフラグと、前エッジ数と後エッジ数との差の有無と、に基づいてクランク割り込み処理の実行の要否を判断し、実行の要否に従ってマスクエッジ数を補正可能である。加えて第三実施形態においても、マスクエッジ算出部114は、前エッジ数の取得と後エッジ数の取得との間にクリアしたエッジフラグレジスタ161bのへの書き込みにより、クランク割り込み処理の実行を予約する。従って第三実施形態においても、第一実施形態と同様に、マスクエッジ算出部114は、どのタイミングにおいてクランク信号にエッジが発生した場合においても、クランク割り込み処理の実行と同期させてマスクエッジ数を算出しうる。 Also in the third embodiment, the mask edge calculation unit 114 determines whether to execute the crank interrupt process based on the flag of the frequency division flag register 161a and the presence/absence of the difference between the front edge number and the rear edge number. It is possible to judge and correct the number of mask edges according to the necessity of execution. In addition, also in the third embodiment, the mask edge calculation unit 114 reserves the execution of the crank interrupt process by writing to the edge flag register 161b that is cleared between the acquisition of the number of front edges and the acquisition of the number of rear edges. To do. Therefore, also in the third embodiment, as in the first embodiment, the mask edge calculation unit 114 determines the number of mask edges in synchronization with the execution of the crank interrupt process at any timing when an edge occurs in the crank signal. It can be calculated.

<第四実施形態>
第四実施形態は、第一実施形態の別の変形例である。第四実施形態では、図10に示すクランク信号設定サブルーチンの処理が、図4に示した処理に換えてプロセッサコア110により実行される。図10に示す第四実施形態におけるクランク信号設定サブルーチンの処理では、図4のS110〜S114の処理が、S410〜S414に置き換えられている。
<Fourth Embodiment>
The fourth embodiment is another modification of the first embodiment. In the fourth embodiment, the processing of the crank signal setting subroutine shown in FIG. 10 is executed by the processor core 110 instead of the processing shown in FIG. In the processing of the crank signal setting subroutine in the fourth embodiment shown in FIG. 10, the processing of S110 to S114 in FIG. 4 is replaced with S410 to S414.

S410は、図4のS111に相当する処理である。すなわちS410では、エッジカウンタ142から、現在のエッジ数を取得する。S410は、S412での分周フラグレジスタ161aのフラグ取得以前に実施される。従ってS410で取得されたエッジ数は、前エッジ数に相当する。またS410は、S413でのエッジフラグレジスタ161bのクリア以前に実施される。 S410 is a process corresponding to S111 of FIG. That is, in S410, the current number of edges is acquired from the edge counter 142. S410 is performed before the acquisition of the flag of the frequency division flag register 161a in S412. Therefore, the number of edges acquired in S410 corresponds to the number of previous edges. Further, S410 is executed before the edge flag register 161b is cleared in S413.

S411は、図4のS110に相当する処理である。すなわちS411では、割り込みコントローラ160に対し、エッジフラグレジスタ161bによるクランク割り込み処理を有効にさせる。 S411 is a process corresponding to S110 of FIG. That is, in step S411, the interrupt controller 160 enables the crank interrupt processing by the edge flag register 161b.

S412は、図4のS113に相当する処理である。すなわちS412では、分周フラグレジスタ161aの保持する割り込み要求フラグを取得する。 S412 is a process corresponding to S113 of FIG. That is, in S412, the interrupt request flag held by the frequency division flag register 161a is acquired.

S413は、図4のS112に相当する処理である。すなわちS413では、エッジフラグレジスタ161bの保持する割り込み要求フラグをクリアする。 S413 is a process corresponding to S112 of FIG. That is, in S413, the interrupt request flag held by the edge flag register 161b is cleared.

S414は、図4のS114に相当する処理である。すなわちS414では、エッジカウンタ142から、現在のエッジ数を再度取得する。S414は、S412での分周フラグレジスタ161aのフラグ取得以降に実施される。従ってS414で取得されたエッジ数は、後エッジ数に相当する。またS414は、S413でのエッジフラグレジスタ161bのクリア以降に実施される。 S414 is a process corresponding to S114 of FIG. That is, in S414, the current number of edges is acquired again from the edge counter 142. S414 is performed after the acquisition of the flag of the frequency division flag register 161a in S412. Therefore, the number of edges acquired in S414 corresponds to the number of trailing edges. Further, S414 is performed after the edge flag register 161b is cleared in S413.

[第四実施形態のまとめ]
以上、説明した第四実施形態によれば、第一実施形態と同様に、エンジンECU1は、マスクエッジ算出部114で算出されたマスクエッジ数に基づき、クランク角のズレを抑制して制御を実施しうる。
[Summary of Fourth Embodiment]
As described above, according to the fourth embodiment described above, the engine ECU 1 controls the crank angle deviation based on the number of mask edges calculated by the mask edge calculation unit 114, similarly to the first embodiment. You can.

また第四実施形態においても、マスクエッジ算出部114は、分周フラグレジスタ161aのフラグと、前エッジ数と後エッジ数との差の有無と、に基づいてクランク割り込み処理の実行の要否を判断し、実行の要否に従ってマスクエッジ数を補正可能である。加えて第四実施形態においても、マスクエッジ算出部114は、前エッジ数の取得と後エッジ数の取得との間にクリアしたエッジフラグレジスタ161bのへの書き込みにより、クランク割り込み処理の実行を予約する。従って第四実施形態においても、第一実施形態と同様に、マスクエッジ算出部114は、どのタイミングにおいてクランク信号にエッジが発生した場合においても、クランク割り込み処理の実行と同期させてマスクエッジ数を算出しうる。 Also in the fourth embodiment, the mask edge calculation unit 114 determines whether to execute the crank interrupt process based on the flag of the frequency division flag register 161a and the presence/absence of the difference between the front edge number and the rear edge number. It is possible to judge and correct the number of mask edges according to the necessity of execution. In addition, also in the fourth embodiment, the mask edge calculation unit 114 reserves execution of crank interrupt processing by writing to the edge flag register 161b that is cleared between the acquisition of the number of front edges and the acquisition of the number of rear edges. To do. Therefore, also in the fourth embodiment, as in the first embodiment, the mask edge calculation unit 114 determines the number of mask edges in synchronization with the execution of the crank interrupt process at any timing when an edge occurs in the crank signal. It can be calculated.

<他の実施形態>
以上、本開示の実施形態を説明したが、本開示は上述の実施形態に限定されるものではなく、次の変形例も本開示の技術的範囲に含まれ、さらに、下記以外にも要旨を逸脱しない範囲内で種々変更して実施できる。なお、以下の説明において、それまでに使用した符号と同一番号の符号を有する要素は、特に言及する場合を除き、それ以前の実施形態における同一符号の要素と同一である。また、構成の一部のみを説明している場合、構成の他の部分については先に説明した実施形態を適用できる。
<Other Embodiments>
Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments, and the following modifications are also included in the technical scope of the present disclosure. Various modifications can be made without departing from the scope. In the following description, elements having the same reference numerals as those used up to now are the same as the elements having the same reference numerals in the previous embodiments, unless otherwise specified. Further, when only a part of the configuration is described, the above-described embodiment can be applied to the other part of the configuration.

上述の実施形態においては、分周フラグレジスタ161aの割り込み要求フラグを無効に切替える処理は、マスクエッジ数の算出以降に行われていた。しかし、分周フラグレジスタ161aの割り込み要求を取得可能であれば、無効に切替える処理のタイミングはこれに限られず適宜変更可能である。 In the above-described embodiment, the process of switching the interrupt request flag of the frequency division flag register 161a to invalid is performed after the calculation of the number of mask edges. However, if the interrupt request of the frequency division flag register 161a can be acquired, the timing of the process of switching to invalid is not limited to this and can be changed appropriately.

上述の実施形態においては、クランク信号のエッジは立ち上がりエッジを用いていた。しかし、立ち下がりエッジを用いる構成でもよい。 In the above-described embodiment, the rising edge is used as the edge of the crank signal. However, a configuration using a falling edge may be used.

1 エンジンECU(内燃機関制御装置)、 111 クランク角処理部、 112 入力切替部、 113 取得部、 114 マスクエッジ算出部、 142 エッジカウンタ、 141 アングルクロック生成部、 161 フラグレジスタ、 161a 分周フラグレジスタ、 161b エッジフラグレジスタ 1 engine ECU (internal combustion engine control unit), 111 crank angle processing unit, 112 input switching unit, 113 acquisition unit, 114 mask edge calculation unit, 142 edge counter, 141 angle clock generation unit, 161 flag register, 161a frequency division flag register , 161b Edge flag register

Claims (10)

入力された内燃機関のクランク信号またはカム信号に基づいてアングルクロックを生成するアングルクロック生成部(141)と、
前記内燃機関の現在のクランク角に同期した処理を行うクランク角処理部(111)と、
前記アングルクロック生成部への入力を前記クランク信号から前記カム信号に切替えさせる入力切替部(112)と、
前記クランク信号のエッジをカウントしたエッジ数を保持するエッジカウンタ(142)と、
前記クランク信号のエッジ発生に基づくフラグであって、前記クランク角処理部の起床を要求する割り込み要求フラグを保持するフラグレジスタ(161)と、
前記入力切替部による入力切替期間に、前記フラグレジスタの保持状況と、前記エッジ数とを取得する取得部(113)と、
前記取得部の取得した前記フラグレジスタの保持状況と、前記エッジ数の変化の有無とに基づいて、マスクエッジ数を算出するマスクエッジ算出部(114)と、を備える内燃機関制御装置。
An angle clock generation unit (141) that generates an angle clock based on the input crank signal or cam signal of the internal combustion engine,
A crank angle processing unit (111) for performing processing in synchronization with the current crank angle of the internal combustion engine;
An input switching unit (112) for switching the input to the angle clock generation unit from the crank signal to the cam signal,
An edge counter (142) for holding the number of edges counting the edges of the crank signal,
A flag register (161) for holding an interrupt request flag for requesting wake-up of the crank angle processing unit, the flag being based on the edge generation of the crank signal;
An acquisition unit (113) for acquiring the holding status of the flag register and the number of edges during the input switching period by the input switching unit;
An internal combustion engine control device comprising: a mask edge calculation unit (114) that calculates the number of mask edges based on the holding status of the flag register acquired by the acquisition unit and whether or not the number of edges has changed.
前記マスクエッジ算出部は、前記フラグレジスタが割り込み要求ありを示している場合、または前記エッジ数の変化が生じていた場合、前記クランク角処理部を起床させ、割り込みを起床させたエッジを差し引いた前記エッジ数に基づいて前記マスクエッジ数を算出する請求項1に記載の内燃機関制御装置。 When the flag register indicates that there is an interrupt request, or when the number of edges has changed, the mask edge calculation unit wakes up the crank angle processing unit and subtracts the edge that wakes up the interrupt. The internal combustion engine controller according to claim 1, wherein the mask edge number is calculated based on the edge number. 前記マスクエッジ算出部は、前記フラグレジスタが割り込み要求なしを示しており、かつ前記エッジ数の変化が生じていない場合、前記クランク角処理部を起床させず、前記エッジ数に基づいて前記マスクエッジ数を算出する請求項1または2に記載の内燃機関制御装置。 When the flag register indicates that there is no interrupt request and the number of edges has not changed, the mask edge calculation unit does not wake up the crank angle processing unit, and the mask edge is calculated based on the number of edges. The internal combustion engine controller according to claim 1, wherein the number is calculated. 前記クランク角処理部は、前記マスクエッジ算出部により算出された前記マスクエッジ数に従って算出されたクランク角に同期して処理を実行する請求項1〜3のいずれか1項に記載の内燃機関制御装置。 The internal combustion engine control according to any one of claims 1 to 3, wherein the crank angle processing unit executes processing in synchronization with a crank angle calculated according to the number of mask edges calculated by the mask edge calculation unit. apparatus. 前記フラグレジスタは、前記クランク信号のエッジの発生ごとに割り込み要求ありを示す状態となるエッジフラグレジスタ(161b)と、前記クランク信号のエッジのうち分周エッジの発生ごとに割り込み要求ありを示す状態となる分周フラグレジスタ(161a)と、を含み、
前記入力切替部は、前記入力切替期間に、前記エッジフラグレジスタの割り込み要求を有効にする有効化処理と、前記エッジフラグレジスタの保持する割り込み要求をクリアするクリア処理と、を行い、
前記取得部は、前記入力切替期間に、前記分周フラグレジスタの割り込み要求フラグを前記保持状況として取得するフラグ取得処理と、前記エッジ数を取得する第一エッジ数取得処理および第二エッジ数取得処理と、を行い、
前記マスクエッジ算出部は、前記エッジ数の変化の有無として、前記第一エッジ数取得処理および前記第二エッジ数取得処理で取得した前記エッジ数の間の変化の有無を判断する請求項1〜4のいずれか1項に記載の内燃機関制御装置。
The flag register has an edge flag register (161b) which is in a state indicating that an interrupt request is generated each time an edge of the crank signal is generated, and a state in which an interrupt request is generated each time a divided edge of the crank signal edges is generated. And a frequency division flag register (161a)
The input switching unit performs, during the input switching period, a validating process for validating an interrupt request of the edge flag register and a clearing process for clearing an interrupt request held by the edge flag register,
The acquisition unit, during the input switching period, a flag acquisition process that acquires the interrupt request flag of the frequency division flag register as the holding state, a first edge number acquisition process and a second edge number acquisition process that acquires the number of edges. Process and
The mask edge calculation unit determines whether there is a change between the number of edges acquired in the first edge number acquisition processing and the second edge number acquisition processing as the presence or absence of the change in the number of edges. 4. The internal combustion engine controller according to any one of 4 above.
前記取得部は、前記第一エッジ数取得処理を、前記フラグ取得処理よりも前かつ前記クリア処理よりも前に実行し、前記第二エッジ数取得処理を、前記フラグ取得処理よりも後かつ前記クリア処理よりも後に実行し、
前記マスクエッジ算出部は、前記エッジフラグレジスタを割り込み要求ありを示す状態に切替えさせることにより、前記クランク角処理部を起床させる請求項5に記載の内燃機関制御装置。
The acquisition unit executes the first edge number acquisition process before the flag acquisition process and before the clear process, and the second edge number acquisition process after the flag acquisition process and Execute after clearing process,
The internal combustion engine control device according to claim 5, wherein the mask edge calculation unit wakes up the crank angle processing unit by switching the edge flag register to a state indicating that there is an interrupt request.
前記入力切替部は、前記入力切替期間が開始されると、前記有効化処理を行い、
前記取得部は、前記有効化処理の後に前記第一エッジ数取得処理を行い、
前記入力切替部は、前記第一エッジ数取得処理の後に前記クリア処理を行い、
前記取得部は、前記クリア処理の後に前記フラグ取得処理を行い、前記フラグ取得処理の後に前記第二エッジ数取得処理を行う請求項5または6に記載の内燃機関制御装置。
When the input switching period is started, the input switching unit performs the validation process,
The acquisition unit performs the first edge number acquisition process after the activation process,
The input switching unit performs the clear process after the first edge number acquisition process,
The internal combustion engine control device according to claim 5, wherein the acquisition unit performs the flag acquisition process after the clear process, and performs the second edge number acquisition process after the flag acquisition process.
前記取得部は、前記入力切替期間が開始されると、前記第一エッジ数取得処理を行い、
前記入力切替部は、前記第一エッジ数取得処理の後に前記有効化処理を行い、前記有効化処理の後に前記クリア処理を行い、
前記取得部は、前記クリア処理の後に前記フラグ取得処理を行い、前記フラグ取得処理の後に前記第二エッジ数取得処理を行う請求項5または6に記載の内燃機関制御装置。
When the input switching period is started, the acquisition unit performs the first edge number acquisition process,
The input switching unit performs the validation processing after the first edge number acquisition processing, performs the clear processing after the validation processing,
The internal combustion engine control device according to claim 5, wherein the acquisition unit performs the flag acquisition process after the clear process, and performs the second edge number acquisition process after the flag acquisition process.
前記入力切替部は、前記入力切替期間が開始されると、前記有効化処理を行い、
前記取得部は、前記有効化処理の後に前記第一エッジ数取得処理を行い、前記第一エッジ数取得処理の後に前記フラグ取得処理を行い、
前記入力切替部は、前記フラグ取得処理の後に前記クリア処理を行い、
前記取得部は、前記クリア処理の後に前記第二エッジ数取得処理を行う請求項5または6に記載の内燃機関制御装置。
When the input switching period is started, the input switching unit performs the validation process,
The acquisition unit performs the first edge number acquisition process after the activation process, performs the flag acquisition process after the first edge number acquisition process,
The input switching unit performs the clear process after the flag acquisition process,
The internal combustion engine control device according to claim 5, wherein the acquisition unit performs the second edge number acquisition process after the clear process.
前記取得部は、前記入力切替期間が開始されると、前記第一エッジ数取得処理を行い、
前記入力切替部は、前記第一エッジ数取得処理の後に前記有効化処理を行い、
前記取得部は、前記有効化処理の後に前記フラグ取得処理を行い、
前記入力切替部は、前記フラグ取得処理の後に前記クリア処理を行い、
前記取得部は、前記クリア処理の後に前記第二エッジ数取得処理を行う請求項5または6に記載の内燃機関制御装置。
When the input switching period is started, the acquisition unit performs the first edge number acquisition process,
The input switching unit performs the validation processing after the first edge number acquisition processing,
The acquisition unit performs the flag acquisition process after the activation process,
The input switching unit performs the clear process after the flag acquisition process,
The internal combustion engine control device according to claim 5, wherein the acquisition unit performs the second edge number acquisition process after the clear process.
JP2019003702A 2019-01-11 2019-01-11 internal combustion engine controller Active JP7251151B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2019003702A JP7251151B2 (en) 2019-01-11 2019-01-11 internal combustion engine controller
DE102019220373.6A DE102019220373A1 (en) 2019-01-11 2019-12-20 INTERNAL COMBUSTION CONTROL UNIT

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019003702A JP7251151B2 (en) 2019-01-11 2019-01-11 internal combustion engine controller

Publications (2)

Publication Number Publication Date
JP2020112104A true JP2020112104A (en) 2020-07-27
JP7251151B2 JP7251151B2 (en) 2023-04-04

Family

ID=71524209

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019003702A Active JP7251151B2 (en) 2019-01-11 2019-01-11 internal combustion engine controller

Country Status (2)

Country Link
JP (1) JP7251151B2 (en)
DE (1) DE102019220373A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006200484A (en) * 2005-01-21 2006-08-03 Denso Corp Engine control device
JP2012117452A (en) * 2010-12-01 2012-06-21 Hitachi Automotive Systems Ltd Engine control device
JP2013160086A (en) * 2012-02-02 2013-08-19 Hitachi Automotive Systems Ltd Control device for internal combustion engine
JP2018135785A (en) * 2017-02-21 2018-08-30 株式会社デンソー Engine control device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006200484A (en) * 2005-01-21 2006-08-03 Denso Corp Engine control device
JP2012117452A (en) * 2010-12-01 2012-06-21 Hitachi Automotive Systems Ltd Engine control device
JP2013160086A (en) * 2012-02-02 2013-08-19 Hitachi Automotive Systems Ltd Control device for internal combustion engine
JP2018135785A (en) * 2017-02-21 2018-08-30 株式会社デンソー Engine control device

Also Published As

Publication number Publication date
DE102019220373A1 (en) 2020-07-30
JP7251151B2 (en) 2023-04-04

Similar Documents

Publication Publication Date Title
US7942041B2 (en) Engine control device
JP4449760B2 (en) Engine control device
JP4274253B2 (en) ENGINE CONTROL DEVICE AND PROGRAM
JP2007334587A (en) Abnormality monitoring program, recording medium and electronic apparatus
JP2007205242A (en) Engine control device
US7089149B2 (en) Method and apparatus for detecting an angle of a rotating shaft
JP3508676B2 (en) Engine control device
JP3539327B2 (en) Engine control device
JP3503593B2 (en) Engine control device
JP7251151B2 (en) internal combustion engine controller
JP3506116B2 (en) Engine control device
JP4582252B2 (en) Engine control device
JP5870977B2 (en) Rotation angle detection system
JP2018135785A (en) Engine control device
JP2021163425A (en) Electronic control device
JP2012108786A (en) Microcomputer and processing synchronization method
JP2013084059A (en) Electronic control device
JP2004003454A (en) Engine control system
JP4333552B2 (en) Engine control device
JP6003869B2 (en) Engine control device
JP2020148120A (en) Electronic controller and microcomputer
JP7314838B2 (en) electronic controller
JP5794012B2 (en) Electronic control unit
JP6717185B2 (en) Engine controller
JP6071697B2 (en) Internal combustion engine control device, internal combustion engine control method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210625

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220531

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220705

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220830

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221018

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20221212

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230306

R151 Written notification of patent or utility model registration

Ref document number: 7251151

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151