Organizing Rules and States in Process Controller

This tutorial assumes that you have completed the exercises of tutorials 1 and 2 successfully. In this particular tutorial, we will focus on the order of rules and states in Process Controller. The subsequent tutorial will focus on interfacing pumps, valves and sensors with states in Process Controller.

What is a State?

The computer sends a digital signal to a stampbox that translates the signal into an analog signal that is utilized to control pumps and valves. A state is the signal that the computer is programmed to send for a given set of conditions over a duration of time.

Step One: Create Off State

In process controller software, click on the "Rules & States" tab and create an OFF state. This state is an important state in case you wish to shut down the experiment at any point.

Step Two: Create the Rule to Switch State

Process Controller requires rules in order to switch to a different state (mode of operation). In creating a rule to switch between states, you need to determine what state you wish to switch to next, and the rule for switching that state.

Rules are conditional if statements for requirements to change state. You can add more than one rule for each state. Each rule you add will act as AND statements. The computer will satisfy the first rule then satisfy the conditions of the second rule before switching states.
Adding additional conditional statements in the same rule act as OR statements. If any of the conditions achieved on the rule list are met, then the computer will proceed to the next state.

The OFF state is a state that we utilize when we want everything shut down. When we shut everything down, we do not want it to then swith to a different state (mode of operation) such as adding chemical to a stock tank. Therefore we should set the state to switch to next as OFF state. The rule here is trivial, but we can set the rule that if time elapsed in the current statement is greater than OFF (a value of zero) then we will switch to the OFF state. Sketch this rule out if it seems confusing.

Step Three: Add More States

The next step is to add two new states: "Add Chemical" and "Settle." First, click add new state and name the state "Add Chemical." For this state, we need a rule. There are many rules we could create, but for simplicity's sake, let's say that if the time in the Add Chemical state exceeds 1000 s that we should switch to "Settle."

In order to make this rule we first have to create a new state "Settle." Do so, adding the state after Add Chemical.

You can see that in the figure above that the next state to proceed to is set to OFF. Set this instead to "Settle".

Step Four: Create Set Point for Rule

Next we need to create a set point so that the computer has a value for the 1000 s time interval which it will spend in the Add Chemical State. Click on set points and click "Add Set Point" after the last set point you just added. Title the set point "Time for Add Chemical" and enter a value of 1000 (as the time in Process Controller is measured in seconds).

As a quick exercise, make a rule for the "Settle" state that if the time exceeds 30 seconds then switch back to the "Add Chemical" state.

Step Five: Edit State to Correspond with Stamp Box Controls

In the Rules and States tab, click on States. Look under "output settings." You will see a blank sheet and all output settings should be set to Off. Slightly to the left of output settings, you will see a column of numbers 0-12. This column of numbers corresponds to the connection number in the stamp box. For example, if you wish a valve to be controlled from row 0, plug in the cable to position 0 in the stamp box, and in Process Controller set the appropriate value in each state of whether you want that valve to be OFF, ON, or somewhere in between.

For this specific example, we wish row 0 to control the valve that allows the passage of chemical. Click on the output description tab and type "Add Chemical Valve." On row 1, name that output "Drain Valve."

Next, click on the set point "Add Chemical" and set the "Add Chemical Valve" to ON since we wish the valve to allow the flow of chemical into the tank. We wish to set the "Drain Valve" to OFF since during this state, we do not wish to drain the chemical tank.

We also wish to control the pump speed of adding chemical. In the "Add Chemical" state, we wish to set the pump speed to the pump speed that we set in a previous tutorial. Under pump 0, name the pump "Chemical Pump" and under "pump on/off" set it to ON. Then under "pump speed" drag down until you find the set point "Mixing Pump Speed." Below is a figure of how your edited "Add Chemical" state should look like.

For the "Settle" state, we wish to turn off the pump and turn off the valve that releases chemical, and we wish to keep "Drain Valve" OFF. Do this and then confirm that your edited state looks like the one in the figure below.

Step Six: Check the Stamp Box

If you have not already done so, plug in the appropriate valves and pump to the appropriate location in the stamp box. Remember to check that the stamp box is communicating with the computer and that your code makes logical sense for what you are going to run.

Exercise for Completion

We're not done yet! Your next task is to add another state "Drain" to drain the experiment. Set the time for the drain state not to exceed 100 s. You should then set the order of processes to be "Add Chemical" state switching to the "Settle" state switching to the "Drain" state. The "Drain" state should then switch back to "Add Chemical" state. In this sense, we are creating a cyclical process that could run indefinitely. In the "Drain" state set the "Drain Valve" to ON.

Click here to see if you have set up the process appropriately.

  • No labels