Академический Документы
Профессиональный Документы
Культура Документы
Kingfisher Examples
Kingfisher PID Simulation
for CP-30 and G30 Processors
Version 1.0
Kingfisher Examples: PID Simulation
Preface
Copyright Copyright CSE Semaphore (Australia) Pty Ltd. ABN 35 006 805 910
www.cse-semaphore.com/mykingfisher,
info.kingfisher@cse-semaphore.com
Intellectual CSE Semaphore asserts ownership of the intellectual property contained
Property herein and claims copyright and authorship excluding any intellectual property
already in the public domain. CSE Semaphore has and retains all rights of
ownership and use of the material herein in its on-going business.
Licence This document is provided to the intended recipient(s) under a non-exclusive
licence. This licence permits Fair Use of the document for operational
requirements, without payment of further royalty or licence fee. Fair Use
includes making copies of the document for operational, backup and archive
purposes. Fair Use includes distributing copies of the document to other
entities for the purposes of their performing related works for the intended
recipient(s). Fair Use does not include creating, selling or distributing copies of
the document for other purposes. All copies must retain this statement of
Intellectual Property and Copyright.
Version 1.0: First Release of document
Kingfisher Examples: PID Simulation
1. Introduction
Evaluated from 0 to t
Where:
Kp = Proportional Constant
Ki = Integral Constant
Kd = Differential Constant
t= Sample Interval
en = Current Process Error (n)
en - 1 = Previous Error (n - 1)
en - 2 = Previous Error (n - 2)
en - 3 = Previous Error (n - 3)
1 Version 1.0
Kingfisher Examples: PID Simulation
Requirements
The project contains DI-10 modules used for outputs from the PID
process. As simulation logic will be used, these modules are not required.
4 Version 1.0
Kingfisher Examples: PID Simulation
Simulation Logic
The INDEX _DINT is used to drive a state machine based on the MOD
function block.
This means that once every 32 increments of INDEX_DINT, this logic will be
executed.
The PID function outputs are also DNP3 variables, allowing event logs for
each variable to be inspected. This is very convenient for characterizing
performance.
5 Version 1.0
Kingfisher Examples: PID Simulation
The test logic is a simple implementation of the PID function block. All 32
instances are the same allowing you to observe any changes made to the
PID loop. The following is the PID function controlling DNPAO0.
DIRE (Bool): Direct (True) or Reverse (False) calculation mode. When direct,
the output value will increase as the measured process value increases.
When reverse, the output value will decrease as the measured process
(PV) value increases.
In this Example: Set TRUE
6 Version 1.0
Kingfisher Examples: PID Simulation
Time (Real): The time interval (in milliseconds) between sampling the
process variable. (Note the minimum interval that can be used is limited
by the ISaGRAF cycle time).
In this Example: The Variable TS_TIME (Set to 500 ms)
DBDP (Real): Dead-band positive. The allowable positive error between the
Process Variable (PV) and the Set-Point (SV). If the positive error is less
than this value, the output will not be adjusted.
Dead-band settings
In this Example: The Variable DEADBANDDP_REAL (Set to 0.1)
can be used to
suppress ‘hunting’
DBDN (Real): Dead-band negative. The allowable negative error between (oscillation) in the
the Process Variable (PV) and the Set-Point (SV). If the negative error is output.
less than this value, the output will not be adjusted.
In this Example: The Variable DEADBANDDN_REAL (Set to 0.1)
ATNP (Real): Anti-Rest Positive. The upper limit of the Process Variable (PV)
to suppress an integral response. The Anti-Reset range can be used to
suppress over-correction (and overshoot) of the output value during initial
tuning actions where there is a significant difference between the
Process Value and the Set-Point value.
In this Example: Static value 0.0
ANTN (Real): Anti-Reset Negative. The lower limit of the Process Variable
(PV) to suppress an integral response. The Anti-Reset range can be used
to suppress over-correction (and undershoot) of the output value during
initial tuning actions where there is a significant difference between the
Process Value and the Set-Point value.
In this Example: Static value 0.0
7 Version 1.0
Kingfisher Examples: PID Simulation
Observing Operation
One of the more convenient ways to see the PID block tracking the Set-
Point value is to retrieve all the logs generated by the DNP3 driver and
graph them in spreadsheet software such as Microsoft Excel or
OpenOffice Calc.
Open the file in your spreadsheet software package of choice. In this case
OpenOffice Calc will be used as it is widely supported and available for
free.
When opening the CSV file, be sure to specify ‘comma’ in the separation
options, otherwise the data will not be formatted correctly.
Once imported, the ID, Date, RTU, Flags, Type, and Priority columns can
be deleted.
Order the data alphabetically with respect to the DNP3 Variable names,
then create a 2D line chart for each of the Variables DNPAI0 and
DNPAO0.
8 Version 1.0
Kingfisher Examples: PID Simulation
The Results
The following charts are of the PID function block Set-Point and
Process Variable. Note the RTU was run overnight to accumulate Event
Logs.
Process Variable
Set Point
The two series were not placed on the same chart as they overlap and
obscure one another.
This method of inspecting the operation of the PID block can be used in
real world situations to ascertain the quality of tuning effects.
9 Version 1.0