450 likes | 593 Views
PVSC Improves PLC Programming Using Real-Time Dynamic Simulation. Paul Cavanagh, P.E. Passaic Valley Sewerage Commissioners ISA WWAC Symposium August 2009. Background. Passaic Valley Sewerage Commissioners. Owns and Operates a 330 mgd wastewater treatment plant in Newark, NJ
E N D
PVSC Improves PLC Programming UsingReal-Time Dynamic Simulation Paul Cavanagh, P.E. Passaic Valley Sewerage Commissioners ISA WWAC Symposium August 2009
Passaic Valley Sewerage Commissioners • Owns and Operates a 330 mgd wastewater treatment plant in Newark, NJ • remove 93% of BOD • remove 94% of TSS • peak dry weather flows of 400 mgd • peak wet weather flows of 550 mgd • Treats about 25% of NJ’s Wastewater • 15% industrial by volume • 50% industrial by strength
PVSC’s Control System Requirements • Balance plant flow between select units • Maintain a Constant Upstream Channel Level • Respond quickly to flow disturbances and rain events
Mixed Liquor Channel Level • Maintain a constant stable level for scum collector • Quickly correct for disturbances and prevent overflows
Secondary Clarifier Settling Tanks • Evenly Split the flow between the 12 units • Ability to turn off control to select units • Minimize the movements of the Flow Control Valves
Existing PLC Flow Balance and Level Control was not meeting its Requirements • The controls were slow to correct for a disturbance such as a rain event • Stability problems that got worse during peak plant flows • Control to individual units could not be shut off • Many Flow Control Valves were constantly opening and closing 1% to 3% every minute • Tuning attempts only had a minimal effect
The Channel Level ControlResponds Slowly and is Unstable Worse During High Flows
Many Flow Control Valves WereConstantly Hunting Back and Forth
As a Result of the Problems … • … the System was kept in manual most of the time • Distribution of solids was uneven making blanket levels more difficult to control • The Scum Collector weir level would need to be frequently adjusted • The risk of overflow into an empty tank was always present
But Modifying the Control Program on the Running System is Problematic • Need to wait for a rain event to test the changes • Uncertainty would remain as not all rain events are exactly alike • The new program could fail when no one is looking • A units settling could be disturbed and solids would be discharged • The channel could overflow
So PVSC chooses to try… Real-Time Dynamic Simulation • Build a model of that captures most of the real-time dynamic interaction between the channel level and the flow control valves and test the PLC program on the model • Make changes to the PLC Program and after proving the program against simulated disturbances install the changes in the field
How Do You Build a Dynamic Simulator? Identify the Dynamic Components Blocks • Resistors • Valves, Orifice, Restrictions • Line Equation • Capacitors (Integrators) • Tanks, Reservoirs, Valve Actuators • Integrates the flow • Inductors (Differentiator) • Pipes, Conduits, • Differentiates the flow • Transfer Function • A convenient way of representing a dynamic system
Fluid Resistors • A Fluid Resistors are like Electrical Resistors except … • For Electrical Resistors the Electric Current changes linearly with Electric Voltage (Ohm’s Law) • For Fluid Resistors the Fluid Current typically changes non-linearly with Fluid Pressure (Bernoulli’s Equation) • Flow Control Valves behave like variable fluid resistors • Use a straight line equation for an ideal flow control valve
Fluid Capacitors • A Fluid Capacitor is like and an Electrical Capacitor except … • An Electrical Capacitor stores electric energy • A Fluid Capacitor stores fluid mass • An open tank or reservoir is a fluid capacitor • Integration of the flow entering/exiting the capacitor + an initial valve produces a pressure or head
Fluid Inductors • A Fluid Inductor is like an Electrical Inductor except … • An electric current through an electric inductor is sustained by its magnetic field. • A fluid current through a fluid inductor is sustained by the inertia of the mass of fluid in motion. • Long pipes or conduits are examples of fluid inductors. • Differentiate the change in flow through the inductor to find the change in pressure across the inductor.
Transfer Functions • Laplace Transform Transfer Function • 1st Order • 2nd Order • nth Order • Captures the input/output dynamics in one block
Using VisSim/OPC • PVSC staff used VisSim software to build and run its dynamic simulations. • VisSim is a computer software application that provides a visual block diagram language for modeling and simulation of complex nonlinear dynamic systems. Its fast execution lets you run models in real-time. • The OPC (OLE for Process Control) is an add-on to VisSim. The VisSim model use OPC to read and write data on the PLC. • With VisSim/OPC you can run a virtual plant for testing and developing the PLC code.
Modeling the Mixed Liquor Channel • Modeled it like a fluid capacitor – it integrates the difference between the flow in and flow out of the channel into the gallons in the channel. • The surface area of the channel is used to convert the volume of gallons in the channel into an elevation level. • Limit the Integration for the real world boundaries • The Elevation of the Upstream Weirs (104 feet) • The Elevation of the Downstream Weirs (99 feet) • Use the channel level to supply the pressure across the valves • 0 to 5 feet of water
Modeling a Flow Control Valve 3 Steps Were Used • Determined the dynamic valve position by integrating the open and close signals and adding the result to the initial position • Treated the valve like a variable fluid resistor that is effected linearly by the position and by the square root of the level • Used straight line equation for steady state flows response to position • Biased that equation by the square-root of the head pressure across the valve (creates the observed non-linear effect) • Used a transfer function to capture the lag response
Improvements Made From Testing PLC Program with the Dynamic Simulator
Changes in Channel Level Control Program Old Program New Program Exponential Average Filter of Channel Level Channel Level Control Bias Added to Flow Set Point Proportional Only Control of channel level (system is self integrating) • Moving Average Filter of Channel Level • Channel Level Control Bias Multiplied Flow Set Point • Proportional – Integral Control for of channel level
Changes to Flow Balance Control Program Old Program New Program PID block calculates Change of Position Manipulates valve for a calculated time Small 1 second deadband Proportional Only Control of each Tanks’ Flow Any combination of tanks can be put in manual Can Balance without level meter • PID block calculates Position • Manipulates valve to a calculated position • Large 2% position deadband • Proportional-Integral Control of each Tank’s Flow • All operating tanks needed to operate • Cannot Balance without level meter
Comparison of Channel Level Program Response Total Flow Changed from 360 to 600 mgd
Comparison of Flow Balance Level Response Total Flow Changed from 360 to 600 mgd
Comparison of Valve Position Manipulation Total Flow Changed from 360 to 600 mgd
The Simulation Shows thatthe New Program Provides: • Much Faster and Very Stable Level Control • prevents overflows of upstream weirs • helps the operation of the channels scum collector • Much Faster and Very Precise Flow Splitting • produces more even solids distribution • A Significant Reduction in Valve Movements • saves on valve maintenance and repair
Conclusions about Using Dynamic Simulation • Dramatically improves PLC programming • Can be faster in the long run than waiting for real disturbances • Much Safer than Testing code on the actual system • Provides new insight into the mechanics of the process which can lead to further improvements
Special Thanks to: • The Commissioners • Bryan Christiansen • Sheldon Lipke • Phil Habrukowich • Tom Wasilewski • Jerry Oselador • Loukas Koufodontes
Resources • Books • Modeling Engineering Systems by Jack W. Lewis • Instrument Engineers' Handbook: Process control and optimization by Béla G. Lipták • Engineer In Training Reference Manual by Michael R. Lindberg, PE • Web Sites • http://www.vissim.com/ • http://blog.prosig.com/
The End Paul Cavanagh, PE pcavanagh@pvsc.com http://www.pvsc.com/