Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
Figures and Tables
Figures and Tables
Table of Contents
minLevel5
maxLevel5
Expand
Abstract
Abstract

Abstract bbb

We describe here easily configured process control and data acquisition software and hardware that significantly enhance experimental evaluation of unit processes and that permit fully automated parametric studies. The process control software is a LabVIEW executable and incorporates sensors, states, rules, an external microprocessor for controls, the ability to link to external LabVIEW code to add new features, and data logging. The composite system is flexible and user friendly. First year undergraduates have used the software to control a bench top drinking water treatment plant and both undergraduate and graduate students have used the software to conduct parametric studies of methane generation, the activated sludge process, flocculation, and porous media filtration. The system offers the user the ability to program an entire series of experimental runs including variation of a parameter over a series of values and inclusion of replicate tests to confirm repeatability of the results. The automated parametric testing has greatly increased our ability to study the response of complex systems. Evaluation of colloidal particle flocculation and porous media filtration in bench-scale experiments are presented here as example applications of the process control software.

Keywords: process control, data acquisition, automation, parametric testing, flocculation, filtration

...

Expand
Procedures
Procedures

Procedures

The process control software was written using LabVIEW. The high level predefined functions, the ease of developing graphical user interfaces, and the integration with input and output devices made LabVIEW the preferred programming environment. In addition to the software we designed hardware interfaces to simplify the use of sensors and controls.

Sensor outputs and power supply inputs have been integrated in a single cable to make sensors easy to use in a student laboratory environment. The sensors use a standardized wiring scheme so that a variety of sensors can be used in a connect-calibrate-measure approach. The elimination of power supplies at each experiment location and all of the associated wiring has made sensor use easy for students. The process control software interface for sensors allows adding and configuring sensors while simultaneously collecting data.

The output control module can vary the state of on/off devices as well as control devices that require a 4-20 mA signal. The on/off outputs are 24 V with sufficient current to operate small solenoid valves or to switch relays for controlling the power to any number of devices. The 4-20 mA analog outputs are used to control peristaltic pumps. Control of digital devices has not yet been implemented; however, it is possible to add external code that would send commands to a serial or GPIB port or across the internet to control an instrument.

Data Acquisition

The Process Control software is designed to receive data from two types of digital sources. Sensors or meters that have their own digital communication interface can transmit their data to the process control software through external code that is written specifically for each meter. For example this method is used to acquire data from HF Scientific turbidimeters. Sensors that can be configured to produce an analog voltage such as pressure, pH and dissolved oxygen are monitored with a National Instruments SCXI data acquisition system. A dedicated computer monitors all of the data channels of the SCXI data acquisition system and serves requested data to client computers across the internet using TCP-IP. This data acquisition protocol makes it possible for multiple clients to monitor the same sensor (useful in a teaching laboratory setting) and to remotely monitor experiments. The Data Server software was written using LabVIEW and can transmit data either one scan at a time or continuously at the acquired data acquisition rate. In the single scan mode the client computer must request each scan. This mode is used by the Process Control software. The advantage of the single scan data acquisition mode is that if the Process Control software on the client computer slows down because of a lack of computer resources, the software will continue making decisions using the most current sensor readings. If the continuous data mode had been used and if the Process Control software wasn't able to keep up with the high data rate, then the Process Controller software would begin using old data to control the process. Control issues are a concern for applications where sensor data is used to make decisions about the process.

Sensors are wired using Category 5 or 6 Ethernet cable using our own #analog wiring standard. Two wires are used to carry the sensor output voltage designated as S- and S+. Five wires are used for different voltage power supplies, and one wire is used for the power supply ground. It is convenient if student laboratories are hardwired with data acquisition ports at workstations, but this is not required for use of the Process Control software. When used, each data acquisition port is wired with up to five different power supplies. Sensors are wired to connect to the power supply that they require. Thus, the sensor is powered and monitored through a single port. This scheme is used for a variety of sensors including pressure, strain gage, pH, dissolved oxygen, turbidity, and temperature. For several of the sensors the power supplies are also used to power a signal conditioning circuit to transform the sensor output into a voltage that can easily be monitored with a data acquisition system.

Anchor
analog wiring standard
analog wiring standard

Wiring standard used for combining power supplies and analog data acquisition in a Category 5 Ethernet cable.

T-568B standard

T-568A standard

voltage

white/orange

white/green

S-

orange

green

S+

white/green

white/orange

ground

blue

blue

-5 V

white/blue

white/blue

+5 V

green

orange

+10V

white/brown

white/brown

-15 V

brown

brown

+15 V

Sensors, Signal Conditioning, and Calibration

Monitoring sensors requires conversion of the measured voltage into a physically meaningful unit. The data acquisition module of the Process Controller software uses conversion files to implement a variety of conversion algorithms including polynomials and correspondence tables as well as the calibration algorithms required for pH and dissolved oxygen. The pressure sensor conversion files make it easy to use pressure sensors to measure pressures in various physical units, to measure reactor volumes (of known cross sectional area), and flow rates (through devices with known relationships between flow and pressure drop). In addition to the application of a conversion to a physical unit it is possible to calibrate the pressure sensor output to a specific value by changing an offset.

pH Sensors

pH sensors produce a voltage output in the range that would normally be easy to measure using standard data acquisition hardware. Unfortunately, the impedance requirement for a pH sensor is orders of magnitude higher than the inputs of standard data acquisition hardware and thus a signal conditioning circuit must be used to amplify the pH sensor output. The circuit consists of unity gain amplifiers that have less than 0.1 pA input leakage current (anonymous , 1993). A circuit diagram is available at http://ceeserver.cee.cornell.edu/mw24/Labdocumentation/pH%20Circuit.pdf. The Process Control software includes automatic pH buffer recognition and piecewise linear calibration between buffers.

Pressure sensors

We use 1 psi (7 kPa) and 30 psi (200 kPa) pressure sensors (Omega sensor models PX26-001DV, and PX26-030DV) in our laboratory to measure water depth, reactor volumes, flow rates, and head loss. These sensors have maximum output voltages of 16.7 mV and 100 mV respectively with a power supply of 10 V. We use the differential pressure model since the sensors can be used to measure gage pressure or differential pressure. The sensors can directly measure water pressure although the electrical connections must be kept dry.

The Process Control software converts the voltage output from the pressure sensors into the physical units of water column height or pressure using linear conversion algorithms. The sensors can also be zeroed or set to a measured value using a one point calibration.

Anchor
pressure sensor
pressure sensor

Differential pressure sensor.

Dissolved Oxygen

Dissolved oxygen probes produce a current in the pA range that is proportional to the oxygen concentration in the bulk solution. The signal conditioning circuit is designed to convert this very small current into a measurable voltage and to isolate the probe from the effects of fluctuations in the voltage level of the solution containing the probe. This isolation is critical if the solution is monitored with additional probes or if the solution is electrically connected to a building plumbing system or to any other voltage source. The circuit design is available at (http://ceeserver.cee.cornell.edu/mw24/Labdocumentation/Dissolved_oxygen/circuit.pdf)

Temperature

We use a linear temperature sensor coupled with a simple voltage dividing circuit such as the Omega sensor model OL703. The voltage output is converted to a temperature using a linear equation.

Controls

An #output control box designed and fabricated around the Basic Stamp® Microprocessors (Parallax 16 port BS2sx and 40 port BS2p BASIC Stamp® modules) is used for on/off control of up to six devices and for variable control of up to six peristaltic pumps. The Basic Stamp® microprocessor receives commands through the serial port from the Process Control software and then sets the values of its output ports.

Anchor
output control box
output control box

Basic Stamp® microprocessor control box with ports for 6 on/off devices and 6 variable speed peristaltic pumps.

We initially used the pulse width modulation capability of the Stamp® microprocessor to create an analog voltage output on one of the ports and then used that voltage to control a 4-20 mA output that could be used to control MasterFlex Peristaltic pumps. That approach continues to work well when we only need to control one pump, but our filtration experiments require computer control of 6 variable speed pumps. The pulse width modulation commands take too much time to execute and when we switched to six pumps the slow response of the Stamp® microprocessor caused a series of control and communication problems. We resolved that issue by adding analog output circuitry. The Stamp® microprocessor sets the values of the analog voltages by sending digital commands to three MAXIM MAX518 2-wire Serial 8-Bit Digital to Analog Converters. The peristaltic pump controls include start/stop and clockwise/counterclockwise rotation in addition to the 4-20 mA speed control.

Software for the Basic Stamp® microprocessor takes the command that it receives across the serial port from the Process Control software to set the output values of the I/O ports. Serial commands are sent one character at a time to the Stamp® microprocessor and each character received is acknowledged. The software controls information flow to overcome the lack of a serial buffer on the Stamp® microprocessor. We currently use both a single pump and a six pump version of the control box and they require different sequences of commands from the Process Control software. The software on the Basic Stamp® sends a version code to the Process Control software as the first response in a communication burst and that version code automatically configures the subsequent communication. The communication interface was designed to handle live connection of the control box to the Process Control software. The Process Control software reports status of the connection with the Basic Stamp® microprocessor and communication begins as soon as the physical connection is made.

The Stamp microprocessor control boxes have six 24 V outputs that can be used to control solenoid valves, pinch valves, relays, or other low current devices. The 24 V circuits include a pulse width modulation chip that reduces the voltage to the device to reduce power consumption and heating. This feature works well for solenoid valves since they can be held open with a relatively low voltage once open. The circuit design for the Stamp microprocessor controls is available at http://ceeserver.cee.cornell.edu/mw24/Labdocumentation/StampBox.pdf.

Process Control Software

The Process Control software runs five parallel processes during normal operation. The five processes are

  1. Data acquisition from the Data Server software using TCP-IP
  2. Calculation of output values, processing of rules to determine state changes, sending commands to the Stamp microprocessor, and logging of state changes and the rule that caused the state to change
  3. Data logging of sensor data as well as all user defined variables
  4. Graphical display of all sensor data as well as all user defined variables
  5. An event loop that responds to 20 user events to initiate processes such as sensor configuration, rule editing, pump calibration, and data server selection.

The parallel processes are asynchronous and share data through the use of code objects (LabVIEW SubVIs) that contain both data and methods.

A core feature of the Process Control software is the user programmable feature that facilitates customization of the control logic for specific tasks. The rule editor provides a programming environment for setting up states, control logic, set points, variables defined by links to external code, and selecting which user defined parameter controls each output in each state.

States

States represent different control configurations. For example, rapid sand filters could have several operating states including normal down flow operation, backwash, and filter to waste. Each of these states has different control settings (valves are in different positions) and each of the states has different rules determining when the state ends and which state is next. The Process Control software has independent #control settings for each state. The rule editor is used to set the value of each output control. Outputs can be set either to 0 (grey lightbulb) or 1 (lightbulb) or they can be set to intermediate values. If a fractional value between 0 and 1 is assigned to a Boolean output (such as solenoid valves) the Process Control software will toggle between 0 and 1 to attain the target value. If a fractional value is assigned to a pump speed control the pump will operate at the fractional value of its maximum speed. The parameters that are assigned to each output can be either constants or variables.

Anchor
control settings for each state
control settings for each state

View of the controls used to set all of the Stamp® Microprocessor outputs. These controls can have different values for every state. The "output settings" in the middle column are drop down menus containing a list of all the defined constants and variables.

Rules

Rules are used to set the exit conditions for states. A common #exit rule might be based on elapsed time in the current state, but it could also be based on sensor values or on a parameter that is calculated from a combination of sensors and other parameters. At a water treatment plant, backwash might be automatically initiated after 72 hours in the down-flow state, when pressure drop across the filter exceeds 1 m, or when the filtered turbidity exceeds 0.05 NTU. Each state can have multiple exit rules and the rules can have multiple conditions. The rules are executed and the output settings are updated approximately 20 times per second with the execution speed controlled by the software running on the Stamp microprocessor. Rules with multiple conditions are used when both conditions must be true simultaneously and thus create a logical "and" condition. Multiple rules are executed sequentially and the first rule that is true will cause the state to change to the state selected by that rule. Thus, multiple rules create the logical "or" condition, but with the added feature that each condition can have a different outcome. This feature is useful for handling emergency conditions that then cause the process to shutdown or for creating programs that cycle through different states depending on measured process values.

Anchor
exit rule
exit rule

Rule that ends the state named "BW filter after challenge" when the time in that state exceeds the set point "backwash (filter) time". The rule also indicates that the next state will be "Acid wash".

External logic

LabVIEW executables can be enabled to connect to external code. This capability makes it possible to easily extend the capabilities of the Process Control software. The external code must be designed to meet specific requirements for the data types of inputs and outputs. An external code interface has been created to take a variable number of numeric inputs and produce a single numeric output. The external code can be used for a wide variety of functions including simple #math functions, a specialized function (such as one which sets a #coagulant dose based on raw water turbidity proportional-integral-derivative control that can be used to force a controlled parameter to a desired set point, and data acquisition functions that acquire digital data from instruments.

Anchor
math functions
math functions

LabVIEW block diagram showing the external code that adds two variables or set points and returns the result.

Anchor
coagulant dose
coagulant dose

Screen shot from the Process Controller showing how inputs are sent to external code. In this case the external code estimates an alum dose based on measured raw water turbidity and a simple model that relates turbidity and alum dose.

The programming environment for creating rules that determine exit conditions for states and which state to go to readily facilitates setting up the algorithms for controlling simple repetitive processes such as a sequencing batch reactors or rapid sand filters. For experimental purposes it is desirable to have the capability to systematically vary a parameter to test the performance of the process over a range of input values. This is accomplished via an external code that compares the number of specified replicates to a parameter that increments when the process controller enters a specified state. The output parameter can be used to control pump speeds, times, or can be an input to subsequent calculations.

Incrementing functions that increment linearly and that increment following a power law relationship are as follow:

Anchor
increment equations
increment equations

Image Modified

Image Modified

The parameter, x, is an integer that increments from zero to a maximum value set by the user. The output parameters, ylinear and ypower could be used to vary a flow rate, a chemical dose, or any other parameter.

The two #increment functions are dependent on the state cycles. The state was set to cycle between states 1, 2, and 3 with the exception of a manual reset to state 0 and then to state 1 to illustrate how the increment function is reset. The power law function is useful when it is desirable to explore a larger parameter space. However, care must be taken to ensure that the controlled processes have the ability to deliver the desired range of the varied parameter.

Anchor
increment functions
increment functions

Increment functions showing how the parameter varies as a function of the state. In this example the state cycled between states 1, 2, and 3. The increment state was 2, the number of replicates was 2, the reset state was 0, the y intercept was 200, the slope was 50, and the maximum value of x was 4. The power law relationship used a coefficient of 100 and a base of 1.5.

The Process Controller can be configured to stop an experiment after the reaching the maximum value of the parameter. Otherwise it will reset the parameter to its initial value and begin the increment process again. It is also possible to systematically vary more than one parameter.

Data and process logging

The Process Controller creates two types of data files. The first column in both files is a time stamp and new files are created automatically at midnight. The datalog file contains a column for each sensor and for each variable. The datalog accumulates data at the rate set by the user. Sensor data is averaged over the data interval, but the instantaneous values are recorded for variables. The statelog file contains a row for every time the state changes. The row contains the state ID number and the name of the rule that caused the state to change. If the user caused the state to change that is indicated as well.

By using both the data and state logs it is possible to reconstruct the events that occurred during an experiment and correlate sensor and variable values with the state of the Process Controller. The data can be analyzed to troubleshoot and to determine what event caused the Process Controller to perform unexpectedly.

The Process Control software is designed to minimize control failures. If a sensor voltage goes out of range for a data acquisition channel or if communication with the Data Server is lost, all control outputs are turned off. The software responds to a power outage or Microsoft Windows restart by automatically opening up Process Control and Data Server software and returning the software to the same state as when it was shut down. Returning to the previous state requires opening up configuration files and then opening up the state log file to determine the state that the software was in when the computer was shut down.

Example application: Filter Test Apparatus

Results from operation of an experimental assembly (#photo and #schematic) designed for research on water filtration is provided here as an example of the Process Controller's use. The filter test apparatus (FTA) consists of 6 variable speed peristaltic pumps (Cole-Parmer, L/S series Masterflex pumps with remote control capabilities), 2 on-line turbidimeters (HF scientific, MicroTol 20053 and 20055), a 15 cm long by 2.5 cm diameter filter cell containing 0.4 mm to 0.5 mm sand, 4 solenoid valves (Farmington Engineering Series 6605), the Basic Stamp® microprocessor control box, the data acquisition system, a pH sensor (Oakton* pH Electrode model WD-35801-00), pressure sensors (Omega, model PX26-001DV), and a computer running the Process Control software.

A second computer running Process Control software is used to control the temperature of a tap water supply reservoir. The reservoir is instrumented with a temperature sensor and a pressure sensor. The temperature sensor is used to determine whether hot tap water or cold tap water should be added and the pressure sensor is used to determine if water needs to be added to keep the reservoir full. The reservoir contains an aeration stone and is constantly aerated to remove any supersaturated gases that are commonly found in cold surface waters and prevent evolution of gas bubbles in the filter column.

Anchor
photo
photo

Photo of the filter test apparatus.

Anchor
schematic
schematic

Schematic of the filter test apparatus showing the valve and pump configuration for pretreatment with aluminum sulfate.

The experimental objective of the FTA is to test the effect of various chemical treatments of the filter media on the particle removal efficiency. The Process Controller is used to cycle through the following states for each test.

  1. A chemical treatment (for example application of alum) can be metered into the filter using different combinations of concentration, filter approach velocity, and duration.
  2. Clean water feed – A clean water feed follows the pretreatment step and is used to flush the residual pretreatment chemicals from the column and turbidity sensors.
  3. Particle Challenge – The particle removal efficiency is measured by applying a turbid water containing a clay suspension to the filter.
  4. Backwash – The accumulated particles and the chemical from the pretreatment step are removed from the porous media. Additional states can be used to flush the turbidimeter cells with clean water to remove any settled clay or to pump an acidic solution through the filter to ensure complete removal of the surface coatings created by pretreatment of the filter media.

...