This GoldSim model demonstrates how to simulate controlled discharge from a reservoir using the built-in Controller element, specifically configured with the Proportional-Integral-Derivative (PID) control method. It is designed for engineers and modelers, particularly those working on environmental or water resource systems, to illustrate how GoldSim can simulate the dynamic behavior of controlled infrastructure.
Control systems are fundamental to operating water infrastructure, and PID control is a well-established feedback mechanism used across many engineering disciplines (e.g., Getu, 2016). In water resources, simulating PID logic is useful for representing:
- Automated Systems: Mechanized controllers like those regulating outlet valves on tanks or dams, or variable speed pump stations maintaining water levels in ponds or canals.
- Manual Operations: The decision-making process of a human operator who adjusts controls (e.g., a sleeve valve opening) based on observed conditions (e.g., reservoir level) relative to operational targets.
- Hybrid Operations: Conceptualizing the combined effect of automated control systems and human operator oversight. This includes scenarios where operators periodically adjust operational targets or controller tuning based on forecasts or system-wide conditions, or intervene manually during specific events, layered on top of underlying automated responses.
At the heart of this simulation lies the Reservoir, represented by a GoldSim Pool element, which dynamically tracks its water volume based on incoming and outgoing flows. Like a real reservoir, it receives variable Inflow (represented here by a Stochastic element, but easily replaceable with other data sources like time series or outputs from other model components). It also loses water to evaporation, modeled simply here as a function of reservoir volume, but capable of being refined with more detailed methods, like this. The primary challenge, however, is managing the controlled discharge to meet operational goals.
The operational goal is defined by the Target_Elev (a Data element), representing the desired water surface elevation. Because controllers often work better with quantities like volume or mass, this target elevation is translated into a target volume using the reservoir's specific geometry, captured in the Elev_Vol_Table (a Lookup Table element). This calculated target volume becomes the desired state, or 'Setpoint', for the control system.
The Controller element continuously monitors the Reservoir's current volume (the 'Process Variable') and compares it to the desired Target volume. The difference between these two is the 'Error' – indicating how far the reservoir's current state is from its target.
In this model example,Controller1is configured to use the PID (Proportional-Integral-Derivative) method to decide how to react to this error. It doesn't just look at the current error; it considers its history and trend, with the influence of each component determined by adjustable gain factors (Kp, Ki, Kd):
- The Proportional (P) component provides an immediate response proportional to the current size of the error (a large deviation prompts a strong corrective action). The Kp (Proportional Gain) factor scales this response, determining the strength of this immediate reaction to the current deviation.
- The Integral (I) component looks back at the accumulated error over time, which helps eliminate any persistent, small deviations (steady-state errors) that the proportional term alone might not fix. The Ki (Integral Gain) factor determines how strongly the controller reacts based on this accumulated error, influencing how quickly these persistent errors are corrected.
- The Derivative (D) component anticipates the future by looking at how quickly the error is changing, acting like a stabilizing brake to dampen oscillations and reduce overshoot. The Kd (Derivative Gain) factor determines the strength of this dampening effect based on the error's rate of change.
The influence of each of these P, I, and D components is fine-tuned using the Kp, Ki, and Kd gain factors. The sum of these weighted responses determines the controller's 'Actuation Signal' – in this case, a requested discharge rate.
This requested rate is then sent to the Reservoir element. The reservoir attempts to meet this demand, and the actual outflow achieved is reported by the Discharge_Rate element (which shows Reservoir.Controlled_Discharge), limited naturally by the amount of water actually available. The simulation begins with the reservoir containing an Init_Vol (Data element) of water.
In essence, the model simulates a continuous feedback loop: the reservoir level influences the controller's calculation, which determines the discharge request, which in turn affects the reservoir level, driving the system dynamically towards its target elevation amidst changing inflows and evaporation losses.
Understanding PID Control Logic and Tuning for Water Systems:
For modelers accustomed to simulating physical processes governed by hydraulics (like flow through an orifice) or environmental factors (like evaporation), the concept of using adjustable "tuning factors" like Kp, Ki, and Kd to simulate controlled discharge might seem abstract. However, many real-world water systems rely on active controls – whether automated (sensors connected to valves/pumps) or manual (human operators making adjustments) – to meet operational targets like maintaining a specific water level. Simulating these systems requires capturing not just the physics but also the control logic or operational strategy.
Think of it like adjusting how sensitively an automated valve reacts or how aggressively/cautiously a human operator typically responds to level changes.
Why Tuning is Necessary: Every physical system is different. A large reservoir with high-capacity outlets responds differently than a small tank with limited outflow. "Tuning" is the process of adjusting Kp, Ki, and Kd so that the generic PID logic produces a control response appropriate for the specific physical system being modeled. The goal is typically to find a balance that makes the simulated controller react quickly enough to keep the level near the target without causing excessive oscillations (overshooting and undershooting) or being too sluggish.
The Tuning Process: Finding the right gain values often involves an iterative approach, mirroring how real control systems are often commissioned or optimized:
- Start with an initial estimate or default values for Kp, Ki, and Kd.
- Run the simulation.
- Visually inspect time history plots of key variables (like Reservoir Elevation vs. Target Elevation, Outflow rate). Observe if the level oscillates, how quickly it settles near the target, and if there's any steady-state error.
- Adjust Kp, Ki, and Kd based on the observations (e.g., if oscillating too much, maybe reduce Kp or increase Kd; if slow to reach target, maybe increase Kp or Ki).
- Repeat the run/observe/adjust cycle until the desired performance is achieved (e.g., smooth, responsive control).
A Suggested Manual Tuning Strategy:
A practical starting strategy or 'rule of thumb' for tuning this type of model manually could be:
- Start with Proportional-only control: Set Kp = 1.0 (or another reasonable starting value), and set both Ki and Kd to 0.0. Run the simulation and observe the response (e.g., speed of reaction, steady-state error, oscillation). This helps understand the basic system response to proportional control alone.
-
Introduce Integral and Derivative action gradually:
- Begin incrementally adjusting Kp (often downwards from the initial guess, especially if oscillations were observed or need to be dampened).
- Simultaneously, start incrementally increasing Ki and Kd slightly from zero.
- Note: Systems like this can be very sensitive to the Integral (Ki) and Derivative (Kd) terms. It's often best to start with very small values (e.g., initially trying values less than 0.1) for Ki and Kd and observe their effect carefully before making larger changes. Remember, Ki primarily addresses steady-state error but can increase overshoot, while Kd primarily dampens oscillations but can amplify noise if set too high.
- Iterate: Continue adjusting Kp, Ki, and Kd in small steps, running the simulation after each adjustment and observing the time history plots, until a satisfactory balance of responsiveness, stability (minimal oscillation/overshoot), and accuracy (minimal steady-state error) is achieved for the system's typical operating conditions.
In this example model, the gains were tuned using this type of visual inspection and iterative adjustment method to achieve a response that effectively manages the reservoir level against inflow variations.
While this model uses a practical, observation-based tuning approach, it's important to know that more formalized procedures exist for determining PID gains. Methods like Ziegler-Nichols provide systematic experimental steps to find starting values for Kp, Ki, and Kd. These techniques are standard practice in control engineering and are detailed in textbooks like Seborg et al. (2017), Process Dynamics and Control, among others. Using the GoldSim framework allows modelers to implement and test these operational control strategies layered on top of the physical system simulation.
Below is an example result of controlling the outflow using the tuned PID configuration developed through this iterative process.
Scenario Analysis:
The model linked below and labeled, "Reservoir_Discharge_Options.gsm" uses GoldSim's Scenario Manager so users can easily run and compare the system's performance using different control methods (PID, Proportional-only, Deadband) under identical inflow conditions, demonstrating the different response characteristics of each control strategy.
This example model demonstrates the application of GoldSim's Controller element for simulating operational rules common in reservoir and water management systems. It highlights how GoldSim can be used to build, tune, and compare different control strategies to understand and predict system behavior, providing valuable insights for design and operational planning.
References
Getu, B. N. (2016). Water level controlling system using PID controller. International Journal of Applied Engineering Research, 11(23), 11223–11227.
Other Examples and Resources
- PID Controller
- Modeling a Control System
- Using Controller Elements - GoldSim User Manual
- Lesson 7 - Simulating Feedback Control - GoldSim
Comments
0 comments
Please sign in to leave a comment.