JPH064170A - Controller - Google Patents

Controller

Info

Publication number
JPH064170A
JPH064170A JP4163102A JP16310292A JPH064170A JP H064170 A JPH064170 A JP H064170A JP 4163102 A JP4163102 A JP 4163102A JP 16310292 A JP16310292 A JP 16310292A JP H064170 A JPH064170 A JP H064170A
Authority
JP
Japan
Prior art keywords
microcomputer
value
output
control
port
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
JP4163102A
Other languages
Japanese (ja)
Inventor
Naoyuki Oki
尚之 大木
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP4163102A priority Critical patent/JPH064170A/en
Publication of JPH064170A publication Critical patent/JPH064170A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To apply control with high accuracy and high efficiency without using the interrupt function of a microcomputer by reading in the output of time measurement initialized repeatedly and restarted by a timing pulse signal, and correcting a control timing corresponding to a read in value. CONSTITUTION:The microcomputer 10 is programmed so as to check an input port I1 for at least one time in the period of low level of a zero cross signal. When the input port I1 is checked in the period of low level, the output of an operational amplifier 32 at that time is read in from the analog input AN2 of the microcomputer 10. A value corrected according to the read in value is set on a timer incorporated in the microcomputer, and a trigger pulse is outputted from an output port O1 when time is up, and the ignition control of a triac 8 is performed by driving a transistor 11. In such a way, since a timer value is set by applying appropriate correction, phase control can be performed with high accuracy.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、タイミングパルス信号
をマイクロコンピュータに供給し、マイクロコンピュー
タがこのタイミングパルスに同期して制御を行う制御装
置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control device which supplies a timing pulse signal to a microcomputer and the microcomputer controls in synchronization with the timing pulse.

【0002】[0002]

【従来の技術】従来からこの種の制御装置において、タ
イミングパルス信号に対する制御の同期精度が要求され
る場合には、そのタイミングパルスをマイクロコンピュ
ータの割り込み端子に入力するなどして、処理の優先度
を高めて対応していた。
2. Description of the Related Art Conventionally, in a control device of this kind, when the synchronization accuracy of control with respect to a timing pulse signal is required, the timing pulse is input to an interrupt terminal of a microcomputer so that the priority of processing is Was raised to correspond.

【0003】また、割り込み端子のないマイクロコンピ
ュータや、他の目的に割り込み端子を使用している場合
は、通常のポートにタイミングパルス信号を入力して、
プログラムにより常時ポートを監視するように構成して
いた。
When a microcomputer without an interrupt terminal or an interrupt terminal is used for other purposes, a timing pulse signal is input to a normal port,
The program was configured to constantly monitor the port.

【0004】[0004]

【発明が解決しようとする課題】しかし、ポートを常時
監視するようにした従来の構成においては、マイクロコ
ンピュータの処理が監視のために費やされ、他の処理が
実行できなくなることから、処理の効率が低下するとい
う問題があった。
However, in the conventional configuration in which the port is constantly monitored, the processing of the microcomputer is spent for monitoring, and other processing cannot be executed. There was a problem of reduced efficiency.

【0005】よって本発明の目的は上述の点に鑑み、マ
イクロコンピュータの割り込み機能を使用することな
く、高精度かつ効率の良い制御を可能とした制御装置を
提供することにある。
Therefore, in view of the above points, an object of the present invention is to provide a control device which enables highly accurate and efficient control without using the interrupt function of a microcomputer.

【0006】[0006]

【課題を解決するための手段】かかる目的を達成するた
めに、本発明はタイミングパルスを入力し、該タイミン
グパルスに同期した制御を行う、マイクロコンピュータ
を含む制御装置において、前記タイミングパルス信号に
より繰り返し初期化され再スタートする時間計測手段
と、前記時間計測手段の計測出力を読み込み、当該計測
出力値に応じて制御タイミングを補正する制御手段とを
有するものである。
In order to achieve the above object, the present invention is a control device including a microcomputer for inputting a timing pulse and performing control in synchronization with the timing pulse, which is repeated by the timing pulse signal. It has a time measuring unit that is initialized and restarted, and a control unit that reads the measurement output of the time measuring unit and corrects the control timing according to the measured output value.

【0007】また、その他の本発明はタイミングパルス
を入力し、該タイミングパルスに同期した制御を行う、
マイクロコンピュータを含む制御装置において、前記タ
イミングパルス信号により繰り返し初期化され再スター
トする時間計測手段と、前記時間計測手段の計測出力を
読み込み、当該計測出力値と外部より半固定的に入力さ
れる設定値に応じて制御タイミングを補正する制御手段
とを有するものである。
According to another aspect of the present invention, a timing pulse is input and control is performed in synchronization with the timing pulse.
In a control device including a microcomputer, a time measurement unit that is repeatedly initialized and restarted by the timing pulse signal, and a setting that reads the measurement output of the time measurement unit and semi-fixedly inputs the measurement output value from the outside. And control means for correcting the control timing according to the value.

【0008】[0008]

【作用】本発明では、タイミングパルス信号により繰り
返し初期化され再スタートする時間計測手段からの計測
出力を読み込み、その読み込んだ値に応じて制御タイミ
ングを補正するものである。
In the present invention, the measurement output from the time measuring means which is repeatedly initialized and restarted by the timing pulse signal is read, and the control timing is corrected according to the read value.

【0009】また、その他の本発明では、タイミングパ
ルス信号により繰り返し初期化され再スタートする時間
計測手段からの計測出力を読み込み、その読み込んだ値
と別の半固定的に入力される設定値とに応じて制御タイ
ミングを補正するものである。
Further, in another aspect of the present invention, the measurement output from the time measuring means which is repeatedly initialized and restarted by the timing pulse signal is read, and the read value and another semi-fixed set value are input. The control timing is corrected accordingly.

【0010】[0010]

【実施例】以下、本発明の実施例を詳細に説明する。EXAMPLES Examples of the present invention will be described in detail below.

【0011】実施例1 図1は、本発明の実施例を説明するために、その前提と
なる技術をまず説明するための図である。本発明の各実
施例では、ランプ制御回路6に特色を有しているが、本
図では以下の説明の都合上、一般的なランプ制御回路を
示してある。
Embodiment 1 FIG. 1 is a diagram for explaining a technique as a premise for explaining an embodiment of the present invention. In each of the embodiments of the present invention, the lamp control circuit 6 has a characteristic, but in this figure, a general lamp control circuit is shown for convenience of the following description.

【0012】図1において、1は商用電源のコンセント
と接続するためのプラグである。2は、安全装置として
の電流ヒューズ、3はノイズフィルタ、4は電源スイッ
チである。5はDC電源回路であり、商用電源から+5
Vdcと、±12Vdcをランプ制御回路6に供給して
いる。このランプ制御回路6は、外部のコントロール信
号により、ON/OFFが制御されるほか、点灯電圧も
制御される。
In FIG. 1, reference numeral 1 is a plug for connecting to an outlet of a commercial power source. 2 is a current fuse as a safety device, 3 is a noise filter, and 4 is a power switch. 5 is a DC power supply circuit, which is +5 from the commercial power supply.
Vdc and ± 12 Vdc are supplied to the lamp control circuit 6. The lamp control circuit 6 is ON / OFF-controlled by an external control signal, and the lighting voltage is also controlled.

【0013】7はハロゲンランプ、8はトライアック、
9はトリガ回路である。10はマイクロコンピュータ、
11はトリガ回路を駆動するためのトランジスタであ
る。
7 is a halogen lamp, 8 is a triac,
Reference numeral 9 is a trigger circuit. 10 is a microcomputer,
Reference numeral 11 is a transistor for driving the trigger circuit.

【0014】次に動作の説明を行う。プラグ1より供給
されたAC電圧は、ヒューズ2,ノイズフィルタ3,電
源スイッチ4を通じて、ハロゲンランプ7とトライアッ
ク8の両端に供給される。
Next, the operation will be described. The AC voltage supplied from the plug 1 is supplied to both ends of the halogen lamp 7 and the triac 8 through the fuse 2, the noise filter 3 and the power switch 4.

【0015】マイクロコンピュータ10には、入力ポー
トI2 に入力されるON/OFF信号と、アナログ入力
(マイクロコンピュータ内蔵A/Dコンバータの入力)
AN1 に入力される制御電圧指令信号に応じて、入力ポ
ートI1 に入力されるゼロクロス信号に同期した位相制
御のためのトリガタイミングパルスを出力ポートO1
ら出力するためのプログラムが、内蔵ROMに書き込ま
れている。
The microcomputer 10 has an ON / OFF signal input to the input port I 2 and an analog input (input of the microcomputer built-in A / D converter).
According to the control voltage command signal inputted to AN 1, a program for outputting a trigger timing pulse for phase control in synchronism with the zero-cross signal which is input to the input port I 1 from the output port O 1 is built-in ROM Is written in.

【0016】マイクロコンピュータ10の出力ポートO
1 より出力されたパルスによりトランジスタ11は駆動
され、トリガ回路9によりトライアック8をトリガし
て、ハロゲンランプ7に電圧が印加される。
Output port O of the microcomputer 10
The pulse output from 1 drives the transistor 11, the trigger circuit 9 triggers the triac 8, and a voltage is applied to the halogen lamp 7.

【0017】図2は、トライアック8をトリガするため
のタイミングを説明した図である。本図において21
は、プラグ1より供給されるAC波形である。22は、
DC電源5に内蔵されるゼロクロス検出回路の出力波形
である。この波形は、AC波形21のゼロクロスタイミ
ングの前後を挾んで所定の幅のローレベル期間を有して
いる。23は、ゼロクロス波形22の立ち下がりから、
マイクロコンピュータ10により計算された所定の時間
後に出力される、トリガパルスの波形である。
FIG. 2 is a diagram for explaining the timing for triggering the triac 8. 21 in this figure
Is an AC waveform supplied from the plug 1. 22 is
It is an output waveform of the zero-cross detection circuit built in the DC power supply 5. This waveform has a low level period of a predetermined width across the zero cross timing of the AC waveform 21. 23 is the trailing edge of the zero-cross waveform 22,
It is a waveform of a trigger pulse output after a predetermined time calculated by the microcomputer 10.

【0018】24は、トライアック8の点弧によりハロ
ゲンランプ7に印加される電圧の波形を示している。こ
のように、ゼロクロス波形22の立ち下がりから、トリ
ガパルス23の出力タイミングを変化することで、負荷
に印加される実効電圧を制御することは位相制御として
知られている。この時、所望の実効電圧を精度良く得る
ためには、ゼロクロス波形の立ち下がりを精度良く検出
して、トリガパルスの出力タイミングを正確に制御して
やる必要がある。
Reference numeral 24 shows the waveform of the voltage applied to the halogen lamp 7 by the ignition of the triac 8. Thus, controlling the effective voltage applied to the load by changing the output timing of the trigger pulse 23 from the trailing edge of the zero-cross waveform 22 is known as phase control. At this time, in order to accurately obtain a desired effective voltage, it is necessary to accurately detect the falling edge of the zero-cross waveform and accurately control the output timing of the trigger pulse.

【0019】このため、従来はゼロクロス信号をマイク
ロコンピュータの割り込み端子などに入力し、精度良く
検出し、マイクロコンピュータ内蔵のタイマに出力タイ
ミングに応じた値を設定して、タイムアップ後にトリガ
出力を行うように設計していた。しかし、一般に、マイ
クロコンピュータの割り込み端子には限りがあり、他の
用途に使用している場合などや、平行してタイミングの
重要な処理をマイクロコンピュータが行っている場合な
ど、割り込み端子の使用を避けたい場合がある。このよ
うな場合には、ゼロクロス信号を通常の入力ポートに接
続することになる。
For this reason, conventionally, a zero-cross signal is input to an interrupt terminal of a microcomputer, detected accurately, a value according to the output timing is set in a timer built in the microcomputer, and a trigger output is performed after the time is up. Was designed to. However, in general, the interrupt pin of the microcomputer is limited, and it is recommended to use the interrupt pin when it is used for other purposes or when the microcomputer performs important timing processing in parallel. There are times when you want to avoid it. In such a case, the zero-cross signal will be connected to a normal input port.

【0020】この場合、精度良くゼロクロス波形の立ち
下がりを知るには、頻繁にポートの監視をソフトウェア
により行わなければならない。従って、平行してタイミ
ングの重要な処理をしている場合には、互いに満足する
ような条件に設計することがソフトウェアの設計の問題
点となり、設計の自由度を狭めることになり、また、あ
る程度のタイミングの遅れを認めなければならないこと
になる。しかし、この遅れが、実効電圧の精度にそのま
ま影響するので、精度の必要な場合にも対応できるよう
にするため、以下に詳述する本実施例においては、検知
タイミングの遅れを補正する手段を追加したものであ
る。以下に、その詳細を説明する。
In this case, in order to accurately detect the falling edge of the zero-cross waveform, the port must be frequently monitored by software. Therefore, when important timing processing is performed in parallel, designing under conditions that satisfy each other becomes a problem in software design, narrowing the degree of freedom in design, and to some extent. You will have to admit the timing delay. However, since this delay directly affects the accuracy of the effective voltage, in order to be able to deal with the case where the accuracy is required, in this embodiment described in detail below, a means for correcting the delay of the detection timing is provided. It was added. The details will be described below.

【0021】図3は、本発明の一実施例によるランプ制
御回路6の内部回路を示す図である。本図において、6
はランプ制御回路全体、10はマイクロコンピュータ、
11はパルス駆動用トランジスタ、31はゼロクロス波
形のハイの区間でONとなるトランジスタ、32は積分
回路を構成するオペアンプ、33は調整用のボリューム
である。
FIG. 3 is a diagram showing an internal circuit of the lamp control circuit 6 according to one embodiment of the present invention. In this figure, 6
Is the entire lamp control circuit, 10 is a microcomputer,
Reference numeral 11 is a pulse driving transistor, 31 is a transistor that is turned on in a high section of the zero-cross waveform, 32 is an operational amplifier forming an integrating circuit, and 33 is an adjusting volume.

【0022】次に本ランプ制御回路6の動作を説明す
る。入力ポートI1 にゼロクロス信号のハイレベルの区
間が入力されている間は、トランジスタ31はON状態
にあり、オペアンプ32の出力を0V付近に固定してい
る。ゼロクロス信号がローレベルになるとともに、オペ
アンプの出力は、近似的な単調増加を開始する。
Next, the operation of the lamp control circuit 6 will be described. While the high-level section of the zero-cross signal is being input to the input port I 1 , the transistor 31 is in the ON state, and the output of the operational amplifier 32 is fixed near 0V. As the zero-cross signal goes low, the output of the op amp begins an approximately monotonic increase.

【0023】マイクロコンピュータ10は、少なくとも
ゼロクロス信号のローレベルの期間(例えば1ms)に
1回は入力ポートI1 をチェックするようにプログラム
されており、ポートをチェックした時にローであれば、
その時のオペアンプの出力をマイクロコンピュータのア
ナログ入力AN2 から読み込み、読み込み値に応じて補
正した値をマイクロコンピュータ内蔵のタイマに設定
し、タイムアップ時に、トリガパルスが出力ポートO1
から出力され、トライアック8が点弧制御される。
The microcomputer 10 is programmed to check the input port I 1 at least once during a low level period of the zero-cross signal (for example, 1 ms), and if it is low when the port is checked,
The output of the operational amplifier at that time is read from the analog input AN 2 of the microcomputer, and the value corrected according to the read value is set in the timer built in the microcomputer. When the time is up, a trigger pulse is output from the output port O 1
And the triac 8 is ignition controlled.

【0024】この構成によれば、少なくともゼロクロス
信号のロー期間に1回は入力ポートI1 をチェックする
ようにプログラムを作成すれば、実際のゼロクロスの立
ち下がりからの遅れ分を、アナログ入力AN2 の値から
知ることができ、適当な補正を加えて、タイマ値をセッ
トすることで、高精度な位相制御が実現可能となる。
According to this configuration, if a program is created so that the input port I 1 is checked at least once in the low period of the zero-cross signal, the delay amount from the actual falling of the zero-cross signal is input to the analog input AN 2 Can be known from the value of, and by adding an appropriate correction and setting the timer value, it is possible to realize highly accurate phase control.

【0025】また、ボリューム33は、個々の制御装置
におけるゼロクロスパルス幅を補正するための調整ボリ
ュームであり、マイクロコンピュータ内部で、アナログ
入力AN2 の値をAN3 の読み込み値に応じて補正を行
うためのものである。なお、アナログ入力AN1 には実
効出力電圧の目標値を指令するアナログ電圧が、入力ポ
ートI2 にはランプのON/OFFを指令する信号が入
力されている構成となっている。
The volume 33 is an adjustment volume for correcting the zero-cross pulse width in each control device, and the value of the analog input AN 2 is corrected in accordance with the read value of AN 3 inside the microcomputer. It is for. Note that the analog input AN 1 is inputted with an analog voltage for instructing a target value of the effective output voltage, and the input port I 2 is inputted with a signal for instructing ON / OFF of the lamp.

【0026】図4は、図3に示した実施例の各部の波形
を示してある。ここで41は、電源プラグに入力された
商用電源の入力波形であり、42はDC電源5によって
作られたゼロクロス信号の波形である。43は、図3に
示したオペアンプ32の出力波形であり、マイクロコン
ピュータ10のアナログ入力AN2 に入力される波形を
示している。
FIG. 4 shows the waveform of each part of the embodiment shown in FIG. Here, 41 is the input waveform of the commercial power source input to the power plug, and 42 is the waveform of the zero-cross signal generated by the DC power source 5. Reference numeral 43 is an output waveform of the operational amplifier 32 shown in FIG. 3, and shows a waveform input to the analog input AN 2 of the microcomputer 10.

【0027】図5は、積分回路を構成するオペアンプ3
2の出力特性を示す図である。ゼロクロス信号がハイレ
ベルからローレベルに変化したことで、トランジスタ3
1がオフとなり、オペアンプ32の出力は、ほぼ直線的
に単調増加を開始するように設定されている。
FIG. 5 shows an operational amplifier 3 which constitutes an integrating circuit.
It is a figure which shows the output characteristic of No. 2. When the zero-cross signal changes from high level to low level, the transistor 3
1 is turned off, and the output of the operational amplifier 32 is set to start monotonically increasing almost linearly.

【0028】図6は、ゼロクロス信号がローレベルから
ハイレベルに変化した場合の出力特性を示している。こ
の時、トランジスタ31はオフからONになり、オペア
ンプの出力は、放電回路の特性に従って、暫時減少して
いる。
FIG. 6 shows output characteristics when the zero-cross signal changes from low level to high level. At this time, the transistor 31 is turned from OFF to ON, and the output of the operational amplifier is temporarily reduced according to the characteristics of the discharge circuit.

【0029】図7は、本実施例のマイクロコンピュータ
10に内蔵されたプログラムを示すフローチャートであ
る。
FIG. 7 is a flow chart showing a program built in the microcomputer 10 of this embodiment.

【0030】まずステップS1(以下、“ステップ”な
る文言は省略する)からスタートし、S2で各種のレジ
スタ,ポート,RAMの初期化を行う。S3においてI
2 ポートを読み込んでランプ点灯信号がONしているか
判断し、ONしていたならばS4に進んで、制御目標値
を示すAD変換値(CNTL)をAN1 から得る。
First, starting from step S1 (hereinafter, the word "step" is omitted), various registers, ports and RAM are initialized in step S2. I in S3
2 ports are read to determine whether the lamp lighting signal is ON, and if it is ON, the process proceeds to S4 to obtain the AD conversion value (CNTL) indicating the control target value from AN 1 .

【0031】次に、S5においてポートI1 を読み込
み、ゼロクロス信号のレベルがハイレベルであるか判断
し、そうであればS3に戻り、そうでなければS6にお
いて積分回路の出力(DLY)をAN2 から読み込む。
Next, in step S5, the port I 1 is read, and it is determined whether the level of the zero-cross signal is high level. If yes, the process returns to step S3. If not, the output (DLY) of the integrating circuit is set to AN in step S6. Read from 2 .

【0032】次にS7において、ボリューム33の調整
値ADJをAN3 から読み込む。
Next, in S7, the adjustment value ADJ of the volume 33 is read from AN 3 .

【0033】次に、S8において、DLYの値とADJ
の値から予め定められたテーブルをサーチして、補正量
DLTを求める。
Next, in S8, the value of DLY and ADJ
A predetermined table is searched from the value of to obtain the correction amount DLT.

【0034】次にS9において、CNTLとDLTの値
からテーブルサーチを行い、その値RSLTを内部タイ
マにセットし、トリガパルス23の立ち上がり待ちであ
ることを示すTFLAGを1にセットする。
Next, in S9, a table search is performed from the values of CNTL and DLT, the value RSLT is set in the internal timer, and TFLAG indicating that the trigger pulse 23 is waiting to rise is set to 1.

【0035】次に、S10にてポートI1 を監視し、ゼ
ロクロス信号がハイレベルになるまでループして待ち、
ハイレベルになったら、S3へ戻る。また、S3におい
て点灯信号がOFFであれば、S11に進み、内部タイ
マをリセット(停止)させ、トリガ信号のポートO1
ローレベルを出力する(S12)。
Next, in step S10, the port I 1 is monitored and looped until the zero cross signal becomes high level.
When the level becomes high, the process returns to S3. If the lighting signal is OFF in S3, the process proceeds to S11, the internal timer is reset (stopped), and a low level is output to the port O 1 of the trigger signal (S12).

【0036】図8は、割り込みプログラムのフローチャ
ートである。内部タイマにより割り込みが発生すると、
S801より処理がスタートする。
FIG. 8 is a flowchart of the interrupt program. When an interrupt is generated by the internal timer,
The process starts from S801.

【0037】まず、S802において、TFLAGが1
にセットされているかどうか判断し、セットされていな
ければS807にて、トリガパルス出力のポートO1
OFF(ローレベル)にしてS806から抜けて、割り
込み処理を終了する。
First, in S802, TFLAG is set to 1
If it is not set, the port O 1 of the trigger pulse output is turned off (low level) in S807, the flow exits from S806, and the interrupt processing is ended.

【0038】S802において、TFLAGがセットさ
れていれば、S803においてトリガパルス出力のポー
トO1 をON(ハイレベル)にし、S804でTFLA
Gを0にリセットして、S805で内部タイマにトリガ
パルスの幅分のタイマ値を設定してタイマを再スタート
させ、S806より抜けて、割り込み処理を終了する。
If TFLAG is set in step S802, the trigger pulse output port O 1 is turned ON (high level) in step S803, and TFLAG is set in step S804.
G is reset to 0, a timer value corresponding to the width of the trigger pulse is set in the internal timer in S805, the timer is restarted, the processing is exited from S806, and the interrupt processing is ended.

【0039】実施例2 図9は、第2の実施例によるランプ制御回路6の内部回
路を示す図である。本図において6はランプ制御回路全
体、10はマイクロコンピュータ、11はパルス駆動用
トランジスタである。91は、ゼロクロス信号がハイレ
ベルの期間にリセットされ、ローレベルの期間にマイク
ロコンピュータ10が出力するクロックパルスをカウン
トするカウンタであり、出力がマイクロコンピュータ1
0のI15〜I8 の8ビットの入力ポートにパラレルに接
続されている。また、33は調整用のボリュームであ
る。
Embodiment 2 FIG. 9 is a diagram showing the internal circuit of the lamp control circuit 6 according to the second embodiment. In the figure, 6 is the entire lamp control circuit, 10 is a microcomputer, and 11 is a pulse driving transistor. Reference numeral 91 is a counter that is reset during a high level period of the zero-cross signal and counts clock pulses output by the microcomputer 10 during a low level period.
0 are connected in parallel to 8-bit input ports I 15 to I 8 . Reference numeral 33 is a volume for adjustment.

【0040】次に、本ランプ制御回路の動作を説明す
る。入力ポートI1 にゼロクロス信号のハイレベルの区
間が入力されている間は、カウンタ91はリセットされ
ており、ローレベルになるとともにカウントアップを開
始する。
Next, the operation of the lamp control circuit will be described. While the high level section of the zero-cross signal is being input to the input port I 1 , the counter 91 is reset and becomes low level and starts counting up.

【0041】マイクロコンピュータ10は、少なくとも
ゼロクロス信号のローレベルの期間(例えば1ms)に
1回は入力ポートI1 をチェックするようにプログラム
されており、ポートをチェックした時にローであれば、
その時のカウンタの値をポートから読み込み、読み込み
値に応じて補正した値をマイクロコンピュータ内蔵のタ
イマに設定し、タイムアップ時に、トリガパルスが、出
力ポートO1 から出力され、トライアック8が点弧制御
される。
The microcomputer 10 is programmed to check the input port I 1 at least once during the low level period of the zero-cross signal (for example, 1 ms), and if it is low when the port is checked,
The counter value at that time is read from the port, the value corrected according to the read value is set in the timer built into the microcomputer, and when the time is up, a trigger pulse is output from the output port O 1 and the triac 8 is controlled to fire. To be done.

【0042】この構成によれば、少なくともゼロクロス
信号のロー期間に1回は入力ポートI1 をチェックする
ようにプログラムを作成することにより、実際のゼロク
ロスの立ち下がりからの遅れ分を、ポートI15〜I8
値から知ることができ、適当な補正を加えて、タイマー
値をセットすることで、高精度な位相制御が実現可能と
なる。
According to this configuration, the program is created so as to check the input port I 1 at least once during the low period of the zero-cross signal, so that the delay amount from the actual zero-cross falling edge can be corrected by the port I 15 It is possible to know from the values of I 8 and it is possible to realize highly accurate phase control by setting the timer value by adding an appropriate correction.

【0043】ボリューム33は、個々の制御装置におけ
るゼロクロスパルス幅を補正するための調整ボリューム
であり、マイクロコンピュータ内部で、カウンタの読み
値をAN3 の読み込み値に応じて補正を行うためのもの
である。なお、AN1 には実効出力電圧の目標値を指令
するアナログ電圧が、I2 の入力ポートにはランプのO
N/OFFを指令する信号が入力されている。
The volume 33 is an adjustment volume for correcting the zero-cross pulse width in each control device, and is for correcting the reading value of the counter in the microcomputer according to the reading value of AN 3. is there. The analog voltage for commanding a target value of the effective output voltage to AN 1 is a lamp to an input port of I 2 O
A signal for instructing N / OFF is input.

【0044】次に、10に示したフローチャートを用い
て、実施例2のマイクロコンピュータ10に内蔵された
プログラムの動作を説明する。
Next, the operation of the program contained in the microcomputer 10 of the second embodiment will be described using the flowchart shown in 10.

【0045】S21からスタートし、S22で各種のレ
ジスタ,ポート,RAMの初期化を行う。S23におい
てI2 ポートを読み込んでランプ点灯信号がONしてい
るか判断し、ONしていたならばS24に進んで、制御
目標値を示すAD変換値(CNTL)をAN1 から得
る。
Starting from S21, various registers, ports and RAM are initialized in S22. In S23, the I 2 port is read to determine whether the lamp lighting signal is ON. If it is ON, the process proceeds to S24 to obtain an AD conversion value (CNTL) indicating a control target value from AN 1 .

【0046】次に、S25においてポートI1 を読み込
みゼロクロス信号のレベルがハイレベルであるか判断
し、そうであればS23に戻り、そうでなければS26
においてポートI15〜I8 の8ビットパラレル入力から
カウンタ91の出力(DLY)を読み込む。
Next, in step S25, the port I 1 is read to determine whether the level of the zero-cross signal is high level. If yes, the process returns to step S23, and if not, step S26
At, the output (DLY) of the counter 91 is read from the 8-bit parallel input of the ports I 15 to I 8 .

【0047】次にS27において、ボリューム33の調
整値ADJをAN3 から読み込む。次に、S28におい
て、DLYの値とADJの値から予め定められたテーブ
ルをサーチして、補正量DLTを求める。
Next, in S27, the adjustment value ADJ of the volume 33 is read from AN 3 . Next, in S28, a predetermined table is searched from the value of DLY and the value of ADJ to obtain the correction amount DLT.

【0048】次にS29においてCNTLとDLTの値
からテーブルサーチを行い、その値RSLTを内部タイ
マにセットし、トリガパルス23の立ち上がり待ちであ
ることを示すTFLAGを1にセットする。
Next, in S29, a table search is performed from the values of CNTL and DLT, the value RSLT is set in the internal timer, and TFLAG indicating that the trigger pulse 23 is waiting for the rising edge is set to 1.

【0049】次に、S30にてポートI1 を監視し、ゼ
ロクロス信号がハイレベルになるまでループして待ち、
ハイレベルになったら、S23へ戻る。
Then, in step S30, the port I 1 is monitored and looped until the zero-cross signal becomes high level.
When the level becomes high, the process returns to S23.

【0050】また、S23において点灯信号がOFFで
あれば、S31に進み、内部タイマをリセット(停止)
させ、トリガ信号のポートO1 にローレベルを出力する
(S12)。
If the lighting signal is OFF in S23, the process proceeds to S31 to reset (stop) the internal timer.
Then, a low level is output to the port O 1 of the trigger signal (S12).

【0051】割り込みプログラムは、図8に示したとお
り実行される。すなわち、内部タイマにより割り込みが
発生すると、S801より処理がスタートする。
The interrupt program is executed as shown in FIG. That is, when an interrupt is generated by the internal timer, the process starts from S801.

【0052】まず、S802において、TFLAGが1
にセットされているかどうか判断し、セットされていな
ければS807にて、トリガパルス出力のポートO1
OFF(ローレベル)にしてS806から抜けて、割り
込み処理を終了する。
First, in S802, TFLAG is set to 1
If it is not set, the port O 1 of the trigger pulse output is turned off (low level) in S807, the flow exits from S806, and the interrupt processing is ended.

【0053】S802において、TFLAGがセットさ
れていれば、S803においてトリガパルス出力のポー
トO1 をON(ハイレベル)にし、S804でTFLA
Gを0にリセットして、S805で内部タイマにトリガ
パルスの幅分のタイマ値を設定してタイマを再スタート
させ、S806より抜けて、割り込み処理を終了する。
If TFLAG is set in step S802, the trigger pulse output port O 1 is turned ON (high level) in step S803, and TFLAG is set in step S804.
G is reset to 0, a timer value corresponding to the width of the trigger pulse is set in the internal timer in S805, the timer is restarted, the processing is exited from S806, and the interrupt processing is ended.

【0054】実施例3 図11は、第3の実施例によるランプ制御回路6の内部
回路を示す図である。本図において、6はランプ制御回
路全体、10はマイクロコンピュータ、11はパルス駆
動用トランジスタである。91は、ゼロクロス信号がハ
イレベルの期間にリセットされ、ローレベルの期間にマ
イクロコンピュータ10が出力するクロックパルスをカ
ウントするカウンタであり、出力がマイクロコンピュー
タ10のI15〜I8 の8ビットの入力ポートにパラレル
に接続されている。
Third Embodiment FIG. 11 is a diagram showing the internal circuit of the lamp control circuit 6 according to the third embodiment. In the figure, 6 is the entire lamp control circuit, 10 is a microcomputer, and 11 is a pulse driving transistor. Reference numeral 91 is a counter that is reset during a high level period of the zero-cross signal and counts clock pulses output by the microcomputer 10 during a low level period. The output is an 8-bit input of I 15 to I 8 of the microcomputer 10. Connected in parallel to the port.

【0055】次に、本ランプ制御回路の動作を説明す
る。入力ポートI1 にゼロクロス信号のハイレベルの区
間が入力されている間は、カウンタ91はリセットされ
ており、ローレベルになるとともにカウントアップを開
始する。
Next, the operation of the lamp control circuit will be described. While the high level section of the zero-cross signal is being input to the input port I 1 , the counter 91 is reset and becomes low level and starts counting up.

【0056】マイクロコンピュータ10は、少なくとも
ゼロクロス信号のローレベルの期間(例えば1ms)に
1回は入力ポートI1 をチェックするようにプログラム
されており、ポートをチェックした時にローであれば、
その時のカウンタの値をポートから読み込み、読み込み
値に応じて補正した値をマイクロコンピュータ内蔵のタ
イマに設定し、タイムアップ時に、トリガパルスが、出
力ポートO1 から出力され、トライアック8が点弧制御
される。
The microcomputer 10 is programmed to check the input port I 1 at least once during the low level period of the zero-cross signal (for example, 1 ms), and if it is low when the port is checked,
The counter value at that time is read from the port, the value corrected according to the read value is set in the timer built into the microcomputer, and when the time is up, a trigger pulse is output from the output port O 1 and the triac 8 is controlled to fire. To be done.

【0057】この構成によれば、少なくともゼロクロス
信号のロー期間に1回は入力ポートI1 をチェックする
ようにプログラムを作成することにより、実際のゼロク
ロスの立ち下がりからの遅れ分を、ポートI15〜I8
値から知ることができ、適当な補正を加えて、タイマー
値をセットすることで、高精度な位相制御が実現可能と
なる。
According to this configuration, the program is created so that the input port I 1 is checked at least once in the low period of the zero-cross signal, so that the delay amount from the actual fall of the zero-cross signal can be adjusted to the port I 15 It is possible to know from the values of I 8 and it is possible to realize highly accurate phase control by setting the timer value by adding an appropriate correction.

【0058】また個々の制御装置におけるゼロクロスパ
ルス幅を補正するための調整値ADJは、ランプ制御回
路6の外部にある制御装置(図示せず)よりシリアル通
信にて送信されてくるもので、マイクロコンピュータ内
部で、カウンタの読み値をSO,SI,SCKの信号に
応じて補正を行う。なお、AN1 には実効出力電圧の目
標値を指令するアナログ電圧が、I2 の入力ポートには
ランプのON/OFFを指令する信号が入力されてい
る。
The adjustment value ADJ for correcting the zero-cross pulse width in each control device is sent by serial communication from a control device (not shown) outside the lamp control circuit 6, and is Inside the computer, the reading value of the counter is corrected according to the SO, SI and SCK signals. An analog voltage that commands the target value of the effective output voltage is input to AN 1 , and a signal that commands ON / OFF of the lamp is input to the I 2 input port.

【0059】次に、図12に示したフローチャートを用
いて、実施例3のマイクロコンピュータ10に内蔵され
たプログラムの動作を説明する。
Next, the operation of the program contained in the microcomputer 10 of the third embodiment will be described with reference to the flow chart shown in FIG.

【0060】S41からスタートし、S42で各種のレ
ジスタ,ポート,RAMの初期化を行う。S43におい
てI2 ポートを読み込んでランプ点灯信号がONしてい
るか判断し、ONしていたならばS44に進んで、制御
目標値を示すAD変換値(CNTL)をAN1 から得
る。
Starting from S41, various registers, ports and RAM are initialized in S42. In S43, the I 2 port is read to determine whether the lamp lighting signal is ON. If it is ON, the process proceeds to S44 to obtain the AD conversion value (CNTL) indicating the control target value from AN 1 .

【0061】次に、S45においてポートI1 を読み込
みゼロクロス信号のレベルがハイレベルであるか判断
し、そうであればS43に戻り、そうでなければS46
においてポートI15〜I8 の8ビットパラレル入力から
カウンタ91の出力(DLY)を読み込む。
Next, in step S45, the port I 1 is read to determine whether the level of the zero-cross signal is high level. If yes, the process returns to step S43, and if not, step S46
At, the output (DLY) of the counter 91 is read from the 8-bit parallel input of the ports I 15 to I 8 .

【0062】次にS47において、調整値ADJをマイ
クロコンピュータ内部の通信バッファより取り出す。
Next, in S47, the adjustment value ADJ is taken out from the communication buffer inside the microcomputer.

【0063】次に、S48において、DLYの値とAD
Jの値から予め定められたテーブルをサーチして補正量
DLTを求める。
Next, in S48, the value of DLY and AD
A correction table DLT is obtained by searching a predetermined table from the value of J.

【0064】次にS49においてCNTLとDLTの値
からテーブルサーチを行い、その値RSLTを内部タイ
マにセットし、トリガパルス23の立ち上がり待ちであ
ることを示すTFLAGを1にセットする。
Next, in S49, a table search is performed from the values of CNTL and DLT, the value RSLT is set in the internal timer, and TFLAG indicating that the rising of the trigger pulse 23 is waited is set to 1.

【0065】次に、S50にてポートI1 を監視し、ゼ
ロクロス信号がハイレベルになるまでループして待ち、
ハイレベルになったら、S43へ戻る。
Next, in step S50, the port I 1 is monitored and looped until the zero-cross signal becomes high level.
When the level becomes high, the process returns to S43.

【0066】また、S43において点灯信号がOFFで
あれば、S51に進み、内部タイマをリセット(停止)
させ、トリガ信号のポートO1 にローレベルを出力する
(S52)。
If the lighting signal is OFF in S43, the process proceeds to S51 to reset (stop) the internal timer.
Then, a low level is output to the port O 1 of the trigger signal (S52).

【0067】割り込みプログラムは、図8に示したとお
り実行される。すなわち、内部タイマにより割り込みが
発生すると、S801より処理がスタートする。
The interrupt program is executed as shown in FIG. That is, when an interrupt is generated by the internal timer, the process starts from S801.

【0068】まず、S802において、TFLAGが1
にセットされているかどうか判断し、セットされていな
ければS807にて、トリガパルス出力のポートO1
OFF(ローレベル)にしてS806から抜けて、割り
込み処理を終了する。
First, in S802, TFLAG is 1
If it is not set, the port O 1 of the trigger pulse output is turned off (low level) in S807, the flow exits from S806, and the interrupt processing is ended.

【0069】S802において、TFLAGがセットさ
れていれば、S803においてトリガパルス出力のポー
トO1 をON(ハイレベル)にし、S804でTFLA
Gを0にリセットして、S805で内部タイマにトリガ
パルスの幅分のタイマ値を設定してタイマを再スタート
させ、S806より抜けて、割り込み処理を終了する。
If TFLAG is set in step S802, the trigger pulse output port O 1 is turned ON (high level) in step S803, and TFLAG is set in step S804.
G is reset to 0, a timer value corresponding to the width of the trigger pulse is set in the internal timer in S805, the timer is restarted, the processing is exited from S806, and the interrupt processing is ended.

【0070】[0070]

【発明の効果】以上説明したとおり本発明によれば、制
御タイミングを補正する構成としてあるので、マイクロ
コンピュータの割り込み機能を使用せずに、簡単な付加
回路で、高精度な制御が実現できる。
As described above, according to the present invention, since the control timing is corrected, it is possible to realize highly accurate control with a simple additional circuit without using the interrupt function of the microcomputer.

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

【図1】本発明の実施例を説明するための前提技術を示
した図である。
FIG. 1 is a diagram showing a prerequisite technique for explaining an embodiment of the present invention.

【図2】図1の動作を示す波形図である。FIG. 2 is a waveform diagram showing the operation of FIG.

【図3】本発明の第1の実施例を示す回路図である。FIG. 3 is a circuit diagram showing a first embodiment of the present invention.

【図4】図3の動作を示す波形図である。FIG. 4 is a waveform diagram showing the operation of FIG.

【図5】図3の動作特性を示す線図である。5 is a diagram showing the operating characteristics of FIG. 3. FIG.

【図6】図3の動作特性を示す線図である。FIG. 6 is a diagram showing the operating characteristics of FIG.

【図7】図3に示した第1の実施例の動作手順を示すフ
ローチャートである。
FIG. 7 is a flowchart showing an operation procedure of the first embodiment shown in FIG.

【図8】割り込み処理を示すフローチャートである。FIG. 8 is a flowchart showing interrupt processing.

【図9】本発明の第2の実施例を示す回路図である。FIG. 9 is a circuit diagram showing a second embodiment of the present invention.

【図10】図9に示した第2の実施例の動作手順を示す
フローチャートである。
10 is a flowchart showing an operation procedure of the second embodiment shown in FIG.

【図11】本発明の第3の実施例を示す回路図である。FIG. 11 is a circuit diagram showing a third embodiment of the present invention.

【図12】図11に示した第3の実施例の動作手順を示
すフローチャートである。
FIG. 12 is a flowchart showing an operation procedure of the third embodiment shown in FIG.

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

1 プラグ 2 電流ヒューズ 3 ノイズフィルタ 4 電源スイッチ 5 DC電源回路 6 ランプ制御回路 7 ハロゲンランプ 8 トライアック 9 トリガ回路 10 マイクロコンピュータ 1 Plug 2 Current Fuse 3 Noise Filter 4 Power Switch 5 DC Power Circuit 6 Lamp Control Circuit 7 Halogen Lamp 8 Triac 9 Trigger Circuit 10 Microcomputer

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 タイミングパルスを入力し、該タイミン
グパルスに同期した制御を行う、マイクロコンピュータ
を含む制御装置において、 前記タイミングパルス信号により繰り返し初期化され再
スタートする時間計測手段と、 前記時間計測手段の計測出力を読み込み、当該計測出力
値に応じて制御タイミングを補正する制御手段とを有す
ることを特徴とする制御装置。
1. A control device including a microcomputer, which receives a timing pulse and performs control in synchronization with the timing pulse, comprising: a time measuring unit that is repeatedly initialized and restarted by the timing pulse signal; and the time measuring unit. And a control means for correcting the control timing according to the measured output value.
【請求項2】 請求項1において、前記タイミングパル
スがローレベルまたはハイレベルを呈する間に少なくと
も1回は、前記タイミングパルスの入力をチェックする
ことを特徴とする制御装置。
2. The control device according to claim 1, wherein the input of the timing pulse is checked at least once while the timing pulse exhibits a low level or a high level.
【請求項3】 タイミングパルスを入力し、該タイミン
グパルスに同期した制御を行う、マイクロコンピュータ
を含む制御装置において、 前記タイミングパルス信号により繰り返し初期化され再
スタートする時間計測手段と、 前記時間計測手段の計測出力を読み込み、当該計測出力
値と外部より半固定的に入力される設定値に応じて制御
タイミングを補正する制御手段とを有することを特徴と
する制御装置。
3. A control device including a microcomputer for inputting a timing pulse and performing control in synchronism with the timing pulse, comprising: time measuring means repeatedly initialized and restarted by the timing pulse signal; and the time measuring means. And a control means for correcting the control timing according to the measured output value and a set value semi-fixedly input from the outside.
JP4163102A 1992-06-22 1992-06-22 Controller Pending JPH064170A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4163102A JPH064170A (en) 1992-06-22 1992-06-22 Controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4163102A JPH064170A (en) 1992-06-22 1992-06-22 Controller

Publications (1)

Publication Number Publication Date
JPH064170A true JPH064170A (en) 1994-01-14

Family

ID=15767214

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4163102A Pending JPH064170A (en) 1992-06-22 1992-06-22 Controller

Country Status (1)

Country Link
JP (1) JPH064170A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4949046A (en) * 1985-11-19 1990-08-14 British Aerospace Public Limited Company Battery state of charge indicator

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4949046A (en) * 1985-11-19 1990-08-14 British Aerospace Public Limited Company Battery state of charge indicator

Similar Documents

Publication Publication Date Title
US5202813A (en) Driver device for a duty solenoid valve
JP3326968B2 (en) Discharge lamp lighting device
US5373224A (en) Method and apparatus for varying the power in a load connected to the mains
JPH064170A (en) Controller
US4617509A (en) Voltage regulator for a microcomputer system
US4718395A (en) Ignition control system for internal combustion engine
JP2002369499A (en) Voltage controller
EP0566335A2 (en) Switch mode ignition coil driver and method
JP2697170B2 (en) Oil pump burner electromagnetic pump controller
JP2021139665A (en) Current detection circuit and current detection system
JP3317043B2 (en) Phase controller
JPH0469377B2 (en)
JP2006033352A (en) A-d converter and temperature regulator
JPH05113166A (en) Glow plug control device for diesel engine
JPS5936109B2 (en) igniter
JPS5817353B2 (en) igniter
JP3111352B2 (en) Hold circuit without periodic disturbance
JPH0831937B2 (en) Light output stabilizer
SU1443142A1 (en) Sawtooth voltage shaper
JP2000113993A (en) Light source control device and method
JP2984616B2 (en) Power control IC
SU1686390A1 (en) Method of timing the acceleration of an electric motor
JPH05137325A (en) Charge voltage control circuit
JPH0974343A (en) Current limiter circuit
JP2001016770A (en) Power supply device