RD Controls Software Release Note 126.1<P> EPICURE Closed Loop Control Utility<P> PID

RD Controls Software Release Note 126.1

EPICURE Closed Loop Control Utility

PID

Larry Lee

Robert West

Therese Watts

Contents

Introduction

A cryogenics multibus crate contains A/D-D/A modules, actuator controller modules, digital status and control modules, and a temperature resistor module. The EPICURE beamline control system reads data from and writes data to these multibus modules via a C1080 Multibus Interface Module residing in a CAMAC crate and connected to the multibus crate via an interface card. One of the functions provided by the firmware residing in the C1080 module is closed loop control implemented via a classical PID equation. A maximum of 20 different closed loops may be controlled by the C1080 at the same time. The EPICURE Closed Loop Control Utility PID enables a user to control a cryogenic system by monitoring and modifying any particular closed loop in the system.

The Closed Loop Control Utility executes on a VAX node and communicates with a specified C1080 module via the EPICURE CAMAC data acquisition system. The Closed Loop Utility displays the various parameters for a single closed loop. The display is updated every two seconds as new data is obtained from the C1080 module. In addition, the utility allows a user to change selected loop parameters and then write them to the C1080 module to modify the operation of the closed loop. All the parameters for a single loop may be saved to a disk file and then written back to the C1080 at some later time. A user is able to select a multibus (corresponding to a particular C1080 module) and one of the 20 closed loops which may be operating on that multibus.

User Interface

The user interface of the Closed Loop Utility is implemented using DECforms, which is a software product that can "readily" interface a user application that requires structured, form-based, or menu-based user interfaces. The user has full control of the screens and is not required to learn complex command statements for setting the loop elements. Pop-up menus and help messages are implemented to make the application user-friendly. The user presses the NEXT SCREEN key to access the setting screen in order to modify any of the settable fields.

A screen display is divided into two sections. The upper section is a "header." The lower section is a quadrant with either readable fields or settable fields. Appendix A contains an example of the reading screen display and Appendix B contains an example of the setting screen display.

After the new PID algorithm has been evaluated in a field test by the cryogenics department, the RD/Controls group will provide a standard Epicure Screen Management (ESM) version based upon the recommendations of the persons involved.

Header Screen

When the Closed Loop Utility starts execution, it displays the closed loop which previously was being monitored. The AREA, MULTIBUS, and LOOP fields are used to select a different multibus and control loop operating on that multibus. The MODE field readback displays the mode label that the C1080 module has received for that set of loop parameters.

The arrow keys are used to move the cursor between fields one cell at a time. The cursor may also be moved by defined keys that allow settable field jumping: (1) KP_1 or TAB to move to the next field and (2) KP_4 or F12 to move to the previous field. (Appendix C contains a complete list of the various key functions.) The data field types are (1) set numerical and (2) menu select.

Area
- A pop-up menu is displayed with a list of the different area choices that can be accessed. The user can move up and down this menu via the arrow keys and make a selection on one of the areas via the carriage return. The screen is updated with the associated data.

Multibus
- A numeric input overstriking the previous data with an integer value from 1 to 7 which identifies the desired multibus. Pressing the carriage return immediately results in the updating of the screen with the associated data.

Loop
- A numeric input overstriking the previous data with an integer value from 0 to 19 identifies the desired loop. Pressing the carriage return immediately results in the updating of the screen with the associated data.

Download Mode
- A pop-up menu is displayed with a list of the different mode choices that can be accessed. The user can move up and down this menu via the arrow keys and make a selection on one of the three operating modes for the loop via the carriage return. This refers to the information stored in the disk file and not in the C1080 module. By selecting a new mode, the user is able to access file information pertinent to that loop. The information is then downloaded to the module. The screen is then immediately updated with the associated data. In this case, the STATUS of the loop is always going to be OFF. This is to enable the user to examine the information from the file before the loop starts to execute. To start the loop, the user must switch to the setting screen, set the status to ON, and then perform another download via the SEND operation. The three mode choices are as follows:

COOLDOWN
- Parameters used for tuning a loop during a cooldown.

INTERMEDIATE
- Parameters used when a cryogenic system is between the cooldown and the normal running mode.

NORMAL
- Parameters a loop operates at under `normal' conditions.

Save to File
- Writes the data most recently received from the C1080 module to the disk file, overwriting the record corresponding to the selected loop and mode.

Exit
- Exits the PID application and returns the user to the calling environment. If the user has sent changes to the module, the user is asked if he wants to save the changes to the disk file.

Download File
- A pop-up menu displays a list of all the titles for the loop and mode data of the current area and multibus. The timestamp for each loop's parameters is also displayed. The user can move up and down this menu via the arrow keys or scroll by page using the PREV SCREEN and NEXT SCREEN keys. An asterisk after the mode designation denotes the loop and mode which the application is currently displaying. A dash indicates the present mode of each of the other loops. Entering a carriage return selects the mode and loop number at the cursor's position in the menu list. Selecting an entry from the list is equivalent to a sequence of two operations in the header screen: (1) specifying a loop number and then (2) selecting a mode to be downloaded to the C1080 module.

It is important to note that any selection from this list always causes the set of parameters from the disk file to be downloaded to the loop table in the module.

Compare
- Compares the loop parameters being returned from the module with the corresponding parameters in the disk file. The module parameters are in the left column and the file parameters in the right column. A difference between the two is noted by highlighting of the parameter from the file. The comparison screen is shown in Appendix F.

Reading Screen

Appendix A contains an example of this screen. There is no movement within this screen. The data fields are of display types (1) read text and (2) read numerical. This screen is displayed when the Closed Loop Utility starts execution. If the setting screen is being displayed, the reading screen is selected by pressing the PREV SCREEN key.

The first quadrant (upper right) encompass the control data. The second quadrant (upper left) and the third (lower left) encompasses the process data. The forth quadrant (lower right) encompasses the loop and process constants. Appendix D describes in detail each of the various fields displayed on this screen. Appendix E describes how the various constants are used in the series Dahlin PID control algorithm which is executed by the C1080 controller.

This screen is updated every two seconds as new data is received from the C1080 module. As a result, the hour-minute-second time display changes in two second increments.

Setting Screen

The user activates this screen with the NEXT SCREEN key. Appendix B contains an example of this screen. The arrow keys are used to move the cursor between fields one cell at a time. The cursor may also be moved by defined keys that allow settable field jumping: (1) KP_1 or TAB to move to the next field and (2) KP_4 or F12 to move to the previous field. The data field types are (1) set text, (2) set numerical, and (3) toggle.

The process device name and the control device name are text fields. The loop status can be toggled between OFF and ON by pressing the carriage return. All the other fields are numeric fields.

The user places the cursor over the desired field and then presses the F13 key which erases the field. The user then types in the new data. As many of the fields may be changed as is necessary. The user then places the cursor on the SEND button and presses the carriage return to send the data to the C1080 module. The display is then switched to the reading screen and the cursor is placed in the header. The new readings are displayed when they are received from the module. If the user decides to abort the changing of any parameters, he simply presses the PREV SCREEN key to return to the display of the reading screen.

If a device name has been changed in the set of loop parameters that are to be sent to the C1080 module, the status of the loop is always set to OFF. Such a change is considered to be a major modification to the loop. As with a mode download from the disk file, the intent is to enable the user to examine all the information before starting execution of the loop.

Note that the data displayed on this screen does not update. Whatever was received from the C1080 module immediately prior to the request for this screen is what is displayed for modification. The hour-minute-second time display is the time when the user pressed the NEXT SCREEN key to request the setting screen. It does not update either.

Help and Error Messages

The bottom 2 lines of the screen are reserved for displaying messages. These messages include instructions, error messages and field help text. Place the cursor over a field and press the help key for information regarding that particular field. For information regarding movement between screens or fields, press the HELP key twice while the cursor is in the header screen. For useful equations pertaining to the PID algorithm, press the HELP key twice while the cursor is in the setting screen. The following message strings may be displayed in the process and control sections of the reading screen:

Distribution:  normal
               C. Drennan      M.S. 222
               R. Sanders      M.S. 219
               P. Wheelwright  M.S. 219

Reading Screen Display

                         CRYO PID CONTROL
  EXIT    SAVE TO FILE    DOWNLOAD FILE    COMPARE
                                                                Download
 Area: TSX           Multibus: 1           Loop:  00            Mode: COOLDOWN
 ***** title line from the disk file describing this loop's parameters
 ------------------------------------------------------------------------------
 PROCESS:  TSXPDEW           | CONTROL:  TSXEVLOSUC              17:04:38
              PSIG           |            %OPN
 Reading:    -   1.001       | Reading:    49.390       Calculated
 Setting:        4.999       | Setting:    50.000       Correction:      .000
 >>> NEW DATA IN THIS LOOP   | >>> NEW DATA IN THIS LOOP
 Dead Band:       .249       | Min Step:     .999       Max Step:       4.999
 Max Error:       .000       | Min Pos:      .000       Max Pos:       59.999
 ------------------------------------------------------------------------------
 PROCESS ERRORS:             | LOOP CONSTANTS:          PROCESS CONSTANTS:
                             |
 (0)      .000               | Kc       .000            Kp        1.000
 (1)      .000               | TI       .951            tau0       .300
                             | TD      1.950            tau1      1.000
 Sampling Interval:  10.000  |  a       .100            tau2      2.000
           Status:      OFF  |  q       .716            Process Delay   0
 
 ------------------------------------------------------------------------------

Setting Screen Display

                         CRYO PID CONTROL
  EXIT    SAVE TO FILE    DOWNLOAD FILE    COMPARE
                                                                Download
 Area: TSX           Multibus: 1           Loop:  00            Mode: COOLDOWN
 ------------------------------------------------------------------------------
                          PID SETTINGS
  SEND                                                                 17:11:44
 (NOTE: THIS IS A FREEZE FRAME - THESE READINGS MAY NOT BE THE CURRENT VALUES.)
 ***** title line from the disk file describing this loop's parameters
 ------------------------------------------------------------------------------
 PROCESS:  TSXPDEW       PSIG  | CONTROL: TSXEVLOSUC      %OPN
 Setting:         4.999        | Setting:       50.000
 Dead Band:        .249        | Min Step:        .999    Max Step:     4.999
 Max Error:        .000        | Min Pos:         .000    Max Pos:     59.999
 ------------------------------------------------------------------------------
 Sampling Interval:  10.000    | LOOP CONSTANTS:          PROCESS CONSTANTS:
            Status:     OFF    | Kc       .000            Kp        1.000
                               | TI       .951            tau0       .300
                               | TD      1.950            tau1      1.000
                               |  a       .100            tau2      2.000
                               |  q       .716            Process Delay   0
 ------------------------------------------------------------------------------

Key Functions

        KEY NAME        USE
        --------        ___
        TAB, KP1........Move to the next field
        F12, KP4........Move to the previous field
        F13.............Erase current field
        F10, CTRL-Z.....EXIT the utility
        CTRL-W..........Refresh screens
        RETURN, ENTER,
        SELECT..........Three interchangeable response keys
        PREV SCREEN.....Displays reading screen
        NEXT SCREEN.....Displays setting screen
        ARROW KEYS......Position the cursor over a character or move between
                        fields, icons and menu choices.

The C1080 Multibus Interface Module implements closed loop control on a system made up of two devices: (1) an input or process device and (2) an output or control device which has some effect upon the process device. A setpoint value is specified which the process device is to achieve and then at which it is to be maintained. This setting value and the current reading value of the process device are input to a PID (Proportional, Integral, Derivative) closed loop algorithm which calculates a new setting value for the control device. After some period of time has elapsed, the new setting of the control device has caused the reading of the process device to change. The PID algorithm is then executed again with the new process reading and a new control setting is again calculated. This sequence is repeated until the difference between the process reading value and the process setpoint is within some tolerance value. How long this convergence takes and how well it occurs, even if it occurs at all, depends on how successful the user has been in tuning the various PID parameters to match the characteristics of the physical system.

The display of the closed loop parameters is divided into four sections: process, control, constants, and errors. (See Appendix A)

PROCESS Section

This section displays parameters related to the process device, which is the device the user wants set to a particular value and then have maintained at that value. All the numerical values in this section are expressed in the engineering units of the process device.

Device Name
- the name of an EPICURE device which is located in the multibus crate to which the C1080 controller module is connected. The engineering units associated with this device are displayed either under or to the right of the name.

Reading
- the current reading value of the device

Setting
- the desired setpoint value

Dead Band
- the tolerance or acceptable difference between the reading and the setting. Whenever the calculated difference is less than or equal to the dead band, the PID algorithm is not executed and the setting of the control device is not changed.

Max Error
- some specified period of time has to elapse before the PID algorithm is again applied to the system. However, if the difference between the reading and the setting is greater than the maximum error value, the PID algorithm is executed to calculate a new control device setting independent of how much time has elapsed since the algorithm was last executed.

CONTROL Section

This section displays parameters related to the control device, which is the device the algorithm is setting in order to cause changes in the process device.

Device Name
- the name of an EPICURE device which is located in the multibus crate to which the C1080 controller module is connected. The engineering units associated with this device are displayed either under or to the right of the name. All the numerical values in this section are expressed in the engineering units of the control device.

Reading
- the current reading value of the device

Setting
- the setting value calculated by the PID algorithm

Calculated Correction
- the difference between the previous setting value and the current setting value

Min Step
- the minimum allowable correction in the setting of the control device. If the PID algorithm calculates a correction less than this minimum, the setting value of the control device is not changed.

Max Step
- the maximum allowable correction in the setting of the control device. If the PID algorithm calculates a correction greater than this value, the correction is set to this maximum value.

Min Pos
- if the algorithm calculates a new control setting less than this value, the control device is set to this minimum value.

Max Pos
- if the algorithm calculates a new control setting greater than this value, the control device is set to this maximum value.

CONSTANTS Section

This section displays parameters used either directly or indirectly in the calculations of the PID algorithm.

Loop Constants
- used in the PID equations

Process Constants
- estimates of the characteristics of the system under control. With the exception of the process delay, changing one or more of the PROCESS constants causes a recalculation of the LOOP constants.

ERRORS Section

This section displays the previous (0) and current (1) calculated process error, which is related to the difference between the process setpoint and the process reading. Also included in this section are two parameters related to when the PID algorithm is executed. If the PID closed loop algorithm is to be applied to the system defined by all the specified parameters, the STATUS field is ON. OFF indicates this particular closed loop is not being executed. The SAMPLING INTERVAL specifies the execution interval of this closed loop and is expressed in units of seconds. The smallest time interval possible is 0.001 seconds or 1 ms. However, probably very few meaningful changes in a cryogenic system occur within the time span of a few milliseconds. The maximum time interval possible is 99.999 seconds.

The C1080 Multibus Interface Module implements a series Dahlin PID control algorithm with dead time compensation. The implementation of this algorithm applies the derivative only to the process measurement according to the equation where the LaPlace variable s is approximated by the discrete equation where f is the delay function such that . This implementation also includes a filter parameter to provide a bound on the derivative mode response to the rate of change of the process variable, reducing the adverse effects of noise and the amplitude quantization effects of sampling.

PID Equations

Derivative Calculation

where

Process Error Calculation

where

Controller Output Calculation

if ( )

where

Equation Summary

Recalculation of PID Constants

A feature of the closed loop algorithm which has been implemented is the ability to calculate several of the constants used in the control equations based upon gain and timing estimates supplied by the user. The following parameters all relate to the characteristics of the process under control: When one or more of these values is changed, the C1080 module will recalculate the following PID constants using the sample time T:

Examples

If the derivative filtering and process delay elements are removed by making the following assignments then equations 1 through 4 become

Note that if the proportional gain Kc is now set to 0, the variable dM is always 0 and hence the controller output never changes.

Case 1

Using equations 5 through 8, let derivative time TD = 0 Then the equations become:

(5.1)

(6.1)

(7.1)

(8.1)

Case 2

Using equations 5 through 8, let integral time TI = 0. Then the equations become:

(5.2)

(6.2)

(7.2)

(8.2)

Case 3

Using equations 5 through 8, let Then the equations become:

(6.3)

(7.3)

(8.3)

Case 4

Using equations 5 through 8, let Then the equations become:

(5.4)

(6.4)

(7.4)

(8.4)

In this case, the change dM is closely proportional to the difference between the process setpoint R and the process reading C[k].

Case 5

Using equations 5 through 8, let Then the equations become:

(6.5)

(7.5)

(8.5)

In this case, the change dM is again closely proportional to the difference between the process setpoint R and the process reading C[k].

Compare Screen Display

 Area TSX    Multibus 1    Loop 00    Mode COOLDOWN    02-Mar-1993 17:15:55.82 
 ***** title line from the disk file describing this loop's parameters
 ------------------------------------------------------------------------------
 PROCESS:     TSXPDEW       TSXPDEW      | CONTROL: TSXEVLOSUC    TSXEVLOSUC   
                      PSIG          PSIG |                  %OPN          %OPN 
                    MODULE          FILE |                MODULE          FILE 
 Setting:            4.999         4.999 | Setting:       50.000        50.000 
 Dead Band:           .249          .249 | Min Step:        .999          .999 
 Max Error:           .000          .000 | Max Step:       4.999         4.999 
                                         | Min Pos:         .000          .000 
                                         | Max Pos:       59.999        59.999 
 ------------------------------------------------------------------------------
 Sampling Interval: 10.000        10.000                                       
 ------------------------------------------------------------------------------
 LOOP CONSTANTS:                         | PROCESS CONSTANTS:                  
                                         |                                     
 Kc                   .000          .000 | Kp              1.000         1.000 
 TI                   .951          .951 | tau0             .300          .300 
 TD                  1.950         1.950 | tau1            1.000         1.000 
  a                   .100          .100 | tau2            2.000         2.000 
  q                   .716          .716 | Process Delay   0             0     
 ------------------------------------------------------------------------------

Security, Privacy, Legal

rwest@fsus04.fnal.gov