JP2000188895A - Motor controller - Google Patents

Motor controller

Info

Publication number
JP2000188895A
JP2000188895A JP10365257A JP36525798A JP2000188895A JP 2000188895 A JP2000188895 A JP 2000188895A JP 10365257 A JP10365257 A JP 10365257A JP 36525798 A JP36525798 A JP 36525798A JP 2000188895 A JP2000188895 A JP 2000188895A
Authority
JP
Japan
Prior art keywords
motor
switch
block
turned
memory
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
JP10365257A
Other languages
Japanese (ja)
Inventor
Hiroyuki Funaki
木 弘 幸 舟
Nobuo Yoshioka
岡 信 夫 吉
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.)
Jidosha Denki Kogyo KK
Original Assignee
Jidosha Denki Kogyo KK
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 Jidosha Denki Kogyo KK filed Critical Jidosha Denki Kogyo KK
Priority to JP10365257A priority Critical patent/JP2000188895A/en
Publication of JP2000188895A publication Critical patent/JP2000188895A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To eliminate the need of a large-capacitance backup capacitor from a motor controller by providing a nonvolatile memory in which a plurality of rotation signals given from a motor rotation detecting means can be written electrically after the signals are converted into positional data when the motor gets into a locked state. SOLUTION: Even when a power switch 20 is switched to a turning-off state, the present position of a window glass is detected by using the positional data of the glass written in a memory and the superscribed positional data of the glass. Since the voltage VB of a motor 5 is not dropped when memory writing is performed, no large-capacitance backup capacitor is required as compared with the case where the memory writing is performed in a short time after the switch 20 is turned off. Therefore, the capacitances of first and second backup capacitors C1 and C2 provided to a power supply block 9 can be reduced.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】この発明は、自動車のパワー
ウインド等の開閉装置を制御するモータ制御装置に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a motor control device for controlling an opening / closing device such as a power window of an automobile.

【0002】[0002]

【従来の技術】自動車の開閉装置を制御するモータ制御
装置としては、コントローラに内蔵され、電気的に書き
込み可能にして消去可能な不揮発性メモリに対し、モー
タの回転信号を位置データとして取り込むことによっ
て、ウインドガラスの現在位置を間接的に検出している
ものが知られている。
2. Description of the Related Art As a motor control device for controlling an opening / closing device of an automobile, a rotation signal of a motor is fetched as position data into a nonvolatile memory which is built in a controller and can be electrically written and erased. In addition, there is known an apparatus that indirectly detects the current position of a window glass.

【0003】上記のようなモータ制御装置では、図7に
示されるように、時刻aにおいて開スイッチ(閉スイッ
チ)がオンされることによってモータが作動される。モ
ータが作動を開始するとモータ電圧VBは無負荷の状態
に対して下がる。モータが作動を開始することによって
モータに内蔵された回転センサからのパルス信号がコン
トローラに取り込まれる。時刻aの後の時刻bにおいて
ウインドガラスがストローク端に到達すると、ウインド
ガラスが移動を阻止されることにより、モータがロック
されるので、モータ電圧VBは作動中よりさらに下が
る。モータがロックされることにより、時刻bの後の時
刻cにおいて、コントローラがモータに対する通電をカ
ットオフし、モータ電圧VBは無負荷の状態に復帰す
る。そして、時刻cの後の時刻dにおいて電源(IG)
スイッチがオフされると、コントローラの電源が遮断さ
れ、モータ電圧VBは時間の経過とともに下がる。そし
て、時刻dの後の時刻eにおいてモータ電圧VBがメモ
リ書き込み電圧V0を下回ると、コントローラは、回転
センサから与えられたパルス信号数の不揮発性メモリへ
の書き込みを始め、時刻eの後の時刻fにおいてモータ
電圧VBがリセット電圧RESを下まわるまでの書き込
み可能時間t内で書き込みが行われる。メモリ書き込み
電圧V0は、回路内の電源電圧がマイコンのリセット電
圧RES以上になるような回路への供給電圧以上であっ
て、しかも、モータがその仕様の最低作動電圧でロック
したときの電圧降下以下である必要がある。
In the above-described motor control device, as shown in FIG. 7, the motor is operated when an open switch (close switch) is turned on at a time a. When the motor starts to operate, the motor voltage VB decreases with respect to the no-load state. When the motor starts operating, a pulse signal from a rotation sensor built in the motor is taken into the controller. When the window glass reaches the stroke end at the time b after the time a, the motor is locked by preventing the movement of the window glass, so that the motor voltage VB falls further than during operation. By locking the motor, at time c after time b, the controller cuts off the current supply to the motor, and the motor voltage VB returns to the no-load state. Then, at time d after time c, the power supply (IG)
When the switch is turned off, the power supply to the controller is cut off, and the motor voltage VB decreases over time. When the motor voltage VB falls below the memory write voltage V0 at time e after time d, the controller starts writing the number of pulse signals given from the rotation sensor to the non-volatile memory, and returns to time after time e. At f, the writing is performed within the writable time t until the motor voltage VB falls below the reset voltage RES. The memory write voltage V0 is equal to or higher than the supply voltage to the circuit such that the power supply voltage in the circuit is equal to or higher than the reset voltage RES of the microcomputer, and is equal to or lower than the voltage drop when the motor is locked at the minimum operating voltage of the specification. Needs to be

【0004】[0004]

【発明が解決しようとする課題】ところが、上記のモー
タ制御装置において、コントローラの電源電圧が遮断さ
れた時に、ウインドガラスの位置データを不揮発性メモ
リに書き込むものでは、モータがロック状態にある際に
電源スイッチがオフ切換えされた場合、コントローラの
電源電圧が通常の作動電圧より低い電圧値に対し既に低
下しているので、書き込みに必要な電荷量が不足し、単
一の位置データのみ書き込むようになっていた。そのた
め、不揮発性メモリにウインドガラスの位置データを書
き込むのに十分な時間を確保できるようにするための大
容量のバックアップ用コンデンサが用いられており、大
容量のバックアップ用コンデンサをコントローラに内蔵
することによって、コントローラの外形が大型化すると
いう問題点があった。
However, in the above-described motor control apparatus, when the power supply voltage of the controller is cut off, the position data of the window glass is written to the nonvolatile memory. When the power switch is turned off, the power supply voltage of the controller is already reduced to a voltage value lower than the normal operation voltage, so that the amount of charge required for writing is insufficient, and only a single position data is written. Had become. For this reason, a large-capacity backup capacitor is used to secure enough time to write the position data of the window glass to the non-volatile memory, and the large-capacity backup capacitor must be built into the controller. As a result, there is a problem that the outer shape of the controller becomes large.

【0005】また、上記のモータ制御装置では、モータ
が作動中に電源スイッチがオフ切換えされた場合、モー
タの回転信号が入力中であるのにも拘らず、コントロー
ラに内蔵されたマイコンの作動電圧が低下することによ
って書き込みができなくなり、実際のウインドガラスの
位置に対してずれた位置データをマイコンが書き込んで
しまうことになる。そのため、モータが停止するまで位
置データの書き込みを継続して行えるようにするための
大容量のバックアップ用コンデンサが用いられており、
上記と同様にコントローラの外形が大型化するという問
題点があった。
Further, in the above motor control device, when the power switch is turned off while the motor is operating, the operating voltage of the microcomputer built in the controller is notwithstanding that the rotation signal of the motor is being input. As a result, the writing becomes impossible, and the microcomputer writes position data shifted from the actual position of the window glass. Therefore, a large-capacity backup capacitor is used so that writing of position data can be continued until the motor stops.
As described above, there is a problem that the outer shape of the controller becomes large.

【0006】[0006]

【発明の目的】この発明に係わるモータ制御装置は、大
容量のバックアップ用コンデンサを必要とすることなく
複数個の位置データの書き込みが確実にできて、コンパ
クトな外形を得ることができるモータ制御装置を提供す
ることを目的としている。
SUMMARY OF THE INVENTION A motor control device according to the present invention can reliably write a plurality of position data without requiring a large-capacity backup capacitor and can obtain a compact external shape. It is intended to provide.

【0007】[0007]

【発明の構成】Configuration of the Invention

【0008】[0008]

【課題を解決するための手段】この発明の請求項1に係
わるモータ制御装置では、電源スイッチと、電源スイッ
チに電気的に接続されたモータ駆動回路と、モータ駆動
回路に電気的に接続されているとともに開閉負荷に結合
され、モータ駆動回路の作動により負荷を開側または閉
側に駆動するモータと、モータの回転により回転検出信
号を発生するモータ回転検出手段と、オン切換えされる
ことにより下降指令信号を発生する開スイッチと、オン
切換えされることにより上昇指令信号を発生する閉スイ
ッチと、電源スイッチ、モータ駆動回路、モータ回転検
出手段、開スイッチ、閉スイッチにそれぞれ電気的に接
続され、開スイッチより下降指令信号が与えられると負
荷を開側に駆動するための電流をモータ駆動回路を介し
モータに供給する一方、閉スイッチより上昇指令信号が
与えられると負荷を閉側に駆動するための電流をモータ
駆動回路を介しモータに供給するコントローラと、モー
タがロック状態となったときに、モータ回転検出手段よ
り与えられた回転信号を位置データに変換して電気的に
複数個書き込み可能な不揮発性メモリを備えている構成
としたことを特徴としている。
According to a first aspect of the present invention, there is provided a motor control device comprising: a power switch; a motor drive circuit electrically connected to the power switch; and a motor drive circuit electrically connected to the motor drive circuit. A motor that drives the load to open or close by the operation of the motor drive circuit, and a motor rotation detection unit that generates a rotation detection signal by the rotation of the motor; An open switch that generates a command signal, a close switch that generates an ascending command signal when switched on, and a power switch, a motor drive circuit, a motor rotation detection unit, an open switch, and an open switch that are electrically connected, respectively. When a lowering command signal is given from the open switch, a current for driving the load to the open side is supplied to the motor via the motor drive circuit. On the other hand, when a rising command signal is given from the closing switch, a controller for supplying a current for driving the load to the closing side to the motor via the motor driving circuit and the motor rotation detecting means when the motor is locked. It is characterized in that a configuration is provided in which a nonvolatile memory capable of converting a given rotation signal into position data and electrically writing a plurality of rotation signals is provided.

【0009】この発明の請求項2に係わるモータ制御装
置では、コントローラには、開スイッチまたは閉スイッ
チがオン切換えされたとき毎に不揮発性メモリに書き込
まれている位置データを消去する制御ブロックを備えて
いる構成としたことを特徴としている。
In the motor control device according to a second aspect of the present invention, the controller includes a control block for erasing the position data written in the nonvolatile memory each time the open switch or the close switch is turned on. It is characterized by having the configuration described above.

【0010】この発明の請求項3に係わるモータ制御装
置では、コントローラには、開スイッチまたは閉スイッ
チがオフ切換えされたとき毎に不揮発性メモリに対して
位置データを上書きする制御ブロックを備えている構成
としたことを特徴としている。
[0010] In the motor control device according to claim 3 of the present invention, the controller includes a control block for overwriting the position data in the nonvolatile memory every time the open switch or the close switch is turned off. It is characterized by having a configuration.

【0011】この発明の請求項4に係わるモータ制御装
置では、コントローラには、モータ回転検出手段より与
えられた回転信号の周期を測定するパルス間隔測定ブロ
ックを備えている構成としたことを特徴としている。
According to a fourth aspect of the present invention, in the motor control device, the controller is provided with a pulse interval measuring block for measuring the period of the rotation signal given by the motor rotation detecting means. I have.

【0012】この発明の請求項5に係わるモータ制御装
置では、コントローラには、パルス間隔測定ブロックよ
り与えられた回転信号の周期値と予め定められた判定値
とを比較することにより、モータのロック判定を行うモ
ータロック判定ブロックを備えている構成としたことを
特徴としている。
In the motor control apparatus according to the fifth aspect of the present invention, the controller locks the motor by comparing the cycle value of the rotation signal given from the pulse interval measurement block with a predetermined judgment value. It is characterized in that it has a configuration including a motor lock determination block for performing determination.

【0013】この発明の請求項6に係わるモータ制御装
置では、コントローラには、開スイッチまたは閉スイッ
チがオン切換えされている時間が予め定められた値を越
えた際に下降指令信号または上昇指令信号を記憶し、そ
の後に、開スイッチまたは閉スイッチがオフ切換えされ
てからも、制御ブロックに対して下降指令信号または上
昇指令信号を連続的に与えるワンタッチ動作記憶ブロッ
クを備えている構成としたことを特徴としている。
[0013] In the motor control device according to claim 6 of the present invention, when the time during which the open switch or the close switch is turned on exceeds a predetermined value, the controller outputs the descending command signal or the ascending command signal. After that, even after the open switch or the close switch is turned off, the control block is provided with a one-touch operation storage block that continuously supplies a descending command signal or an ascending command signal to the control block. Features.

【0014】[0014]

【発明の作用】この発明の請求項1に係わるモータ制御
装置において、モータがロック状態となったときに、モ
ータ回転検出手段より与えられた回転信号を位置データ
に変換して不揮発性メモリに電気的に書き込んでいるた
め、モータ電圧が遮断されていないときに複数個の位置
データの書き込みが行われている。それ故、電源スイッ
チがオフ切換えされた後の電源電圧の降下中に位置デー
タの書き込みは行われないから、電源スイッチがオフ切
換えされてから書き込みを行うものと比べて、位置デー
タの書き込みのための時間を確保する大容量のバックア
ップ用コンデンサを必要としない。
In the motor control device according to the first aspect of the present invention, when the motor is locked, the rotation signal given by the motor rotation detecting means is converted into position data and stored in the nonvolatile memory. Therefore, a plurality of position data are written when the motor voltage is not cut off. Therefore, since the position data is not written during the fall of the power supply voltage after the power switch is turned off, the writing of the position data is performed in comparison with the case where the writing is performed after the power switch is turned off. It does not require a large-capacity backup capacitor to secure time.

【0015】この発明の請求項2に係わるモータ制御装
置において、コントローラの制御ブロックは、開スイッ
チまたは閉スイッチがオン切換えされたとき毎に不揮発
性メモリに書き込まれている位置データを消去する。そ
れ故、請求項1の作用に加え、不揮発性メモリへの書き
込みには、開スイッチ、閉スイッチの動作毎に常に最新
の位置データが用いられ、且つ、モータが作動したこと
が判別できるため、例えば、マイコンが暴走した場合に
おいても誤ったガラス位置データによる誤動作を回避で
きる。
In the motor control device according to a second aspect of the present invention, the control block of the controller deletes the position data written in the nonvolatile memory every time the open switch or the close switch is turned on. Therefore, in addition to the operation of the first aspect, the latest position data is always used for each operation of the open switch and the close switch for writing to the nonvolatile memory, and it can be determined that the motor has been operated. For example, even when the microcomputer runs out of control, malfunction due to incorrect glass position data can be avoided.

【0016】この発明の請求項3に係わるモータ制御装
置において、コントローラの制御ブロックは、開スイッ
チまたは閉スイッチがオフ切換えされたとき毎に不揮発
性メモリに対して位置データを上書きする。それ故、請
求項1および2の作用に加え、モータがロック状態とな
ったときに複数個書き込まれた位置データと、開スイッ
チ、閉スイッチのオフ切換え時に上書きされた位置デー
タとによって、ロック状態になったモータがわずかに回
転を続けた場合でも、ウインドガラスが確実にストロー
ク端に到達した位置での位置データが書き込まれる。
In the motor control device according to a third aspect of the present invention, the control block of the controller overwrites the position data in the nonvolatile memory each time the open switch or the close switch is turned off. Therefore, in addition to the effects of claims 1 and 2, the locked state is determined by the position data written when the motor is locked and the position data overwritten when the open switch and the close switch are turned off. The position data at the position where the window glass has reliably reached the stroke end is written even if the motor has slightly rotated.

【0017】この発明の請求項4に係わるモータ制御装
置において、モータ回転検出手段より与えられる回転信
号は、モータがロックすることによってその周期が大き
くなり、コントローラのパルス間隔測定ブロックは、モ
ータ回転検出手段より与えられた回転信号の周期を測定
する。それ故、請求項1の作用に加え、パルス間隔測定
ブロックにより、回転信号の周期を検出することによっ
てモータの負荷状態が検出される。
In the motor control device according to a fourth aspect of the present invention, the period of the rotation signal given by the motor rotation detecting means increases when the motor is locked, and the pulse interval measurement block of the controller detects the motor rotation. The period of the rotation signal given by the means is measured. Therefore, in addition to the operation of the first aspect, the load state of the motor is detected by detecting the period of the rotation signal by the pulse interval measurement block.

【0018】この発明の請求項5に係わるモータ制御装
置において、コントローラのモータロック判定ブロック
は、パルス間隔測定ブロックより与えられた周期値と予
め定められた判定値とを比較し、パルス間隔測定ブロッ
クより与えられた周期値が予め定められた判定値を越え
た際に、制御ブロックにより不揮発性メモリへの書込み
が実行される。それ故、請求項4の作用に加え、モータ
のロック中に電源スイッチがオフ切換えされても、ガラ
スの位置データは失われない。
In the motor control device according to a fifth aspect of the present invention, the motor lock determination block of the controller compares a period value given from the pulse interval measurement block with a predetermined determination value, and determines a pulse interval measurement block. When the given cycle value exceeds a predetermined determination value, writing to the non-volatile memory is executed by the control block. Therefore, even if the power switch is turned off while the motor is locked, the position data of the glass is not lost.

【0019】この発明の請求項6に係わるモータ制御装
置において、コントローラのワンタッチ動作記憶ブロッ
クは、開スイッチまたは閉スイッチが長い時間オン切換
えされた後にオフ切換えされた際、開スイッチまたは閉
スイッチがオン切換えされたときに記憶した下降指令信
号または上昇指令信号を制御ブロックに連続的に与え
る。それ故、請求項1の作用に加え、ワンタッチ動作記
憶ブロックによって、開スイッチまたは閉スイッチより
発生した指令信号の保持が行われるため、開スイッチお
よび閉スイッチの他にオートスイッチ等の付加スイッチ
を必要としない。
According to a sixth aspect of the present invention, in the motor control device, the one-touch operation storage block of the controller is configured such that when the open switch or the close switch is turned off after the open switch or the close switch is turned on for a long time, the open switch or the close switch is turned on. When the switching is performed, the stored descending command signal or ascending command signal is continuously supplied to the control block. Therefore, in addition to the operation of the first aspect, since the command signal generated from the open switch or the close switch is held by the one-touch operation storage block, an additional switch such as an auto switch is required in addition to the open switch and the close switch. And not.

【0020】[0020]

【実施例】図1ないし図6には、この発明に係わるモー
タ制御装置の一実施例が示されている。
1 to 6 show one embodiment of a motor control device according to the present invention.

【0021】図示されるモータ制御装置1は、開スイッ
チ(SW)2、閉スイッチ(SW)3、スイッチ(S
W)信号入力ブロック4、モータ5、回転センサ6、モ
ータ駆動出力ブロック7、パルス信号入力ブロック8、
電源ブロック9(図2に示される。)、変換ブロック1
0(図2に示される。)、中央処理回路(コントロー
ラ)MCU、EEPROM外部メモリブロックMEM、
リセット回路11(図2に示される。)から構成されて
おり、中央処理回路MCUに、ワンタッチ動作記憶ブロ
ック12、EEPROMメモリアドレスカウンタADC
T、クロックジェネレータ13、制御ブロック14、入
出力制御ブロック15、パルス間隔測定ブロック16、
パルス間隔測定タイマTM2、モータロック判定ブロッ
ク17、EEPROM書き込みインターバルタイマTM
1、パルスカウンタガラス位置記憶WINDCTが内蔵
されている。
The illustrated motor control device 1 includes an open switch (SW) 2, a close switch (SW) 3, and a switch (S).
W) signal input block 4, motor 5, rotation sensor 6, motor drive output block 7, pulse signal input block 8,
Power supply block 9 (shown in FIG. 2), conversion block 1
0 (shown in FIG. 2), central processing circuit (controller) MCU, EEPROM external memory block MEM,
The reset circuit 11 (shown in FIG. 2) includes a one-touch operation storage block 12, an EEPROM memory address counter ADC, and a central processing circuit MCU.
T, clock generator 13, control block 14, input / output control block 15, pulse interval measurement block 16,
Pulse interval measurement timer TM2, motor lock determination block 17, EEPROM write interval timer TM
1. Built-in pulse counter glass position storage WINDCT.

【0022】図1に示されるモータ制御装置1は、具体
的には図2に示される回路図に表される。
The motor control device 1 shown in FIG. 1 is specifically shown in a circuit diagram shown in FIG.

【0023】開、閉スイッチ2、3は、一方が電源スイ
ッチ(イグニションスイッチ)20を通じてバッテリで
ある電源21に電気的に接続され、他方がスイッチ信号
入力ブロック4に電気的に接続されている。開スイッチ
2は、オン切換えされることによって下降指令信号を発
生する。これとは異なり、閉スイッチ3は、オン切換え
されることによって上昇指令信号を発生する。
One of the open / close switches 2 and 3 is electrically connected to a power source 21 as a battery through a power switch (ignition switch) 20, and the other is electrically connected to the switch signal input block 4. The open switch 2 generates a descending command signal by being turned on. On the contrary, the close switch 3 generates an ascending command signal by being turned on.

【0024】スイッチ信号入力ブロック4は、抵抗R
6、抵抗R7から構成されており、抵抗R6が開スイッ
チ2に電気的に接続され、抵抗R7が閉スイッチ3に電
気的に接続されている。
The switch signal input block 4 includes a resistor R
6, a resistor R7. The resistor R6 is electrically connected to the open switch 2, and the resistor R7 is electrically connected to the closed switch 3.

【0025】スイッチ信号入力ブロック4では、電源ス
イッチ20がオン状態にある際に、開スイッチ2がオン
切換えされると、抵抗R6を通じ、図示しない電圧クラ
ンプ回路を介し下降指令信号(ハイレベル)を中央処理
回路MCUに備えた第1の入力ポートIN1に与える。
これとは異なり、電源スイッチ20がオン状態にある際
に、閉スイッチ3がオン切換えされると、抵抗R7を通
じ、図示しない電圧クランプ回路を介し上昇指令信号
(ハイレベル)を中央処理回路MCUに備えた第2の入
力ポートIN2に与える。
In the switch signal input block 4, when the open switch 2 is turned on while the power switch 20 is in the on state, a lowering command signal (high level) is passed through a resistor R6 via a voltage clamp circuit (not shown). The signal is supplied to a first input port IN1 provided in the central processing unit MCU.
On the other hand, when the close switch 3 is turned on while the power switch 20 is in the on state, the rising command signal (high level) is sent to the central processing circuit MCU via the resistor R7 via a voltage clamp circuit (not shown). To the provided second input port IN2.

【0026】モータ5には、第1、第2のブラシ端子5
a、5bが備えられているとともに、図示しないアーマ
チュアに備えたアーマチュアシャフト5cが図示しない
ゴム製のダンパを介し、同じく図示しないガラス昇降器
を介してウインドガラス30に連結されている。
The motor 5 has first and second brush terminals 5
a and 5b are provided, and an armature shaft 5c provided on an armature (not shown) is connected to the window glass 30 via a rubber damper (not shown) and a glass elevator (not shown).

【0027】モータ5は、第1のブラシ端子5aが電源
21に電気的に接続されるとともに第2のブラシ端子5
bが接地に接続されることによってアーマチュアシャフ
ト5cが正回転するため、アーマチュアシャフト5cの
正回転によってウインドガラス30を開ける。これに反
して、第2のブラシ端子5bが電源21に電気的に接続
されるとともに第1のブラシ端子5aが接地に接続され
ることによってアーマチュアシャフト5cが逆回転する
ため、アーマチュアシャフト5cの逆回転によってウイ
ンドガラス30を閉める。モータ5の第1、第2のブラ
シ端子5a、5bは、モータ駆動出力ブロック7に電気
的に接続されている。
The motor 5 has a first brush terminal 5a electrically connected to a power source 21 and a second brush terminal 5a.
Since the armature shaft 5c rotates forward when b is connected to the ground, the window glass 30 is opened by the forward rotation of the armature shaft 5c. On the contrary, since the second brush terminal 5b is electrically connected to the power supply 21 and the first brush terminal 5a is connected to the ground, the armature shaft 5c rotates in the reverse direction. The window glass 30 is closed by rotation. The first and second brush terminals 5a and 5b of the motor 5 are electrically connected to the motor drive output block 7.

【0028】モータ駆動出力ブロック7には、第1のリ
レーRL1、第1のスイッチングトランジスタTR1、
第2のリレーRL2、第2のスイッチングトランジスタ
TR2が備えられている。
The motor drive output block 7 includes a first relay RL1, a first switching transistor TR1,
A second relay RL2 and a second switching transistor TR2 are provided.

【0029】第1のリレーRL1には、第1のリレーコ
イルRL1−1、第1のリレー常開接点RL1−2、第
1の常閉接点RL1−3、第1のリレー可動接点RL1
−4が備えられている。第1のリレーコイルRL1−1
は、上流側が電源スイッチ20に接続され、下流側が第
1のスイッチングトランジスタTR1のコレクタに接続
されている。第1のリレー常開接点RL1−2は電源ス
イッチ20に接続されている。第1のリレー常閉接点R
L1−3は接地に接続されている。第1のリレー可動接
点RL1−4はモータ5の第1のブラシ端子5aに接続
されている。
The first relay RL1 includes a first relay coil RL1-1, a first relay normally open contact RL1-2, a first normally closed contact RL1-3, and a first relay movable contact RL1.
-4 is provided. First relay coil RL1-1
Has an upstream side connected to the power switch 20 and a downstream side connected to the collector of the first switching transistor TR1. The first relay normally open contact RL1-2 is connected to the power switch 20. First relay normally closed contact R
L1-3 is connected to the ground. The first relay movable contacts RL1-4 are connected to a first brush terminal 5a of the motor 5.

【0030】第1のスイッチングトランジスタTR1
は、エミッタ接地のNPN型トランジスタであり、ベー
スが図示しない抵抗を通じて中央処理回路MCUに備え
た第1の出力ポートD1に接続され、コレクタが前述し
たように第1のリレーコイルRL1−1の下流側に接続
されている。
First switching transistor TR1
Is an emitter-grounded NPN transistor, whose base is connected to a first output port D1 provided in the central processing circuit MCU through a resistor (not shown), and whose collector is downstream of the first relay coil RL1-1 as described above. Connected to the side.

【0031】第2のリレーRL2には、第2のリレーコ
イルRL2−1、第2のリレー常開接点RL2−2、第
2の常閉接点RL2−3、第2のリレー可動接点RL2
−4が備えられている。第2のリレーコイルRL2−1
は、上流側が電源スイッチ20に接続され、下流側が第
2のスイッチングトランジスタTR2のコレクタに接続
されている。第2のリレー常開接点RL2−2は、電源
スイッチ20に接続されている。第2のリレー常閉接点
RL2−3は、接地に接続されている。第2のリレー可
動接点RL2−4は、モータ5の第2のブラシ端子5b
に接続されている。
The second relay RL2 includes a second relay coil RL2-1, a second relay normally open contact RL2-2, a second normally closed contact RL2-3, and a second relay movable contact RL2.
-4 is provided. Second relay coil RL2-1
Has an upstream side connected to the power switch 20, and a downstream side connected to the collector of the second switching transistor TR2. The second relay normally open contact RL2-2 is connected to the power switch 20. The second relay normally closed contact RL2-3 is connected to the ground. The second relay movable contact RL2-4 is connected to the second brush terminal 5b of the motor 5.
It is connected to the.

【0032】第2のスイッチングトランジスタTR2
は、エミッタ接地のNPN型トランジスタであり、ベー
スが図示しない抵抗を通じて中央処理回路MCUに備え
た第2の出力ポートD2に接続され、コレクタが前述し
たように第2のリレーコイルRL2−1の下流側に接続
されている。
Second switching transistor TR2
Is a common-emitter NPN transistor whose base is connected to a second output port D2 provided in the central processing unit MCU through a resistor (not shown), and whose collector is downstream of the second relay coil RL2-1 as described above. Connected to the side.

【0033】モータ駆動出力ブロック7では、中央処理
回路MCUの第1の出力ポートD1からハイレベルが与
えられるとともに、中央処理回路MCUの第2の出力ポ
ートD2からローレベルが与えられると、第1のスイッ
チングトランジスタTR1がオンされ、第1のリレーコ
イルRL1−1が励磁され、第1のリレー可動接点RL
1−4が第1のリレー常閉接点RL1−3から第1のリ
レー常開接点RL1−2に電気的に接続される。そし
て、電源21の電流が、第1のリレー常開接点RL1−
2、第1のリレー可動接点RL1−4、モータ5の第1
のブラシ端子5a、モータ5の第2のブラシ端子5b、
第2のリレー可動接点RL2−4、第2のリレー常閉接
点RL2−3、接地に流れるため、モータ5のアーマチ
ュアシャフト5cが正回転する。
In the motor drive output block 7, when a high level is given from the first output port D1 of the central processing circuit MCU and a low level is given from the second output port D2 of the central processing circuit MCU, the first Is turned on, the first relay coil RL1-1 is excited, and the first relay movable contact RL is turned on.
1-4 are electrically connected from the first relay normally closed contact RL1-3 to the first relay normally open contact RL1-2. Then, the current of the power supply 21 is changed to the first relay normally open contact RL1-
2, the first relay movable contact RL1-4, the first of the motor 5
Brush terminal 5a, the second brush terminal 5b of the motor 5,
Since the current flows to the second relay movable contact RL2-4, the second relay normally closed contact RL2-3, and the ground, the armature shaft 5c of the motor 5 rotates forward.

【0034】上記に反して、モータ駆動出力ブロック7
では、中央処理回路MCUの第2の出力ポートD2から
ハイレベルが与えられるとともに、中央処理回路MCU
の第1の出力ポートD1からローレベルが与えられる
と、第2のスイッチングトランジスタTR2がオン切換
えされ、第2のリレーコイルRL2−1が励磁され、第
2のリレー可動接点RL2−4が第2のリレー常閉接点
RL2−3から第2のリレー常開接点RL2−2に電気
的に接続される。そして、電源21の電流が、第2のリ
レー常開接点RL2−2、第2のリレー可動接点RL2
−4、モータ5の第2のブラシ端子5b、モータ5の第
1のブラシ端子5a、第1のリレー可動接点RL1−
4、第1のリレー常閉接点RL1−3、接地に流れるた
め、モータ5のアーマチュアシャフト5cが逆回転す
る。
On the contrary, the motor drive output block 7
In this case, the high level is given from the second output port D2 of the central processing circuit MCU, and the central processing circuit MCU
When the low level is given from the first output port D1, the second switching transistor TR2 is turned on, the second relay coil RL2-1 is excited, and the second relay movable contact RL2-4 is turned on. The relay normally closed contact RL2-3 is electrically connected to the second relay normally open contact RL2-2. Then, the current of the power supply 21 is changed to the second relay normally open contact RL2-2 and the second relay movable contact RL2.
-4, the second brush terminal 5b of the motor 5, the first brush terminal 5a of the motor 5, the first relay movable contact RL1-
4. Since the first relay normally closed contact RL1-3 flows to the ground, the armature shaft 5c of the motor 5 rotates in the reverse direction.

【0035】回転センサ6は、ロータリーエンコーダや
タコジェネレータなどの回転検出器であって、モータ5
のアーマチュアシャフト5cの近くに配置されている。
この回転センサ6は、図2に示されるように、抵抗R8
および抵抗9によって分圧され、ツェナダイオードZD
3によって制限された電圧レベルが上流側に与えられて
いるため、モータ5のアーマチュアシャフト5cが回転
していると、回転に対応してパルス状の回転信号を発生
する。回転センサ6が発生したパルス信号はパルス信号
入力ブロック8に与えられる。
The rotation sensor 6 is a rotation detector such as a rotary encoder or a tachogenerator.
Is disposed near the armature shaft 5c.
This rotation sensor 6, as shown in FIG.
Is divided by the resistor 9 and the Zener diode ZD
Since the voltage level limited by 3 is applied to the upstream side, when the armature shaft 5c of the motor 5 is rotating, a pulse-like rotation signal is generated in accordance with the rotation. The pulse signal generated by the rotation sensor 6 is given to a pulse signal input block 8.

【0036】パルス信号入力ブロック8は、抵抗R1
0、コンデンサC5からなる。このパルス信号入力ブロ
ック8は、回転センサ6から与えられたパルス信号を安
定化したうえで、図示しない電圧クランプ回路を通じ中
央処理回路MCUに備えた第3の入力ポートIN3に与
える。
The pulse signal input block 8 includes a resistor R1
0 and a capacitor C5. The pulse signal input block 8 stabilizes the pulse signal supplied from the rotation sensor 6 and supplies the stabilized pulse signal to a third input port IN3 provided in the central processing circuit MCU through a voltage clamp circuit (not shown).

【0037】電源ブロック9は、ダイオードD1、抵抗
R1、ツェナダイオードZD1、第1のバックアップ用
コンデンサC1、第2のバックアップ用コンデンサC
2、発振防止用コンデンサC4、電源IC22からな
る。
The power supply block 9 includes a diode D1, a resistor R1, a zener diode ZD1, a first backup capacitor C1, and a second backup capacitor C.
2. It comprises a capacitor C4 for preventing oscillation and a power supply IC22.

【0038】電源ブロック9では、ダイオードD1のア
ノードが電源スイッチ20に接続され、他端が接地され
た第2のバックアップ用コンデンサC2の一端が電源ラ
イン9aとともに作動用電源VCCに接続され、電源ラ
イン9aが中央処理回路MCUのレギュレータポートR
EGおよびEEPROM外部メモリブロック(不揮発性
メモリ)MEMに接続されている。
In the power supply block 9, the anode of the diode D1 is connected to the power supply switch 20, the other end of the second backup capacitor C2 whose other end is grounded is connected to the operating power supply VCC together with the power supply line 9a. 9a is the regulator port R of the central processing circuit MCU
The EG and the EEPROM are connected to an external memory block (non-volatile memory) MEM.

【0039】電源ブロック9では、電源スイッチ20が
オン状態にあると、第1のバックアップ用コンデンサC
1が充電され、電源IC22がオンし、第2のバックア
ップ用コンデンサC2が充電されて、中央処理回路MC
UのレギュレータポートREG、EEPROM外部メモ
リブロックMEMに所定のドライブ電圧を与える。そし
て、電源ブロック9では、電源スイッチ20がオフ切換
えされると、第1のバックアップ用コンデンサC1、第
2のバックアップ用コンデンサC2がそれぞれ放電さ
れ、放電電圧が、中央処理回路MCUのレギュレータポ
ートREG、EEPROM外部メモリブロックMEMに
与えられる。
In the power supply block 9, when the power switch 20 is on, the first backup capacitor C
1 is charged, the power supply IC 22 is turned on, the second backup capacitor C2 is charged, and the central processing circuit MC
A predetermined drive voltage is applied to the U regulator port REG and the EEPROM external memory block MEM. Then, in the power supply block 9, when the power switch 20 is turned off, the first backup capacitor C1 and the second backup capacitor C2 are respectively discharged, and the discharge voltage is reduced to the regulator port REG of the central processing circuit MCU. This is given to the EEPROM external memory block MEM.

【0040】EEPROM外部メモリブロックMEM
(electrically erasable programma-ble ROM )は、電
気的に書き換え可能なROMであり、非通電状態でも記
憶内容が保持される不揮発性メモリである。このEEP
ROM外部メモリブロックMEMは、中央処理回路MC
Uに備えたシリアル出力ポートSOUTより与えられた
ガラス位置データを所定のメモリエリア内に格納し、シ
リアル入力ポートSINを介して所定のメモリエリアよ
りガラス位置データを取り出す。
EEPROM external memory block MEM
(Electrically erasable programma-ble ROM) is an electrically rewritable ROM, and is a non-volatile memory that retains its stored contents even in a non-energized state. This EEP
The ROM external memory block MEM includes a central processing circuit MC.
The glass position data provided from the serial output port SOUT provided in U is stored in a predetermined memory area, and the glass position data is taken out from the predetermined memory area via the serial input port SIN.

【0041】変換ブロック10には、抵抗R2、R3、
R4、R5、ツェナダイオードZD2、コンデンサC3
が備えられている。
The conversion block 10 includes resistors R2, R3,
R4, R5, Zener diode ZD2, capacitor C3
Is provided.

【0042】変換ブロック10では、抵抗R2と抵抗R
3とによって分圧され、ツェナダイオードZD2によっ
て制限され、抵抗R4とコンデンサC3によって積分さ
れ、抵抗R5によって調整された電圧レベルの信号を中
央処理回路MCUに備えた変換ポートA/Dに与える。
In the conversion block 10, the resistance R2 and the resistance R
3 is applied to the conversion port A / D provided in the central processing unit MCU by applying a signal of a voltage level limited by the Zener diode ZD2, integrated by the resistor R4 and the capacitor C3, and adjusted by the resistor R5.

【0043】リセット回路11は、ドライブ電圧が低下
した際に、中央処理回路MCUをリセットする。
The reset circuit 11 resets the central processing unit MCU when the drive voltage drops.

【0044】ワンタッチ動作記憶ブロック12は、開ス
イッチ2がオン切換えされることによってスイッチ信号
入力ブロック4から第1の入力ポートIN1に与えられ
た下降指令信号(ハイレベル)、閉スイッチ3がオン切
換えされることによってスイッチ信号入力ブロック4か
ら第2の入力ポートIN2に与えられた上昇指令信号
(ハイレベル)の入力時間を検出している。
The one-touch operation storage block 12 includes a down command signal (high level) given from the switch signal input block 4 to the first input port IN1 when the open switch 2 is turned on, and the close switch 3 being turned on. As a result, the input time of the rising command signal (high level) given from the switch signal input block 4 to the second input port IN2 is detected.

【0045】ワンタッチ動作記憶ブロック12では、開
スイッチ2から与えられた下降指令信号、閉スイッチ3
から与えられた上昇指令信号のそれぞれの入力信号が予
め定められた時間よりも長くなった場合、後述するもの
とは別に定められたプログラムによってワンタッチフラ
グがセットされることによりそれぞれの入力信号を記憶
し、それぞれの入力信号が与えられなくなってからも、
記憶したそれぞれの指令信号を制御ブロック14に与え
続けてワンタッチ動作を行う。
In the one-touch operation storage block 12, the lowering command signal given from the open switch 2 and the closing switch 3
When each input signal of the ascending command signal given from becomes longer than a predetermined time, each input signal is stored by setting a one-touch flag by a program separately defined from that described later. And, after each input signal is not given,
The one-touch operation is performed by continuously supplying the stored command signals to the control block 14.

【0046】EEPROMメモリアドレスカウンタAD
CTは、制御ブロック14とのあいだで番地信号の授与
を行うカウンタである。
EEPROM memory address counter AD
CT is a counter for giving an address signal to and from the control block 14.

【0047】クロックジェネレータ12は、実行するプ
ログラムの時間管理を行う。
The clock generator 12 manages the time of the program to be executed.

【0048】パルス間隔測定ブロック16は、パルス信
号入力ブロック8より与えられたパルス信号の1つづつ
の立上がりおよび立下がりを検出する。
The pulse interval measuring block 16 detects each rising and falling of the pulse signal supplied from the pulse signal input block 8.

【0049】パルス間隔測定タイマTM2は、パルス間
隔測定ブロック16によってパルス信号の立上がりが検
出されるとタイマがスタートし、パルス信号の立下がり
が検出されるとタイマがオフすることによって、パルス
信号の1つづつの周期時間を検出する。検出したパルス
信号の周期時間は、モータロック判定ブロック17に与
えられる。パルス間隔測定タイマTM2では、モータ5
のロック検出をモータ5が発生したパルス信号の周期に
よって直接的に検出している。
The pulse interval measurement timer TM2 starts when the pulse interval measurement block 16 detects the rising edge of the pulse signal, and turns off when the falling edge of the pulse signal is detected. One cycle time is detected. The detected cycle time of the pulse signal is given to the motor lock determination block 17. In the pulse interval measurement timer TM2, the motor 5
Is directly detected by the cycle of the pulse signal generated by the motor 5.

【0050】モータロック判定値XLOCKは、予め定
められた値であって、モータ5のアーマチュアシャフト
5cが回転を拘束されたことを検出するために用いられ
る。このモータロック判定値XLOCKは、中央処理回
路MCUに内蔵された図示しないROM内に保持されて
いる。モータロック判定値XLOCKは、モータロック
判定ブロック17において、パルス間隔測定タイマTM
2により検出された周期時間と比較される。
The motor lock determination value XLOCK is a predetermined value, and is used to detect that the rotation of the armature shaft 5c of the motor 5 is restricted. The motor lock determination value XLOCK is held in a ROM (not shown) built in the central processing circuit MCU. The motor lock determination value XLOCK is supplied to the motor lock determination block 17 by the pulse interval measurement timer TM.
2 is compared with the cycle time detected.

【0051】モータロック判定ブロック17は、パルス
間隔測定タイマTM2が検出した周期時間とモータロッ
ク判定値XLOCKとを比較することにより、パルス間
隔測定タイマTM2が検出した周期時間がモータロック
判定値XLOCKを越えたときに判定信号を制御ブロッ
ク14に与える。モータロック判定ブロック17が与え
た判定信号は、制御ブロック14においてEEPROM
外部メモリブロックMEM内へのメモリ書き込みタイミ
ングとして用いられる。
The motor lock determination block 17 compares the cycle time detected by the pulse interval measurement timer TM2 with the motor lock determination value XLOCK to determine the motor lock determination value XLOCK by the cycle time detected by the pulse interval measurement timer TM2. When exceeding, a determination signal is given to the control block 14. The determination signal given by the motor lock determination block 17 is transmitted to the control block 14 by an EEPROM.
This is used as a timing for writing data into the external memory block MEM.

【0052】EEPROM書き込みインターバルタイマ
TM1は、制御ブロック14より入出力制御ブロック1
5を通じて行われるEEPROM外部メモリブロックM
EMへの書き込みを一定の時間毎に行う機能を有する。
このとき、EEPROM書き込みインターバルタイマT
M1は予め定められた値XMEMWRと比較することに
よってインターバル時間の経過を測る。
The EEPROM write interval timer TM1 is controlled by the control block 14
EEPROM external memory block M performed through step 5
It has the function of writing to the EM at regular intervals.
At this time, the EEPROM write interval timer T
M1 measures the elapse of the interval time by comparing it with a predetermined value XMEMWR.

【0053】パルスカウンタガラス位置記憶WINDC
Tは、制御ブロック14においてEEPROM外部メモ
リブロックMEM内へ書き込むためのガラス位置データ
の個数を計数する。中央処理回路MCUに備えたリセッ
トポートRESはリセット回路11に接続されている。
Pulse counter glass position storage WINDC
T counts the number of glass position data to be written into the EEPROM external memory block MEM in the control block 14. The reset port RES provided in the central processing unit MCU is connected to the reset circuit 11.

【0054】制御ブロック14では、スイッチ信号入力
ブロック4より下降指令信号が与えられると、中央処理
回路MCUにおいて、第1の出力ポートD1がハイレベ
ルに、第2の出力ポートD2がローレベルになることに
よって第1のスイッチングトランジスタTR1をオンす
る。これに反して、スイッチ信号入力ブロック4より上
昇指令信号が与えられると、中央処理回路MCUにおい
て、第2の出力ポートD1がハイレベルに、第1の出力
ポートD2がローレベルになることによって第2のスイ
ッチングトランジスタTR2をオンする。
In the control block 14, when a down command signal is supplied from the switch signal input block 4, in the central processing unit MCU, the first output port D1 goes high and the second output port D2 goes low. This turns on the first switching transistor TR1. On the other hand, when an ascending command signal is given from the switch signal input block 4, the second output port D1 becomes high level and the first output port D2 becomes low level in the central processing circuit MCU. The second switching transistor TR2 is turned on.

【0055】また、制御ブロック14では、スイッチ信
号入力ブロック4より下降指令信号が与えられると、入
出力制御ブロック15を通じてEEPROM外部メモリ
ブロックMEMに格納されているガラス位置データのメ
モリ消去を行うとともに、スイッチ信号入力ブロック4
より下降指令信号が与えられると、入出力制御ブロック
15を通じてEEPROM外部メモリブロックMEMに
格納されているガラス位置データのメモリ消去を行う。
Further, in the control block 14, when a lowering command signal is given from the switch signal input block 4, the glass position data stored in the EEPROM external memory block MEM is erased through the input / output control block 15 and the memory is erased. Switch signal input block 4
When a lowering command signal is given, the memory of the glass position data stored in the EEPROM external memory block MEM is erased through the input / output control block 15.

【0056】そして、制御ブロック14では、モータロ
ック判定ブロック17より判定信号が与えられたときに
入出力制御ブロック15に書き込み指令を与える。そし
て、制御ブロック14は、スイッチ信号入力ブロック4
より与えられていた下降指令信号(ハイレベル)および
上昇指令信号(ハイレベル)が消滅したときに入出力制
御ブロック15に上書き指令を与える。
The control block 14 gives a write command to the input / output control block 15 when the determination signal is given from the motor lock determination block 17. Then, the control block 14 controls the switch signal input block 4
When the lowering command signal (high level) and the rising command signal (high level) given by the controller disappear, the overwriting command is given to the input / output control block 15.

【0057】入出力制御ブロック15は、制御ブロック
14より与えられた書き込み指令により、EEPROM
書き込みインターバルタイマTM1によって定められた
時間毎に、EEPROM外部メモリブロックMEM内に
おいてEEPROMメモリアドレスカウンタADCTに
よって定められた番地にパルスカウンタガラス位置記憶
WINDCTより与えられたパルス信号数(ガラス位置
データ)でのメモリ書き込みを行う機能を有する。ま
た、入出力制御ブロック15は、制御ブロック14より
与えられた上書き指令により、EEPROM外部メモリ
ブロックMEM内においてEEPROMメモリアドレス
カウンタADCTによって定められた番地にパルスカウ
ンタガラス位置記憶WINDCTより与えられたパルス
信号数(ガラス位置データ)でのメモリ書き込みを行う
機能を有する。また、入出力制御ブロック15は、制御
ブロック14より与えられた読み込み指令により、EE
PROM外部メモリブロックMEM内の任意の番地のパ
ルス信号数(ガラス位置データ)を読み込む機能を有す
る。
The input / output control block 15 responds to a write command given from the control block 14 by an EEPROM.
At every time determined by the write interval timer TM1, the number of pulse signals (glass position data) given from the pulse counter glass position storage WINDCT to the address determined by the EEPROM memory address counter ADCT in the EEPROM external memory block MEM. It has the function of writing to memory. In addition, the input / output control block 15 responds to the overwrite command given from the control block 14 by a pulse signal given from the pulse counter glass position storage WINDCT to the address determined by the EEPROM memory address counter ADCT in the EEPROM external memory block MEM. It has the function of writing data to the memory (number of glass position data). In addition, the input / output control block 15 responds to the read command given from the control block 14 by the EE.
It has a function of reading the number of pulse signals (glass position data) at an arbitrary address in the PROM external memory block MEM.

【0058】中央処理回路MCUでは、電源スイッチ2
0がオンされている状態で、ウインドガラス30が閉ま
っていて、図3に示されるように、時刻Aにおいて開ス
イッチ2がオン切換えされることによってスイッチ信号
入力ブロック4より制御ブロック14に下降指令信号が
与えられると、制御ブロック14(第1の出力ポートD
1)よりモータ駆動出力ブロック7の第1のスイッチン
グトランジスタTR1のベースにハイレベルが与えられ
るため、モータ5のアーマチュアシャフト5cが正回転
し、ウインドガラス30が開く。このとき、開スイッチ
2より下降指令信号が制御ブロック14に与えられるた
め、制御ブロック14より入出力制御ブロック15を通
じてEEPROM外部メモリブロックMEMに格納され
ているガラス位置データのメモリ消去が行われる。開ス
イッチ2より下降指令信号が制御ブロック14に与えら
れた際に、EEPROM外部メモリブロックMEMに格
納されているガラス位置データのメモリ消去を行い、既
に存在する位置データによる誤作動要因を排除する。
In the central processing unit MCU, the power switch 2
0, the window glass 30 is closed, and as shown in FIG. 3, when the open switch 2 is turned on at time A, the switch signal input block 4 issues a lowering command to the control block 14. When the signal is supplied, the control block 14 (the first output port D)
1) Since the high level is given to the base of the first switching transistor TR1 of the motor drive output block 7, the armature shaft 5c of the motor 5 rotates forward and the window glass 30 opens. At this time, since the lowering command signal is given from the open switch 2 to the control block 14, the control block 14 erases the memory of the glass position data stored in the EEPROM external memory block MEM through the input / output control block 15. When a lowering command signal is given from the open switch 2 to the control block 14, the glass position data stored in the EEPROM external memory block MEM is erased from the memory, and the cause of the malfunction due to the existing position data is eliminated.

【0059】中央処理回路MCUでは、開スイッチ2が
発生した下降指令信号が予め定められた時間よりも長く
なった場合、プログラム内でワンタッチ開フラグがセッ
トされるため、ワンタッチ動作記憶ブロック12におい
て下降指令信号を記憶して制御ブロック14に与え続け
る。中央処理回路MCUでは、開スイッチ2が発生した
下降指令信号の時間によってワンタッチ動作を判別する
ため、開スイッチ2の他にオートスイッチ等の付加スイ
ッチを必要としない。
In the central processing unit MCU, when the descent command signal generated by the open switch 2 becomes longer than a predetermined time, the one-touch open flag is set in the program. The command signal is stored and given to the control block 14. In the central processing unit MCU, the one-touch operation is determined based on the time of the descent command signal generated by the open switch 2, so that an additional switch such as an auto switch other than the open switch 2 is not required.

【0060】時刻Aにおいて、モータ5が正回転を開始
することによって、回転センサ6はほぼ同一間隔のパル
ス信号を発生し、パルス信号入力ブロック8、パルス間
隔測定ブロック16、パルス間隔測定タイマTM2が1
つづつのパルス信号の周期時間を検出する。
At time A, when the motor 5 starts rotating forward, the rotation sensor 6 generates pulse signals at substantially the same interval, and the pulse signal input block 8, the pulse interval measurement block 16, and the pulse interval measurement timer TM2 operate. 1
The cycle time of each successive pulse signal is detected.

【0061】時刻Aの後の時刻Bにおいて、ウインドガ
ラス30が全開位置Fに到達すると、ウインドガラス3
0が移動を阻止され、モータ5のアーマチュアシャフト
5cは回転速度が下がる。モータ5のアーマチュアシャ
フト5cの回転速度が下がってくると、回転センサ6が
発生するパルス信号の周期時間が長くなる。
At time B after time A, when window glass 30 reaches full open position F, window glass 3
0 is prevented from moving, and the rotation speed of the armature shaft 5c of the motor 5 decreases. When the rotation speed of the armature shaft 5c of the motor 5 decreases, the cycle time of the pulse signal generated by the rotation sensor 6 increases.

【0062】その後、パルス間隔測定タイマTM2が検
出した周期時間がモータロック判定値XLOCKを越え
た時刻Cにおいて、モータロック判定ブロック17が判
定信号を制御ブロック14に与えるため、制御ブロック
14より入出力制御ブロック15に書き込み指令が与え
られ、EEPROM書き込みインターバルタイマTM1
によって定められた時間毎に、EEPROM外部メモリ
ブロックMEM内においてEEPROMメモリアドレス
カウンタADCTによって定められた番地にパルスカウ
ンタガラス位置記憶WINDCTより与えられた回転信
号数(ガラス位置データ)でのメモリ書き込みが繰り返
し行われる。
Thereafter, at time C when the cycle time detected by the pulse interval measurement timer TM2 exceeds the motor lock determination value XLOCK, the motor lock determination block 17 provides a determination signal to the control block 14, A write command is given to the control block 15, and the EEPROM write interval timer TM1
Memory writing with the number of rotation signals (glass position data) given from the pulse counter glass position memory WINDCT at the address determined by the EEPROM memory address counter ADCT in the EEPROM external memory block MEM at every time determined by Done.

【0063】ウインドガラス30が全開位置Gに到達
し、モータ5のアーマチュアシャフト5cが回転を拘束
され、時刻Cの後の時刻Dにおいて、開スイッチ2がオ
フ切換えされると、制御ブロック14より入出力制御ブ
ロック15に上書き指令が与えられるため、EEPRO
M外部メモリブロックMEM内においてEEPROMメ
モリアドレスカウンタADCTによって定められた番地
にパルスカウンタガラス位置記憶WINDCTより与え
られたパルス信号数(ガラス位置データ)でのメモリ書
き込みが行われる。開スイッチ2がオフ切換えされた際
に、EEPROM外部メモリブロックMEMに位置デー
タが上書きされることによって、モータ2のアーマチュ
アシャフト5cがロック状態となったときに複数個書き
込まれた位置データと、開スイッチ、閉スイッチのオフ
切換え時に上書きされた位置データとによって、ロック
状態になったモータ5のアーマチュアシャフト5cがわ
ずかに回転を続けた場合でも、ウインドガラス30が確
実にストローク端に到達した位置での位置データが書き
込まれるため、ウインドガラス30の位置推定にずれが
なくなる。
When the window glass 30 reaches the fully open position G, the rotation of the armature shaft 5c of the motor 5 is restricted, and at time D after time C, the open switch 2 is turned off, the control block 14 turns on. Since an overwrite command is given to the output control block 15, EEPRO
In the M external memory block MEM, memory writing is performed at the address determined by the EEPROM memory address counter ADCT with the pulse signal number (glass position data) given from the pulse counter glass position storage WINDCT. When the open switch 2 is turned off, the position data is overwritten in the EEPROM external memory block MEM, so that a plurality of position data written when the armature shaft 5c of the motor 2 is locked is opened. Even when the armature shaft 5c of the locked motor 5 continues to rotate slightly due to the position data overwritten when the switch and the close switch are turned off, the position where the window glass 30 reaches the stroke end is ensured. Since the position data is written, there is no deviation in the position estimation of the window glass 30.

【0064】そして、時刻Dの後の時刻Eにおいて電源
スイッチ20がオフ切換えされても、時刻Cにおいてメ
モリ書き込みが行われたガラス位置データおよび時刻D
において上書きが行われたガラス位置データを用いてウ
インドガラス30の現在位置の検出が行われる。それ
故、メモリ書き込みが行われる際のモータ5の電圧VB
は、電源スイッチ20がオフ切換えされてからのように
下がったものとならないため、電源スイッチ20がオフ
切換えされてからの短い時間を使ってメモリ書き込みを
行うものと比べ、大きな容量のバックアップコンデンサ
を必要とせずに、電源ブロック9に備えられた第1のバ
ックアップ用コンデンサC1、第2のバックアップ用コ
ンデンサC2は容量が小さいものとなる。
Then, even if the power switch 20 is turned off at the time E after the time D, the glass position data and the time
The current position of the window glass 30 is detected using the overwritten glass position data. Therefore, the voltage VB of the motor 5 when memory writing is performed
Does not decrease as in the case where the power switch 20 is turned off, so that a backup capacitor having a larger capacity is used as compared with the case where memory writing is performed using a short time after the power switch 20 is turned off. Although not necessary, the first backup capacitor C1 and the second backup capacitor C2 provided in the power supply block 9 have small capacities.

【0065】一方、中央処理回路MCUでは、電源スイ
ッチ20がオン切換えされている状態で、ウインドガラ
ス30が開いていて、図3に示されるように、時刻Aに
おいて閉スイッチ3がオン切換えされることによってス
イッチ信号入力ブロック4より制御ブロック14に上昇
指令信号が与えられると、制御ブロック14(第2の出
力ポートD2)よりモータ駆動出力ブロック7の第2の
スイッチングトランジスタTR2のベースにハイレベル
が与えられるため、モータ5のアーマチュアシャフト5
cが逆回転し、ウインドガラス30が閉る。このとき、
閉スイッチ3より上昇指令信号が制御ブロック14に与
えられるため、制御ブロック14より入出力制御ブロッ
ク15を通じてEEPROM外部メモリブロックMEM
に格納されているガラス位置データのメモリ消去が行わ
れる。閉スイッチ3より上昇指令信号が制御ブロック1
4に与えられた際に、EEPROM外部メモリブロック
MEMに格納されているガラス位置データのメモリ消去
を行い、既に存在する位置データによる誤作動要因を排
除する。
On the other hand, in the central processing unit MCU, the window glass 30 is open while the power switch 20 is turned on, and the close switch 3 is turned on at time A as shown in FIG. As a result, when a rising command signal is given from the switch signal input block 4 to the control block 14, a high level is applied from the control block 14 (second output port D2) to the base of the second switching transistor TR2 of the motor drive output block 7. The armature shaft 5 of the motor 5
c rotates in the reverse direction, and the window glass 30 closes. At this time,
Since the rising command signal is given from the close switch 3 to the control block 14, the control block 14 sends the signal to the EEPROM external memory block MEM through the input / output control block 15.
Of the glass position data stored in the memory is erased. The rising command signal from the closing switch 3 is the control block 1.
4, the glass position data stored in the EEPROM external memory block MEM is erased from the memory, and a malfunction due to the existing position data is eliminated.

【0066】中央処理回路MCUでは、閉スイッチ3が
発生した上昇指令信号が予め定められた時間よりも長く
なった場合、プログラム内でワンタッチ閉フラグがセッ
トされるため、ワンタッチ動作記憶ブロック11におい
て上昇指令信号を記憶して制御ブロック14に与え続け
る。中央処理回路MCUでは、閉スイッチ3が発生した
上昇指令信号の時間によってワンタッチ動作を判別する
ため、閉スイッチ3の他にオートスイッチ等の付加スイ
ッチを必要としない。
In the central processing unit MCU, when the rising command signal generated by the closing switch 3 becomes longer than a predetermined time, the one-touch closing flag is set in the program. The command signal is stored and given to the control block 14. In the central processing unit MCU, an additional switch such as an auto switch is not required in addition to the close switch 3 because the one-touch operation is determined based on the time of the rising command signal generated by the close switch 3.

【0067】時刻Aにおいて、モータ5が逆回転を開始
することによって、回転センサ6はほぼ同一間隔のパル
ス信号を発生し、パルス信号入力ブロック8、パルス間
隔測定ブロック16、パルス間隔測定タイマTM2が1
つづつのパルス信号の周期時間を検出する。
At time A, when the motor 5 starts to rotate in the reverse direction, the rotation sensor 6 generates pulse signals at substantially the same interval, and the pulse signal input block 8, the pulse interval measurement block 16, and the pulse interval measurement timer TM2 operate. 1
The cycle time of each successive pulse signal is detected.

【0068】時刻Aの後の時刻Bにおいて、ウインドガ
ラス30が全閉位置Fに到達すると、ウインドガラス3
0が移動を阻止され、モータ5のアーマチュアシャフト
5cは回転速度が下がる。モータ5のアーマチュアシャ
フト5cの回転速度が下がってくると、回転センサ6が
発生するパルス信号の周期時間が長くなる。
At time B after time A, when window glass 30 reaches fully closed position F, window glass 3
0 is prevented from moving, and the rotation speed of the armature shaft 5c of the motor 5 decreases. When the rotation speed of the armature shaft 5c of the motor 5 decreases, the cycle time of the pulse signal generated by the rotation sensor 6 increases.

【0069】その後、パルス間隔測定タイマTM2が検
出した周期時間がモータロック判定値XLOCKを越え
た時刻Cにおいて、モータロック判定ブロック17が判
定信号を制御ブロック14に与えるため、制御ブロック
14より入出力制御ブロック15に書き込み指令が与え
られ、EEPROM書き込みインターバルタイマTM1
によって定められた時間毎に、EEPROM外部メモリ
ブロックMEM内においてEEPROMメモリアドレス
カウンタADCTによって定められた番地にパルスカウ
ンタガラス位置記憶WINDCTより与えられた回転信
号数(ガラス位置データ)でのメモリ書き込みが行われ
る。
Thereafter, at time C when the cycle time detected by the pulse interval measurement timer TM2 exceeds the motor lock determination value XLOCK, the motor lock determination block 17 provides a determination signal to the control block 14, A write command is given to the control block 15, and the EEPROM write interval timer TM1
Is written in the EEPROM external memory block MEM at the address determined by the EEPROM memory address counter ADCT with the number of rotation signals (glass position data) given from the pulse counter glass position storage WINDCT at every time determined by the above. Will be

【0070】ウインドガラス30が全閉位置Fに到達
し、モータ5のアーマチュアシャフト5cが回転を拘束
され、時刻Cの後の時刻Dにおいて、閉スイッチ3がオ
フ切換えされると、制御ブロック14より入出力制御ブ
ロック15に上書き指令が与えられるため、EEPRO
M外部メモリブロックMEM内においてEEPROMメ
モリアドレスカウンタADCTによって定められた番地
にパルスカウンタガラス位置記憶WINDCTより与え
られたパルス信号数(ガラス位置データ)でのメモリ書
き込みが行われる。閉スイッチ3がオフ切換えされた際
に、EEPROM外部メモリブロックMEMに位置デー
タが上書きされることによって、以前の時刻Cにおいて
EEPROM外部メモリブロックMEM内に既に書き込
まれている位置データとにより、ウインドガラス30の
位置推定にずれがなくなる。
When the window glass 30 reaches the fully closed position F, the rotation of the armature shaft 5c of the motor 5 is restricted, and at time D after time C, the closing switch 3 is turned off, the control block 14 Since an overwrite command is given to the input / output control block 15, the EEPRO
In the M external memory block MEM, memory writing is performed at the address determined by the EEPROM memory address counter ADCT with the pulse signal number (glass position data) given from the pulse counter glass position storage WINDCT. When the close switch 3 is turned off, the position data is overwritten in the EEPROM external memory block MEM, and the position of the window glass is changed by the position data already written in the EEPROM external memory block MEM at the previous time C. There is no deviation in the position estimation of 30.

【0071】そして、時刻Dの後の時刻Eにおいて電源
スイッチ20がオフ切換えされても、時刻Cにおいてメ
モリ書き込みが行われたガラス位置データおよび時刻D
において上書きが行われたカラス位置データを用いてウ
インドガラス30の現在位置の検出が行われる。それ
故、メモリ書き込みが行われる際のモータ5の電圧VB
は、電源スイッチ20がオフ切換えされてからのように
下がったものとならないため、電源スイッチ20がオフ
切換えされてからの短い時間を使ってメモリ書き込みを
行うものと比べ、大きな容量のバックアップコンデンサ
を必要とせずに、電源ブロック9に備えられた第1のバ
ックアップ用コンデンサC1、第2のバックアップ用コ
ンデンサC2は容量が小さいものとなる。
Then, even if the power switch 20 is turned off at the time E after the time D, the glass position data and the time
, The current position of the window glass 30 is detected using the overwritten crow position data. Therefore, the voltage VB of the motor 5 when memory writing is performed
Does not decrease as in the case where the power switch 20 is turned off, so that a backup capacitor having a larger capacity is used as compared with the case where memory writing is performed using a short time after the power switch 20 is turned off. Although not necessary, the first backup capacitor C1 and the second backup capacitor C2 provided in the power supply block 9 have small capacities.

【0072】上記のようなモータ制御装置1は、図4な
いし図6に示されるプログラムに従って制御動作を行
う。図4および図5はスイッチ信号取り込みルーチンで
あり、図6はEEPROM外部メモリブロックMEMへ
の書き込みルーチンである。なお、当該プログラムにお
いてワンタッチ開フラグ、ワンタッチ閉フラグは、図示
しない別のプログラムにおいて予めセットされ、モータ
5のアーマチュアシャフト5cが回転を拘束されること
によってロックされると図示しない別のプログラムにお
いてリセットされる。
The above-described motor control device 1 performs a control operation in accordance with the programs shown in FIGS. 4 and 5 show a switch signal fetching routine, and FIG. 6 shows a writing routine to the EEPROM external memory block MEM. In this program, the one-touch open flag and the one-touch close flag are set in advance in another program (not shown), and are reset in another program (not shown) when the armature shaft 5c of the motor 5 is locked by restricting rotation. You.

【0073】電源スイッチ20がオン切換えされてい
て、ウインドガラス30が全閉位置Fにあるとき、図3
に示される時刻Aにおいて開スイッチ2がオン切換えさ
れると、下降指令信号が制御ブロック14に取り込まれ
ることによってモータ駆動出力ブロック7の第1のスイ
ッチングトランジスタTR1にベース電流が与えられる
ため、モータ5のアーマチュアシャフト5cが正回転を
始め、ウインドガラス30が開く側に駆動され、ステッ
プ201においての判別で「開スイッチ2がオン」なの
でステップ207に移行してステップ207においての
判別が実行される。ステップ207では「モータオフで
の書き込みフラグFMWROFFがセットされているか
否か」を判別することにより、前回のルーチンでモータ
5がロックされた際にメモリ書き込みを実行したか否か
を判別する。ステップ207においての判別で「モータ
オフでの書き込みフラグFMWROFFがセットされて
いる」ためステップ222に移行し、ステップ222に
おいての判別で「メモリ消去フラグFMERASEはセ
ットされていない」のでステップ223に移行する。
When the power switch 20 is turned on and the window glass 30 is in the fully-closed position F, as shown in FIG.
When the open switch 2 is turned on at the time A shown in FIG. 5, a base command is given to the first switching transistor TR1 of the motor drive output block 7 by receiving the descending command signal into the control block 14, so that the motor 5 The armature shaft 5c starts to rotate forward and the window glass 30 is driven to the open side. Since the determination in step 201 indicates that the "open switch 2 is on", the process proceeds to step 207 and the determination in step 207 is executed. In step 207, it is determined whether or not the memory write has been executed when the motor 5 was locked in the previous routine by determining whether or not the motor OFF write flag FMWROFF has been set. Since the determination in step 207 indicates that “write flag FMWROFF when motor is off is set”, the process proceeds to step 222, and the determination in step 222 indicates that “memory erase flag FMERASE is not set” and the process proceeds to step 223.

【0074】ステップ222から移行したステップ22
3において「メモリ書き込み中フラグFMWRNOWを
リセット」してステップ224に移行し、ステップ22
4において「メモリ書き込み完了フラグFMWREND
をリセット」してステップ225に移行し、ステップ2
25において「メモリ消去フラグFMERASEをセッ
ト」することにより、制御ブロック14より入出力制御
ブロック15を通じて「EEPROM外部メモリブロッ
クMEMに格納されているガラス位置データのメモリ消
去」が行われてステップ226に移行し、ステップ22
6において「モータオンでの書き込みフラグFMWRO
Nをリセット」してステップ227に移行し、ステップ
227において「モータオフでの書き込みフラグFMW
ROFFをリセット」してステップ228に移行し、ス
テップ228において「EEPROM外部メモリブロッ
クMEMに格納されているガラス位置データを全数クリ
ア」してステップ201に戻るルーチンを実行する。
Step 22 shifted from step 222
In step 3, "Reset memory writing flag FMWRNOW" is performed, and the process proceeds to step 224.
4, the "memory write completion flag FMWREND"
Is reset, and the process proceeds to step 225.
By setting the “memory erase flag FMERASE” in step 25, “the memory erase of the glass position data stored in the EEPROM external memory block MEM” is performed by the control block 14 through the input / output control block 15, and the process proceeds to step 226. And step 22
In step 6, "Write flag FMWRO at motor on"
N is reset ", and the routine proceeds to step 227. In step 227, the" motor-off write flag FMW
ROFF is reset ", and the routine proceeds to step 228. In step 228, a routine is executed in which" all glass position data stored in the EEPROM external memory block MEM is cleared "and the routine returns to step 201.

【0075】そして、次の回のルーチンでは、「モータ
オフでの書き込みフラグFMWROFFが前回のルーチ
ンでリセットされている」ため、開スイッチ2がオン切
換えされ、ウインドガラス30が開く側に移動している
途中では、ステップ201からステップ207に移行
し、ステップ207においての判別でステップ214に
移行し、ステップ214においての判別で「メモリ書き
込み中フラグFMERNOWはセットされていない」の
でステップ215に移行し、ステップ215においての
判別で「パルス間隔測定タイマTM2が検出した周期時
間がモータロック判定値XLOCKを越えていない」の
でステップ217に移行し、ステップ217において
「メモリ書き込み中フラグFMWRNOWをリセット」
してステップ201に戻るルーチンを実行する。
In the next routine, since the write flag FMWROFF with the motor off is reset in the previous routine, the open switch 2 is turned on and the window glass 30 is moved to the open side. In the middle, the process proceeds from step 201 to step 207, and the process proceeds to step 214 in the determination in step 207. Since the determination in step 214 is "the memory writing flag FMERNOW is not set", the process proceeds to step 215. In the determination at 215, since the cycle time detected by the pulse interval measurement timer TM2 has not exceeded the motor lock determination value XLOCK, the process proceeds to step 217, and at step 217, the "reset the memory writing flag FMWRNOW"
Then, a routine that returns to step 201 is executed.

【0076】時刻Aにおいて、モータ5が正回転を開始
することによって、回転センサ6はほぼ同一間隔のパル
ス信号を発生し、パルス信号入力ブロック8、パルス間
隔測定ブロック16、パルス間隔測定タイマTM2が1
つづつのパルス信号の周期時間を検出する。
At time A, when the motor 5 starts rotating forward, the rotation sensor 6 generates pulse signals at substantially the same interval, and the pulse signal input block 8, the pulse interval measurement block 16, and the pulse interval measurement timer TM2 operate. 1
The cycle time of each successive pulse signal is detected.

【0077】時刻Aの後の時刻Bにおいて、ウインドガ
ラス30が全開位置Gに到達すると、ウインドガラス3
0が移動を阻止され、モータ5のアーマチュアシャフト
5cは回転速度が下がる。モータ5のアーマチュアシャ
フト5cの回転速度が下がってくると、回転センサ6が
発生するパルス信号の周期時間が長くなる。
At time B after time A, when window glass 30 reaches full open position G, window glass 3
0 is prevented from moving, and the rotation speed of the armature shaft 5c of the motor 5 decreases. When the rotation speed of the armature shaft 5c of the motor 5 decreases, the cycle time of the pulse signal generated by the rotation sensor 6 increases.

【0078】時刻Bの後、パルス間隔測定タイマTM2
が検出した周期時間が時刻Cにおいてモータロック判定
値XLOCKを越えると、ステップ201、ステップ2
07、ステップ214、ステップ215においての判別
でステップ216に移行し、ステップ216においての
判別で「メモリ書き込み完了フラグFMWRENDはセ
ットされていない」のでステップ218に移行し、ステ
ップ218において「メモリ消去フラグFMERASE
をリセット」してステップ219に移行し、ステップ2
19において「モータオンでの書き込みフラグFMWR
ONをセットして」ステップ220に移行し、ステップ
220において「モータオフでの書き込みフラグFMW
ROFFをリセット」してステップ221に移行し、ス
テップ221においてステップ201に戻るルーチンが
実行される。メモリ書き込みが行われている間、ステッ
プ201、ステップ207、ステップ214に移行し、
ステップ214においての判別で「メモリ書き込み中フ
ラグFMERNOWはセットされていない」ので、ステ
ップ215、ステップ216をスキップし、ステップ2
18、ステップ219、ステップ220、ステップ22
1が実行される。
After time B, the pulse interval measuring timer TM2
If the detected cycle time exceeds the motor lock determination value XLOCK at time C, step 201, step 2
07, step 214, and step 215, the process proceeds to step 216. In step 216, since the "memory write completion flag FMWREND is not set", the process proceeds to step 218, and in step 218, the "memory erase flag FMERASE" is set.
Is reset, and the process proceeds to step 219.
19, the "motor ON write flag FMWR
Then, the process proceeds to step 220. In step 220, the "write flag FMW with motor off" is set.
"ROFF is reset", and the routine proceeds to step 221. In step 221, a routine for returning to step 201 is executed. While the memory writing is being performed, the process proceeds to step 201, step 207, and step 214,
Since it is determined in step 214 that the memory writing flag FMERNOW is not set, steps 215 and 216 are skipped and step 2
18, step 219, step 220, step 22
1 is executed.

【0079】ステップ221が実行されることにより、
書き込みルーチンが実行され、ステップ301において
の判別で「メモリ書き込み中フラグFMWRNOWはリ
セットされている」のでステップ302に移行し、ステ
ップ302において「メモリ書き込み完了フラグFMW
RENDをリセット」してステップ303に移行し、ス
テップ303において「EEPROM書き込みインター
バルタイマTM1をクリア」してステップ304に移行
し、ステップ304において「EEPROMメモリアド
レスカウンタADCTをクリア(メモリ書き込みの初期
設定)」してステップ305に移行し、ステップ305
において「メモリ書き込み中フラグFMWRNOWをセ
ット」してステップ306に移行する。
By executing step 221,
The write routine is executed, and the determination in step 301 indicates that the “memory writing flag FMWRNOW has been reset”.
REND is reset "and the process proceeds to step 303. In step 303," the EEPROM write interval timer TM1 is cleared "and the process proceeds to step 304. In step 304, the" EEPROM memory address counter ADCT is cleared (initial setting of memory writing). And the process proceeds to step 305.
, "Sets the memory writing flag FMWRNOW" and proceeds to step 306.

【0080】ステップ305から移行したステップ30
6では、「EEPROM書き込みインターバルタイマT
M1が予め定められたインターバル時間を越えたか否
か」の判別が行われるため、1つ目の書き込みが開始さ
れた当初は、ステップ307に移行して「EEPROM
外部メモリブロックMEM内でEEPROMメモリアド
レスカウンタADCTによって定められた番地にパルス
カウンタガラス位置記憶WINDCTより与えられた回
転信号数(ガラス位置データ)でのメモリ書き込み」が
行われてステップ308に移行し、ステップ308にお
いて「EEPROMメモリアドレスカウンタADCTを
インクリメント」してステップ309に移行し、ステッ
プ309において「EEPROM書き込みインターバル
タイマTM1をクリア」してステップ310に移行す
る。ステップ310では「EEPROMメモリアドレス
カウンタADCTが最大値Nになっているか否か」が判
別されるため、1つ目の書き込みが開始された当初はス
テップ301に戻って次の回のルーチンを実行する。
Step 30 shifted from step 305
In the example of FIG. 6, "EEPROM writing interval timer T
It is determined whether or not M1 has exceeded a predetermined interval time. Therefore, when the first writing is started, the process proceeds to step 307 to execute “EEPROM”.
In the external memory block MEM, the memory is written to the address determined by the EEPROM memory address counter ADCT with the number of rotation signals (glass position data) given by the pulse counter glass position storage WINDCT ”, and the process proceeds to step 308. In step 308, "the EEPROM memory address counter ADCT is incremented" and the process proceeds to step 309. In step 309, "the EEPROM write interval timer TM1 is cleared" and the process proceeds to step 310. In step 310, "whether or not the EEPROM memory address counter ADCT has reached the maximum value N" is determined. Therefore, when the first writing is started, the flow returns to step 301 to execute the next routine. .

【0081】次の回のルーチンでは、ステップ301に
おいての判別で「メモリ書き込み中フラグFMWRNO
Wがセットされている」ためステップ306に移行し、
EEPROM書き込みインターバルタイマTM1が予め
定められたインターバル時間を越えたら、ステップ30
6においての判別でステップ311に移行し、ステップ
311において「メモリ書き込み中フラグFMWRNO
Wをリセット」してステップ312に移行し、ステップ
312において「メモリ書き込み完了フラグFMWRE
NDをセット」して次の回に移行する書き込みルーチン
が実行される。
In the next routine, the determination in step 301 indicates that the “memory writing flag FMWRNO
W has been set. "
If the EEPROM write interval timer TM1 exceeds a predetermined interval time, step 30 is executed.
6, the process proceeds to step 311, and in step 311, the “memory writing flag FMWRNO
W is reset, and the process proceeds to the step 312. In the step 312, the "memory write completion flag FMWRE"
A write routine is executed to set "ND" and shift to the next time.

【0082】ウインドガラス30が全開位置Gに到達
し、モータ5のアーマチュアシャフト5cが回転を拘束
され、時刻Cの後の時刻Dにおいて、開スイッチ2がオ
フ切換えされると、制御ブロック14に取り込まれてい
た下降指令信号が消滅するため、モータ駆動出力ブロッ
ク7の第1のスイッチングトランジスタTR1がオフ
し、モータ5のアーマチュアシャフト5cが回転を停止
し、ウインドガラス30が全開位置Gで停止する。する
と、ステップ201においての判別で「開スイッチ2が
オン切換えされていない」のでステップ202に移行
し、ステップ202においての判別で「閉スイッチ3が
オン切換えされていない」のでステップ203に移行
し、ステップ203においての判別で「ワンタッチ開フ
ラグはセットされていない」のでステップ204に移行
し、ステップ204においての判別で「ワンタッチ閉フ
ラグはセットされていない」のでステップ205に移行
し、ステップ205においての判別で「モータオンでの
書き込みフラグFMWRONはセットされている」ので
ステップ206に移行し、ステップ206において「メ
モリ書き込み中フラグFMWRNOWをリセット」して
ステップ208に移行し、ステップ208においての判
別で「メモリ書き込み中フラグFMWRNOWはセット
されている」のでステップ210に移行し、ステップ2
10において「メモリ消去フラグFMERASEをリセ
ット」してステップ211に移行し、ステップ211に
おいて「モータオンでの書き込みフラグFMWRONを
セット」してステップ212に移行し、ステップ212
において「モータオフでの書き込みフラグFMWROF
Fをリセット」してステップ213に移行し、ステップ
213において「制御ブロック14より入出力制御ブロ
ック15に上書き指令」が与えられる。
When the window glass 30 reaches the fully open position G, the rotation of the armature shaft 5c of the motor 5 is restricted, and at time D after time C, the open switch 2 is turned off, the control block 14 takes in. Since the descending command signal disappears, the first switching transistor TR1 of the motor drive output block 7 is turned off, the armature shaft 5c of the motor 5 stops rotating, and the window glass 30 stops at the fully open position G. Then, in the determination in step 201, since the "open switch 2 is not switched on", the process proceeds to step 202. In the determination in step 202, the "close switch 3 is not switched on", the process proceeds to step 203. In the determination in step 203, "one-touch open flag is not set", the process proceeds to step 204. In the determination in step 204, "one-touch close flag is not set", the process proceeds to step 205, and in step 205, Since the determination is "the writing flag FMWRON is set when the motor is on", the flow shifts to step 206. In step 206, the "memory writing flag FMWRNOW is reset" and the flow shifts to step 208. Writing Since the only medium flag FMWRNOW has been set, "the process proceeds to step 210, step 2
In step 10, the "memory erase flag FMERRASE is reset" and the process proceeds to step 211. In step 211, the "motor-on write flag FMWRON" is set and the process proceeds to step 212.
"Write flag FMWROF at motor off"
F is reset "and the process proceeds to step 213. In step 213," an overwrite command is issued from the control block 14 to the input / output control block 15 ".

【0083】ステップ213が実行されることにより、
書き込みルーチンが実行され、ステップ301において
「メモリ書き込み中フラグFMWRNOWはリセットさ
れている」のでステップ302に移行し、ステップ30
2において「メモリ書き込み完了フラグFMWREND
をリセット」してステップ303に移行し、ステップ3
03において「EEPROM書き込みインターバルタイ
マTM1をクリア」してステップ304に移行し、ステ
ップ304において「EEPROMメモリアドレスカウ
ンタADCTをクリア(メモリ書き込みの初期設定)」
してステップ305に移行し、ステップ305において
「メモリ書き込み中フラグFMWRNOWをセット」し
てステップ306に移行する。
By executing step 213,
The write routine is executed, and in step 301, the "memory writing flag FMWRNOW has been reset".
2, the "memory write completion flag FMWREND"
Is reset, and the process proceeds to step 303, where step 3
In step 03, "clear the EEPROM write interval timer TM1" and proceed to step 304. In step 304, "clear the EEPROM memory address counter ADCT (initial setting of memory writing)".
Then, the process proceeds to step 305. In step 305, "set the memory writing flag FMWRNOW", and then proceeds to step 306.

【0084】ステップ305から移行したステップ30
6では、「EEPROM書き込みインターバルタイマT
M1が予め定められたインターバル時間を越えたか否
か」の判別が行われるため、1つ目の書き込みが開始さ
れた当初は、ステップ307に移行して「EEPROM
外部メモリブロックMEM内でEEPROMメモリアド
レスカウンタADCTによって定められた番地にパルス
カウンタガラス位置記憶WINDCTより与えられた回
転信号数(ガラス位置データ)でのメモリ書き込み」が
行われてステップ308に移行し、ステップ308にお
いて「EEPROMメモリアドレスカウンタADCTを
インクリメント」してステップ309に移行し、ステッ
プ309において「EEPROM書き込みインターバル
タイマTM1をクリア」してステップ310に移行す
る。ステップ310では「EEPROMメモリアドレス
カウンタADCTが最大値Nになっているか否か」が判
別されるため、1つ目の書き込みが開始された当初はス
テップ301に戻って次の回のルーチンを実行する。
Step 30 shifted from step 305
In the example of FIG. 6, "EEPROM writing interval timer T
It is determined whether or not M1 has exceeded a predetermined interval time. Therefore, when the first writing is started, the process proceeds to step 307 to execute “EEPROM”.
In the external memory block MEM, the memory is written to the address determined by the EEPROM memory address counter ADCT with the number of rotation signals (glass position data) given by the pulse counter glass position storage WINDCT ”, and the process proceeds to step 308. In step 308, "the EEPROM memory address counter ADCT is incremented" and the process proceeds to step 309. In step 309, "the EEPROM write interval timer TM1 is cleared" and the process proceeds to step 310. In step 310, "whether or not the EEPROM memory address counter ADCT has reached the maximum value N" is determined. Therefore, when the first writing is started, the flow returns to step 301 to execute the next routine. .

【0085】次の回のルーチンでは、ステップ301に
おいての判別で「メモリ書き込み中フラグFMWRNO
Wがセットされている」ためステップ306に移行し、
EEPROM書き込みインターバルタイマTM1が予め
定められたインターバル時間を越えたら、ステップ30
6においての判別でステップ311に移行し、ステップ
311において「メモリ書き込み中フラグFMWRNO
Wをリセット」してステップ312に移行し、ステップ
312において「メモリ書き込み完了フラグFMWRE
NDをセット」して次の回に移行する書き込みルーチン
が実行される。
In the next routine, the determination in step 301 indicates that the “memory writing flag FMWRNO
W has been set. "
If the EEPROM write interval timer TM1 exceeds a predetermined interval time, step 30 is executed.
6, the process proceeds to step 311, and in step 311, the “memory writing flag FMWRNO
W is reset, and the process proceeds to the step 312. In the step 312, the "memory write completion flag FMWRE"
A write routine is executed to set "ND" and shift to the next time.

【0086】上書きのメモリ書き込みが行われている
間、一回目のルーチンが終了すると、次の回からは、ス
テップ201、ステップ202、ステップ203、ステ
ップ204、ステップ205、ステップ206、ステッ
プ208に移行し、ステップ208においての判別でス
テップ210にスキップし、ステップ210、ステップ
211、ステップ212、ステップ213が実行され
る。
When the first routine is completed while the overwriting memory writing is being performed, the process proceeds to step 201, step 202, step 203, step 204, step 205, step 206, and step 208 from the next time. Then, the process skips to step 210 in the determination in step 208, and steps 210, 211, 212, and 213 are executed.

【0087】一方、電源スイッチ20がオン切換えされ
ていて、ウインドガラス30が全閉位置Fにあるとき、
開スイッチ2がオン切換えされ、開スイッチ2のオン時
間が予め定められた時間よりも長いと、他のプログラム
によってワンタッチ開フラグがセットされたルーチンが
実行される。
On the other hand, when the power switch 20 is turned on and the window glass 30 is in the fully closed position F,
When the open switch 2 is turned on and the ON time of the open switch 2 is longer than a predetermined time, a routine in which the one-touch open flag is set by another program is executed.

【0088】開スイッチ2が当初オン切換えされたと
き、ステップ201での判別でステップ207に移行
し、ステップ207においての判別でステップ222に
移行し、ステップ222においての判別で「メモリ消去
フラグFMERASEはセットされていない」のでステ
ップ223に移行し、ステップ223、ステップ22
4、ステップ225、ステップ226、ステップ22
7、ステップ228を実行する。下降指令信号が制御ブ
ロック14に取り込まれることによってモータ駆動出力
ブロック7の第1のスイッチングトランジスタTR1に
ベース電流が与えられるため、モータ5のアーマチュア
シャフト5cが正回転を始め、ウインドガラス30が開
く側に駆動される。
When the open switch 2 is initially turned on, the process proceeds to step 207 in the determination in step 201, proceeds to step 222 in the determination in step 207, and proceeds to step 222 in the determination in step 222. Not set ", the process proceeds to Step 223, and Steps 223 and 22 are executed.
4, Step 225, Step 226, Step 22
7. Step 228 is executed. The base command is applied to the first switching transistor TR1 of the motor drive output block 7 by the falling command signal being taken into the control block 14, so that the armature shaft 5c of the motor 5 starts forward rotation and the window glass 30 opens. Is driven.

【0089】その後に、開スイッチ2がオフ切換えされ
ても、「ワンタッチ開フラグはセットされている」た
め、ステップ201においての判別で「開スイッチ2は
オン切換えされていない」のでステップ202に移行
し、ステップ202においての判別でステップ203に
移行し、ステップ203においての判別で「ワンタッチ
開フラグはセットされている」のでステップ207に移
行し、以後、ステップ222、ステップ223、ステッ
プ224、ステップ225、ステップ226、ステップ
227、ステップ228を実行し、制御ブロック14に
よりモータ駆動出力ブロック7の第1のスイッチングト
ランジスタTR1にベース電流が与えられ続けるため、
モータ5のアーマチュアシャフト5cが正回転をし続
け、ウインドガラス30が開く側に連続的に駆動され
る。
Thereafter, even if the open switch 2 is turned off, since the "one-touch open flag is set", the determination in step 201 indicates that "the open switch 2 has not been turned on". Then, the process proceeds to step 203 in the determination at step 202, and proceeds to step 207 because the "one-touch open flag is set" in the determination at step 203. Thereafter, steps 222, 223, 224, and 225 are performed. , 226, 227, and 228, and the control block 14 continues to supply the base current to the first switching transistor TR1 of the motor drive output block 7.
The armature shaft 5c of the motor 5 continues to rotate forward, and the window glass 30 is continuously driven to the open side.

【0090】時刻Aにおいて、モータ5が正回転を開始
することによって、回転センサ6はほぼ同一間隔のパル
ス信号を発生し、パルス信号入力ブロック8、パルス間
隔測定ブロック16、パルス間隔測定タイマTM2が1
つづつのパルス信号の周期時間を検出する。
At time A, when the motor 5 starts rotating forward, the rotation sensor 6 generates pulse signals of substantially the same interval, and the pulse signal input block 8, the pulse interval measurement block 16, and the pulse interval measurement timer TM2 operate. 1
The cycle time of each successive pulse signal is detected.

【0091】時刻Aの後の時刻Bにおいて、ウインドガ
ラス30が全開位置Gに到達すると、ウインドガラス3
0が移動を阻止され、モータ5のアーマチュアシャフト
5cは回転速度が下がる。モータ5のアーマチュアシャ
フト5cの回転速度が下がってくると、回転センサ6が
発生するパルス信号の周期時間が長くなる。
At time B after time A, when window glass 30 reaches full-open position G, window glass 3
0 is prevented from moving, and the rotation speed of the armature shaft 5c of the motor 5 decreases. When the rotation speed of the armature shaft 5c of the motor 5 decreases, the cycle time of the pulse signal generated by the rotation sensor 6 increases.

【0092】時刻Bの後、パルス間隔測定タイマTM2
が検出した周期時間が時刻Cにおいてモータロック判定
値XLOCKを越えると、ステップ201、ステップ2
07、ステップ214、ステップ215においての判別
でステップ216に移行し、ステップ216においての
判別で「メモリ書き込み完了フラグFMWRENDはセ
ットされていない」のでステップ218に移行し、ステ
ップ218において「メモリ消去フラグFMERASE
をリセット」してステップ219に移行し、ステップ2
19において「モータオンでの書き込みフラグFMWR
ONをセット」してステップ220に移行し、ステップ
220において「モータオフでの書き込みフラグFMW
ROFFをリセット」してステップ221に移行し、ス
テップ221においてステップ201に戻るルーチンが
実行される。メモリ書き込みが行われている間、ステッ
プ201、ステップ207、ステップ214に移行し、
ステップ214においての判別で「メモリ書き込み中フ
ラグFMERNOWはセットされていない」ので、ステ
ップ215、ステップ216をスキップし、ステップ2
18、ステップ219、ステップ220、ステップ22
1が実行される。
After time B, the pulse interval measuring timer TM2
If the detected cycle time exceeds the motor lock determination value XLOCK at time C, step 201, step 2
07, step 214, and step 215, the process proceeds to step 216. In step 216, since the "memory write completion flag FMWREND is not set", the process proceeds to step 218, and in step 218, the "memory erase flag FMERASE" is set.
Is reset, and the process proceeds to step 219.
19, the "motor ON write flag FMWR
ON is set ", and the process proceeds to step 220. In step 220, the" motor off write flag FMW "is set.
"ROFF is reset", and the routine proceeds to step 221. In step 221, a routine for returning to step 201 is executed. While the memory writing is being performed, the process proceeds to step 201, step 207, and step 214,
Since it is determined in step 214 that the memory writing flag FMERNOW is not set, steps 215 and 216 are skipped and step 2
18, step 219, step 220, step 22
1 is executed.

【0093】ステップ221が実行されることにより、
書き込みルーチンが実行され、ステップ301において
の判別で「メモリ書き込み中フラグFMWRNOWはリ
セットされている」のでステップ302に移行し、ステ
ップ302において「メモリ書き込み完了フラグFMW
RENDをリセット」してステップ303に移行し、ス
テップ303において「EEPROM書き込みインター
バルタイマTM1をクリア」してステップ304に移行
し、ステップ304において「EEPROMメモリアド
レスカウンタADCTをクリア(メモリ書き込みの初期
設定)」してステップ305に移行し、ステップ305
において「メモリ書き込み中フラグFMWRNOWをセ
ット」してステップ306に移行する。
By executing step 221,
The write routine is executed, and the determination in step 301 indicates that the “memory writing flag FMWRNOW has been reset”.
REND is reset "and the process proceeds to step 303. In step 303," the EEPROM write interval timer TM1 is cleared "and the process proceeds to step 304. In step 304, the" EEPROM memory address counter ADCT is cleared (initial setting of memory writing). And the process proceeds to step 305.
, "Sets the memory writing flag FMWRNOW" and proceeds to step 306.

【0094】ステップ305から移行したステップ30
6では、「EEPROM書き込みインターバルタイマT
M1が予め定められたインターバル時間を越えたか否
か」の判別が行われるため、1つ目の書き込みが開始さ
れた当初は、ステップ307に移行して「EEPROM
外部メモリブロックMEM内でEEPROMメモリアド
レスカウンタADCTによって定められた番地にパルス
カウンタガラス位置記憶WINDCTより与えられた回
転信号数(ガラス位置データ)でのメモリ書き込み」が
行われてステップ308に移行し、ステップ308にお
いて「EEPROMメモリアドレスカウンタADCTを
インクリメント」してステップ309に移行し、ステッ
プ309において「EEPROM書き込みインターバル
タイマTM1をクリア」してステップ310に移行す
る。ステップ310では「EEPROMメモリアドレス
カウンタADCTが最大値Nになっているか否か」が判
別されるため、1つ目の書き込みが開始された当初はス
テップ301に戻って次の回のルーチンを実行する。
Step 30 shifted from step 305
In the example of FIG. 6, "EEPROM writing interval timer T
It is determined whether or not M1 has exceeded a predetermined interval time. Therefore, when the first writing is started, the process proceeds to step 307 to execute “EEPROM”.
In the external memory block MEM, the memory is written to the address determined by the EEPROM memory address counter ADCT with the number of rotation signals (glass position data) given by the pulse counter glass position storage WINDCT ”, and the process proceeds to step 308. In step 308, "the EEPROM memory address counter ADCT is incremented" and the process proceeds to step 309. In step 309, "the EEPROM write interval timer TM1 is cleared" and the process proceeds to step 310. In step 310, "whether or not the EEPROM memory address counter ADCT has reached the maximum value N" is determined. Therefore, when the first writing is started, the flow returns to step 301 to execute the next routine. .

【0095】次の回のルーチンでは、ステップ301に
おいての判別で「メモリ書き込み中フラグFMWRNO
Wがセットされている」ためステップ306に移行し、
EEPROM書き込みインターバルタイマTM1が予め
定められたインターバル時間を越えたら、ステップ30
6においての判別でステップ311に移行し、ステップ
311において「メモリ書き込み中フラグFMWRNO
Wをリセット」してステップ312に移行し、ステップ
312において「メモリ書き込み完了フラグFMWRE
NDをセット」して次の回に移行する書き込みルーチン
が実行される。
In the next routine, the determination in step 301 indicates that the “memory writing flag FMWRNO
W has been set. "
If the EEPROM write interval timer TM1 exceeds a predetermined interval time, step 30 is executed.
6, the process proceeds to step 311, and in step 311, the “memory writing flag FMWRNO
W is reset, and the process proceeds to the step 312. In the step 312, the "memory write completion flag FMWRE"
A write routine is executed to set "ND" and shift to the next time.

【0096】ウインドガラス30が全開位置Gに到達
し、モータ5のアーマチュアシャフト5cが回転を拘束
されると、時刻Cの後の時刻Dにおいて、制御ブロック
14に取り込まれていた下降指令信号が消滅するため、
モータ駆動出力ブロック7の第1のスイッチングトラン
ジスタTR1がオフし、モータ5のアーマチュアシャフ
ト5cが回転を停止し、ウインドガラス30が全開位置
Gで停止する。すると、ステップ201においての判別
で「開スイッチ2がオン切換えされていない」のでステ
ップ202に移行し、ステップ202においての判別で
「閉スイッチ3がオン切換えされていない」のでステッ
プ203に移行し、ステップ203においての判別で
「ワンタッチ開フラグはセットされていない」のでステ
ップ204に移行し、ステップ204においての判別で
「ワンタッチ閉フラグはセットされていない」のでステ
ップ205に移行し、ステップ205においての判別で
「モータオンでの書き込みフラグFMWRONはセット
されている」のでステップ206に移行し、ステップ2
06において「メモリ書き込み中フラグFMWRNOW
をリセット」してステップ208に移行し、ステップ2
08においての判別で「メモリ書き込み中フラグFMW
RNOWはセットされている」のでステップ210に移
行し、ステップ210において「メモリ消去フラグFM
ERASEをリセット」してステップ211に移行し、
ステップ211において「モータオンでの書き込みフラ
グFMWRONをセット」してステップ212に移行
し、ステップ212において「モータオフでの書き込み
フラグFMWROFFをリセット」してステップ213
に移行し、ステップ213において「制御ブロック14
より入出力制御ブロック15に上書き指令」が与えられ
る。
When the window glass 30 reaches the fully open position G and the rotation of the armature shaft 5c of the motor 5 is restricted, the descent command signal taken into the control block 14 at time D after time C disappears. To do
The first switching transistor TR1 of the motor drive output block 7 is turned off, the armature shaft 5c of the motor 5 stops rotating, and the window glass 30 stops at the fully open position G. Then, in the determination in step 201, since the "open switch 2 is not switched on", the process proceeds to step 202. In the determination in step 202, the "close switch 3 is not switched on", the process proceeds to step 203. In the determination in step 203, "one-touch open flag is not set", the process proceeds to step 204. In the determination in step 204, "one-touch close flag is not set", the process proceeds to step 205, and in step 205, In the determination, "the motor ON write flag FMWRON is set", the flow proceeds to step 206, and step 2 is executed.
06, the “memory writing flag FMWRNOW
Is reset, and the process proceeds to step 208, where step 2
08, the "memory writing flag FMW
Since RNOW is set, the process proceeds to step 210, and in step 210, the "memory erase flag FM
Reset ERASE ”and proceed to step 211,
In step 211, "set the write flag FMWRON when the motor is on" and proceed to step 212. In step 212, "reset the write flag FMWROFF when the motor is off" and execute step 213.
The processing proceeds to step 213, where "control block 14
From the input / output control block 15.

【0097】ステップ213が実行されることにより、
書き込みルーチンが実行され、ステップ301において
「メモリ書き込み中フラグFMWRNOWはリセットさ
れている」のでステップ302に移行し、ステップ30
2において「メモリ書き込み完了フラグFMWREND
をリセット」してステップ303に移行し、ステップ3
03において「EEPROM書き込みインターバルタイ
マTM1をクリア」してステップ304に移行し、ステ
ップ304において「EEPROMメモリアドレスカウ
ンタADCTをクリア(メモリ書き込みの初期設定)」
してステップ305に移行し、ステップ305において
「メモリ書き込み中フラグFMWRNOWをセット」し
てステップ306に移行する。
By executing step 213,
The write routine is executed, and in step 301, the "memory writing flag FMWRNOW has been reset".
2, the "memory write completion flag FMWREND"
Is reset, and the process proceeds to step 303, where step 3
In step 03, "clear the EEPROM write interval timer TM1" and proceed to step 304. In step 304, "clear the EEPROM memory address counter ADCT (initial setting of memory writing)".
Then, the process proceeds to step 305. In step 305, "set the memory writing flag FMWRNOW", and then proceeds to step 306.

【0098】ステップ305から移行したステップ30
6では、「EEPROM書き込みインターバルタイマT
M1が予め定められたインターバル時間を越えたか否
か」の判別が行われるため、1つ目の書き込みが開始さ
れた当初は、ステップ307に移行して「EEPROM
外部メモリブロックMEM内でEEPROMメモリアド
レスカウンタADCTによって定められた番地にパルス
カウンタガラス位置記憶WINDCTより与えられた回
転信号数(ガラス位置データ)でのメモリ書き込み」が
行われてステップ308に移行し、ステップ308にお
いて「EEPROMメモリアドレスカウンタADCTを
インクリメント」してステップ309に移行し、ステッ
プ309において「書き込みインターバルタイマTM1
をクリア」してステップ310に移行する。ステップ3
10では「EEPROMメモリアドレスカウンタADC
Tが最大値Nになっているか否か」が判別されるため、
1つ目の書き込みが開始された当初はステップ301に
戻って次の回のルーチンを実行する。
Step 30 shifted from step 305
In the example of FIG. 6, "EEPROM writing interval timer T
It is determined whether or not M1 has exceeded a predetermined interval time. Therefore, when the first writing is started, the process proceeds to step 307 to execute “EEPROM”.
In the external memory block MEM, the memory is written to the address determined by the EEPROM memory address counter ADCT with the number of rotation signals (glass position data) given by the pulse counter glass position storage WINDCT ”, and the process proceeds to step 308. In step 308, "the EEPROM memory address counter ADCT is incremented", and the flow shifts to step 309. In step 309, the "write interval timer TM1"
Is cleared ", and the routine proceeds to step 310. Step 3
10, the "EEPROM memory address counter ADC"
Whether or not T has reached the maximum value N "is determined.
When the first writing is started, the process returns to step 301 to execute the next routine.

【0099】次の回のルーチンでは、ステップ301に
おいての判別で「メモリ書き込み中フラグFMWRNO
Wがセットされている」ためステップ306に移行し、
EEPROM書き込みインターバルタイマTM1が予め
定められたインターバル時間を越えたら、ステップ30
6においての判別でステップ311に移行し、ステップ
311において「メモリ書き込み中フラグFMWRNO
Wをリセット」してステップ312に移行し、ステップ
312において「メモリ書き込み完了フラグFMWRE
NDをセット」して次の回に移行する書き込みルーチン
が実行される。
In the next routine, the determination in step 301 indicates that the "memory writing flag FMWRNO
W has been set. "
If the EEPROM write interval timer TM1 exceeds a predetermined interval time, step 30 is executed.
6, the process proceeds to step 311, and in step 311, the “memory writing flag FMWRNO
W is reset, and the process proceeds to the step 312. In the step 312, the "memory write completion flag FMWRE"
A write routine is executed to set "ND" and shift to the next time.

【0100】上書きのメモリ書き込みが行われている
間、一回目のルーチンが終了すると、次の回からは、ス
テップ201、ステップ202、ステップ203、ステ
ップ204、ステップ205、ステップ206、ステッ
プ208に移行し、ステップ208においての判別でス
テップ210にスキップし、ステップ210、ステップ
211、ステップ212、ステップ213が実行され
る。
When the first routine is completed while the overwriting memory is being written, the process proceeds to steps 201, 202, 203, 204, 205, 206 and 208 from the next time. Then, the process skips to step 210 in the determination in step 208, and steps 210, 211, 212, and 213 are executed.

【0101】他方、電源スイッチ20がオン切換えされ
ていて、ウインドガラス30が全開位置Gにあるとき、
閉スイッチ3がオン切換えされると、上述した開スイッ
チ2がオン切換えされた際のルーチンと同様にしてルー
チンが実行される。また、電源スイッチ20がオン切換
えされていて、ウインドガラス30が全開位置Gにある
とき、閉スイッチ3がオン切換えされ、閉スイッチ3の
オン時間が予め定められた時間よりも長いものとなった
際も上述したワンタッチ開フラグがセットされている場
合と同様にして制御ルーチンが実行される。
On the other hand, when the power switch 20 is turned on and the window glass 30 is at the full open position G,
When the close switch 3 is turned on, the routine is executed in the same manner as the routine when the open switch 2 is turned on. When the power switch 20 is turned on and the window glass 30 is at the fully open position G, the close switch 3 is turned on, and the on time of the close switch 3 is longer than a predetermined time. At this time, the control routine is executed in the same manner as in the case where the one-touch open flag is set.

【0102】上述したように、モータ制御装置1は、開
スイッチ2がオン切換えされるか、あるいは閉スイッチ
3がオン切換えされた際に、EEPROM外部メモリブ
ロックMEMに書き込まれている位置データを消去し、
モータ5のアーマチュアシャフト5cがロック状態とな
ったときに、回転センサ6より与えられた回転信号を位
置データに変換してEEPROM外部メモリブロックM
EMに書き込み、その後に、開スイッチ2がオフ切換え
されるか、あるいは閉スイッチ3がオフ切換えされた際
に、回転センサ6より与えられた回転信号を位置データ
に変換してEEPROM外部メモリブロックMEMに上
書きするため、モータ5の第1、第2のブラシ端子5
a、5bの端子電圧が遮断されていないときに複数個の
位置データの書き込みが行われるものとなる。
As described above, when the open switch 2 is turned on or the close switch 3 is turned on, the motor control device 1 erases the position data written in the EEPROM external memory block MEM. And
When the armature shaft 5c of the motor 5 is locked, the rotation signal given by the rotation sensor 6 is converted into position data and the data is stored in the EEPROM external memory block M.
EM, and thereafter, when the open switch 2 is turned off or the close switch 3 is turned off, the rotation signal given from the rotation sensor 6 is converted into position data to convert it into the EEPROM external memory block MEM. The first and second brush terminals 5 of the motor 5
When the terminal voltages a and 5b are not cut off, writing of a plurality of position data is performed.

【0103】[0103]

【発明の効果】以上説明してきたように、この発明の請
求項1に係わるモータ制御装置によれば、モータがロッ
ク状態となったときに、モータ回転検出手段より与えら
れた回転信号を位置データに変換して不揮発性メモリに
電気的に書き込んでいるため、モータ電圧が遮断されて
いないときに複数個の位置データの書き込みが行われて
いる。それ故、電源スイッチがオフ切換えされた後の電
源電圧の降下中に位置データの書き込みは行われないか
ら、電源スイッチがオフ切換えされてから書き込みを行
うものと比べて、確実に位置データの書き込みができ、
位置データの書き込みのための時間を確保する大容量の
バックアップ用コンデンサを必要としないから、コンパ
クトな外形にすることができるという優れた効果を奏す
る。
As described above, according to the motor control device according to the first aspect of the present invention, when the motor is locked, the rotation signal given by the motor rotation detecting means is transmitted to the position data. Therefore, when the motor voltage is not cut off, a plurality of position data are written. Therefore, the position data is not written during the fall of the power supply voltage after the power switch is turned off, so that the position data can be written more reliably than when writing is performed after the power switch is turned off. Can be
Since there is no need for a large-capacity backup capacitor for securing time for writing position data, an excellent effect that a compact external shape can be obtained is obtained.

【0104】この発明の請求項2に係わるモータ制御装
置によれば、コントローラの制御ブロックは、開スイッ
チまたは閉スイッチがオン切換えされたとき毎に不揮発
性メモリに書き込まれている位置データを消去する。そ
れ故、請求項1の効果に加え、不揮発性メモリへの書き
込みには、開スイッチ、閉スイッチの動作毎に常に最新
の位置データが用いられるという優れた効果を奏する。
According to the motor control device of the second aspect of the present invention, the control block of the controller erases the position data written in the nonvolatile memory every time the open switch or the close switch is turned on. . Therefore, in addition to the effect of the first aspect, there is an excellent effect that the latest position data is always used for each operation of the open switch and the close switch when writing to the nonvolatile memory.

【0105】この発明の請求項3に係わるモータ制御装
置によれば、コントローラの制御ブロックは、開スイッ
チまたは閉スイッチがオフ切換えされたとき毎に不揮発
性メモリに対して位置データを上書きする。それ故、請
求項1および2の効果に加え、モータがロック状態とな
ったときに複数個書き込まれた位置データと、開スイッ
チ、閉スイッチのオフ切換え時に上書きされた位置デー
タとによって、ロック状態になったモータがわずかに回
転を続けた場合でも、ウインドガラスが確実にストロー
ク端に到達した位置での位置データが書き込まれるとい
う優れた効果を奏する。
According to the motor control device of the third aspect of the present invention, the control block of the controller overwrites the position data in the nonvolatile memory every time the open switch or the close switch is turned off. Therefore, in addition to the effects of claims 1 and 2, the locked state is obtained by the position data written when the motor is in the locked state and the position data overwritten when the open switch and the close switch are turned off. Thus, even when the motor is slightly rotated, the position data at the position where the window glass has reached the stroke end is written.

【0106】この発明の請求項4に係わるモータ制御装
置によれば、モータ回転検出手段より与えられる回転信
号は、モータがロックすることによってその周期が大き
くなり、コントローラのパルス間隔測定ブロックは、モ
ータ回転検出手段より与えられた回転信号の周期を測定
する。それ故、請求項1の効果に加え、パルス間隔測定
ブロックにより回転信号の周期を検出することによって
モータの負荷状態が検出されるという優れた効果を奏す
る。
According to the motor control device of the fourth aspect of the present invention, the period of the rotation signal given from the motor rotation detecting means is increased by locking the motor, and the pulse interval measuring block of the controller is used for the motor. The period of the rotation signal provided by the rotation detecting means is measured. Therefore, in addition to the effect of the first aspect, there is an excellent effect that the load state of the motor is detected by detecting the period of the rotation signal by the pulse interval measurement block.

【0107】この発明の請求項5に係わるモータ制御装
置によれば、コントローラのモータロック判定ブロック
は、パルス間隔測定ブロックより与えられた周期値と予
め定められた判定値とを比較し、パルス間隔測定ブロッ
クより与えられた周期値が予め定められた判定値を越え
た際に、制御ブロックにより不揮発性メモリへの書込み
が実行される。それ故、請求項4の効果に加え、モータ
のロック中に電源スイッチがオフ切換えされてもガラス
の位置データは失われないという優れた効果を奏する。
According to the motor control device of the fifth aspect of the present invention, the motor lock determination block of the controller compares the period value given from the pulse interval measurement block with a predetermined determination value, and determines the pulse interval. When the cycle value given by the measurement block exceeds a predetermined determination value, writing to the nonvolatile memory is executed by the control block. Therefore, in addition to the effect of claim 4, there is an excellent effect that the position data of the glass is not lost even if the power switch is turned off while the motor is locked.

【0108】この発明の請求項6に係わるモータ制御装
置によれば、コントローラのワンタッチ動作記憶ブロッ
クは、開スイッチまたは閉スイッチが長い時間オン切換
えされた後にオフ切換えされた際、開スイッチまたは閉
スイッチがオン切換えされたときに記憶した下降指令信
号または上昇指令信号を制御ブロックに連続的に与え
る。それ故、請求項1の効果に加え、ワンタッチ動作記
憶ブロックによって、開スイッチまたは閉スイッチより
発生した指令信号の保持が行われるため、開スイッチお
よび閉スイッチの他にオートスイッチ等の付加スイッチ
を必要としないという優れた効果を奏する。
According to the motor control device of the sixth aspect of the present invention, the one-touch operation storage block of the controller stores the open switch or the close switch when the open switch or the close switch is turned off after being turned on for a long time. Is continuously supplied to the control block when the switch is turned on. Therefore, in addition to the effect of claim 1, since the command signal generated from the open switch or the close switch is held by the one-touch operation storage block, an additional switch such as an auto switch is required in addition to the open switch and the close switch. It has an excellent effect of not doing so.

【図面の簡単な説明】[Brief description of the drawings]

【図1】この発明に係わるモータ制御装置の一実施例の
ブロック構成図である。
FIG. 1 is a block diagram of an embodiment of a motor control device according to the present invention.

【図2】図1に示したモータ制御装置の具体的回路図で
ある。
FIG. 2 is a specific circuit diagram of the motor control device shown in FIG.

【図3】図1に示したモータ制御装置においてのタイミ
ングチャートである。
FIG. 3 is a timing chart in the motor control device shown in FIG. 1;

【図4】図1に示したモータ制御装置においての制御動
作を説明するフローチャートである。
FIG. 4 is a flowchart illustrating a control operation in the motor control device illustrated in FIG. 1;

【図5】図1に示したモータ制御装置においての制御動
作を説明するフローチャートである。
FIG. 5 is a flowchart illustrating a control operation in the motor control device illustrated in FIG. 1;

【図6】図1に示したモータ制御装置においての制御動
作を説明するフローチャートである。
FIG. 6 is a flowchart illustrating a control operation in the motor control device illustrated in FIG. 1;

【図7】従来のモータ制御装置においてのタイミングチ
ャートである。
FIG. 7 is a timing chart in a conventional motor control device.

【符号の説明】[Explanation of symbols]

1 モータ制御装置 2 開スイッチ 3 閉スイッチ 5 モータ 6 (モータ回転検出手段)回転センサ 7 (モータ駆動回路)モータ駆動出力ブロック 12 ワンタッチ動作記憶ブロック 14 制御ブロック 16 パルス間隔測定ブロック 17 モータロック判定ブロック 20 電源スイッチ 21 電源 30 (負荷)ウインドガラス MCU コントローラ MEM (不揮発性メモリ)EEPROM外部メモリブ
ロック VB モータ電圧
REFERENCE SIGNS LIST 1 motor control device 2 open switch 3 close switch 5 motor 6 (motor rotation detecting means) rotation sensor 7 (motor drive circuit) motor drive output block 12 one-touch operation storage block 14 control block 16 pulse interval measurement block 17 motor lock determination block 20 Power switch 21 Power supply 30 (Load) Window glass MCU Controller MEM (Non-volatile memory) EEPROM external memory block VB Motor voltage

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 2E052 AA09 CA06 EA11 EB01 GA08 GA10 GB12 GB13 GC01 GC05 3D127 AA17 BB01 CB05 CC05 DF03 DF36 FF09 FF19 5H571 AA03 BB03 BB07 BB10 CC04 DD01 EE02 FF09 HA04 HB01 JJ03 JJ13 JJ17 JJ18 KK06 LL07 LL33 LL50  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 2E052 AA09 CA06 EA11 EB01 GA08 GA10 GB12 GB13 GC01 GC05 3D127 AA17 BB01 CB05 CC05 DF03 DF36 FF09 FF19 5H571 AA03 BB03 BB07 BB10 CC04 DD01 EE02 FF09 HA04 JJ03 JJ03 JJ03 LL50

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 電源スイッチと、 上記電源スイッチに電気的に接続されたモータ駆動回路
と、 上記モータ駆動回路に電気的に接続されているとともに
開閉負荷に結合され、モータ駆動回路の作動により該負
荷を開側または閉側に駆動するモータと、 上記モータの回転により回転検出信号を発生するモータ
回転検出手段と、 オン切換えされることにより下降指令信号を発生する開
スイッチと、 オン切換えされることにより上昇指令信号を発生する閉
スイッチと、 上記電源スイッチ、モータ駆動回路、モータ回転検出手
段、開スイッチ、閉スイッチにそれぞれ電気的に接続さ
れ、該開スイッチより下降指令信号が与えられると負荷
を開側に駆動するための電流をモータ駆動回路を介しモ
ータに供給する一方、該閉スイッチより上昇指令信号が
与えられると負荷を閉側に駆動するための電流をモータ
駆動回路を介しモータに供給するコントローラと、 上記モータがロック状態となったときに、該モータ回転
検出手段より与えられた回転信号を位置データに変換し
て電気的に複数個書き込み可能な不揮発性メモリを備え
ていることを特徴とするモータ制御装置。
A power switch, a motor drive circuit electrically connected to the power switch, and a motor drive circuit electrically connected to the motor drive circuit and coupled to an on / off load. A motor for driving a load to an open side or a closed side; motor rotation detecting means for generating a rotation detection signal by rotation of the motor; an open switch for generating a descending command signal when switched on; A close switch that generates an ascending command signal, and is electrically connected to the power switch, the motor drive circuit, the motor rotation detecting means, the open switch, and the close switch. Current for driving the motor to the open side is supplied to the motor via the motor drive circuit, and a rising command signal is given from the close switch. And a controller for supplying a current for driving the load to the closing side to the motor through the motor drive circuit, and when the motor is in a locked state, a rotation signal given by the motor rotation detection means is transmitted to the position. A motor control device, comprising: a nonvolatile memory capable of converting data into data and electrically writing a plurality of nonvolatile memories.
【請求項2】 コントローラには、開スイッチまたは閉
スイッチがオン切換えされたとき毎に不揮発性メモリに
書き込まれている位置データを消去する制御ブロックを
備えていることを特徴とする請求項1に記載のモータ制
御装置。
2. The controller according to claim 1, wherein the controller is provided with a control block for erasing the position data written in the nonvolatile memory each time the open switch or the close switch is turned on. The motor control device according to any one of the preceding claims.
【請求項3】 コントローラには、開スイッチまたは閉
スイッチがオフ切換えされたとき毎に不揮発性メモリに
対して位置データを上書きする制御ブロックを備えてい
ることを特徴とする請求項1または2に記載のモータ制
御装置。
3. The controller according to claim 1, wherein the controller is provided with a control block for overwriting the position data in the nonvolatile memory each time the open switch or the close switch is turned off. The motor control device according to any one of the preceding claims.
【請求項4】コントローラには、モータ回転検出手段よ
り与えられた回転信号の周期を測定するパルス間隔測定
ブロックを備えていることを特徴とする請求項1に記載
のモータ制御装置。
4. The motor control device according to claim 1, wherein the controller includes a pulse interval measurement block for measuring a period of the rotation signal provided by the motor rotation detection means.
【請求項5】 コントローラには、パルス間隔測定ブロ
ックより与えられた回転信号の周期値と予め定められた
判定値とを比較することにより、モータのロック判定を
行うモータロック判定ブロックを備えていることを特徴
とする請求項4に記載のモータ制御装置。
5. A controller is provided with a motor lock determination block for performing a motor lock determination by comparing a cycle value of a rotation signal given from a pulse interval measurement block with a predetermined determination value. The motor control device according to claim 4, wherein:
【請求項6】 コントローラには、開スイッチまたは閉
スイッチがオン切換えされている時間が予め定められた
値を越えた際に下降指令信号または上昇指令信号を記憶
し、その後に、開スイッチまたは閉スイッチがオフ切換
えされてからも、制御ブロックに対して下降指令信号ま
たは上昇指令信号を連続的に与えるワンタッチ動作記憶
ブロックを備えていることを特徴とする請求項1に記載
のモータ制御装置。
6. A controller stores a descending command signal or a rising command signal when a time during which an open switch or a close switch is turned on exceeds a predetermined value. 2. The motor control device according to claim 1, further comprising a one-touch operation storage block that continuously supplies a descending command signal or an ascending command signal to the control block even after the switch is turned off.
JP10365257A 1998-12-22 1998-12-22 Motor controller Pending JP2000188895A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10365257A JP2000188895A (en) 1998-12-22 1998-12-22 Motor controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10365257A JP2000188895A (en) 1998-12-22 1998-12-22 Motor controller

Publications (1)

Publication Number Publication Date
JP2000188895A true JP2000188895A (en) 2000-07-04

Family

ID=18483820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10365257A Pending JP2000188895A (en) 1998-12-22 1998-12-22 Motor controller

Country Status (1)

Country Link
JP (1) JP2000188895A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6437531B1 (en) * 1999-06-30 2002-08-20 Yazaki Corporation Backup method of microcomputer used in case of stoppage of operation, backup unit of microcomputer, and control unit for controlling power window for automobile use

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6437531B1 (en) * 1999-06-30 2002-08-20 Yazaki Corporation Backup method of microcomputer used in case of stoppage of operation, backup unit of microcomputer, and control unit for controlling power window for automobile use

Similar Documents

Publication Publication Date Title
US5483135A (en) Adaptive system and method for controlling vehicle window operation
US6426604B1 (en) Power window controlling device
EP0945953B1 (en) Method of detecting pinching of object of power window apparatus
US20090132114A1 (en) Control Device and Adjusting Mechanism of a Motor Vehicle
US6972536B2 (en) Closure member control device and method for limiting positional deviation of closure member
JPH11506214A (en) Deceleration delay state detection system for regulated electric motor
JP2000188895A (en) Motor controller
KR101077124B1 (en) Control apparatus for open/close member and method for controlling open/close member
US7164983B2 (en) Switching device for detecting a voltage interruption
JP2000184780A (en) Motor controlling device
JP3613611B2 (en) Motor control device
JPS6220058B2 (en)
JP4472963B2 (en) Control device with time measurement function
JP4184550B2 (en) Motor control device
JPH11275892A (en) Wiper controller
JP3656491B2 (en) Opening and closing body control device
US6346787B1 (en) Method for positioning a part
JP3839402B2 (en) Opening / closing member control device and method of preventing opening / closing member misalignment in opening / closing member control device
JP3630008B2 (en) Stoppage detection device for opening / closing mechanism
JPH08331877A (en) Safety device of motor-driven window opening/closing mechanism for vehicle
CN109510524B (en) Motor position information storage method and device
JP2552626Y2 (en) Drive circuit
JPS5828890Y2 (en) Vehicle air conditioner
JP2588117Y2 (en) Motor control device
JP4350878B2 (en) Mobile control device