Proportional Control Valve Position Feedback Loop — Control Design
Shared by TSIMEREZIVO Team · 4 Oct 2026 · 51 views
# Generic Module: Proportional Control Valve Position Feedback Loop
**Version**: 1.0
**Complexity**: Medium
**Industries**: Hydraulics, Pneumatics, Chemical, Food, Oil & Gas
**Valve Type**: Proportional directional control valve (PDCV) with spool position feedback
**Sensor**: LVDT (Linear Variable Differential Transformer) or magnetostrictive transducer
---
## 📋 Overview
Position a proportional control valve spool accurately 0-100% using feedback-based regulation. Ensures valve opening matches command despite internal friction and spool nonlinearities.
**Use When:**
- ✅ Proportional valve with spool position feedback available
- ✅ Precise valve positioning ±2% required
- ✅ Valve hysteresis (deadband) problematic
- ✅ Spool stiction (static friction) compensation needed
**Do NOT Use When:**
- ❌ Simple on/off solenoid (use digital output only)
- ❌ No feedback transducer available (use open-loop valve control)
- ❌ Proportional relief valve (use Pressure Control template instead)
---
## 🎯 Control Philosophy
```
Command = 50% (open half-way)
Without feedback:
→ Coil current set to 50%
→ But internal friction may hold spool at 35%
→ Actual flow = 35% of max (not 50%)
→ Error goes unnoticed
With feedback loop:
→ Measure actual spool position (LVDT)
→ Error = 50% - 35% = +15%
→ Increase current slightly to overcome friction
→ Spool moves to 50%
→ Error becomes zero
→ Hold at that current to maintain position
Benefits:
- ✅ Repeatable performance (independent of temperature, friction)
- ✅ Load-independent (works even if pressure changes)
- ✅ No hunting (smooth convergence)
- ✅ Spool wear compensation (as friction ages, system adapts)
```
---
## 🏗️ Control Logic (Pseudocode)
```pascal
PROGRAM Proportional_Valve_Position_Control
VAR
(* ─── COMMAND INPUT ─── *)
Valve_Position_Command : REAL := 0.0; (* 0-100%, from upstream control *)
(* ─── SPOOL POSITION FEEDBACK ─── *)
Spool_Position_Raw : INT; (* 0-4095 from LVDT *)
Spool_Position_Actual : REAL; (* 0-100% *)
Spool_Center_Offset : REAL := 2048.0; (* Default center position (half of 4095) *)
Spool_Null_Deadband : REAL := 5.0; (* ±5 counts, center deadband *)
(* ─── PI FEEDBACK LOOP (Proportional + Integral) ─── *)
Kp_Spool : REAL := 0.5; (* Proportional gain *)
Ki_Spool : REAL := 0.01; (* Integral gain *)
Position_Error : REAL := 0.0;
Position_Error_Integral : REAL := 0.0;
Position_Error_Previous : REAL := 0.0;
(* ─── SPOOL CURRENT COMMAND ─── *)
Spool_Current_Command : REAL := 0.0; (* 0-10 mA or 4-20 mA equiv *)
Spool_Current_Limited : REAL := 0.0; (* Clamped to safe range *)
(* ─── VALVE PARAMETERS ─── *)
Min_Spool_Current : REAL := 0.0; (* mA, no coil action *)
Max_Spool_Current : REAL := 10.0; (* mA, full spool deflection *)
Spool_Full_Range : REAL := 100.0; (* % travel 0-100 *)
(* ─── DIAGNOSTICS & PROTECTION ─── *)
Spool_At_Center : BOOL := FALSE; (* Within null deadband *)
Spool_Deviation : REAL := 0.0; (* Current position error *)
Spool_Stiction_Detected : BOOL := FALSE; (* Friction compensation active *)
Stiction_Breakaway_Current : REAL := 0.0; (* Additional current to overcome friction *)
(* ─── FAILSAFE ─── *)
Spring_Return_To_Center : BOOL := TRUE; (* Valve springs return spool to neutral on power loss *)
END_VAR
(* ═════════════════════════════════════════════════════════════ *)
(* 1. SPOOL POSITION FEEDBACK CONVERSION *)
(* ═════════════════════════════════════════════════════════════ *)
(*
Typical LVDT transducer:
Center position (0% spool) = 2048 counts (raw ADC mid-range)
Left extreme (-100%) = 0 counts
Right extreme (+100%) = 4095 counts
With null deadband: ±5 counts = spool considered at center
*)
Spool_Position_Actual := ((Spool_Position_Raw - Spool_Center_Offset) / 2048.0) * 50.0 + 50.0;
(* Result: 0% = fully left, 50% = center, 100% = fully right *)
(* Clamp to valid range *)
Spool_Position_Actual := MAX(0.0, MIN(100.0, Spool_Position_Actual));
(* ═════════════════════════════════════════════════════════════ *)
(* 2. CENTER DEADBAND (Null Zone) *)
/* ═════════════════════════════════════════════════════════════ */
(*
Proportional valves have null zone:
±5-10% spool movement produces zero flow (friction, pressure-balanced spool)
Don't fight null zone—recognize it and reduce power below it.
*)
Spool_At_Center := (ABS(Spool_Position_Actual - 50.0) < (Spool_Null_Deadband / 2.0));
(* ═════════════════════════════════════════════════════════════ *)
(* 3. POSITION ERROR CALCULATION *)
/* ═════════════════════════════════════════════════════════════ */
Position_Error := Valve_Position_Command - Spool_Position_Actual;
Spool_Deviation := ABS(Position_Error);
(* ═════════════════════════════════════════════════════════════ *)
(* 4. PI FEEDBACK CONTROLLER (Proportional + Integral) *)
/* ═════════════════════════════════════════════════════════════ */
(*
PI loop (not PID) because:
- Proportional moves spool quickly toward target
- Integral accumulates error, overcomes friction (stiction)
- Derivative would add oscillation to spool (undesirable high-frequency)
*)
(* Proportional term: immediate response *)
Proportional_Term := Kp_Spool * Position_Error;
(* Integral term: friction compensation *)
Position_Error_Integral := Position_Error_Integral + (Position_Error * SCAN_TIME_SEC);
(* Limit integral growth (prevent windup) *)
Position_Error_Integral := MAX(-10.0, MIN(10.0, Position_Error_Integral));
Integral_Term := Ki_Spool * Position_Error_Integral;
(* Combine proportional + integral *)
Spool_Current_Command := Proportional_Term + Integral_Term;
(* ═════════════════════════════════════════════════════════════ *)
(* 5. CENTER RELIEF (Dither to Reduce Stiction) *)
/* ═════════════════════════════════════════════════════════════ */
(*
Optional: Add small dither signal (0.05 mA @ 20 Hz) to break static friction
Modern proportional valves have this built-in; older valves may need it.
*)
IF Position_Error > 2.0 AND NOT Spool_At_Center THEN
(* Stiction may be holding spool; add breakaway current *)
Stiction_Breakaway_Current := SIGN(Position_Error) * 0.2; (* 0.2 mA extra *)
Spool_Stiction_Detected := TRUE;
ELSE
Stiction_Breakaway_Current := 0.0;
Spool_Stiction_Detected := FALSE;
END_IF;
Spool_Current_Command := Spool_Current_Command + Stiction_Breakaway_Current;
(* ═════════════════════════════════════════════════════════════ *)
(* 6. CURRENT LIMITING & SAFETY *)
/* ═════════════════════════════════════════════════════════════ */
(* Clamp current to safe operating range *)
Spool_Current_Limited := MAX(Min_Spool_Current, MIN(Max_Spool_Current, Spool_Current_Command));
(* Failsafe: If command = 0, spool returns to center via springs *)
IF Valve_Position_Command = 0.0 THEN
Spool_Current_Limited := 0.0; (* De-energize coil, springs push spool neutral *)
END_IF;
(* ═════════════════════════════════════════════════════════════ *)
(* 7. OUTPUT TO PROPORTIONAL SOLENOID COIL *)
/* ═════════════════════════════════════════════════════════════ */
(* Convert current command to DAC output (0-4095 = 0-10 mA) *)
DAC_Output : INT := INT((Spool_Current_Limited / Max_Spool_Current) * 4095.0);
WRITE_ANALOG_OUTPUT(AO_PROPORTIONAL_SOLENOID, DAC_Output);
(* ═════════════════════════════════════════════════════════════ *)
(* 8. DIAGNOSTICS & FAULT DETECTION *)
/* ═════════════════════════════════════════════════════════════ */
(* Valve stuck detection *)
Valve_Stuck : BOOL := (ABS(Spool_Current_Limited) > 5.0) AND (Spool_Deviation > 20.0) FOR 10 SECONDS;
(* If coil energized >5mA but spool hasn't moved >20%, valve stuck *)
(* Position accuracy at steady-state *)
IF Spool_Deviation < 1.0 THEN
Spool_Position_Lock_Counter := Spool_Position_Lock_Counter + 1;
ELSE
Spool_Position_Lock_Counter := 0;
END_IF;
Position_Locked := (Spool_Position_Lock_Counter > 50); (* Stable for 5 seconds *)
END_PROGRAM
```
---
## 🏷️ Tag List
| Tag | Type | I/O | Range | Description |
|-----|------|-----|-------|-------------|
| `VALVE_01_CMD` | REAL | Input | 0-100 % | Spool position command |
| `VALVE_01_POS_ACTUAL` | REAL | Feedback | 0-100 % | Measured spool position (LVDT) |
| `VALVE_01_ERROR` | REAL | Status | -100…100 % | Command - Actual position error |
| `VALVE_01_COIL_CURRENT` | REAL | Output | 0-10 mA | Solenoid coil current command |
| `VALVE_01_KP_SPOOL` | REAL | Param | 0-5 | Proportional gain (position loop) |
| `VALVE_01_KI_SPOOL` | REAL | Param | 0-0.5 | Integral gain (friction compensation) |
| `VALVE_01_AT_CENTER` | BOOL | Status | - | Spool within null deadband |
| `VALVE_01_STICTION_ACTIVE` | BOOL | Status | - | Friction compensation commanded |
| `VALVE_01_STUCK` | BOOL | Alarm | - | Coil energized but spool not moving |
| `VALVE_01_LOCKED` | BOOL | Status | - | Position error <1% for >5 sec |
| `VALVE_01_NULL_DEADBAND` | REAL | Param | 0-20 % | Center deadband (null zone) |
| `VALVE_01_DEVIATION_MAX` | REAL | Metrics | 0-100 % | Peak position error since startup |
| `VALVE_01_RESPONSE_TIME_MS` | REAL | Metrics | 0-5000 | Time to reach command within 1% |
| `VALVE_01_SPRING_CENTER` | BOOL | Param | - | TRUE=spring return to neutral |
| `VALVE_01_FAILSAFE_CMD` | REAL | Safety | 0-100 % | Force to neutral on E-stop |
---
## 🚨 Alarm & Trip Matrix
| Alarm | Condition | Severity | Auto-Reset |
|-------|-----------|----------|-----------|
| **Valve Stuck** | Coil >5 mA, spool hasn't moved >20% | Critical | Manual inspection |
| **LVDT Fault** | Position constant for 60 sec despite coil changes | Critical | Check sensor wiring |
| **Solenoid Coil Fault** | Current not rising despite command | Critical | Check coil continuity |
| **Position Drift** | Error >5% persistent | Warning | Tune proportional gain |
| **Slow Response** | Takes >5 sec to reach command | Warning | Check filter size, tune gains |
| **Oscillation** | Position hunting ±3% continuously | Warning | Reduce proportional gain |
| **Center Deviation** | At-center command but position ≠ 50% | Info | Check spring balance |
---
## 📺 HMI Layout
```
┌──────────────────────────────────────────┐
│ PROPORTIONAL VALVE POSITION - V01 │
├──────────────────────────────────────────┤
│ │
│ Command: 75% ⚙️ [•━━━━━━━░ 75%] │
│ │
│ ┌──────────────────────────────────┐ │
│ │ Actual Position: 74.8% │ │
│ │ [████████████████░░░░░░ 74.8%] │ │
│ │ │ │
│ │ Error: -0.2% (LOCKED ✓) │ │
│ └──────────────────────────────────┘ │
│ │
│ Solenoid Current: 6.2 mA [████░░░░│ │
│ Status: REGULATING [●●●] │
│ Response Time: 1.2 seconds │
│ At Center Null Zone: No │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Position Loop Tuning │ │
│ │ Kp: 0.50 │ │
│ │ Ki: 0.01 (friction comp) │ │
│ │ Stiction Breakaway: 0.20 mA │ │
│ │ Null Deadband: ±5% │ │
│ │ [AutoTune] [Zero Calibrate] │ │
│ └─────────────────────────────────┘ │
│ │
│ Peak Deviation (session): 2.3% │
│ Spool Locked (stable): 34 seconds │
│ │
│ [Manual Left] [Center Stop] [Right] │
│ │
└──────────────────────────────────────────┘
```
---
## 🔧 Configuration Parameters
```json
{
"valve_type": "proportional_directional_control_valve",
"solenoid_current_min_ma": 0.0,
"solenoid_current_max_ma": 10.0,
"spool_position_feedback": "lvdt_transducer",
"lvdt_center_offset_counts": 2048,
"lvdt_null_deadband_counts": 5,
"lvdt_range_counts": 4095,
"position_sensor_accuracy_percent": 1.0,
"kp_proportional": 0.5,
"ki_integral": 0.01,
"stiction_breakaway_current_ma": 0.2,
"anti_windup_limit": 10.0,
"controller_scan_time_ms": 100,
"spring_centered": true,
"failsafe_position": "center_neutral",
"coil_power_24v_dc": true,
"dither_frequency_hz": 0,
"dither_amplitude_ma": 0.0
}
```
---
## 📝 Implementation Checklist
### Before Deployment
- [ ] **LVDT transducer calibrated** (center position verified, range 0-100% confirmed)
- [ ] **Solenoid coil tested** (resistance measured, no open circuits)
- [ ] **Proportional valve manual (datasheet)** (spool range, current range, null zone)
- [ ] **Electrical connections verified** (24V power, signal wiring shielded)
- [ ] **Spring centering confirmed** (spool returns neutral when de-energized)
- [ ] **Port P/T connections correct** (pump pressure and tank returns)
### During Commissioning
1. **LVDT zero/span calibration**:
- Move spool to full left → record raw ADC counts
- Move spool to center → record center counts
- Move spool to full right → record right counts
- Update offset and span in configuration
2. **Solenoid current test** (valve isolated, no flow):
- Command 0% → current = 0 mA, spool centered
- Command 50% → current rises (~5 mA), observe spool movement
- Command 100% → current max (~10 mA), spool fully deflected
- Reverse: 100% → 0%, verify smooth return
3. **PI loop tuning**:
- Start with Kp=0.1, Ki=0.001 (very conservative)
- Command 75%
- Observe position feedback
- If response <1 sec but stable, increase Kp gradually
- If hunting (±3% oscillation), reduce Kp by 50%
- Add Ki increment to overcome friction (stiction)
4. **Null zone characterization**:
- Command center (50%)
- Verify spool stays within ±5% deadband with <0.1 mA current
- Record actual null zone bounds for datasheet
5. **Load step test**:
- Command 50% (neutral)
- Suddenly demand load (open downstream valve)
- Spool should not move >2% due to pressure unbalance
- If moves >5%, null zone may be too wide
---
## 📊 Expected Performance
| Metric | Target | Achievable |
|--------|--------|-----------|
| **Steady-state error** | ±1% | ±0.5-1.5% |
| **Response time (10-90%)** | 1-2 sec | 0.8-2.0 sec |
| **Overshoot** | <2% | 0-1% (if tuned well) |
| **Oscillation** | Damped | <0.5% ripple |
| **Null zone** | ±5% typical | 3-7% depending on valve |
| **Repeatability** | ±2% | ±0.5-1.0% |
---
## 🔄 Advanced Variations
### Dither Compensation
Add 20 Hz, 0.1 mA dither signal to overcome stiction in older valves.
### Pressure-Compensated Spool
Measure pilot pressure (internal), feed-forward to adjust coil current
→ Eliminates pressure-induced spool drift
### Mechanical Hysteresis Handling
If spool has A-side vs B-side loading asymmetry, apply per-direction breakaway current.
---
**Production-ready proportional valve positioning for hydraulic and pneumatic systems.**