JP2008172896A - Controller of vehicular motor - Google Patents

Controller of vehicular motor Download PDF

Info

Publication number
JP2008172896A
JP2008172896A JP2007002529A JP2007002529A JP2008172896A JP 2008172896 A JP2008172896 A JP 2008172896A JP 2007002529 A JP2007002529 A JP 2007002529A JP 2007002529 A JP2007002529 A JP 2007002529A JP 2008172896 A JP2008172896 A JP 2008172896A
Authority
JP
Japan
Prior art keywords
motor
control
area
vehicle
data
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
JP2007002529A
Other languages
Japanese (ja)
Inventor
Mitsuhiro Hirota
光洋 廣田
Shinji Kanai
伸治 金井
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.)
NSK Ltd
Original Assignee
NSK Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NSK Ltd filed Critical NSK Ltd
Priority to JP2007002529A priority Critical patent/JP2008172896A/en
Publication of JP2008172896A publication Critical patent/JP2008172896A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a controller of a vehicular motor capable of preventing the runaway of software by monitoring a memory with a cost-effective structure, a control method of the controller, and a program for a computer to execute. <P>SOLUTION: This controller includes a CPU 101, which controls an auxiliary steering motor 20 by executing a control program, and a RAM 103, which is used as a work area when the CPU 101 executes the control program having an access permission area, in which data writing is permitted, and an access inhibition area, in which the data writing is inhibited. The CPU 101 performs a memory-monitoring program 202 to monitor the data writing to the access inhibition area of the RAM 103. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、車両用電動機の制御装置、車両用電動機の制御方法、およびコンピュータが実行するためのプログラムに関し、詳細には、メモリのアクセス禁止領域へのデータの書き込みをソフトウェアで監視して、ソフトウェアの暴走を未然に防止することが可能な車両用電動機の制御装置、車両用電動機の制御方法、およびコンピュータが実行するためのプログラムに関する。   The present invention relates to a control device for a motor for a vehicle, a method for controlling a motor for a vehicle, and a program to be executed by a computer. More specifically, the software monitors the writing of data to an access-prohibited area of a memory. The present invention relates to a vehicular electric motor control device, a vehicular electric motor control method, and a program executed by a computer.

車両には、各種電動機が使用されている。例えば、車両に搭載される電動パワーステアリング装置では、操舵補助トルク(アシストトルク)を与える操舵補助モータ(アシストモータ)が使用されている。電動パワーステアリング装置は、操舵補助モータの駆動力を、減速機を介してギヤまたはベルト等の伝送機構により、ステアリングシャフトまたはラック軸に補助力を付与するようになっている。かかる電動パワーステアリング装置の制御装置は、操舵補助トルクを正確に発生させるため、モータ電流のフィードバック制御を行っている。フィードバック制御は、電流指令値とモータ電流検出値との差が小さくなるようにモータ印加電圧を調整するものであり、モータ印加電圧の調整は、一般的にPWM(パルス幅変調)制御のデューティー比の調整で行っている。   Various electric motors are used in the vehicle. For example, in an electric power steering apparatus mounted on a vehicle, a steering assist motor (assist motor) that gives steering assist torque (assist torque) is used. The electric power steering apparatus applies a driving force of a steering assist motor to a steering shaft or a rack shaft by a transmission mechanism such as a gear or a belt via a speed reducer. Such a control device for the electric power steering apparatus performs feedback control of the motor current in order to accurately generate the steering assist torque. In feedback control, the motor applied voltage is adjusted so that the difference between the current command value and the detected motor current value is small. Generally, the adjustment of the motor applied voltage is a duty ratio of PWM (pulse width modulation) control. It is done by adjusting.

電動パワーステアリングの制御装置は、CPU(中央演算装置)、操舵補助モータを制御するためのソフトウェアが格納されたROMと、CPUがソフトウェアを実行する場合に作業領域として使用するRAMを備えている。ソフトウェア設計時には、あらゆる動作を想定して、RAMのメモリ保護違反、スタックオーバーフロー等を起こさないように、設計・デバック・検証をホワイトボックス的に行っているが、想定外のソフトウェアエラーが発生した場合には、RAMのオーバーフローが発生する場合がある。また、近時、ソフトウェアモジュールのブラックボックス化が進んでいるため、設計・デバック・検証を十分に行えない場合も想定される。   The control device for the electric power steering includes a CPU (Central Processing Unit), a ROM that stores software for controlling the steering assist motor, and a RAM that is used as a work area when the CPU executes the software. At the time of software design, design / debug / verification is performed in a white box to prevent RAM memory protection violation, stack overflow, etc., assuming every operation, but an unexpected software error occurs In some cases, RAM overflow may occur. In addition, since software modules are becoming more black boxes recently, there may be cases where design, debugging, and verification cannot be performed sufficiently.

ハードウェアを用いて、RAMへの不正なアクセスを事前に防止する技術が、例えば、特許文献1,2で提案されている。特許文献1のデータ保護装置は、アドレススペースをアドレスするプロセッサと、第1メモリと、これらプロセッサとメモリとを相互接続するバスと、第1範囲のアドレスに応答して第1選択信号を発生する第1アドレスデコーダとを備え、上記第1メモリはこの第1選択信号によって選択され、更に、上記第1のアドレス範囲と同一ではなく且つ上記第1範囲と共通のアドレスを少なくとも1つ有している第2のアドレス範囲のアドレスに応答して第2選択信号を発生する第2のアドレスデコーダと、上記プロセッサに作動的に接続されてそこから要求信号を受け取る保護回路とを備えており、当該保護回路は、要求信号の受信が存在しない場合に上記第2選択信号の発生の事象を通知するものである。   For example, Patent Documents 1 and 2 propose techniques for preventing unauthorized access to a RAM in advance using hardware. The data protection device of Patent Document 1 generates a first selection signal in response to a processor that addresses an address space, a first memory, a bus that interconnects these processors and the memory, and a first range of addresses. A first address decoder, wherein the first memory is selected by the first selection signal, and has at least one address that is not the same as the first address range and is common to the first range. A second address decoder for generating a second selection signal in response to an address in a second address range, and a protection circuit operatively connected to the processor for receiving a request signal therefrom, The protection circuit notifies the occurrence of the second selection signal when there is no reception of the request signal.

また、特許文献2のメモリ制御装置は、閾値レジスタに、アドレス信号ADDRの値の大小関係により書き込み制限区画を識別するための唯一の閾値アドレスを格納し、アドレス信号の一部と閾値レジスタが保持する値の大小関係を検出するアドレス比較部と、デバイス選択信号CS_0と、アドレス比較部の比較結果に基づきメモリデバイスに対する書き込み制御信号をマスクするマスク制御部を設け、アドレス信号ADDRの値と閾値アドレスが書き込み制限を行なうべき所定の大小関係にあることをアドレス比較部が検出している場合、メモリデバイスに対する書き込みアクセスを無効とするものである。   In addition, the memory control device of Patent Document 2 stores a single threshold address for identifying a write-restricted partition based on the magnitude relationship of the value of the address signal ADDR in the threshold register, and holds a part of the address signal and the threshold register. An address comparison unit for detecting the magnitude relationship of values to be performed, a device selection signal CS_0, and a mask control unit for masking a write control signal for the memory device based on the comparison result of the address comparison unit, and the value of the address signal ADDR and the threshold address When the address comparison unit detects that there is a predetermined magnitude relationship for which write restriction should be performed, write access to the memory device is invalidated.

特開平7−134678号公報JP-A-7-134678 特開2005−135036号公報Japanese Patent Laying-Open No. 2005-135036

しかしながら、上記特許文献1,2にあっては、RAMへの不正なアクセスを、ハードウェアを用いて防止する構成であるため、監視するメモリエリアの変更や複数メモリエリアへの対応等、設計変更による設計・製造工数にかかる工程が大きくなり、コストが大きくなってしまうため、低コストな構成とすることができないという問題がある。   However, in Patent Documents 1 and 2 described above, since unauthorized access to the RAM is prevented using hardware, design changes such as changes in the memory area to be monitored and support for multiple memory areas are provided. This increases the number of steps involved in designing and manufacturing man-hours, which increases the cost. Therefore, there is a problem that a low cost configuration cannot be achieved.

本発明は、上記課題に鑑みてなされたものであり、低コストな構成でメモリを監視して、ソフトウェアの暴走を未然に防止することが可能な車両用電動機の制御装置、車両用電動機の制御方法、およびコンピュータが実行するためのプログラムを提供することを目的とする。   The present invention has been made in view of the above problems, and monitors a memory with a low-cost configuration to prevent a software runaway from occurring, and a control device for a vehicle motor. It is an object to provide a method and a program to be executed by a computer.

上記した課題を解決して、本発明の目的を達成するために、本発明は、車両に搭載された車両用電動機を制御する車両用電動機の制御装置において、制御プログラムを実行して前記車両用電動機を制御する制御手段と、前記制御手段が前記制御プログラムを実行する場合にその作業領域として使用され、データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリと、を備え、前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを監視するメモリ監視手段を有し、前記制御プログラムの不正アクセスを監視することを特徴とする。これにより、メモリのアクセス禁止領域へデータが書き込まれたか否かをソフトウェアにより検出して、ソフトウェアエラーを検出することができ、低コストな構成でメモリを監視して、ソフトウェアの暴走を未然に防止することが可能となる。   In order to solve the above-described problems and achieve the object of the present invention, the present invention provides a control apparatus for a vehicle motor that controls a vehicle motor mounted on a vehicle, by executing a control program to A control means for controlling an electric motor; an access permission area that is used as a work area when the control means executes the control program; And the control means has memory monitoring means for monitoring the writing of data to the access prohibited area of the memory, and monitors unauthorized access of the control program. This makes it possible to detect whether software has been written to the memory access-prohibited area and detect software errors, and monitor the memory with a low-cost configuration to prevent software runaway. It becomes possible to do.

また、本発明の好ましい態様によれば、前記メモリ監視手段は、前記制御プログラムが実行される前に所定の検出用データを前記アクセス禁止領域に予め書き込み、前記制御プログラムの実行中に、または、前記制御プログラムが実行された後に、前記アクセス禁止領域のデータを読み込んで前記所定の検出用データと比較することにより、前記アクセス禁止領域へのデータの書き込みを検出することが望ましい。これにより、簡単な方法で、メモリのアクセス禁止領域にデータが書き込まれたか否かを検出することが可能となる。   Further, according to a preferred aspect of the present invention, the memory monitoring unit writes predetermined detection data in the access prohibited area in advance before the control program is executed, and during execution of the control program, or After the control program is executed, it is preferable to detect data writing in the access prohibited area by reading the data in the access prohibited area and comparing it with the predetermined detection data. As a result, it is possible to detect whether or not data has been written in the access prohibited area of the memory by a simple method.

また、本発明の好ましい態様によれば、前記アクセス許可領域は、スタック領域およびデータ領域を含み、前記アクセス禁止領域は、前記スタック領域およびデータ領域に隣接した領域であることが望ましい。これにより、スタック領域およびデータ領域のオーバーフローを監視することが可能となる。   According to a preferred aspect of the present invention, it is desirable that the access permission area includes a stack area and a data area, and the access prohibition area is an area adjacent to the stack area and the data area. Thereby, it is possible to monitor the overflow of the stack area and the data area.

また、本発明の好ましい態様によれば、前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを検出した場合には、前記車両用電動機を停止させることが望ましい。これにより、ソフトウェアが暴走する前に、車両用電動機を停止することが可能となる。   Further, according to a preferred aspect of the present invention, it is desirable that the control means stops the vehicle electric motor when detecting the writing of data to the access prohibited area of the memory. This makes it possible to stop the vehicle motor before the software runs away.

また、本発明の好ましい態様によれば、前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを検出した場合には、前記制御プログラムの実行を停止して、当該制御プログラムに比して負荷の少ないサブ制御プログラムを実行して前記車両用電動機の制御を継続することが望ましい。これにより、ソフトウェアの暴走を未然に防止することができるとともに、車両用電動機の動作を継続させることが可能となる。   According to a preferred aspect of the present invention, when the control means detects writing of data into the access prohibited area of the memory, the control means stops execution of the control program and compares it with the control program. It is desirable to continue the control of the vehicle motor by executing a sub-control program with a low load. As a result, it is possible to prevent the software from running away and to continue the operation of the vehicle motor.

また、本発明の好ましい態様によれば、さらに、不揮発性メモリを備え、前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを検出した場合には、解析に必要なメモリ情報を前記不揮発性メモリに格納することが望ましい。これにより、メモリのアクセス禁止領域にデータが書き込まれた原因(ソフトウェアエラーの原因)を解析することが可能となる。   Further, according to a preferred aspect of the present invention, further comprising a non-volatile memory, the control means detects the memory information necessary for the analysis when the writing of data to the access prohibited area of the memory is detected. It is desirable to store in non-volatile memory. As a result, it is possible to analyze the cause (data cause) of the data being written in the access prohibited area of the memory.

また、本発明の好ましい態様によれば、前記制御プログラムは、優先順位の異なる複数のタスクを含み、前記メモリは、複数のアクセス禁止領域が設定されていることが望ましい。これにより、各タスクのソフトウェアエラーを検出することが可能となる。   According to a preferred aspect of the present invention, it is preferable that the control program includes a plurality of tasks having different priorities, and the memory is set with a plurality of access prohibited areas. Thereby, it becomes possible to detect the software error of each task.

また、本発明の好ましい態様によれば、前記メモリ監視手段は、前記メモリのアクセス禁止領域への書き込みの監視を、前記車両用電動機の立ち上がりの時定数より短い周期で実行することが望ましい。これにより、ソフトウェアが暴走する前に、確実に電動機を停止させる等の対策をとることが可能となる。   Further, according to a preferred aspect of the present invention, it is desirable that the memory monitoring unit performs monitoring of writing to the access prohibited area of the memory at a cycle shorter than a time constant of rising of the vehicle motor. As a result, it is possible to take measures such as stopping the motor without fail before the software runs away.

また、本発明の好ましい態様によれば、前記車両用電動機は、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータであり、前記制御手段は、前記制御プログラムを実行して、少なくとも前記ステアリング系に発生する操舵トルクに基づいて前記操舵補助モータの電流指令値を演算し、電流検出回路で検出された前記操舵補助モータの電流検出値と前記電流指令値とに基づいて、前記操舵補助モータの電流検出値が前記電流指令値に追従するように前記操舵補助モータを駆動制御することが望ましい。これにより、電動パワーステアリング装置において、低コストな構成でメモリを監視して、ソフトウェアの暴走を未然に防止することが可能となる。   According to a preferred aspect of the present invention, the vehicle electric motor is a steering assist motor of an electric power steering device that applies a steering assist force to a steering system of the vehicle, and the control means executes the control program. And calculating a current command value of the steering assist motor based on at least a steering torque generated in the steering system, and based on the detected current value of the steering assist motor and the current command value detected by a current detection circuit. Preferably, the steering assist motor is driven and controlled so that a current detection value of the steering assist motor follows the current command value. As a result, in the electric power steering apparatus, it is possible to monitor the memory with a low-cost configuration and prevent software runaway.

また、本発明の好ましい態様によれば、前記車両用電動機は、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータであり、前記制御プログラムは、モータ電流制御系モジュール、モータ電流補助制御系モジュール、トルク制御系モジュール、および補償制御系モジュールを含み、前記サブ制御プログラムは、前記モータ電流制御系モジュール、前記トルク制御系モジュール、および前記補償制御系モジュールを含むことが望ましい。これにより、第1の制御プログラムにソフトウェアエラーが発生した場合でも、モータ電流補助制御系モジュールがなく負荷の軽いサブ制御プログラムを実行して、操舵補助モータのアシストを継続させることが可能となる。   According to a preferred aspect of the present invention, the vehicle electric motor is a steering assist motor of an electric power steering device that applies a steering assist force to a vehicle steering system, and the control program includes a motor current control system module, It is preferable that the motor current auxiliary control system module, the torque control system module, and the compensation control system module are included, and the sub-control program includes the motor current control system module, the torque control system module, and the compensation control system module. . Thus, even when a software error occurs in the first control program, it is possible to continue the assist of the steering assist motor by executing the sub-control program with a light load and no motor current assist control module.

また、本発明の好ましい態様によれば、前記車両用電動機は、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータであり、前記制御プログラムは、前記操舵補助モータを制御するための第1のタスクと、外部と通信するための第2のタスクとを含むことが望ましい。これにより、電動パワーステアリング装置の制御装置において、各タスクのソフトウェアエラーを検出することが可能となる。   According to a preferred aspect of the present invention, the vehicle electric motor is a steering assist motor of an electric power steering device that applies a steering assist force to a steering system of the vehicle, and the control program controls the steering assist motor. It is desirable to include a first task for communication and a second task for communication with the outside. Thereby, the software error of each task can be detected in the control device of the electric power steering device.

上記した課題を解決して、本発明の目的を達成するために、本発明は、車両に搭載された車両用電動機を制御する車両用電動機の制御方法において、制御手段が、データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリを、作業領域として使用して制御プログラムを実行し、前記車両用電動機を制御する制御工程と、前記制御手段が、メモリ監視プログラムを実行して、前記アクセス禁止領域へのデータの書き込みを監視して、前記制御プログラムの不正アクセスを監視する監視工程と、を含むことを特徴とする。   In order to solve the above-described problems and achieve the object of the present invention, the present invention provides a vehicle motor control method for controlling a vehicle motor mounted on a vehicle. A control step of controlling the vehicle electric motor by executing a control program using a memory having an access-permitted area and an access-prohibited area where data writing is prohibited as a work area, and the control means A monitoring step of executing a memory monitoring program to monitor writing of data to the access prohibited area and monitoring unauthorized access of the control program.

上記した課題を解決して、本発明の目的を達成するために、本発明は、車両に搭載された車両用電動機を制御する車両用電動機の制御装置に搭載されるプログラムにおいて、コンピュータに、データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリを作業領域として使用して、前記車両用電動機を制御する制御工程と、前記アクセス禁止領域へのデータの書き込みを監視して、ソフトウェアの不正アクセスを監視する監視工程と、を実行させることを特徴とする。   In order to solve the above-described problems and achieve the object of the present invention, the present invention provides a computer program that stores data in a program mounted on a vehicle motor control device that controls a vehicle motor mounted on a vehicle. A control process for controlling the motor for a vehicle using a memory having an access-permitted area where data writing is permitted and an access-prohibited area where data writing is prohibited as a work area, and access to the access-prohibited area And monitoring the data writing to monitor unauthorized access of software.

本発明によれば、車両に搭載された車両用電動機を制御する車両用電動機の制御装置において、制御プログラムを実行して前記車両用電動機を制御する制御手段と、前記制御手段が前記制御プログラムを実行する場合にその作業領域として使用され、データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリと、を備え、前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを監視するメモリ監視手段を有し、前記制御プログラムの不正アクセスを監視することとしたので、メモリのアクセス禁止領域へデータが書き込まれたか否かをソフトウェアにより検出して、ソフトウェアエラーを検出することができ、低コストな構成でメモリを監視して、ソフトウェアの暴走を未然に防止することが可能な車両用電動機の制御装置を提供することが可能となるという効果を奏する。   According to the present invention, in a control apparatus for a vehicle motor that controls a vehicle motor mounted on a vehicle, a control unit that executes a control program to control the vehicle motor, and the control unit executes the control program. A memory having an access-permitted area where data writing is permitted and an access-prohibited area where data writing is prohibited; Since it has memory monitoring means to monitor the writing of data to the access prohibited area and monitors the unauthorized access of the control program, it detects by software whether data has been written to the access prohibited area of the memory. Can detect software errors, monitor memory with low-cost configuration, and software Providing a motor control apparatus for a vehicle capable of preventing a runaway in advance an effect that it is possible.

以下に、この発明につき図面を参照しつつ詳細に説明する。なお、この実施例によりこの発明が限定されるものではない。また、下記実施例における構成要素には、当業者が容易に想定できるものまたは実質的に同一のものが含まれる。以下の実施例では、車両に搭載された車両用電動機として、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータを制御する制御装置を一例として説明する。   Hereinafter, the present invention will be described in detail with reference to the drawings. Note that the present invention is not limited to the embodiments. In addition, constituent elements in the following embodiments include those that can be easily assumed by those skilled in the art or those that are substantially the same. In the following embodiments, a control device for controlling a steering assist motor of an electric power steering device that applies a steering assist force to a steering system of the vehicle will be described as an example of a vehicle electric motor mounted on the vehicle.

図1は、電動パワーステアリング装置の一般的な構成を示す図である。図1において、操向ハンドル1のコラム軸2は減速ギア3、ユニバーサルジョイント4aおよび4b、ピニオンラック機構5を経て操向車輪のタイロッド6に連結されている。コラム軸2には、操向ハンドル1の操舵トルクTを検出するトルクセンサ10が設けられており、操向ハンドル1の操舵力を補助する操舵補助モータ20が、減速ギア3を介してコラム軸2に連結されている。ここで、操舵補助モータ20は、例えば、ブラシレスモータやブラシモータである。電動パワーステアリング装置を制御するコントロールユニット30には、バッテリ14から内蔵の電源リレー13を経て電力が供給され、イグニションキー11からイグニション信号が供給される。また、コントロールユニット30は、トルクセンサ10で検出された操舵トルクTと車速センサ12で検出された車速Vとに基づいて、操舵補助モータ20の電流指令値を演算し、操舵補助モータ20の電流検出値と電流指令値とに基づいて、操舵補助モータ20の電流検出値が電流指令値に追従するように操舵補助モータ20を駆動制御する。   FIG. 1 is a diagram illustrating a general configuration of an electric power steering apparatus. In FIG. 1, a column shaft 2 of a steering handle 1 is connected to a tie rod 6 of a steering wheel via a reduction gear 3, universal joints 4a and 4b, and a pinion rack mechanism 5. The column shaft 2 is provided with a torque sensor 10 that detects the steering torque T of the steering handle 1, and a steering assist motor 20 that assists the steering force of the steering handle 1 is connected to the column shaft via the reduction gear 3. 2 is connected. Here, the steering assist motor 20 is, for example, a brushless motor or a brush motor. The control unit 30 that controls the electric power steering device is supplied with electric power from the battery 14 via the built-in power supply relay 13 and is supplied with an ignition signal from the ignition key 11. Further, the control unit 30 calculates a current command value for the steering assist motor 20 based on the steering torque T detected by the torque sensor 10 and the vehicle speed V detected by the vehicle speed sensor 12, and the current of the steering assist motor 20 is calculated. Based on the detected value and the current command value, the steering assist motor 20 is drive-controlled so that the current detected value of the steering assist motor 20 follows the current command value.

図2は、図1のコントロールユニット30のハードウェア構成を示す図である。図3は、図2の主MCUのROMおよびRAMのメモリ構成例を示す図である。コントロールユニット30は、図2に示すように、主MCU(マイクロコントロールユニット)100と、副MCU(マイクロコントロールユニット)110と、WDT(ウォッチドックタイマ)130と、FETプリドライバ回路140と、モータ駆動回路(インバータ)150と、電流検出回路160と、位置検出回路170等を備えている。   FIG. 2 is a diagram showing a hardware configuration of the control unit 30 of FIG. FIG. 3 is a diagram showing a memory configuration example of the ROM and RAM of the main MCU of FIG. As shown in FIG. 2, the control unit 30 includes a main MCU (micro control unit) 100, a sub MCU (micro control unit) 110, a WDT (watch dock timer) 130, an FET pre-driver circuit 140, and a motor drive. A circuit (inverter) 150, a current detection circuit 160, a position detection circuit 170, and the like are provided.

主MCU100は、CPU101(制御手段)、ROM102、RAM(メモリ)103、EEPROM104,A/D変換器105、インターフェース106、バス107等を備えている。CPU101は、ROM102に格納された各種プログラムを実行して電動パワーステアリング装置を制御する。   The main MCU 100 includes a CPU 101 (control means), a ROM 102, a RAM (memory) 103, an EEPROM 104, an A / D converter 105, an interface 106, a bus 107, and the like. The CPU 101 executes various programs stored in the ROM 102 and controls the electric power steering apparatus.

ROM102は、CPU101が実行する各種プログラムを格納する。具体的には、ROM102には、図3に示すように、操舵補助モータ20を制御するモータ制御処理(操舵補助処理)を実行するための制御プログラム201、RAM103のアクセス禁止領域にデータの書き込みがあるか否かを監視するメモリ監視処理を実行するためのメモリ監視プログラム202、安全動作に移行する安全動作移行処理を実施するための安全動作移行プログラム203等が格納されている。RAM103は、CPU101がプログラムを実行する場合にその作業領域として使用され、処理過程で必要とするデータや処理結果、サブルーチンや割り込み処理に際して戻り番地等が記憶されるものであり、データの書き込みが許可されたアクセス許可領域とデータの書き込みが禁止されたアクセス禁止領域とを有している。上記構成において、CPU101がメモリ監視プログラム202を実行することにより、メモリ監視手段として機能する。   The ROM 102 stores various programs executed by the CPU 101. Specifically, as shown in FIG. 3, the ROM 102 stores data in a control program 201 for executing a motor control process (steering assist process) for controlling the steering assist motor 20 and an access prohibited area of the RAM 103. A memory monitoring program 202 for executing a memory monitoring process for monitoring whether or not there is, a safe operation transition program 203 for executing a safe operation transition process for shifting to a safe operation, and the like are stored. The RAM 103 is used as a work area when the CPU 101 executes a program, and stores data necessary for processing, processing results, return addresses in subroutines and interrupt processing, etc., and writing of data is permitted. And an access prohibited area where data writing is prohibited. In the above configuration, when the CPU 101 executes the memory monitoring program 202, it functions as a memory monitoring unit.

EEPROM104は、電源遮断後においても記憶内容を保持可能なメモリであり、後述するように、RAM103のアクセス禁止領域へのデータの書き込みが検出された場合に、解析に必要なメモリ情報等が書き込まれる。A/D変換器105は、トルクセンサ10からの操舵トルクT、電流検出回路160からの操舵補助モータ20の電流検出値Im、および位置検出回路170からのモータ回転角信号θ等を入力し、デジタル信号に変換する。インターフェース106は、車速センサ12からの車速V(車速パルス)をCAN通信で受け取るためのものである。   The EEPROM 104 is a memory that can retain the stored contents even after the power is shut off. As will be described later, when data writing to the access prohibited area of the RAM 103 is detected, memory information or the like necessary for analysis is written. . The A / D converter 105 inputs the steering torque T from the torque sensor 10, the current detection value Im of the steering assist motor 20 from the current detection circuit 160, the motor rotation angle signal θ from the position detection circuit 170, and the like. Convert to digital signal. The interface 106 is for receiving the vehicle speed V (vehicle speed pulse) from the vehicle speed sensor 12 by CAN communication.

FETプリドライバ回路140は、主MCU100から入力されるUVW各相のPWM制御信号を、各相正負の通電信号(Up,Un、Vp、Vn、Wp,Wn)に変換して、モータ駆動回路150に出力する。   The FET pre-driver circuit 140 converts the PWM control signal for each phase of UVW input from the main MCU 100 into positive and negative energization signals (Up, Un, Vp, Vn, Wp, Wn) for each phase, and the motor drive circuit 150. Output to.

モータ駆動回路150は、一対のFETスイッチング素子からなるブリッジ回路をU相用,V相用,W相用として3相分備えており、各FETスイッチング素子には還流ダイオードが並列接続されている。このブリッジ回路には、バッテリ14から電源リレー13を介して直流電圧が印加される。各FETスイッチング素子の制御端子(ゲート端子)には、FETプリドライバ回路140から通電信号が入力される。モータ駆動回路150に印加される直流電圧は、モータ駆動回路150内のFETスイッチング素子のスイッチング動作によって3相の交流電圧に変換され、それにより操舵補助モータ20が駆動される。このブリッジ回路には、シャント抵抗R1,R2が接続されている。このシャント抵抗R1,R2に電流検出回路160が接続され、これによって、操舵補助モータ20の電流検出値Imを検出するようになっている。   The motor drive circuit 150 includes a bridge circuit composed of a pair of FET switching elements for three phases for the U phase, the V phase, and the W phase, and a reflux diode is connected in parallel to each FET switching element. A DC voltage is applied to the bridge circuit from the battery 14 via the power relay 13. An energization signal is input from the FET pre-driver circuit 140 to the control terminal (gate terminal) of each FET switching element. The DC voltage applied to the motor drive circuit 150 is converted into a three-phase AC voltage by the switching operation of the FET switching element in the motor drive circuit 150, thereby driving the steering assist motor 20. Shunt resistors R1 and R2 are connected to this bridge circuit. A current detection circuit 160 is connected to the shunt resistors R1 and R2, and the current detection value Im of the steering assist motor 20 is thereby detected.

位置検出回路170は、位置センサ21に励磁電流を与えるとともに、位置センサ21からの出力信号をモータ回転角信号θとして、A/D変換器105に出力する。   The position detection circuit 170 supplies an excitation current to the position sensor 21 and outputs an output signal from the position sensor 21 to the A / D converter 105 as a motor rotation angle signal θ.

WDT130は、主MCU100のCPU101のハードウェアエラーを検出するためのものである。CPU101のハードウェアエラーは、電磁ノイズによる暴走、レジスタのデータ化け等の各種が存在する。CPU101およびWDT130は、それぞれタイマ用カウンタを備えている。WDT130は、CPU101から出力されるクリアパルスが一定時間(例えば、40msec)以上停止した場合に、リセット信号を発生し、CPU101をリセットすると共に、FETプリドライバ回路140にモータ停止信号を出力して、FETプリドライバ回路140の動作を停止させて、操舵補助モータ20を停止させる。   The WDT 130 is for detecting a hardware error of the CPU 101 of the main MCU 100. There are various types of hardware errors in the CPU 101, such as runaway due to electromagnetic noise and garbled register data. Each of the CPU 101 and the WDT 130 includes a timer counter. The WDT 130 generates a reset signal when the clear pulse output from the CPU 101 stops for a certain time (for example, 40 msec) or more, resets the CPU 101, and outputs a motor stop signal to the FET pre-driver circuit 140. The operation of the FET pre-driver circuit 140 is stopped, and the steering assist motor 20 is stopped.

副MCU110は、CPU111、ROM112、RAM113、D/A変換器115、およびA/D変換器116等を備えている。副MCU110は、モータ制御のための演算処理は実行しないが、主MCU100とシリアル通信により相互に動作(ハードウェアエラー)の監視を行っている。   The sub MCU 110 includes a CPU 111, a ROM 112, a RAM 113, a D / A converter 115, an A / D converter 116, and the like. The sub MCU 110 does not execute arithmetic processing for motor control, but monitors the operation (hardware error) with the main MCU 100 through serial communication.

例えば、主MCU100のA/D変換器105の異常を以下の方法で検出している。主MCU100のA/D変換器105は、8ポートAD1〜AD8を有しており、異常診断時には、例えば、AD8が使用され、7つのポートAD1〜AD7は異常診断に使用されず、ポートAD1〜AD7は、本来のモータ制御処理に使用される。   For example, the abnormality of the A / D converter 105 of the main MCU 100 is detected by the following method. The A / D converter 105 of the main MCU 100 has 8 ports AD1 to AD8. For example, when an abnormality is diagnosed, AD8 is used, and the seven ports AD1 to AD7 are not used for abnormality diagnosis, and the ports AD1 to AD8 are used. AD7 is used for original motor control processing.

また、副MCU110のA/D変換器116は、8ポートAD1〜AD8を有しており、異常診断時には、例えば、AD8が使用され、7つのポートAD1〜AD7は使用されない。まず、副MCU110は、所定値のデジタル値をD/A変換器115でアナログ値に変換して出力する。出力されたアナログ値は、主MCU100のA/D変換器105のポートAD8に入力され、再度、デジタル値に変換され、シリアル通信で副MCU110へ返却値1として送信される。また、出力されたアナログ値は、副MCU110のA/D変換器116のポートAD8に入力され、再度、デジタル値に変換され、返却値2として返却される。副MCU110は、受信された返却値1と所定値のデジタル値との誤差ΔX1を算出し、誤差ΔX1が、許容値ΔXK以下である場合には、A/D変換器105およびD/A変換器115が正常と判定する。他方、副MCU110は、誤差ΔX1が許容値ΔXKより大きい場合には、返却値2と所定値のデジタル値との誤差ΔX2を算出し、誤差ΔX2が、許容値ΔXK以下である場合には、D/A変換器115は正常で、A/D変換器105が異常であると判定する。A/D変換器105は、操舵補助モータ20を制御するために重要な要素であるので、この場合は、操舵補助モータ20を停止させる。   The A / D converter 116 of the sub MCU 110 has 8 ports AD1 to AD8. For example, AD8 is used and 7 ports AD1 to AD7 are not used at the time of abnormality diagnosis. First, the sub MCU 110 converts a predetermined digital value into an analog value by the D / A converter 115 and outputs the analog value. The output analog value is input to the port AD8 of the A / D converter 105 of the main MCU 100, converted into a digital value again, and transmitted as a return value 1 to the sub MCU 110 by serial communication. Further, the output analog value is input to the port AD8 of the A / D converter 116 of the sub MCU 110, converted again to a digital value, and returned as a return value 2. The sub MCU 110 calculates an error ΔX1 between the received return value 1 and a predetermined digital value. If the error ΔX1 is less than or equal to the allowable value ΔXK, the A / D converter 105 and the D / A converter 115 is determined to be normal. On the other hand, when the error ΔX1 is larger than the allowable value ΔXK, the sub MCU 110 calculates an error ΔX2 between the return value 2 and the predetermined digital value, and when the error ΔX2 is equal to or smaller than the allowable value ΔXK, D It is determined that the / A converter 115 is normal and the A / D converter 105 is abnormal. Since the A / D converter 105 is an important element for controlling the steering assist motor 20, the steering assist motor 20 is stopped in this case.

上記構成のコントロールユニット30では、副MCU110およびWDT130により主MCU100のハードウェアエラーを監視している。また、主MCU100のCPU101が、メモリ監視プログラム202を実行することにより、ソフトウェアエラーを監視している。このように、ハードウェアエラーとソフトウェアエラーを別々に検出することで、ハードウェアエラーとソフトウェアエラーの切り分けを行うことができる。なお、図示はしないが、RAM103のRAM化け(01反転)等のハードウェアエラーを検出するための検出回路を主MCU100の内部または外部に設けることにしてもよい。   In the control unit 30 configured as described above, the sub MCU 110 and the WDT 130 monitor the hardware error of the main MCU 100. Further, the CPU 101 of the main MCU 100 monitors the software error by executing the memory monitoring program 202. As described above, the hardware error and the software error can be separated by detecting the hardware error and the software error separately. Although not shown, a detection circuit for detecting a hardware error such as garbled RAM (01 inversion) of the RAM 103 may be provided inside or outside the main MCU 100.

つぎに、図3〜図7を参照して、CPU101がメモリ監視プログラム202を実行して、ソフトウェアエラーを検出する方法を具体的に説明する。本実施例では、CPU101がメモリ監視プログラム202を実行して、RAM103のアクセス禁止領域へのデータの書き込みを監視して制御プログラム201の不正アクセスを監視することにより、制御プログラム201のソフトウェアエラーを検出している。以下の説明では、CPU101がプログラムを実行して行う処理を、プログラムを動作主体として説明する。   Next, with reference to FIGS. 3 to 7, a method in which the CPU 101 executes the memory monitoring program 202 to detect a software error will be specifically described. In this embodiment, the CPU 101 executes the memory monitoring program 202 to monitor the writing of data to the access prohibited area of the RAM 103 and monitor the unauthorized access of the control program 201, thereby detecting the software error of the control program 201. is doing. In the following description, processing performed by the CPU 101 by executing a program will be described with the program as an operation subject.

図3において、RAM103には、制御プログラム201を実行する場合に使用するデータ領域(メモリ領域)301およびスタック領域302が初期設定で確保されている。このデータ領域301およびスタック領域302をアクセス許可領域と称する。   In FIG. 3, the RAM 103 has a data area (memory area) 301 and a stack area 302 that are used when the control program 201 is executed. The data area 301 and the stack area 302 are referred to as an access permission area.

上述したように、ソフトウェア設計時には、あらゆる動作を想定して、RAM103のメモリ保護違反、スタックオーバーフロー等を起こさないように、設計・デバック・検証をホワイトボックス的に行っているが、想定外のソフトウェアエラーが発生する場合がある。また、近時、ソフトウェアモジュールのブラックボックス化が進んでいるため、設計・デバック・検証を十分に行えない場合も想定される。   As described above, at the time of software design, design / debugging / verification is performed in a white box so as not to cause a memory protection violation of RAM 103, stack overflow, etc. An error may occur. In addition, since software modules are becoming more black boxes recently, there may be cases where design, debugging, and verification cannot be performed sufficiently.

データ領域301は、矢印方向に使用され、上位アドレス側から下位アドレス側にデータが書き込まれる。データ領域301の下側にはアクセス禁止領域401が隣接して設定されている。ソフトウェアエラーが発生して、データ領域301がオーバーフローした場合には、アクセス禁止領域401にデータが書き込まれることになる。   The data area 301 is used in the direction of the arrow, and data is written from the upper address side to the lower address side. An access prohibition area 401 is set adjacently below the data area 301. When a software error occurs and the data area 301 overflows, data is written to the access prohibited area 401.

スタック領域302は、矢印方向に使用され、上位アドレス側から下位アドレス側にデータが書き込まれる。スタック領域302の下側には、アクセス禁止領域402が近接して設定されている。ソフトウェアエラーが発生して、スタック領域302がオーバーフローした場合には、アクセス禁止領域402にデータが書き込まれることになる。   The stack area 302 is used in the direction of the arrow, and data is written from the upper address side to the lower address side. An access prohibition area 402 is set close to the lower side of the stack area 302. When a software error occurs and the stack area 302 overflows, data is written to the access prohibited area 402.

メモリ監視プログラム202は、電源投入後の制御プログラム201が実行される前に、検出用データとして、アクセス禁止領域401に、初期値=0x01010101を、アクセス禁止領域402に、初期値=0x02020202を書き込む。メモリ監視プログラム202は、制御プログラム201の実行中または制御プログラム201の実行後に、メモリ監視処理を実行し、アクセス禁止領域401,402のデータを読み込んで、検出用データ(0x01010101,0x02020202)とそれぞれ比較することで、アクセス禁止領域401、402にデータの書き込みがあるか否か検出する。   The memory monitoring program 202 writes initial value = 0x01010101 in the access prohibited area 401 and initial value = 0x0202022 in the access prohibited area 402 as detection data before the control program 201 after power-on is executed. The memory monitoring program 202 executes a memory monitoring process during execution of the control program 201 or after execution of the control program 201, reads the data in the access prohibited areas 401 and 402, and compares them with the detection data (0x01010101, 0x02020202). Thus, it is detected whether or not data is written in the access prohibited areas 401 and 402.

図4は、制御プログラム201とメモリ監視プログラム202の実行タイミングを説明するための図である。図4において、Tはモータ電流制御周期(例えば、125μsec)を示している。メモリ監視プログラム202によるメモリ監視処理は、CPU101の空き時間に実行され、同図に示す例では、所定周期で、制御プログラム201によるモータ制御処理の実行後の空き時間に実行される。また、メモリ監視処理の実行周期は、操舵補助モータ20の立ち上がりの時定数より小さい周期となっている。   FIG. 4 is a diagram for explaining execution timings of the control program 201 and the memory monitoring program 202. In FIG. 4, T represents a motor current control cycle (for example, 125 μsec). The memory monitoring process by the memory monitoring program 202 is executed during the idle time of the CPU 101. In the example shown in the figure, the memory monitoring process is executed at the idle time after the motor control process is executed by the control program 201 in a predetermined cycle. In addition, the execution period of the memory monitoring process is smaller than the time constant of the startup of the steering assist motor 20.

図5は、メモリ監視処理および安全動作移行処理を説明するためのフローチャートである。図5において、メモリ監視プログラム202によるメモリ監視処理が実行されると(ステップS1)、RAM103のアクセス禁止領域401、402のデータを読み込み(ステップS2)、読み込んだデータと検出用データが一致するか否かを判定する(ステップS3)。読み込んだデータと検出用データが一致する場合は(ステップS3の「Yes」)、ソフトウェアが正常に動作していると判断して、モータ制御処理を実行する(ステップS4)。他方、読み込んだデータと検出用データが一致しない場合は(ステップS3の「No」)、制御プログラム201による不正なアクセスであり、ソフトウェアエラーと判断して、安全動作移行プログラム203を実行する(ステップS5)。安全動作移行プログラム203は、解析に必要なメモリ情報(例えば、CPU101のレジスタやRAM103のアクセス禁止領域401,402に書き込まれたデータ等)を、EEPROM104に格納した後(ステップS6)、操舵補助モータ20を停止させる(ステップS7)。このように、RAM103のアクセス禁止領域にデータが書き込まれたことを検出した場合に、直ちに、操舵補助モータ20を停止することとしたので、制御プログラム201が暴走する前に、操舵補助モータ20を停止させることが可能となる。   FIG. 5 is a flowchart for explaining the memory monitoring process and the safe operation transition process. In FIG. 5, when the memory monitoring process by the memory monitoring program 202 is executed (step S1), the data in the access prohibited areas 401 and 402 of the RAM 103 is read (step S2), and whether the read data matches the detection data. It is determined whether or not (step S3). If the read data matches the detection data (“Yes” in step S3), it is determined that the software is operating normally, and motor control processing is executed (step S4). On the other hand, if the read data and the detection data do not match (“No” in step S3), it is determined that the access is an unauthorized access by the control program 201 and a software error is detected, and the safe operation transition program 203 is executed (step S3). S5). The safe operation transition program 203 stores memory information (for example, data written in the registers of the CPU 101 and the access prohibition areas 401 and 402 of the RAM 103) necessary for the analysis in the EEPROM 104 (step S6), and then the steering assist motor. 20 is stopped (step S7). As described above, when it is detected that data is written in the access prohibited area of the RAM 103, the steering assist motor 20 is immediately stopped. Therefore, before the control program 201 runs away, the steering assist motor 20 is turned off. It can be stopped.

なお、ここでは、EEPROM104に解析に必要なメモリ情報を格納した後に、操舵補助モータ20を停止させることとしたが、操舵補助モータ20を停止させた後に、解析に必要なメモリ情報を、EEPROM104に格納することにしてもよい。また、解析に必要なメモリ情報は、CPU101のレジスタやRAM103のアクセス禁止領域401,402に書き込まれたデータに限られるものではなく、RAM103のアクセス禁止領域にデータが書き込まれた原因(ソフトウェアエラーの原因)を解析するために必要なデータであれば、如何なるデータでもよい。   Here, the memory information necessary for the analysis is stored in the EEPROM 104 and then the steering assist motor 20 is stopped. However, after the steering assist motor 20 is stopped, the memory information necessary for the analysis is stored in the EEPROM 104. It may be stored. Further, the memory information necessary for the analysis is not limited to the data written in the registers of the CPU 101 and the access prohibited areas 401 and 402 of the RAM 103, but the cause of the data being written in the access prohibited areas of the RAM 103 (software error Any data may be used as long as it is necessary for analyzing the cause).

図6および図7は、RAM103の他の構成例を示す図である。RAM103の領域設定は、図3に示す例に限られるものではなく、例えば、図6および図7に示すような構成としてもよい。図6において、データ領域311とスタック領域312とが、隣接して設定されており、データ領域311の上側にアクセス禁止領域411、スタック領域312の下側にアクセス禁止領域412が隣接して設定されている。データ領域311は、矢印方向に使用され、下位アドレス側から上位アドレス側にデータ書き込まれる。また、スタック領域312は、矢印方向に使用され、上位アドレス側から下位アドレス側にデータが書き込まれる。   6 and 7 are diagrams illustrating another configuration example of the RAM 103. FIG. The area setting of the RAM 103 is not limited to the example shown in FIG. 3, and may be configured as shown in FIGS. 6 and 7, for example. In FIG. 6, the data area 311 and the stack area 312 are set adjacently, the access prohibited area 411 is set above the data area 311, and the access prohibited area 412 is set adjacently below the stack area 312. ing. The data area 311 is used in the direction of the arrow, and data is written from the lower address side to the upper address side. The stack area 312 is used in the direction of the arrow, and data is written from the upper address side to the lower address side.

図7において、データ領域321とスタック領域322間にアクセス禁止領域421が設定されている。データ領域321は、矢印方向に使用され、上位アドレス側から下位アドレス側にデータ書き込まれる。また、スタック領域322は、矢印方向に使用され、下位アドレス側から上位アドレス側にデータが書き込まれる。このように、アクセス禁止領域421を設定することにより、1つのアクセス禁止領域で、データ領域321およびスタック領域322のオーバーフローを検出することができ、RAM103のメモリ容量を低減することが可能となる。   In FIG. 7, an access prohibition area 421 is set between the data area 321 and the stack area 322. The data area 321 is used in the direction of the arrow, and data is written from the upper address side to the lower address side. The stack area 322 is used in the direction of the arrow, and data is written from the lower address side to the upper address side. Thus, by setting the access prohibited area 421, it is possible to detect an overflow of the data area 321 and the stack area 322 in one access prohibited area, and to reduce the memory capacity of the RAM 103.

図8は、CPU101が制御プログラム201を実行することにより実現する機能(制御プログラム201の機能構成)を示す図である。   FIG. 8 is a diagram illustrating functions realized by the CPU 101 executing the control program 201 (functional configuration of the control program 201).

制御プログラム201は、図8に示すように、操舵トルクTと車速Vに基づいて操舵補助トルク指令値を算出するトルク制御系モジュール(例えば、動作周期が1msec)500と、各種のトルク補償を行う補償制御系モジュール(例えば、動作周期が2msec)510と、モータ電流のFB(フィードバック)制御を行うモータ電流制御系モジュール520(例えば、動作周期が125μsec)と、操舵補助モータ20のモータ電流のFF(フィードフォワード)制御を行うモータ電流補助制御系モジュール530(例えば、動作周期が125μsec)等を備えている。つぎに、動作の概略を説明する。   As shown in FIG. 8, the control program 201 performs a torque control system module (for example, the operation cycle is 1 msec) 500 that calculates a steering assist torque command value based on the steering torque T and the vehicle speed V, and performs various torque compensations. Compensation control system module (for example, operation cycle is 2 msec) 510, motor current control system module 520 for performing FB (feedback) control of motor current (for example, operation cycle is 125 μsec), motor current FF of steering assist motor 20 A motor current auxiliary control system module 530 (for example, the operation cycle is 125 μsec) that performs (feed forward) control is provided. Next, an outline of the operation will be described.

まず、トルクセンサ10で検出された操舵トルクTと、車速センサ12で検出された車速Vとがアシストマップ501に入力され操舵補助指令値が算出される。さらに、補償制御系モジュール510で演算される補償値、例えば、収斂性演算部511,慣性演算部512,およびSAT演算部513で算出された収斂性・慣性・SATなどの補償値を、加算部502で操舵補助指令値に加算してトルク指令値Trefが決定される。トルク指令値Trefは、位相補償部503で位相補償された後、電流指令値演算部540に入力される。そして、トルク指令値Trefに基づいて電流指令値演算部540で電流指令値Irefが決定される。なお、ブラシレスモータでは、トルク指令値Trefの他に回転子のロータ角度も電流指令値演算部540に入力して電流指令値Irefが決定される。   First, the steering torque T detected by the torque sensor 10 and the vehicle speed V detected by the vehicle speed sensor 12 are input to the assist map 501, and a steering assist command value is calculated. Furthermore, a compensation value calculated by the compensation control system module 510, for example, a compensation value such as convergence / inertia / SAT calculated by the convergence calculation unit 511, inertia calculation unit 512, and SAT calculation unit 513 is added to the addition unit. In 502, the torque command value Tref is determined by adding to the steering assist command value. The torque command value Tref is phase-compensated by the phase compensator 503 and then input to the current command value calculator 540. Based on the torque command value Tref, the current command value calculation unit 540 determines the current command value Iref. In the brushless motor, in addition to the torque command value Tref, the rotor angle of the rotor is also input to the current command value calculation unit 540 to determine the current command value Iref.

一方、操舵補助モータ20のモータ電流は、電流検出値Imとして、電流検出回路160で検出され、電流指令値Irefとともに減算部521へ入力される。減算部521では、それらの偏差ΔI=Iref−Imが算出され、PI(比例積分)制御部522に入力される。PI(比例積分)制御部522では、偏差ΔIの比例積分出力として、電圧制御値Vrefが出力される。また、電流指令値Irefは、補助値演算部531に入力される。補助値演算部531で演算される補助値、例えば、Dead Time演算部532、EMF(逆起電力)演算部533、および弱め界磁制御演算部534で算出された補助値が、加算部535で電圧制御値Vrefに加算される。加算部535の出力は、PWM制御部550に入力されて、PWM処理され、UVW各相のPWM制御信号がFETプリドライバ回路140に出力され、FETプリドライバ回路140およびモータ駆動回路150を介して、操舵補助モータ20が駆動される。   On the other hand, the motor current of the steering assist motor 20 is detected by the current detection circuit 160 as the current detection value Im, and is input to the subtraction unit 521 together with the current command value Iref. The subtraction unit 521 calculates the deviation ΔI = Iref−Im and inputs it to the PI (proportional integration) control unit 522. A PI (proportional integration) control unit 522 outputs a voltage control value Vref as a proportional integration output of the deviation ΔI. The current command value Iref is input to the auxiliary value calculation unit 531. The auxiliary value calculated by the auxiliary value calculation unit 531, for example, the auxiliary value calculated by the Dead Time calculation unit 532, the EMF (back electromotive force) calculation unit 533, and the field weakening control calculation unit 534 is voltage-controlled by the addition unit 535. It is added to the value Vref. The output of the adder 535 is input to the PWM controller 550 and subjected to PWM processing, and the PWM control signal for each UVW phase is output to the FET predriver circuit 140, via the FET predriver circuit 140 and the motor drive circuit 150. The steering assist motor 20 is driven.

実施例1によれば、制御プログラム201を実行して操舵補助モータ20を制御するCPU101と、CPU101が制御プログラム201を実行する場合にその作業領域として使用され、アクセス許可領域とアクセス禁止領域とを有するRAM103とを備え、CPU101は、メモリ監視プログラム202を実行して、RAM103のアクセス禁止領域へのデータの書き込みを監視して、制御プログラム201の不正アクセスを監視することとしたので、RAM103のアクセス禁止領域へデータが書き込まれたか否かをソフトウェアにより検出して、ソフトウェアエラーを検出することができ、低コストな構成でRAM103を監視して、ソフトウェアの暴走を未然に防止することが可能となる。   According to the first embodiment, the CPU 101 that executes the control program 201 to control the steering assist motor 20, and is used as a work area when the CPU 101 executes the control program 201, and includes an access permission area and an access prohibition area. Since the CPU 101 executes the memory monitoring program 202 and monitors the writing of data to the access prohibited area of the RAM 103 to monitor the unauthorized access of the control program 201, the CPU 103 accesses the RAM 103. It is possible to detect whether or not data has been written to the prohibited area by software, and to detect a software error. By monitoring the RAM 103 with a low-cost configuration, it is possible to prevent software runaway. .

また、実施例1によれば、CPU101は、メモリ監視プログラム202を実行して、RAM103のアクセス禁止領域のデータを読み込んで、検出用データと比較することで、アクセス禁止領域に書き込みがあるか否か検出することとしたので、簡単な方法で、RAM103のアクセス禁止領域にデータが書き込まれたか否かを検出することが可能となる。   Further, according to the first embodiment, the CPU 101 executes the memory monitoring program 202, reads the data in the access prohibited area of the RAM 103, and compares it with the detection data to determine whether there is a write in the access prohibited area. Therefore, it is possible to detect whether data has been written in the access prohibited area of the RAM 103 by a simple method.

また、実施例1によれば、アクセス許可領域は、スタック領域およびデータ領域を含み、アクセス禁止領域は、スタック領域およびデータ領域に隣接した領域に設定しているので、スタック領域およびデータ領域のオーバーフローを監視することが可能となる。   Further, according to the first embodiment, the access permitted area includes the stack area and the data area, and the access prohibited area is set to an area adjacent to the stack area and the data area. Can be monitored.

また、実施例1によれば、CPU101は、RAM103のアクセス禁止領域へのデータの書き込みを検出した場合には、安全動作移行プログラム203を実行して、操舵補助モータ20を停止させることとしたので、ソフトウェアが暴走する前に、操舵補助モータ20を停止することが可能となる。   Further, according to the first embodiment, when the CPU 101 detects writing of data in the access prohibited area of the RAM 103, the CPU 101 executes the safe operation transition program 203 to stop the steering assist motor 20. The steering assist motor 20 can be stopped before the software runs away.

また、実施例1によれば、CPU101は、RAM103のアクセス禁止領域へのデータの書き込みを検出した場合には、安全動作移行プログラム203を実行して、解析に必要なメモリ情報をEEPROM104に格納することとしたので、RAM103のアクセス禁止領域にデータが書き込まれた原因(ソフトウェアエラーの原因)を解析することが可能となる。   Further, according to the first embodiment, when the CPU 101 detects writing of data in the access prohibited area of the RAM 103, the CPU 101 executes the safe operation transition program 203 and stores memory information necessary for analysis in the EEPROM 104. As a result, it is possible to analyze the cause (data cause of software error) of the data being written in the access prohibited area of the RAM 103.

また、実施例1によれば、CPU101は、メモリ監視プログラム202によるRAM103のアクセス禁止領域への書き込みの監視を、操舵補助モータ20の立ち上がりの時定数よりも短い周期で実行することとしたので、ソフトウェアが暴走する前に、確実に操舵補助モータ20を停止させる等の対策をとることが可能となる。   Further, according to the first embodiment, the CPU 101 executes the monitoring of the writing to the access prohibited area of the RAM 103 by the memory monitoring program 202 at a cycle shorter than the time constant of the startup of the steering assist motor 20. It is possible to take measures such as reliably stopping the steering assist motor 20 before the software runs away.

また、実施例1によれば、CPU101およびRAM103のハードウェアエラーを副MPU110およびWDT130等で検出することとしたので、ハードウェアエラーの無い状態でソフトウェアエラーを検出することが可能となる。   In addition, according to the first embodiment, since the hardware error of the CPU 101 and the RAM 103 is detected by the sub MPU 110 and the WDT 130, it is possible to detect the software error without any hardware error.

実施例1では、メモリ監視プログラム202により、RAM103のアクセス禁止領域への書き込みを検出した場合に、安全動作移行プログラム203を実行して操舵補助モータ20を停止させる構成である。これに対して、実施例2は、メモリ監視プログラム202で、RAM103のアクセス禁止領域への書き込みを検出した場合に、制御プログラム201に比して負荷の小さいサブ制御プログラム204を実行して、モータ制御を続行する構成である。   In the first embodiment, when the memory monitoring program 202 detects writing to the access prohibited area of the RAM 103, the safe operation transition program 203 is executed to stop the steering assist motor 20. In contrast, in the second embodiment, when the memory monitoring program 202 detects writing in the access prohibited area of the RAM 103, the sub-control program 204 having a smaller load than the control program 201 is executed to This is a configuration for continuing control.

図9は、実施例2に係るROMおよびRAMの構成例を示す図である。図9において、図3と同等機能を有する部位には同一符号を付してその説明を省略し、異なる点についてのみ説明する。同図において、ROM102には、さらに、制御プログラム201に比して負荷の小さいサブ制御プログラム204が格納されている。   FIG. 9 is a diagram illustrating a configuration example of a ROM and a RAM according to the second embodiment. 9, parts having the same functions as those in FIG. 3 are denoted by the same reference numerals, description thereof is omitted, and only different points will be described. In the figure, the ROM 102 further stores a sub control program 204 having a smaller load than the control program 201.

図10は、実施例2に係るメモリ監視処理および安全動作移行処理を説明するためのフローチャートである。図10において、図5と同様の処理を行うステップには、同一のステップ番号が付してある。   FIG. 10 is a flowchart for explaining the memory monitoring process and the safe operation transition process according to the second embodiment. In FIG. 10, the same step numbers are assigned to the steps for performing the same processing as in FIG.

図10において、まず、メモリ監視プログラム202によるメモリ監視処理が実行されると(ステップS1)、RAM103のアクセス禁止領域401、402のデータを読み込み(ステップS2)、読み込んだデータと検出用データが一致するか否かを判定する(ステップS3)。読み込んだデータと検出用データが一致する場合は(ステップS3の「Yes」)、ソフトウェアが正常に動作していると判断して、モータ制御処理を実行する(ステップS4)。他方、読み込んだデータと検出用データが一致しない場合は(ステップS3の「No」)、制御プログラム201による不正アクセスであり、ソフトウェアエラーと判断して、安全動作移行プログラム203を実行し(ステップS5)、解析に必要なメモリ情報(例えば、CPU101のレジスタやRAM103のアクセス禁止領域401,402に書き込まれたデータ等)を、EEPROM104に格納する(ステップS6)。この後、サブ制御プログラム204を実行し、操舵補助モータ20の制御を継続する(ステップS10)。   In FIG. 10, first, when the memory monitoring process by the memory monitoring program 202 is executed (step S1), the data in the access prohibited areas 401 and 402 of the RAM 103 are read (step S2), and the read data matches the detection data. It is determined whether or not to perform (step S3). If the read data matches the detection data (“Yes” in step S3), it is determined that the software is operating normally, and motor control processing is executed (step S4). On the other hand, if the read data does not match the detection data (“No” in step S3), it is determined that the access is an unauthorized access by the control program 201 and a software error has occurred, and the safe operation transition program 203 is executed (step S5). ), Memory information necessary for analysis (for example, data written in the registers of the CPU 101 and the access prohibited areas 401 and 402 of the RAM 103) is stored in the EEPROM 104 (step S6). Thereafter, the sub control program 204 is executed to continue the control of the steering assist motor 20 (step S10).

図11は、CPU101がサブ制御プログラム204を実行することにより実現する機能(サブ制御プログラム204の機能構成)を示す図である。図11において、図8と同等機能を有する部位には同一符号を付してある。図11に示すサブ制御プログラム204は、図8に示す制御プログラム201において、モータ電流補助制御系モジュール530を削除して負荷を軽くしたものである。   FIG. 11 is a diagram illustrating a function (functional configuration of the sub control program 204) realized by the CPU 101 executing the sub control program 204. In FIG. 11, parts having the same functions as those in FIG. A sub control program 204 shown in FIG. 11 is obtained by reducing the load by removing the motor current auxiliary control system module 530 from the control program 201 shown in FIG.

実施例2によれば、CPU101は、メモリ監視プログラム202によるメモリ監視処理で、RAM103のアクセス禁止領域401,402へのデータの書き込みを検出した場合には、制御プログラム201の実行を停止して、制御プログラム201に比して負荷の少ないサブ制御プログラム204を実行して操舵補助モータ20の制御を継続することとしたので、ソフトウェアの暴走を未然に防止することができるとともに、操舵補助モータ20の制御を継続させることが可能となる。   According to the second embodiment, when the memory monitoring process by the memory monitoring program 202 detects the writing of data to the access prohibited areas 401 and 402 of the RAM 103, the CPU 101 stops the execution of the control program 201, Since the sub-control program 204 having a smaller load than the control program 201 is executed and the control of the steering assist motor 20 is continued, the software runaway can be prevented and the steering assist motor 20 is controlled. Control can be continued.

実施例3では、マルチタスクOSであるリアルタイムOSを用いて、マルチタスク構成としたものである。近時、車両用電動機の制御の複雑化に伴って多数のタスク(プロセス、ジョブ)を処理する必要がでてきており、それら多数のタスクに対して細かな優先順位を設定しなければならなくなってきている。そこで、実施例3では、マルチタスクOSであるリアルタイムOSを用いて、マルチタスク構成とした場合について説明する。   In the third embodiment, a multitask configuration is made using a real-time OS that is a multitasking OS. Recently, it has become necessary to process a large number of tasks (processes, jobs) as the control of motors for vehicles has become more complex, and it has become necessary to set detailed priorities for these numerous tasks. It is coming. Thus, in the third embodiment, a case where a multitask configuration is configured using a real-time OS that is a multitask OS will be described.

図12は、実施例3に係るROMおよびRAMの構成例を示す図である。図12において、図3と同等機能を有する部位には同一符号を付してその説明を省略し、異なる点についてのみ説明する。同図において、ROM102には、タスクの時間管理等を行うためのリアルタイムOS205、タスク1〜3が格納されている。リアルタイムOS205は、タスク1〜3の優先順位に従って、タスク1〜3の実行の時間的管理を行う。   FIG. 12 is a diagram illustrating a configuration example of a ROM and a RAM according to the third embodiment. 12, parts having the same functions as those in FIG. 3 are denoted by the same reference numerals, description thereof is omitted, and only different points will be described. In FIG. 1, a ROM 102 stores a real-time OS 205 and tasks 1 to 3 for performing task time management and the like. The real-time OS 205 performs temporal management of the execution of tasks 1 to 3 in accordance with the priorities of tasks 1 to 3.

ここで、リアルタイムOS205およびタスク1〜3を、制御プログラム210と称する。タスク1〜3は優先順位が異なっており、タスク1は優先度が「高」、タスク2は優先度が「中」、タスク3は優先度が「低」に設定されている。例えば、タスク1は、操舵補助モータ20を制御するためのモータ制御処理を実行するタスクであり、タスク2は、外部とCAN通信等の通信をするためのタスクであり、タスク3は、フェールセーフ(F/S)処理を行うためのタスクである。ここで示すタスク1〜3は一例であり、本発明はこれに限られるものではなく、電動パワーステアリング装置では他のタスクもある。   Here, the real-time OS 205 and tasks 1 to 3 are referred to as a control program 210. Tasks 1 to 3 have different priorities, task 1 is set to “high” priority, task 2 is set to “medium”, and task 3 is set to “low”. For example, task 1 is a task for executing a motor control process for controlling the steering assist motor 20, task 2 is a task for communication such as CAN communication with the outside, and task 3 is fail-safe. This is a task for performing (F / S) processing. Tasks 1 to 3 shown here are examples, and the present invention is not limited to this, and there are other tasks in the electric power steering apparatus.

また、RAM103には、タスク1を実行するためのタスク1用領域331(データ領域331a、スタック領域331b)、タスク2を実行するためのタスク2用領域332(データ領域332a、スタック領域332b)、タスク3を実行するためのタスク3用領域333(データ領域333a、スタック領域333b)が初期設定で確保されている。なお、ここでは、タスク毎にそれぞれアクセス許可領域を設定することとしたが、複数のタスクについて、1つのアクセス許可領域を設定することにしてもよい。   Further, in the RAM 103, a task 1 area 331 (data area 331a and stack area 331b) for executing task 1, a task 2 area 332 (data area 332a and stack area 332b) for executing task 2, A task 3 area 333 (data area 333a and stack area 333b) for executing task 3 is secured by initial setting. Here, the access permission area is set for each task, but one access permission area may be set for a plurality of tasks.

各データ領域331a、332a、333aおよび各スタック領域331b、332b、333bは、矢印方向に使用される。各タスク用領域331,332,333間には、アクセス禁止領域431,432,433,434が設定されている。なお、アクセス許可領域およびアクセス禁止領域の設定例は、図12に示す例に限られるものではなく、各タスク毎に、上記図6および図7に示すような構成としてもよい。   Each data area 331a, 332a, 333a and each stack area 331b, 332b, 333b are used in the direction of the arrow. Access prohibition areas 431, 432, 433, and 434 are set between the task areas 331, 332, and 333, respectively. The setting example of the access permission area and the access prohibition area is not limited to the example shown in FIG. 12, and the configuration shown in FIGS. 6 and 7 may be used for each task.

メモリ監視プログラム202は、電源投入後の制御プログラム210が実行される前に、検出用データとして、アクセス禁止領域431に初期値=0x01010101を、アクセス禁止領域432に初期値=0x02020202を、アクセス禁止領域433に初期値=0x03030303を、アクセス禁止領域434に初期値=0x04040404をそれぞれ書き込む。メモリ監視プログラム202は、制御プログラム210の実行中または制御プログラム210の実行後に、メモリ監視処理を実行し、アクセス禁止領域431,432、433,434のデータを読み込んで、検出用データ(0x01010101,0x02020202、0x03030303、0x04040404)とそれぞれ比較することで、アクセス禁止領域431,432、433,434に書き込みがあるか否か検出する。   The memory monitoring program 202 sets, as detection data, an initial value = 0x01010101 in the access prohibited area 431, an initial value = 0x0202022 in the access prohibited area 432, and an access prohibited area as detection data before the control program 210 after power is turned on. The initial value = 0x03030303 is written in 433, and the initial value = 0x040040404 is written in the access prohibited area 434, respectively. The memory monitoring program 202 executes a memory monitoring process during execution of the control program 210 or after execution of the control program 210, reads data in the access prohibited areas 431, 432, 433, and 434, and detects data (0x01010101, 0x02020202). , 0x03030303, 0x040040404), it is detected whether or not there is a write in the access prohibited areas 431, 432, 433, 434.

図13は、タスク1〜3およびメモリ監視処理のタイミングチャートの一例を示す図である。同図において、T1は通常時、T2は外乱発生時、Tはモータ電流制御周期を示している。メモリ監視処理は、タスク1〜3が実行されていない間に実行され、その周期は、操舵補助モータ20の立ち上がりの時定数より小さい周期となっている。   FIG. 13 is a diagram illustrating an example of a timing chart of tasks 1 to 3 and memory monitoring processing. In the figure, T1 indicates a normal time, T2 indicates a disturbance occurrence, and T indicates a motor current control cycle. The memory monitoring process is executed while tasks 1 to 3 are not executed, and the cycle thereof is shorter than the time constant of the startup of the steering assist motor 20.

T1の期間は、外乱要素がなく、他のタスク処理に影響されずに、通常処理を行っている。T2の期間は、外乱要素が発生した場合を示しており、他のタスク処理の割り込みが発生し、RAM103の使用領域が増加する傾向となる。例えば、時刻t1に、外乱要素が発生し、タスク3の処理中に、優先度「中」のタスク2の処理が要求された場合、タスク3は待ち行列処理が発生し、一時的に処理を中断し、中断した情報をRAM103のタスク3用領域333のスタック領域333bに保存しておく。次に、時刻t2で、タスク2の処理中に、処理の優先度「高」のタスク1の処理が要求されると、タスク2は待ち行列が発生し、一時的に処理を中断し、中断した情報をRAM103のタスク2用領域332のスタック領域332bに保存する。この後、中断したタスク2,タスク3の処理を実行する。この場合、外乱要素がない場合に比して、一時的なメモリ使用量が増加してしまい、RAM103のオーバーフローが発生する可能性が高くなる。   During the period of T1, there is no disturbance factor, and normal processing is performed without being affected by other task processing. The period of T2 shows a case where a disturbance element has occurred, and another task processing interrupt occurs, and the use area of the RAM 103 tends to increase. For example, when a disturbance element occurs at time t1, and processing of task 2 having a priority “medium” is requested during processing of task 3, queue processing occurs in task 3, and processing is temporarily performed. The interrupted information is stored in the stack area 333 b of the task 3 area 333 of the RAM 103. Next, at time t2, during the processing of task 2, when the processing of task 1 having a high processing priority is requested, a queue is generated in task 2, and the processing is temporarily interrupted. The stored information is stored in the stack area 332 b of the task 2 area 332 of the RAM 103. Thereafter, the suspended task 2 and task 3 processes are executed. In this case, compared with the case where there is no disturbance element, the temporary memory usage increases, and the possibility of overflow of the RAM 103 increases.

なお、メモリ監視処理の実行周期は、図13に示す場合に限られるものではなく、例えば、タスク1の実行後に、必ず実行することにしてもよく、操舵補助モータ20の立ち上がりの時定数より小さい周期であれば、如何なる周期で行うことにしてもよい。   The execution period of the memory monitoring process is not limited to the case shown in FIG. 13. For example, it may be executed after the execution of task 1, and is smaller than the time constant of the startup of the steering assist motor 20. Any period may be used as long as it is a period.

図14は、実施例3に係るメモリ監視処理および安全動作移行処理を説明するためのフローチャートである。図14において、図5と同様の処理を行うステップには、同一のステップ番号が付してある。   FIG. 14 is a flowchart for explaining the memory monitoring process and the safe operation transition process according to the third embodiment. In FIG. 14, steps that perform the same processing as in FIG. 5 are given the same step numbers.

図14において、まず、メモリ監視プログラム202によるメモリ監視処理が実行されると(ステップS1)、RAM103のアクセス禁止領域431、432、433、434のデータを読み込み(ステップS2)、読み込んだデータと検出用データが一致するか否かを判定する(ステップS3)。読み込んだデータと検出用データが一致する場合は(ステップS3の「Yes」)、ソフトウェアが正常に動作していると判断して、タスク1〜3を実行する(ステップS20)。他方、読み込んだデータと検出用データが一致しない場合は(ステップS3の「No」)、制御プログラム210の不正なアクセスであり、ソフトウェアエラーと判断して、安全動作移行プログラム203を実行する(ステップS5)。安全動作移行プログラム203は、解析に必要なメモリ情報(例えば、CPU101のレジスタやRAM103のアクセス禁止領域431,432,433,434に書き込まれたデータ等)を、EEPROM104に格納した後(ステップS6)、操舵補助モータ20を停止させる(ステップS7)。   In FIG. 14, first, when a memory monitoring process by the memory monitoring program 202 is executed (step S1), data in the access prohibited areas 431, 432, 433, and 434 of the RAM 103 is read (step S2), and the read data and detection are detected. It is determined whether the business data matches (step S3). If the read data matches the detection data (“Yes” in step S3), it is determined that the software is operating normally, and tasks 1 to 3 are executed (step S20). On the other hand, if the read data and the detection data do not match (“No” in step S3), it is determined that the control program 210 is an unauthorized access and a software error is detected, and the safe operation transition program 203 is executed (step S3). S5). The safe operation transition program 203 stores memory information necessary for analysis (for example, data written in the registers of the CPU 101 and the access prohibited areas 431, 432, 433, and 434 of the RAM 103) in the EEPROM 104 (step S6). Then, the steering assist motor 20 is stopped (step S7).

なお、ここでは、メモリ監視プログラム202で、RAM103のアクセス禁止領域431,432,433、434への書き込みを検出した場合に、操舵補助モータ20を停止させることとしたが、実施例2のように、各タスク1〜3について、より負荷の軽いタスクをROM102に格納しておいて、アクセス禁止領域431,432,433、434への書き込みを検出した場合に、負荷の軽いタスクを実行することにしてもよい。   Here, the steering assist motor 20 is stopped when the memory monitoring program 202 detects writing to the access prohibited areas 431, 432, 433, and 434 of the RAM 103, but as in the second embodiment. For each task 1 to 3, when a task with a lighter load is stored in the ROM 102 and writing to the access prohibited areas 431, 432, 433, and 434 is detected, the task with a lighter load is executed. May be.

実施例3によれば、制御プログラム210は、優先順位の異なる複数のタスクを含み、RAM103は、複数のタスク用の各タスク用領域331,332,333が設定されており、各タスク用領域331,332,333間にアクセス禁止領域431,432,433,434が設定されており、CPU101は、メモリ監視プログラム202を実行して、RAM103の各タスク用領域331,332,333間のアクセス禁止領域431,432,433,434を監視することとしたので、各タスクのソフトウェアエラーを検出することが可能となる。   According to the third embodiment, the control program 210 includes a plurality of tasks having different priorities, and the RAM 103 is provided with task areas 331, 332, and 333 for a plurality of tasks, and each task area 331 is provided. , 332, 333 are set as access prohibition areas 431, 432, 433, 434, and the CPU 101 executes the memory monitoring program 202, and the access prohibition areas between the task areas 331, 332, 333 of the RAM 103 are set. Since 431, 432, 433, and 434 are monitored, it becomes possible to detect a software error of each task.

なお、上記実施例1〜3では、車両用電動機として電動パワーステアリング装置の操舵補助モータを制御する制御装置を一例として説明したが、本発明はこれに限られるものではなく、他の車両用電動機に適用することができ、例えば、ハイブリット車両用の電動機等に広く適用可能である。   In the first to third embodiments, the control device for controlling the steering assist motor of the electric power steering device is described as an example of the vehicle motor. However, the present invention is not limited to this, and other vehicle motors are used. For example, it can be widely applied to electric motors for hybrid vehicles.

本発明に係る車両用電動機の制御装置、車両用電動機の制御方法、およびコンピュータが実行するためのプログラムは、車両に搭載される各種車両用電動機に適用可能であるが、特に、電動パワーステアリング装置の操舵補助モータを制御する場合に有用である。   The vehicle motor control device, the vehicle motor control method, and the program executed by the computer according to the present invention can be applied to various vehicle motors mounted on the vehicle, and in particular, the electric power steering device. This is useful when controlling the steering assist motor.

電動パワーステアリング装置の一般的な構成を示す図である。It is a figure which shows the general structure of an electric power steering apparatus. 図1のコントロールユニットのハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the control unit of FIG. 主MCUのROMおよびRAMのメモリ構成例を示す図である。It is a figure which shows the memory structural example of ROM and RAM of main MCU. 制御プログラムとメモリ監視プログラムの実行タイミングを説明するための図である。It is a figure for demonstrating the execution timing of a control program and a memory monitoring program. メモリ監視処理および安全動作移行処理を説明するためのフローチャートである。It is a flowchart for demonstrating a memory monitoring process and a safe operation | movement transfer process. RAMの他の構成例(その1)を示す図である。It is a figure which shows the other structural example (the 1) of RAM. RAMの他の構成例(その2)を示す図である。It is a figure which shows the other structural example (the 2) of RAM. CPUが制御プログラムを実行することにより実現する機能(制御プログラムの機能構成)を示す図である。It is a figure which shows the function (functional structure of a control program) implement | achieved when CPU runs a control program. 実施例2に係るROMおよびRAMの構成例を示す図である。6 is a diagram illustrating a configuration example of a ROM and a RAM according to Embodiment 2. FIG. 実施例2に係るメモリ監視処理および安全動作移行処理を説明するためのフローチャートである。12 is a flowchart for explaining a memory monitoring process and a safe operation transition process according to the second embodiment. CPUがサブ制御プログラムを実行することにより実現する機能(サブ制御プログラムの機能構成)を示す図である。It is a figure which shows the function (functional structure of a sub control program) implement | achieved when CPU executes a sub control program. 実施例3に係るROMおよびRAMの構成例を示す図である。FIG. 10 is a diagram illustrating a configuration example of a ROM and a RAM according to a third embodiment. タスク1〜3およびメモリ監視処理のタイミングチャートの一例を示す図である。It is a figure which shows an example of the timing chart of tasks 1-3 and a memory monitoring process. 実施例3に係るメモリ監視処理および安全動作移行処理を説明するためのフローチャートである。12 is a flowchart for explaining a memory monitoring process and a safe operation transition process according to the third embodiment.

符号の説明Explanation of symbols

1 操向ハンドル
2 コラム軸
3 減速ギア
4a,4b ユニバーサルジョイント
5 ピニオンラック機構
6 タイロッド
10 トルクセンサ
12 車速センサ
14 バッテリ
20 操舵補助モータ
30 コントロールユニット
100 主MCU(マイクロコントロールユニット)
101 CPU(制御手段)
102 ROM
103 RAM
104 EEPROM
105 A/D変換器
106 インターフェース
107 バス
110 副MCU(マイクロコントロールユニット)
111 CPU
112 ROM
113 RAM
115 D/A変換器
116 A/D変換器
130 WDT(ウォッチドックタイマ)
140 FETプリドライバ回路
150 モータ駆動回路(インバータ)
160 電流検出回路
170 位置検出回路
201,210 制御プログラム
202 メモリ監視プログラム
203 安全動作移行プログラム
204 サブ制御プログラム
301,311,321 データ領域
302,312,322 スタック領域
401,402,411,412 421,431,432,433,434 アクセス禁止領域
331 タスク1用領域
332 タスク2用領域
333 タスク3用領域
500 トルク制御系モジュール
510 補償制御系モジュール
520 モータ電流制御系モジュール
530 モータ電流補助制御系モジュール
DESCRIPTION OF SYMBOLS 1 Steering handle 2 Column shaft 3 Reduction gear 4a, 4b Universal joint 5 Pinion rack mechanism 6 Tie rod 10 Torque sensor 12 Vehicle speed sensor 14 Battery 20 Steering auxiliary motor 30 Control unit 100 Main MCU (micro control unit)
101 CPU (control means)
102 ROM
103 RAM
104 EEPROM
105 A / D converter 106 Interface 107 Bus 110 Sub-MCU (micro control unit)
111 CPU
112 ROM
113 RAM
115 D / A converter 116 A / D converter 130 WDT (watchdog timer)
140 FET pre-driver circuit 150 Motor drive circuit (inverter)
160 Current detection circuit 170 Position detection circuit 201, 210 Control program 202 Memory monitoring program 203 Safe operation transition program 204 Sub control program 301, 311, 321 Data area 302, 312, 322 Stack area 401, 402, 411, 412 421, 431 , 432, 433, 434 Access prohibited area 331 Task 1 area 332 Task 2 area 333 Task 3 area 500 Torque control module 510 Compensation control module 520 Motor current control module 530 Motor current auxiliary control module

Claims (13)

車両に搭載された車両用電動機を制御する車両用電動機の制御装置において、
制御プログラムを実行して前記車両用電動機を制御する制御手段と、
前記制御手段が前記制御プログラムを実行する場合にその作業領域として使用され、データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリと、
を備え、
前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを監視するメモリ監視手段を有し、前記制御プログラムの不正アクセスを監視することを特徴とする車両用電動機の制御装置。
In a control device for a vehicle motor that controls a vehicle motor mounted on a vehicle,
Control means for controlling the vehicle electric motor by executing a control program;
A memory having an access-permitted area where writing of data is permitted and an access-prohibiting area where writing of data is prohibited; used as a work area when the control means executes the control program;
With
The control device for a motor for a vehicle according to claim 1, wherein the control means includes memory monitoring means for monitoring writing of data to the access prohibited area of the memory, and monitors unauthorized access of the control program.
前記メモリ監視手段は、前記制御プログラムが実行される前に所定の検出用データをアクセス禁止領域に予め書き込み、前記制御プログラムの実行中に、または、前記制御プログラムが実行された後に、前記アクセス禁止領域のデータを読み込んで前記所定の検出用データと比較することにより、前記アクセス禁止領域へのデータの書き込みを検出することを特徴とする請求項1に記載の車両用電動機の制御装置。   The memory monitoring unit writes predetermined detection data in an access prohibited area in advance before the control program is executed, and prohibits the access during the execution of the control program or after the control program is executed. The vehicle motor control device according to claim 1, wherein data writing in the access prohibited area is detected by reading data in the area and comparing the data with the predetermined detection data. 前記アクセス許可領域は、スタック領域およびデータ領域を含み、前記アクセス禁止領域は、前記スタック領域およびデータ領域に隣接した領域であることを特徴とする請求項1または請求項2に記載の車両用電動機の制御装置。   The electric motor for a vehicle according to claim 1, wherein the access permission area includes a stack area and a data area, and the access prohibition area is an area adjacent to the stack area and the data area. Control device. 前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを検出した場合には、前記車両用電動機を停止させることを特徴とする請求項1乃至請求項3のいずれか1つに記載の車両用電動機の制御装置。   The said control means stops the said motor for vehicles, when the writing of the data to the access prohibition area | region of the said memory is detected, The electric motor for vehicles as described in any one of Claim 1 thru | or 3 characterized by the above-mentioned. Control device for motor for vehicle. 前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを検出した場合には、前記制御プログラムの実行を停止して、当該制御プログラムに比して負荷の少ないサブ制御プログラムを実行して前記車両用電動機の制御を継続することを特徴とする請求項1乃至請求項3のいずれか1つに記載の車両用電動機の制御装置。   When the control unit detects writing of data to the access prohibited area of the memory, the control unit stops execution of the control program and executes a sub-control program having a smaller load than the control program. The control device for a vehicle motor according to any one of claims 1 to 3, wherein the control of the vehicle motor is continued. さらに、不揮発性メモリを備え、
前記制御手段は、前記メモリのアクセス禁止領域へのデータの書き込みを検出した場合には、解析に必要なメモリ情報を前記不揮発性メモリに格納することを特徴とする請求項1乃至請求項5のいずれか1つに記載の車両用電動機の制御装置。
In addition, it has a non-volatile memory,
6. The control unit according to claim 1, wherein the control unit stores memory information necessary for analysis in the nonvolatile memory when detecting writing of data to the access prohibited area of the memory. The control apparatus of the motor for vehicles as described in any one.
前記制御プログラムは、優先順位の異なる複数のタスクを含み、
前記メモリは、複数のアクセス禁止領域が設定されていることを特徴とする請求項1乃至請求項6のいずれか1つに記載の車両用電動機の制御装置。
The control program includes a plurality of tasks having different priorities,
The vehicle electric motor control apparatus according to claim 1, wherein a plurality of access prohibition areas are set in the memory.
前記メモリ監視手段は、前記メモリのアクセス禁止領域への書き込みの監視を、前記車両用電動機の立ち上がりの時定数より短い周期で実行することを特徴とする請求項1乃至請求項7のいずれか1つに記載の車両用電動機の制御装置。   8. The memory monitoring unit according to claim 1, wherein the memory monitoring unit performs monitoring of writing to the access prohibited area of the memory at a cycle shorter than a time constant of rising of the vehicle motor. The control apparatus of the motor for vehicles as described in one. 前記車両用電動機は、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータであり、
前記制御手段は、前記制御プログラムを実行して、少なくとも前記ステアリング系に発生する操舵トルクに基づいて前記操舵補助モータの電流指令値を演算し、電流検出回路で検出された前記操舵補助モータの電流検出値と前記電流指令値とに基づいて、前記操舵補助モータの電流検出値が前記電流指令値に追従するように前記操舵補助モータを駆動制御することを特徴とする請求項1乃至請求項8のいずれか1つに記載の車両用電動機の制御装置。
The vehicle motor is a steering assist motor of an electric power steering device that applies a steering assist force to a steering system of the vehicle,
The control means executes the control program, calculates a current command value of the steering assist motor based on at least a steering torque generated in the steering system, and detects the current of the steering assist motor detected by a current detection circuit. 9. The driving assist motor is controlled based on the detected value and the current command value so that the detected current value of the steering assist motor follows the current command value. The control apparatus of the motor for vehicles as described in any one of these.
前記車両用電動機は、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータであり、
前記制御プログラムは、モータ電流制御系モジュール、モータ電流補助制御系モジュール、トルク制御系モジュール、および補償制御系モジュールを含み、
前記サブ制御プログラムは、前記モータ電流制御系モジュール、前記トルク制御系モジュール、および前記補償制御系モジュールを含むことを特徴とする請求項5に記載の車両用電動機の制御装置。
The vehicle motor is a steering assist motor of an electric power steering device that applies a steering assist force to a steering system of the vehicle,
The control program includes a motor current control system module, a motor current auxiliary control system module, a torque control system module, and a compensation control system module,
6. The vehicle motor control apparatus according to claim 5, wherein the sub control program includes the motor current control system module, the torque control system module, and the compensation control system module.
前記車両用電動機は、車両のステアリング系に操舵補助力を付与する電動パワーステアリング装置の操舵補助モータであり、
前記制御プログラムは、前記操舵補助モータを制御するための第1のタスクと、外部と通信するための第2のタスクとを含むことを特徴とする請求項7に記載の車両用電動機の制御装置。
The vehicle motor is a steering assist motor of an electric power steering device that applies a steering assist force to a steering system of the vehicle,
The said control program contains the 1st task for controlling the said steering assist motor, and the 2nd task for communicating with the exterior, The control apparatus of the motor for vehicles of Claim 7 characterized by the above-mentioned. .
車両に搭載された車両用電動機を制御する車両用電動機の制御方法において、
制御手段が、データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリを、作業領域として使用して制御プログラムを実行し、前記車両用電動機を制御する制御工程と、
前記制御手段が、メモリ監視プログラムを実行して、前記アクセス禁止領域へのデータの書き込みを監視して、前記制御プログラムの不正アクセスを監視する監視工程と、
を含むことを特徴とする車両用電動機の制御方法。
In a vehicle motor control method for controlling a vehicle motor mounted on a vehicle,
The control means executes a control program using a memory having an access-permitted area where data writing is permitted and an access-banned area where data writing is prohibited as a work area, and controls the vehicle motor A control process,
A monitoring step in which the control means executes a memory monitoring program, monitors writing of data to the access prohibited area, and monitors unauthorized access of the control program;
A control method for an electric motor for a vehicle, comprising:
車両に搭載された車両用電動機を制御する車両用電動機の制御装置に搭載されるプログラムにおいて、
コンピュータに、
データの書き込みが許可されるアクセス許可領域と、データの書き込みが禁止されるアクセス禁止領域とを有するメモリを、作業領域として使用して、前記車両用電動機を制御する制御工程と、
前記アクセス禁止領域へのデータの書き込みを監視して、ソフトウェアの不正アクセスを監視する監視工程と、
を実行させることを特徴とするコンピュータが実行するためのプログラム。
In a program installed in a control device for a vehicle motor that controls a vehicle motor mounted on the vehicle,
On the computer,
A control step of controlling the electric motor for the vehicle, using a memory having an access permission area where data writing is permitted and an access prohibition area where data writing is prohibited as a work area;
A monitoring step of monitoring writing of data to the access prohibited area and monitoring unauthorized access of software;
A program to be executed by a computer, characterized in that
JP2007002529A 2007-01-10 2007-01-10 Controller of vehicular motor Pending JP2008172896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007002529A JP2008172896A (en) 2007-01-10 2007-01-10 Controller of vehicular motor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007002529A JP2008172896A (en) 2007-01-10 2007-01-10 Controller of vehicular motor

Publications (1)

Publication Number Publication Date
JP2008172896A true JP2008172896A (en) 2008-07-24

Family

ID=39700446

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007002529A Pending JP2008172896A (en) 2007-01-10 2007-01-10 Controller of vehicular motor

Country Status (1)

Country Link
JP (1) JP2008172896A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012128743A (en) * 2010-12-16 2012-07-05 Nsk Ltd Detection method of stack overflow
CN102582678A (en) * 2011-01-11 2012-07-18 上海联盛汽车电子有限公司 Electric power-assisted steering system with software integrated monitoring function
WO2012104901A1 (en) * 2011-01-31 2012-08-09 トヨタ自動車株式会社 Safety control device and safety control method
JP2012247978A (en) * 2011-05-27 2012-12-13 Toyota Motor Corp Control device and control method
JP2014186453A (en) * 2013-03-22 2014-10-02 Hitachi Automotive Systems Ltd Vehicle control apparatus
KR20150012782A (en) * 2013-07-26 2015-02-04 현대모비스 주식회사 Apparatus and Method for timing control of Motor Driven Power Steering Electronic Control Unit
JP2015090548A (en) * 2013-11-05 2015-05-11 オムロン株式会社 Control device
WO2015087540A1 (en) * 2013-12-12 2015-06-18 パナソニックIpマネジメント株式会社 Motor-driving apparatus

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012128743A (en) * 2010-12-16 2012-07-05 Nsk Ltd Detection method of stack overflow
CN102582678A (en) * 2011-01-11 2012-07-18 上海联盛汽车电子有限公司 Electric power-assisted steering system with software integrated monitoring function
WO2012104901A1 (en) * 2011-01-31 2012-08-09 トヨタ自動車株式会社 Safety control device and safety control method
CN103052924A (en) * 2011-01-31 2013-04-17 丰田自动车株式会社 Safety control device and safety control method
JP5321686B2 (en) * 2011-01-31 2013-10-23 トヨタ自動車株式会社 SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP2012247978A (en) * 2011-05-27 2012-12-13 Toyota Motor Corp Control device and control method
JP2014186453A (en) * 2013-03-22 2014-10-02 Hitachi Automotive Systems Ltd Vehicle control apparatus
KR20150012782A (en) * 2013-07-26 2015-02-04 현대모비스 주식회사 Apparatus and Method for timing control of Motor Driven Power Steering Electronic Control Unit
KR102045869B1 (en) * 2013-07-26 2019-11-18 현대모비스 주식회사 Apparatus and Method for timing control of Motor Driven Power Steering Electronic Control Unit
JP2015090548A (en) * 2013-11-05 2015-05-11 オムロン株式会社 Control device
WO2015087540A1 (en) * 2013-12-12 2015-06-18 パナソニックIpマネジメント株式会社 Motor-driving apparatus
CN105814791A (en) * 2013-12-12 2016-07-27 松下知识产权经营株式会社 Motor-driving apparatus
JPWO2015087540A1 (en) * 2013-12-12 2017-03-16 パナソニックIpマネジメント株式会社 Motor drive device
CN105814791B (en) * 2013-12-12 2018-10-02 松下知识产权经营株式会社 Motor drive
US10254737B2 (en) 2013-12-12 2019-04-09 Panasonic Intellectual Property Management Co., Ltd. Motor driving apparatus

Similar Documents

Publication Publication Date Title
JP2008172896A (en) Controller of vehicular motor
CN110235358B (en) Vehicle control device
JP5086385B2 (en) Electric power steering control device
JP5267186B2 (en) Electric power steering device
CN105612097B (en) Electric power-assisted steering apparatus
US9221492B2 (en) Method for operating an electrical power steering mechanism
JP2009029172A (en) Electric power steering system
US20170088164A1 (en) Control apparatus and control method of on-vehicle electronic equipment
JP5151791B2 (en) Electric power steering device
EP3382877B1 (en) Electronic control device and electric power steering device equipped therewith
EP4257453A1 (en) Control method, monitoring method, electronic control units, controller and control system
JP5182101B2 (en) Electric power steering device
JP2010188748A (en) Memory diagnostic device of control device of on-vehicle equipment
JP5169410B2 (en) Electric power steering device
JP2009056820A (en) Control device of electric power steering device
JP6459229B2 (en) Electric power steering device
JP2020039201A (en) Vehicle control device
JP2010188796A (en) Electric power steering device
JP2009269458A (en) Electric power steering device
JP2009062009A (en) Control device of electric power steering device
JP5169411B2 (en) Electric power steering device
JP6197463B2 (en) Abnormality diagnosis device for inverter controlled AC motor
JP6497456B2 (en) Control device for electric power steering device
JP5169412B2 (en) Electric power steering device
JP5233506B2 (en) Electric power steering device