JP2799009B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP2799009B2
JP2799009B2 JP1282010A JP28201089A JP2799009B2 JP 2799009 B2 JP2799009 B2 JP 2799009B2 JP 1282010 A JP1282010 A JP 1282010A JP 28201089 A JP28201089 A JP 28201089A JP 2799009 B2 JP2799009 B2 JP 2799009B2
Authority
JP
Japan
Prior art keywords
pid
program
control
loop
processing
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
JP1282010A
Other languages
Japanese (ja)
Other versions
JPH03144706A (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 JP1282010A priority Critical patent/JP2799009B2/en
Publication of JPH03144706A publication Critical patent/JPH03144706A/en
Application granted granted Critical
Publication of JP2799009B2 publication Critical patent/JP2799009B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明はプログラマブルコントローラに係り、特に、
PID制御プログラムを内部に有するシーケンス制御プロ
グラムを実行するに好適なプログラマブルコントローラ
に関する。
The present invention relates to a programmable controller, and more particularly, to a programmable controller.
The present invention relates to a programmable controller suitable for executing a sequence control program having a PID control program therein.

[従来の技術] 第8図は、従来のプログラマブルコントローラの構成
図である。従来のプログラマブルコントローラは、CPU
部1と、入出力部2とを備え、外部に設けられたプログ
ラミング装置3でユーザが作成した制御プログラムをCP
U部1に読み込ませて該制御プログラムを実行させ、入
出力部2を介してシーケンス制御対象5を制御するよう
になっている。CPU部1は、MPU11と、システムROM/RAM1
2と、プログラミング装置3等に接続される周辺装置イ
ンタフェース13と、制御プログラムを格納するユーザメ
モリ15と、これらを相互に接続するシステムバス14とか
ら成る。入出力部2は、ディジタル信号入力ポート21
と、ディジタル信号出力ポート22と、アナログ信号入力
ポート23と、アナログ信号出力ポート24とを備え、これ
らはシステムバス14に接続されている。
[Prior Art] FIG. 8 is a configuration diagram of a conventional programmable controller. Conventional programmable controllers use a CPU
Unit 1 and an input / output unit 2, and a control program created by a user using a programming device 3 provided outside
The control program is executed by being read by the U unit 1, and the sequence control target 5 is controlled via the input / output unit 2. The CPU unit 1 includes an MPU 11 and a system ROM / RAM 1
2, 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 has a digital signal input port 21
, A digital signal output port 22, an analog signal input port 23, and an analog signal output port 24, which are connected to the system bus 14.

ユーザメモリ15に格納される制御プログラムは、通常
スキャンプログラム部40と、該通常スキャンプログラム
部40の実行中の一定周期で割込処理される定周期スキャ
ンプログラム部41とに分かれている。通常スキャンプロ
グラム部40は、該プログラム部40の先頭からEND命令ま
でをサイクリックに演算処理され、定周期スキャンプロ
グラム部41は、INT命令(定周期スキャンプログラムの
開始位置を示すラベル)からRTI命令(定周期スキャン
プログラムから通常スキャンプログラムへ戻るための命
令)までを割込処理される。
The control program stored in the user memory 15 is divided into a normal scan program unit 40 and a fixed-cycle scan program unit 41 that is interrupted at a constant period during execution of the normal scan program unit 40. The normal scan program section 40 performs a cyclic operation from the beginning of the program section 40 to the END instruction, and the fixed scan program section 41 executes the RTI instruction from the INT instruction (label indicating the start position of the fixed scan program). (Instructions for returning from the periodic scan program to the normal scan program) are interrupted.

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

従来のプログラマブルコントローラにおいて、上述し
たように、制御プログラムを通常スキャンプログラム部
40と定周期スキャンプログラム部41に分けたのは、次の
理由による。通常スキャンプログラム部40は、ユーザの
プログラム量に比例して処理時間が長くなる。従って、
制御対象の中で、短い応答時間を必要とする制御部分が
ある場合、前記のプログラム量が大きいとこの短時間で
応答すべき制御部分の制御は不可能になってしまう。そ
こで、制御プログラムに定周期スキャンプログラム部41
を設け、短時間応答の必要な制御をこの定周期スキャン
プログラム部41で行わせることで、短時間応答制御を定
時間で実行させ、合わせて、ユーザが大きなプログラム
を組むことができるようにしている。
In the conventional programmable controller, as described above, the control program is stored in the normal scan program section.
The reason for dividing into 40 and the periodic scan program section 41 is as follows. 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 part that requires a short response time in the control target, control of a control part that should respond in a short time becomes impossible if the program amount is large. Therefore, the periodic scan program section 41 is included in the control program.
Is provided, and the control that requires a short-time response is performed by the fixed-period scan program unit 41, so that the short-time response control is performed at a fixed time so that the user can form a large program. I have.

尚、従来のプログラマブルコントローラに関連するも
のとして、例えば、「日立評論」1989年7月発行(U.D.
C.658.527.7′132)P43〜P48に記載のものがある。
As related to the conventional programmable controller, for example, "Hitachi Review" issued in July 1989 (UD
C.658.527.7'132) There are those described on pages 43 to 48.

[発明が解決しようとする課題] プログラマブルコントローラの制御対象は、従来はシ
ーケンス制御を行うものに限られていたが、近年は、プ
ロセス制御にも応用しようとする傾向が出てきている。
しかし、プロセス制御を行うには、PID(比例,積分,
微分)制御を行う必要がある。しかし、従来のプログラ
マブルコントローラは、PID制御については配慮してお
らず、以下のような問題が生じるという不具合がある。
[Problems to be Solved by the Invention] The control target of the programmable controller has conventionally been limited to one that performs sequence control, but in recent years, there has been a tendency to apply it to process control.
However, PID (proportional, integral,
Differential) control. However, the conventional programmable controller does not consider PID control, and has a problem that the following problem occurs.

(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, but 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.

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

(3)シーケンス演算命令には通常四則演算までしかな
いが、PID演算は積分,微分演算まで含まれるので、プ
ログラムの長さはPID制御プログラムの方が長くなり、
また、そのプログラミングを多大の労力を要することに
なる。
(3) The sequence operation instruction usually has only four arithmetic operations. However, since the PID operation includes the integration and the differential operation, the program length is longer in the PID control program.
Also, the programming requires a great deal of effort.

本発明の目的は、ユーザプログラムの大きさにかかわ
らずPID定数を設定することができ、PIDループ数が多く
なっても確実に通常スキャンプログラムを実行すること
ができ、容易にPID制御プログラムを作成することので
きるプログラマブルコントローラを提供することにあ
る。
An object of the present invention is to be able to set a PID constant regardless of the size of a user program, to execute a normal scan program reliably even when the number of PID loops is large, and to easily create a PID control program. To provide a programmable controller capable of performing such operations.

〔課題を解決するための手段〕[Means for solving the problem]

上記目的は、シーケンス演算処理プログラム中に存在
する定周期演算処理プログラムの中に複数ループのPID
制御プログラムを有しこれらのプログラムを実行処理す
るプロセッサを備えるプログラマブルコントローラにお
いて、前記プロセッサは、前記定周期演算処理プログラ
ムの実行時に1ループのPID制御プログラムのみを実行
し次の定周期演算処理プログラムの実行時には別の1ル
ープのPID制御プログラムを実行する手段と、複数ルー
プのPID制御プログラムの中で任意のループの実行間隔
をループ数の任意の倍数で設定する手段とを備えること
で、達成される。
The purpose of the above is to use multiple loop PIDs in the fixed-cycle arithmetic processing program that exists in the sequence arithmetic processing program.
In a programmable controller having a control program and having a processor for executing and executing these programs, the processor executes only one loop of the PID control program at the time of execution of the fixed-cycle operation processing program, and executes the next fixed-cycle operation processing program. This is achieved by providing means for executing another one-loop PID control program at the time of execution, and means for setting an execution interval of an arbitrary loop in the multiple-loop PID control program at an arbitrary multiple of the number of loops. You.

定期的にPID制御プログラムを実行することで、ユー
ザプログラムの大きさにかかわりなく定期的に制御対象
のデータを取り込むことができ、PID定数を決めること
が可能となる。更に、定期的でPID制御を行うため多数
のPIDループがあっても、それにより、通常スキャンプ
ログラムの実行が行われなくなるという事態は回避さ
れ、しかも、PID制御の実行間隔を任意の倍数で設定で
きるようにしたため、通常スキャンプログラムの実行を
確保できる。
By periodically executing the PID control program, the data to be controlled can be periodically taken in regardless of the size of the user program, and the PID constant can be determined. Furthermore, even if there are a large number of PID loops for performing PID control on a regular basis, it is possible to avoid a situation in which the execution of the normal scan program is not performed, and to set the execution interval of the PID control at an arbitrary multiple. Because it is possible, the execution of the normal scan program can be ensured.

[実施例] 以下、本発明に一実施例を第1図乃至第7図を参照し
て説明する。
Embodiment An embodiment of the present invention will be described below with reference to FIGS. 1 to 7.

第1図は、本発明の一実施例に係るプログラマブルコ
ントローラの構成図である。本プログラマブルコントロ
ーラと、第8図に示した従来のプログラマブルコントロ
ーラとは、定周期スキャンプログラム部41の内容と、PI
D制御対象6がアナログ信号入出力ポート23,24に接続さ
れている点が異なるだけで、他の構成は同じである。以
下、定周期スキャンプログラム部41の内容とMPU11が該
内容に従って行う動作について説明する。
FIG. 1 is a configuration diagram of a programmable controller according to one embodiment of the present invention. The present programmable controller and the conventional programmable controller shown in FIG.
The other configuration is the same except that the D control target 6 is connected to the analog signal input / output ports 23 and 24. 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.

本実施例における定周期スキャンプログラム部41は、
通常スキャンプログラム部40の実行処理中に20ミリ秒毎
に読み出されて実行される。そのプログラム構成は、開
始位置を示すラベルであるINT命令で始まり、次に、ル
ープ管理を行う命令PID“C"があり、以下、実際のPID演
算命令であるPID“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 includes:
It is read out and executed every 20 milliseconds during the execution processing of the normal scan program unit 40. The program configuration starts with an INT instruction which is a label indicating a start position, and then there is an instruction PID “C” for performing loop management. Hereinafter, PID “1” to PID “n” which are actual PID operation instructions (In each instruction, the measured value Xn of the PID control target 6 is taken from the analog signal input port 23 and the corresponding target value Wn
From the system ROM / RAM12 and using both values Xn and Wn
The PID calculation is performed, and the result is output to the PID control target 6 from the analog signal output port 24 as the manipulated variable Yn. Finally, there is an instruction RTI that returns to the normal scan program.

ループ管理命令PID“C"は、PID演算命令PID“1"〜PID
“n"対応にソフト的に設けられたPID演算起動フラグR
“1"〜R“n"を、この定周期スキャンプログラム部41が
MPU11に読み出され割込み処理される毎に順次1つづつ
オンする働きをする。つまり、ある周期でこの定周期ス
キャンプログラム部41が読み出され割込処理されるとき
のフラグR“i"がオンになっている場合には、この定周
期スキャンプログラム部41の実行ではPID“i"命令のみ
が実行され、次の20ミリ秒後のこの定周期スキャンプロ
グラム部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” is a PID operation instruction PID “1” to PID
PID operation start flag R provided in software for "n"
“1” to R “n” are converted by the fixed-cycle scan program unit 41.
Each time it is read by the MPU 11 and interrupted, it is turned on one by one. In other words, if the flag R “i” at the time when the periodic scan program unit 41 is read and interrupted at a certain cycle is on, the PID “ Only the “i” instruction is executed, and in the execution of the fixed-cycle scan program unit 41 after the next 20 milliseconds, the PID “i + 1” instruction is executed because the flag R “i + 1” is on. That is,
In one execution of the fixed-cycle scan program unit 41, only one loop of the PID operation instruction is executed. In the present embodiment, such a program configuration is performed, as described above, when the PID control is continuously performed, the processing time of the PID control becomes longer, and the normal scan program to be executed between the interrupt processes is performed. This is to avoid running out of the execution time of the unit 40. Therefore, if a high-speed processor is used and the execution time of the normal scan program is always ensured between each interrupt processing, that is, the execution of the normal scan program and the execution of the fixed-cycle scan program alternately at the time interval order of the interrupt processing. If the parallel processing is performed in parallel, the PID calculation instruction of a plurality of loops such as two loops or three loops may be continuously executed by one execution of the fixed-cycle scan program unit 41. Absent.

第2図は、PID制御プログラムの作成説明図である。
第1図のシステムROM/RAM12には、第2図の左側に記載
されたサブルーチン命令FUN(0),FUN(1),…,FUN
(n)がPID演算命令PID(0),PID(1),…,PID
(n)対応に予め作成されており、ユーザは、各サブル
ーチン命令FUN(i)全体を作成する必要がなく、各サ
ブルーチン命令FUN(i)で使用されるパラメータTz,K
p,KI等をセットするだけで済むようになっている。これ
らのパラメータは、データエリアWR000,001,…に格納さ
れるのであるが、データエリアのアドレスの指定しなが
らパラメータをセットするのは、ユーザにとっては不便
であるので、例えば第2図の右側の図面をCRIに描き、
ここでTz=20mm s等と指定することで行えるようにす
る。
FIG. 2 is an explanatory diagram of creating a PID control program.
The subroutine instructions FUN (0), FUN (1),..., FUN described on the left side of FIG. 2 are stored in the system ROM / RAM 12 of FIG.
(N) is the PID operation instruction PID (0), PID (1), ..., PID
(N) It is created in advance so that the user does not need to create the entire subroutine instruction FUN (i), and the parameters Tz, K used in each subroutine instruction FUN (i) are not required.
You only need to set p, KI, etc. These parameters are stored in the data areas WR000, 001,..., But it is inconvenient for the user to set the parameters while specifying the address of the data area. Draw the drawing on CRI,
Here, it can be performed by designating Tz = 20 mm s or the like.

このようにしてユーザが各パラメータをセットし、MP
U11が前述したフラグを参照しi番目のサブルーチン命
令FUN(i)を起動すると、MPU11は該サブルーチン命令
FUN(i)の実行に必要なパラメータをデータエリアを
検索することで探し、PID演算を実行しPID制御対象
(i)を制御する。
In this way, the user sets each parameter and
When U11 refers to the flag described above and activates the i-th subroutine instruction FUN (i), the MPU 11
A parameter necessary for executing FUN (i) is searched by searching the data area, and a PID operation is executed to control the PID control target (i).

第3図は、本実施例におけるプログラムブルコントロ
ーラのシステム構成図である。周辺装置インタフェース
13を介してユーザメモリMEM内にプログラミングされた
シーケンス制御プログラムとPID制御プログラムはCPUが
実行する。CPUとシーケンス制御対象たる機械との間で
はディズタル入力DIとディジタル出力DOとを介して検出
信号と制御信号が送受され、CPUとアナログ制御対象
(本実施例ではプロセス制御対象)との間ではアナログ
入力AIとアナログ出力AOとを介して検出信号と制御信号
とが送受される。これにより、シーケンス制御対象はシ
ーケンス制御され、プロセス制御対象はPID制御され
る。
FIG. 3 is a system configuration diagram of the programmable controller in the present embodiment. Peripheral device interface
The sequence control program and the PID control program programmed in the user memory MEM via the CPU 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 through a digital input DI and a digital output DO, and an analog signal is transmitted between the CPU and an analog control target (in this embodiment, a process control target). 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.

第4図は、PIDループが複数ある場合のシステム構成
図である。この実施例では、CPUを備える基本ユニット3
0にCPUを持たない増設ユニット31,32,33が接続され、ま
た、基本ユニット30にはリモート回線を介して離れた位
置に増設ユニット34,35が接続されている。各ユニット
はモジュール化されており、図示の例では、AIはアナロ
グインプットモジュール,AOはアナログアウトプットモ
ジュールを示している。この例では、PID制御対象が3
つあり、1番目は基本ユニット30に設けられたAI,AOモ
ジュールに接続され、2番目は増設ユニット33のAI,AO
モジュールに接続され、3番目は増設ユニット35のAI,A
Oモジュールに接続されている。そして、各PID制御対象
は、基本ユニット30のCPUにより制御されるが、前述し
たように、1回目の割込処理では1番目の制御対象が制
御され、2回目の割込処理では2番目の制御対象が制御
され、3回目の割込処理では3番目の制御対象が制御さ
れ、4回目の割込処理では再び1番目の制御対象が制御
されるようになっている。
FIG. 4 is a system configuration diagram when there are a plurality of PID loops. In this embodiment, a basic unit 3 having a CPU
The extension units 31, 32, and 33 having no CPU are connected to 0, and the extension units 34 and 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, the PID control target is 3
The first is connected to the AI and AO modules provided in the basic unit 30, and the second is the AI and AO
Connected to the module, the third is AI, A of the extension unit 35
Connected to O module. 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.

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

システム定周期スキャン処理: 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 expressed to make the figure easier to read, so that the process is executed every 20 milliseconds. Actually, after processing of 3 ms, processing of 4 ms is performed, then processing of 3 ms is performed, and then again (10 ms after the beginning), processing of 3 ms is performed. In FIG. 5, each of the above processes is omitted by writing a line segment at the center of 6 milliseconds of the process.), And updating of the elapsed value of the timer in the sequence program ·self-diagnosis·
Perform peripheral services.

20ミリ秒毎の定周期スキャン処理: CPUが20ミリ秒毎に必ず実行する処理で、処理a,b,c,d
からなる。処理aでは、PIDループ1の定周期スキャン
開始命令INTが実行され、処理bでは、ループ管理命令P
ID“C"が実行され、次に処理cでPID演算命令が実行さ
れ、最後に処理dで定周期スキャン終了処理(処理に
戻る。)を行う。
Periodic scan processing every 20 milliseconds: Processing that the CPU always executes every 20 milliseconds. Processing a, b, c, d
Consists of 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 P
The ID “C” is executed, then the PID operation instruction is executed in the process c, and finally the periodic scan end process (return to the process) is executed in the process d.

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

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

第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 processing shown in FIG. 5, the PID calculation is performed in the processing c of the processing, but in the first periodic scan processing, the PID loop 1 is performed, and in the second periodic scan processing, the PID calculation is performed. Execute the operation of loop 2 and execute 3
The PID loop 1 is executed at the fourth time, the PID loop 2 is executed at the fourth time, and so on.
Execute alternately 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.

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

尚、PID制御は、例えば温度を一定温度に制御するよ
うな場合に行うものであり、温度変化が急な場合にはサ
ンプリング間隔を短くした方が精度の高い制御が可能に
なる。しかし、温度が一定温度近辺の定常状態になった
後は、サンプリング間隔を長くしても、制御精度はそれ
ほど落ちない。そこで、制御対象が目標値近辺に制御さ
れ制御量が安定した後は、サンプリング周期を延ばし、
その分を通常スキャンプログラムの実行に割くことで、
より円滑な制御を実行できるようになる。
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 target is controlled to the vicinity of the target value and the control amount is stabilized, the sampling cycle is extended,
By dividing that amount into the execution of a normal scan program,
Smooth control can be performed.

本実施例によれば、ユーザプログラム(シーケンス制
御プログラム部分)の大きさの関係なく、所定周期でPI
D演算を実行できるので、シーケンス制御とPID制御を1
つのCPUで実行しても、PID制御のサンプリング間隔が変
化することなく実行でき、PID定数をサンプリング時間
に対応して調節するような複雑な処理が不用になる。ま
た、CPUが1つで済むので、シーケンス演算とPID演算の
組合せを調整することで、システムの制御装置のコスト
低減を図ることもできる。更に、PID制御とシーケンス
制御の演算負荷の割合を、各PIDループの実行周期を指
定することで調整でき、シーケンス制御の応答時間の調
整が可能になる。
According to the present embodiment, regardless of the size of the user program (sequence control program portion), PI
D operation can be executed, so sequence control and PID control
Even if executed by one CPU, it can be executed without changing the sampling interval of PID control, 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.

[発明の効果] 本発明によれば、1つのCPUでシーケンス制御対象とP
ID制御対象を並行して制御でき、また、PID制御対象が
複数あっても、PID制御の周期を延ばしたり実行間隔を
任意に設定することができるため、各PID制御対象の制
御の他にシーケンス制御も更に確実に実行できるという
効果がある。更に、ユーザがPID制御プログラムを容易
に作成することが可能になる。
According to the present invention, the sequence control target and P
ID control targets can be controlled in parallel, and even if there are multiple PID control targets, the PID control cycle can be extended and the execution interval can be set arbitrarily. The control can be executed more reliably. Further, the user can easily create the PID control program.

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

第1図は本発明の一実施例に係るプログラマブルコント
ローラの構成図、第2図は本発明の一実施例に係るPID
制御プログラム作成方法の説明図、第3図は第1図のプ
ログラマブルコントローラで1ループのPID制御を行う
場合の一システム構成図、第4図は第1図に示すプログ
ラマブルコントローラで3ループのPID制御を行う場合
の一システム構成図、第5図は2ループのPID制御を行
う場合の一例に係るタイミングチャート、第6図は3ル
ープのPID制御を行う場合の一例に係るタイミングチャ
ート、第7図はPID演算機能の一仕様説明図、第8図は
従来のプログラマブルコントローラの構成図である。 1……CPU部、2……入出力部、3……プログラミング
装置、5……シーケンス制御対象、6……PID制御対
象、11……MPU、12……システムROM/RAM、13……周辺装
置インタフェース、14……システムバス、15……ユーザ
メモリ、40……通常スキャンプログラム部、41……定周
期スキャンプログラム部。
FIG. 1 is a block diagram of a programmable controller according to one embodiment of the present invention, and FIG. 2 is a PID according to one embodiment of the present invention.
FIG. 3 is an explanatory diagram of a control program creating method, FIG. 3 is a system configuration diagram in the case of performing one-loop PID control with the programmable controller of FIG. 1, and FIG. 4 is three-loop PID control with the programmable controller shown in FIG. FIG. 5 is a timing chart according to an example when performing two-loop PID control, FIG. 6 is a timing chart according to an example when performing three-loop PID control, FIG. Is a diagram for explaining one specification of a PID calculation function, and FIG. 8 is a block diagram of a conventional programmable controller. 1 ... CPU unit, 2 ... input / output unit, 3 ... programming device, 5 ... sequence control target, 6 ... PID control target, 11 ... MPU, 12 ... system ROM / RAM, 13 ... peripheral Device interface, 14: system bus, 15: user memory, 40: normal scan program unit, 41: fixed-cycle scan program unit

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

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】シーケンス演算処理プログラム中に存在す
る定周期演算処理プログラムの中に複数ループのPID制
御プログラムを有しこれらのプログラムを実行処理する
プロセッサを備えるプログラマブルコントローラにおい
て、前記プロセッサは、前記定周期演算処理プログラム
の実行時に1ループのPID制御プログラムのみを実行し
次の定周期演算処理プログラムの実行時には別の1ルー
プのPID制御プログラムを実行する手段と、複数ループ
のPID制御プログラムの中で任意のループを実行間隔を
ループ数の任意の倍数で設定する手段とを備えることを
特徴とするプログラマブルコントローラ。
1. A programmable controller comprising a plurality of loops of PID control programs in a fixed cycle calculation processing program existing in a sequence calculation processing program and including a processor for executing and executing these programs. Means for executing only one loop PID control program when executing the periodic calculation processing program, and executing another one loop PID control program when executing the next fixed cycle calculation processing program; Means for setting an execution interval of an arbitrary loop at an arbitrary multiple of the number of loops.
【請求項2】請求項1において、PID演算用のサブルー
チン命令をシーケンス演算命令の1つとして持ちユーザ
はPIDのパラメータを前記サブルーチン命令にセットす
ることで該サブルーチン命令をプログラムする手段を備
えることを特徴とするプログラマブルコントローラ。
2. The apparatus according to claim 1, further comprising means for programming a subroutine instruction by having a PID operation subroutine instruction as one of the sequence operation instructions and setting a parameter of the PID in the subroutine instruction. Features a programmable controller.
JP1282010A 1989-10-31 1989-10-31 Programmable controller Expired - Lifetime JP2799009B2 (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Related Child Applications (1)

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

Publications (2)

Publication Number Publication Date
JPH03144706A JPH03144706A (en) 1991-06-20
JP2799009B2 true JP2799009B2 (en) 1998-09-17

Family

ID=17646971

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JP2799009B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3737650B2 (en) * 1999-07-09 2006-01-18 株式会社東芝 Integrated controller and control system
JP4128338B2 (en) * 2001-02-22 2008-07-30 株式会社リコー MEASUREMENT DEVICE, MEASUREMENT METHOD, MEASUREMENT DEVICE OPERATION CONTROL METHOD, AND MEASUREMENT CONTROL UNIT
JP5916677B2 (en) * 2013-09-20 2016-05-11 株式会社日立製作所 Control controller and programming method thereof
JP6161752B2 (en) * 2016-03-04 2017-07-12 株式会社日立製作所 Control controller and programming method thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61220001A (en) * 1985-03-25 1986-09-30 Mitsubishi Electric Corp Sequence control/direct digital control mixing type process control method
JPS62248002A (en) * 1986-04-22 1987-10-29 Toshiba Corp Process controller
JPS6472202A (en) * 1987-09-14 1989-03-17 Hitachi Ltd Sequence control system
JPH01116705A (en) * 1987-10-30 1989-05-09 Hitachi Ltd Sampling system

Also Published As

Publication number Publication date
JPH03144706A (en) 1991-06-20

Similar Documents

Publication Publication Date Title
JP2544960B2 (en) Programmable controller
JP2799009B2 (en) Programmable controller
EP0355961A2 (en) Microprogrammed timer processor
US4924403A (en) Numerical control method and system therefor having override playback function
JP2963676B2 (en) Programmable controller
JPS62236006A (en) Processing method for numerical controller
JP2752514B2 (en) Program execution method of CNC device
US4907190A (en) Computer control system and method for effecting sequence controls and servo-controls
EP0476154A1 (en) System for executing instruction of pc
US5115513A (en) Microprogrammed timer processor
JP2875841B2 (en) Programmable controller
JPH03154104A (en) Positioning controller
JP3638821B2 (en) Numerical controller
JPH082727Y2 (en) Programmable sequencer
JPS6128144A (en) Executing device of tracing
JPS615349A (en) Programmable controller
JPS6341970A (en) Microcomputer system
JPS61151745A (en) Interruption processing system
JPH0224703A (en) Numerical controller
JPH0682285B2 (en) Programmable controller
JPH054203U (en) Periodic pulse counting device
JPH02150906A (en) Numerical controller
JPH0239346A (en) Screen shift control system
JPS61170803A (en) Sequence control method
JPS61168012A (en) Robot controller

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080703

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090703

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090703

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100703

Year of fee payment: 12

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100703

Year of fee payment: 12