...
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
|
Expand | ||||
---|---|---|---|---|
| ||||
AbstractbbbWe 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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ProceduresThe 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 AcquisitionThe 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.
Wiring standard used for combining power supplies and analog data acquisition in a Category 5 Ethernet cable.
Sensors, Signal Conditioning, and CalibrationMonitoring 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 SensorspH 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 sensorsWe 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. Dissolved OxygenDissolved 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) TemperatureWe 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. ControlsAn #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.
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 SoftwareThe Process Control software runs five parallel processes during normal operation. The five processes are
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. StatesStates 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 RulesRules 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.
External logicLabVIEW 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.
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:
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.
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 loggingThe 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 ApparatusResults 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.
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.
|
...