DriveLab
Account

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.

Print QR code

Objectives

As set by the Lab Works booklet:

  1. Apply the Affinity Laws to model a centrifugal pump's H–Q curve at variable speed.
  2. Model the system (pipe network) curve and locate the operating point.
  3. Implement a discrete PID controller regulating discharge pressure by commanding pump speed.
  4. 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 Hsystem=Hstatic+kQ2H_\text{system} = H_\text{static} + kQ^2; 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

Pelec=Q H ρ gηpump ηmotorP_\text{elec} = \frac{Q\, H\, \rho\, g}{\eta_\text{pump}\,\eta_\text{motor}}

with QQ in m³/s.

Parameter sheet

ParameterSymbolValue
Rated pump speedN1N_11 475 rpm
Rated flow at N1N_1Q1Q_1120 m³/h
Rated head at N1N_1H1H_125 m
Rated power at N1N_1P1P_111.5 kW
System static headHstaticH_\text{static}5 m
System friction coefficientkksuch that H1=Hstatic+kQ12H_1 = H_\text{static} + kQ_1^2
Fluid densityρ\rho1 000 kg/m³
Pump + motor efficiencyηpumpηmotor\eta_\text{pump}\eta_\text{motor}0.75
Pressure set-point (discharge)SPequivalent to H1H_1 at t=0t = 0
Demand step (simulated)—flow demand drops 20 % at t=20t = 20 s
PID gainsKp,Ki,KdK_p, K_i, K_dto be tuned by you

Procedure

The booklet's five steps, with the names the checker looks for shown in code font.

  1. Set up the environment. Import NumPy and Matplotlib (already in the template).
  2. Define parameters. Set H0, a, Hs, k0 and eta; derive a and k0 from the rated point.
  3. Implement the models.
    • Pump and system curves, and the operating point of NN identical pumps in parallel at speed ratio rr:
H=r2H0−a(QN)2,H=Hs+k Q2,Q=r2H0−Hsa/N2+kH = r^2 H_0 - a\left(\frac{Q}{N}\right)^2, \qquad H = H_s + k\,Q^2, \qquad Q = \sqrt{\frac{r^2 H_0 - H_s}{a / N^2 + k}}

Write op_point(r, k, n_pumps=1) returning (Q, H) (no flow if r2H0≤Hsr^2 H_0 \le H_s), and pump_power(Q, H) returning kW with Q in m³/h.

  • Throttling at full speed to 96 m³/h: the valve setting k_thr and the power P_thr. VFD on the original system curve: r_vfd and P_vfd. VFD holding 25 m at the pump: r_cp and P_cp.
  1. Generate the signals. Write simulate(Kp, Ki, ...) returning t, H, r over 80 s with dt = 0.01 s. The system is k0 until t=20t = 20 s, then k_dem. Start from r=1r = 1, a measured head of 25 m, an empty integral, and a delay buffer filled with 25 m. At each step, in this order:
    1. operating point at the current speed: Q, H = op_point(r, k);
    2. transport delay: append H to the buffer and take the oldest value out (the buffer holds round(delay / dt) values);
    3. sensor lag: Hm += dt / tau_s * (H_delayed - Hm);
    4. PID: e = H_set - Hm, integral += e * dt, u = 1 + Kp * e + Ki * integral (plus a derivative term if you use Kd), clamped to [0, 1.1]; if the clamp is active, undo this step's integration (anti-windup);
    5. speed lag: r += dt / tau_m * (u - r);
    6. store H (from step 1) and the new r.
  2. 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.