JPH02268304A - Sampling method for trace back data - Google Patents
Sampling method for trace back dataInfo
- Publication number
- JPH02268304A JPH02268304A JP1089976A JP8997689A JPH02268304A JP H02268304 A JPH02268304 A JP H02268304A JP 1089976 A JP1089976 A JP 1089976A JP 8997689 A JP8997689 A JP 8997689A JP H02268304 A JPH02268304 A JP H02268304A
- Authority
- JP
- Japan
- Prior art keywords
- program
- time
- data
- sampling
- period
- 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
Links
Landscapes
- Control By Computers (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、マイクロコンピュータを使用した制御装置に
おける、いわゆるRAS(信頼性・可用性・保守性)機
能を満足するために、制御系の各種状態量データを再現
するトレースバックのためのデータのサンプリング方法
に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention aims to improve the various states of a control system in order to satisfy the so-called RAS (Reliability, Availability, and Maintainability) function in a control device using a microcomputer. This invention relates to a data sampling method for traceback that reproduces quantitative data.
(従来の技術)
従来、例えば半導体電力変換装置を使用した電動機の速
度制御装置では、電動機の速度を検出してそれと設定速
度とが一致するように、比例積分演算等の調節演算結果
をトルク指令あるいは電流指令として出力する速度制御
系と、これらのトルク指令または電流指令に基づいて半
導体電力変換装置を制御する電流制御系とから構成され
ている。(Prior art) Conventionally, for example, a motor speed control device using a semiconductor power conversion device detects the speed of the motor and uses the result of an adjustment calculation such as a proportional integral calculation as a torque command so that the speed matches the set speed. Alternatively, it is composed of a speed control system that outputs current commands and a current control system that controls the semiconductor power conversion device based on these torque commands or current commands.
ここで一般に、電流制御系のようなマイナループは、そ
の目的及び制御対象の性質から速度制御系に比べて短い
サンプリング周期で制御されるのが通常である。Generally, a minor loop such as a current control system is usually controlled at a shorter sampling period than a speed control system due to its purpose and the nature of the controlled object.
一方、その内部にマイクロコンピュータを組み込んだ電
子制御装置では、いわゆるRAS機能として、制御装置
内部の制御量、操作量、その他のデータを常時サンプリ
ングして記録しておき、装置に故障や障害が発生した場
合にその発生前後における上記データを再生することに
より、故障や障害の発生前後における制御装置の状態を
明らかにしてその原因を究明するトレースバック機能を
備えている。On the other hand, in an electronic control device that incorporates a microcomputer, the so-called RAS function constantly samples and records the control amount, operation amount, and other data inside the control device, so that it can be used in the event of a failure or failure of the device. In the event of a failure, the controller is equipped with a traceback function that clarifies the state of the control device before and after the failure occurs and investigates the cause by reproducing the data before and after the failure occurred.
このようなトレースバック機能を実現する場合に、サン
プリングされたデータを改めて再生する処理の容易さや
他のサンプリング周期で更新されるデータとの同期のと
りやすさの点から、通常はトレースバック・データのサ
ンプリング周期をそのデータ本来の更新周期よりも短い
一定の周期に選んでいる。具体的には、その制御系で最
も短いデータのサンプリング周期(例えば前述した電動
機の速度制御装置の例では電流系の制御のためのサンプ
リング周期に相当する)よりも更に短い一定のサンプリ
ング周期で、トレースバックのために各制御系の状態を
サンプリングすることが行われている。When implementing such a traceback function, traceback data is usually The sampling period is selected to be a constant period shorter than the original update period of the data. Specifically, at a constant sampling period that is shorter than the shortest data sampling period in the control system (for example, in the example of the speed control device of an electric motor mentioned above, this corresponds to the sampling period for controlling the current system). The state of each control system is sampled for traceback purposes.
(発明が解決しようとする課題)
ところで、短い周期で繰り返しサンプリング処理を行う
ことは、実質的に短い周期の割り込み処理に頼らざるを
得す、ソウトウエアシステム全体に多大な負担をもたら
す。例えば、前記のような制御系においてトレースバッ
ク・データ収集のためのサンプリングを1 (msec
)周期の割り込みで実現したとすれば、1 (+1sa
c)毎にデータを収集するべくサンプリングを行うため
のソフトウェア上の処理時間と共に1割り込み発生に伴
う内部レジスタの退避/復帰及び割り込み制御回路の操
作のための処理時間(オーバヘッド)が発生することに
なる。(Problems to be Solved by the Invention) By the way, repeatedly performing sampling processing in a short cycle causes a substantial burden on the entire software system, forcing it to rely on interrupt processing in a substantially short cycle. For example, in the control system described above, sampling for traceback data collection is performed at 1 (msec
) period interrupt, then 1 (+1sa
c) In addition to the software processing time required to perform sampling to collect data every time, processing time (overhead) is required to save/restore internal registers and operate the interrupt control circuit in response to the occurrence of one interrupt. Become.
ちなみにサンプリングのための所要時間を80(p 5
ac)、オーバヘッドを20(p 5ac)とすれば、
両者の所要時間は1 (+5ec1間では80+ 20
= 100(u s。By the way, the time required for sampling is 80 (p 5
ac), and the overhead is 20 (p 5ac),
The time required for both is 1 (+5ec1 is 80+20
= 100(us.
C〕となり、マイクロコンピュータの負荷率に換算して
10〔%〕になる。これは、速度制御系のような比較的
ゆっくりとした制御ループにおいて1例えばその制御演
算を10(msec)周期で行うものとすれば、この制
御レベルに換算して10(+*5ec) X 10(%
〕= 1 (msec〕となり、制御装置本来の目的で
ある制御ループからみても無視し得ない負担となる。C], and the load factor of the microcomputer is 10%. In a relatively slow control loop such as a speed control system, for example, if the control calculation is performed at a cycle of 10 (msec), this control level is converted to 10 (+*5 ec) x 10 (%
] = 1 (msec), which is a burden that cannot be ignored even from the viewpoint of the control loop, which is the original purpose of the control device.
更に、前記のような半導体電力変換装置の制御のための
ソフトウェア処理に要する時間が、トレースバックのた
めのサンプリング周期と同等かそれ以上にわたる場合は
、サンプリングの歯抜けや他のデータとの時間的なずれ
を防ぐ意味から、このような制御のためのソフトウェア
処理中であってもトレースバックのためのサンプリング
を優先して行わなければならず、トレースバック・デー
タのサンプリングのための割り込みを電流系の制御のた
めの割り込みよりも優先度の高い割込レベルに設定し、
電流制御のための演算処理を中断してでもトレースバッ
ク・データのサンプリングを行うことになる。Furthermore, if the time required for software processing to control the semiconductor power conversion device as described above is equal to or longer than the sampling period for traceback, there may be gaps in sampling or temporal differences with other data. In order to prevent deviations, sampling for traceback must be given priority even during software processing for such control, and interrupts for sampling traceback data must be given priority to the current system. Set the interrupt level to a higher priority than the interrupt for control of
Traceback data will be sampled even if the arithmetic processing for current control is interrupted.
このため、電流制御のための演算処理時間が圧迫されて
、制御装置本来の目的である制御演算に支障をきたしか
ねないというような問題を生じていた。This has created a problem in that the calculation processing time for current control is compressed, which may impede the control calculations that are the original purpose of the control device.
本発明は上記問題点を解決するために提案されたもので
、その目的とするところは、トレースバック・データの
サンプリングのためだけに高い割り込み優先度を持った
プログラムを起動する必要がなく、マイクロコンピュー
タのソフトウェア上の負荷を必要以上に増加させること
がないと共に。The present invention was proposed to solve the above problems, and its purpose is to eliminate the need to start a program with a high interrupt priority just for sampling traceback data, and to It does not increase the load on the computer's software more than necessary.
制御装置本来の制御演算に何ら支障なくサンプリングが
行えるようにしたトレースバック・データのサンプリン
グ方法を提供することにある。It is an object of the present invention to provide a method for sampling traceback data that allows sampling to be performed without any hindrance to the original control calculations of a control device.
(課題を解決するための手段)
上記目的を達成するため、本発明では、トレースバック
・データとしてサンプリングされる状態量データの生成
・更新時に、割り込み処理プログラムのタイミングを規
定するための割り込み要求信号を発生するシステム・ク
ロックの分周カウンタの計数値を前記状態量データと併
せて保存する。(Means for Solving the Problems) In order to achieve the above object, the present invention provides an interrupt request signal for specifying the timing of an interrupt processing program when generating/updating state quantity data sampled as traceback data. The count value of the frequency division counter of the system clock that generates the system clock is stored together with the state quantity data.
また、前記プログラムよりも長い周期でかつ低い割り込
み優先度で起動され、トレースバック・データのサンプ
リングを行うプログラムにおいて、サンプリング処理を
実施する時点における前記分周カウンタの計数値からサ
ンプリングを実施する時刻を求めると共に、そのプログ
ラムが前回起動されてから今回起動されるまでの間にト
レースバック・データを生成する前記プログラムが残し
た状態量データとその状態量データ更新時における前記
カウンタの計数値とから状態量データの更新時点を求め
て、同一時間軸上に換算したサンプリング時点における
状態量データを決定してこれをトレースバック・データ
のサンプリング結果とするものである。In addition, in a program that is started at a longer cycle and with a lower interrupt priority than the program and samples traceback data, the time at which sampling is performed is determined from the count value of the frequency division counter at the time when the sampling process is performed. At the same time, the state is determined from the state quantity data left by the program that generates traceback data between the last time the program was started and the current time the program is started, and the count value of the counter at the time of updating the state quantity data. The updated time point of the quantity data is determined, the state quantity data at the sampling time point converted to the same time axis is determined, and this is used as the sampling result of the traceback data.
(作用)
一般に、マイクロコンピュータを使用した制御装置のデ
ータのサンプリング周期は、CPUのシステム・クロッ
クをカウンタから構成される分周回路(分周カウンタ)
により計数して発生させている。従って、このシステム
・クロックの計数値を読み出すことができれば(一般に
可能な場合が多い)、その値を時刻代わりに使用して複
数の異なった制御ループ(サンプリング周期)間のタイ
ミングのずれを同一の時間軸上に換算して評価すること
ができる。(Function) Generally, the data sampling period of a control device using a microcomputer is determined by a frequency division circuit (frequency division counter) consisting of a counter for the CPU system clock.
It is counted and generated by Therefore, if it is possible to read out the count value of this system clock (which is generally possible in many cases), that value can be used instead of time to correct the timing deviation between multiple different control loops (sampling periods) at the same time. It can be converted and evaluated on the time axis.
すなわち、トレースバック用にサンプリングされる状態
量データXを生成・更新する第1のプログラムが、更新
した状態量データXと共に状態量データXの更新時点に
おける前記分周カウンタの計数値を保存するようにして
おけば、サンプリングする側の第2のプログラムは以下
のような方法で、あたかも第1のプログラムの起動周期
よりも短い周期で。で状態量データXをサンプリングし
た場合と同じ結果を得ることができる。That is, the first program that generates and updates the state quantity data X sampled for traceback saves the counted value of the frequency division counter at the time of updating the state quantity data X together with the updated state quantity data X. If you do this, the second program on the sampling side uses the following method, as if it had a cycle shorter than the startup cycle of the first program. The same result as when sampling the state quantity data X can be obtained.
このことを第1図及び第2図を参照しつつ説明する。第
1図において、鋸歯状波形nは、第2のプログラムP2
を起動する割り込み要求信号I2を発生するための分周
カウンタの計数値を表わす。This will be explained with reference to FIGS. 1 and 2. In FIG. 1, the sawtooth waveform n is the second program P2
represents the count value of the frequency division counter for generating the interrupt request signal I2 that activates the interrupt request signal I2.
ここで分周カウンタは周波数f(Hz)のシステム・ク
ロックFを計数し、計数値がn2−1に達する度にカウ
ント値をゼロにリセットすると共しこ、マイクロコンピ
ュータに対する割り込み要求として信号■2を出力する
。Here, the frequency division counter counts the system clock F of frequency f (Hz), and resets the count value to zero every time the count value reaches n2-1. Output.
今、トレースバックするべき状態量データXを生成・更
新するプログラムP、が、前記プログラムP2の起動周
期τ2よりも短い周期τ□でプログラムP2とは非同期
のタイミングで起動される場合を考える。プログラムP
1が状態量データXと共にそれを生成・更新した時点の
分周カウンタの計数値nを検出して、これらをそれぞれ
X(k)及びQl(k)として記憶しておけば、状態量
データX(k)の生成・更新時期t1は、n□(k)の
偏差の積算値として下記の漸化式(1)または(1)′
で表わすことができる。Now, let us consider a case where a program P that generates and updates state quantity data X to be traced back is started at a timing asynchronous to the program P2 with a cycle τ□ shorter than the start cycle τ2 of the program P2. Program P
1 detects the count value n of the frequency dividing counter at the time when it is generated and updated together with the state quantity data X, and stores these as X(k) and Ql(k), respectively, then the state quantity data The generation/update time t1 of (k) is determined by the following recurrence formula (1) or (1)' as the integrated value of the deviation of n□(k).
It can be expressed as
t1=t1oLd+n、(in−n、(k−t);nl
<k〉>n、(k−1+のとき・・・(1)
tl =t 1otd+ n、 + nl(k) n
l(k−t ) ; nl(k+≦n1(k−t)のと
き・・・(1)′
なお、上記(1)、(1)’式の右辺のt 10tdは
左辺t□の前回値を表わす。ここで、式を単純化するた
めに時刻t2をシステム・クロックのカウント値に換算
したものとして扱っており、これは以下についても同様
である。t1=t1oLd+n, (in-n, (k-t); nl
<k>>n, (when k-1+...(1) tl = t 1otd+ n, + nl(k) n
l(k-t); nl(k+≦n1(k-t)...(1)' Note that t10td on the right side of equations (1) and (1)' above is the previous value of t□ on the left side. Here, in order to simplify the expression, time t2 is treated as being converted to the count value of the system clock, and the same applies to the following.
一方、プログラムP2におけるトレースバック・データ
のサンプリングのタイミングt、についても、tlと同
様にサンプリング時点における分周カウンタの計数値△
nを使って以下の(2)式により表わすことができる。On the other hand, regarding the sampling timing t of the traceback data in the program P2, the count value of the frequency division counter at the sampling time △ is similar to tl.
It can be expressed by the following equation (2) using n.
t 2= t 2oLd−Δn、oLd+n、+Δn、
−(2)なお、j、oLd、Δn、OLdはそれぞれt
2tΔn2の前回値を示す。ここで、Δn2は分周回路
によってプログラムP2を起動するための割り込み信号
工2が発生されてから実際にトレースバックのためのサ
ンプリングが行われるまでの時間のずれを表わすもので
あり、また、t、OLdは前回プログラムP2が実行さ
れた時点におけるΔn2を表わしている。t2=t2oLd-Δn, oLd+n, +Δn,
-(2) Note that j, oLd, Δn, and OLd are each t
The previous value of 2tΔn2 is shown. Here, Δn2 represents the time lag from the generation of interrupt signal 2 to start program P2 by the frequency dividing circuit to the time when sampling for traceback is actually performed, and t , OLd represents Δn2 at the time when program P2 was executed last time.
以上のように、分周カウンタの計数値nを基準として、
複数プログラムp1.p、間のタイミングを知ることが
できる。As mentioned above, based on the count value n of the frequency division counter,
Multiple programs p1. It is possible to know the timing between p and p.
具体的なアルゴリズムを以下に説明する。プログラムP
1は、トレースバックされる状態量データXを生成・更
新する度にその値Xと分周カウンタの計数値nとをそれ
ぞれX (k)、 n (k)としてFIF○(Fir
st InFirst 0ut)バッファに格納する。The specific algorithm will be explained below. Program P
1, each time the state quantity data X to be traced back is generated or updated, the value X and the count value n of the frequency division counter are set as
st InFirst 0ut) Store in buffer.
一方、プログラムP、においで、実際にトレースバック
のためのデータ・サンプリングを行うルーチンでは、サ
ンプリング実施時点における分周カウンタの計数値Δn
2を使用し、前記(2)式の演算に基づいてサンプリン
グを実施する時点t2を決定する。On the other hand, in the routine that actually performs data sampling for traceback in program P, the count value Δn of the frequency division counter at the time of sampling is
2 is used to determine the time point t2 at which sampling is to be performed based on the calculation of equation (2).
次に、プログラムP2による前回のサンプリング実施時
点から今回までの間にプログラムP、によってFIFO
バッファに保存された0組の状態量データX(k)と分
周カウンタの計数値n 1<k>Cただし、k=1〜a
)とを使用して、後述する第5図に示すフローチャート
に従ってトレースバック・データのサンプリング動作を
行う。Next, between the time of the previous sampling by program P2 and this time, program P performs the FIFO
0 set of state quantity data stored in the buffer
), the traceback data sampling operation is performed according to the flowchart shown in FIG. 5, which will be described later.
この結果、プログラムP、において周期τ1で生成・更
新された状態量データXは、第2図に示すごとく周期τ
。でサンプリングされた時系列データXT(II)とし
て再生することができる。As a result, the state quantity data X generated and updated at a period τ1 in the program P, has a period τ as shown in FIG.
. It can be reproduced as time series data XT(II) sampled in .
(実施例) 以下1図に沿って本発明の一実施例を説明する。(Example) An embodiment of the present invention will be described below with reference to FIG.
なお、この実施例は電流制御系をマイナループとして有
する。半導体電力変換装置を用いた電動機の速度制御装
置に本発明を適用した場合のものである。Note that this embodiment has a current control system as a minor loop. This is a case where the present invention is applied to a speed control device for a motor using a semiconductor power conversion device.
第3図はこの実施例のハードウェア上の構成を示してお
り1図においてlは複数のプログラムを実行するマイク
ロコンピュータ、2は、制御演算のためのプログラムと
データの一時記憶との機能の他に、いわゆるFIFOメ
モリとしての機能を持つメモリであって、その構成とし
てはハードウェアによりFIFO機能を直接実現するも
のや。Fig. 3 shows the hardware configuration of this embodiment. Second, it is a memory that functions as a so-called FIFO memory, and its configuration is such that the FIFO function is directly realized by hardware.
通常の固定メモリをリング・バッファとして使用して書
き込み/読み出しのためのポインタの使用と併せてソフ
トウェア上でFIFO機能を実現するものであってもよ
い。An ordinary fixed memory may be used as a ring buffer to implement the FIFO function in software in conjunction with the use of pointers for writing/reading.
また、3はシステム・クロックF(f(Hzl)を計数
してn2だけカウントする度にマイクロコンピュータ1
に対して割り込み要求償号工2を出力し、速度制御系の
定周期プログラムP8を周期で、で起動させるための分
周カウンタ、4は、電流マイナループの制御演算処理を
行う電流制御系のプログラムP1の起動要求として1周
期τ□の割り込み要求償号工、を出力する割り込み信号
発生回路、5゜6は各種制御量の検出及び操作量に基づ
いた機器の駆動のための入力インタフェイス、出力イン
タフェイス、7はデータバスである。3 counts the system clock F (f (Hzl)) and every time it counts by n2, the microcomputer 1
4 is a current control system program that outputs an interrupt request code 2 and starts the fixed cycle program P8 of the speed control system at regular intervals; 4 is a current control system program that performs control calculation processing of the current minor loop; An interrupt signal generation circuit outputs an interrupt request signal of one cycle τ□ as a start request for P1, and 5 and 6 are input interfaces and outputs for detecting various control variables and driving equipment based on the manipulated variables. Interface 7 is a data bus.
このような構成において、マイクロコンピュータ1は割
り込み要求信号■、に基づいてプログラムP2を起動す
るので、このプログラムP2の起動周期はτ2=n2÷
fとなる。また、分周カウンタ3の計数値nは、データ
バス7を介してマイクロコンピュータ1から読み出し可
能となっている。In such a configuration, the microcomputer 1 starts the program P2 based on the interrupt request signal ■, so the starting cycle of the program P2 is τ2=n2÷
It becomes f. Further, the count value n of the frequency division counter 3 can be read from the microcomputer 1 via the data bus 7.
更に、電流制御系のプログラムP1の起動周期τ、は、
速度制御系のプログラムP2の起動周期τ、よりも短く
、かつ前記割り込み要求償号工、よりも優先度の高い割
り込み要求償号工、に基づいてプログラムP2とは非同
期に起動されるようになっている。Furthermore, the starting period τ of the program P1 of the current control system is
The speed control system program P2 is started asynchronously with the program P2 based on an interrupt request coder that is shorter than the start cycle τ and has a higher priority than the interrupt request coder. ing.
ここで、周期τ、で起動される電流制御系のプログラム
P□が周期τ□で更新する状態量データXを1周期で2
で起動される速度制御系のプログラムP2においてサン
プリング周期で。でトレースバック・データをサンプリ
ングする場合を考える。Here, the current control system program P□ started at the period τ updates the state quantity data X at the period τ□ by 2 times in one cycle.
At the sampling period in the speed control system program P2 started at. Consider the case of sampling traceback data.
ただし、周期τ2.τ4.τ。の間には以下の(3)式
の関係が成立するものとする。However, the period τ2. τ4. τ. It is assumed that the following equation (3) holds true between .
τ。くτ1くτ、 ・・・(3)
従って、上記周期τ。、τ1.τ2を分周カウンタ3に
よるシステム・クロックFのカウント値に換算した値n
1le ntt naについても、以下の(4)式が成
立する。τ. τ1 τ, ...(3) Therefore, the above period τ. , τ1. Value n obtained by converting τ2 to the count value of system clock F by frequency division counter 3
The following equation (4) also holds true for 1le ntt na.
。。くn□<nl ・・・(4) ただし、no=τ。×f、nL=τ□×f。. . Kun□<nl ・・・(4) However, no=τ. ×f, nL=τ□×f.
n、=τ、Xf
次に、第4図は、この実施例において電流制御系の検出
・制御演算の結果としてトレースバックされる状態量デ
ータXを生成・更新する電流マイナループのプログラム
P1のフローチャート、第5図は前記プログラムP工よ
りも長い周期で8で速度制御系の検出・制御演算を行う
と共に本発明のアルゴリズムに基づいてトレースバック
のためのサンプリングを実施する速度制御系のプログラ
ムP2のフローチャートであり、これらに基づいてこの
実施例の作用を以下に説明する。n, = τ, Xf Next, FIG. 4 is a flowchart of the current minor loop program P1 that generates and updates state quantity data X that is traced back as a result of detection and control calculations of the current control system in this embodiment. FIG. 5 is a flowchart of a speed control system program P2 that performs detection and control calculations for the speed control system at 8 at a cycle longer than that of the program P, and also performs sampling for traceback based on the algorithm of the present invention. Based on these, the operation of this embodiment will be explained below.
まず第4図のフローチャートにおいて、割り込み要求信
号I□に基づいて起動される電流制御系のプログラムP
工は、電流制御のための所定の制御演算及び処理を実施
する(ステップSl)。更に。First, in the flowchart of FIG. 4, a current control system program P started based on an interrupt request signal I□
The operator performs predetermined control calculations and processing for current control (step Sl). Furthermore.
その時点における分周カウンタ3の計数値nを読み出し
くS2)、トレースバックするべき状態量データXと共
にX(k)、nl(k)としてメモリ(P I F○バ
ッファ)2に書き込み(S3)、その後、にの値をイン
クリメントする(S 4 )。Read out the count value n of the frequency division counter 3 at that point in time (S2) and write it to the memory (PIF○ buffer) 2 as X(k) and nl(k) together with the state quantity data X to be traced back (S3) , and then increments the value of (S 4 ).
次いで第5図のフローチャートにおいて、割り込み要求
償号工、に基づいて起動される速度制御系のプログラム
P2は、速度制御のための所定の制御演算及び処理を実
施する(ステップS 11)。更に、トレースバック用
データのサンプリング処理として、前記(作用)の項で
説明した(2)式に基づいて以下■〜■のアルゴリズム
に従ってトレースバック・データのサンプリングを実施
する。Next, in the flowchart of FIG. 5, the speed control system program P2 started based on the interrupt request executes predetermined control calculations and processing for speed control (step S11). Furthermore, as a sampling process for traceback data, sampling of traceback data is performed according to the following algorithms (1) to (2) based on equation (2) described in the section (effects) above.
■まず、実際にトレースバック・データのサンプリング
処理を行う時点t2を(2)式により求める(S 12
. S 13)。■First, the time point t2 at which the traceback data sampling process is actually performed is determined using equation (2) (S 12
.. S13).
■その後、時点t2を求めるのに使用したΔn2を前回
値Δn2oLdとしくS 14)、かつkを1として(
S 15)メモリ2内にプログラムP工が格納した状態
量データがあるか否かを判断する(S16)。■Then, set Δn2 used to find time t2 as the previous value Δn2oLdS 14) and set k to 1 (
S15) It is determined whether there is state quantity data stored by the program P in the memory 2 (S16).
■この状態量データX(k)がある場合、その更新時点
における分周カウンタ3の計数値n 1(k)を、nl
(k)とnl(k−1)との大小関係に応じて前記(1
)式または(1)1式にあてはめて状態量データX (
k)の更新時点t2を求め(817〜519)、その後
、kの値をインクリメントする(S20)。■If there is this state quantity data
(1) according to the magnitude relationship between (k) and nl(k-1).
) or (1)1 to obtain the state quantity data X (
The update time t2 of k) is determined (817-519), and then the value of k is incremented (S20).
0次に、前記t工l t、と同一の時間軸上でトレース
バックのためのサンプリング時点t0を求め(821〜
523)、toとt工との大小関係からサンプリング時
点t0における状態量データXの値を求めて周期τ。の
時系列データXア(、)を作成しくS24゜S 25.
S 27)、mの値をインクリメントする(S26゜
528)。Next, the sampling time point t0 for traceback is determined on the same time axis as the above t step (821 to t).
523), the value of the state quantity data X at the sampling time t0 is determined from the magnitude relationship between to and t, and the period τ is determined. Create time series data XA(,) S24゜S25.
S27), and increments the value of m (S26°528).
この結果、状態量データXのトレースバックは、周期τ
。でmを順次増加させながら時系列データXT(Im+
をトレースすることで実現可能になる。As a result, the traceback of the state quantity data X has a period τ
. The time series data XT (Im+
This can be achieved by tracing.
なお、プログラムP1の起動周期で1またはnlが知り
得る値であれば
プログラムP2の起動周期〉プログラムP1の起動周期
が成立する限りにおいて、プログラムP L −P z
共に一定周期で起動されるプログラムである必要はない
。Note that if 1 or nl is a knowable value in the startup cycle of the program P1, then the startup cycle of the program P2 > the startup cycle of the program P1, the program P L −P z
Both programs do not need to be started at regular intervals.
(発明の効果)
以上のように本発明によれば、制御系の状態量データを
このデータが実際に生成・構成される周期よりも長く、
かつ低い割り込み優先度のプログラムによって、あたか
もその状態量データが実際に生成・更新される周期より
も短い周期でサンプリングしたかのようにトレースバッ
ク・データを構成するものであるから、サンプリングの
ためだけの高い割り込み優先度をもったプログラムを起
動する必要がなく、制御機能を実現するマイクロコンピ
ュータのソフトウェア上の負荷を本来の制御目的以外の
理由で重くしないで済むという効果がある。(Effects of the Invention) As described above, according to the present invention, the state quantity data of the control system is generated for a period longer than the period in which this data is actually generated and configured.
In addition, traceback data is constructed by a program with a low interrupt priority as if it were sampled at a shorter cycle than the cycle at which the state quantity data is actually generated or updated, so it is not necessary to use traceback data only for sampling purposes. There is no need to start a program with a high interrupt priority, and there is no need to increase the load on the software of the microcomputer that implements the control function for reasons other than the original control purpose.
また、割り込み信号の発生により上記のトレースバック
用サンプリング処理を行うプログラムが起動されて、実
際にデータの収集処理が実施されるまでの無、駄時間を
含めてトレースバック用データの構成を行うことから、
上記プログラム内においても任意のタイミングで処理す
ることができるためにプログラム実行上の制約が緩和さ
れ、制御を目的とした制御装置本来の処理を優先して実
行することができるという利点がある。In addition, the traceback data must be configured, including the idle time between when the program that performs the traceback sampling processing described above is activated by the generation of an interrupt signal, and when the data collection processing is actually performed. from,
Since the above program can be processed at any timing, restrictions on program execution are relaxed, and there is an advantage that the original processing of the control device for the purpose of control can be executed with priority.
第1図及び第2図は本発明の詳細な説明するためのタイ
ミングチャート、第3図は本発明の一実施例が適用され
る制御装置のブロック図、第4図及び第5図は第1及び
第2のプログラムの処理を示すフローチャートである。
1・・・マイクロコンピュータ 2・・・メモリ3
・・・分周カウンタ 4・・・割り込み信号発生器5
・・・入力用インタフェイス
6・・・出力用インタフェイス 7・・・データバス
I0.I、・・・割り込み要求信号
F・・・システム・クロック1 and 2 are timing charts for explaining the present invention in detail, FIG. 3 is a block diagram of a control device to which an embodiment of the present invention is applied, and FIGS. 4 and 5 are timing charts for explaining the present invention in detail. and a flowchart showing the processing of the second program. 1...Microcomputer 2...Memory 3
...Division counter 4...Interrupt signal generator 5
...Input interface 6...Output interface 7...Data bus I0. I,... Interrupt request signal F... System clock
Claims (1)
ウンタの計数値が読み出し可能であり、かつ複数の割り
込みタイミングで複数のプログラムが起動される制御シ
ステムにおいて、 第1のプログラムにより生成・更新された、トレースバ
ックするべき状態データとその更新時点における前記分
周カウンタの計数値とを併せて記憶すると共に、 前記第1のプログラムよりも起動周期が長く、かつ割り
込み優先度の低い第2のプログラムにおいて、この第2
のプログラムが前回起動されてから再び起動されるまで
の間に第1のプログラムによって記憶された前記分周カ
ウンタの計数値及び第2のプログラムの起動時点におけ
る前記分周カウンタの計数値から前記状態量データの更
新時点とトレースバックのためのサンプリング時点とを
同一時間軸上に換算し、 これらの同一時間軸上に換算された前記状態量データの
更新時点とトレースバックのためのサンプリング時点と
の関係に基づいて、前記サンプリング時点における前記
状態量データの値を決定し、この値を前記サンプリング
時点における状態量の時系列データとして再構成するこ
とを特徴とするトレースバック・データのサンプリング
方法。[Claims] In a control system in which a count value of a clock frequency division counter for managing a program activation cycle can be read and a plurality of programs are activated at a plurality of interrupt timings, A program that simultaneously stores the generated/updated state data to be traced back and the count value of the frequency division counter at the time of updating, and has a longer activation cycle and lower interrupt priority than the first program. In the second program, this second
The state is calculated based on the count value of the frequency division counter stored by the first program from when the program was last started until it is started again, and the count value of the frequency division counter at the time of starting the second program. The update time of the quantity data and the sampling time for traceback are converted to be on the same time axis, and the update time of the state quantity data converted to the same time axis and the sampling time for traceback are A method for sampling traceback data, characterized in that the value of the state quantity data at the sampling time is determined based on the relationship, and the value is reconstructed as time series data of the state quantity at the sampling time.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1089976A JPH02268304A (en) | 1989-04-10 | 1989-04-10 | Sampling method for trace back data |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1089976A JPH02268304A (en) | 1989-04-10 | 1989-04-10 | Sampling method for trace back data |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH02268304A true JPH02268304A (en) | 1990-11-02 |
Family
ID=13985705
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1089976A Pending JPH02268304A (en) | 1989-04-10 | 1989-04-10 | Sampling method for trace back data |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH02268304A (en) |
-
1989
- 1989-04-10 JP JP1089976A patent/JPH02268304A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5850338A (en) | Numerical control system using a personal computer and a method of controlling the same | |
| US9785587B2 (en) | Method for executing, within a multitasking onboard system, an application timed according to a plurality of different time domains including interruption management | |
| JP2000513468A (en) | Synchronization method | |
| JPH04257932A (en) | Chip for emulation for digital signal processor | |
| JP6808090B1 (en) | Control device and distributed processing method | |
| JPH02268304A (en) | Sampling method for trace back data | |
| EP4365690A1 (en) | Control device, system program, and method | |
| JP7014062B2 (en) | Control device, control method of control device, information processing program, and recording medium | |
| JP2002006944A (en) | Display with control function | |
| JPS6364588A (en) | Motor digital control device | |
| RU1798881C (en) | Direct current electric drive | |
| JPH11296251A (en) | Information processing device | |
| WO2025191852A1 (en) | Motor control device | |
| JPS6037003A (en) | Communication method between personal computer and sequence controller | |
| JPS6376053A (en) | Multicomputer equipment | |
| JPS63280307A (en) | Controller | |
| JP2557785Y2 (en) | Single chip microcomputer | |
| JPS63186335A (en) | Structure of computer | |
| JPH04192037A (en) | Semiconductor integrated circuit | |
| JPS6013575B2 (en) | Program counter monitoring device | |
| JP2001060162A (en) | In-circuit emulator | |
| JPS6273340A (en) | Central processing unit | |
| JPS61151745A (en) | Interruption processing system | |
| JPS63195781A (en) | Digital input device | |
| JP2001216005A (en) | Programmable controller |