JPH1063357A - Constant current controller - Google Patents

Constant current controller

Info

Publication number
JPH1063357A
JPH1063357A JP8214528A JP21452896A JPH1063357A JP H1063357 A JPH1063357 A JP H1063357A JP 8214528 A JP8214528 A JP 8214528A JP 21452896 A JP21452896 A JP 21452896A JP H1063357 A JPH1063357 A JP H1063357A
Authority
JP
Japan
Prior art keywords
time
bit
timer
pwm signal
pwm
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
JP8214528A
Other languages
Japanese (ja)
Inventor
Koji Nakamura
孝司 中村
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 Kiki Co Ltd
Original Assignee
Jidosha Kiki Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jidosha Kiki Co Ltd filed Critical Jidosha Kiki Co Ltd
Priority to JP8214528A priority Critical patent/JPH1063357A/en
Publication of JPH1063357A publication Critical patent/JPH1063357A/en
Pending legal-status Critical Current

Links

Landscapes

  • Power Sources (AREA)
  • Control Of Electrical Variables (AREA)
  • Control Of Ac Motors In General (AREA)

Abstract

PROBLEM TO BE SOLVED: To realize control being equivalent to that when one timer with multiple bit numbers is used by using two timers with a small number of bits and to utilize one of them for another control. SOLUTION: The two eight-bit timers are used for generating a PWM signal. The first eight-bit timer is used so as to repeatedly counts a fixed time T1(200μs) by the resolusion of 1μs. By the repetition of counting the fixed time T1, a value obtained by subtracting a fraction being indivisible by T1 of the on-time TON of a PWM cycle Tc(5ms) and the PWM signal is counted. Then, after the counting of the on-time TON of the PWM signal by the first eight-bit timer is ended, the remaining fraction is succeedingly counted by the second eight-bit timer.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、PWM制御によ
る定電流制御装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a constant current control device based on PWM control.

【0002】[0002]

【従来の技術】従来より、この種の定電流制御装置とし
て、図4にその要部を示すような車速感応型のパワース
テアリング装置がある。同図において、1は車速セン
サ、2は制御部、3はトランジスタ、4はソレノイド、
5は電流検出用抵抗である。制御部2は、基準電流算出
部2−1と、定電流制御部2−2と、ソレノイド電流検
出部2−3と、A/D変換部2−4と、デューティ比調
整部2−5と、PWM信号出力部2−6とを備えてい
る。
2. Description of the Related Art Conventionally, as a constant current control device of this kind, there is a vehicle speed sensitive type power steering device as shown in FIG. In the figure, 1 is a vehicle speed sensor, 2 is a control unit, 3 is a transistor, 4 is a solenoid,
5 is a current detecting resistor. The control unit 2 includes a reference current calculation unit 2-1, a constant current control unit 2-2, a solenoid current detection unit 2-3, an A / D conversion unit 2-4, and a duty ratio adjustment unit 2-5. , PWM signal output unit 2-6.

【0003】このパワーステアリング装置では、車速セ
ンサ1からの検出車速が制御部2の基準電流算出部2−
1へ与えられ、検出車速に応じた基準電流(目標電流)
が算出される。この目標電流はディジタル値として定電
流制御部2−2へ与えられる。一方、ソレノイド電流検
出部2−3は、ソレノイド4に流れている電流(実電
流)を検出する。この検出された実電流はA/D変換部
2−4を介しディジタル値として定電流制御部2−2へ
与えられる。
In this power steering device, the detected vehicle speed from the vehicle speed sensor 1 is used as a reference current calculation unit 2-
1. Reference current (target current) according to the detected vehicle speed
Is calculated. This target current is provided as a digital value to the constant current control unit 2-2. On the other hand, the solenoid current detector 2-3 detects the current (actual current) flowing through the solenoid 4. The detected actual current is supplied to the constant current control section 2-2 as a digital value via the A / D conversion section 2-4.

【0004】定電流制御部2−2は、基準電流算出部2
−1からの目標電流とA/D変換部2−4からの実電流
との差を求め、その差をデューティ比調整部2−5へ送
る。デューティ比調整部2−5は、定電流制御部2−2
からの目標電流と実電流との差に応じてデューティ比を
調整し、PWM信号出力部2−6へ送る。PWM信号出
力部2−6は、デューティ比調整部2−5からのデュー
ティ比によってそのオン時間TONが定まるパルス信号を
PWM信号とし(図5(b)参照)、このPWM信号を
所定の周期(PWM周期)Tcでトランジスタ3のベー
スへ送る。これにより、トランジスタ3のオン/オフ時
間が調整され、ソレノイド4への実電流が目標電流に合
致するように制御される。
The constant current control section 2-2 includes a reference current calculation section 2
The difference between the target current from -1 and the actual current from the A / D converter 2-4 is obtained, and the difference is sent to the duty ratio adjuster 2-5. The duty ratio adjustment unit 2-5 includes a constant current control unit 2-2.
The duty ratio is adjusted in accordance with the difference between the target current and the actual current, and sent to the PWM signal output unit 2-6. The PWM signal output unit 2-6 sets a pulse signal whose ON time T ON is determined by the duty ratio from the duty ratio adjustment unit 2-5 as a PWM signal (see FIG. 5B), and converts the PWM signal into a predetermined period. (PWM cycle) Send to the base of transistor 3 at Tc. As a result, the on / off time of the transistor 3 is adjusted, and control is performed so that the actual current to the solenoid 4 matches the target current.

【0005】ここで、PWM信号出力部2−6からのP
WM信号は、16ビットタイマ(図示せず)を使用し、
1μsの分解能で、PWM周期Tcを5msとして作ら
れる。すなわち、16ビットタイマでは、0〜215=6
5536までカウント可能であり、分解能を1μsとし
た場合、5ms=5000μsまで問題なくカウントす
ることができる。したがって、PWM信号出力部2−6
において、16ビットタイマを用いてPWM周期Tc=
5msを1μsの分解能で繰り返しカウントすれば、P
WM周期Tcのカウント開始時点(図5(a)に示すt
1点)でPWM信号を「H」レベルとし、TON時間カウ
ントした時点(図5(a)に示すt2点)でPWM信号
を「L」レベルとすることにより、図5(b)に示すよ
うなPWM信号を作ることができる。
Here, P from the PWM signal output unit 2-6
The WM signal uses a 16-bit timer (not shown),
The PWM period Tc is made 5 ms with a resolution of 1 μs. That is, in the 16-bit timer, 0 to 2 15 = 6
Counting up to 5536 is possible, and when the resolution is 1 μs, counting can be performed without any problem up to 5 ms = 5000 μs. Therefore, the PWM signal output unit 2-6
, Using a 16-bit timer, the PWM cycle Tc =
If 5 ms is repeatedly counted at a resolution of 1 μs, P
At the time when the counting of the WM cycle Tc starts (t shown in FIG.
The PWM signal is set to the "H" level at one point), and the PWM signal is set to the "L" level at the point of time when the T ON time is counted (point t2 shown in FIG. 5A), as shown in FIG. Such a PWM signal can be generated.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、このよ
うな従来のパワーステアリング装置によると、PWM信
号を作るために16ビットタイマを使用しているのでコ
ストアップとなる。なお、16ビットタイマに代えて8
ビットタイマを使用することが考えられるが、8ビット
タイマでは0〜27 =256までしかカウントすること
ができない。すなわち、8ビットタイマでは、分解能を
1μsとした場合、256μsまでしかカウントするこ
とができず、PWM周期Tcが短くなってしまう。分解
能を20μsとすれば、20μs×256=5120μ
sまでカウント可能とはなるが、すなわちPWM周期T
cを5msとすることができるが、16ビットタイマの
場合に比べて分解能が荒くなる。また、16ビットタイ
マに代えて、8ビットタイマを2本使用することが考え
られる。しかし、この2本の8ビットタイマを現在の1
6ビットタイマの様な使い方をしてまうと、専用のタイ
マになってしまうので、他の制御には利用することがで
きない。
However, according to such a conventional power steering apparatus, the cost is increased because a 16-bit timer is used to generate a PWM signal. Note that instead of a 16-bit timer, 8
Although it is conceivable to use a bit timer, an 8-bit timer can only count from 0 to 2 7 = 256. That is, when the resolution is 1 μs, the 8-bit timer can only count up to 256 μs, and the PWM cycle Tc becomes short. If the resolution is 20 μs, 20 μs × 256 = 5120 μ
s can be counted, that is, the PWM cycle T
Although c can be set to 5 ms, the resolution becomes rougher than in the case of the 16-bit timer. It is conceivable to use two 8-bit timers instead of the 16-bit timer. However, these two 8-bit timers are
If it is used like a 6-bit timer, it becomes a dedicated timer and cannot be used for other controls.

【0007】本発明はこのような課題を解決するために
なされたもので、その目的とするところは、ビット数の
少ないタイマを2本使用することによりビット数の多い
タイマを1本使用したと同等の制御を実現可能とし、す
なわちPWM周期を長く更に分解能を細かくとる制御を
実現可能とし、かつその内の1本を他の制御にも利用す
ることの可能な定電流制御装置を提供することにある。
The present invention has been made to solve such a problem, and an object of the present invention is to use one timer having a large number of bits by using two timers having a small number of bits. Provided is a constant current control device capable of realizing equivalent control, that is, realizing control in which a PWM cycle is made longer and resolution is made finer, and one of which can be used for another control. It is in.

【0008】[0008]

【課題を解決するための手段】このような目的を達成す
るために、本発明は、所定の周期でパルス信号(PWM
信号)を発生し、このパルス信号のオン時間TONを調整
することによって、負荷への電流を所望の値に制御する
定電流制御装置において、第1のタイマ手段と第2のタ
イマ手段とを設け、第1のタイマ手段で、一定時間T1
をカウントし、この一定時間T1のカウントの繰り返し
によって、パルス信号の周期(PWM周期)Tcおよび
パルス信号のオン時間TONの前記一定時間T1で割り切
れない端数を除いた値をカウントし、第2のタイマ手段
で、第1のタイマ手段によるパルス信号のオン時間TON
のカウント終了後、その残された端数を引き続いてカウ
ントするようにしたものである。この発明によれば、第
1のタイマ手段および第2のタイマ手段を例えば8ビッ
トタイマとした場合、第1の8ビットタイマが一定時間
T1(200μs)をカウントし、この一定時間T1の
カウントの繰り返しによって、PWM周期Tc(5m
s)およびPWM信号のオン時間TON(804μs)の
T1で割り切れない端数を除いた値(800μs)をカ
ウントする。そして、この第1の8ビットタイマによる
PWM信号のオン時間TONのカウント終了後、その残さ
れた端数(4μs)を第2の8ビットタイマが引き続い
てカウントする。
In order to achieve such an object, the present invention provides a pulse signal (PWM) having a predetermined period.
Signal, and adjusting the on-time T ON of the pulse signal to control the current to the load to a desired value. In the constant current control device, the first timer means and the second timer means Provided by the first timer means for a predetermined time T1.
By repeating the counting of the fixed time T1, a value excluding a fraction (division) of the pulse signal cycle (PWM cycle) Tc and the ON time T ON of the pulse signal that is not divisible by the fixed time T1 is counted. And the ON time T ON of the pulse signal by the first timer means.
After the end of the counting, the remaining fraction is continuously counted. According to the present invention, when the first timer means and the second timer means are, for example, 8-bit timers, the first 8-bit timer counts a fixed time T1 (200 μs), and counts the count of the fixed time T1. By the repetition, the PWM cycle Tc (5 m
s) and the value (800 μs) excluding a fraction of the ON time T ON (804 μs) of the PWM signal that is not divisible by T1. After the counting of the ON time T ON of the PWM signal by the first 8-bit timer is completed, the remaining fraction (4 μs) is continuously counted by the second 8-bit timer.

【0009】[0009]

【発明の実施の形態】以下、本発明を実施の形態に基づ
き詳細に説明する。この実施の形態では、PWM信号を
作るために、8ビットタイマを2本使用する。すなわ
ち、図4に示したパワーステアリング装置において、従
来はそのPWM信号出力部2−6において16ビットタ
イマを1本使用していたが、この16ビットタイマに代
えて8ビットタイマ(図示せず)を2本使用する。ここ
で、PWM信号出力部2−6からのPWM信号は、1μ
sの分解能で、PWM周期Tcを5msとし、かつ2本
の8ビットタイマの内の1本を他の制御にも利用できる
ようにする。以下、この2本の8ビットタイマを使用し
てのPWM信号の生成状況について、その基本原理を図
1を参照しながら説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail based on embodiments. In this embodiment, two 8-bit timers are used to generate a PWM signal. That is, in the power steering apparatus shown in FIG. 4, one 16-bit timer is conventionally used in the PWM signal output unit 2-6, but an 8-bit timer (not shown) is used instead of the 16-bit timer. Are used. Here, the PWM signal from the PWM signal output unit 2-6 is 1 μm.
With a resolution of s, the PWM cycle Tc is set to 5 ms, and one of the two 8-bit timers can be used for other control. Hereinafter, the basic principle of the generation of the PWM signal using the two 8-bit timers will be described with reference to FIG.

【0010】8ビットタイマでは0〜27 =256まで
カウントすることができる。そこで、第1の8ビットタ
イマを使用し、1μsの分解能で一定時間T1(200
μs)を繰り返しカウントする。この一定時間T1のカ
ウントの繰り返しによって、PWM周期Tc(5ms)
およびPWM信号のオン時間TONのT1で割り切れない
端数を除いた値をカウントする。そして、この第1の8
ビットタイマによるPWM信号のオン時間TONのカウン
ト終了後、その残された端数を第2の8ビットタイマで
引き続いてカウントする。
The 8-bit timer can count from 0 to 2 7 = 256. Therefore, the first 8-bit timer is used, and a fixed time T1 (200
μs) is counted repeatedly. The repetition of the count of the fixed time T1 causes the PWM cycle Tc (5 ms).
And a value excluding a fraction that is not divisible by T1 of the ON time T ON of the PWM signal. And this first 8
After the counting of the ON time T ON of the PWM signal by the bit timer is completed, the remaining fraction is continuously counted by the second 8-bit timer.

【0011】例えば、PWM信号のオン時間TONを80
4μsとした場合、PWM周期TcをT1によって除し
て得られる整数値25(=5ms/200μs)をαと
し、TON時間をT1によって除して得られる整数値4
(=804μs/200μs)をβとしてRAM(図示
せず)にセットし、T1によるTON時間の割り切れない
端数4(4μs)をγとして第2の8ビットタイマにセ
ットする。
For example, the ON time T ON of the PWM signal is set to 80
In the case of 4 μs, an integer value 25 (= 5 ms / 200 μs) obtained by dividing the PWM cycle Tc by T1 is α, and an integer value 4 obtained by dividing the T ON time by T1.
(= 804 μs / 200 μs) is set in the RAM (not shown) as β, and the indivisible fraction 4 (4 μs) of the T ON time by T1 is set in the second 8-bit timer as γ.

【0012】そして、PWM周期Tcのカウント開始時
点で(図1(a)に示すt1点)、PWM信号(図1
(d))を「H」レベルとし、第1の8ビットタイマに
よるT1時間のカウント毎にαおよびβをカウントダウ
ンし(図1(a)および(b))、βが0となった時点
で(図1(b)に示すt2点)、第2の8ビットタイマ
を動作状態とする。そして、この第2の8ビットタイマ
により、1μs毎にγのカウントダウンを行ない、γが
0となった時点で(図1(c)に示すt3点)、PWM
信号を「L」レベルとする。なお、PWM信号を「L」
レベルとした後は、第2の8ビットタイマは動作停止と
する。そして、αが0となった時点(図1(a)に示す
t4点)を次のPWM周期Tcのカウント開始時点とし
て、上述した動作を繰り返す。
At the time when the counting of the PWM cycle Tc starts (point t1 shown in FIG. 1A), the PWM signal (FIG.
(D)) is set to the “H” level, and α and β are counted down every time the T1 time is counted by the first 8-bit timer (FIGS. 1 (a) and (b)). (Point t2 shown in FIG. 1B), the second 8-bit timer is set to the operating state. The second 8-bit timer counts down γ every 1 μs, and when γ becomes 0 (point t3 shown in FIG. 1C), PWM
The signal is set to “L” level. Note that the PWM signal is set to “L”.
After setting the level, the operation of the second 8-bit timer is stopped. Then, the above-described operation is repeated with the time when α becomes 0 (time t4 shown in FIG. 1A) as the time when the next PWM cycle Tc starts counting.

【0013】以上の説明から分かるように、この実施の
形態では、2本の8ビットタイマを使用することによっ
て、16ビットタイマを1本使用したと同等の制御が実
現される。すなわち、PWM周期Tcを5msとし、分
解能を1μsとする制御が実現される。また、この実施
の形態によれば、第1の8ビットタイマが常に一定時間
T1=200μsをカウントしているので、この第1の
8ビットタイマを他の制御にも使用することができる。
例えば、車速検出に際し、その車速パルスの周期測定用
のタイマとして使用することができる。
As can be seen from the above description, in this embodiment, by using two 8-bit timers, control equivalent to using one 16-bit timer is realized. That is, control is performed in which the PWM cycle Tc is set to 5 ms and the resolution is set to 1 μs. Also, according to this embodiment, the first 8-bit timer always counts the fixed time T1 = 200 μs, so that the first 8-bit timer can be used for other controls.
For example, when detecting the vehicle speed, it can be used as a timer for measuring the cycle of the vehicle speed pulse.

【0014】次に、図2および図3に示すフローチャー
トを参照しながら、制御部2での具体的な処理動作につ
いて説明する。図2(a)はメインルーチンであり、初
期設定の後(ステップ201)、車速検出を行い(ステ
ップ202)、その検出車速に応ずる基準電流(目標電
流)をディジタル値として求める(ステップ203)。
Next, a specific processing operation in the control unit 2 will be described with reference to flowcharts shown in FIGS. FIG. 2A shows a main routine. After the initial setting (step 201), the vehicle speed is detected (step 202), and a reference current (target current) corresponding to the detected vehicle speed is obtained as a digital value (step 203).

【0015】今、図1におけるt1点にあって、第1の
8ビットタイマ(TIMER1)が200μsをカウン
トアップしたとする。すると、TIMER1割り込みが
かかり、ソレノイド電流(実電流)のA/D変換を開始
する(図3に示すステップ301)。そして、「α←α
−1」とし(ステップ302)、α=0か否かをチェッ
クする(ステップ303)。この場合、それまでのTI
MER1割り込みによるカウントダウンにより、このT
IMER1割り込み時点ではα=1とされているので、
ステップ302ではα=0とされる。したがって、ステ
ップ303でのYESに応じて、ステップ304へ進
む。
Assume that the first 8-bit timer (TIMER1) has counted up 200 μs at the point t1 in FIG. Then, a TIMER1 interrupt occurs, and A / D conversion of the solenoid current (actual current) is started (step 301 shown in FIG. 3). Then, “α ← α
−1 ”(step 302), and it is checked whether α = 0 (step 303). In this case, the previous TI
By counting down by the MER1 interrupt, this T
Since α = 1 is set at the time of the IMER1 interrupt,
In step 302, α = 0 is set. Therefore, the process proceeds to step 304 in response to YES in step 303.

【0016】ステップ304ではPWM信号を「H」レ
ベルとする。そして、ステップ305へ進み、PWM周
期TcをT1で除して得られる整数値25(=5ms/
200μs)をαとしてセットする。また、β=15,
γ=0としてセットし(ステップ306,307)、周
期フラグをセットのうえ(ステップ308)、ステップ
309へ進む。
In step 304, the PWM signal is set to "H" level. Then, the process proceeds to step 305, where an integer value 25 (= 5 ms / 5) obtained by dividing the PWM cycle Tc by T1.
200 μs) is set as α. Also, β = 15,
γ = 0 is set (steps 306 and 307), the cycle flag is set (step 308), and the process proceeds to step 309.

【0017】ステップ309ではPWM信号が「H」レ
ベルか否かをチェックする。この場合、PWM信号は先
のステップ304で「H」レベルとされているので、ス
テップ310へ進む。ステップ310ではβ=0か否か
をチェックする。この場合、先のステップ306でβ=
15とされているので、ステップ310でのNOに応
じ、ステップ313へ進んで「β←β−1」としたう
え、ステップ314へ進む。
In step 309, it is checked whether the PWM signal is at "H" level. In this case, since the PWM signal has been set to the “H” level in the previous step 304, the process proceeds to step 310. In step 310, it is checked whether β = 0. In this case, β =
Since it is set to 15, the process proceeds to step 313 in response to NO in step 310 to set “β ← β−1”, and then proceeds to step 314.

【0018】ステップ314ではソレノイド電流のA/
D変換の終了をチェックする。ソレノイド電流のA/D
変換が終了すれば、そのソレノイド電流のA/D変換値
を「SOLCOUNT」と加算し、新たなる「SOLC
OUNT」を得る(ステップ315)。これにより、
「SOLCOUNT」は、前回のPWM周期Tc中での
200μs毎のソレノイド電流のA/D変換値の合計値
とされる。
At step 314, the solenoid current A /
Check the end of D conversion. A / D of solenoid current
When the conversion is completed, the A / D conversion value of the solenoid current is added to “SOLCOUNT” and a new “SOLC
OUNT ”is obtained (step 315). This allows
“SOLCOUNT” is the total value of the A / D conversion values of the solenoid current every 200 μs during the previous PWM cycle Tc.

【0019】そして、ステップ316へ進み、周期フラ
グがセットされているか否かをチェックする。この場
合、先のステップ308で周期フラグがセットされてい
るので、ステップ316でのYESに応じステップ31
7へ進む。ステップ317では周期フラグをリセットす
る。そして、ステップ318へ進み、「SOLCOUN
T」を「SOLSUM」とする。そして、「SOLCO
UNT」を0としたうえ(ステップ319)、先のステ
ップ203で得た目標電流のA/D変換値と「SOLS
UM」との差を求め、すなわち目標電流と実電流との差
を求め、その差をSAとする(ステップ320)。
Then, the program proceeds to a step 316, wherein it is checked whether or not the period flag is set. In this case, since the cycle flag has been set in the previous step 308, the process proceeds to step 31 in response to YES in step 316.
Proceed to 7. In step 317, the cycle flag is reset. Then, the process proceeds to step 318, where "SOLCOUN"
T ”is“ SOLSUM ”. And "SOLCO
UNT ”is set to 0 (step 319), and the A / D conversion value of the target current obtained in the previous step 203 and“ SOLS
UM ”, that is, the difference between the target current and the actual current is obtained, and the difference is set as SA (step 320).

【0020】そして、SA=0か否かをチェックし(ス
テップ321)、SA=0であれば直ちにステップ32
5へ進み、SA=0でなければステップ322へ進む。
ステップ322では、実電流と目標電流との大小をチェ
ックし、目標電流>実電流であればステップ323へ進
み、目標電流≦実電流であればステップ324へ進む。
Then, it is checked whether or not SA = 0 (step 321). If SA = 0, step 32 is immediately executed.
Then, the process proceeds to step 322 unless SA = 0.
In step 322, the magnitude of the actual current and the target current is checked. If the target current> the actual current, the process proceeds to step 323. If the target current ≦ the actual current, the process proceeds to step 324.

【0021】ステップ323では、前回のPWM周期で
のPWM信号のオン時間TONに目標電流と実電流との差
SAに応じた時間TSAを加算し、今回のPWM周期での
PWM信号のオン時間TONとする。また、ステップ32
4では、前回のPWM周期でのPWM信号のオン時間T
ONから目標電流と実電流との差SAに応じた時間TSA
減算し、今回のPWM周期でのPWM信号のオン時間T
ONとする。ステップ325では、今回のPWM周期での
PWM信号のオン時間TONをT1(=200μs)で除
し、これによって得られる整数値をβとし、割り切れな
い端数をγとしてセットする。この場合、TON=804
μsとすれば、β=4、γ=4として得られる。
In step 323, the time T SA corresponding to the difference SA between the target current and the actual current is added to the on-time T ON of the PWM signal in the previous PWM cycle, and the PWM signal is turned on in the current PWM cycle. Time T ON . Step 32
4, the on-time T of the PWM signal in the previous PWM cycle
The time T SA in accordance with the difference SA between the target current and the actual current is subtracted from ON, the ON time of the PWM signal in the current PWM period T
Set to ON . In step 325, the on-time T ON of the PWM signal in the current PWM cycle is divided by T1 (= 200 μs), the resulting integer value is set as β, and the indivisible fraction is set as γ. In this case, T ON = 804
If μs, β = 4 and γ = 4 are obtained.

【0022】第1の8ビットタイマ(TIMER1)が
次の200μsをカウントアップすると、ステップ30
1を経たステップ302において、「α←α−1」とさ
れる。この場合、先のステップ305でα=25として
セットされているので、α=24となる。したがって、
ステップ303でのNOに応じ、直ちにステップ309
へへ進む。そして、ステップ309でのYESに応じて
ステップ310へ進み、ステップ310でのNOに応じ
てステップ313へ進み、「β←β−1」とする。この
場合、先のステップ325においてβ=4とされている
ので、ステップ313ではβ=4−1=3とされる。
When the first 8-bit timer (TIMER1) counts up the next 200 μs, step 30
In step 302 after 1, “α ← α−1” is set. In this case, since α = 25 was set in the previous step 305, α = 24. Therefore,
In response to NO in step 303, step 309 is immediately executed.
Proceed to. Then, the process proceeds to step 310 in response to YES in step 309, and proceeds to step 313 in response to NO in step 310, where "β ← β-1" is set. In this case, since β = 4 in the previous step 325, β = 4-1 = 3 in step 313.

【0023】そして、ステップ314において、ソレノ
イド電流のA/D変換が終了すれば、そのソレノイド電
流のA/D変換値を「SOLCOUNT」と加算し、新
たなる「SOLCOUNT」とする。この場合、先のス
テップ319にて「SOLCOUNT」は0とされてい
るので、ステップ315で得られる「SOLCOUN
T」は今回のPWM周期Tc中の最初の200μsでの
ソレノイド電流のA/D変換値とされる。そして、ステ
ップ316へ進み、周期フラグがセットされているか否
かをチェックする。この場合、先のステップ317で周
期フラグがリセットされているので、ステップ317以
降の処理へは進まず、メインルーチンへリターンする。
Then, in step 314, when the A / D conversion of the solenoid current is completed, the A / D conversion value of the solenoid current is added to "SOLCOUNT" to obtain a new "SOLCOUNT". In this case, since “SOLCOUNT” is set to 0 in the previous step 319, “SOLCOUNT” obtained in step 315 is obtained.
“T” is the A / D converted value of the solenoid current in the first 200 μs during the current PWM cycle Tc. Then, the process proceeds to a step 316, wherein it is checked whether or not the period flag is set. In this case, since the cycle flag has been reset in the previous step 317, the process does not proceed to the processes after step 317, and returns to the main routine.

【0024】以下同様にして、第1の8ビットタイマが
200μsをカウントする毎に、上述した動作を繰り返
す。これにより、200μsが経過する毎に、ステップ
313においてβがカウントダウンされて行く。ここ
で、β=0となると、すなわち図1におけるt1時点よ
り800μsが経過すると、ステップ310でのYES
に応じてステップ311へ進み、第2の8ビットタイマ
(TIMER2)のカウントが開始される(第1図
(c)に示すt2点)。そして、この第2の8ビットタ
イマの割り込みが許可されて(ステップ312)、ステ
ップ314以降の処理へと移行する。
In the same manner, the above operation is repeated every time the first 8-bit timer counts 200 μs. Thus, every time 200 μs elapses, β is counted down in step 313. Here, when β = 0, that is, when 800 μs has elapsed from the time t1 in FIG. 1, YES in step 310
Then, the process proceeds to step 311 to start counting of the second 8-bit timer (TIMER2) (point t2 shown in FIG. 1 (c)). Then, the interruption of the second 8-bit timer is permitted (step 312), and the processing shifts to the processing after step 314.

【0025】第2の8ビットタイマのカウントが開始さ
れ、先のステップ325で求められたγで規定される4
μsが経過すると、TIMER2割り込みがかかり、P
WM信号が「L」レベルとされる(図2(b)に示すス
テップ401:図1(d)におけるt3点)。そして、
第2の8ビットタイマの割り込みが禁止され(ステップ
402)、第2の8ビットタイマのカウントが停止され
る(ステップ403)。
The count of the second 8-bit timer is started, and the count defined by γ obtained in step 325 is 4
After elapse of μs, a TIMER2 interrupt is generated and P
The WM signal is set to the “L” level (step 401 shown in FIG. 2B: point t3 in FIG. 1D). And
The interruption of the second 8-bit timer is prohibited (step 402), and the counting of the second 8-bit timer is stopped (step 403).

【0026】一方、第1の8ビットタイマは一定時間T
1のカウントを繰り返し、200μs経過する毎にステ
ップ302においてαがカウントダウンされて行く。こ
こで、α=0となると、すなわち図1におけるt1時点
より5msが経過すると、ステップ303でのYESに
応じてステップ304へ進み、PWM信号を「H」レベ
ルとする(図1(d)に示すt4点)。
On the other hand, the first 8-bit timer has a predetermined time T
The count of 1 is repeated, and every time 200 μs elapses, α is counted down in step 302. Here, when α = 0, that is, when 5 ms has elapsed from the time point t1 in FIG. 1, the process proceeds to step 304 in response to YES in step 303, and the PWM signal is set to the “H” level (see FIG. 1D). T4 point shown).

【0027】なお、上述した実施の形態では、16ビッ
トタイマを1本使用したと同等の制御を実現するものと
して、8ビットタイマを2本使用した場合の使用状況に
ついて説明した。これと同じ技術を利用すれば、32ビ
ットタイマを1本使用したと同等の制御を2本の16ビ
ットタイマで実現することが可能となるし、8ビットタ
イマを1本使用したと同等の制御を2本の4ビットタイ
マで実現することが可能となる。また、上述した実施の
形態では、パワーステアリング装置への適用例として説
明したが、パワーステアリング装置に限るものではな
く、PWM制御による各種の定電流制御装置に適用する
ことが可能である。
In the above-described embodiment, assuming that the same control as that of using one 16-bit timer is realized, the use situation in the case of using two 8-bit timers has been described. If the same technology is used, the same control as using one 32-bit timer can be realized with two 16-bit timers, and the same control as using one 8-bit timer can be realized. Can be realized by two 4-bit timers. Further, in the above-described embodiment, an example of application to a power steering device has been described. However, the present invention is not limited to the power steering device, and can be applied to various constant current control devices based on PWM control.

【0028】[0028]

【発明の効果】以上説明したことから明らかなように本
発明によれば、第1のタイマ手段および第2のタイマ手
段を例えば8ビットタイマとした場合、第1の8ビット
タイマが一定時間T1をカウントし、この一定時間T1
のカウントの繰り返しによって、PWM周期およびPW
M信号のオン時間TONのT1で割り切れない端数を除い
た値をカウントし、この第1の8ビットタイマによるP
WM信号のオン時間TONのカウント終了後、その残され
た端数を第2の8ビットタイマが引き続いてカウントす
るので、16ビットタイマを1本使用したと同等の制御
が実現可能となり、すなわちPWM周期を長く更に分解
能を細かくとる制御が実現可能となり、かつその内の1
本を他の制御にも利用することが可能となる。
As apparent from the above description, according to the present invention, when the first timer means and the second timer means are, for example, 8-bit timers, the first 8-bit timer is set to the predetermined time T1. Is counted, and this fixed time T1
, The PWM cycle and the PWM
Count the value of the ON time T ON of the M signal excluding a fraction that is not divisible by T 1, and calculate the value of P by the first 8-bit timer.
After the counting of the ON time T ON of the WM signal is completed, the remaining fraction is continuously counted by the second 8-bit timer, so that the same control as using one 16-bit timer can be realized. It is possible to realize a control in which the period is made longer and the resolution is made finer.
The book can be used for other controls.

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

【図1】 本発明において8ビットタイマを2本使用し
てのPWM信号の生成状況を説明するためのタイムチャ
ートである。
FIG. 1 is a time chart for explaining a generation state of a PWM signal using two 8-bit timers in the present invention.

【図2】 制御部での具体的な処理動作を説明するため
のフローチャート(メインルーチン、TIMER2割り
込み処理ルーチン)である。
FIG. 2 is a flowchart (main routine, TIMER2 interrupt processing routine) for explaining a specific processing operation in a control unit.

【図3】 制御部での具体的な処理動作を説明するため
のフローチャート(TIMER1割り込み処理ルーチ
ン)である。
FIG. 3 is a flowchart (TIMER1 interrupt processing routine) for describing a specific processing operation in a control unit.

【図4】 従来および本発明に係るパワーステアリング
装置の要部を示すブロック図である。
FIG. 4 is a block diagram illustrating a main part of a power steering apparatus according to the related art and the present invention.

【図5】 従来において16ビットタイマを1本使用し
てのPWM信号の生成状況を説明するためのタイムチャ
ートである。
FIG. 5 is a time chart for explaining a generation state of a PWM signal using one 16-bit timer in the related art.

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

1…車速センサ、2…制御部、3…トランジスタ、4…
ソレノイド、5…電流検出用抵抗、2−1…基準電流算
出部、2−2…定電流制御部、2−3…ソレノイド電流
検出部、2−4…A/D変換部、2−5…デューティ比
調整部、2−6…PWM信号出力部。
DESCRIPTION OF SYMBOLS 1 ... Vehicle speed sensor, 2 ... Control part, 3 ... Transistor, 4 ...
Solenoid, 5: Current detection resistor, 2-1: Reference current calculation unit, 2-2: Constant current control unit, 2-3: Solenoid current detection unit, 2-4: A / D conversion unit, 2-5 ... Duty ratio adjustment unit, 2-6... PWM signal output unit.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 所定の周期でパルス信号を発生し、この
パルス信号のオン時間TONを調整することによって、負
荷への電流を所望の値に制御する定電流制御装置におい
て、 一定時間T1をカウントし、この一定時間T1のカウン
トの繰り返しによって、前記パルス信号の周期Tcおよ
び前記パルス信号のオン時間TONの前記一定時間T1で
割り切れない端数を除いた値をカウントする第1のタイ
マ手段と、 この第1のタイマ手段による前記パルス信号のオン時間
ONのカウント終了後、その残された端数を引き続いて
カウントする第2のタイマ手段とを備えたことを特徴と
する定電流制御装置。
1. A constant current control device that generates a pulse signal at a predetermined cycle and adjusts the ON time T ON of the pulse signal to control a current to a load to a desired value. A first timer means for counting and counting a value obtained by repeating the counting of the fixed time T1, excluding a period Tc of the pulse signal and a fraction of the ON time T ON of the pulse signal which is not divisible by the fixed time T1. And a second timer means for continuously counting the remaining fraction after the end of counting the ON time T ON of the pulse signal by the first timer means.
【請求項2】 請求項1において、第1および第2のタ
イマ手段が8ビットのタイマであることを特徴とする定
電流制御装置。
2. The constant current control device according to claim 1, wherein said first and second timer means are 8-bit timers.
JP8214528A 1996-08-14 1996-08-14 Constant current controller Pending JPH1063357A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8214528A JPH1063357A (en) 1996-08-14 1996-08-14 Constant current controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8214528A JPH1063357A (en) 1996-08-14 1996-08-14 Constant current controller

Publications (1)

Publication Number Publication Date
JPH1063357A true JPH1063357A (en) 1998-03-06

Family

ID=16657227

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8214528A Pending JPH1063357A (en) 1996-08-14 1996-08-14 Constant current controller

Country Status (1)

Country Link
JP (1) JPH1063357A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7779288B2 (en) 2007-03-19 2010-08-17 Kabushiki Kaisha Toshiba High resolution timer circuit and time count method for suppressing increase in storage capacity

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7779288B2 (en) 2007-03-19 2010-08-17 Kabushiki Kaisha Toshiba High resolution timer circuit and time count method for suppressing increase in storage capacity

Similar Documents

Publication Publication Date Title
JPS5815476A (en) Speed controlling system for motor
JPH1063357A (en) Constant current controller
JPS593626Y2 (en) frequency. voltage conversion circuit
JPH0511786B2 (en)
JPH0457092B2 (en)
JPS5615192A (en) Input pulse frequency controller for stepping motor
JP3213796B2 (en) Servo motor controller
JPH0136286Y2 (en)
JP3567628B2 (en) Servo controller
JPH08116693A (en) Drive circuit of stepping motor
JP3072601B2 (en) Charged particle beam accelerator
JPS55153296A (en) Method for controlling speed of pulse motor
JPS5816810B2 (en) AD conversion device
JPH06211153A (en) Actuator control device of vehicle
JPH0442882B2 (en)
JP2550649Y2 (en) Trigger signal generation circuit
JPH0756382B2 (en) How to adjust the inflow gas pressure of the water heater
JPH0196561A (en) Dc voltage generating circuit
JP2001124793A (en) Vehicle speed measuring method
JPS55153297A (en) Method for controlling speed of pulse motor
JPH05133975A (en) Reading device for output of accelerometer
JPH082188B2 (en) Motor speed control method
JPH0558903B2 (en)
JPH0360392A (en) Speed control circuit of dc motor
JPH02114895A (en) Drive