JP2013257165A - Rotational angle detecting device - Google Patents

Rotational angle detecting device Download PDF

Info

Publication number
JP2013257165A
JP2013257165A JP2012131958A JP2012131958A JP2013257165A JP 2013257165 A JP2013257165 A JP 2013257165A JP 2012131958 A JP2012131958 A JP 2012131958A JP 2012131958 A JP2012131958 A JP 2012131958A JP 2013257165 A JP2013257165 A JP 2013257165A
Authority
JP
Japan
Prior art keywords
rotation angle
phase
pulse signal
angle
rotation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012131958A
Other languages
Japanese (ja)
Inventor
Shigenori Mori
重範 森
Keiichi Kato
恵一 加藤
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 JP2012131958A priority Critical patent/JP2013257165A/en
Publication of JP2013257165A publication Critical patent/JP2013257165A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/64Electric machine technologies in electromobility

Abstract

PROBLEM TO BE SOLVED: To enable a rotational angle having a desired level of reliability to be obtained even if any one or two of A, B and Z phase signals become abnormal.SOLUTION: A decoder 1 detects (and decodes) a rotational angle φ of a motor 1 on the basis of A, B and Z phase signals matching the rotation of the motor 1. An angle signal monitoring unit 43 determines abnormality, if any, of one or two of the A, B and Z phase signals. The decoder 1, when all the A, B and Z phase signals are normal, detects the rotational angle φ by a predetermined normal decoding system based on the A, B and Z phase signals. Or if the angle signal monitoring unit 43 determines any one or two of the A, B and Z phase signals to be abnormal, the decoder 1 detects the rotational angle φ by a prescribed abnormal decoding system using one or two other normal phase signals which are not determined to be abnormal.

Description

本発明は、回転体の回転角を検出する回転角検出装置に関する。   The present invention relates to a rotation angle detection device that detects a rotation angle of a rotating body.

電動車両の駆動源となるモータにおいて、モータの位置情報である回転角(ロータの電気角)は、例えばベクトル制御の際の座標変換等のために重要な情報である。回転角を検出するセンサとしては、レゾルバが知られている(例えば、特許文献1参照。)。   In a motor serving as a drive source of an electric vehicle, a rotation angle (electrical angle of a rotor) that is position information of the motor is important information for coordinate conversion in vector control, for example. A resolver is known as a sensor for detecting the rotation angle (see, for example, Patent Document 1).

一般に、レゾルバから出力された角度情報は、RDC(Resolver to Digital Converter)にてデジタルの角度データに変換される。この角度データは、そのまま各種制御に用いられることもあるが、エンコーダにてA,B,Z各相信号に変換されてマイコン等の各種回路へ出力されることも多い。なお、エンコーダにて変換されるA,B,Z各相信号は、周知のインクリメンタル型ロータリエンコーダが出力するA,B,Z各相信号と同じ性質のものである。また、RDCには、エンコーダが内蔵されていてRDC自身がA,B,Z各相信号も出力するよう構成されたものも多い。   In general, angle information output from a resolver is converted into digital angle data by an RDC (Resolver to Digital Converter). The angle data may be used for various controls as it is, but is often converted into A, B, and Z phase signals by an encoder and output to various circuits such as a microcomputer. The A, B, and Z phase signals converted by the encoder have the same properties as the A, B, and Z phase signals output by a known incremental rotary encoder. Also, many RDCs have an encoder built therein so that the RDC itself outputs A, B, and Z phase signals.

従来、A,B,Z各相信号を出力するエンコーダ又はRDC(以下、エンコーダ等という)と、これらA,B,Z各相信号を回転角に変換して各種制御を行うマイコン等の各種制御回路とは、相互に近接して配置されることが一般的であった。そのため、エンコーダ等から各種制御回路へのA,B,Z各相信号の欠損についてはあまり考慮されていなかった。   Conventionally, various controls such as an encoder or RDC (hereinafter referred to as an encoder or the like) that outputs A, B, and Z phase signals and a microcomputer that performs various controls by converting these A, B, and Z phase signals into rotation angles. In general, the circuits are arranged close to each other. Therefore, the loss of the A, B, and Z phase signals from the encoder and the like to various control circuits has not been considered much.

特開2011−95094号公報JP 2011-95094 A

しかしながら、近年、機能安全の観点より、モータの回転角を示すA,B,Z各相信号を、複数の制御回路(複数のマイコン等)で用いる必要性が出てきている。例えば、モータの制御を行う制御マイコン以外に、その制御マイコンの動作を監視するための監視マイコンを搭載する要求があり、その監視マイコンにおいてもモータの回転角情報が必要となる。   However, in recent years, from the viewpoint of functional safety, it has become necessary to use A, B, Z phase signals indicating the rotation angle of a motor in a plurality of control circuits (a plurality of microcomputers, etc.). For example, in addition to the control microcomputer that controls the motor, there is a demand for mounting a monitoring microcomputer for monitoring the operation of the control microcomputer, and the monitoring microcomputer also requires information on the rotation angle of the motor.

これに対応するためには、エンコーダ等からのA,B,Z各相信号を、これら複数の制御回路にそれぞれ伝送する必要がある。そのため、エンコーダ等と複数の制御回路とを近接して配置することが困難となる。   In order to cope with this, it is necessary to transmit the A, B, Z phase signals from the encoder or the like to the plurality of control circuits. Therefore, it is difficult to arrange the encoder and the like and the plurality of control circuits close to each other.

エンコーダ等と制御回路とが離れた位置関係になると、断線や固着などの何らかの要因で、両者間を伝送されるA,B,Z各相信号の何れかが正常に伝送されなくなるおそれがある。このような伝送異常が生じると、A,B,Z各相信号を回転角に変換して各種制御を行う制御回路側では、正常な回転角が得られなくなり、これにより制御を正常に行うことができなくなるおそれがある。   If the encoder or the like is away from the control circuit, any of the A, B, and Z phase signals transmitted between them may not be transmitted normally due to some factor such as disconnection or sticking. When such a transmission abnormality occurs, a normal rotation angle cannot be obtained on the control circuit side that performs various controls by converting the A, B, and Z phase signals into rotation angles. There is a risk that it will not be possible.

本発明は上記課題に鑑みなされたものであり、A,B,Z各相信号の何れか1つ又は2つが異常になっても、これらA,B,Z各相信号から所望の信頼性を有する回転角を得られるようにすることを目的とする。   The present invention has been made in view of the above problems, and even if any one or two of the A, B, and Z phase signals become abnormal, desired reliability can be obtained from these A, B, and Z phase signals. It is an object to obtain a rotation angle having.

上記課題を解決するためになされた本発明の回転角検出装置は、回転角検出手段と、パルス信号判断手段とを備える。
回転角検出手段は、回転体が一定角度回転する毎に入力される、互いに位相がずれた第1及び第2のパルス信号、及び前記回転体が前記一定角度よりも大きい360度/n(nは1以上の整数)回転する毎に入力される第3のパルス信号を用いて、予め決められた所定の通常検出方式により、前記回転体の回転方向を検出しつつその回転角を検出する。
The rotation angle detection device of the present invention made to solve the above problems includes rotation angle detection means and pulse signal determination means.
The rotation angle detection means inputs the first and second pulse signals that are out of phase with each other, and 360 degrees / n (n larger than the certain angle), each time the rotating body rotates by a certain angle. Is an integer greater than or equal to 1) The rotation angle of the rotating body is detected while detecting the direction of rotation of the rotating body by a predetermined normal detection method using a third pulse signal input every time it rotates.

パルス信号判断手段は、前記各パルス信号のうち少なくとも1つについて異常か否かを判断する。
そして、回転角検出手段は、パルス信号判断手段により前記各パルス信号の何れか1つ又は2つが異常と判断された場合は、異常と判断されなかった他の1つ又は2つの正常なパルス信号を用いて、その正常なパルス信号の種類に応じた所定の異常時検出方式により前記回転体の回転角を検出する。
The pulse signal determining means determines whether or not at least one of the pulse signals is abnormal.
Then, the rotation angle detecting means, when any one or two of the respective pulse signals is determined to be abnormal by the pulse signal determining means, is another one or two normal pulse signals that are not determined to be abnormal. The rotation angle of the rotating body is detected by a predetermined abnormality detection method according to the type of the normal pulse signal.

各パルス信号のうち何れか1つ又は2つが正常であれば、各パルス信号全てが正常である場合よりは精度が劣る可能性はあるものの、その正常なパルス信号を用いて、最低限の信頼性を有する回転角を得ることができる。そこで本発明では、各パルス信号のうちどれが正常であるかに応じて異常時検出方式を個々に用意しておき、異常が生じた場合には、他の正常なパルス信号を用いて、その正常なパルス信号に対応した異常時検出方式にて回転角を検出するのである。   If any one or two of the pulse signals are normal, the accuracy may be inferior to the case where all the pulse signals are normal. The rotation angle which has the property can be obtained. Therefore, in the present invention, an abnormality detection method is individually prepared according to which one of the pulse signals is normal, and when an abnormality occurs, another normal pulse signal is used, The rotation angle is detected by an abnormality detection method corresponding to a normal pulse signal.

従って、本発明の回転角検出装置によれば、各パルス信号の何れか1つ又は2つが異常になっても、これら各パルス信号から(詳しくは正常なパルス信号から)所望の信頼性を有する回転角を得ることができる。   Therefore, according to the rotation angle detection device of the present invention, even if any one or two of each pulse signal becomes abnormal, it has a desired reliability from each pulse signal (specifically, from a normal pulse signal). A rotation angle can be obtained.

なお、特許請求の範囲に記載した括弧内の符号は、後述する実施形態に記載の具体的手段等との対応関係を示す一例であって、本発明の技術的範囲を限定するものではない。   In addition, the code | symbol in the parenthesis described in the claim is an example which shows a corresponding relationship with the specific means etc. which are described in embodiment mentioned later, Comprising: The technical scope of this invention is not limited.

実施形態の電気自動車の制御システムを表す構成図である。It is a block diagram showing the control system of the electric vehicle of embodiment. 監視マイコンに入力されるA,B,Z各相信号とこれらに基づいてデコード出力される回転角φを例示する説明図であり、(a)はA,B,Z各相信号正常時の例、(b)はZ相異常時の例、(c)はAB両相異常時の例である。It is explanatory drawing which illustrates A, B, Z each phase signal input into the monitoring microcomputer, and the rotation angle (phi) decoded based on these, (a) is an example at the time of A, B, Z phase signal normal (B) is an example when the Z phase is abnormal, and (c) is an example when the AB phase is abnormal. B相異常が発生した場合の各カウンタのカウンタ値およびこれらに基づいて出力される回転角φの推移を例示する説明図である。It is explanatory drawing which illustrates transition of the counter value of each counter when B phase abnormality generate | occur | produces, and rotation angle (phi) output based on these. 監視マイコン内の角度信号監視部の動作を模式的に表すフローチャートである。It is a flowchart which represents typically operation | movement of the angle signal monitoring part in the monitoring microcomputer. 監視マイコン内のデコーダの動作を模式的に表すフローチャートである。It is a flowchart which represents typically the operation | movement of the decoder in a monitoring microcomputer. 監視マイコン内の制御マイコン監視部(CPU)が実行する監視制御処理を表すフローチャートである。It is a flowchart showing the monitoring control process which the control microcomputer monitoring part (CPU) in a monitoring microcomputer performs. モータ電流と回転角φとの位相関係を表す説明図である。It is explanatory drawing showing the phase relationship between a motor current and rotation angle (phi).

以下に、本発明の好適な実施形態を図面に基づいて説明する。
本実施形態では、本発明を電気自動車に適用した例について説明する。図1に示すように、本実施形態の電気自動車には、走行用モータ(以下単に「モータ」という)1と、バッテリ3と、インバータ5と、走行用モータ制御ECU(以下「MGECU」という)7と、統合制御ECU(以下「EVECU」という)9と、が搭載されている。
Preferred embodiments of the present invention will be described below with reference to the drawings.
In the present embodiment, an example in which the present invention is applied to an electric vehicle will be described. As shown in FIG. 1, the electric vehicle of the present embodiment includes a travel motor (hereinafter simply referred to as “motor”) 1, a battery 3, an inverter 5, and a travel motor control ECU (hereinafter referred to as “MGECU”). 7 and an integrated control ECU (hereinafter referred to as “EVECU”) 9 are mounted.

モータ1は、公知の交流同期モータからなるものである。モータ1の出力軸1aは、ディファレンシャルギヤ10を介して左右の駆動輪11に連結されている。バッテリ3は、充放電可能な周知の2次電池(例えばニッケル水素2次電池)であり、モータ1の駆動に必要な所定の直流電圧(例えば288V)をインバータ5を介してモータ1へ供給する。   The motor 1 is a known AC synchronous motor. The output shaft 1 a of the motor 1 is connected to the left and right drive wheels 11 via a differential gear 10. The battery 3 is a well-known secondary battery (for example, a nickel metal hydride secondary battery) that can be charged and discharged, and supplies a predetermined DC voltage (for example, 288 V) necessary for driving the motor 1 to the motor 1 via the inverter 5. .

インバータ5は、バッテリ3の直流電圧を三相交流に変換し、その変換したU相、V相及びW相の三相交流電流によってモータ1を駆動する。具体的には、本実施形態のインバータ5は、例えばIGBT(絶縁ゲート型バイポーラトランジスタ)等からなる6個のスイッチング素子と、それらスイッチング素子を駆動する駆動回路とを備える。その駆動回路が、MGECU7から入力されるパルス幅変調信号UU,UV,UWに基づいて上記スイッチング素子をオン/オフさせることにより、バッテリ3の直流を三相交流に変換する。   The inverter 5 converts the DC voltage of the battery 3 into a three-phase AC, and drives the motor 1 by the converted U-phase, V-phase, and W-phase three-phase AC currents. Specifically, the inverter 5 of the present embodiment includes six switching elements made of, for example, an IGBT (insulated gate bipolar transistor) and a drive circuit that drives the switching elements. The drive circuit converts the direct current of the battery 3 into a three-phase alternating current by turning on / off the switching element based on the pulse width modulation signals UU, UV, UW input from the MGECU 7.

MGECU7は、インバータ5を介してモータ1を制御する。EVECU9は、当該電気自動車の制御全体を統括するECUである。EVECU9は、MGECU7がモータ1を制御するために必要な各種指令、信号等を生成してMGECU7へ出力する。   The MGECU 7 controls the motor 1 via the inverter 5. The EV ECU 9 is an ECU that controls the entire control of the electric vehicle. The EVECU 9 generates various commands, signals, and the like necessary for the MGECU 7 to control the motor 1 and outputs them to the MGECU 7.

モータ1の出力軸1aには、モータ1の回転角(詳しくは、モータ1のロータの回転角度)を検出するためのセンサとして、レゾルバ13が設けられている。尚、本実施形態でいう回転角度(又は回転角)とは、特に断りのない限り、モータ1の機械的な回転角度ではなく、電気的な角度(いわゆる電気角)を意味するものとする。   The output shaft 1a of the motor 1 is provided with a resolver 13 as a sensor for detecting the rotation angle of the motor 1 (specifically, the rotation angle of the rotor of the motor 1). It should be noted that the rotation angle (or rotation angle) in this embodiment means an electrical angle (so-called electrical angle), not a mechanical rotation angle of the motor 1 unless otherwise specified.

レゾルバ13は、周知の通り、モータ1の回転角θに応じて正弦波状に振幅が変わると共に位相が電気角で90°ずれた2つの回転検出信号Sa,Sbを出力する。即ち、レゾルバ13において、レゾルバの一次コイルに一定周波数の励磁信号f(t)(=sinωt)が供給されることで、二次コイルの各々から、モータ1の回転角θに応じた回転検出信号として、励磁信号f(t)をsinθで振幅変調した波形の回転検出信号Sa(=f(t)・sinθ)と、励磁信号f(t)をcosθで振幅変調した波形の回転検出信号Sb(=f(t)・cosθ)とが出力される。   As is well known, the resolver 13 outputs two rotation detection signals Sa and Sb whose amplitude changes sinusoidally according to the rotation angle θ of the motor 1 and whose phase is shifted by 90 ° in electrical angle. That is, in the resolver 13, the excitation signal f (t) (= sin ωt) having a constant frequency is supplied to the primary coil of the resolver, so that the rotation detection signal corresponding to the rotation angle θ of the motor 1 is output from each of the secondary coils. The rotation detection signal Sa (= f (t) · sin θ) having a waveform obtained by amplitude-modulating the excitation signal f (t) with sin θ, and the rotation detection signal Sb having a waveform obtained by amplitude-modulating the excitation signal f (t) with cos θ. = F (t) · cos θ) is output.

尚、θは、モータ1の実際の機械的回転角度をn倍(nは1以上の整数)した角度であり、レゾルバ13の電気角(モータ1の電気角)を示すものでもある。また、nは、モータ1の一回転あたりにθが回転する回数(即ち、機械角に対する電気角の倍速比)であり、一般には軸倍角と呼ばれる。本実施形態のレゾルバ13は、一例として、軸倍角n=1である。   Note that θ is an angle obtained by multiplying the actual mechanical rotation angle of the motor 1 by n times (n is an integer of 1 or more), and also represents the electrical angle of the resolver 13 (the electrical angle of the motor 1). Further, n is the number of rotations of θ per rotation of the motor 1 (that is, a double speed ratio of the electrical angle with respect to the mechanical angle), and is generally called a shaft double angle. As an example, the resolver 13 of the present embodiment has an axial multiple angle n = 1.

インバータ5からモータ1への各相の電流供給線21,22,23の各々には、各相の電流センサ25,26,27が配設されている。U相電流センサ25は、モータ1のU相電流レベルを検出してこれに対応するU相電流信号を出力する。同様に、V相電流センサ26は、モータ1のV相電流レベルを検出してこれに対応するV相電流信号を出力し、W相電流センサ27は、モータ1のW相電流レベルを検出してこれに対応するW相電流信号を出力する。そして、各電流センサ25〜27からの各相の電流信号は、MGECU7に入力される。尚、図7の上段の波形は、各相電流の波形例を示したものである。   Current sensors 25, 26, and 27 for each phase are disposed in each of the current supply lines 21, 22, and 23 for each phase from the inverter 5 to the motor 1. The U-phase current sensor 25 detects the U-phase current level of the motor 1 and outputs a U-phase current signal corresponding thereto. Similarly, the V-phase current sensor 26 detects the V-phase current level of the motor 1 and outputs a V-phase current signal corresponding thereto, and the W-phase current sensor 27 detects the W-phase current level of the motor 1. A W-phase current signal corresponding to this is output. And the current signal of each phase from each current sensor 25-27 is input into MGECU7. The upper waveform in FIG. 7 shows a waveform example of each phase current.

EVECU9は、アクセルセンサ(図示略)から入力されるアクセル開度を示す信号や、シフトスイッチ(図示略)から入力されるシフト位置を示す信号、車速センサ(図示略)から入力される車速(車両速度)を示す信号などの、車両状態を示す各種信号に基づいて、当該電気自動車における各種の制御を行う。その制御の1つに、トルク指令の生成がある。   The EV ECU 9 includes a signal indicating an accelerator opening input from an accelerator sensor (not shown), a signal indicating a shift position input from a shift switch (not shown), and a vehicle speed (vehicle) input from a vehicle speed sensor (not shown). Various controls in the electric vehicle are performed based on various signals indicating the vehicle state, such as a signal indicating the speed. One of the controls is generation of a torque command.

即ち、EVECU9は、上述した各種信号に基づき、例えばトルクマップ等を用いて、モータ1が出力すべき必要な駆動トルクを決定する。そして、その駆動トルクを示すトルク指令をMGECU7へ出力する。EVECU9は、トルク指令のほか、車速を示す信号(車速信号)もMGECU7へ出力する。   That is, the EV ECU 9 determines a necessary driving torque that the motor 1 should output based on the various signals described above using, for example, a torque map. Then, a torque command indicating the drive torque is output to MGECU 7. In addition to the torque command, the EV ECU 9 also outputs a signal (vehicle speed signal) indicating the vehicle speed to the MGECU 7.

MGECU7は、主に、インバータ5を介してモータ1を制御する制御マイコン30と、この制御マイコン30の動作を監視する監視マイコン40と、パルス幅変調回路(PWM回路)36と、を備えている。   The MGECU 7 mainly includes a control microcomputer 30 that controls the motor 1 via the inverter 5, a monitoring microcomputer 40 that monitors the operation of the control microcomputer 30, and a pulse width modulation circuit (PWM circuit) 36. .

制御マイコン30は、レゾルバ・デジタルコンバータ(RDC)31と、モータ制御部32と、エンコーダ33とを備えている。このうちモータ制御部32は、その実態はCPUであり、CPUが各種プログラムを実行することによりモータ制御部32として機能する。その他、図示は省略したものの、制御マイコン30は、ROM、RAM(SRAM)、I/Oなどの、一般的なマイコンが通常備えている周知の構成要素を備えている。   The control microcomputer 30 includes a resolver / digital converter (RDC) 31, a motor control unit 32, and an encoder 33. Of these, the motor control unit 32 is actually a CPU, and functions as the motor control unit 32 when the CPU executes various programs. In addition, although illustration is omitted, the control microcomputer 30 includes well-known constituent elements that are generally provided in a general microcomputer, such as a ROM, a RAM (SRAM), and an I / O.

RDC31は、レゾルバ13からの各回転検出信号Sa,Sbを角度データ(回転角θ)に変換する周知のハードウェアである。即ち、RDC31は、レゾルバ13に励磁信号f(t)を供給すると共に、レゾルバ13から出出力される回転検出信号Sa,Sbを入力して、その回転検出信号Sa,Sbから、モータ1の回転角を示すデジタルデータ(回転角θ)を出力する。本実施形態のRDC31は、デジタルトラッキング方式のRDCである。デジタルトラッキング方式のRDCによる角度データ変換方法はよく知られているため、ここでは詳細説明を省略する。   The RDC 31 is well-known hardware that converts the rotation detection signals Sa and Sb from the resolver 13 into angle data (rotation angle θ). That is, the RDC 31 supplies an excitation signal f (t) to the resolver 13 and inputs rotation detection signals Sa and Sb output from the resolver 13, and rotates the motor 1 from the rotation detection signals Sa and Sb. Digital data (angle of rotation θ) indicating the angle is output. The RDC 31 in this embodiment is a digital tracking type RDC. Since the angle data conversion method by the RDC of the digital tracking method is well known, detailed description is omitted here.

モータ制御部32は、RDC31からの回転角θを、モータ1の回転角度の検出値として入力すると共に、例えば、その回転角θの単位時間あたりの変化分から、モータ1の回転数(回転速度)を算出する。   The motor control unit 32 inputs the rotation angle θ from the RDC 31 as a detected value of the rotation angle of the motor 1 and, for example, the rotation number (rotation speed) of the motor 1 from the change per unit time of the rotation angle θ. Is calculated.

そして、モータ制御部32は、モータ1の回転情報である回転角θ及び回転数や、電流センサ25〜27からの各相電流信号、EVECU9からのトルク指令値などに基づいて、PWM回路36を介してインバータ5を駆動することにより、車両の運転状態に応じた所望のトルクをモータ1に発生させる。尚、こうしたモータ1の制御自体は公知のものであるが、簡単に説明しておく。   Then, the motor control unit 32 controls the PWM circuit 36 based on the rotation angle θ and the number of rotations which are the rotation information of the motor 1, the respective phase current signals from the current sensors 25 to 27, the torque command value from the EV ECU 9, and the like. By driving the inverter 5 via the motor 1, a desired torque corresponding to the driving state of the vehicle is generated in the motor 1. Although the control of the motor 1 is known, it will be briefly described.

即ち、モータ制御部32は、EVECU9から入力されるトルク指令値に基づいて、そのトルク指令値が示すトルクをモータ1に発生させるための制御信号を、パルス幅変調回路36に出力する。このとき、モータ制御部32は、各電流センサ25〜27からの電流信号のうちの少なくとも2つ(例えば、U相電流信号とW相電流信号)に基づいて、モータ1に流れる三相の各電流がトルク指令値に応じた目標値となるように、パルス幅変調回路36への制御信号(延いては、パルス幅変調回路36からインバータ5へのパルス幅変調信号UU,UV,UW)をフィードバック制御する。   That is, the motor control unit 32 outputs, to the pulse width modulation circuit 36, a control signal for causing the motor 1 to generate the torque indicated by the torque command value based on the torque command value input from the EV ECU 9. At this time, the motor control unit 32 determines each of the three phases flowing through the motor 1 based on at least two of the current signals from the current sensors 25 to 27 (for example, a U-phase current signal and a W-phase current signal). Control signals to the pulse width modulation circuit 36 (and thus pulse width modulation signals UU, UV, UW from the pulse width modulation circuit 36 to the inverter 5) are set so that the current becomes a target value corresponding to the torque command value. Feedback control.

より具体的には、このフィードバック制御における演算は、dq軸回転座標系にて行われる。即ち、入力されるトルク指令値に応じたd・q各軸の電流指令値を演算する一方、各電流センサ25〜27からの各相電流信号を2相(d・q軸)の実電流値に座標変換する。そして、座標変換後の電流指令値と実電流値とに基づくフィードバック制御により、パルス幅変調回路36への制御信号を生成する。上述した座標変換の際、さらにフィードバック制御による制御信号生成の際に、モータ1の回転角θや回転速度が必要となる。   More specifically, the calculation in this feedback control is performed in the dq axis rotating coordinate system. That is, while calculating the current command value of each of the d and q axes in accordance with the input torque command value, each phase current signal from each of the current sensors 25 to 27 is converted into an actual current value of two phases (d and q axes). Convert coordinates to. Then, a control signal to the pulse width modulation circuit 36 is generated by feedback control based on the current command value after the coordinate conversion and the actual current value. At the time of the coordinate conversion described above, and further at the time of generating a control signal by feedback control, the rotation angle θ and the rotation speed of the motor 1 are required.

エンコーダ33は、RDC31にて生成された回転角θ(デジタル値)を、A相信号、B相信号、およびZ相信号の3つの角度信号に変換(エンコード)するものである。これら各相信号は、周知のインクリメンタルエンコーダが出力するA,B,Z各相信号と同じである。   The encoder 33 converts (encodes) the rotation angle θ (digital value) generated by the RDC 31 into three angle signals of an A phase signal, a B phase signal, and a Z phase signal. These phase signals are the same as the A, B, and Z phase signals output by a known incremental encoder.

即ち、図2(a)に示すように、A相信号は、モータ1が電気的に一定角度回転する毎に所定パルス幅のパルスが発生するようなパルス信号である。B相信号も、A相信号と同じく、モータが電気的に一定角度回転する毎に所定パルス幅のパルスが発生するようなパルス信号である。ただし、A相信号とB相信号は互いに位相がずれており、本実施形態では、90度の位相差がある。Z相信号は、モータ1が電気的に一回転する毎に所定パルス幅のパルスが発生するようなパルス信号である。   That is, as shown in FIG. 2A, the A-phase signal is a pulse signal that generates a pulse having a predetermined pulse width every time the motor 1 is electrically rotated by a certain angle. Similarly to the A phase signal, the B phase signal is a pulse signal that generates a pulse having a predetermined pulse width every time the motor is electrically rotated by a certain angle. However, the A phase signal and the B phase signal are out of phase with each other, and in this embodiment, there is a phase difference of 90 degrees. The Z-phase signal is a pulse signal that generates a pulse having a predetermined pulse width every time the motor 1 makes one electrical rotation.

エンコーダ33にてエンコードされたA,B,Z各相信号は、監視マイコン40へ伝送される。即ち、本実施形態では、監視マイコン40においても、モータ1の回転角度に関する情報が必要である。モータ1の回転情報を伝送する具体的方法として、RDC31にて生成された回転角θをそのままパラレル伝送又はシリアル伝送することも考えられる。しかし、パラレル伝送するためには多数の伝送線が必要となる。本実施形態では、角度分解能が12bitであるため、パラレル伝送しようとすると12本の伝送線が必要となり、現実的ではない。一方、シリアル伝送する場合、伝送時間が長くなってしまい、これも現実的ではない。そこで、制御マイコン30内のRDCにて生成された回転角θを、A,B,Z各相信号にエンコードして、監視マイコン40に伝送するようにしている。   The A, B, and Z phase signals encoded by the encoder 33 are transmitted to the monitoring microcomputer 40. That is, in the present embodiment, the monitoring microcomputer 40 also needs information regarding the rotation angle of the motor 1. As a specific method for transmitting the rotation information of the motor 1, it is conceivable that the rotation angle θ generated by the RDC 31 is directly transmitted in parallel or serial. However, a large number of transmission lines are required for parallel transmission. In the present embodiment, since the angular resolution is 12 bits, twelve transmission lines are required for parallel transmission, which is not realistic. On the other hand, when serial transmission is performed, the transmission time becomes long, which is also not realistic. Therefore, the rotation angle θ generated by the RDC in the control microcomputer 30 is encoded into A, B, and Z phase signals and transmitted to the monitoring microcomputer 40.

パルス幅変調回路36は、制御マイコン30からの制御信号に従って、三相交流電流の各相に対応したパルス幅変調信号UU,UV,UWを生成し、それら各パルス幅変調信号UU,UV,UWをインバータ5に出力する。これにより、インバータ5からモータ1へ、U相、V相及びW相の三相交流電流が供給される。   The pulse width modulation circuit 36 generates a pulse width modulation signal UU, UV, UW corresponding to each phase of the three-phase alternating current according to a control signal from the control microcomputer 30, and each of the pulse width modulation signals UU, UV, UW. Is output to the inverter 5. As a result, a U-phase, V-phase, and W-phase three-phase alternating current is supplied from the inverter 5 to the motor 1.

監視マイコン40は、デコーダ41と、制御マイコン監視部42と、角度信号監視部43と、推定カウンタ44とを備えている。このうち制御マイコン監視部42は、その実態はCPUであり、CPUが各種プログラムを実行することにより制御マイコン監視部42として機能する。その他、図示は省略したものの、監視マイコン40は、ROM、RAM(SRAM)、I/Oなどの、一般的なマイコンが通常備えている周知の構成要素を備えている。   The monitoring microcomputer 40 includes a decoder 41, a control microcomputer monitoring unit 42, an angle signal monitoring unit 43, and an estimation counter 44. Of these, the control microcomputer monitoring unit 42 is actually a CPU, and functions as the control microcomputer monitoring unit 42 when the CPU executes various programs. In addition, although illustration is omitted, the monitoring microcomputer 40 includes well-known components that are generally provided in general microcomputers, such as ROM, RAM (SRAM), and I / O.

デコーダ41は、制御マイコン30から伝送されてきた角度信号(A,B,Z各相信号)を、デジタルの角度データ(回転角)φに変換(デコード)する。デコーダ41による具体的なデコード方式は、A,B,Z各相信号の状態に応じて異なる。即ち、本実施形態では、角度信号監視部43がA,B,Z各相信号が正常か否かを監視しており、何れか1つ又は2つが異常となった場合は、その旨を示すダイアグ情報(角度信号ダイアグ)を出力する。デコーダ41は、角度信号監視部43からの角度信号ダイアグの有無、および角度信号ダイアグの種類に応じて、デコード方式を切り替える。   The decoder 41 converts (decodes) the angle signal (A, B, Z phase signals) transmitted from the control microcomputer 30 into digital angle data (rotation angle) φ. The specific decoding method by the decoder 41 differs depending on the states of the A, B, and Z phase signals. That is, in this embodiment, the angle signal monitoring unit 43 monitors whether the A, B, and Z phase signals are normal, and if any one or two becomes abnormal, this is indicated. Diagnostic information (angle signal diagnostic) is output. The decoder 41 switches the decoding method according to the presence / absence of the angle signal diagnosis from the angle signal monitoring unit 43 and the type of the angle signal diagnosis.

角度信号監視部43から角度信号ダイアグが出力されていないとき、即ちA,B,Z各相信号が正常であるときは、デコーダ41は、通常デコード方式Doにてデコードを行う。具体的には、A相信号とB相信号の位相差により、モータ1の回転方向を判別する。本実施形態では、B相信号のエッジが立ち上がった後にA相信号のエッジが立ち上がった場合、A相信号のエッジが立ち上がった後にB相信号のエッジが立ち下がった場合、B相信号のエッジが立ち下がった後にA相信号のエッジが立ち下がった場合、およびA相信号のエッジが立ち下がった後にB相信号のエッジが立ち上がった場合は、モータ1が順方向に回転(順回転)しているものとする。エッジ変化が上記とは逆の場合(例えば、A相信号が立ち下がった後にB相信号が立ち下がった場合など)は、モータ1が逆方向に回転(逆回転)しているものとする。   When the angle signal diagnosis is not output from the angle signal monitoring unit 43, that is, when the A, B, and Z phase signals are normal, the decoder 41 performs decoding by the normal decoding method Do. Specifically, the rotational direction of the motor 1 is determined based on the phase difference between the A phase signal and the B phase signal. In the present embodiment, when the edge of the A phase signal rises after the edge of the B phase signal rises, when the edge of the B phase signal falls after the edge of the A phase signal rises, the edge of the B phase signal becomes When the edge of the A phase signal falls after falling, and when the edge of the B phase signal rises after the falling edge of the A phase signal, the motor 1 rotates in the forward direction (forward rotation). It shall be. When the edge change is opposite to the above (for example, when the B-phase signal falls after the A-phase signal falls), the motor 1 is assumed to rotate in the reverse direction (reverse rotation).

このようにしてモータ1の回転方向を判別しつつ、A相信号およびB相信号それぞれのエッジ立ち上がりおよび立ち下がりが発生する毎に、内蔵するエッジカウンタをカウントアップ又はカウントダウンさせる。本実施形態では、モータ1が順回転している間はエッジカウンタをカウントアップさせ、モータ1が逆回転している間はエッジカウンタをカウントダウンさせる。   The built-in edge counter is incremented or decremented each time the edge rise and fall of the A-phase signal and the B-phase signal occur while discriminating the rotation direction of the motor 1 in this way. In the present embodiment, the edge counter is counted up while the motor 1 is rotating forward, and the edge counter is counted down while the motor 1 is rotating backward.

また、Z相信号は、回転位置の基準を示す信号であり、Z相信号のエッジが立ち上がる毎に、エッジカウンタのカウンタ値を0にリセットする。
そして、このようにしてカウントアップ又はカウントダウンされるエッジカウンタのカウンタ値が、通常デコード方式Doによるデコード結果(回転角φ)として、制御マイコン監視部42へ出力される。なお、Z相信号のエッジ立ち上がりによりリセットされるエッジカウンタのカウンタ値「0」は本発明の初期値に相当し、そのカウンタ値「0」からA,B各相信号(何れか一方が異常の場合は他方の信号)によりカウントアップまたはカウントアップされるカウンタ値が本発明の相対的角度変化量に相当する。
The Z-phase signal is a signal indicating the reference of the rotational position, and the counter value of the edge counter is reset to 0 each time the edge of the Z-phase signal rises.
Then, the counter value of the edge counter counted up or down in this way is output to the control microcomputer monitoring unit 42 as a decoding result (rotation angle φ) by the normal decoding method Do. Note that the counter value “0” of the edge counter that is reset by the rising edge of the Z-phase signal corresponds to the initial value of the present invention, and the A and B phase signals (one of which is abnormal) In this case, the counter value counted up or counted up by the other signal) corresponds to the relative angle change amount of the present invention.

本実施形態では、角度分解能M[bit]は12bitである。即ち、エッジカウンタのカウンタ値がZ相信号により0にリセットされたあと、4095(=2M−1=212−1)までカウントアップされると、再びZ相信号によりカウンタ値が0にリセットされる。なお、本実施形態では、エッジカウンタ自体が、0〜4095までカウントアップ可能な12bitカウンタであるため、仮にZ相信号のエッジ変化が生じなくても、カウンタ値は4095の次は0となる。なお、角度分解能が12bitであることはあくまでも一例であり、分解能をどのように設定するか、A,B各相信号に基づいてどのようにカウントアップ、ダウンさせるか、などについては適宜決めることができる。 In the present embodiment, the angular resolution M [bit] is 12 bits. That is, when the counter value of the edge counter is reset to 0 by the Z-phase signal and then counted up to 4095 (= 2 M -1 = 2 12 -1), the counter value is reset to 0 again by the Z-phase signal. Is done. In this embodiment, since the edge counter itself is a 12-bit counter that can count up from 0 to 4095, even if no edge change of the Z-phase signal occurs, the counter value becomes 0 after 4095. Note that the angular resolution of 12 bits is merely an example, and how to set the resolution and how to count up and down based on the A and B phase signals can be appropriately determined. it can.

図2(a)は、モータ1が順回転している場合であってA,B,Z各相信号がいずれも正常である場合の各相信号の例を示している。このように各相信号がいずれも正常である場合は、デコーダ41は、上述した通常デコード方式Doにてデコードを行う。即ち、A,B各相信号のエッジ変化発生毎にエッジカウンタのカウンタ値はカウントアップされていき、Z相信号の立ち上がりエッジが発生するとカウンタ値は0にリセットされる。そして、そのエッジカウンタのカウンタ値が、最終的なデコード出力(回転角φ)として出力される。   FIG. 2A shows an example of each phase signal when the motor 1 is rotating forward and all the A, B, and Z phase signals are normal. As described above, when each phase signal is normal, the decoder 41 performs decoding by the above-described normal decoding method Do. That is, the counter value of the edge counter is incremented every time the edge change of the A and B phase signals occurs, and the counter value is reset to 0 when the rising edge of the Z phase signal occurs. Then, the counter value of the edge counter is output as the final decoded output (rotation angle φ).

一方、A,B,Z各相信号の何れか1つ又は2つが異常となってことにより角度信号監視部43から角度信号ダイアグが出力されると、デコーダ41は、その角度信号ダイアグに応じた(即ちA,B,Z各相信号のうちどれが異常なのかに応じた)所定の異常時デコード方式に切り替えてデコードを行う。即ち、A,B,Z各相信号のうち正常な信号を用いてデコードを行うのである。各種角度信号ダイアグおよび異常時デコード方式の詳細については後述する。   On the other hand, when one or two of the A, B, and Z phase signals become abnormal and the angle signal diagnosis is output from the angle signal monitoring unit 43, the decoder 41 responds to the angle signal diagnosis. Decoding is performed by switching to a predetermined abnormality decoding system (that is, depending on which of the A, B, and Z phase signals is abnormal). That is, decoding is performed using a normal signal among the A, B, and Z phase signals. Details of the various angle signal diagnostics and the abnormality decoding method will be described later.

制御マイコン監視部42は、制御マイコン30が正常に動作しているかどうか、即ちモータ制御部32による上記フィードバック制御が正常に行われているかどうかを監視する。具体的には、デコーダ41にて生成(デコード)された回転角φおよび各電流センサ25〜27からの各相電流信号に基づいて、モータ1の実際の出力トルクを演算し、EVECU9からのトルク指令値と比較する。そして、その比較結果に基づいて、制御マイコン30の状態を判断する。例えば、演算した出力トルクがトルク指令値と略一致していれば制御マイコン30は正常に動作していると判断し、演算した出力トルクとトルク指令値との差が大きければ制御マイコン30が異常であると判断する。   The control microcomputer monitoring unit 42 monitors whether the control microcomputer 30 is operating normally, that is, whether the feedback control by the motor control unit 32 is normally performed. Specifically, the actual output torque of the motor 1 is calculated based on the rotation angle φ generated (decoded) by the decoder 41 and the phase current signals from the current sensors 25 to 27, and the torque from the EV ECU 9 is calculated. Compare with the command value. Based on the comparison result, the state of the control microcomputer 30 is determined. For example, if the calculated output torque substantially matches the torque command value, it is determined that the control microcomputer 30 is operating normally, and if the difference between the calculated output torque and the torque command value is large, the control microcomputer 30 is abnormal. It is judged that.

制御マイコン監視部42による上記出力トルクの演算およびトルク指令値との比較の具体的方法は、基本的には制御マイコン30のモータ制御部32によるフィードバック制御と同じであり、dq軸回転座標系にて行われる。   The specific method of calculating the output torque by the control microcomputer monitoring unit 42 and comparing it with the torque command value is basically the same as the feedback control by the motor control unit 32 of the control microcomputer 30, and is based on the dq axis rotation coordinate system. Done.

制御マイコン監視部42は、制御マイコン30が異常であると判断した場合、その旨を示すダイアグ情報である制御マイコン異常ダイアグを自身のRAM(SRAM)に記憶すると共に、EVECU9へ出力する。   When the control microcomputer monitoring unit 42 determines that the control microcomputer 30 is abnormal, the control microcomputer monitoring unit 42 stores the control microcomputer abnormality diagnosis, which is diagnosis information indicating the fact, in its own RAM (SRAM) and outputs it to the EV ECU 9.

EVECU9は、監視マイコン40からの制御マイコン異常ダイアグを受信すると、例えばトルク指令値を0(またはその近傍)にしてモータ1の駆動を停止させるようにすると共に、車両の運転者に対して異常が発生している旨の警告等を報知するなどといった、所定の制御マイコン異常対応処理を実行する。なお、制御マイコン異常対応処理の具体的内容は適宜決めることができる。   When receiving the control microcomputer abnormality diagnosis from the monitoring microcomputer 40, the EV ECU 9 stops the drive of the motor 1 by setting the torque command value to 0 (or the vicinity thereof), for example, and an abnormality is detected for the vehicle driver. Predetermined control microcomputer abnormality handling processing, such as notifying a warning to the effect that it has occurred, is executed. Note that the specific contents of the control microcomputer abnormality handling process can be determined as appropriate.

また、制御マイコン監視部42には、角度信号監視部43からの角度信号ダイアグも入力される。そのため、A,B,Z各相信号の異常により角度信号監視部43から角度信号ダイアグが入力された場合は、その角度信号ダイアグを自身のSRAMに記憶すると共に、EVECU9へ出力する。   Further, an angle signal diagnosis from the angle signal monitoring unit 43 is also input to the control microcomputer monitoring unit 42. Therefore, when an angle signal diagnosis is input from the angle signal monitoring unit 43 due to an abnormality in the A, B, Z phase signals, the angle signal diagnosis is stored in its own SRAM and output to the EV ECU 9.

EVECU9は、監視マイコン40から角度信号ダイアグを受信すると、例えば運転者に対して早めに停車させるよう退避走行を促すといった所定の角度信号異常対応処理を実行する。つまり、モータ駆動をすぐに強制的に停止させることまではせず、最低限の退避走行は許容する。なお、角度信号異常対応処理の具体的内容についても適宜決めることができる。   When the EV ECU 9 receives the angle signal diagnosis from the monitoring microcomputer 40, the EV ECU 9 executes a predetermined angle signal abnormality handling process such as prompting the driver to evacuate to stop the vehicle early. In other words, the motor drive is not forcibly stopped immediately, and the minimum retreat travel is allowed. It should be noted that the specific content of the angle signal abnormality handling process can also be determined as appropriate.

推定カウンタ44は、Z相信号に基づいて回転角の推定(カウント)を行う。具体的には、Z相信号のパルス(以下「Z相パルス」ともいう)の発生毎(例えばエッジ立ち上がりタイミング毎)に、そのZ相パルス発生の直近2周期分の各周期に基づいて、1ビット分の角度だけ回転するのに要する時間を推定する。例えば、Z相パルス発生時、前回Z相パルスが発生したタイミング(前回タイミング)から今回Z相パルスが発生したタイミングまでの期間である前周期をTA、前回タイミングの直前にZ相パルスが発生したタイミング(前々回タイミング)から前回タイミングまでの期間である前々周期をTBとしたとき、次式(1)により、次回再びZ相パルスが発生するまでの期間である次周期TZを推定演算する。   The estimation counter 44 estimates (counts) the rotation angle based on the Z-phase signal. Specifically, each time a Z-phase signal pulse (hereinafter also referred to as a “Z-phase pulse”) is generated (for example, every edge rising timing), 1 Z Estimate the time required to rotate by an angle of bits. For example, when a Z-phase pulse is generated, TA is the previous period that is the period from the timing at which the previous Z-phase pulse was generated (previous timing) to the timing at which the current Z-phase pulse was generated, and a Z-phase pulse was generated immediately before the previous timing. When the previous cycle that is the period from the timing (previous timing) to the previous timing is TB, the next cycle TZ that is the period until the next Z-phase pulse is generated is calculated by the following equation (1).

TZ=2・TA−TB ・・・(1)
そして、その推定した次周期TZを用いて、次式(2)により、1ビット分の角度だけ回転するのに要する時間である推定カウント周期Txを推定演算する。
TZ = 2 · TA-TB (1)
Then, using the estimated next period TZ, an estimated count period Tx that is a time required to rotate by an angle of 1 bit is estimated by the following equation (2).

Tx=TZ/2M ・・・(2)
本実施形態の角度分解能は12bitであるため、本実施形態では、上記式(2)の演算は、次周期TZを4096で除算することにより推定カウント周期Txが得られることになる。なお、この推定カウント周期Txの逆数が本発明の回転速度に相当する。
Tx = TZ / 2 M (2)
Since the angular resolution of the present embodiment is 12 bits, in the present embodiment, the calculation of the above equation (2) is obtained by dividing the next period TZ by 4096 to obtain the estimated count period Tx. The reciprocal of this estimated count period Tx corresponds to the rotational speed of the present invention.

推定カウンタ44は、Z相パルスが発生する毎に、上記のように直近2周期に基づいて推定カウント周期Txを推定演算し、その推定カウント周期Txが経過する毎に、カウンタ値を0から1つずつカウントアップ(または4095から1つずつカウントダウン)していく。そして、次にまたZ相パルスが発生したら、再び直近2周期に基づいて新たに推定カウント周期Txを推定演算し、その推定カウント周期Txを用いて再び0からカウントアップ(または4095から1つずつカウントダウン)していく。   Each time the Z-phase pulse is generated, the estimation counter 44 estimates and calculates the estimated count period Tx based on the two most recent periods as described above, and each time the estimated count period Tx elapses, the estimated value is changed from 0 to 1. Count up one by one (or count down from 4095 one by one). Then, when the Z-phase pulse is generated again, the estimated count period Tx is newly calculated again based on the latest two periods, and counted up again from 0 (or 4095 one by one using the estimated count period Tx). Count down).

カウントアップさせるかそれともカウントダウンさせるかは、回転方向に応じて区別する。本実施形態では、推定カウンタ44は、Z相パルスが発生する毎に、デコーダ41にて判断されている回転方向を取得する。そして、その取得した回転方向に基づき、順回転ならば0からカウントアップさせるようにし、逆回転ならば4095からカウントダウンさせる。そして、そのカウンタ値を推定カウンタ値として、デコーダ41へ出力する。   Whether to count up or count down is distinguished according to the direction of rotation. In the present embodiment, the estimation counter 44 acquires the rotation direction determined by the decoder 41 every time a Z-phase pulse is generated. Then, based on the acquired rotation direction, the count is incremented from 0 for forward rotation, and is counted down from 4095 for reverse rotation. Then, the counter value is output to the decoder 41 as an estimated counter value.

このように、推定カウンタ44は、Z相パルス発生毎に、直近2周期分の周期TA,TBに基づいて、次にまたZ相パルスが発生するまでの1周期分における推定カウント周期Txを推定演算する。そして、次にまたZ相パルスが発生するまでは、その演算した推定カウント周期Txにてカウンタ値がカウントアップ(又はカウントダウン)されていくもの(即ちその推定カウント周期Txで回転角φが1/4096度ずつ変化していくもの)と推定して、推定カウンタ値(本発明の推定回転角に相当)を出力する。推定カウンタ44による推定カウンタ値の生成、出力は、監視マイコン40の動作中は常時行われる。   As described above, the estimation counter 44 estimates the estimated count period Tx for one period until the next Z-phase pulse is generated based on the latest two periods TA and TB every time the Z-phase pulse is generated. Calculate. Then, until the next Z-phase pulse is generated, the counter value is counted up (or counted down) in the calculated estimated count period Tx (that is, the rotation angle φ is 1 / in the estimated count period Tx). The estimated counter value (corresponding to the estimated rotation angle of the present invention) is output. Generation and output of the estimated counter value by the estimated counter 44 are always performed while the monitoring microcomputer 40 is operating.

なお、推定カウント周期Txの推定演算方法は種々考えられ、例えば、単に前周期TAを2Mで除算することにより演算してもよいし、逆に、過去3周期分以上の各周期からモータ1の回転速度の変化傾向がより反映された値を演算してもよい。また、過去2周期分の各周期から演算する場合についても、本実施形態のように直近2周期を用いることは必須ではない。但し、演算処理負荷を抑えつつ、現在のモータ1の回転速度の変化傾向をより良く反映した推定カウント周期Txを演算するためには、本実施形態のように直近2周期分の周期に基づいて推定演算するのが好ましい。 Various estimation calculation methods for the estimated count period Tx are conceivable. For example, the calculation may be performed by simply dividing the previous period TA by 2 M , or conversely, the motor 1 from each period of the past three periods or more. You may calculate the value in which the change tendency of the rotation speed was more reflected. Also, in the case of calculating from each period for the past two periods, it is not essential to use the two most recent periods as in the present embodiment. However, in order to calculate the estimated count period Tx that better reflects the current change tendency of the rotation speed of the motor 1 while suppressing the calculation processing load, it is based on the period of the two most recent periods as in this embodiment. It is preferable to perform an estimation calculation.

角度信号監視部43は、制御マイコン30から入力されるA,B,Z各相信号の異常の有無を判断し、何れか1つ又は2つの異常を判断したら、その旨を示す角度信号ダイアグをデコーダ41及び制御マイコン監視部42へ出力する。角度信号監視部43による角度信号異常判断の具体的内容についてより詳しく説明する。   The angle signal monitoring unit 43 determines whether there is an abnormality in the A, B, Z phase signals input from the control microcomputer 30, and when any one or two abnormality is determined, an angle signal diagnosis indicating the fact is performed. The data is output to the decoder 41 and the control microcomputer monitoring unit 42. The specific contents of the angle signal abnormality determination by the angle signal monitoring unit 43 will be described in more detail.

まず、Z相信号の異常判断について説明する。図2(a)に示したように、Z相信号が正常ならば、モータ1が電気的に1回転する毎に、Z相パルスが発生する。しかし、何らかの要因で、図2(b)に例示するように、本来発生すべきタイミングが到来してもZ相パルスが発生しない異常(以下「Z相異常」ともいう)が発生する可能性がある。   First, the abnormality determination of the Z-phase signal will be described. As shown in FIG. 2A, if the Z-phase signal is normal, a Z-phase pulse is generated every time the motor 1 makes one electrical rotation. However, as illustrated in FIG. 2B, for some reason, there is a possibility that an abnormality in which a Z-phase pulse does not occur (hereinafter also referred to as “Z-phase abnormality”) may occur even when the timing to be originally generated arrives. is there.

角度信号監視部43は、このようなZ相異常を、A,B各相信号に基づくエッジカウンタのカウンタ値に基づいて判断する。即ち、エッジカウンタがカウントアップされている場合(順回転時)には、そのカウンタ値が2M−1(本例では4095)から0にカウントアップされるタイミング又はその近傍でZ相パルスが発生しなかった場合に、Z相異常と判断する。より具体的には、本実施形態では、エッジカウンタのカウンタ値が2M−1にカウントアップされたタイミングから0にカウントアップされてさらに1にカウントアップされるタイミングまでの期間にZ相パルスが発生しなかった場合に、Z相異常と判断する。なお、カウンタ値が0になったタイミングでZ相異常の判断を行うようにしてもよい。 The angle signal monitoring unit 43 determines such a Z-phase abnormality based on the counter value of the edge counter based on the A and B phase signals. That is, when the edge counter is counted up (during forward rotation), a Z-phase pulse is generated at or near the timing when the counter value is counted up from 2 M −1 (4095 in this example) to 0. If not, it is determined that the Z phase is abnormal. More specifically, in the present embodiment, the Z-phase pulse is generated during the period from the timing when the counter value of the edge counter is counted up to 2 M −1 until the timing when the counter value is counted up to 0 and further counted up to 1. If it does not occur, it is determined that the Z phase is abnormal. Note that determination of Z-phase abnormality may be made at the timing when the counter value becomes zero.

エッジカウンタがカウントダウンされている場合(逆回転時)には、そのカウンタ値が1から0にカウントダウンされるタイミングの近傍でZ相パルスが発生しなかった場合に、Z相異常と判断する。より具体的には、本実施形態では、エッジカウンタのカウンタ値が0にカウントダウンされたタイミングから2M−1にカウントダウンされてさらに2M−2にカウントダウンされるタイミングまでの期間にZ相パルスが発生しなかった場合に、Z相異常と判断する。なお、逆回転時においても、カウンタ値が0にカウントダウンされたタイミングでZ相異常の判断を行うようにしてもよい。 When the edge counter is counted down (during reverse rotation), it is determined that the Z phase is abnormal when no Z phase pulse is generated near the timing when the counter value is counted down from 1 to 0. More specifically, in the present embodiment, the Z-phase pulse is generated during a period from the timing when the counter value of the edge counter is counted down to 0 to the timing when it is counted down to 2 M −1 and further counted down to 2 M −2. If it does not occur, it is determined that the Z phase is abnormal. Even during reverse rotation, the Z-phase abnormality may be determined at the timing when the counter value is counted down to zero.

図2(b)の例では、モータ1が順回転している場合に、エッジカウンタのカウンタ値が2M−1から0にカウントアップされるタイミングtaでZ相パルスが発生せず、さらにカウンタ値が0から1にカウントアップされるタイミングtbが来てもZ相パルスが発生しないことから、そのタイミングtbで、Z相異常が発生したと判断される。なお、Z相異常を判断するタイミングは、Z相パルスが本来発生すべきタイミングでありながら発止していないことを判別できるかぎり、適宜決めることができる。 In the example of FIG. 2B, when the motor 1 is rotating forward, the Z-phase pulse is not generated at the timing ta when the counter value of the edge counter is counted up from 2 M −1 to 0, and the counter Since the Z-phase pulse does not occur even when the timing tb when the value is counted up from 0 to 1, it is determined that the Z-phase abnormality has occurred at the timing tb. Note that the timing for determining the Z-phase abnormality can be appropriately determined as long as it is possible to determine that the Z-phase pulse is to be generated but not stopped.

角度信号監視部43は、Z相異常が発生したと判断すると、デコーダ41及び制御マイコン監視部42へ、ダイアグ情報として、角度信号ダイアグのうちZ相異常を示すダイアグZを出力する。但し、本実施形態では、Z相異常が発生したと判断した場合にすぐにダイアグZを出力せず、A相信号またはB相信号のいずれかの異常の有無まで判断した上で、その判断結果も含めた角度信号ダイアグを出力するようにしている。   When the angle signal monitoring unit 43 determines that the Z-phase abnormality has occurred, the angle signal monitoring unit 43 outputs a diagnosis Z indicating the Z-phase abnormality in the angle signal diagnosis to the decoder 41 and the control microcomputer monitoring unit 42 as diagnosis information. However, in the present embodiment, when it is determined that a Z-phase abnormality has occurred, the diagnosis Z is not output immediately, and it is determined whether there is an abnormality in either the A-phase signal or the B-phase signal, and the determination result An angle signal diagnostic including the above is output.

なお、角度信号監視部43による、エッジカウンタのカウンタ値に基づくZ相異常の判断は、デコーダ41が備えているエッジカウンタからそのカウンタ値を取得して行うようにしてもよい。ただし、本実施形態では、角度信号監視部43自身が、デコーダ41と同じくエッジカウンタを備え、このエッジカウンタが、角度信号監視部43に入力されるA,B各相信号のパルスの立ち上がりエッジ及び立ち下がりエッジを検出してカウントアップ又はカウントダウンするよう構成されている。そして、その自身が備えるエッジカウンタのカウント値に基づいて、Z相異常の有無を判断するようにしている。   The determination of Z-phase abnormality based on the counter value of the edge counter by the angle signal monitoring unit 43 may be performed by acquiring the counter value from the edge counter provided in the decoder 41. However, in the present embodiment, the angle signal monitoring unit 43 itself includes an edge counter similar to the decoder 41, and this edge counter detects the rising edges of the pulses of the A and B phase signals input to the angle signal monitoring unit 43. The falling edge is detected and counted up or down. Then, based on the count value of the edge counter provided in itself, the presence / absence of Z-phase abnormality is determined.

デコーダ41は、角度信号監視部43からダイアグZが入力されると、デコード方式を、通常デコード方式Doから、異常時デコード方式Dzに切り替える。この異常時デコード方式Dzは、ダイアグZに対応したデコード方式であり、Z相信号以外の他の正常な角度信号であるA相信号及びB相信号を用いてデコードを行う。   When the diagnosis signal Z is input from the angle signal monitoring unit 43, the decoder 41 switches the decoding method from the normal decoding method Do to the abnormal time decoding method Dz. This abnormal-time decoding method Dz is a decoding method corresponding to the diagnosis Z, and performs decoding using an A-phase signal and a B-phase signal which are normal angle signals other than the Z-phase signal.

具体的には、デコーダ41は、A,B各相信号に基づくエッジカウンタのカウントアップ又はカウントダウンを継続して行う。なお、A,B各相信号に基づくエッジカウンタのカウンタ値を、以下、「規定カウント値」ともいう。デコーダ41は、ダイアグZ入力時には、その規定カウント値を、最終的なデコード結果、即ち回転角φとして出力する。   Specifically, the decoder 41 continues to count up or count down the edge counter based on the A and B phase signals. Hereinafter, the counter value of the edge counter based on the A and B phase signals is also referred to as a “specified count value”. When the diagnosis Z is input, the decoder 41 outputs the specified count value as a final decoding result, that is, the rotation angle φ.

従って、ダイアグZ入力時には、デコーダ41は、エッジカウンタによる規定カウント値により、引き続き回転角φを出力することは可能である。また、A,B各相の位相差に基づいて回転方向を検出し、その検出した回転方向に応じてエッジカウンタのカウントアップおよびカウントダウンの切り替えを行うことも可能である。但し、Z相異常であることから、エッジカウンタのカウント値をZ相信号に基づいてリセットすることはできない。   Therefore, when the diagnosis Z is input, the decoder 41 can continuously output the rotation angle φ according to the specified count value by the edge counter. It is also possible to detect the rotation direction based on the phase difference between the A and B phases, and to switch the count up and down of the edge counter according to the detected rotation direction. However, since the Z phase is abnormal, the count value of the edge counter cannot be reset based on the Z phase signal.

次に、A相信号およびB相信号の双方の異常判断について説明する。図2(c)に例示するように、何らかの要因で、A相信号およびB相信号のいずれもパルスが発生しない異常(以下「AB両相異常」ともいう)が発生する可能性がある。言い換えれば、AB両相異常とは、A,B各相信号がいずれもHレベルに固定(以下「H固定」)又はLレベルに固定(以下「L固定」)された状態である。   Next, abnormality determination of both the A phase signal and the B phase signal will be described. As illustrated in FIG. 2C, there is a possibility that an abnormality in which neither the A-phase signal nor the B-phase signal generates a pulse (hereinafter also referred to as “AB both-phase abnormality”) may occur due to some factor. In other words, the AB both-phase abnormality is a state in which the A and B phase signals are both fixed at the H level (hereinafter “H fixed”) or fixed at the L level (hereinafter “L fixed”).

角度信号監視部43は、このようなAB両相異常を、Z相信号に基づいて判断する。即ち、角度信号監視部43は、Z相パルスが発生してから次に再びZ相パルスが発生するまでのZ相信号1周期の期間内にA,B各相信号のパルスが全く発生しなかった場合に、AB両相異常と判断する。そして、AB両相異常が発生したと判断すると、デコーダ41及び制御マイコン監視部42へ、ダイアグ情報として、角度信号ダイアグのうちAB両相異常を示すダイアグABを出力する。   The angle signal monitoring unit 43 determines such AB both-phase abnormality based on the Z-phase signal. That is, the angle signal monitoring unit 43 does not generate any pulses of the A and B phase signals within the period of one cycle of the Z phase signal from the generation of the Z phase pulse to the next generation of the Z phase pulse again. In the case of AB, it is determined that the AB phase is abnormal. Then, when it is determined that an AB both-phase abnormality has occurred, a diagnosis AB indicating an abnormality in both AB phases of the angle signal diagnosis is output to the decoder 41 and the control microcomputer monitoring unit 42 as the diagnosis information.

図2(c)の例では、モータ1が順回転している場合に、タイミングtaでZ相パルスが発生したとき、前回のZ相パルス発生から今回のタイミングtaでのZ相パルス発生までの間にA,B各相のパルスが全く発生しなかったことから、そのタイミングtaでAB両相異常と判断される。   In the example of FIG. 2C, when the Z-phase pulse is generated at the timing ta when the motor 1 is rotating forward, from the previous Z-phase pulse generation to the Z-phase pulse generation at the current timing ta. Since no pulses of the A and B phases occurred in the meantime, it is determined that the AB phase is abnormal at the timing ta.

デコーダ41は、角度信号監視部43からダイアグABが入力されると、デコード方式を、通常デコード方式Doから、異常時デコード方式Dabに切り替える。この異常時デコード方式Dabは、ダイアグABに対応したデコード方式であり、A,B各相信号以外の他の正常な角度信号であるZ相信号に基づくデコードを行う。   When the diagnosis AB is input from the angle signal monitoring unit 43, the decoder 41 switches the decoding method from the normal decoding method Do to the abnormal time decoding method Dab. This abnormal time decoding method Dab is a decoding method corresponding to the diagnosis AB, and performs decoding based on a Z-phase signal which is a normal angle signal other than the A and B phase signals.

具体的には、デコーダ41は、推定カウンタ44からの推定カウンタ値を、最終的なデコード結果、即ち回転角φとして出力する。これにより、制御マイコン監視部42は、その出力された回転角φ、即ち推定カウンタ44にて推定された推定カウンタ値に基づいて、制御マイコン30の監視を行うことになる。   Specifically, the decoder 41 outputs the estimated counter value from the estimated counter 44 as the final decoding result, that is, the rotation angle φ. Thus, the control microcomputer monitoring unit 42 monitors the control microcomputer 30 based on the output rotation angle φ, that is, the estimated counter value estimated by the estimation counter 44.

このように、デコーダ41は、ダイアグAB入力時には、推定カウンタ44からの推定カウンタ値により、引き続き回転角φを出力することは可能である。ただし、この場合の回転角φは、推定カウンタ値に基づくものであるため、実際の回転角との誤差が生じるおそれはある。また、AB両相異常時は、A,B各相信号の位相差に基づく回転方向判別ができない。そのため、デコーダ41は、ダイアグABが入力された場合、その入力される前に判断していた回転方向(A,B各相正常時の回転方向)をそのまま保持する。即ち、ダイアグABが入力された後も、ダイアグAB入力前に判断していた最新の回転方向と同じ回転方向にてモータ1が回転するものと推定する。そのため、推定カウンタ44は、デコーダ41にダイアグABが入力される前後でカウント方法(カウントアップ又はカウントダウン)が変わることはない。   Thus, the decoder 41 can continuously output the rotation angle φ based on the estimated counter value from the estimated counter 44 when the diagnosis AB is input. However, since the rotation angle φ in this case is based on the estimated counter value, an error from the actual rotation angle may occur. Further, when the AB phase is abnormal, the rotational direction cannot be determined based on the phase difference between the A and B phase signals. Therefore, when the diagnosis AB is input, the decoder 41 keeps the rotation direction (the rotation direction when the phases A and B are normal) determined before the input is input. That is, even after the diagnosis AB is input, it is estimated that the motor 1 rotates in the same rotation direction as the latest rotation direction determined before the diagnosis AB is input. Therefore, the estimation counter 44 does not change its counting method (count up or count down) before and after the diagnosis AB is input to the decoder 41.

なお、制御マイコン監視部42は、トルク指令値からd・q各軸の電流指令値を演算する際にモータ1の回転速度が必要となる。制御マイコン監視部42は、通常、この回転速度を、デコーダ41からの回転角φの変化を元に算出するが、AB両相異常時には、Z相パルスの発生タイミングに基づいて算出する。具体的には、前回Z相パルスが発生したタイミング(回転角φが前回0にリセットされたタイミング)から今回Z相パルスが発生したタイミング(回転角φが今回再び0にリセットされたタイミング)までの経過時間に基づいて、回転速度を算出する。なお、制御マイコン監視部42は、Z相信号を直接又はバッファ等を介して間接的に入力し、AB両相異常時にはその入力されているZ相信号に基づいて回転速度を算出するようにしてもよい。   The control microcomputer monitoring unit 42 needs the rotational speed of the motor 1 when calculating the current command value for each of the d and q axes from the torque command value. The control microcomputer monitoring unit 42 normally calculates the rotation speed based on the change in the rotation angle φ from the decoder 41, but calculates the Z-phase pulse generation timing when the AB phase is abnormal. Specifically, from the timing at which the previous Z-phase pulse was generated (timing at which the rotation angle φ was previously reset to 0) to the timing at which the current Z-phase pulse was generated (timing at which the rotation angle φ was reset to 0 again). The rotation speed is calculated based on the elapsed time. The control microcomputer monitoring unit 42 inputs the Z-phase signal directly or indirectly through a buffer or the like, and calculates the rotation speed based on the input Z-phase signal when the AB phase is abnormal. Also good.

次に、A相信号またはB相信号のいずれか一方の異常判断について説明する。図3に例示するように、何らかの要因で、A相信号またはB相信号のいずれか一方においてパルスが発生しない異常が発生する可能性がある。以下、A相信号のパルスが発生しない異常を「A相異常」といい、B相信号のパルスが発生しない異常を「B相異常」という。なお、A相異常は、言い換えれば、A相信号がH固定又はL固定された状態であり、B相異常は、言い換えれば、B相信号がH固定又はL固定された状態である。   Next, the abnormality determination of either the A phase signal or the B phase signal will be described. As illustrated in FIG. 3, there is a possibility that an abnormality in which no pulse is generated in one of the A-phase signal and the B-phase signal may occur due to some factor. Hereinafter, an abnormality in which a pulse of the A phase signal does not occur is referred to as “A phase abnormality”, and an abnormality in which the pulse of the B phase signal does not occur is referred to as “B phase abnormality”. In other words, the A phase abnormality is a state in which the A phase signal is fixed to H or L, and the B phase abnormality is in other words, the state in which the B phase signal is fixed to H or L.

角度信号監視部43は、A,B各相信号の相互比較により、A相異常またはB相異常を判断する。ここで、一例として、B相異常が発生した場合のそのB相異常の判断方法について、図3を用いて説明する。ただし、モータ1は順回転しているものとする。   The angle signal monitoring unit 43 determines an A phase abnormality or a B phase abnormality by comparing the A and B phase signals. Here, as an example, a method for determining a B phase abnormality when a B phase abnormality occurs will be described with reference to FIG. However, it is assumed that the motor 1 is rotating forward.

図3は、時刻taでA相信号のパルスが立ち上がった後の時刻tbで、B相異常(本例ではB相信号のH固定)が発生した例を示している。仮に正常ならば、時刻taでA相信号が立ち上がった後、時刻tcでB相信号が立ち下がるはずである。しかし、時刻tcより前の時刻tbでB相異常が発生したため、時刻tcではB相信号は立ち下がらない。   FIG. 3 shows an example in which a B-phase abnormality (fixed to H of the B-phase signal in this example) occurs at time tb after the A-phase signal pulse rises at time ta. If it is normal, the B phase signal should fall at time tc after the A phase signal rises at time ta. However, since a B-phase abnormality has occurred at time tb prior to time tc, the B-phase signal does not fall at time tc.

そのため、本来正常ならば、デコーダ41は、時刻taでエッジカウンタのカウンタ値を5にカウントアップした後、時刻tcでB相信号立ち下がりによりエッジカウンタ値を6にカウントアップするはずだが、ここではカウントアップすることなく、カウンタ値は5のままである。そのため、時刻tcが過ぎても、デコーダ41が出力する回転角φは5のままである。   Therefore, if it is normally normal, the decoder 41 should count up the counter value of the edge counter to 5 at time ta and then count up the edge counter value to 6 at the time tc due to the fall of the B phase signal. The counter value remains at 5 without counting up. Therefore, even after time tc, the rotation angle φ output by the decoder 41 remains at 5.

時刻tcでB相信号が立ち下がることなく(Hレベルに維持されたまま)、時刻tdでA相信号が立ち下がると、デコーダ41は、この時刻tdにて、B相信号がHレベルの状態でA相信号が立ち下がったことから、モータ1の回転方向が逆回転に変わったものと判断する。そのため、エッジカウンタのカウント方法をカウントアップからカウントダウンに切り替える。これにより、エッジカウンタのカウンタ値(規定カウント値)は、時刻tdにて、5から4にカウントダウンされる。そのため、デコーダ41が出力する回転角φも4となる。   If the B-phase signal falls at time td without the B-phase signal falling (maintained at the H level) at time tc, the decoder 41 determines that the B-phase signal is at the H level at time td. Therefore, it is determined that the rotation direction of the motor 1 has changed to reverse rotation. Therefore, the counting method of the edge counter is switched from counting up to counting down. Thereby, the counter value (specified count value) of the edge counter is counted down from 5 to 4 at time td. Therefore, the rotation angle φ output from the decoder 41 is also 4.

その後、もし実際に逆回転していて且つB相信号が正常ならば、時刻tdでA相信号が立ち下がった後、続いてB相信号が立ち下がるはずである。しかし本例では、実際には逆回転しておらず、B相信号がHレベルに維持されたままであるため、時刻tdの後、時刻teにてA相信号が再び立ち上がる。   After that, if the rotation is actually reverse and the B-phase signal is normal, the B-phase signal should fall after the A-phase signal falls at time td. However, in this example, since the reverse rotation is not actually performed and the B-phase signal remains at the H level, the A-phase signal rises again at time te after time td.

すると、デコーダ41は、この時刻teにて、B相信号がHレベルの状態でA相信号が立ち上がったことから、モータ1の回転方向が逆回転から再び順回転に変わったものと判断する。そのため、エッジカウンタのカウント方法をカウントダウンからカウントアップに切り替える。これにより、デコーダ41は、エッジカウンタのカウンタ値(規定カウント値)を、時刻teにて、4から5にカウントアップする。   Then, at this time te, the decoder 41 determines that the rotation direction of the motor 1 has changed from the reverse rotation to the forward rotation again because the A phase signal has risen while the B phase signal is at the H level. Therefore, the counting method of the edge counter is switched from countdown to countup. Thereby, the decoder 41 counts up the counter value (specified count value) of the edge counter from 4 to 5 at time te.

一方、角度信号監視部43も、既述の通りエッジカウンタを備え、デコーダ41と同様に回転方向を判別しつつエッジカウントを行っている。そのため、時刻Tdにおける逆回転判定、および時刻teにおける順回転判定も、デコーダ41と同様に行う。   On the other hand, the angle signal monitoring unit 43 also includes an edge counter as described above, and performs edge counting while discriminating the rotation direction in the same manner as the decoder 41. Therefore, reverse rotation determination at time Td and forward rotation determination at time te are also performed in the same manner as the decoder 41.

そして、角度信号監視部43は、時刻teにて、エッジ変化が生じる度に回転方向が連続的に切り替わったことから、実際には回転方向が変わったのではなくB相信号がH固定されているものと判断する。つまり、角度信号監視部43は、エッジ変化毎に連続的に回転方向が順回転→逆回転→順回転、または逆回転→順回転→逆回転、と切り替わった場合に、その間エッジ変化が生じていない方の信号の異常(H固定またはL固定)を判断するのである。言い換えれば、一方のエッジ変化が連続して3回生じた期間中(図3の例では時刻ta〜時刻te)に他方のパルス信号のエッジ変化が生じなかった場合に、その他方を異常と判断するのである。なお、「3回」というのは一例であって、4回以上としてもよい。即ち、一方のエッジ変化が連続して4回以上生じた期間中に他方のエッジ変化が生じなかった場合にその他方を異常と判断するようにしてもよい。   Then, since the rotation direction is continuously switched every time an edge change occurs at the time te, the angle signal monitoring unit 43 does not actually change the rotation direction but the B-phase signal is fixed to H. Judge that there is. That is, the angle signal monitoring unit 43 continuously changes the edge direction every time the edge changes, such as forward rotation → reverse rotation → forward rotation or reverse rotation → forward rotation → reverse rotation. The abnormality of the signal that is not present (H fixed or L fixed) is determined. In other words, if the edge change of the other pulse signal does not occur during the period in which one edge change has occurred three times in succession (time ta to time te in the example of FIG. 3), the other is determined to be abnormal. To do. Note that “three times” is an example, and may be four times or more. That is, when the other edge change does not occur during a period in which one edge change occurs four or more times continuously, the other may be determined as abnormal.

図3の例では、角度信号監視部43は、時刻teで、B相信号のH固定、即ちB相異常を判断する。そして、デコーダ41及び制御マイコン監視部42へ、ダイアグ情報として、角度信号ダイアグのうちB相異常を示すダイアグBを出力する。   In the example of FIG. 3, the angle signal monitoring unit 43 determines that the B phase signal is fixed to H, that is, the B phase abnormality at time te. Then, to the decoder 41 and the control microcomputer monitoring unit 42, the diagnosis B indicating the B phase abnormality is output as the diagnosis information.

デコーダ41は、角度信号監視部43からダイアグBが入力されると、デコード方式を、通常デコード方式Doから、異常時デコード方式Dbに切り替える。この異常時デコード方式Dbは、ダイアグBに対応したデコード方式であり、A,B各相信号のうち正常な角度信号であるA相信号に基づくデコードを行うことを基本としつつ、適宜、推定カウンタ44からの推定カウンタ値による補間も行うものである。なお、Z相パルス発生毎に回転角φを0にリセットすることは正常時と同様である。   When the diagnosis B is input from the angle signal monitoring unit 43, the decoder 41 switches the decoding method from the normal decoding method Do to the abnormal time decoding method Db. This abnormal time decoding method Db is a decoding method corresponding to the diagnosis B, and is based on performing decoding based on the A phase signal which is a normal angle signal among the A and B phase signals, and appropriately estimating the estimation counter. Interpolation by the estimated counter value from 44 is also performed. The rotation angle φ is reset to 0 every time the Z-phase pulse is generated as in the normal state.

具体的には、デコーダ41は、エッジカウンタのカウンタ値を補正すると共に、以後、エッジカウンタによるカウントを、A相信号のエッジ変化が生じる毎に2つずつカウントアップさせるようにする。即ち、もしB相信号が正常であったならば、時刻teの時点で、エッジカウンタのカウンタ値(規定カウント値)は9になっているはずである。つまり、時刻taでカウンタ値が5にカウントアップされてから4カウント分アップされているはずである。しかし、上記のように回転方向の変化と誤判断してしまったことにより、時刻teの時点でカウンタ値は5になっている。   Specifically, the decoder 41 corrects the counter value of the edge counter and thereafter increments the count by the edge counter by two every time an edge change of the A-phase signal occurs. That is, if the B-phase signal is normal, the counter value (specified count value) of the edge counter should be 9 at time te. That is, after the counter value is counted up to 5 at time ta, it should have been increased by 4 counts. However, the counter value is set to 5 at the time te because it is erroneously determined as a change in the rotation direction as described above.

そこでデコーダ41は、時刻teにて一旦はカウンタ値を5にしたものの、角度信号監視部43からのダイアグB入力により、そのカウンタ値にさらに4を加えて9とする。つまり、カウンタ値を正常な値に更新する。そして、その更新した値(9)を、時刻teにおける回転角φとして出力する。そして、時刻te以後は、A相信号のエッジ変化が生じる毎に、エッジカウンタのカウンタ値を2つずつカウントアップしていく。この時te以後の、2つずつカウントアップされるエッジカウンタのカウンタ値を、以下「変則カウント値」ともいう。   Therefore, the decoder 41 once sets the counter value to 5 at time te, but further adds 4 to the counter value to 9 by the diagnosis B input from the angle signal monitoring unit 43. That is, the counter value is updated to a normal value. Then, the updated value (9) is output as the rotation angle φ at time te. After the time te, every time the edge change of the A phase signal occurs, the counter value of the edge counter is incremented by two. The counter value of the edge counter that is incremented by two after this time te is also referred to as “anomalous count value”.

図3の例では、時刻teでダイアグBが入力されたことにより、デコーダ41が、デコード方式を異常時デコード方式Dbに切り替え、これによりA相信号のエッジ変化が生じる毎にエッジカウンタのカウンタ値(変則カウント値)を9→11→13→・・・と2つずつカウントアップしていく例が示されている。そして、基本的には、この2つ飛びの値が、回転角φとして出力される。   In the example of FIG. 3, when the diagnosis B is input at time te, the decoder 41 switches the decoding method to the abnormal time decoding method Db, and thereby the counter value of the edge counter is generated every time the edge change of the A phase signal occurs. An example is shown in which (anomalous count value) is counted up by two from 9 → 11 → 13 →. Basically, these two skip values are output as the rotation angle φ.

しかし、この2つ飛びで出力される回転角φは、正常時に比べて角度分解能が1/2に低下している。もちろん、この分解能が低下した回転角φを用いても、制御マイコン監視部42は、制御マイコン30の監視を行うことができるのであるが、監視機能をより十分に果たすためには、回転角φの分解能は少しでも高い方がよい。   However, the angle resolution of the rotation angle φ that is output in two skips is halved compared to the normal time. Of course, the control microcomputer monitoring unit 42 can monitor the control microcomputer 30 even when the rotation angle φ with the reduced resolution is used. However, in order to perform the monitoring function more sufficiently, the rotation angle φ The resolution should be as high as possible.

そこで本実施形態のデコーダ41は、B相異常時、推定カウンタ値を用いてデコード出力の補間を行う。即ち、デコーダ41は、B相異常によりエッジカウンタのカウント方法を2つ飛びに切り替えた後、そのカウンタ値(変則カウント値)がnからn+2にカウントアップされるまでに(即ち変則カウント値がnの間に)推定カウンタ値がnからn+1に変化した場合は、変則カウント値はnであるものの、最終的に出力する回転角φは、推定カウント値の方を優先してn+1を出力するのである。そして、その後変則カウント値がn+2にカウントアップされたら、最終的に出力する回転角φも再びその変則カウント値であるn+2に戻す。   Accordingly, the decoder 41 of this embodiment performs interpolation of the decoded output using the estimated counter value when the B phase is abnormal. That is, the decoder 41 switches the counting method of the edge counter to two skips due to the B phase abnormality and then counts up from n to n + 2 (that is, the irregular count value is n). When the estimated counter value changes from n to n + 1), the irregular count value is n, but the rotation angle φ to be finally output is n + 1 giving priority to the estimated count value. is there. After that, when the irregular count value is counted up to n + 2, the rotation angle φ that is finally output is also returned to the irregular count value n + 2.

図3の例では、時刻teでB相異常が判断され、これによりエッジカウンタのカウンタ値(変則カウント値)は9となる。その後、変則カウント値は、A相信号のエッジ変化が生じる時刻tfまでは9のままであり、時刻tfでA相信号のエッジ変化が生じると、11にカウントアップされる。   In the example of FIG. 3, the B-phase abnormality is determined at time te, and thereby the counter value (anomalous count value) of the edge counter becomes 9. Thereafter, the irregular count value remains 9 until time tf when the edge change of the A phase signal occurs, and is incremented to 11 when the edge change of the A phase signal occurs at time tf.

一方、この時刻te〜時刻tfの間、推定カウンタ44からの推定カウンタ値は、時刻txにて9から10に変化する。そこで、デコーダ41は、この時刻txにて、最終的に出力する回転角φを10にする。同様に、時刻tfで変則カウント値が11にカウントアップされてから時刻tgで変則カウント値が13にカウントアップされるまでの間についても、基本的にはその変則カウント値を回転角φとして出力するものの、時刻tyで推定カウンタ値が11から12に変化したため、この時刻tyにて、最終的に出力する回転角φも12とする。   On the other hand, during this time te to time tf, the estimated counter value from the estimated counter 44 changes from 9 to 10 at time tx. Therefore, the decoder 41 sets the rotation angle φ to be finally output to 10 at this time tx. Similarly, from the time when the irregular count value is counted up to 11 at time tf until the time when the irregular count value is counted up to 13 at time tg, the irregular count value is basically output as the rotation angle φ. However, since the estimated counter value has changed from 11 to 12 at time ty, the rotation angle φ that is finally output at time ty is also 12.

つまり、A相信号のエッジ変化に基づく変則カウント値を、推定カウンタ値で補間することで、角度分解能を上げるのである。なお、変則カウント値がnからn+2に変化する間に推定カウンタ値がn+1とならなかった場合は、推定カウンタ値による補間は行わない。   That is, the angular resolution is increased by interpolating the irregular count value based on the edge change of the A phase signal with the estimated counter value. If the estimated counter value does not become n + 1 while the irregular count value changes from n to n + 2, interpolation using the estimated counter value is not performed.

このように、B相異常時のデコード方式である異常時デコード方式Dbは、A相信号に基づく変則カウンタ値(2つ飛びの値)を用いることを基本としつつ、推定カウンタ44からの推定カウンタ値による補間も行うようにするものである。また、回転方向については、B相異常と判断される前の回転方向を保持する。即ち、B相信号が異常の場合、A,B各相信号の位相差に基づく回転方向の判別はできない。そこで、B相異常と判断される前に判別している回転方向、即ち角度信号監視部43からダイアグBが入力される直前に判別していた回転方向(本例では順回転)を、以後もそのまま用いる。   As described above, the abnormal-time decoding method Db, which is a decoding method when the B-phase is abnormal, is based on the use of the irregular counter value (two skipped values) based on the A-phase signal, and the estimated counter from the estimated counter 44. Interpolation by value is also performed. Moreover, about the rotation direction, the rotation direction before it is judged as B phase abnormality is hold | maintained. That is, when the B phase signal is abnormal, the rotation direction cannot be determined based on the phase difference between the A and B phase signals. Therefore, the rotation direction determined before the B-phase abnormality is determined, that is, the rotation direction determined immediately before the diagnosis B is input from the angle signal monitoring unit 43 (forward rotation in this example) is also applied thereafter. Use as is.

なお、図3では、モータ1が順回転しているときにB相異常が生じたケースを例示したが、モータ1が逆回転している場合も基本的には同じ要領でB相異常の判断を行う。逆回転時が順回転時と異なる主な点は、各カウンタがカウントダウンされること、これに伴い、ダイアグB入力時にデコーダ41はその時点でのカウント値(規定カウント値)から4を減算することでカウント値の更新を行うこと、などである。   FIG. 3 illustrates the case where the B-phase abnormality occurs when the motor 1 is rotating forward. However, the determination of the B-phase abnormality is basically performed in the same manner when the motor 1 is rotating backward. I do. The main difference between the reverse rotation and the forward rotation is that each counter is counted down, and accordingly, when the diagnosis B is input, the decoder 41 subtracts 4 from the count value (specified count value) at that time. And updating the count value.

また、A相異常の判断についても、B相異常の判断と全く同じように行うことができる。即ち、A相信号のエッジ変化がなく、B相信号のエッジが変化する毎に回転方向が順回転→逆回転→順回転、または逆回転→順回転→逆回転、と連続的に切り替わった場合に、A相異常(A相信号のH固定またはL固定)を判断する。角度信号監視部43は、A相異常と判断した場合は、デコーダ41及び制御マイコン監視部42へ、ダイアグ情報として、角度信号ダイアグのうちA相異常を示すダイアグAを出力する。   Further, the determination of the A phase abnormality can be performed in the same manner as the determination of the B phase abnormality. That is, when there is no change in the edge of the A phase signal and the rotation direction is continuously switched from forward rotation → reverse rotation → forward rotation or reverse rotation → forward rotation → reverse rotation every time the edge of the B phase signal changes. Next, it is determined whether the A phase is abnormal (A phase signal is fixed to H or L). When the angle signal monitoring unit 43 determines that the A phase abnormality has occurred, the angle signal monitoring unit 43 outputs a diagnosis A indicating the A phase abnormality in the angle signal diagnosis to the decoder 41 and the control microcomputer monitoring unit 42 as diagnosis information.

デコーダ41は、角度信号監視部43からダイアグAが入力されると、デコード方式を、通常デコード方式Doから、異常時デコード方式Daに切り替える。この異常時デコード方式Daは、ダイアグAに対応したデコード方式であり、A,B各相信号のうち正常な角度信号であるB相信号に基づくデコードを行うことを基本としつつ、適宜、推定カウンタ44からの推定カウンタ値による補間も行うものである。   When the diagnosis A is input from the angle signal monitoring unit 43, the decoder 41 switches the decoding method from the normal decoding method Do to the abnormal time decoding method Da. This abnormal-time decoding method Da is a decoding method corresponding to the diagnosis A, and is based on performing decoding based on the B phase signal which is a normal angle signal among the A and B phase signals, and appropriately estimating the counter. Interpolation by the estimated counter value from 44 is also performed.

具体的には、デコーダ41は、B相異常時と同様、エッジカウンタのカウンタ値を補正(+4または−4)すると共に、以後、エッジカウンタによるカウントを、B相信号のエッジ変化が生じる毎に2つずつカウントアップさせるようにする。さらに、B相異常時と同様、推定カウンタ値による補間が可能なら補間も行う。   Specifically, the decoder 41 corrects the counter value of the edge counter (+4 or −4) as in the case of the B phase abnormality, and thereafter counts the edge counter every time an edge change of the B phase signal occurs. Count up by two. Further, as in the case of B-phase abnormality, interpolation is also performed if interpolation based on the estimated counter value is possible.

また、角度信号監視部43は、Z相異常を判断した場合は、さらに、A相信号またはB相信号が正常か否かの判断も行う。Z相異常の判断は、既述の通り、エッジカウンタが0に切り替わるタイミング近傍でZ相パルスが生じるか否かに基づいて行う。そして、Z相異常と判断すると、引き続き、A相異常またはB相異常の有無を、A,B各相信号に基づく既述の方法(図3を用いて説明した方法)で行う。   In addition, when the Z-phase abnormality is determined, the angle signal monitoring unit 43 further determines whether the A-phase signal or the B-phase signal is normal. As described above, the Z-phase abnormality is determined based on whether or not a Z-phase pulse is generated in the vicinity of the timing at which the edge counter is switched to 0. If it is determined that there is a Z-phase abnormality, the presence or absence of an A-phase abnormality or a B-phase abnormality is subsequently performed by the method described above (the method described with reference to FIG. 3) based on the A and B phase signals.

即ち、Z相異常と判断した後、A,B各相信号のエッジ変化が交互に所定回数続いたら、A,B各相信号は正常であるものとして、ダイアグZを出力する。一方、Z相異常の判断後、A,B各相信号のエッジ変化が交互に所定回数続くことなく、例えばB相信号がH固定またはL固定となってA相信号のエッジ変化のみ生じるようになった場合は、上述した要領(図3参照)でB相異常の判断も行う。つまり、結果としてB相信号とZ相信号の双方が異常(以下「BZ両相異常」ともいう)であると判断されることになる。   That is, if it is determined that the Z phase is abnormal, and the edge changes of the A and B phase signals continue alternately a predetermined number of times, the diagnosis Z is output assuming that the A and B phase signals are normal. On the other hand, after the determination of the Z-phase abnormality, the edge changes of the A and B phase signals do not continue alternately for a predetermined number of times, for example, the B phase signal is fixed to H or L and only the edge change of the A phase signal occurs. If this happens, the B phase abnormality is also determined in the manner described above (see FIG. 3). That is, as a result, both the B-phase signal and the Z-phase signal are determined to be abnormal (hereinafter also referred to as “BZ both-phase abnormality”).

そして、角度信号監視部43は、BZ両相異常と判断すると、デコーダ41及び制御マイコン監視部42へ、ダイアグ情報として、角度信号ダイアグのうちBZ両相異常を示すダイアグBZを出力する。   When the angle signal monitoring unit 43 determines that the BZ both-phase abnormality is present, the angle signal monitoring unit 43 outputs a diagnosis BZ indicating the BZ both-phase abnormality in the angle signal diagnosis to the decoder 41 and the control microcomputer monitoring unit 42.

デコーダ41は、角度信号監視部43からダイアグBZが入力されると、デコード方式を、通常デコード方式Doから、異常時デコード方式Dbzに切り替える。この異常時デコード方式Dbzは、ダイアグBZに対応したデコード方式であり、B,Z各相信号以外の他の正常な角度信号であるA相信号を用いてデコードを行う。つまり、図3の時刻te以降のカウンタ値(変則カウント値)と同じ要領であり、ダイアグBZが入力された場合、まず、その時点でのエッジカウンタのカウンタ値(規定カウンタ値)を正規の値に更新する(+4または−4)。そして、A相信号のエッジ変化が生じる毎に、エッジカウンタを2つずつカウントアップ(またはカウントダウン)させていく。従って、BZ両相異常時は、A相信号に基づく変則カウント値が回転角φとして出力されることになる。   When the diagnosis BZ is input from the angle signal monitoring unit 43, the decoder 41 switches the decoding method from the normal decoding method Do to the abnormal time decoding method Dbz. This abnormal-time decoding method Dbz is a decoding method corresponding to the diagnosis BZ, and performs decoding using an A phase signal which is a normal angle signal other than the B and Z phase signals. That is, in the same way as the counter value (anomalous count value) after time te in FIG. 3, when the diagnosis BZ is input, first, the counter value (specified counter value) of the edge counter at that time is a normal value. (+4 or -4). Each time an edge change occurs in the A-phase signal, the edge counter is incremented by two (or counted down). Therefore, when both BZ phases are abnormal, an irregular count value based on the A phase signal is output as the rotation angle φ.

また、Z相異常の判断後、A,B各相信号のエッジ変化が交互に所定回数続くことなく、例えばA相信号がH固定またはL固定となってB相信号のエッジ変化のみ生じるようになった場合は、A相異常の判断も行う。つまり、結果としてA相信号とZ相信号の双方が異常(以下「AZ両相異常」ともいう)であると判断されることになる。   Further, after the determination of the Z-phase abnormality, the edge changes of the A and B phase signals do not continue alternately for a predetermined number of times, for example, the A phase signal is fixed to H or fixed to L and only the edge change of the B phase signal occurs. If this happens, the phase A abnormality is also judged. That is, as a result, it is determined that both the A-phase signal and the Z-phase signal are abnormal (hereinafter also referred to as “AZ both-phase abnormality”).

そして、角度信号監視部43は、AZ両相異常と判断すると、デコーダ41及び制御マイコン監視部42へ、ダイアグ情報として、角度信号ダイアグのうちAZ両相異常を示すダイアグAZを出力する。   When the angle signal monitoring unit 43 determines that the AZ phase abnormality has occurred, the angle signal monitoring unit 43 outputs a diagnosis AZ indicating the AZ phase abnormality in the angle signal diagnosis to the decoder 41 and the control microcomputer monitoring unit 42.

デコーダ41は、角度信号監視部43からダイアグAZが入力されると、デコード方式を、通常デコード方式Doから、異常時デコード方式Dazに切り替える。この異常時デコード方式Dazは、ダイアグAZに対応したデコード方式であり、A,Z各相信号以外の他の正常な角度信号であるB相信号を用いてデコードを行う。つまり、上述したBZ両相異常と同じ要領であり、ダイアグAZが入力された場合、まず、その時点でのエッジカウンタのカウンタ値(規定カウンタ値)を正規の値に更新する(+4または−4)。そして、B相信号のエッジ変化が生じる毎に、エッジカウンタを2つずつカウントアップ(またはカウントダウン)させていく。従って、AZ両相異常時は、B相信号に基づく変則カウント値が回転角φとして出力されることになる。   When the diagnosis AZ is input from the angle signal monitoring unit 43, the decoder 41 switches the decoding method from the normal decoding method Do to the abnormal time decoding method Daz. This abnormal-time decoding method Daz is a decoding method corresponding to the diagnosis AZ, and performs decoding using a B-phase signal that is a normal angle signal other than the A and Z phase signals. That is, in the same manner as the above-described BZ both-phase abnormality, when the diagnosis AZ is input, first, the counter value (specified counter value) of the edge counter at that time is updated to a normal value (+4 or −4 ). Then, every time an edge change of the B phase signal occurs, the edge counter is counted up (or counted down) by two. Therefore, when both AZ phases are abnormal, the irregular count value based on the B phase signal is output as the rotation angle φ.

ここまで、角度信号監視部43による角度信号の異常判断方法、およびデコーダ41による角度信号のデコード方法について説明したが、これら各方法を簡潔にまとめると、図4および図5のように表すことができる。なお、図4に示した角度信号異常判定動作(上述した各種異常の判断)は角度信号監視部43により行われ、図5に示したデコード方式設定動作(上述した各種デコード方式の切り替え)はデコーダ41により行われるものであって、いずれもソフトウェア処理ではないが、図4および図5では、それぞれ対応するハードウェアの動作を模式的にフローチャート形式で表現している。   Up to this point, the angle signal abnormality determination method by the angle signal monitoring unit 43 and the angle signal decoding method by the decoder 41 have been described, but these methods can be summarized as shown in FIGS. 4 and 5. it can. The angle signal abnormality determination operation (determination of various abnormalities described above) shown in FIG. 4 is performed by the angle signal monitoring unit 43, and the decoding method setting operation (switching of various decoding methods described above) shown in FIG. 41, which are not software processing, but in FIG. 4 and FIG. 5, the operation of the corresponding hardware is schematically represented in a flowchart format.

図4に示すように、角度信号監視部43は、まずS110で、EVECU9から入力される車速信号に基づき、車速が一定速度以上であるか否か判断する。そして、車速が一定速度以上でなければ(S110:NO)、角度信号異常判定動作を終了する。つまり、車速が一定速度より低い場合は、角度信号の異常判断は行わない。   As shown in FIG. 4, the angle signal monitoring unit 43 first determines in S110 whether or not the vehicle speed is equal to or higher than a certain speed based on the vehicle speed signal input from the EV ECU 9. If the vehicle speed is not equal to or greater than a certain speed (S110: NO), the angle signal abnormality determination operation is terminated. That is, when the vehicle speed is lower than a certain speed, the abnormality determination of the angle signal is not performed.

車速が一定速度以上ならば(S110:YES)、S120にて、A相信号およびB相信号がともにH固定またはL固定であるか否か、即ちAB両相異常であるか否か判断する。そして、AB両相異常と判断した場合はS180にてダイアグABをデコーダ41へ出力する。   If the vehicle speed is equal to or higher than a certain speed (S110: YES), in S120, it is determined whether both the A-phase signal and the B-phase signal are H-fixed or L-fixed, that is, whether the AB phase is abnormal. If it is determined that both AB phases are abnormal, the diagnosis AB is output to the decoder 41 in S180.

AB両相異常でなかった場合は、S130に進み、Z相異常の判断を行う。即ち、S130にて、角度信号監視部43自身が備えるエッジカウンタのカウンタ値が0になったか否か判断する。エッジカウンタのカウンタ値が0になった場合は、S140にて、Z相信号のエッジが立ち上がったか否かを判断する。Z相信号のエッジが立ち上がらなかった場合は、Z相異常と判断し、さらにS190に進む。S190では、A相信号がH固定またはL固定であるか否か、即ちA相異常であるか否かを判断する。そして、A相異常と判断した場合は、Z相異常であることも含め、ダイアグAZをデコーダ41へ出力する。   If it is not AB both-phase abnormality, it progresses to S130 and judgment of Z-phase abnormality is performed. That is, in S130, it is determined whether or not the counter value of the edge counter included in the angle signal monitoring unit 43 itself has become zero. When the counter value of the edge counter becomes 0, it is determined in S140 whether or not the edge of the Z-phase signal has risen. If the edge of the Z-phase signal does not rise, it is determined that the Z-phase is abnormal, and the process proceeds to S190. In S190, it is determined whether the A-phase signal is H-fixed or L-fixed, that is, whether the A-phase is abnormal. If it is determined that the phase A is abnormal, the diagnosis AZ is output to the decoder 41, including the case where the phase Z is abnormal.

S190で、A相信号が正常であった場合は、S210に進み、B相信号がH固定またはL固定であるか否か、即ちB相異常であるか否かを判断する。そして、B相異常と判断した場合は、Z相異常であることも含め、ダイアグBZをデコーダ41へ出力する。S210で、B相信号も正常であった場合は、S230に進み、ダイアグZをデコーダ41へ出力する。   If the A-phase signal is normal in S190, the process proceeds to S210, and it is determined whether the B-phase signal is H-fixed or L-fixed, that is, whether the B-phase is abnormal. If it is determined that the phase B is abnormal, the diagnosis BZ is output to the decoder 41, including the case where the phase Z is abnormal. If the B phase signal is also normal in S210, the process proceeds to S230, and the diagnosis Z is output to the decoder 41.

S130でエッジカウンタのカウンタ値が0でなかった場合、およびS140でZ相信号のエッジが立ち上がった場合は、S150に進む。S150では、S190と全く同様に、A相異常の有無を判断する。そして、A相異常と判断した場合は、S240にて、ダイアグAをデコーダ41へ出力する。A相信号が正常であった場合は、S160に進み、S210と全く同様に、B相異常の有無を判断する。そして、B相異常と判断した場合は、S250にて、ダイアグBをデコーダ41へ出力する。B相信号が正常であった場合は、S170にて、A,B,Z各相信号いずれも正常と判定して、S110に戻る。   When the counter value of the edge counter is not 0 in S130, and when the edge of the Z-phase signal rises in S140, the process proceeds to S150. In S150, the presence or absence of the A phase abnormality is determined in exactly the same manner as in S190. If it is determined that the phase A is abnormal, the diagnosis A is output to the decoder 41 in S240. If the A-phase signal is normal, the process proceeds to S160, and the presence or absence of the B-phase abnormality is determined in the same manner as in S210. If it is determined that the phase B is abnormal, the diagnosis B is output to the decoder 41 in S250. If the B phase signal is normal, it is determined in S170 that all the A, B, and Z phase signals are normal, and the process returns to S110.

次に、図5に示すように、デコーダ41は、まずS310で、角度信号監視部43から角度信号ダイアグが入力されたか否かを判断する。角度信号ダイアグの入力がなければ、S320にて、通常デコード方式DoにてA,B,Z各相信号のデコードを行い、回転角φを生成して出力する。   Next, as shown in FIG. 5, the decoder 41 first determines whether or not an angle signal diagnosis is input from the angle signal monitoring unit 43 in S310. If there is no input of the angle signal diagnosis, in S320, the A, B, Z phase signals are decoded by the normal decoding method Do, and the rotation angle φ is generated and output.

角度信号ダイアグが入力された場合は、S330以降で、ダイアグの種類の判断およびダイアグに応じたデコード方式への切り替えを行う。即ち、S330で、入力された角度信号ダイアグがダイアグAであるか否か判断する。そして、ダイアグAであった場合は、S340にて、デコード方式を異常時デコード方式Daに切り替える。異常時デコード方式Daの詳細は既述の通りである。即ち、異常と判断される前の正常時の回転方向を維持する。そして、B相信号に基づいてカウントされる変則カウント値をデコード結果(回転角φ)として出力することを基本としつつ、Z相信号に基づく推定カウンタ値による補間が可能ならば補間も実行する。   When the angle signal diagnosis is input, the determination of the type of diagnosis and the switching to the decoding method corresponding to the diagnosis are performed after S330. That is, in S330, it is determined whether or not the input angle signal diagnosis is the diagnosis A. If it is diagnosis A, the decoding method is switched to the abnormal decoding method Da in S340. The details of the abnormal decoding method Da are as described above. That is, the normal rotation direction before being determined as abnormal is maintained. Then, based on outputting the irregular count value counted based on the B phase signal as a decoding result (rotation angle φ), the interpolation is also executed if interpolation based on the estimated counter value based on the Z phase signal is possible.

S330でダイアグAではないと判断した場合は、S350で、入力された角度信号ダイアグがダイアグBであるか否か判断する。そして、ダイアグBであった場合は、S360にて、デコード方式を異常時デコード方式Dbに切り替える。異常時デコード方式Dbの詳細は既述の通りである。即ち、異常と判断される前の正常時の回転方向を維持する。そして、A相信号に基づいてカウントされる変則カウント値をデコード結果(回転角φ)として出力することを基本としつつ、Z相信号に基づく推定カウンタ値による補間が可能ならば補間も実行する。   If it is determined in S330 that it is not the diagnosis A, it is determined whether or not the input angle signal diagnosis is the diagnosis B in S350. If it is the diagnosis B, the decoding system is switched to the abnormal decoding system Db in S360. The details of the abnormality decoding method Db are as described above. That is, the normal rotation direction before being determined as abnormal is maintained. Then, based on outputting the irregular count value counted based on the A phase signal as a decoding result (rotation angle φ), the interpolation is also executed if the interpolation based on the estimated counter value based on the Z phase signal is possible.

S350でダイアグBではないと判断した場合は、S370で、入力された角度信号ダイアグがダイアグABであるか否か判断する。そして、ダイアグABであった場合は、S380にて、デコード方式を異常時デコード方式Dabに切り替える。異常時デコード方式Dabの詳細は既述の通りである。即ち、異常と判断される前の正常時の回転方向を維持する。そして、Z相信号に基づく推定カウンタ値をデコード結果(回転角φ)として出力する。   If it is determined in S350 that it is not a diagnosis B, it is determined in S370 whether or not the input angle signal diagnosis is a diagnosis AB. If it is a diagnosis AB, the decoding method is switched to the abnormal decoding method Dab in S380. Details of the abnormal decoding method Dab are as described above. That is, the normal rotation direction before being determined as abnormal is maintained. Then, an estimated counter value based on the Z-phase signal is output as a decoding result (rotation angle φ).

S370でダイアグABではないと判断した場合は、S390で、入力された角度信号ダイアグがダイアグAZであるか否か判断する。そして、ダイアグAZであった場合は、S400にて、デコード方式を異常時デコード方式Dazに切り替える。異常時デコード方式Dazの詳細は既述の通りである。即ち、異常と判断される前の正常時の回転方向を維持する。そして、B相信号に基づく変則カウント値をデコード結果(回転角φ)として出力する。   If it is determined in S370 that the diagnosis is not a diagnosis AB, it is determined in S390 whether or not the input angle signal diagnosis is a diagnosis AZ. If it is the diagnosis AZ, the decoding method is switched to the abnormal decoding method Daz in S400. The details of the abnormal decoding method Daz are as described above. That is, the normal rotation direction before being determined as abnormal is maintained. Then, the irregular count value based on the B phase signal is output as a decoding result (rotation angle φ).

S390でダイアグAZではないと判断した場合は、S410で、入力された角度信号ダイアグがダイアグBZであるか否か判断する。そして、ダイアグBZであった場合は、S420にて、デコード方式を異常時デコード方式Dbzに切り替える。異常時デコード方式Dbzの詳細は既述の通りである。即ち、異常と判断される前の正常時の回転方向を維持する。そして、A相信号に基づく変則カウント値をデコード結果(回転角φ)として出力する。   If it is determined in S390 that it is not a diagnosis AZ, it is determined in S410 whether or not the input angle signal diagnosis is a diagnosis BZ. If it is a diagnosis BZ, the decoding method is switched to the abnormal decoding method Dbz in S420. The details of the abnormal decoding method Dbz are as described above. That is, the normal rotation direction before being determined as abnormal is maintained. Then, the irregular count value based on the A-phase signal is output as a decoding result (rotation angle φ).

S410でダイアグBZではないと判断した場合は、S430にて、デコード方式を異常時デコード方式Dzに切り替える。異常時デコード方式Dzの詳細は既述の通りである。即ち、A,B各相信号に基づく規定カウント値をデコード結果(回転角φ)として出力する。   If it is determined in S410 that it is not the diagnosis BZ, the decoding method is switched to the abnormal time decoding method Dz in S430. The details of the abnormality decoding method Dz are as described above. That is, a specified count value based on the A and B phase signals is output as a decoding result (rotation angle φ).

次に、監視マイコン40における制御マイコン監視部42による監視制御処理について、図6を用いて説明する。既述の通り、制御マイコン監視部42の実体はCPUである。CPUは、動作開始後、所定の制御周期(電流サンプリング周期)で、ROM等に記憶されている図6の監視制御処理プログラムを実行する。   Next, monitoring control processing by the control microcomputer monitoring unit 42 in the monitoring microcomputer 40 will be described with reference to FIG. As described above, the entity of the control microcomputer monitoring unit 42 is a CPU. After the operation starts, the CPU executes the monitoring control processing program of FIG. 6 stored in the ROM or the like at a predetermined control cycle (current sampling cycle).

制御マイコン監視部42(CPU)は、図6の監視制御処理を開始すると、まずS510にて、電流サンプリングを行う。即ち、各電流センサ25〜27からの各電流信号を読み込む。そして、S520にて、角度信号監視部43から角度信号ダイアグが入力されているか否かを判断する。   When the control microcomputer monitoring unit 42 (CPU) starts the monitoring control process of FIG. 6, first, in S510, current sampling is performed. That is, each current signal from each current sensor 25 to 27 is read. In step S520, it is determined whether an angle signal diagnosis is input from the angle signal monitoring unit 43.

S520で角度信号ダイアグが入力されていない場合は、S530に進み、制御マイコン監視処理を行う。即ち、既述の通り、デコーダ41からの回転角φ、各電流センサ25,26,27からの電流信号、およびEVECU9からのトルク指令値に基づいて、制御マイコン30が正常に動作しているか否かを監視するのである。そして、S540にて、制御マイコン30が異常であるか否か判断し、制御マイコン30が異常ならば、その旨を示す制御マイコン異常ダイアグを自身のRAM(SRAM)に記憶すると共に、EVECU9へ通知する。   If the angle signal diagnosis is not input in S520, the process proceeds to S530 and the control microcomputer monitoring process is performed. That is, as described above, based on the rotation angle φ from the decoder 41, the current signals from the current sensors 25, 26 and 27, and the torque command value from the EV ECU 9, whether or not the control microcomputer 30 is operating normally. It is monitored. In S540, it is determined whether or not the control microcomputer 30 is abnormal. If the control microcomputer 30 is abnormal, a control microcomputer abnormality diagnosis indicating that fact is stored in its own RAM (SRAM) and notified to the EV ECU 9. To do.

一方、S520にて、角度信号ダイアグが入力されている場合は、S560にて、その入力されているダイアグを記憶すると共に、そのダイアグをEVECU9へ通知する。これにより、EVECU9では、既述の角度信号異常対応処理が行われることになる。そしてS570で、入力されたダイアグがダイアグZであるか否かを判断する。   On the other hand, if the angle signal diagnosis is input in S520, the input diagnosis is stored and the diagnosis is notified to the EV ECU 9 in S560. As a result, the EV ECU 9 performs the aforementioned angle signal abnormality handling process. In step S570, it is determined whether or not the input diagnosis is the diagnosis Z.

ダイアグZでなかった場合は、S530に進むが、ダイアグZであった場合は、S580に進む。S580〜S600の処理は、ダイアグZの場合における、回転角の基準位置の確認処理である。   If it is not a diagnosis Z, the process proceeds to S530. If it is a diagnosis Z, the process proceeds to S580. The processing of S580 to S600 is confirmation processing of the reference position of the rotation angle in the case of Diag Z.

既述の通り、ダイアグZが入力されている場合(即ちZ相異常が生じている場合)、デコーダ41では異常時デコード方式Dzにてデコードが行われるが、この場合、Z相信号が異常であることから、A,B各相信号に基づくエッジカウンタのカウントは継続されて回転角は検出できるものの、基準位置の確認、即ちZ相パルスに基づくカウンタ値のリセットはできない。そのため、何らかの原因で、エッジカウンタのカウンタ値が0になるタイミングが、本来Z相パルスが発生するはずのタイミングから大きくずれてしまうと、制御マイコン監視部42は精度の悪い角度情報(回転角φ)を用いて制御マイコン30の監視を行うことになり、あまり好ましいものではない。   As described above, when the diagnosis Z is input (that is, when the Z-phase abnormality has occurred), the decoder 41 performs decoding by the abnormal-time decoding method Dz, but in this case, the Z-phase signal is abnormal. For this reason, counting of the edge counter based on the A and B phase signals is continued and the rotation angle can be detected, but the reference position cannot be confirmed, that is, the counter value cannot be reset based on the Z phase pulse. Therefore, if for some reason the timing at which the counter value of the edge counter becomes 0 deviates significantly from the timing at which the Z-phase pulse is supposed to be generated, the control microcomputer monitoring unit 42 causes the inaccurate angle information (rotation angle φ ) Is used to monitor the control microcomputer 30, which is not very preferable.

そこで、制御マイコン監視部42は、ダイアグZが入力された場合は、S580〜S600にて、U相電流と回転角φの位相を比較することで基準位置の確認を行うようにしている。換言すれば、回転角φが実際の回転角と異なっているか否かの確認を行うのである。   Therefore, when the diagnosis Z is input, the control microcomputer monitoring unit 42 confirms the reference position by comparing the U-phase current and the phase of the rotation angle φ in S580 to S600. In other words, it is confirmed whether or not the rotation angle φ is different from the actual rotation angle.

即ち、S580では、デコーダ41からの回転角φが0度(例えばカウント値0)または180度(例えばカウント値2047)の何れかであるか否かを判断する。そして、0度または180度の何れかならば、S590にて、U相電流が0またはその近傍であるか否かを判断する。   That is, in S580, it is determined whether or not the rotation angle φ from the decoder 41 is 0 degrees (for example, count value 0) or 180 degrees (for example, count value 2047). If it is either 0 degrees or 180 degrees, it is determined in S590 whether the U-phase current is 0 or in the vicinity thereof.

図7に示すように、回転角φが正常ならば、各相電流と回転角φは同期した状態で周期的に変化する。そして、本実施形態では、U相電流がほぼ0となるときに、モータ1の回転角が0度または180度となるように構成されている。そのため、U相電流がほぼ0となったときにデコーダ41からの回転角φが0度または180度となっているか否かを確認することで、デコーダ41からの回転角φの基準位置が実際の回転状態と合っているか否か、即ちデコーダ41からの回転角φが十分に信頼出来るものであるか否かを確認できるのである。   As shown in FIG. 7, if the rotation angle φ is normal, each phase current and the rotation angle φ periodically change in a synchronized state. In the present embodiment, when the U-phase current becomes approximately 0, the rotation angle of the motor 1 is configured to be 0 degree or 180 degrees. Therefore, the reference position of the rotation angle φ from the decoder 41 is actually determined by checking whether or not the rotation angle φ from the decoder 41 is 0 degree or 180 degrees when the U-phase current becomes almost zero. Therefore, it is possible to confirm whether the rotation angle φ from the decoder 41 is sufficiently reliable.

S590で、U相電流がほぼ0であった場合は、回転角φの基準位置が合っているものとして、S530に進む。一方、S590で、U相電流が0またはその近傍とはみなせない場合は、S600にて、EVECU9へ、回転角φの基準位置が合っていない旨(換言すれば回転角φが実際の回転角と異なっている旨)を示すダイアグαを出力する。これにより、EVECU9では、ダイアグαに対応した所定の異常対応処理が行われることになる。この異常対応処理は種々考えられ、例えば単に運転者に対して異常が生じた旨を報知するようにしてもよいし、車両を緊急的に停止させるようにしてもよい。   In S590, if the U-phase current is almost 0, it is determined that the reference position of the rotation angle φ is correct, and the process proceeds to S530. On the other hand, if the U-phase current cannot be regarded as 0 or in the vicinity thereof in S590, in S600, the EVECU 9 is informed that the reference position of the rotation angle φ is not correct (in other words, the rotation angle φ is the actual rotation angle). A message α indicating that the difference is different from As a result, the EV ECU 9 performs a predetermined abnormality handling process corresponding to the diagnosis α. Various abnormality handling processes are conceivable. For example, the driver may simply be notified that an abnormality has occurred, or the vehicle may be urgently stopped.

なお、ダイアグαが出力されるのは、別途、Z相異常によりダイアグZが出力されていることが前提である。そのため、ダイアグαが出力された場合は、別途出力されているダイアグZと合わせて、双方のダイアグに対応した異常対応処理が行われることになる。   Note that the diagnosis α is output on the premise that the diagnosis Z is output separately due to the Z-phase abnormality. Therefore, when the diagnosis α is output, an abnormality handling process corresponding to both diagnosis is performed together with the separately output diagnosis Z.

以上説明した本実施形態によれば、デコーダ41は、A,B,Z各相信号のうち何れか1つ又は2つが異常となっても、他の正常な信号を用いて回転角φを生成することができる。そのため、制御マイコン監視部42は、A,B,Z各相信号の異常が生じても、3つ全てが異常でない限り、所望の(最低限の)信頼性を有する回転角φに基づいて制御マイコン30の監視動作を必要最小限の期間(例えば退避走行に要する期間)継続することができる。   According to the present embodiment described above, the decoder 41 generates the rotation angle φ using another normal signal even if any one or two of the A, B, and Z phase signals become abnormal. can do. For this reason, the control microcomputer monitoring unit 42 performs control based on the rotation angle φ having a desired (minimum) reliability as long as all three are not abnormal even if abnormality occurs in each of the A, B, and Z phase signals. The monitoring operation of the microcomputer 30 can be continued for a minimum necessary period (for example, a period required for evacuation travel).

また、Z相信号に基づいて角度推定を行う推定カウンタ44を備え、AB両相異常が生じた場合にはこの推定カウンタ44の推定カウンタ値を回転角φとして出力するが、この推定カウンタ値は、A相異常又はB相異常の場合にも、補間用として用いられる(図3の最下段参照)。このように、A相異常又はB相異常の場合に推定カウンタ値を補間用として用いることで、異常状態でありながらも分解能のより高い回転角φを得ることができる。   Further, an estimation counter 44 that performs angle estimation based on the Z-phase signal is provided, and when an AB both-phase abnormality occurs, the estimation counter value of the estimation counter 44 is output as the rotation angle φ. In the case of an A-phase abnormality or a B-phase abnormality, it is also used for interpolation (see the lowermost stage in FIG. 3). As described above, when the estimated counter value is used for interpolation in the case of the A-phase abnormality or the B-phase abnormality, the rotation angle φ with higher resolution can be obtained even in the abnormal state.

また、Z相異常の場合、Z相パルスに基づく基準位置の確認はできなくなるが、本実施形態では、A,B各相信号によるエッジカウンタのカウンタ値とU相電流の位相とを比較することにより、エッジカウンタのカウンタ値が示す回転角φの基準位置が正しいか否か、即ちその回転角φが実際の回転角と合っているか否かを判断するようにしている。そのため、Z相異常が発生した場合に、A,B各相信号に基づく回転角φが実際と合わなくなってきた場合にはその旨が的確に検出され、これによりEVECU9は適切且つ迅速な対応をとることができる。   Further, in the case of Z-phase abnormality, the reference position cannot be confirmed based on the Z-phase pulse, but in this embodiment, the counter value of the edge counter based on the A and B phase signals and the phase of the U-phase current are compared. Thus, it is determined whether or not the reference position of the rotation angle φ indicated by the counter value of the edge counter is correct, that is, whether or not the rotation angle φ matches the actual rotation angle. For this reason, when the Z-phase abnormality occurs, if the rotation angle φ based on the A and B phase signals has become inconsistent with the actual situation, that fact is accurately detected, so that the EV ECU 9 can take appropriate and prompt action. Can take.

[変形例]
以上、本発明の実施の形態について説明したが、本発明の実施の形態は、上記実施形態に何ら限定されるものではなく、本発明の技術的範囲に属する限り種々の形態を採り得ることはいうまでもない。
[Modification]
Although the embodiments of the present invention have been described above, the embodiments of the present invention are not limited to the above-described embodiments, and can take various forms as long as they belong to the technical scope of the present invention. Needless to say.

上記実施形態では、A相信号またはB相信号が異常となった場合、デコーダ41は、異常と判断される直前の正常時の回転方向をそのまま保持して以後も引き続きその回転方向にて回転するものとしてカウントを継続するようにした。しかし、異常と判断された後、実際には回転方向が変化する可能性もある。そこで、当該電気自動車において、A,B各相信号以外にモータ1の回転方向を判別できる何らかの信号や情報等を取得できれば、デコーダ41は、その取得した回転方向に基づいて正しくカウントを行うことができる。   In the above embodiment, when the A-phase signal or the B-phase signal becomes abnormal, the decoder 41 keeps the normal rotation direction immediately before it is determined to be abnormal, and continues to rotate in that rotation direction thereafter. Counting continued as a thing. However, after it is determined that there is an abnormality, the rotation direction may actually change. Therefore, in the electric vehicle, if any signal or information that can determine the rotation direction of the motor 1 other than the A and B phase signals can be acquired, the decoder 41 can correctly count based on the acquired rotation direction. it can.

本実施形態では、EVECU9にシフト位置信号が入力されている。このシフト位置信号は、シフトレバーの位置を示す信号である。通常、シフト位置がR(リバース)の場合は、車両を後進させる方向にモータ1が回転し、逆に、R、P(パーキング)、およびN(ニュートラル)以外のシフト位置の場合は、車両を前進させる方向にモータ1が回転するものと判断できる。   In the present embodiment, a shift position signal is input to the EV ECU 9. This shift position signal is a signal indicating the position of the shift lever. Normally, when the shift position is R (reverse), the motor 1 rotates in the direction of moving the vehicle backward. Conversely, when the shift position is other than R, P (parking), and N (neutral), the vehicle is It can be determined that the motor 1 rotates in the forward direction.

そこで、EVECU9からMGECU7へシフト位置信号を送信するようにし、監視マイコン40内の制御マイコン監視部42は、その送信されてきたシフト位置信号に基づいてモータ1の回転方向を判別するようにしてもよい。   Therefore, the shift position signal is transmitted from the EVECU 9 to the MGECU 7, and the control microcomputer monitoring unit 42 in the monitoring microcomputer 40 determines the rotation direction of the motor 1 based on the transmitted shift position signal. Good.

また、シフト位置信号のような特定の信号がなくても、制御マイコン監視部42は、トルク指令値および各電流信号を用いて、回転方向を求めることができる。
モータ1の制御(本例ではベクトル制御)においては、一般に、モータ1の回転角θと、U相電流IuおよびW相電流Iwを用いて、次式(3),(4)のようにd・q各軸の実電流値Id,Iqが得られる。
Further, even if there is no specific signal such as a shift position signal, the control microcomputer monitoring unit 42 can determine the rotation direction using the torque command value and each current signal.
In the control of the motor 1 (vector control in this example), generally, the rotation angle θ of the motor 1, the U-phase current Iu, and the W-phase current Iw are used as shown in the following equations (3) and (4). Q The actual current values Id and Iq of each axis are obtained.

Figure 2013257165
一方、トルク指令値についても、d・q各軸の電流指令値IdcomおよびIqcomに変換される。そして、各電流指令値IdcomおよびIqcomと、各実電流値Id,Iqとの差に基づくフィードバック制御により、モータ1が制御される。
Figure 2013257165
On the other hand, the torque command value is also converted into current command values Idcom and Iqcom for each of the d and q axes. The motor 1 is controlled by feedback control based on the difference between the current command values Idcom and Iqcom and the actual current values Id and Iq.

そこで、回転角φがある角度φ0からdだけ変化したときに、順回転によりdだけ変化(即ち回転角φがφ0+dとなった)のか、それとも逆回転によりdだけ変化(即ち回転角φがφ0−dとなった)のかを、上記式(4)を用いて判断する。   Therefore, when the rotation angle φ changes from a certain angle φ0 by d, it changes by d by forward rotation (that is, the rotation angle φ becomes φ0 + d) or by d by reverse rotation (that is, the rotation angle φ changes by φ0). -D) is determined using the above equation (4).

具体的には、回転角φがφ0からdだけ変化したときに、φ0+dとなったものと仮定した場合のq軸電流Iq(φ0+d)、およびφ0−dとなったものと仮定した場合のq軸電流Iq(φ0−d)を、それぞれ上記式(4)を用いて演算する。即ち、上記式(4)において、φをφ0+dおよびφ0−dとしたときのそれぞれの演算結果を求める。なおその際、上記式(4)中のIuおよびIwは、いずれも回転角φがφ0からdだけ変化した時点での値を用いる。   Specifically, when the rotation angle φ is changed from φ0 by d, the q-axis current Iq (φ0 + d) is assumed to be φ0 + d, and q is assumed to be φ0−d. The shaft current Iq (φ0−d) is calculated using the above equation (4). That is, in the above equation (4), the respective calculation results are obtained when φ is φ0 + d and φ0−d. At that time, as for Iu and Iw in the above formula (4), values at the time when the rotation angle φ changes from φ0 by d is used.

一方、回転角φがφ0のときのトルク指令値に基づいて、q軸電流指令値Iqcomも演算しておく。
そして、その演算したq軸電流指令値と、上記各q軸電流Iq(φ0+d),Iq(φ0−d)との差の絶対値ra,rbをそれぞれ次式(5),(6)にて求める。
On the other hand, the q-axis current command value Iqcom is also calculated based on the torque command value when the rotation angle φ is φ0.
Then, the absolute values ra and rb of the difference between the calculated q-axis current command value and the q-axis currents Iq (φ0 + d) and Iq (φ0−d) are expressed by the following equations (5) and (6), respectively. Ask.

Figure 2013257165
そして、各絶対値ra,rbのうち小さい方の回転角が、正しい回転角であると判断できる。例えばra<rbであった場合は、φ0+dが正しい回転角、即ちモータ1は順回転しているものと判断できる。逆に、ra>rbであった場合は、φ0−dが正しい回転角、即ちモータ1は逆回転しているものと判断できる。このように、制御マイコン監視部42は、上記式(5)、(6)を用いた演算により、回転方向を判別することができるのである。
Figure 2013257165
Then, it can be determined that the smaller rotation angle of the absolute values ra and rb is the correct rotation angle. For example, when ra <rb, it can be determined that φ0 + d is the correct rotation angle, that is, the motor 1 is rotating forward. Conversely, if ra> rb, it can be determined that φ0-d is the correct rotation angle, that is, the motor 1 is rotating in the reverse direction. Thus, the control microcomputer monitoring unit 42 can determine the rotation direction by the calculation using the above formulas (5) and (6).

そこで、制御マイコン監視部42は、A相信号またはB相信号が異常となってそれを示すダイアグ(ダイアグA,B,AB,AZ,BZのいずれか)が入力された場合、シフト位置信号のように回転方向を判別できる何らかの信号等の入力があれば、その信号等を用いて回転方向を判別し、その結果をデコーダ41へ出力するとよい。また、そのような信号等の入力がなければ、上記式(5),(6)を用いた演算によって回転方向を判別しその結果をデコーダ41へ出力するとよい。なお、この回転方向の判別は、角度信号ダイアグが入力された後、定期的に行うようにするとよい。   Therefore, when the A-phase signal or the B-phase signal becomes abnormal and a diagnosis indicating one (diagonal A, B, AB, AZ, BZ) is input, the control microcomputer monitoring unit 42 receives the shift position signal. Thus, if there is an input of any signal or the like that can determine the rotation direction, the rotation direction is determined using the signal or the like, and the result may be output to the decoder 41. If there is no input of such a signal or the like, the rotation direction is determined by calculation using the above equations (5) and (6), and the result may be output to the decoder 41. The rotation direction may be determined periodically after the angle signal diagnosis is input.

そして、デコーダ41は、制御マイコン監視部42から回転方向の判別結果が入力されたら、自身が保持している回転方向と比較し、異なっていたならばその入力された判別結果を正しいものとして新たに保持し、その新たな回転方向に基づいてカウントを行うようにするとよい。   When the rotation direction determination result is input from the control microcomputer monitoring unit 42, the decoder 41 compares the rotation direction held by itself, and if it is different, the decoder 41 newly sets the input determination result as a correct one. And counting is performed based on the new rotation direction.

また、図4のS110における車速判断は、EVECU9からの車速信号に基づいて行うことに限定されず、他に車速を直接又は間接的に示す何らかの信号等があれば、それに基づいて判断するようにしてもよい。また、制御マイコン監視部42が各電流センサからの各電流検出信号に基づいて(即ち電流値の変化に基づいて)車速を演算し、その演算結果を角度信号監視部43へ入力することで、角度信号監視部43は、その入力された演算結果(車速)をもとにS110の判断を行うようにしてもよい。   In addition, the vehicle speed determination in S110 of FIG. 4 is not limited to being performed based on the vehicle speed signal from the EV ECU 9, and any other signal or the like that directly or indirectly indicates the vehicle speed is determined based on that signal. May be. Further, the control microcomputer monitoring unit 42 calculates the vehicle speed based on each current detection signal from each current sensor (that is, based on a change in the current value), and inputs the calculation result to the angle signal monitoring unit 43, The angle signal monitoring unit 43 may make the determination in S110 based on the input calculation result (vehicle speed).

また、上記実施形態では、デコーダ41,角度信号監視部43,及び推定カウンタ44をいずれもハードウェアにて構成した例を示したが、これはあくまでも一例であり、このうち1つ又は複数をCPUによるソフトウェア処理にて実現するようにしてもよい。   In the above embodiment, the decoder 41, the angle signal monitoring unit 43, and the estimation counter 44 are all configured by hardware. However, this is merely an example, and one or a plurality of these are assigned to the CPU. You may make it implement | achieve by the software processing by.

また、上記実施形態では、本発明を電気自動車の監視マイコン40に適用した例を示したが、本発明の適用が監視マイコン40に限定されるものでないことはいうまでもなく、また電気自動車への適用に限定されるものでないこともいうまでもない。   Moreover, in the said embodiment, although the example which applied this invention to the monitoring microcomputer 40 of an electric vehicle was shown, it cannot be overemphasized that application of this invention is not limited to the monitoring microcomputer 40, and also to an electric vehicle. Needless to say, the application is not limited to the above.

例えば、A,B,Z各相信号に基づいてモータ制御を行うよう構成されたモータ制御装置に対して本発明を適用することができる。一例として、A,B,Z各相信号を出力するいわゆるロータリエンコーダを備えたモータ制御装置への適用が考えられる。その場合、A,B,Z各相信号の何れかが異常となった場合に、他の正常な信号を元に対応する異常時デコード方式にてデコードを行うことで回転角を生成し、その回転角を用いて退避走行を可能とすることができる。このように、本発明は、A,B,Z各相信号に基づいて回転体の回転角を生成するよう構成されたあらゆる機器、装置等に対して適用可能である。   For example, the present invention can be applied to a motor control device configured to perform motor control based on A, B, and Z phase signals. As an example, application to a motor control device having a so-called rotary encoder that outputs A, B, and Z phase signals is conceivable. In that case, when any of the A, B, Z phase signals becomes abnormal, the rotation angle is generated by performing decoding by the corresponding abnormal decoding method based on other normal signals, The retreat traveling can be made possible by using the rotation angle. As described above, the present invention is applicable to all devices, apparatuses, and the like configured to generate the rotation angle of the rotating body based on the A, B, and Z phase signals.

1…モータ、3…バッテリ、5…インバータ、7…MGECU、9…EVECU、13…レゾルバ、25…U相電流センサ、26…V相電流センサ、27…W相電流センサ、30…制御マイコン、31…RDC、32…モータ制御部、33…エンコーダ、36…PWM回路、36…パルス幅変調回路、40…監視マイコン、41…デコーダ、42…制御マイコン監視部、43…角度信号監視部、44…推定カウンタ   DESCRIPTION OF SYMBOLS 1 ... Motor, 3 ... Battery, 5 ... Inverter, 7 ... MGECU, 9 ... EVECU, 13 ... Resolver, 25 ... U-phase current sensor, 26 ... V-phase current sensor, 27 ... W-phase current sensor, 30 ... Control microcomputer, DESCRIPTION OF SYMBOLS 31 ... RDC, 32 ... Motor control part, 33 ... Encoder, 36 ... PWM circuit, 36 ... Pulse width modulation circuit, 40 ... Monitoring microcomputer, 41 ... Decoder, 42 ... Control microcomputer monitoring part, 43 ... Angle signal monitoring part, 44 ... Estimated counter

Claims (8)

回転体(1)が一定角度回転する毎に入力される、互いに位相がずれた第1及び第2のパルス信号、及び前記回転体が前記一定角度よりも大きい360度/n(nは1以上の整数)回転する毎に入力される第3のパルス信号を用いて、予め決められた所定の通常検出方式(S320)により、前記回転体の回転方向を検出しつつその回転角を検出する回転角検出手段(41)と、
前記各パルス信号のうち少なくとも1つについて異常か否かを判断するパルス信号判断手段(43)と、
を備え、
前記回転角検出手段は、前記パルス信号判断手段により前記各パルス信号の何れか1つ又は2つが異常と判断された場合は、異常と判断されなかった他の1つ又は2つの正常なパルス信号を用いて、その正常なパルス信号の種類に応じた所定の異常時検出方式により前記回転体の回転角を検出する
ことを特徴とする回転角検出装置。
The first and second pulse signals which are input each time the rotating body (1) rotates by a certain angle, and the rotating body is 360 degrees / n larger than the certain angle (n is 1 or more). Rotation for detecting the rotation angle while detecting the rotation direction of the rotating body by a predetermined normal detection method (S320) determined in advance using the third pulse signal input every rotation. Angle detection means (41);
Pulse signal determination means (43) for determining whether or not at least one of the pulse signals is abnormal;
With
The rotation angle detection means, when any one or two of the pulse signals is determined to be abnormal by the pulse signal determination means, is another one or two normal pulse signals that are not determined to be abnormal. The rotation angle detection device is characterized in that the rotation angle of the rotating body is detected by a predetermined abnormality detection method according to the type of the normal pulse signal.
請求項1に記載の回転角検出装置であって、
前記パルス信号判断手段は、
前記第1及び第2のパルス信号の何れか一方に基づいて他方のパルス信号が異常か否かを判断する第1の判断機能(S150,S160,S190,S210)、前記第3のパルス信号に基づいて前記第1及び第2のパルス信号の双方が異常か否かを判断する第2の判断機能(S120)、および前記第1及び第2のパルス信号に基づいて前記第3のパルス信号が異常か否かを判断する第3の判断機能(S140)のうち少なくとも1つの判断機能を有し、
前記回転角検出手段は、
前記異常時検出方式として、前記第1の判断機能により前記他方のパルス信号が異常と判断された場合に用いる、前記一方のパルス信号および前記第3のパルス信号を用いた第1の異常時検出方式(S340,S360)、前記第2の判断機能により前記第1及び第2のパルス信号の双方が異常と判断された場合に用いる、前記第3のパルス信号を用いた第2の異常時検出方式(S380)、および前記第3の判断機能により前記第3のパルス信号が異常と判断された場合に用いる、前記第1及び第2のパルス信号を用いた第3の異常時検出方式(S430)のうち、少なくとも、前記パルス信号判断手段が有している前記判断機能に対応した異常時検出方式を有する
ことを特徴とする回転角検出装置。
The rotation angle detection device according to claim 1,
The pulse signal determination means includes
A first determination function (S150, S160, S190, S210) for determining whether the other pulse signal is abnormal based on one of the first and second pulse signals, and the third pulse signal A second determination function (S120) for determining whether or not both of the first and second pulse signals are abnormal, and the third pulse signal based on the first and second pulse signals. Having at least one determination function of the third determination function (S140) for determining whether or not there is an abnormality;
The rotation angle detecting means includes
As the abnormality detection method, a first abnormality detection using the one pulse signal and the third pulse signal used when the other pulse signal is determined to be abnormal by the first determination function. Method (S340, S360), second abnormality detection using the third pulse signal, used when both the first and second pulse signals are determined to be abnormal by the second determination function The third abnormality detection method (S430) using the first and second pulse signals, which is used when the third pulse signal is determined to be abnormal by the method (S380) and the third determination function. ) At least in an abnormality detection method corresponding to the determination function of the pulse signal determination means.
請求項2に記載の回転角検出装置であって、
前記パルス信号判断手段は、少なくとも前記第1の判断機能を備えており、
前記第1の判断機能は、前記第1及び第2のパルス信号の何れか一方のエッジ変化が連続して所定回数以上生じた期間中に他方のパルス信号のエッジ変化が生じなかった場合にその他方のパルス信号が異常と判断する機能であり、
前記回転角検出手段は、少なくとも前記第1の異常時検出方式を備えており、
前記第1の異常時検出方式は、前記第1の判断機能により異常と判断される前に前記通常検出方式により検出されていた回転方向を保持しつつ、前記第3のパルス信号が入力される毎に前記回転角を初期値に設定すると共にその初期値からの相対的角度変化量を前記他方のパルス信号を用いて検出することによりその相対的角度変化量を前記回転角として検出するよう構成されている
ことを特徴とする回転角検出装置。
The rotation angle detection device according to claim 2,
The pulse signal determination means includes at least the first determination function,
The first determination function is used when the edge change of the other pulse signal does not occur during a period when the edge change of one of the first and second pulse signals continuously occurs a predetermined number of times or more. It is a function to judge that the pulse signal of the other is abnormal,
The rotation angle detection means includes at least the first abnormality detection method,
In the first abnormality detection method, the third pulse signal is input while maintaining the rotation direction detected by the normal detection method before the abnormality is determined by the first determination function. The rotation angle is set to an initial value every time and the relative angle change amount from the initial value is detected by using the other pulse signal to detect the relative angle change amount as the rotation angle. A rotation angle detection device characterized by that.
請求項3に記載の回転角検出装置であって、
前記回転角検出手段は、前記第3のパルス信号が発生する毎に、前記回転角を初期値に設定すると共に、その発生以前の過去の前記第3のパルス信号の発生周期を用いて、次に再び第3のパルス信号が発生するまでの回転速度を推定して、その推定した回転速度に従って前記初期値からの変化量である推定回転角を算出する回転角推定手段(44)を備え、
前記第1の異常時検出方式は、前記他方のパルス信号によって前記相対的角度変化量が現在の値から次の値へ変化する間に、前記回転角推定手段により算出された前記推定回転角が、その現在の値と次の値の間の範囲内の角度になったならば、前記次の値へ変化するまでの間は、その推定回転角を前記回転角として検出するよう構成されている
ことを特徴とする回転角検出装置。
The rotation angle detection device according to claim 3,
The rotation angle detection means sets the rotation angle to an initial value every time the third pulse signal is generated, and uses the generation cycle of the previous third pulse signal before the generation, A rotation angle estimating means (44) for estimating a rotation speed until the third pulse signal is generated again and calculating an estimated rotation angle that is a change amount from the initial value according to the estimated rotation speed;
In the first abnormality detection method, the estimated rotation angle calculated by the rotation angle estimating means is calculated while the relative angle change amount is changed from the current value to the next value by the other pulse signal. When the angle is within the range between the current value and the next value, the estimated rotation angle is detected as the rotation angle until the angle changes to the next value. A rotation angle detection device characterized by that.
請求項2〜請求項4の何れか1項に記載の回転角検出装置であって、
前記パルス信号判断手段は、少なくとも前記第2の判断機能を備えており、
前記第2の判断機能は、前記第3のパルス信号の1周期期間中に前記第1及び第2のパルス信号のエッジ変化がいずれも生じなかった場合にその第1及び第2のパルス信号の双方が異常と判断する機能であり、
前記回転角検出手段は、
前記第3のパルス信号が発生する毎に、前記回転角を初期値に設定すると共に、その発生以前の過去の前記第3のパルス信号の発生周期を用いて、次に再び第3のパルス信号が発生するまでの回転速度を推定して、その推定した回転速度に従って前記初期値からの変化量である推定回転角を算出する回転角推定手段を備え、
前記異常時検出方式として、少なくとも前記第2の異常時検出方式を備えており、
前記第2の異常時検出方式は、前記第2の判断機能により異常と判断される前に前記通常検出方式により検出されていた回転方向を保持しつつ、前記回転角推定手段により算出された前記推定回転角を前記回転角として検出するよう構成されている
ことを特徴とする回転角検出装置。
The rotation angle detecting device according to any one of claims 2 to 4,
The pulse signal determination means has at least the second determination function,
The second determination function is configured to detect the first and second pulse signals when an edge change of the first and second pulse signals does not occur during one period of the third pulse signal. It is a function that both sides judge as abnormal,
The rotation angle detecting means includes
Each time the third pulse signal is generated, the rotation angle is set to an initial value, and then the third pulse signal is again generated using the generation cycle of the past third pulse signal before the generation. A rotation angle estimating means for estimating a rotation speed until the occurrence of, and calculating an estimated rotation angle that is an amount of change from the initial value according to the estimated rotation speed;
As the abnormality detection method, at least the second abnormality detection method is provided,
The second abnormality detection method is calculated by the rotation angle estimation means while maintaining the rotation direction detected by the normal detection method before being determined abnormal by the second determination function. A rotation angle detection device configured to detect an estimated rotation angle as the rotation angle.
請求項3〜請求項5の何れか1項に記載の回転角検出装置であって、
前記第1及び第2のパルス信号を用いない所定の検出方法により前記回転体の回転方向を検出する回転方向検出手段(42)を備え、
前記回転角検出手段は、前記第1の異常時検出方式又は前記第2の異常時検出方式にて前記回転角を検出する際、前記回転方向検出手段により検出された回転方向が前記保持した回転方向と異なる場合は、前記回転方向検出手段により検出された回転方向に前記回転体が回転しているものと判断して前記回転角の検出を行う
ことを特徴とする回転角検出装置。
The rotation angle detection device according to any one of claims 3 to 5,
Rotation direction detection means (42) for detecting the rotation direction of the rotating body by a predetermined detection method not using the first and second pulse signals,
When the rotation angle is detected by the first abnormality detection method or the second abnormality detection method, the rotation angle detection unit detects the rotation direction detected by the rotation direction detection unit. If it is different from the direction, it is determined that the rotating body is rotating in the rotation direction detected by the rotation direction detecting means, and the rotation angle is detected.
請求項2〜請求項6の何れか1項に記載の回転角検出装置であって、
前記通常検出方式は、前記第1及び第2のパルス信号の位相差に基づいて前記回転体の回転方向を検出しつつ、前記第3のパルス信号が入力される毎に前記回転角を初期値に設定すると共に、その初期値からの相対的角度変化量を前記第1及び第2のパルス信号を用いて検出することによりその相対的角度変化量を前記回転角として検出するよう構成されており、
前記パルス信号判断手段は、少なくとも前記第3の判断機能を備えており、
前記第3の判断機能は、前記相対的角度変化量が前記第3のパルス信号が発生すべき量となったタイミング、又はそのタイミングを含む所定期間において、前記第3のパルス信号が発生しなかった場合に、前記第3のパルス信号が異常と判断する機能であり、
前記回転角検出手段は、少なくとも前記第3の異常時検出方式を備えており、
前記第3の異常時検出方式は、前記第1及び第2のパルス信号を用いて、前記回転方向を検出しつつ前記回転角を検出するよう構成されている
ことを特徴とする回転角検出装置。
The rotation angle detecting device according to any one of claims 2 to 6,
The normal detection method detects the rotation direction of the rotating body based on the phase difference between the first and second pulse signals, and sets the rotation angle to an initial value every time the third pulse signal is input. The relative angle change amount from the initial value is detected using the first and second pulse signals, and the relative angle change amount is detected as the rotation angle. ,
The pulse signal determination means has at least the third determination function,
In the third determination function, the third pulse signal is not generated at a timing when the relative angle change amount is an amount that the third pulse signal should be generated, or in a predetermined period including the timing. A function of determining that the third pulse signal is abnormal when
The rotation angle detection means includes at least the third abnormality detection method,
The third abnormality detection method is configured to detect the rotation angle while detecting the rotation direction using the first and second pulse signals. .
請求項7に記載の回転角検出装置であって、
前記回転体は同期モータ(1)であり、
前記同期モータに供給される前記交流電流を検出する電流検出手段(25,26,27)と、
前記回転角検出手段により前記第3の異常時検出出方式で前記回転角が検出されている際に、その検出された前記回転角と、前記電流検出手段により検出された前記交流電流の位相とを比較して、前記回転角が前記位相に対応した値となっているか否か判断し、対応した値となっていない場合に、前記回転角が実際の回転角と異なっているものと判断する回転角判定手段(S580〜S600)と、
を備えることを特徴とする回転角検出装置。
The rotation angle detection device according to claim 7,
The rotating body is a synchronous motor (1);
Current detection means (25, 26, 27) for detecting the alternating current supplied to the synchronous motor;
When the rotation angle is detected by the rotation angle detection means by the third abnormality detection method, the detected rotation angle and the phase of the alternating current detected by the current detection means To determine whether or not the rotation angle is a value corresponding to the phase. If the rotation angle is not a corresponding value, it is determined that the rotation angle is different from the actual rotation angle. Rotation angle determination means (S580 to S600);
A rotation angle detection device comprising:
JP2012131958A 2012-06-11 2012-06-11 Rotational angle detecting device Pending JP2013257165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012131958A JP2013257165A (en) 2012-06-11 2012-06-11 Rotational angle detecting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012131958A JP2013257165A (en) 2012-06-11 2012-06-11 Rotational angle detecting device

Publications (1)

Publication Number Publication Date
JP2013257165A true JP2013257165A (en) 2013-12-26

Family

ID=49953730

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012131958A Pending JP2013257165A (en) 2012-06-11 2012-06-11 Rotational angle detecting device

Country Status (1)

Country Link
JP (1) JP2013257165A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016096631A (en) * 2014-11-13 2016-05-26 日本航空電子工業株式会社 Motor equipped with resolver, and resolver structure of motor
JP2016226189A (en) * 2015-06-01 2016-12-28 株式会社デンソー Controller for rotary electric machine
JP2017198627A (en) * 2016-04-28 2017-11-02 ファナック株式会社 Control apparatus of machine tool including failure diagnosis function for sensor detecting one-turn signal
JP2018128429A (en) * 2017-02-10 2018-08-16 株式会社デンソー Rotation detector
CN112311291A (en) * 2019-07-25 2021-02-02 三菱电机株式会社 Rotation angle detection device, rotation angle estimation device, and in-vehicle motor control system
CN114812378A (en) * 2022-04-24 2022-07-29 重庆长安新能源汽车科技有限公司 Motor angle sensor mounting position and fault testing system and method
JP7453070B2 (en) 2020-06-10 2024-03-19 ファナック株式会社 Encoder and rotating body control device with signal evaluation function

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016096631A (en) * 2014-11-13 2016-05-26 日本航空電子工業株式会社 Motor equipped with resolver, and resolver structure of motor
JP2016226189A (en) * 2015-06-01 2016-12-28 株式会社デンソー Controller for rotary electric machine
JP2017198627A (en) * 2016-04-28 2017-11-02 ファナック株式会社 Control apparatus of machine tool including failure diagnosis function for sensor detecting one-turn signal
US10571886B2 (en) 2016-04-28 2020-02-25 Fanuc Corporation Machine tool control device having function of diagnosing malfunction in sensor for detecting one-rotation signal
JP2018128429A (en) * 2017-02-10 2018-08-16 株式会社デンソー Rotation detector
CN112311291A (en) * 2019-07-25 2021-02-02 三菱电机株式会社 Rotation angle detection device, rotation angle estimation device, and in-vehicle motor control system
JP7453070B2 (en) 2020-06-10 2024-03-19 ファナック株式会社 Encoder and rotating body control device with signal evaluation function
CN114812378A (en) * 2022-04-24 2022-07-29 重庆长安新能源汽车科技有限公司 Motor angle sensor mounting position and fault testing system and method
CN114812378B (en) * 2022-04-24 2023-09-05 深蓝汽车科技有限公司 Motor angle sensor mounting position and fault testing system and method

Similar Documents

Publication Publication Date Title
JP2013257165A (en) Rotational angle detecting device
JP5131143B2 (en) Motor rotation angle detection device
JP5928438B2 (en) AC motor control device
JP4803286B2 (en) Vehicle drive motor control device
JP6704293B2 (en) Inverter control device and power conversion device
JP5929874B2 (en) AC motor control device
US8957613B2 (en) Control device for AC motor
JP6530654B2 (en) Electric power steering device
JP5402403B2 (en) Electric motor control system
JP2007282299A (en) Fault diagnoser for voltage sensor
JP2015091166A (en) Control device for ac motor
JP2020106391A (en) Controller of vehicle onboard apparatus
US10972032B2 (en) Method and apparatus for detecting failure of current sensor of motor
CN111200384B (en) Feedforward control method and system for permanent magnet synchronous motor drive under current sensing fault
JP5904038B2 (en) Angle information transmission method and angle information transmission system
JP5605312B2 (en) Rotating machine control device
US10444288B2 (en) Abnormality diagnosing device and abnormality diagnosing method
JP4735439B2 (en) Initial magnetic pole position estimation device for permanent magnet type synchronous motor
JP3903478B2 (en) Control device for permanent magnet type synchronous motor
JP6890700B2 (en) Power converter
JP2014212602A (en) Motor drive
JP5884747B2 (en) AC motor control device
JP2010004696A (en) Device for estimating output, motor controller using it and motor control system
JP2008289361A (en) Motor driving system
JP7326822B2 (en) motor controller