Introduction
Build a digital protection relay implementing overcurrent, earth fault, and differential protection for a distribution substation. This comprehensive guide covers everything from design through implementation, testing, and deployment.
Build a digital protection relay implementing overcurrent, earth fault, and differential protection for a distribution substation.
Build a digital protection relay implementing overcurrent, earth fault, and differential protection for a distribution substation. This comprehensive guide covers everything from design through implementation, testing, and deployment.
Implement IDMT (Inverse Definite Minimum Time) overcurrent characteristic per IEC 60255: t = TMS × (K / ((I/Is)^α - 1)). Standard Inverse: K=0.14, α=0.02. Very Inverse: K=13.5, α=1. Extremely Inverse: K=80, α=2. Sample CT secondaries at 1600 Hz (32 samples per cycle). Calculate true RMS current each cycle. Compare against pickup setting (Is). When exceeded, start operate timer using IDMT formula. On timer expiry, issue trip command.
10 components required for this project.
| # | Component | Purpose | Qty |
|---|---|---|---|
| 1 | STM32F407 Discovery Board | High-speed relay processing at 168MHz | x1 |
| 2 | ADS1115 ADC (16-bit, 860 SPS) | High-precision CT and VT signal sampling | x4 |
| 3 | Precision Current Transformers (5A:5mA) | Measurement-class CT for relay inputs | x6 |
| 4 | Bourns Precision Voltage Divider | VT secondary voltage scaling | x6 |
| 5 | Output Relay Module (24V DC coil) | Trip and alarm output contacts | x8 |
| 6 | RS485 with IEC 61850 Gateway | Substation automation communication | x1 |
| 7 | GPS Receiver (synchronized timing) | IEEE 1588 time sync for event records | x1 |
| 8 | Ethernet Module (W5500) | IEC 61850 GOOSE messaging | x1 |
| 9 | Non-volatile FRAM (256kB) | Fast event record and disturbance recording | x1 |
| 10 | Industrial Power Supply (24V/5A DIN) | Relay auxiliary power supply | x1 |
Follow these 3 steps carefully.
Implement IDMT (Inverse Definite Minimum Time) overcurrent characteristic per IEC 60255: t = TMS × (K / ((I/Is)^α - 1)). Standard Inverse: K=0.14, α=0.02. Very Inverse: K=13.5, α=1. Extremely Inverse: K=80, α=2. Sample CT secondaries at 1600 Hz (32 samples per cycle). Calculate true RMS current each cycle. Compare against pickup setting (Is). When exceeded, start operate timer using IDMT formula. On timer expiry, issue trip command.
Compare currents entering and leaving a protected zone (transformer, busbar, motor). Under normal conditions: I_in = I_out (Kirchhoff's law). Fault inside zone: I_differential = |I_in - I_out| > threshold. Must compensate for CT ratio differences, transformer vector group (phase shift), and transformer no-load current. Use percentage-restrained differential: operate if I_diff > (k × I_restrain + I_min) to prevent false trips on through-fault with CT saturation.
Measure apparent impedance Z = V/I. When a fault occurs on the transmission line, V drops and I increases, causing Z to fall within defined impedance zones. Zone 1 covers 80% of line length (instantaneous trip). Zone 2 covers 120% of line (trip after 0.3–0.5s time delay). Zone 3 covers 220% as backup. Implement MHO characteristic (circular impedance characteristic in R-X plane) for directional selectivity — only trips for faults in the forward direction.
Core code for protection_relay.cpp:
// IDMT Overcurrent protection implementation #include <math.h> float Is = 5.0; float TMS = 0.5; float idmt_time(float I) { if(I <= Is) return 99999; return TMS * (0.14 / (pow(I/Is, 0.02) - 1.0)); } float sampleRMS(int adcChannel) { float sum = 0; int N = 32; for(int i=0; i<N; i++) { float v = (analogRead(adcChannel) - 2048) * 0.005; sum += v*v; delayMicroseconds(625); } return sqrt(sum / N); } unsigned long pickupTime = 0; bool pickedUp = false; void protectionLoop() { float I = sampleRMS(A0); if(I > Is && !pickedUp) { pickupTime = millis(); pickedUp = true; } if(I <= Is * 0.9) { pickedUp = false; } if(pickedUp) { float operate_ms = idmt_time(I) * 1000; if(millis() - pickupTime >= operate_ms) { digitalWrite(TRIP_RELAY, HIGH); logEvent("OVERCURRENT TRIP", I, millis()); } } }
Test Substation Protection Relay System by verifying each subsystem individually before full integration.
Verify power voltages, check ground connections, use serial monitor for debug.
An interactive simulator will be available here — simulate circuits and run code in-browser without hardware.