PIDSIM.BA (c) R.H. Pigford 2002 PIDSIM.BA simulates a PID controller used in the process industries for "closed loop" control of process. P = Proportional action I = Integral action D = Derivative action The operator uses a such a control station in Automatic or Manual mode to control process variables (PV) versus a desired value for that variable to be, called the set point (SP). The controller then modulates the controller output (CO) to a final control element (usually a modulating valve). The dynamic response of the PID controller depends on the "error" (difference between the actual PV and the desired SP) and the PID settings put into the controller by the operator or engineer. Setting the optimum PID values into the controller is called "CONTROLLER TUNING" and this simulation tries to help teach you something about this science. TEMPERATURE CONTROLLER In this simulation, imagine a reactor of hot liquid heated by steam applied to the outside of the reactor (a steam "jacket" around the reactor). A steady flow of cold liquid enters the reactor. An equal flow of heated liquid exits the reactor. PV is the temperature of the liquid in the reactor, SP is the desired liquid temperature, and CO is the signal which tells a modulating valve in the steam line to open or close to add more heat or less heat respectively. The PID controller screen shows a SP marker and a PV marker on a vertical scale from 0 to 100% of the PV range (actual range in degrees is determined by the actual calibrated range of the temperature transmitter out by the reactor). PV, SP and CO are displayed in percent. The current PID tuning values are displayed along with the keys that perform various functions: = switches to automatic control In Auto, the operator can change the setpoint 1% at a time by using the up/down arrows. To make +- 10% scale changes, use Code plus the = key or Code plus the - key. = switches to manual control In Manual, the operator is sending the signal to the steam valve himself (CO) by using the left/right arrows to change 1% at a time, or Code+ or Code- to make 10% scale changes. In Manual, the process will respond.

= prints the screen to an HP compatible LazerJet printer. Four print sizes and 4 margin settings are offered. = make changes to the tuning settings. = hold the screen (suspend action) in order to look at things more closely while they are on the screen. = quit the program. Remember that all processes are not alike. They all have their own dynamic behaviors, so different tuning values will be needed for good control. GOOD CONTROL occurs when the PV moves to the new SP fairly quickly, crosses over the SP value, then rejoins the SP value staying on the new SP thereafter. BAD CONTROL will see oscillations, PV wandering away from SP, and wild swings in PV and/or CO. PIDSIM requires the use of two companion machine language programs which PIDSIM will load into memory as it starts up. 1) TREND2.CO (c) R.H.Pigford: Makes the values draw a "chart paper" across the screen. TREND2.CO has been SAVEM'd to RAM without it's included buffer space, thus, at startup, PIDSIM takes a minute to fill that buffer with 0's. This saves RAM file space. 2) LCD2LJ.CO (c) R.H.Pigford: Sends a screen dump to a LazerJet printer, typically an HP compatible printer. The operator can choose either of 4 printout sizes and varios left margins. This program can also be used as a standalone program LOADM'd and CALLed from within your programs when you want a screen print to a LazerJet printer. Similar to TREND2.CO, LCD2LJ.CO has also been SAVEM'd as a RAM file without it's buffer space, but it does not need to be filled with 0's before it is used by PIDSIM.BA. The initial PID tuning values provided do not provide the best control responses to the simulated process. It is up to you to set PID values which achieve good control. Note: If you want to tune a simulated FLOW loop, edit the remark away from LINE #560 and put a remark in LINE# 555. Hint: While not exactly correct, a way to think of PID is as follows: The P output action is applied to the valve immediately and is simply the "error" times the gain (note: gain = 1/PB ... so a high PB number is a low gain). The I action is additional application of error times gain as long as the error is not 0 (this helps "pull in" the PV to the SP target). The units of I are repeats/min. A high I = very large additional output action ... not always a good thing. The D action senses the rate-of-change of the error and adds output action to try to "head off" big changes. Most processes are gentle enough to not require much, if any D. PIDDOC.DO last updated 3/08/04