Grid and PCC Subsystem Simulation Model
This document specifies the equivalent simulation model for the Grid and PCC (Point of Common Coupling) subsystem. It models the grid as a voltage source with a short-circuit impedance, computes the power flow at the PCC, simulates the metering and protection blocks, and defines the interfaces to the EMS and BESS systems.
(For automated code generation, refer to 05_grid_simulation_model_ai.md.)
Terms and Abbreviations
| Term / Abbreviation | Definition |
|---|---|
| PCC | Point of Common Coupling — the physical point where the plant connects to the grid |
| CT/PT | Current Transformer / Potential Transformer — scales high-voltage sensing to meter-level inputs |
| IED | Intelligent Electronic Device — the protection relay controlling the grid breaker |
| OCV | Open Circuit Voltage (grid Thevenin source voltage, Vg) |
| Zg | Grid short-circuit impedance (Rg + jXg) |
| Vpcc | PCC voltage magnitude (kV) |
| Ig | Grid current injected at PCC (A, positive = flowing from grid to plant) |
| P_pcc | Active power at PCC (MW, positive = plant generating / exporting to grid) |
| Q_pcc | Reactive power at PCC (MVAr, positive = plant generating / exporting Q) |
| f | Grid frequency (Hz) |
| SIL | Short-circuit Impedance Level — characterises how "stiff" the grid is |
| FRT | Fault Ride-Through — plant must remain connected during brief grid voltage dips |
System Overview
The Grid and PCC subsystem sits at the boundary between the plant and the external grid. The EMS reads measurements from this subsystem and adjusts plant output to track setpoints at the PCC. The BESS and other assets are connected to the Main AC Bus which is directly linked to the PCC.
Block Diagram
flowchart TD
subgraph GRID_SYS ["Grid & PCC Subsystem"]
GridSrc["AC Grid Voltage Source\n(Thevenin: Vg, Zg = Rg + jXg)"]
GridLine["Grid Line / Feeder\n(series impedance)"]
CTPT["CT/PT Sensors\n(scales V, I to meter level)"]
PCCMeter["PCC Meter\n(computes P, Q, V, f, energy)"]
BreakerIED["PCC Breaker + Protection IED\n(overcurrent, under-voltage, FRT)"]
MainACBus["Main AC Bus / PCC\n(voltage node)"]
end
subgraph PLANT ["Plant Assets"]
PVInv["PV Inverter\n(P_pv injected)"]
WindConv["Wind Converter\n(P_wind injected)"]
PCSInv["BESS PCS\n(P_bess injected)"]
end
subgraph EMS_SYS ["EMS"]
EMSPCC["PCC Tracking Controller"]
EMSALM["Alarm Manager"]
end
GridSrc -->|"Vg (source)"| GridLine
GridLine -->|"Ig, Vg_drop"| MainACBus
MainACBus -.->|"IF-CT01: V, I analog sensing"| CTPT
CTPT -->|"IF-CT02: scaled V, I"| PCCMeter
CTPT -->|"IF-CT03: scaled V, I"| BreakerIED
PVInv -->|"I_pv"| MainACBus
WindConv -->|"I_wind"| MainACBus
PCSInv -->|"I_bess"| MainACBus
PCCMeter -->|"IF-GM01: P_pcc, Q_pcc, V_pcc, f, energy"| EMSPCC
PCCMeter -->|"IF-GM02: P_pcc, Q_pcc, V_pcc, f, energy"| EMSALM
BreakerIED -->|"IF-BR01: breaker_status, trip, alarms"| EMSALM
BreakerIED -->|"IF-BR02: trip command"| MainACBus
Interface Map (Grid ↔ EMS ↔ BESS)
This table shows all cross-system interfaces and ensures signal names are consistent across the three simulation models.
| Interface ID | From | To | Signal Name | Type | Unit | Rate |
|---|---|---|---|---|---|---|
| IF-GM01 | PCC Meter | EMS PCC Controller | P_pcc |
float | MW | 0.5–1 s |
| IF-GM01 | PCC Meter | EMS PCC Controller | Q_pcc |
float | MVAr | 0.5–1 s |
| IF-GM01 | PCC Meter | EMS PCC Controller | V_pcc |
float | kV | 0.5–1 s |
| IF-GM01 | PCC Meter | EMS PCC Controller | f |
float | Hz | 0.5–1 s |
| IF-GM02 | PCC Meter | EMS Alarm Manager | P_pcc, Q_pcc, V_pcc, f |
float | MW, MVAr, kV, Hz | 0.5–1 s |
| IF-BR01 | PCC Breaker IED | EMS Alarm Manager | breaker_status |
bool | OPEN/CLOSED | Event |
| IF-BR01 | PCC Breaker IED | EMS Alarm Manager | trip_alarm |
bool | True/False | Event |
| IF-BR02 | EMS Alarm Manager | PCC Breaker IED | breaker_open_cmd |
bool | True/False | Event |
| IF-BE01 | BESS PCS (from BESS model) | Main AC Bus | I_bess |
float | A | Per step |
| IF-BE02 | EMS Coordinator (from EMS model) | BESS PCS | P_bess_setpoint |
float | MW (+Chg/-Dis) | 0.5–2 s |
| IF-PV01 | PV Inverter | Main AC Bus | I_pv |
float | A | Per step |
| IF-WD01 | Wind Converter | Main AC Bus | I_wind |
float | A | Per step |
Sign convention (consistent across BESS, EMS, and Grid models): -
P_pcc > 0→ plant exports power to grid (generating) -P_pcc < 0→ plant imports power from grid (consuming/charging) -P_bess_setpoint > 0→ BESS is charging (consuming from AC bus) -P_bess_setpoint < 0→ BESS is discharging (injecting to AC bus)
1. AC Grid Voltage Source Model
The grid is modelled as a Thevenin equivalent: an ideal sinusoidal AC voltage source (Vg) behind a short-circuit impedance (Zg). For a simulation step size of 0.5–1 s, phasor-domain (steady-state) representation is sufficient.
1.1 Grid Thevenin Model
flowchart LR
Vg["Vg\n(Grid source voltage)"]
Zg["Zg = Rg + jXg\n(Grid impedance)"]
PCC["PCC / Main AC Bus\n(Vpcc)"]
Vg -->|"Ig flows through"| Zg --> PCC
Variables: - Vg: Grid open-circuit (Thevenin) source voltage (V RMS phase-to-phase). Default: 400 V - Ig: Current injected from the grid at PCC (A). Positive = grid supplying plant. - Vpcc: Resulting PCC voltage at the bus (V)
Parameters:
- Rg: Grid resistance (Ohms). Default: 0.01 Ohms (stiff grid)
- Xg: Grid reactance = 2 * pi * f * Lg (Ohms). Default: 0.05 Ohms
- f_nom: Nominal grid frequency (Hz). Default: 50 Hz
1.2 PCC Voltage Calculation (phasor model)
The PCC voltage results from the grid source voltage minus the drop across the grid impedance:
Vpcc = Vg - Ig * (Rg + j*Xg)
For simplified scalar simulation (ignoring phase angle):
Vpcc ≈ Vg - Ig * Rg (resistive drop only, for slow EMS time scale)
PCC current from asset injections:
I_plant = I_pv + I_wind + I_bess (sum of all plant currents at the bus)
Ig = -I_plant (grid supplies what the plant does not)
1.3 Frequency Model
Grid frequency is treated as an independent disturbance input. In a simple simulation it is held constant or given as a time-series input signal:
f[k] = f_nom + f_disturbance[k]
For FRT testing: apply a frequency step or ramp (f_disturbance) to the input and verify that the EMS Alarm Manager responds correctly.
Default values:
| Parameter | Description | Default |
|---|---|---|
Vg |
Grid source voltage (V, RMS line-to-line) | 400 V |
Rg |
Grid resistance | 0.01 Ohms |
Xg |
Grid reactance at 50 Hz | 0.05 Ohms |
f_nom |
Nominal frequency | 50 Hz |
f_disturbance |
Added frequency disturbance | 0.0 Hz |
2. CT/PT Sensor Model
The CT/PT sensors are hardware transformers that scale the high-voltage bus signals to a safe low-level range suitable for the PCC meter input. In simulation, they are modelled as ideal scaling blocks with an optional noise term for realism.
Variables: - V_bus: Actual PCC bus voltage (high-level, kV) - I_bus: Actual PCC current (high-level, A) - V_sec: Secondary voltage output to meter (low-level, V) - I_sec: Secondary current output to meter (low-level, A)
Equations:
V_sec = V_bus / PT_ratio + V_noise
I_sec = I_bus / CT_ratio + I_noise
Parameters:
| Parameter | Description | Default |
|---|---|---|
PT_ratio |
Potential transformer ratio | 100 (e.g., 40 kV → 400 V) |
CT_ratio |
Current transformer ratio | 1000 (e.g., 1000 A → 1 A) |
V_noise_std |
Gaussian voltage noise std dev | 0.001 V |
I_noise_std |
Gaussian current noise std dev | 0.001 A |
3. PCC Meter Model
The PCC meter receives the scaled secondary signals from the CT/PT and computes the power quality measurements. These are the primary feedback signals consumed by the EMS.
3.1 Computed Measurements
Active Power (MW):
P_pcc = (V_sec * I_sec * cos(phi)) * PT_ratio * CT_ratio / 1,000,000
Simplified scalar form for simulation:
P_pcc = P_pv + P_wind + P_bess
(Sum of all plant asset power injections, positive = export. This is the algebraic sum at the bus node.)
Reactive Power (MVAr):
Q_pcc = Q_pv + Q_wind + Q_bess + Q_grid
(Q from each asset; Q_grid is the reactive current drawn from or supplied to the grid.)
Voltage magnitude (kV):
V_pcc = Vpcc / 1000
Frequency (Hz):
f = f_nom + f_disturbance
3.2 Measurement Output with Data Quality
The meter applies a timestamp and quality flag to each published value:
MeterOutput = {
"P_pcc": P_pcc, # MW
"Q_pcc": Q_pcc, # MVAr
"V_pcc": V_pcc, # kV
"f": f, # Hz
"energy": energy_acc, # MWh (accumulated integral of P_pcc * dt)
"quality": "GOOD", # GOOD | SUSPECT | INVALID
"timestamp": t_current # ISO 8601 UTC
}
Energy accumulation (integrate per step):
energy[k] = energy[k-1] + (P_pcc[k] * delta_t / 3600) (converts Ws to Wh, /1e6 for MWh)
Parameters:
| Parameter | Description | Default |
|---|---|---|
meter_update_rate |
How often meter publishes values (s) | 1 s |
data_validity_window |
Age beyond which quality = SUSPECT (s) | 5 s |
4. PCC Breaker and Protection IED Model
The breaker/IED model controls the grid interconnection switch. In simulation it is a logical gate — the breaker is either CLOSED (operating) or OPEN (disconnected). The IED applies protection functions and can trip the breaker autonomously.
4.1 Breaker State Machine
stateDiagram-v2
[*] --> OPEN : Startup
OPEN --> CLOSED : close_cmd received AND enable_conditions_ok
CLOSED --> OPEN : trip_cmd from IED, or open_cmd from EMS
CLOSED --> OPEN : Protection trip condition
OPEN --> OPEN : [default hold]
4.2 IED Protection Functions
The IED monitors conditions and trips the breaker automatically on fault:
| Protection | Signal Checked | Trip Condition | Default Threshold |
|---|---|---|---|
| Overcurrent (OC) | I_bus |
abs(I_bus) > I_trip |
I_trip = 1500 A |
| Under-Voltage (UV) | V_pcc |
V_pcc < V_uv_trip for > t_uv |
V_uv = 0.80 * Vnom, t_uv = 3 s |
| Over-Voltage (OV) | V_pcc |
V_pcc > V_ov_trip for > t_ov |
V_ov = 1.10 * Vnom, t_ov = 0.5 s |
| Under-Frequency (UF) | f |
f < f_min for > t_uf |
f_min = 47.5 Hz, t_uf = 4 s |
| Over-Frequency (OF) | f |
f > f_max for > t_of |
f_max = 51.5 Hz, t_of = 0.5 s |
4.3 IED Output Signals (sent to EMS via IF-BR01)
| Signal Name | Type | Description |
|---|---|---|
breaker_status |
bool | TRUE = CLOSED, FALSE = OPEN |
trip_alarm |
bool | TRUE = IED triggered a protection trip |
trip_cause |
string | "OC", "UV", "OV", "UF", "OF", "Manual" |
ied_alarms |
list | Active protection alerts |
Parameters:
| Parameter | Description | Default |
|---|---|---|
I_trip |
Overcurrent trip threshold (A) | 1500 A |
V_uv_trip |
Under-voltage trip level (fraction of Vnom) | 0.80 |
V_ov_trip |
Over-voltage trip level (fraction of Vnom) | 1.10 |
f_min_ied |
IED under-frequency trip (Hz) | 47.5 Hz |
f_max_ied |
IED over-frequency trip (Hz) | 51.5 Hz |
trip_delay_uv |
Under-voltage hold time before trip (s) | 3.0 s |
trip_delay_ov |
Over-voltage hold time before trip (s) | 0.5 s |
5. Fault Ride-Through (FRT) Simulation
FRT tests verify the plant remains grid-connected during brief voltage dips. Implement as an input scenario applied to Vg and f_disturbance:
| Test Scenario | Vg Change |
Duration | Expected Result |
|---|---|---|---|
| Shallow dip | 80% of Vnom | 3 s | Plant stays connected, IED does not trip |
| Deep dip | 5% of Vnom | 0.5 s | Plant stays connected per EN 50549 / grid code |
| Frequency step | +/-2 Hz | 10 s | EMS adjusts output, no IED trip |
| Frequency ramp | +0.5 Hz/s rise | 5 s | EMS responds, Alarm Manager triggers |
Apply the fault by setting Vg[k] = Vg_nom * dip_factor for the duration. Observe V_pcc, P_pcc, breaker_status, and EMS mode transitions.
6. Calibratable Parameters — Summary Table
| Block | Parameter | Description | Default |
|---|---|---|---|
| Grid Source | Vg |
Grid source voltage (V, line-to-line RMS) | 400 V |
| Grid Source | Rg |
Grid Thevenin resistance | 0.01 Ω |
| Grid Source | Xg |
Grid Thevenin reactance at 50 Hz | 0.05 Ω |
| Grid Source | f_nom |
Nominal frequency | 50 Hz |
| CT/PT | PT_ratio |
Potential transformer ratio | 100 |
| CT/PT | CT_ratio |
Current transformer ratio | 1000 |
| PCC Meter | meter_update_rate |
Publish rate (s) | 1 s |
| PCC Meter | data_validity_window |
SUSPECT age threshold (s) | 5 s |
| Breaker IED | I_trip |
Overcurrent trip (A) | 1500 A |
| Breaker IED | V_uv_trip |
Under-voltage trip (fraction) | 0.80 |
| Breaker IED | V_ov_trip |
Over-voltage trip (fraction) | 1.10 |
| Breaker IED | f_min_ied |
Under-frequency trip (Hz) | 47.5 Hz |
| Breaker IED | f_max_ied |
Over-frequency trip (Hz) | 51.5 Hz |