Level Regulation with MPC

Pumped-storage hydroelectricity is a promising method to improve energy dispatch potential with increasing renewable sources such as wind and solar. The following application is a dual reservoir system with pumped water that either enters the upper or lower reservoir.

You are asked to develop a model predictive controller (MPC) to reach a level set point for tank 2 (e.g. 50% full, level=0.5), initially starting from empty tanks. Tune the controller for satisfactory performance with setpoint changes in the level or with disturbances to the valve position (γ1). Demonstrate the control performance and discuss methods used to achieve satisfactory control during startup from empty and with valve position changes (show both of these).

A pump transports water to tank 1 where it drains to tank 2. Both tanks have an opening at the bottom that allows liquid to flow out. A valve is used to divert pumped liquid into tank 1 (valve position=0), into tank 2 (valve position=1) or fractionally into both (valve position 0-1). The valve position is not available to the controller as a measurement and is considered a disturbance to the process. Only the level of tank 2 (bottom tank) is available as a measured value. The pump rate can be manipulated between 0 and 1. The pump has a maximum rate of change of 0.1 every second.

For control you can use linear or nonlinear model predictive control. For estimation, you can use moving horizon estimation (MHE) or simple bias updating. The simplest option is linear MPC with bias updating. The following is a linear second order model that approximates the level dynamics.

τ1h1dt=h1+K1p τ2h2dt=h2+K2h1

where 1 and 2 refer to the tanks, τ1=18.4 and τ2=24.4 are time constants, K1=1.3 and K2=1.0 are gains, h1 and h2 are liquid level heights, and p is the pump flow between 0 and 1.

Python (GEKKO Solution)

Python (APM) Solution

Simulink Solution

Streaming Chatbot
💬