Appearance
Ratio Controller
Maintain ratio between wild and controlled flows with PID trim
Overview
The Ratio Controller maintains a specified ratio between a "wild" (leader) variable and a "controlled" (follower) variable. Optional PID trim provides fine adjustment to correct for deviations from the target ratio.
When to Use
- Flow ratio control: RAS/Q ratio, chemical feed to flow
- Blend control: Multiple stream mixing
- Load following: Chemical dose proportional to load
- Feed-forward: Predictive adjustment based on flow
Common Applications
| Wild Variable | Controlled Variable | Typical Ratio |
|---|---|---|
| Influent flow | RAS flow | 0.5-1.5 |
| Influent flow | Chemical dose | Variable |
| Primary effluent | Methanol dose | kg/m³ |
| MLSS | WAS flow | % of inventory |
Control Theory
Concept
mermaid
graph LR
Wild[Wild Flow] --> Ratio[Ratio Station]
SP[Ratio SP] --> Ratio
Ratio --> CV_SP[Controlled SP]
CV_SP --> Sum((+/-))
CV[Controlled PV] --> Sum
Sum --> Trim[PID Trim]
Trim --> Output[Final Output]Mathematical Model
Base calculation: $$output_{base} = ratio \times wild$$
With PID trim: $$output = output_{base} \times (1 + trim)$$
$$trim = K_p \cdot e_r + K_i \int e_r , dt + K_d \frac{de_r}{dt}$$
Where:
- $e_r = ratio_{setpoint} - ratio_{actual}$
- $ratio_{actual} = \frac{controlled}{wild}$
Parameters
| Parameter | Unit | Range | Default | Description |
|---|---|---|---|---|
| Ratio | - | 0.1-10 | 1.0 | Target ratio (controlled/wild) |
| Wild Lag | days | 0-0.1 | 0 | Delay compensation for wild |
| PID Trim Enabled | - | true/false | true | Enable feedback trim |
| Trim Kp | - | 0.1-2 | 0.5 | Trim proportional gain |
| Trim Ki | - | 0.01-0.5 | 0.1 | Trim integral gain |
| Trim Kd | - | 0-0.1 | 0 | Trim derivative gain |
| Max Trim | fraction | 0.05-0.3 | 0.1 | Maximum trim adjustment |
| Output Min | varies | - | 0 | Minimum output |
| Output Max | varies | - | 10000 | Maximum output |
Tuning Guidelines
Ratio Selection
- Steady-state requirement: Based on process stoichiometry
- Dynamic requirement: May vary with load
- Safety margin: Include buffer for upsets
PID Trim Tuning
The trim loop should be:
- Conservative: Small gains, slow response
- Secondary: Feedforward does most work
- Bounded: Max trim ±10-20%
Recommended Settings
| Application | Ratio | Kp | Ki | Max Trim |
|---|---|---|---|---|
| RAS/Q ratio | 1.0 | 0.3 | 0.05 | 0.15 |
| Chemical/Flow | 0.005 | 0.5 | 0.1 | 0.2 |
| Blend ratio | 0.5 | 0.4 | 0.08 | 0.1 |
Configuration
Example: RAS Ratio Control
json
{
"id": "ras-ratio-1",
"type": "Ratio",
"enabled": true,
"wildNodeId": "influent-1",
"wildVariable": "flow",
"controlledNodeId": "clarifier-1",
"controlledVariable": "flow",
"targetNodeId": "ras-pump-1",
"manipulatedVariable": "flow",
"ratio": 1.0,
"pidTrim": {
"enabled": true,
"kp": 0.3,
"ki": 0.05,
"kd": 0,
"maxTrim": 0.15
},
"outputMin": 0,
"outputMax": 50000,
"wildLag": 0,
"mode": "auto"
}Example: Flow-Paced Chemical Feed
json
{
"id": "chemical-ratio-1",
"type": "Ratio",
"enabled": true,
"wildNodeId": "influent-1",
"wildVariable": "flow",
"controlledNodeId": "chemical-tank-1",
"controlledVariable": "flow",
"targetNodeId": "dosing-pump-1",
"manipulatedVariable": "flow",
"ratio": 0.005,
"pidTrim": {
"enabled": true,
"kp": 0.5,
"ki": 0.1,
"kd": 0,
"maxTrim": 0.2
},
"outputMin": 0,
"outputMax": 1000,
"wildLag": 0.01,
"mode": "auto"
}Integration Example
RAS Flow Ratio Control
Scenario: Maintain RAS/Q ratio of 1.0
Influent (Wild) 10,000 m³/d
│
▼
┌──────────────────────┐
│ Ratio = 1.0 │
│ Trim = +5% │
└──────────────────────┘
│
▼
RAS Flow (Output) 10,500 m³/dCalculation:
- Base output: 10,000 × 1.0 = 10,000 m³/d
- Trim: If actual ratio is 0.95, trim adds 5%
- Final output: 10,000 × 1.05 = 10,500 m³/d
Dynamic Response
Flow (m³/d)
15000 ─────────────────────────────
┌──────────────── Wild (Influent)
10000 ────────────┘
┌───────────── Output (RAS)
┌──┘ with trim tracking
10000 ────────────┘
└─────────────────────────────
Time 0 1h 2h 3hBest Practices
Measure both flows accurately
- Wild and controlled need good meters
- Flow totalizers help verify ratio
Keep trim bounded
- Max trim ±10-20%
- Large trim indicates ratio error
Consider transport lag
- Use wild lag for distance
- Prevents overshooting
Monitor actual ratio
- Trend ratio over time
- Alert on sustained deviation
Coordinate with other controls
- RAS ratio affects clarifier
- Chemical ratio affects pH
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Ratio offset | Trim too conservative | Increase Ki |
| Oscillation | Trim too aggressive | Reduce Kp, Ki |
| Overcorrection | Max trim too high | Reduce max trim |
| Lag mismatch | Wild lag incorrect | Adjust wild lag |
| Ratio hunting | Measurement noise | Filter inputs |
Advanced Features
Wild Variable Lag
Compensate for transport delay:
json
{
"wildLag": 0.01
}Uses delayed wild value to match when flow arrives at controlled point.
Bounded Trim
Prevents runaway:
json
{
"maxTrim": 0.15
}Output limited to ±15% of base calculation.
Comparison: Ratio vs Feedforward
| Aspect | Ratio | Feedforward |
|---|---|---|
| Feedback | Yes (trim) | Optional |
| Complexity | Moderate | Higher |
| Response | Immediate | Lead-lag compensated |
| Best for | Flow ratios | Disturbance rejection |
Related Controllers
- Feedforward-Controller - Disturbance-based control
- Cascade-Controller - Nested loops
- PID-Controller - Base trim algorithm
References
- Shinskey, F.G. "Process Control Systems" (4th Edition)
- Liptak, B.G. "Instrument Engineers' Handbook: Process Control"