PID Control for Flow
PID Control for Flow: Measuring and Controlling the Right Flow Variable
PID flow control is one of the most common closed-loop control functions in process automation. It is used in water treatment, chemical dosing, combustion systems, HVAC, food and beverage, pharmaceutical production, gas systems and many other industrial processes.
A simplified flow loop is:
Flow setpoint → Flow measurement → PI/PID → Control valve or pump → Actual flow
But the word flow can describe several different physical quantities.
Before tuning the controller, the engineer must determine whether the process requires:
volumetric flow,
mass flow,
actual gas volume,
standardized gas volume.
A setpoint of “100” is meaningless until the unit and physical quantity are defined. 100 L/min, 100 m³/h, 100 Nm³/h and 100 kg/h describe different process conditions.
For the basic control concept, see What Is PID?.
What Is Volumetric Flow?
Volumetric flow rate is the volume of fluid passing through a point during a given time.
Common units include:
L/min,
m³/h,
m³/s.
The basic relationship is:
Q = A × v
where:
Q is volumetric flow,
A is pipe cross-sectional area,
v is average fluid velocity.
What Is Mass Flow?
Mass flow rate describes the amount of mass passing through the system per unit time.
Typical units are:
kg/h,
kg/min,
t/h.
The basic relationship is:
ṁ = ρ × Q
where:
ṁ is mass flow,
ρ is density,
Q is volumetric flow.
If density changes, the same volumetric flow no longer represents the same mass flow.
If a recipe is defined by kilograms of material, maintaining constant m³/h does not necessarily maintain the correct dosing ratio.
Instantaneous Flow and Totalized Quantity Are Different
A flowmeter may show:
50 L/min
as the present flow rate.
The same instrument may show:
12,480 litres
on its totalizer.
The first value is a rate.
The second is accumulated quantity over time.
A normal PID loop controls the instantaneous flow rate.
A batching system may use the totalizer to close a valve after a defined quantity has been delivered.
Flow rate and accumulated volume are not the same process variable.
Liquids, Gases and Steam Require Different Flow Considerations
Liquid density may remain relatively stable in many applications.
Gas volume, however, changes strongly with pressure and temperature.
The same gas mass occupies:
a smaller volume at higher pressure,
a larger volume at lower pressure.
Therefore a gas-flow value such as:
100 m³/h
must be understood correctly.
Is it actual flow at operating conditions?
Or has it been converted to standard reference conditions?
Actual Flow Versus Standard Flow
Actual volumetric flow refers to gas volume at the real operating pressure and temperature.
Standard or normal volumetric flow converts that measured gas quantity to defined reference conditions.
The correction may use:
absolute pressure,
absolute temperature,
compressibility factor where required.
100 m³/h and 100 Nm³/h are not automatically equivalent. The transmitter, PLC and operator display must use the same gas reference conditions.
This is why pressure and temperature can be important parts of gas-flow measurement.
There Is No Single Best Flowmeter
Flowmeter selection depends on:
whether the fluid is liquid or gas,
electrical conductivity,
density,
temperature,
pressure,
solid content,
required accuracy,
pipe diameter,
installation conditions.
Different flowmeter technologies rely on different physical principles, so one instrument type should not be assumed suitable for every process.
Electromagnetic Flowmeters
An electromagnetic flowmeter, often called a magmeter, measures the electrical signal generated when a conductive liquid moves through a magnetic field.
Because pipe area is known, volumetric flow can be calculated.
Typical suitable applications include:
water,
wastewater,
conductive chemicals,
many slurry applications.
However, the liquid must have sufficient electrical conductivity.
Oil, hydrocarbons and very low-conductivity fluids are not automatically suitable for electromagnetic measurement.
Coriolis Flowmeters
A Coriolis flowmeter can measure mass flow directly.
The instrument observes changes in vibrating measuring tubes caused by moving fluid mass.
Depending on the instrument, it may also provide:
density,
temperature,
calculated volumetric flow.
This makes Coriolis measurement particularly useful in:
chemical dosing,
food production,
pharmaceutical processing,
high-accuracy batching.
Where the real process target is mass, direct mass-flow measurement can provide a cleaner control architecture than measuring volume and correcting it later.
Differential-Pressure Flow Measurement
Flow can also be measured from the differential pressure produced across a primary element such as:
an orifice plate,
a venturi,
a flow nozzle.
In many such applications:
Q ∝ √ΔP
This means differential pressure is not linearly proportional to flow.
If flow doubles, differential pressure may increase by approximately four times under simplified conditions.
Square-root extraction may therefore be performed in:
the transmitter,
the PLC,
the DCS.
Do not scale raw differential pressure directly as linear flow unless the required square-root conversion has already been applied somewhere in the measurement chain.
Why Low-Flow Cutoff Is Used
At very low flow, differential pressure becomes very small.
Measurement noise can then become large relative to the useful signal.
The displayed flow may wander near zero even when the real process is nearly stopped.
A transmitter or control system may therefore use a low-flow cutoff.
But the cutoff must not be placed above a real operating flow that the process still needs to measure.
Vortex Flowmeters
A vortex flowmeter measures the frequency of vortices generated behind a bluff body in the flow stream.
Depending on instrument and process conditions, vortex technology can be used for:
steam,
gas,
clean liquids.
It is especially common in steam applications.
Low Reynolds number, strong pulsation or disturbed flow profiles can reduce measurement quality.
Ultrasonic Flowmeters
Ultrasonic flow measurement uses acoustic signals to determine fluid velocity.
Some instruments are installed inline.
Others are attached externally as clamp-on sensors.
Clamp-on measurement can be valuable when:
the process cannot easily be stopped,
the pipe should not be cut,
a temporary measurement is required,
an existing plant needs retrofit monitoring.
Flow Profile and Straight Pipe Requirements
The velocity profile inside a pipe can be disturbed by:
elbows,
tees,
control valves,
pumps,
reducers.
Some measurement technologies are more sensitive to these disturbances than others.
The manufacturer's upstream and downstream straight-pipe requirements should therefore be followed.
Do not blindly apply one universal “10D upstream and 5D downstream” rule to every flowmeter technology.
Incorrect installation cannot be repaired by PID tuning.
Flow Control with a Control Valve
The traditional process loop is:
Flow SP → Flow transmitter → PI/PID → Control valve → Flow
If measured flow is below setpoint, the valve normally opens farther.
If flow is above setpoint, it closes.
But control quality depends on:
valve sizing,
installed valve characteristic,
positioner performance,
stiction,
available pressure drop.
Linear and Equal-Percentage Valve Characteristics
Control valves may be designed with characteristics such as:
linear,
equal-percentage.
But the valve does not operate in isolation.
Pressure drop across the valve changes as the process operating point changes.
The real installed characteristic can therefore differ significantly from the valve's intrinsic laboratory characteristic.
Equal-percentage valves are often useful when a process must operate over a wide flow range.
An Oversized Valve Can Make Flow Control Difficult
If the valve is much larger than required, normal production may occur only between very small openings such as:
5%,
8%,
12%.
A tiny valve movement can then create a large flow change.
Effective process gain becomes high and the loop becomes unnecessarily sensitive.
Flow hunting is not always caused by bad PID tuning. An oversized valve and poor valve sizing can produce the same symptom.
Valve Stiction Can Create a Limit Cycle
Mechanical friction can prevent a valve from responding to small command changes.
The controller increases output.
The valve remains stationary.
Integral action continues increasing.
Eventually the valve breaks free and jumps.
Flow overshoots.
The controller reverses direction and the sequence begins again.
Changing Kp and integral time cannot physically repair a sticking valve.
Cavitation and Flashing
As liquid passes through a restrictive control valve, local pressure may fall sharply.
If pressure drops below the liquid's vapor pressure, vapor bubbles can form.
If downstream pressure later recovers and those bubbles collapse, cavitation can occur.
If downstream pressure remains low enough for the vapor to persist, the condition is called flashing.
These phenomena can produce:
noise,
vibration,
erosion,
valve damage,
pipe damage.
A PID controller cannot demand unlimited valve pressure drop simply to reach a flow setpoint. Cavitation, flashing and hydraulic limits must be handled by proper valve and process design.
What Is Choked Flow?
Under certain conditions, reducing downstream pressure further no longer produces the expected increase in flow.
The valve and fluid have reached a physical flow limit.
The detailed mechanism differs between liquids and gases, but the control consequence is similar:
additional controller output may no longer produce meaningful additional flow.
This is a physical saturation limit, not a tuning error.
Flow Control with a VFD
In centrifugal pumping applications, flow can be controlled by changing pump speed with a VFD.
The loop becomes:
Flow SP → Flowmeter → PID → VFD speed → Pump → Flow
This is a direct application of PID control with VFDs.
Centrifugal Pump Affinity Laws
For geometrically similar operation of a centrifugal pump, the familiar approximate relationships are:
Flow Q ∝ speed n
Head H ∝ n²
Power P ∝ n³
These relationships explain why reducing speed can provide major energy savings in appropriate variable-torque pumping applications.
Reducing flow with a throttling valve and reducing pump speed with a VFD are not hydraulically or energetically equivalent.
This also connects directly with PID power control.
Positive-Displacement Pump Flow Control
Gear, piston and screw pumps behave differently from centrifugal pumps.
A positive-displacement pump moves approximately a defined volume per revolution, subject to slip and real machine characteristics.
Changing shaft speed can therefore provide a relatively direct means of changing flow.
But if the discharge path is blocked, pressure can rise rapidly.
Independent protection such as:
relief valves,
pressure trips,
mechanical protection
must remain in place.
The flow PID is not an over-pressure protection system for a positive-displacement pump.
Pressure and Flow Must Be Considered Together
Changing flow changes pressure losses throughout the pipe network.
As flow rises, the required head or differential pressure generally rises as well.
Therefore pressure control and flow control are often two different control objectives operating on the same hydraulic or pneumatic system.
Why Flow Loops Are Often Fast
Flow measurement can respond quickly.
A control valve or VFD can also change flow relatively quickly compared with slower process variables such as:
temperature,
level,
pH,
composition.
This makes the flow loop an excellent candidate for the inner loop of a cascade-control architecture.
Pressure-to-Flow Cascade
Instead of driving a control valve directly, a pressure controller can generate the setpoint for a faster flow loop:
Outer loop: Pressure PI → Flow SP
Inner loop: Flow PI/PID → Control valve
The inner loop rejects fast valve and supply-pressure disturbances.
The outer pressure loop handles the slower pressure objective.
This is a classic application of cascade control.
Level-to-Flow Cascade
A tank-level controller can also generate a flow setpoint:
Level PI → Flow SP
The inner flow loop controls actual inlet or outlet flow quickly.
The outer level controller handles the slower inventory balance.
This connects directly with PID level control.
pH-to-Flow Cascade
In chemical dosing, an outer pH controller can create a reagent flow setpoint:
pH error → Reagent flow SP
The inner flow loop then controls the dosing pump or valve.
This architecture is particularly useful in PID pH control.
What Is Ratio Control?
Many processes do not need one constant flow.
They need a controlled ratio between two flows.
Examples include:
fuel-to-air ratio,
chemical-to-product ratio,
water-to-concentrate ratio.
A basic structure is:
Flow B SP = Flow A × Ratio
The Flow B controller follows this calculated setpoint.
Ratio control does not mean tuning two unrelated PID loops and hoping they happen to maintain the correct proportion. One measured flow directly determines the setpoint of the other loop.
Feedforward in Flow-Control Applications
If a disturbance is measurable before it creates a large process error, it can be used as feedforward.
For example, when main product flow increases, additive flow demand can be increased immediately.
A downstream quality controller can then provide only a trim correction.
The architecture can be:
Main product flow → Feedforward additive SP
plus:
Quality controller → Trim
This can respond much earlier than waiting for a quality or composition error to develop.
Gas Flow Pressure and Temperature Compensation
If gas volumetric flow is being controlled, changes in pressure and temperature can change actual volume even when mass flow remains the same.
If the real process requirement is:
mass flow
or
standardized volumetric flow,
pressure and temperature compensation may be required.
A gas-flow measurement system may therefore use:
flow,
pressure,
temperature
as separate measurement inputs.
Never assume a displayed m³/h value is automatically Nm³/h.
Viscosity Can Affect Both Measurement and Control
Heavy oil, resin and viscous products can significantly change:
pressure loss,
flow profile,
pump behaviour,
meter performance.
This means viscosity can influence both the measurement and the actuator side of the flow loop.
A valve sized for water may not behave the same way when controlling a highly viscous fluid.
Two-Phase Flow and Entrained Gas
A flowmeter selected for single-phase liquid service may experience measurement problems if the line contains:
air bubbles,
foam,
a two-phase mixture.
Different meter technologies respond differently to multiphase conditions.
If flow PV becomes unstable, do not immediately change PID tuning.
First check:
whether the pipe is full,
air ingress,
cavitation,
installation orientation.
Flow Pulsation
Reciprocating pumps and compressors may produce naturally pulsating flow.
If the PID reacts to every individual pulse, the valve or drive can move unnecessarily.
Possible process measures include:
pulsation dampers,
receivers,
averaging,
careful filtering.
But excessive filtering introduces delay and can create the problems discussed in time delay and system dynamics.
Is Derivative Necessary in a Flow Loop?
Flow loops are often fast and can contain measurement components from:
turbulence,
pump ripple,
sensor noise.
Derivative is sensitive to these high-frequency changes.
For this reason, PI control is very common in industrial flow loops.
D should be added only if real process testing shows that it improves performance.
Derivative also does not predict the future. It responds to the rate of change of error or measurement.
Output Saturation and Integral Windup
A valve may already be fully open.
A pump may already be at maximum speed.
Flow may still remain below setpoint because of:
insufficient source pressure,
pump capacity,
filter blockage,
pipe restriction,
incorrect valve sizing.
If the integral term continues accumulating error, integral windup occurs.
When the restriction later disappears, the stored integral can produce a large flow overshoot.
If the controller is already at 100% output and flow is still insufficient, investigate physical process capacity first. PID tuning cannot increase pipe diameter, pump capacity or supply pressure.
For related diagnostic principles, see PID troubleshooting.
Minimum Flow Is Also a Physical Limit
A control valve may leak slightly when commanded closed.
A pump may have a minimum permitted speed.
A flowmeter may have a minimum reliable measurement range.
Therefore 0% controller output does not automatically mean zero physical flow.
The minimum controllable flow should be defined as part of process design.
Powder and Bulk-Solid Flow Is a Different Measurement Problem
Liquid and gas flowmeters should not be treated as universal instruments for powders or bulk solids.
Solid-material flow can require technologies such as:
weigh feeders,
loss-in-weight feeders,
belt scales,
specialized solids mass-flow instruments.
The control objective may still use feedback, but the measurement physics are different.
PLC Flow Control
A PLC can:
read a 4-20 mA flow transmitter,
scale the signal into engineering units,
run a PI/PID loop,
command a valve positioner,
send a speed reference to a VFD,
perform ratio control,
calculate totalized flow,
manage batch sequences.
This is one of the most common applications of PID control with PLCs.
4-20 mA Flow Scaling
A transmitter might be configured as:
4 mA = 0 m³/h
20 mA = 200 m³/h
If the PLC instead scales the same signal as 0-100 m³/h, the PID loop will operate with an incorrect process variable.
Mixing:
kg/h,
m³/h,
Nm³/h
can be an equally serious engineering error.
The signal-scaling principles are described in 0-10 V and 4-20 mA and analog signals.
What Should Be Trended in SCADA?
A useful SCADA trend can include:
Flow SP
Flow PV