Topic: DMD0245

Getting Started with PID Loops in a Do-more Controller


Process Control Instruction Set

The Do-more environment utilizes what we refer to as the Tinker-Toy™ approach to providing options that can handle various Process Control requirements. Rather than embedding the input and output scaling, alarm handlers and ramp/soak tables within the PID instruction itself, these are all handled by separate instructions, allowing the proper level of customization for whatever control algorithms are used. The Do-more controller provides a full complement of Process Control related instructions that includes:

Alarm Handlers
Input and Output Value Limiters
Noise Suppression
PID Calculation and Tuning Constants
Ramp/Soak Profiles - up to 250 steps
Input and Output Scaling
 Emulate Analog Level Control with a Discrete Output Device

 


Process Control Utilities

The Do-more Designer programming environment has several utility programs to assist in the configuration, tuning and monitoring of PID loops.

 

  • The PID View - is where the majority of the work related to configuring, tuning, and monitoring PID loops will be done. The PID View is opened by selecting Debug-> PID View from the Online Toolbar, or right-clicking on any PID instruction in a ladder diagram and select Trend Instruction from the pop-up menu, or double-clicking on the PID Overview graphic for that PID loop.

    The PID View is broken into three sections: the PID Data form which displays the current configuration of the underlying PID Loop, and two trend graphs (one with the .PV and .SP fields, and one with the .Output and .Bias fields) to see the results of the configuration and tuning efforts.
     

  • Using the Auto-tune Process - the Do-more controller provides an automatic tuning function to help in achieving optimal P, I, and D values. Any of the terms set incorrectly can cause the process to be unstable, or very slow to control.
     

  • The PID Overview - is a container that will display a boilerplate for each Closed Loop Controller (PID) instruction used in a Do-more Designer project. The boilerplate for each PID Loop displays the most commonly needed runtime values and alarming information (if available).
     

  • Using the Do-more PID Process Simulator - The Do-more Designer Simulator includes a PID Process simulator that can be used to demonstrate the process control abilities of the controller, or for testing potential changes to existing control solutions by working with the process control instructions in a simulation environment before deploying the control solution to a Do-more controller. The PID process simulator uses a first order filter and a dead time calculation to provide the simulated PID loop response.

 


PID Structure Fields

For each Closed Loop Controller (PID) instruction that is added to a project, a PID Structure is automatically created for that instruction. This structure contains the "dot" fields that are used to configure, tune and monitor the PID loop. The syntax for reference any of these "dot" fields is <PID reference>.<field name>.

 

The Input fields of a PID loop are used for writing configuration data to the PID loop, to manage the PID loop's mode, and to manage the Autotune process. The Output fields of a PID loop are used to monitor the loop's response to its configuration and the input values. These fields are updated each time the PID instruction is executed as part of the ladder logic scan. Refer to the following chart for complete lists of the input and output fields, their data types, and acceptable ranges:

 

PID Structure Fields

 

Field

Field Type

Field Name

Data Type

Description

.PV

Input

Process Variable

Real

The Process Variable (PV) is the input value that is being measured, typically from an analog input.

 

.SP

Input

Setpoint

Real

The Set point is the target value that the PID loop wants the Process Variable (PV) to reach.

 

.Gain

Input

Proportional

Real

The Gain (P) value sets the output of the PID loop proportional to the change in the process variable (PV).

Larger values mean a faster output response since the larger the error, the larger the proportional term compensation. But, an excessively large proportional gain can lead to process instability and oscillation.

 

.Reset

Input

Integral

Real

The Reset (I)  value determines how the PID loop output will change based on the amount of time there is an error between set point (SP) and the process variable (PV).

Larger values eliminate steady state errors more slowly. The trade-off is larger overshoot: any negative error integrated during transient response must be integrated away by positive error before reaching steady state.

 

A value of 0 disables the effect of this term in the PID calculation.

 

.Rate

Input

Derivative

Real

The Rate (D) value determines how the PID loop will respond based on the rate of change in the process variable (PV).

Larger values decrease overshoot, but slow down transient response and may lead to instability due to signal noise amplification in the differentiation of the error.

 

.Bias

Output

Bias

Real

In some modes the Bias is used to provide bumpless transfer from automatic to manual mode, and vice-versa. Bias is set equal to the actual output value (with consideration of the Error term) when the loop is switched from manual to automatic mode.

 

.Output

Output

Control Output

Real

The output value from the loop calculation.

 

.ErrorDB

Input

Error Deadband

Real

The Error Deadband designates the area around Error value where no action will occur. The error deadband is the same above and below the setpoint. If 'Enable Error Deadband' has been selected in the PID instruction, this is where the deadband value is entered.

 

.DGainLmt

Input

Derivative Gain Limit

Real

If the magnitude of the loop calculation exceeds the derivative gain limit, the derivative component will be clamped at the specified limit.

 

.SampleTime

Input

Loop Sample Time

Integer

The SampleTime value designates how often the loop calculation is performed. The value is specified in milliseconds.

 

 

.Mode

Output (read-only)

Loop More

Bit

0 = Manual Mode
1 = Automatic Mode

 

.AutoTuning

Output (read-only)

Autotune Mode

 

Bit

0 = No Autotune in progress
1 = Autotune in progress

 

.AutoTuneComp

Output (read-only)

Autotune Complete

Bit

0 = Autotune complete

1 = Autotune is running

 

.AutoTuningErr

Output (read-only)

Autotune Error

Bit

0 = Autotune completed successfully
1 = Autotune did not complete successfully, loop is not tuned.

 

.RanThisScan

Output

Loop calculation ran this scan

 

0 = Loop Calculation was not performed on the current PLC scan
1 = Loop Calculation was performed on the current PLC scan

 

.Setup

Input

Setup Bits

32-Bit Hex

A DWord that allows the Bit fields to be accessed as a single data value rather than through individual Bits.

 

.Tune

Input

Autotune

Bit

Initiates an Autotune:

0 = Stop Autotune
1 = Start Autotune

 

.TuningAlg

Input

Tuning Algorithm

Bit

Designates whether the Autotune should use an Open Loop or Closed loop algorithm:
0 = Closed Loop
1 = Open Loop

 

.TunedParms

Input

Tuning Parameters

Bit

Designates whether the Autotune should use a PI or PID calculation:
0 = PI
1 = PID

 

.LastError

Output (read-only)

Error value

Real

The Computed Error value, that is, the difference between a measured process variable (PV) and a desired setpoint (SP).

 

 


Copyright © Host Engineering, Inc. ALL RIGHTS RESERVED