A simplified flow chart of the program's execution is shown below. Some details are omitted for the sake of clarity. The Control Plungers state is discussed in detail below.
All floating point input values, including casing pressure, tubing pressure, line pressure, temperature and flow are averaged over 2 samples before being used by the Plunger Lift application. Each sample is taken at a 5 second interval. This prevents one bad sample from upsetting the control algorithm.
The Plunger Lift application executes once every 5 seconds.