Lab II · VFD-driven pump with closed-loop PID control
Operating point, throttling against speed control, and a PID loop, tuned by you, that holds the discharge pressure through a 20 % drop in demand.
Objectives
As set by the Lab Works booklet:
- Apply the Affinity Laws to model a centrifugal pump's H–Q curve at variable speed.
- Model the system (pipe network) curve and locate the operating point.
- Implement a discrete PID controller regulating discharge pressure by commanding pump speed.
- Compare quantitatively the energy consumption of VFD speed control against mechanical throttling for the same flow reduction.
Background
A centrifugal pump scales with speed through the Affinity Laws; the system curve is ; the operating point is where the speed-dependent pump curve crosses the system curve. A discrete PID controller commands the pump speed so that the measured discharge pressure tracks its set-point despite changes in demand. The electrical power drawn at any operating point is
with in m³/s.
Parameter sheet
| Parameter | Symbol | Value |
|---|---|---|
| Rated pump speed | 1 475 rpm | |
| Rated flow at | 120 m³/h | |
| Rated head at | 25 m | |
| Rated power at | 11.5 kW | |
| System static head | 5 m | |
| System friction coefficient | such that | |
| Fluid density | 1 000 kg/m³ | |
| Pump + motor efficiency | 0.75 | |
| Pressure set-point (discharge) | SP | equivalent to at |
| Demand step (simulated) | — | flow demand drops 20 % at s |
| PID gains | to be tuned by you |
Procedure
The booklet's five steps, with the names the checker looks for shown in code font.
- Set up the environment. Import NumPy and Matplotlib (already in the template).
- Define parameters. Set
H0,a,Hs,k0andeta; deriveaandk0from the rated point. - Implement the models.
- Pump and system curves, and the operating point of identical pumps in parallel at speed ratio :
Write op_point(r, k, n_pumps=1) returning (Q, H) (no flow if ), and pump_power(Q, H) returning kW with Q in m³/h.
- Throttling at full speed to 96 m³/h: the valve setting
k_thrand the powerP_thr. VFD on the original system curve:r_vfdandP_vfd. VFD holding 25 m at the pump:r_cpandP_cp.
- Generate the signals. Write
simulate(Kp, Ki, ...)returningt, H, rover 80 s withdt = 0.01s. The system isk0until s, thenk_dem. Start from , a measured head of 25 m, an empty integral, and a delay buffer filled with 25 m. At each step, in this order:- operating point at the current speed:
Q, H = op_point(r, k); - transport delay: append
Hto the buffer and take the oldest value out (the buffer holdsround(delay / dt)values); - sensor lag:
Hm += dt / tau_s * (H_delayed - Hm); - PID:
e = H_set - Hm,integral += e * dt,u = 1 + Kp * e + Ki * integral(plus a derivative term if you useKd), clamped to [0, 1.1]; if the clamp is active, undo this step's integration (anti-windup); - speed lag:
r += dt / tau_m * (u - r); - store
H(from step 1) and the newr.
- operating point at the current speed:
- Plot and analyse. Plot the head and the commanded speed against time for the PID/VFD case; plot the pump and system curves with the VFD and throttling operating points marked; report the electrical power of each scenario, then answer the questions under the workspace.
The checker calls op_point, pump_power and simulate with random arguments on every run, so each function must work for any sensible input, not only the lab's values. The gains 0.02 and 0.01 used by one check are only a common reference point for comparing models: the booklet leaves the tuning to you.
Report
One individual report and your code, in this order: Objective, Model, Parameters, Results, Discussion, Conclusion, Code, marked out of 20 (model 6, results and plots 5, discussion 6, report quality 3). The workspace builds it from your work.