Process Controller

Terminology/Background

Many of the lab experiments run by the AguaClara team use Process Controller, a LabVIEW based program, to run methodically run experiments and collect data. Users can configure sensors to control the system and collect data simultaneously. Before any experiments are run, Process Controller must be programmed correctly to control the processes of the experiment. There are four types of things that need to be defined in Process Controller in order for the program to control any process. These are States, Rules, Sensors, and Set Points.

For a more general guide to Process Controller (with tutorials), see the ProCoDA Software page.

Basics

  • States: States represent different control configurations. Each has different control settings and each have different rules that determine when the state ends and what state comes next. Each state has independent control settings which means that each is defined uniquely by which pumps are on or off and which valves are opened or closed. It is these states that tell Process Control what to make the system do. Not all are necessarily used in a process; states can be designed for testing pumps, to clean the system and so on. States are listed in a drop-down list and can be added or removed BUT they are place sensitive meaning each is assigned an identification number in the list of states so deleting a state will alter the number ID of the states proceeding it. When using a state you must pull it using this number. Also important to remember is that the first position is "0", not "1".
  • Rules: Rules set exit conditions for states. It tells a state when to turn on, off, or switch to a different state. Rules can have multiple conditions and can be based of sensor values, time elapsed in a state, etc. They are executed sequentially and the state will change upon reaching the first true rule ("if" statement-causes state to exit). Rules are defined using a greater-than or equal to sign so one must be careful to ensure that set points are defined properly.
  • Sensors: Process Control is setup so individual sensors and meters (such as a turbidimeter) can directly transmit their information to Process Controller. Information obtained from these is stored and can also be used to control how the program behaves. They must be properly calibrated with the Process Controller software in order to obtain meaningful units. There are conversion files for doing this.
  • Set Points: Values that process controller uses in defining States and Rules. They can be either constant or variable and can define the flow rate through a pump for example. Like states, set points are assigned a numerical identification number based upon their position in the list. Set points can be called by name, unlike states, but they are still identified internally by this number. When one is deleted the internal sequences becomes a mess so generally we do not delete set points once they are created, even if they are not being used. Set points can use pre existing methods (in the methods folder) that will need to be imported. The set points (if) required by the method will be listed under Required Set Points and these required set points will need to be selected. If the set points used do not match those required the light next to "data match" will be red, indicating an error.

Experimentation

Before running process controller for the day, you first must create a new folder to save data collected on this day. To do this, go to Datalog directory path and click the folder icon to the right. Create a new folder titled with the days' date in the format of MM.DD.YY and save by selecting Current Folder. Process Controller will save two excel files of the experiment in this folder: a datalog file and statelog file. The first column in both files is a time stamp that records time as a fraction of the day. The statelog file tracks when a state changes and what caused it to change; whether it was a rule or it was changed by an operator.

Upon opening Process Controller, click edit rules to see all the available states and rules.

Click on either the Set Points or Rules and States tab to view a list of each.

Under the Rules and States tab is a list of the states that control which pump is turned on and the amount of liquid coming in from each pump into the tank. These states include OFF, Turn pump on, Both Alum and Water Pump On, Change Location-stay, Residence Time of Tank, Hold, Change Location-leave, Increment Alum, and Run Increment Alum. These states have different rules that determine when the state ends and which state is next.

For example in the figure above, when Process Controller is switched to Change Location-Stay, the rules governing this state allows Process Controller to run in this state until the Elapsed time in current state is greater than the residence time of tube settler. When that happens, then the next state that Process Controller switches to is Hold.

After all modifications are made in process controller for the day the days setup should be saved. To save, click the disk icon (shown by the red arrow) and save in the setup in format of Setup Month DD in the folder created for the day

Set Points

As seen in the figure above, residence time of tube settler is a set point created to hold the value of the residence time of the tube settlers. Set points can be either variables or numerical values.

States:

Alum pump on: Set point

HMI VI Path

This is an application that displays a visual representation of the system and system sensors after the system has been programmed in. We generally do not use it so HMI Failure is not a problem.

States

To toggle between states, click on the Plant Operation tab after opening process controller. On the upper left corner, the states can be changed by clicking the up or the down arrow.

  • OFF

Every pump is turned off. Nothing is running during this state.

  • Turn Pump On

This state turns only the water pump on. Process controller stays in this state unless changed by an operator.

  • Both Alum and Pump On

This state turns on both the alum pump and the water pump. For the alum dosing, the A + Blog(NTU) formula for dosage is used. Process controller stays in this state unless changed by an operator.

  • Change Location Stay

Both pumps are on in this state. After the residence time of the tank has passed by, Process Controller switches to the Hold state. For the alum dosing, the A + Blog(NTU) formula for dosage is used.

  • Residence Time of Tank

Process Controller runs both pumps for the residence time of the tank then shuts the tank OFF. The A + Blog(NTU) formula for dosage is used for the alum dosing.

  • Hold

This state is the idle state. Leave Process Controller in this state when modifications are being made to the tank. It functions the same way as Both Alum and Pump On except data recorded while in this state are ignored.

  • Change Location (Leave)

Both pumps are on in this state. After the residence time of the tank has passed by, Process Controller switches to the Both Alum and Pump On state. The A + Blog(NTU) formula for dosage is used for the alum dosing.

  • Increment Alum

Both the alum and water pump are on in this state but a different dosing of alum is used that starts the alum dosage at a set level and increases it by a preset amount. Process controller runs on this state until the residence time of the tank has elapsed, then Process Controller switches to the Run Increment Alum state.

  • Run Increment Alum

This state is the same as Increment Alum except Process Controller switches to the Increment Alum state after the residence time of the tank has elapsed.

Set Points

OFF- if "if" statement reads true, whatever is running (plant, alum pump, etc.) is turned off. (unit: none, Type: Constant, value: 0)

ON- if "if" statement reads true, whatever is running (plant, alum pump, etc.) is turned on (unit: none, Type: Constant, value: 1)

a (for alum dose) - Constant for alum dosing equation (unit: mg/L, Type: Constant, value: varies). See: Alum dose

b (for alum dose) - Constant for alum dosing equation (unit: mg/L, Type: Constant, value: varies). See: Alum dose

raw water 1 ID - Method that identifies the raw water turbidimeter (unit: none, Type: Constant, value: 1)

floc sample 2 ID - 4 ID- Methods that identify turbidimeters 2-4. These are connected to the tube settlers. (unit: none, Type: Constant, value: 2-4 depending on which turbidimeter it is connected to.)

raw water turbidity 1 - Method that connects the turbidimeter to process controller and allows data collection. (unit: none, Type: Variable, value: turbidity reading) Uses set point "raw water 1 ID".

floc turbidity 2-4 - Methods that connect the turbidimeters to process controller and allows data collection. (unit: none, Type: Variable, value: turbidity reading) Uses set point "floc sample _ ID" .

plant flow rate - Place to keep track of incoming flow. This effects alum dose and is used throughout process control. (unit: mL/min, Type: Constant, value: determined flow rate of plant. MAKE SURE UNITS MATCH ACTUAL VALUE)

alum stock concentration - Keeps track of concentration of alum stock solution. Used for alum dosing. (unit: mg/L, Type: Constant, value: determined stock concentration. MAKE SURE UNITS MATCH)

alum dose - Method for alum dosing, based on equation: y = a + b*log(NTU). (unit: mg/L, Type: Variable, value: matches current dosing value). Set points: a (for alum dose), b (for alum dose), raw water turbidity.

tubing size (for alum pump) - Size of tubing being used with alum pump. Important for proper alum dosing. (unit: none, Type: Constant, value: depends on type of tubing used. Usually 16.)

alum pump control - Method that controls alum pump. Essential for alum dosing. (unit: none, Type: Variable, value: equivalent to current alum dose) Set points: plant flow rate, alum stock concentration, alum dose, tubing size (for alum pump)

residence time of tube settler - Residence time of tube settler. (unit: s, Type: Constant, value: actually 7, but 14 minutes used. Must be in seconds)

Residence time of tank - Residence time of tank. (unit: s, Type: Constant, value: 18 mintus, or 1080 seconds.)

Alum dose increment - Method that allows for a state to automatically vary the alum dosing according to specified parameters. (unit: none, Type: Variable, value: 0) Uses set points: reset state, state to increment, slope, intercept, max x. The method automatically starts at -1.

Reset state - state that automatically sets to 0 when entered. (unit: none, Type: Constant, value: 6. This is the position of the Hold State. The state was picked randomly.)

State to increment - identifies which state is being incremented. In our case it is the state "Increment Alum" (unit: none, Type: Constant, value: 8 - this is the position of the state "Increment Alum" in the State list.)

Slope - Runs the equation y = mx + b. x is automatically incremented by 1 so it must be changed if you want otherwise. For our case we are using 5 because we are incrementing from 0-30 and do not want 30 data points. (unit: mg/L, Type: Constant, value: 5)

Intercept - Runs the equation y = mx + b. Defines what you want the y intercept to be. In our case we are using it to vary the alum dosing. We want results for values between 0-30 meaning the first data point is at 0 so we have a y intercept of 0. (units: mg/L, Type: Constant, value: 0)

Max x - Maximum value of incrementation. In this case it is being used by "Increment Alum". We are incrementing by five and want a maximum dose of 30, so our max value is 6 but since x starts at -1 instead of 0 the value is increased by 1 to compensate, leaving us with a value of 7. (unit: mg/L, Type: Constant, value: 7)

Found residence time of tank - is the residence time for the tank when done visually by turning off alum, letting the tank run for a while, then turning the alum back on and watching how long it took for flocs to exit. This came out to be 39 minutes. This is currently irrelevant and not used. (unit: s, Type: Constant, value: 39 minutes)

Increment alum time - time that increment alum spends in increment alum. State doesn't actually control x but allows for a loop. State where alum is incrementing, no testing is done.

Alum pump control increment - Method that controls alum pump, uses alum dose increment instead of alum dose. (unit: none, Type: Variable, value: 0) Set Points: plant flow, alum stock concentration, alum dose increment, tubing size.

Tubing size (for alum pump) - same as other, but used by alum pump control. Selected Set Points must be in same order as in Required Set Points so this was created to have proper sequencing.

  • No labels