JP2963676B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP2963676B2
JP2963676B2 JP15398797A JP15398797A JP2963676B2 JP 2963676 B2 JP2963676 B2 JP 2963676B2 JP 15398797 A JP15398797 A JP 15398797A JP 15398797 A JP15398797 A JP 15398797A JP 2963676 B2 JP2963676 B2 JP 2963676B2
Authority
JP
Japan
Prior art keywords
program
pid
control
scan
executed
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.)
Expired - Lifetime
Application number
JP15398797A
Other languages
Japanese (ja)
Other versions
JPH1055204A (en
Inventor
孝幸 押賀
克弘 藤原
雅規 内藤
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP15398797A priority Critical patent/JP2963676B2/en
Publication of JPH1055204A publication Critical patent/JPH1055204A/en
Application granted granted Critical
Publication of JP2963676B2 publication Critical patent/JP2963676B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラマブルコ
ントローラに係り、特に複数ループのPID制御プログ
ラムを内部に有するシーケンス制御プログラムを実行す
るのに好適なプログラマブルコントローラに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a programmable controller, and more particularly to a programmable controller suitable for executing a sequence control program having a plurality of loop PID control programs therein.

【0002】[0002]

【従来の技術】図8は、従来のプログラマブルコントロ
ーラの構成図である。従来のプログラマブルコントロー
ラは、CPU部1と、入出力部2とを備え、外部に設け
られたプログラミング装置3でユーザが作成した制御プ
ログラムをCPU部1に読み込ませて該制御プログラム
を実行させ、入出力部2を介してシーケンス制御対象5
を制御するようになっている。
2. Description of the Related Art FIG. 8 is a block diagram of a conventional programmable controller. The conventional programmable controller includes a CPU unit 1 and an input / output unit 2. The CPU 1 reads a control program created by a user using a programming device 3 provided externally and executes the control program. Sequence control target 5 via output unit 2
Is controlled.

【0003】CPU部1は、MPU11と、システムR
OM/RAM12と、プログラミング装置3等に接続さ
れる周辺装置インタフェース13と、制御プログラムを
格納するユーザメモリ15と、これらを相互に接続する
システムバス14とから成る。入出力部2は、ディジタ
ル信号入力ポート21と、ディジタル信号出力ポート2
2と、アナログ信号入力ポート23と、アナログ信号出
力ポート24とを備え、これらはシステムバス14に接
続されている。
[0003] The CPU unit 1 includes an MPU 11 and a system R.
It comprises an OM / RAM 12, a peripheral device interface 13 connected to the programming device 3 and the like, a user memory 15 storing a control program, and a system bus 14 interconnecting these. The input / output unit 2 includes a digital signal input port 21 and a digital signal output port 2.
2, an analog signal input port 23, and an analog signal output port 24, which are connected to the system bus 14.

【0004】ユーザメモリ15に格納される制御プログ
ラムは、通常スキャンプログラム部40と、該通常スキ
ャンプログラム部40の実行中に一定周期で割込処理さ
れる定周期スキャンプログラム部41とに分かれてい
る。通常スキャンプログラム部40では、該プログラム
部40の先頭からEND命令までがサイクリックに演算
処理され、また、定周期スキャンプログラム部41で
は、INT命令(定周期スキャンプログラムの開始位置
を示すラベル)からRTI命令(定周期スキャンプログ
ラムから通常スキャンプログラムへ戻るための命令)ま
でが割込処理される。
[0006] The control program stored in the user memory 15 is divided into a normal scan program section 40 and a fixed cycle scan program section 41 which is interrupted at a fixed cycle during execution of the normal scan program section 40. . In the normal scan program unit 40, the operation from the top of the program unit 40 to the END instruction is cyclically processed. In the fixed scan program unit 41, the INT command (label indicating the start position of the fixed scan program) is used. Interrupt processing is performed up to an RTI instruction (an instruction for returning from the fixed scan program to the normal scan program).

【0005】上記の制御プログラムは、プログラミング
装置3から周辺装置インタフェース13を介してユーザ
メモリ15に書き込まれ、MPU11は、この制御プロ
グラムの各命令を順次読み出し、入出力部2からの読み
込みデータを演算処理し、シーケンス制御対象5の制御
を行う。
The above-mentioned control program is written into the user memory 15 from the programming device 3 via the peripheral device interface 13, and the MPU 11 sequentially reads out each instruction of this control program and calculates read data from the input / output unit 2. Then, the sequence control target 5 is controlled.

【0006】従来のプログラマブルコントローラにおい
て、上述したように、制御プログラムを通常スキャンプ
ログラム部40と定周期スキャンプログラム部41に分
けたのは以下の理由による。即ち、通常スキャンプログ
ラム部40は、ユーザのプログラム量に比例して処理時
間が長くなる。したがって、シーケンス制御対象5の中
に、短い時間内での応答制御を必要とする制御対象部分
がある場合、前記のプログラム量が大きい程に、その制
御対象部分に対する短時間内での応答制御は不可能にな
ってしまうからである。そこで、制御プログラム内に定
周期スキャンプログラム部41を設けた上、必要とされ
ている短時間応答制御を定周期スキャンプログラム部4
1で定周期で実行させるとともに、併せて、ユーザが大
きなプログラムを組むことができるようにしている。
In the conventional programmable controller, as described above, the control program is divided into the normal scan program section 40 and the fixed-cycle scan program section 41 for the following reasons. That is, the processing time of the normal scan program unit 40 becomes longer in proportion to the program amount of the user. Therefore, when there is a control target portion in the sequence control target 5 that requires response control within a short period of time, the response control within a short period of time for the control target portion increases as the program amount increases. It becomes impossible. Therefore, a fixed-cycle scan program unit 41 is provided in the control program, and required short-term response control is performed in the fixed-cycle scan program unit 4.
In step 1, the program is executed at regular intervals, and at the same time, a large program can be created by the user.

【0007】尚、従来のプログラマブルコントローラに
関連するものとしては、例えば「日立評論」(1989
年7月発行(U.D.C.658.527.7’13
2)P43〜P48)に記載のものが挙げられる。
[0007] Incidentally, as a related to the conventional programmable controller, for example, "Hitachi Review" (1989)
Published in July, 2000 (UDC 658.527.7'13
2) P43 to P48).

【0008】[0008]

【発明が解決しようとする課題】ところで、プログラマ
ブルコントローラの制御対象としては、従来はシーケン
ス制御が行われるものに専ら限られていたが、近年、プ
ロセス制御にも応用しようとする傾向が出てきている。
しかし、プロセス制御を行うには、PID(比例・積分
・微分)制御を行う必要があるにも拘らず、これまでの
プログラマブルコントローラではPID制御が何等考慮
されていなく、したがって、以下のような不具合が生じ
るものとなっている。
Conventionally, the control target of the programmable controller has been limited exclusively to those that perform sequence control, but in recent years there has been a tendency to apply it to process control. I have.
However, although PID (proportional / integral / differential) control must be performed in order to perform process control, PID control has not been taken into account in any of the conventional programmable controllers. Is caused.

【0009】(1)PID演算を行う上で、制御対象の
測定データをサンプリングしてコントローラ内に取り込
む必要があるが、このサンプリングは一定周期毎に行わ
なければならない。しかし、ユーザプログラムの大きさ
によって処理時間が変わるため、このサンプリング周期
を固定することができず、したがって、PID定数を一
義に設定できないという問題がある。
(1) In performing the PID calculation, it is necessary to sample the measurement data to be controlled and take it into the controller. This sampling must be performed at regular intervals. However, since the processing time varies depending on the size of the user program, the sampling period cannot be fixed, and therefore, there is a problem that the PID constant cannot be uniquely set.

【0010】(2)上記(1)の問題は、PID演算を
定周期スキャンプログラム部41にプログラミングする
ことで対処することはできるが、制御しなければならな
いPIDループの数が多くなると、定周期スキャンの実
行時間が長くなり、通常スキャンプログラムが殆ど実行
されなくなってしまうという問題が生じてしまう。
(2) The problem (1) can be dealt with by programming the PID operation into the fixed-period scan program unit 41. However, if the number of PID loops to be controlled increases, the fixed-period scan program unit 41 must be controlled. A problem arises that the scan execution time becomes longer and the normal scan program is hardly executed.

【0011】本発明の目的は、ユーザプログラムの大き
さに拘らずPID定数が設定可とされ、しかも、PID
ループ数が多くなっても確実に通常スキャンプログラム
が実行され得るプログラマブルコントローラを提供する
ことにある。
An object of the present invention is to set a PID constant regardless of the size of a user program.
An object of the present invention is to provide a programmable controller that can surely execute a normal scan program even when the number of loops increases.

【0012】[0012]

【課題を解決するための手段】上記目的は、シーケンス
制御プログラムとn(n:2以上の任意整数)ループの
PID制御プログラムを格納したユーザメモリと、シー
ケンス制御対象との間でデータの送受を行うディジタル
信号入出力ポートと、PID制御対象との間でデータの
送受を行うアナログ信号入出力ポートと、シーケンス制
御プログラム中のタイマ経過値更新・自己診断・周辺サ
ービスを周期的に実行するシステム定周期スキャン処理
や、通常スキャン処理の最後に実行された上、実行命令
のアドレスを示すプログラムカウンタの値を通常スキャ
ンプログラムの先頭へ戻す処理・MPU内の演算器の診
断処理を実行するスキャンエンド処理を実行しつつ、上
記通常スキャン処理として前記シーケンス制御プログラ
ムを実行して前記ディジタル信号入出力ポートを介して
前記シーケンス制御対象をシーケンス制御している最中
に、前記nループのPID制御プログラムのうちから、
予め定められた選択上の更新順序に従って何れか1つの
PID制御プログラムのみを周期t的に選択の上、定周
期スキャン処理として割込処理することによって、前記
アナログ信号入出力ポートを介し前記PID制御対象を
PID制御するプロセッサとを備えるべく構成されるこ
とで達成される。
An object of the present invention is to transmit and receive data between a sequence control program and a user memory storing a PID control program of n (n: an arbitrary integer of 2 or more) loops and a sequence control target. A digital signal input / output port for transmitting and receiving data to and from a PID control target; and a system setting for periodically executing timer elapsed value updating, self-diagnosis, and peripheral services in a sequence control program. A process executed at the end of the periodic scan process or the normal scan process, and a process of returning the value of the program counter indicating the address of the execution instruction to the beginning of the normal scan program. A scan end process for executing a diagnostic process of a computing unit in the MPU. While executing the sequence control program as the normal scan process, While the through Ijitaru signal input and output ports are sequence controls the sequence control object, from among the PID control program of the n loops,
By selectively selecting only one of the PID control programs periodically in accordance with a predetermined selective update order and performing an interrupt process as a periodic scan process, the PID control program is performed via the analog signal input / output port. And a processor for performing PID control of the object.

【0013】定周期でPID制御プログラムを実行する
ことで、ユーザプログラムの大きさにかかわりなく定期
的に制御対象のデータを取り込むことができ、PID定
数を決めることが可能となるものである。しかも、定周
期でPID制御を行う場合に、1回で1ループのPID
演算しか行わないようにすれば、多数のPIDループが
あっても、それにより、通常スキャンプログラムの実行
が行われなくなるという事態は回避され得るものであ
る。
By executing the PID control program at a fixed period, data to be controlled can be periodically taken in regardless of the size of the user program, and a PID constant can be determined. In addition, when PID control is performed at a fixed period, one loop of PID
If only the calculation is performed, even if there are a large number of PID loops, it is possible to avoid a situation in which the execution of the normal scan program is not performed.

【0014】[0014]

【発明の実施の形態】以下、本発明の一実施形態を図1
から図7により説明する。図1は、本発明の一実施形態
に係るプログラマブルコントローラの構成図である。本
プログラマブルコントローラと、図8に示した従来のプ
ログラマブルコントローラとは、定周期スキャンプログ
ラム部41の内容と、PID制御対象6がアナログ信号
入出力ポート23,24に接続されている点が異なるだ
けで、他の構成は同じである。以下、定周期スキャンプ
ログラム部41の内容とMPU11が該内容に従って行
う動作について説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below with reference to FIG.
7 will be described with reference to FIG. FIG. 1 is a configuration diagram of a programmable controller according to an embodiment of the present invention. This programmable controller is different from the conventional programmable controller shown in FIG. 8 only in the content of the fixed-cycle scan program unit 41 and in that the PID control target 6 is connected to the analog signal input / output ports 23 and 24. The other configuration is the same. Hereinafter, the contents of the periodic scan program unit 41 and the operation performed by the MPU 11 according to the contents will be described.

【0015】本実施形態における定周期スキャンプログ
ラム部41は、通常スキャンプログラム部40の実行処
理中に20ミリ秒毎に読み出された上、実行される。そ
のプログラム構成は、開始位置を示すラベルであるIN
T命令で始まり、次に、ループ管理を行う命令PID
“C”があり、以下、実際のPID演算命令であるPI
D“1”〜PID“n”のnループの命令群が並び(各
命令では、PID制御対象6の測定値Xnをアナログ信
号入力ポート23から取り込むと共に、対応する目標値
WnをシステムROM/RAM12から読み出し、両値
Xn,Wnを用いてPID演算を行い、その結果を操作
量Ynとしてアナログ信号出力ポート24からPID制
御対象6に出力する)、最後に、通常スキャンプログラ
ムに戻る命令RTIがある。
The periodic scan program unit 41 in the present embodiment is read out and executed every 20 milliseconds during the execution process of the normal scan program unit 40. The program configuration includes a label indicating the start position, IN
Instruction PID that starts with T instruction and then performs loop management
There is “C”, and hereafter, PI which is an actual PID operation instruction
An instruction group of n loops of D “1” to PID “n” is arranged (in each instruction, the measured value Xn of the PID control target 6 is fetched from the analog signal input port 23 and the corresponding target value Wn is stored in the system ROM / RAM 12 And performs a PID operation using both values Xn and Wn, and outputs the result as an operation amount Yn from the analog signal output port 24 to the PID control target 6). Finally, there is an instruction RTI for returning to the normal scan program. .

【0016】ループ管理命令PID“C”は、PID演
算命令PID“1”〜PID“n”対応にソフト的に設
けられたPID演算起動フラグR“1”〜R“n”を、
定周期スキャンプログラム部41がMPU11に読み出
された上、割込み処理される毎に、順次選択的に1つの
みオンにおく働きをする。つまり、ある周期でこの定周
期スキャンプログラム部41が読み出され割込処理され
るとき、フラグR“i”のみがオンにおかれている場合
には、この定周期スキャンプログラム部41の実行では
PID“i”命令のみが実行されるものである。次の2
0ミリ秒後のこの定周期スキャンプログラム部41の実
行では、フラグR“i+1”のみがオンにおかれるの
で、PID“i+1”命令のみが実行されるものであ
る。つまり、1回の定周期スキャンプログラム部41の
実行では、1ループ分のPID演算命令のみが実行され
ているものである。本実施形態で斯かるプログラム構成
にしたのは、前述したように、PID制御を連続して実
行すると、PID制御の処理時間が長くなってしまい、
各割込処理の間で実行されるべき通常スキャンプログラ
ム部40の実行時間が無くなってしまうのを回避するた
めである。従って、高速のプロセッサを使用し各割込処
理間で必ず通常スキャンプログラムの実行時間が確保さ
れるのであれば、つまり、割込処理の時間間隔オーダで
通常スキャンプログラムと定周期スキャンプログラムの
実行が交互に並行処理されるのであれば、1回の定周期
スキャンプログラム部41の実行で、連続して2ルー
プ,3ループ等、複数ループのPID演算命令が連続的
に実行されてもよいものである。
The loop management instruction PID “C” includes PID operation start flags R “1” to R “n” provided in software corresponding to the PID operation instructions PID “1” to PID “n”.
Each time the periodic scan program unit 41 is read by the MPU 11 and interrupted, only one of them is sequentially turned on. That is, when the fixed-cycle scan program unit 41 is read and interrupted at a certain cycle, when only the flag R “i” is turned on, the execution of the fixed-cycle scan program unit 41 is not performed. Only the PID “i” instruction is executed. Next 2
In the execution of the fixed-cycle scan program unit 41 after 0 millisecond, only the flag R “i + 1” is turned on, so that only the PID “i + 1” instruction is executed. That is, in one execution of the fixed-period scan program unit 41, only one loop of the PID operation instruction is executed. The reason why such a program configuration is adopted in the present embodiment is that, as described above, if the PID control is executed continuously, the processing time of the PID control becomes longer,
This is to avoid running out of the execution time of the normal scan program unit 40 to be executed between each interruption process. Therefore, if the execution time of the normal scan program is always ensured between each interrupt process using a high-speed processor, that is, the execution of the normal scan program and the periodic scan program can be performed at the time interval order of the interrupt process. If the parallel processing is performed alternately, a plurality of loops, such as two loops and three loops, may be continuously executed by one execution of the periodic scan program unit 41. is there.

【0017】図2は、PID制御プログラムの作成説明
図である。図1のシステムROM/RAM12には、図
2の左側に記載されたサブルーチン命令FUN(0),
FUN(1),…,FUN(n)がPID演算命令PI
D(0),PID(1),…,PID(n)対応に予め
作成されており、ユーザは、各サブルーチン命令FUN
(i)全体を作成する必要はなく、各サブルーチン命令
FUN(i)で使用されるパラメータTz,Kp,KI
等をセットするだけで済むようになっている。これらパ
ラメータは、データエリアWR000,001,…に格
納されるのであるが、データエリアのアドレスを指定し
ながらパラメータをセットするのは、ユーザにとっては
不便であるので、例えば図2の右側の図面をCRTに描
き、ここでTzの値を具体的に指定し得るようにする。
FIG. 2 is an explanatory diagram for creating a PID control program. The system ROM / RAM 12 shown in FIG. 1 has subroutine instructions FUN (0),
FUN (1),..., FUN (n) are PID operation instructions PI
D (0), PID (1),..., PID (n).
(I) It is not necessary to create the whole, and the parameters Tz, Kp, KI used in each subroutine instruction FUN (i)
And so on. These parameters are stored in the data area WR000,001,..., But it is inconvenient for the user to set the parameters while specifying the address of the data area. Draw on the CRT so that the value of Tz can be specified specifically.

【0018】このようにしてユーザが各パラメータをセ
ットし、MPU11が前述したフラグを参照してi番目
のサブルーチン命令FUN(i)を起動すると、MPU
11は該サブルーチン命令FUN(i)の実行に必要な
パラメータをデータエリアから検索の上、PID演算を
実行しPID制御対象(i)を制御する。
In this way, when the user sets each parameter and the MPU 11 activates the i-th subroutine instruction FUN (i) with reference to the aforementioned flag, the MPU 11
Numeral 11 searches the data area for parameters necessary for executing the subroutine instruction FUN (i), executes PID calculation, and controls the PID control target (i).

【0019】図3は、本実施形態におけるプログラマブ
ルコントローラのシステム構成図である。周辺装置イン
タフェース13を介してユーザメモリMEM内にプログ
ラミングされたシーケンス制御プログラムとPID制御
プログラムはCPUが実行する。CPUとシーケンス制
御対象たる機械との間ではディジタル入力DIとディジ
タル出力DOとを介して検出信号と制御信号が送受さ
れ、CPUとアナログ制御対象(本実施形態ではプロセ
ス制御対象)との間ではアナログ入力AIとアナログ出
力AOとを介して検出信号と制御信号とが送受される。
これにより、シーケンス制御対象はシーケンス制御さ
れ、プロセス制御対象はPID制御される。図4は、P
IDループが複数ある場合のシステム構成図である。こ
の実施形態では、CPUを備える基本ユニット30にC
PUを持たない増設ユニット31,32,33が接続さ
れ、また、基本ユニット30にはリモート回線を介して
離れた位置に増設ユニット34,35が接続されてい
る。各ユニットはモジュール化されており、図示の例で
は、AIはアナログインプットモジュール,AOはアナ
ログアウトプットモジュールを示している。この例で
は、PID制御対象が3つあり、1番目は基本ユニット
30に設けられたAI,AOモジュールに接続され、2
番目は増設ユニット33のAI,AOモジュールに接続
され、3番目は増設ユニット35のAI,AOモジュー
ルに接続されている。そして、各PID制御対象は、基
本ユニット30のCPUにより制御されるが、前述した
ように、1回目の割込処理では1番目の制御対象が制御
され、2回目の割込処理では2番目の制御対象が制御さ
れ、3回目の割込処理では3番目の制御対象が制御さ
れ、4回目の割込処理では再び1番目の制御対象が制御
されるようになっている。
FIG. 3 is a system configuration diagram of the programmable controller according to the present embodiment. The sequence control program and the PID control program programmed in the user memory MEM via the peripheral device interface 13 are executed by the CPU. A detection signal and a control signal are transmitted and received between the CPU and the machine to be sequence controlled via the digital input DI and the digital output DO, and an analog signal is transmitted between the CPU and the analog control target (the process control target in the present embodiment). A detection signal and a control signal are transmitted and received via the input AI and the analog output AO.
Thereby, the sequence control target is subjected to sequence control, and the process control target is subjected to PID control. FIG.
FIG. 2 is a system configuration diagram when there are a plurality of ID loops. In this embodiment, the basic unit 30 including the CPU has C
Extension units 31, 32, 33 having no PU are connected, and extension units 34, 35 are connected to the basic unit 30 at remote positions via a remote line. Each unit is modularized. In the illustrated example, AI indicates an analog input module, and AO indicates an analog output module. In this example, there are three PID control targets, and the first is connected to the AI and AO modules provided in the basic unit 30,
The third is connected to the AI and AO modules of the extension unit 33, and the third is connected to the AI and AO modules of the extension unit 35. Each PID control target is controlled by the CPU of the basic unit 30. As described above, the first control target is controlled in the first interrupt processing, and the second control target is controlled in the second interrupt processing. The control target is controlled, the third control target is controlled in the third interrupt processing, and the first control target is controlled again in the fourth interrupt processing.

【0020】図5は、PID制御ループが2ループの場
合の制御タイミングを示すチャートである。この実施形
態におけるCPUにはその動作モードとして4種類あ
り、夫々のモードにおけるCPU動作は次の通りであ
る。
FIG. 5 is a chart showing the control timing when the PID control loop is two loops. The CPU in this embodiment has four types of operation modes, and the CPU operation in each mode is as follows.

【0021】システム定周期スキャン処理: CPUが10ミリ秒毎に実行する処理で(図5において
は、図を見やすくするために、2回分の処理をまとめて
表現してあるため、20ミリ秒毎の処理のように示して
ある。実際には、3ミリ秒の処理の後に4ミリ秒の処理
を行い、次に3ミリ秒の処理を行った後、再び(最初か
ら10ミリ秒後)3ミリ秒の処理を行うようになってい
る。図5では、処理の6ミリ秒の中央に線分を記載する
ことで上記の各処理を省略してある)、シーケンスプロ
グラム中のタイマの経過値更新・自己診断・周辺サービ
スを実行する。
System periodic scan process: This is a process executed by the CPU every 10 milliseconds. (In FIG. 5, two processes are collectively represented for easy viewing, In practice, the processing of 3 ms is followed by the processing of 4 ms, then the processing of 3 ms, and again (after 10 ms from the beginning). In FIG. 5, each of the above processes is omitted by drawing a line segment at the center of 6 milliseconds in the process), and the elapsed value of the timer in the sequence program Perform update, self-diagnosis, and peripheral services.

【0022】20ミリ秒毎の定周期スキャン処理: CPUが20ミリ秒毎に必ず実行する処理で、処理a,
b,c,dからなる。処理aでは、PIDループ1の定
周期スキャン開始命令INTが実行され、処理bでは、
ループ管理命令PID“C"が実行され、次に処理cでP
ID演算命令が実行され、最後に処理dで定周期スキャ
ン終了処理を行う。
Periodic scan processing every 20 milliseconds: Processing that is always executed by the CPU every 20 milliseconds.
b, c, d. In the process a, the periodic scan start instruction INT of the PID loop 1 is executed, and in the process b,
The loop management instruction PID “C” is executed, and then P
An ID calculation instruction is executed, and finally, a periodic scan end process is performed in process d.

【0023】スキャンエンド処理: 通常スキャン処理の最後に実行される処理であり、通常
スキャンプログラムの「END」命令で起動され、実行
命令のアドレスを示すプログラムカウンタの値を通常ス
キャンプログラムの先頭へ戻す処理や、MPU内の演算
器の診断処理を実行する。
Scan end processing: This processing is executed at the end of the normal scan processing, is started by the "END" instruction of the normal scan program, and returns the value of the program counter indicating the address of the execution instruction to the top of the normal scan program. It performs processing and diagnostic processing of the arithmetic unit in the MPU.

【0024】通常スキャン処理: ユーザメモリに書き込まれた通常スキャンプログラムを
先頭から「END」命令までサイクリックに実行する。
Normal scan processing: The normal scan program written in the user memory is cyclically executed from the top to the "END" instruction.

【0025】図5に示す定周期スキャン処理では、処理
cでPID演算を実行しているが、最初の定周期スキャ
ン処理ではPIDループ1の演算を実行し、2回目の定
周期スキャン処理ではPIDループ2の演算を実行し、
3回目ではPIDループ1を、4回目ではPIDループ
2を実行するという具合に、PIDループ1とPIDル
ープ2の処理を20ミリ秒毎に交互に実行する。従っ
て、1つのPIDループの処理は40ミリ秒に1回の一
定周期で実行されることになり、各PIDループは確実
に一定のサンプリング周期で実行されることになる。
In the periodic scan process shown in FIG. 5, the PID calculation is performed in process c. However, in the first periodic scan process, the operation of the PID loop 1 is performed, and in the second periodic scan process, the PID calculation is performed. Perform the operation of loop 2,
The PID loop 1 is executed at the third time, the PID loop 2 is executed at the fourth time, and the processes of the PID loop 1 and the PID loop 2 are alternately executed every 20 milliseconds. Therefore, the processing of one PID loop is executed once every 40 milliseconds at a constant period, and each PID loop is surely executed at a constant sampling period.

【0026】図6は、PID制御ループが3ループの場
合のタイミングチャートである。定周期スキャン処理で
各ループは1ループづつ重複することなく実行される。
この例では、ループ1が60ミリ秒毎(3ループを実行
するときの最小サンプリング時間)に処理され、ループ
2が120ミリ秒毎に処理され、ループ3が240ミリ
秒毎に処理される。従って、各ループは必ず一定周期で
実行されるが、20ミリ秒毎の定周期スキャン処理で毎
回PIDループが実行されることは無くなり、図6に↓
印で示すタイミングでは通常スキャンプログラムを実行
する余裕ができ、通常スキャンプログラムの処理を多く
とることができる。図7に、PID演算機能の仕様の一
例を示す。
FIG. 6 is a timing chart when three PID control loops are provided. In the periodic scan process, each loop is executed one by one without overlapping.
In this example, loop 1 is processed every 60 milliseconds (minimum sampling time when executing three loops), loop 2 is processed every 120 milliseconds, and loop 3 is processed every 240 milliseconds. Therefore, although each loop is always executed at a fixed period, the PID loop is not executed every time in the fixed period scan processing every 20 milliseconds.
At the timing indicated by the mark, there is a margin for executing the normal scan program, and the processing of the normal scan program can be increased. FIG. 7 shows an example of the specifications of the PID calculation function.

【0027】尚、PID制御は、例えば温度を一定温度
に制御するような場合に行うものであり、温度変化が急
な場合にはサンプリング間隔を短くした方が精度の高い
制御が可能になる。しかし、温度が一定温度近辺の定常
状態になった後は、サンプリング間隔を長くしても、制
御精度はそれほど落ちない。そこで、制御対象が目標値
近辺に制御され制御量が安定した後は、サンプリング周
期を延ばし、その分を通常スキャンプログラムの実行に
割くことで、より円滑な制御を実行できるようになる。
Note that the PID control is performed, for example, when the temperature is controlled to a constant temperature. When the temperature changes rapidly, a shorter sampling interval enables more accurate control. However, after the temperature has reached a steady state near a certain temperature, the control accuracy does not decrease so much even if the sampling interval is lengthened. Therefore, after the control object is controlled to be close to the target value and the control amount is stabilized, the sampling period is extended and the control period is divided into the execution of the normal scan program, whereby smoother control can be performed.

【0028】本実施形態によれば、ユーザプログラム
(シーケンス制御プログラム部分)の大きさに関係な
く、所定周期でPID演算を実行できるので、シーケン
ス制御とPID制御を1つのCPUで実行しても、PI
D制御のサンプリング間隔が変化することなく実行で
き、PID定数をサンプリング時間に対応して調節する
ような複雑な処理が不用になる。また、CPUが1つで
済むので、シーケンス演算とPID演算の組合せを調整
することで、システムの制御装置のコスト低減を図るこ
ともできる。更に、PID制御とシーケンス制御の演算
負荷の割合を、各PIDループの実行周期を指定するこ
とで調整でき、シーケンス制御の応答時間の調整が可能
になる。
According to the present embodiment, the PID operation can be executed at a predetermined cycle regardless of the size of the user program (sequence control program portion). Therefore, even if the sequence control and the PID control are executed by one CPU, PI
The D control can be performed without changing the sampling interval, and complicated processing such as adjusting the PID constant in accordance with the sampling time is unnecessary. Further, since only one CPU is required, the cost of the control device of the system can be reduced by adjusting the combination of the sequence operation and the PID operation. Furthermore, the ratio of the operation load of PID control and sequence control can be adjusted by specifying the execution cycle of each PID loop, and the response time of sequence control can be adjusted.

【0029】[0029]

【発明の効果】本発明によるプログラマブルコントロー
ラによれば、ユーザプログラムの大きさに拘らずPID
定数が設定可とされ、しかも、PIDループ数が多くな
っても確実に通常スキャンプログラムが実行され得るも
のとなっている。
According to the programmable controller of the present invention, the PID is independent of the size of the user program.
A constant can be set, and even if the number of PID loops increases, the normal scan program can be executed without fail.

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

【図1】本発明の一実施形態に係るプログラマブルコン
トローラの構成図
FIG. 1 is a configuration diagram of a programmable controller according to an embodiment of the present invention.

【図2】本発明の一実施形態に係るPID制御プログラ
ム作成方法の説明図
FIG. 2 is an explanatory diagram of a PID control program creation method according to an embodiment of the present invention.

【図3】図1のプログラマブルコントローラで1ループ
のPID制御を行う場合の一システム構成図
FIG. 3 is a system configuration diagram in a case where one loop of PID control is performed by the programmable controller of FIG. 1;

【図4】図1に示すプログラマブルコントローラで3ル
ープのPID制御を行う場合の一システム構成図
FIG. 4 is a system configuration diagram in the case where three-loop PID control is performed by the programmable controller shown in FIG. 1;

【図5】2ループのPID制御を行う場合の一例に係る
タイミングチャート
FIG. 5 is a timing chart according to an example of a case where two-loop PID control is performed;

【図6】3ループのPID制御を行う場合の一例に係る
タイミングチャート
FIG. 6 is a timing chart according to an example of a case where PID control of three loops is performed.

【図7】PID演算機能の一仕様説明図FIG. 7 is an explanatory diagram of one specification of a PID calculation function.

【図8】従来のプログラマブルコントローラの構成図FIG. 8 is a configuration diagram of a conventional programmable controller.

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

1…CPU部、2…入出力部、3…プログラミング装
置、5…シーケンス制御対象、6…PID制御対象、1
1…MPU、12…システムROM/RAM、13…周
辺装置インタフェース、14…システムバス、15…ユ
ーザメモリ、40…通常スキャンプログラム部、41…
定周期スキャンプログラム部。
DESCRIPTION OF SYMBOLS 1 ... CPU part, 2 ... input / output part, 3 ... programming device, 5 ... sequence control object, 6 ... PID control object, 1
DESCRIPTION OF SYMBOLS 1 ... MPU, 12 ... System ROM / RAM, 13 ... Peripheral device interface, 14 ... System bus, 15 ... User memory, 40 ... Normal scan program part, 41 ...
Fixed scan program section.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭64−72202(JP,A) 特開 昭61−220001(JP,A) 特開 平1−140301(JP,A) (58)調査した分野(Int.Cl.6,DB名) G05B 19/05 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-64-72202 (JP, A) JP-A-61-220001 (JP, A) JP-A-1-140301 (JP, A) (58) Field (Int.Cl. 6 , DB name) G05B 19/05

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 シーケンス制御プログラムとn(n:2
以上の任意整数)ループのPID制御プログラムを格納
したユーザメモリと、シーケンス制御対象との間でデー
タの送受を行うディジタル信号入出力ポートと、PID
制御対象との間でデータの送受を行うアナログ信号入出
力ポートと、シーケンス制御プログラム中のタイマ経過
値更新・自己診断・周辺サービスを周期的に実行するシ
ステム定周期スキャン処理や、通常スキャン処理の最後
に実行された上、実行命令のアドレスを示すプログラム
カウンタの値を通常スキャンプログラムの先頭へ戻す処
理・MPU内の演算器の診断処理を実行するスキャンエ
ンド処理を実行しつつ、上記通常スキャン処理として前
記シーケンス制御プログラムを実行して前記ディジタル
信号入出力ポートを介して前記シーケンス制御対象をシ
ーケンス制御している最中に、前記nループのPID制
御プログラムのうちから、予め定められた選択上の更新
順序に従って何れか1つのPID制御プログラムのみを
周期t的に選択の上、定周期スキャン処理として割込処
理することによって、前記アナログ信号入出力ポートを
介し前記PID制御対象をPID制御するプロセッサと
を備えるプログラマブルコントローラ。
A sequence control program and n (n: 2
(Arbitrary integer above) Stores PID control program for loop
Data between the user memory and the sequence control target
Digital signal input / output port for transmitting and receiving
Analog signal input / output for sending / receiving data to / from the control target
Output port and timer in sequence control program
System that periodically executes value update, self-diagnosis, and peripheral services
At the end of the regular scan process or the regular scan process
A program that shows the address of the execution instruction after being executed
Returning the counter value to the beginning of the normal scan program
Scan and execute diagnostic processing of the arithmetic and logic units in the MPU
While executing the normal scan process,
The sequence control program is executed to execute the digital
The sequence control target is switched via the signal input / output port.
During the sequence control, the PID control of the n loop is performed.
Pre-determined optional updates from your program
According to the order, only one PID control program
After selecting periodically, interrupt processing as periodic scan processing
The analog signal input / output port
A processor for performing PID control on the PID control target via
A programmable controller comprising:
JP15398797A 1997-06-11 1997-06-11 Programmable controller Expired - Lifetime JP2963676B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15398797A JP2963676B2 (en) 1997-06-11 1997-06-11 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15398797A JP2963676B2 (en) 1997-06-11 1997-06-11 Programmable controller

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP1282010A Division JP2799009B2 (en) 1989-10-31 1989-10-31 Programmable controller

Publications (2)

Publication Number Publication Date
JPH1055204A JPH1055204A (en) 1998-02-24
JP2963676B2 true JP2963676B2 (en) 1999-10-18

Family

ID=15574442

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15398797A Expired - Lifetime JP2963676B2 (en) 1997-06-11 1997-06-11 Programmable controller

Country Status (1)

Country Link
JP (1) JP2963676B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788069B2 (en) * 2011-09-27 2014-07-22 Fisher-Rosemount Systems, Inc. Method and apparatus for eliminating aliasing
CN105659174B (en) * 2014-10-02 2018-03-23 三菱电机株式会社 Dcs control device and elementary cell

Also Published As

Publication number Publication date
JPH1055204A (en) 1998-02-24

Similar Documents

Publication Publication Date Title
US4663730A (en) Sequence controller
US5889669A (en) Programmable controller allowing an external peripheral device to monitor an internal operation state of a CPU unit
JP2963676B2 (en) Programmable controller
JPH01291303A (en) Programmable controller
JP2799009B2 (en) Programmable controller
CA1247247A (en) Electronic postage meter having a status monitor
US5771167A (en) Synchronous control method and apparatus therefor
JP2752514B2 (en) Program execution method of CNC device
EP0476154A1 (en) System for executing instruction of pc
JP3015793B1 (en) Programmable controller
JP3638821B2 (en) Numerical controller
US5500809A (en) Microcomputer system provided with mechanism for controlling operation of program
JP3167245B2 (en) Programmable controller operating state monitoring device
JPH03154104A (en) Positioning controller
JPH0764476A (en) Programmable controller
JPS63284604A (en) Programmable controller
JPH1083204A (en) Programmable controller and control arithmetic parameter output method
JPH0782370B2 (en) Sequencer timer processor
JPS615349A (en) Programmable controller
JP2875841B2 (en) Programmable controller
JP3358112B2 (en) Programmable controller
JPS616704A (en) Programmable controller
JPS61151745A (en) Interruption processing system
JPH0682285B2 (en) Programmable controller
JPH03282906A (en) Programmable controller for distributed control system