Title: PVSC Improves PLC Programming Using Real-Time Dynamic Simulation
1PVSC Improves PLC Programming UsingReal-Time
Dynamic Simulation
- Paul Cavanagh, P.E.
- Passaic Valley Sewerage Commissioners
- ISA WWAC Symposium
- August 2009
2Background
3Passaic 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 NJs Wastewater
- 15 industrial by volume
- 50 industrial by strength
4PVSCs Control System Requirements
- Balance plant flow between select units
- Maintain a Constant Upstream Channel Level
- Respond quickly to flow disturbances and rain
events
5Mixed Liquor Channel Level
- Maintain a constant stable level for scum
collector - Quickly correct for disturbances and prevent
overflows
6Secondary 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
7The Problem
8Existing 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
9The Channel Level ControlResponds Slowly and is
Unstable
Worse During High Flows
10Many Flow Control Valves WereConstantly Hunting
Back and Forth
11As 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
12But 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
13So 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
14Developing the Dynamic Modelof the Channel and
Valves
15How 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
16Fluid Resistors
- A Fluid Resistors are like Electrical Resistors
except - For Electrical Resistors the Electric Current
changes linearly with Electric Voltage (Ohms
Law) - For Fluid Resistors the Fluid Current typically
changes non-linearly with Fluid Pressure
(Bernoullis Equation) - Flow Control Valves behave like variable fluid
resistors - Use a straight line equation for an ideal flow
control valve
17Fluid 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
18Fluid 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.
19Transfer Functions
- Laplace Transform Transfer Function
- 1st Order
- 2nd Order
- nth Order
- Captures the input/output dynamics in one block
20Using 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.
21Modeling 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
22PVSCs Channel Level Model in VisSim
23Modeling 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
24Step 1 - Valve Position Calculation
25Step 2 - Steady State Flow Calculation
26Valve Flow Increases With Channel Level
27Step 3 - Lag Response Calculation
28PVSCs Complete Flow Control Valve Model
29The Complete Plant Model
30The OPC Interface
31Human Machine Interface to the Model
32Improvements Made From Testing PLC Program with
the Dynamic Simulator
33Changes in Channel Level Control Program
- Moving Average Filter of Channel Level
- Channel Level Control Bias Multiplied Flow Set
Point - Proportional Integral Control for of channel
level
- 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)
34Changes to Flow Balance Control Program
- PID block calculates Position
- Manipulates valve to a calculated position
- Large 2 position deadband
- Proportional-Integral Control of each Tanks Flow
- All operating tanks needed to operate
- Cannot Balance without level meter
- 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
35Comparison of Channel Level Program Response
Total Flow Changed from 360 to 600 mgd
36Comparison of Flow Balance Level Response
Total Flow Changed from 360 to 600 mgd
37Comparison of Valve Position Manipulation
Total Flow Changed from 360 to 600 mgd
38The 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
39Running New PLC Program On the Real System
40New PLC Program Worked Immediately!
41Conclusions 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
42Special Thanks to
- The Commissioners
- Bryan Christiansen
- Sheldon Lipke
- Phil Habrukowich
- Tom Wasilewski
- Jerry Oselador
- Loukas Koufodontes
43Resources
- 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/
44Demonstration
45The End
- Paul Cavanagh, PE
- pcavanagh_at_pvsc.com
- http//www.pvsc.com/