Example PID Algorithm Listings 495
Appendix G
PIDB Source Listing
/********************************************************************************************/
/* PID_B
*/
/********************************************************************************************/
/* I/O Channels
*/
/* Must be defined by the user
*/
/*
*/
/* inchan - Input channel name
*/
/* outchan - Output channel name
*/
/* alarmchan - Alarm channel name
*/
/*
*/
/********************************************************************************************/
/*
*/
/********************************************************************************************/
/* PID algorithm for VT1422A controller module. This algorithm is called */
/* once per scan trigger by main(). It performs Proportional, Integral
*/
/* and Derivative control.
*/
/*
*/
/*
*/
/* The output is derived from the following equations:
*/
/* */
/* PID_out = P_out + I_out + D_out + SD_out
*/
/* P_out = Error * P_factor
*/
/* I_out = I_out + (Error * I_factor)
*/
/* D_out = ((PV_old - PV) * D_factor)
*/
/* SD_out = (Setpoint - Setpoint_old) * SD_factor
*/
/* Error = Setpoint - PV
*/
/*
*/
/* where:
*/
/* Setpoint is the desired value of the process variable (user supplied) */
/* PV is the process variable measured on the input channel
*/
/* PID_out is the algorithm result sent to the output channel
*/
/* P_factor, I_factor, D_factor and SD_factor are the PID constants
*/
/* (user supplied)
*/
/*
*/
/* Alarms may be generated when either the Process Variable or the
*/
/* error exceeds user supplied limits. The alarm condition will cause
*/
/* an interrupt to the host computer, set the (user-specified) alarm
*/
/* channel output to one (1) and set a bit in the Status variable to
*/
/* one (1). The interrupt is edge-sensitive. ( It will be asserted only
*/
/* on the transition into the alarm state.) The alarm channel digital
*/
/* output will persist for the duration of all alarm conditions. The
*/
/* Status word bits will also persist for the alarm duration. No user
*/
/* intervention is required to clear the alarm outputs.
*/
/*
*/
/* This version provides for limiting (or clipping) of the Integral,
*/
/* Derivative, Setpoint Derivative and output to user specified limits.
*/
/* The Status Variable indicates when terms are being clipped.
*/
/*
*/
/* Manual control is activated when the user sets the Man_state variable */
/* to a non-zero value. The output will be held at its last value. The
*/
/* user can change the output by changing the Man_out variable. User */
/* initiated changes in Man_out will cause the output to slew to the
*/
/* Man_out value at a rate of Man_inc per scan trigger.
*/
/* */
/* Manual control causes the Setpoint to continually change to match
*/
/* the Process Variable and the Integral term to be constantly updated */
/* to the output value such that a return to automatic control will
*/
/* be bumpless and will use the current Process Variable value as the
*/
/* new setpoint.
*/
/* The Status variable indicates when the Manual control mode is active. */
/*
*/
/* At startup in the Manual control mode, the output will slew to Man_out */
/* at a rate of Man_inc per scan trigger.
*/
/*
*/
/* At startup, in the Automatic control mode, the output will abruptly
*/
/* change to P_factor * Error.
*/
/*
*/
/* For process monitoring, data may be sent to the FIFO and current
*/
/* value table (CVT). There are two levels of data logging, controlled
*/
/* by the History_mode variable. The location in the CVT is based
*/
Summary of Contents for VT1422A
Page 2: ...This page is blank...
Page 8: ...8 Notes...
Page 22: ...22 Support...
Page 57: ...Field Wiring 57 Chapter 2...
Page 58: ...58 Field Wiring Chapter 2...
Page 96: ...94 Programming the VT1422A VT1529A B for Remote Strain Measurement Chapter 3...
Page 162: ...160 Programming the VT1422A for Data Acquisition and Control Chapter 4...
Page 224: ...222 Creating and Running Algorithms Chapter 6...
Page 419: ...VT1422A Command Reference 417 Chapter 7 Notes...
Page 420: ...418 VT1422A Command Reference Chapter 7 Notes...
Page 425: ...Specifications 423 Appendix A Thermocouple Type E 200 800 C SCPs VT1501 02 03A...
Page 426: ...424 Specifications Appendix A Thermocouple Type E 200 800 C SCPs VT1508 09A...
Page 427: ...Specifications 425 Appendix A Thermocouple Type E 0 800 C SCPs VT1501A 02A 03A...
Page 428: ...426 Specifications Appendix A Thermocouple Type E 0 800 C SCPs VT1508A 09A...
Page 429: ...Specifications 427 Appendix A Thermocouple Type E Extended SCPs VT1501A 02A 03A...
Page 430: ...428 Specifications Appendix A Thermocouple Type E Extended SCPs VT1508A 09A...
Page 431: ...Specifications 429 Appendix A Thermocouple Type J SCPs VT1501A 02A 03A...
Page 432: ...430 Specifications Appendix A Thermocouple Type J SCPs VT1508A 09A...
Page 433: ...Specifications 431 Appendix A Thermocouple Type K SCPs VT1501A 02A 03A...
Page 434: ...432 Specifications Appendix A Thermocouple Type R SCPs VT1501A 02A 03A...
Page 435: ...Specifications 433 Appendix A Thermocouple Type R SCPs VT1508A 09A...
Page 436: ...434 Specifications Appendix A Thermocouple Type S SCPs VT1501A 02A 03A...
Page 437: ...Specifications 435 Appendix A Thermocouple Type S SCPs VT1508A 09A...
Page 438: ...436 Specifications Appendix A Thermocouple Type T SCPs VT1501A 02A 03A...
Page 439: ...Specifications 437 Appendix A Thermocouple Type T SCPs VT1508A 09A...
Page 440: ...438 Specifications Appendix A 5k Thermistor Reference SCPs VT1501A 02A 03A...
Page 441: ...Specifications 439 Appendix A 5k Thermistor Reference SCPs VT1508A 09A...
Page 442: ...440 Specifications Appendix A RTD Reference SCPs VT1501A 02A 03A...
Page 443: ...Specifications 441 Appendix A RTD SCPs VT1501A 02A 03A...
Page 444: ...442 Specifications Appendix A RTD SCPs VT1508A 09A...
Page 445: ...Specifications 443 Appendix A 2250 Thermistor SCPs VT1501A 02A 03A...
Page 446: ...444 Specifications Appendix A 2250 Thermistor SCPs VT1508A 09A...
Page 447: ...Specifications 445 Appendix A 5k Thermistor SCPs VT1501A 02A 03A...
Page 448: ...446 Specifications Appendix A 5k Thermistor SCPs VT1508A 09A...
Page 449: ...Specifications 447 Appendix A 10k Thermistor SCPs VT1501A 02A 03A...
Page 450: ...448 Specifications Appendix A 10k Thermistor SCPs VT1508A 09A...
Page 454: ...452 Specifications Appendix A...
Page 480: ...478 VT1529A B Verification Calibration Appendix C...
Page 484: ...482 Glossary Appendix D Notes...