- Home
- Documentation
- Grid code compliance
Grid code compliance (P-Q and V-Q)
Two studies compare the reactive power a plant can deliver at the point of connection with the grid code: P-Q sweeps the active power, V-Q sweeps the grid voltage at Pmax.
Grid Code Compliance (P-Q) App menu: Grid Code Compliance (P-Q)
pandapower
This study builds a P-Q diagram at the point of connection. It sweeps plant active power, runs load flow at each step and PCC voltage, and records the Q range the plant can deliver. The results chart plots net P and Q at the PCC (including collector and transformer losses). The blue grid-code overlay is in p.u. of Pmax at the PoC. Plant Q can be set locally on each static generator / wind turbine, or dispatched through a Park Controller as constant Q at the point of connection.
Simulate → Grid Code Compliance (P-Q) (pandapower only). Requires a subscription.
Worked examples: 33 MW onshore wind farm (park controller at the 110 kV POC); offshore wind P-Q/Pmax — 450 MW grid compliance (Part 1) (video card).
Use cases:
- Verify that the plant can deliver required Q (lagging/leading) across the P range at different PCC voltages
- Compare simulated capability (red) against grid code templates (e.g. ENTSO-E PPM, VDE AR-N, Saudi Arabian Grid Code (SAGC), other national codes) on the same chart (blue)
- Document compliance using the compliance badge and exported CSV
- Study the effect of tap changers, shunt reactors, loading limits, and voltage protection on the envelope at the PoC
P and Q at the point of connection: The sweep still dispatches active power on the selected generators (as % of Pn). The results chart does not use that generator P. Red is net P and Q at the PCC from each solved load flow, so collector and transformer losses pull the top of the red envelope below installed P. Blue is the grid-code template in p.u. of that same Pmax at the PCC (including Q/Pmax ratios such as 0.33), not generator Pn. Installed P stays in the summary as the nameplate / sweep reference.
Plant Q dispatch: Choose Local Q on each static generator / wind turbine or Park Controller. The red curve is net P and Q at the point of connection in both modes. The difference is who sets reactive power on the machines. Place and configure a Park Controller on the SLD first (Machines, General, Distribution tabs) if you use park dispatch. If one is on the diagram, this study selects it automatically; click Configure… to open the same dialog.
Local Q writes a setpoint on each ticked static generator or wind turbine. The Park Controller is not used. At each plant active-power step, plant P is shared across the ticked machines in proportion to rated power. A unit ticked under Units that keep their diagram P keeps the P already set on the diagram and is left out of that share. At that unit P, available Q comes from the machine’s P–Q capability curve, or from the circular rating \(\sqrt{S_n^2-P^2}\) when the curve is off. For Q max (overexcited, capacitive) every ticked machine is set to \(+Q_\text{available}\) at the same fraction of its own limit. For Q min (underexcited, inductive) the setpoint is \(-Q_\text{available}\) at that fraction. The fraction starts at 1, so each machine is at full available Q. Identical machines therefore get the same Q. Shunt reactors, cables, and transformers are not given a Local Q setpoint. A ticked shunt keeps the Q from the diagram; its solved Q then changes with voltage. Unticked additional shunts are out of service.
Park Controller does not set those machine Q values directly. For each step it asks for one plant Q at the point of connection, equal to the sum of the machines’ available Q (positive for Q max, negative for Q min). The Park Controller (constant Q, BinarySearchControl) then moves the turbines until the load flow meets that setpoint at the PCC, as far as the machines and the network allow. Other park controllers are taken out of service so they cannot overwrite Q.
If the load flow does not converge, or a loading or voltage limit is on and is violated, both modes reduce the request until the highest value that still solves is found. The search step is the Q reduction step (% of Pn). Under Local Q that reduction is a fraction of each machine’s own Q. Under the Park Controller it is a smaller constant-Q target at the point of connection. The Q that arrives at the PCC is still the solved exchange after shunts and the network, so it is not equal to the sum of the machine setpoints.
How to run it
- Model the plant: PCC bus, external grid at the point of connection, wind turbines and/or static generators, and optionally a Park Controller linked to those machines.
- Simulate → Grid Code Compliance (P-Q) (pandapower only).
- Select PCC, external grid, plant units, and (if using park dispatch) the Park Controller (auto-filled from the park Machines list when park mode is on).
- Set Pn, sweep start / step / end (% of Pn), voltage levels, and optional grid-code P-Q template. Q limits are taken from each wind turbine / static generator Q capability tab when that curve is enabled; otherwise a circular Sn–P limit is used. You do not set a separate Q mode in this dialog.
- Optionally enable loading limit, voltage protection at LV terminals, two-winding and/or three-winding worst-case transformer taps, shunt reactor control, shunt on/off before plant Q, and Q with units not operating.
- Run the calculation. A progress overlay shows voltage levels and load flows; you can Stop between steps.
Key parameters
The input dialog groups these into Point of connection, Plant, P–Q sweep, Transformer and shunt control, Loading limit, Voltage protection, Grid code requirement, and Results.
| Parameter | Meaning |
|---|---|
| Plant Q dispatch | Local Q sets each selected static generator / wind turbine to its capability Qmax or Qmin at that P. Park Controller dispatches plant Q as constant Q at the point of connection. If a Park Controller is on the diagram, it is selected automatically when you switch to park mode. Choose “— none —” only if you do not want a park. |
| Pn | Reference active power for the sweep only (start / step / end and Q reduction step as % of Pn). 0 = sum of selected unit ratings. The results chart does not plot this P: red uses net P at the PCC, and p.u. chart units are p.u. of Pmax at the PCC. |
| Un | Rated (nameplate) voltage of the PCC bus. Leave 0 to use the bus vn_kv. This is the per-unit voltage base. |
| Uc | Declared supply voltage at the connection point (grid-code Uc). It can differ from Un. Leave 0 to use Un. Each voltage level is applied on the PCC as (p.u.) × Uc/Un. Example: Un = 110 kV, Uc = 115 kV → 1.0 pu is applied as 1.045 pu. |
| Sweep start / step / end | Active-power sweep as % of Pn. |
| Q reduction step | Resolution for the Q search, as % of Pn. After a violating load flow, plant Q is reduced until limits are OK or Q = 0, to this step size. |
| Frequency | 50 Hz or 60 Hz for the load flows in this study. |
| Operating range | Sign of plant P in the sweep (which operating points are calculated). Generation evaluates Pstart…Pend as export (P ≥ 0). Consumption uses the same percentages as import (P ≤ 0, e.g. storage charging). Generation and consumption runs both. This is not a plot-sign setting — switch generator vs load convention on the results chart after the run. |
| Q limits | Not a dialog setting. Each selected wind turbine or static generator uses its Q capability tab when the curve is enabled. Units without a curve use a circular limit from Sn and P. The Park Controller option Use machine P–Q capability curves is separate: it only governs how plant Q is shared among machines during park control, not which envelope this study starts from. |
| Units that keep their diagram P | Optional. The sweep scales plant P across the selected generators. Tick units that should not be scaled — they keep the P already set on the diagram (for example a neighbouring machine outside this plant). Leave empty to scale every selected generator. |
| Two-winding transformer tap changer | Worst-case taps on two-winding transformers that have Discrete tap control enabled: two voltage setpoints (min and max of that transformer’s band); keep the more restrictive Q envelope. Other two-winding transformers keep their diagram tap_pos. After plant Q is applied, DiscreteTapControl is run again so the controlled side stays in a deadband at the chosen edge of that transformer’s band. The deadband is never made narrower than one tap step (tap_step_percent), because a discrete tap overshoots such a band and the controlled load flow would fail to converge. If the whole configured band is narrower than one tap step, neither edge is reachable and both runs aim at the band centre instead. Results report every operating point where tap control could not keep the controlled bus inside the band you configured, with the worst voltage, whether the tap was already at an end position, and whether the band is too narrow for the tap step. |
| Three-winding transformer tap changer | Same worst-case DiscreteTapControl logic for three-winding transformers that have discrete tap control enabled (control side hv, mv, or lv). Independent of the two-winding checkbox. |
| Shunt reactor control | pandapower DiscreteShuntController (voltage / target step) or Line P→shunt step, whichever is enabled on that shunt — the same controllers as Load Flow. A reactor uses only one of the two. Independent of shunt on/off below. |
| Shunt on/off (reduce steps before plant Q) | Switch shunt compensation on/off automatically. With the loading limit, shunt compensation is reduced toward zero one step at a time before plant Q is cut. This can be used together with Shunt reactor control. |
| Loading limit / max loading | Cap Q so line and transformer loading stay within the limit. |
| Voltage protection | Cap Q when generating-unit LV terminal voltage leaves the min…max band. |
| Q with units not operating | Extra load flow with the selected units at P = Q = 0 (plant off). Results show residual P and Q at the point of connection from the rest of the network (loads, cables, shunts). This is not the P = 0 point on the red capability chart, which is plant Qmin/Qmax while the units are still providing reactive power. |
| Grid code requirement | Pick a built-in P-Q template or a custom table (see built-in templates). After the sweep, the blue overlay is scaled to Pmax at the PCC (highest net P on both Qmax and Qmin branches). Q requirements (e.g. 0.33 Q/Pmax) scale with that Pmax. A custom MW table is treated as p.u. of Pn and then scaled the same way. Compliance is assessed on this PCC-based envelope: the plant is compliant when red fully covers blue. |
| Table at 10%…100% of Pn | Adds a results table of Qmax and Qmin at 10%, 20%, … 100% of Pn along the PCC P axis (plus over-/underexcited power factor), in addition to the P–Q chart. A row is omitted when that P is above the highest net P delivered at the PCC (typical when collector/transformer losses keep PPCC below Pn). Included in the CSV download. The chart is always produced. |
Procedure
For each voltage level, plant P is taken from the sweep start / step / end (% of Pn). Operating range sets the sign: generation uses +P, consumption uses −P, and “both” evaluates both signs. That sweep P is dispatched on the selected generators. The red chart plots net P and Q at the PCC from each solved load flow. The blue grid-code envelope uses the same Pmax: the highest net P delivered at the PCC (Q/Pmax ratios from the template apply to that Pmax, not generator Pn). Then for each sweep P:
- Set Q to the plant/unit capability (Qmax, then Qmin) and run a load flow.
- If loading limits are violated and Shunt control plus Loading limit are on, reduce shunt compensation one step at a time before touching plant Q.
- Then reduce Q until the network is within limits or Q reaches 0 Mvar (resolution = Q reduction step % of Pn).
- Local Q: the same fraction of each unit’s available Q at that P is reduced on every ticked static generator / wind turbine.
- Park Controller: the constant-Q setpoint at the point of connection is reduced. The controller then shares that plant Q across the machines.
- Transformer tap control: two load flows per P (lower vs upper tap voltage setpoint) on two-winding and/or three-winding transformers that have Discrete tap control enabled (each family is optional); keep the more restrictive Q envelope. Plant Q is applied first, then taps, so the controlled bus stays in the (pinned) band at the displayed operating point. Where the tap changer cannot reach the band, the point is still reported as reactive-power capability but flagged as not voltage-regulated.
Park Controller Q applies to wind turbine and static generator elements only, not synchronous generators. OpenDSS is not supported. You can Stop a run from the progress overlay; the backend cancels between load flows.
What the results show
- Red capability — net P (Y) and net Q (X) at the selected PCC bus from each load flow, including collector and transformer losses. This is not dispatched generator P. Qmax is overexcited (solid); Qmin is underexcited (dashed). Click a red point to apply that load flow on the diagram.
- Blue requirement — the chosen grid-code envelope in p.u. of Pmax at the PCC, so the top of the blue area lines up with the top of the red area. Q/Pmax ratios from the template apply to that Pmax, not to installed / generator Pn.
- Summary — PCC bus, generator count, installed P (Pn / nameplate), Pmax at PCC, voltage levels, tap/shunt status, Q dispatch mode, load-flow count, and overall P-Q compliance.
- Chart units — MW/Mvar, or p.u. of Pmax at the PCC. Sign convention is generator (+P export) or load (+P import). Those toggles do not change which sweep points were calculated; that is Operating range on the input dialog.
- Compliance — COMPLIANT when red covers the required Q band at every P on the blue envelope (and at the measured PCC P points that fall inside that band). If a required P is above the delivered PCC P span, that point is not met.
- Q with units not operating — residual P/Q at the PCC with the selected units at P = Q = 0. This is not the red P = 0 capability (units still supplying Q there).
- Download CSV — P at PCC for the Qmax and Qmin branches, dispatched generator P, Qmax/Qmin, power factors, optional 10% Pn table, residual PQ0, and the (PCC-scaled) requirement envelope.
Built-in grid code templates
Choose Custom (manual table) to type P, Qmin, and Qmax yourself, or pick a built-in envelope. Values are stored as per-unit of a P base (Pn, or a custom MW table treated as p.u. of Pn) and then scaled to Pmax at the PCC (the highest net P from the load flows), so the blue envelope sits on the connection-point P axis with the red capability. These summaries support study and visualization only—always confirm against the official code text and your TSP or connection agreement.
- ENTSO-E RfG — PPM inner envelope (EU minimum); PPM outer envelope (maximum TSO range)
- VDE AR-N 4120 variant 2 (Germany HV, ≥110 kV); VDE AR-N 4110 (Germany MV)
- Polish IRiESP — Type D (≥110 kV); PPM / wind farms; PPM P-Q/Pmax Fig. 2 @ 400 kV (offshore Type D PPM). The 400 kV PPM template matches NC RfG Figure 2: ±0.33 Q/Pmax at Pmax, −0.35 / +0.40 Q/Pmax from 10–90% P.
- GB Grid Code (UK, National Grid ESO)
- Spanish P.O. 12.2 (REE)
- Danish Grid Code (Energinet TF 3.2.5)
- Italian Grid Code (Terna, Allegato A.68)
- Saudi Arabian Grid Code (SAGC, May 2024) — Connection Code §2.5.5.1, Fig. 2.1:
- Power Park Module: at the connection point, for active output below 20% of rated power, Q within ±0.05·Prated; for output above 20%, Q within ±0.33·Prated (unless the TSP agrees a different threshold in the connection agreement).
- Synchronous generating unit: at rated active power, capability between 85% power factor lagging and 95% leading at the unit terminals. For P below rated, the template uses a linear ramp toward (0, 0) so the chart has points to interpolate; the published text is explicit at rated output, so check with your TSP if you need a different partial-load shape.
Based on: pandapower AC power flow (runpp) executed repeatedly inside Electrisim’s Grid Code Compliance (P-Q) workflow.
Grid Code Compliance (V-Q) App menu: Grid Code Compliance (V-Q)
pandapower
This study maps U-Q/Pmax at the point of connection: plant active power is held at Pmax (default 100% of Pn) while the external grid voltage is swept. At each voltage, Electrisim searches feasible Qmax and Qmin at the PCC (red). The blue overlay is the grid-code U-Q/Pmax requirement in Q/Pmax × Pn (registered Pmax), not scaled by collector losses. Plant Q can be local on each unit or dispatched through a Park Controller as constant Q at the point of connection.
Simulate → Grid Code Compliance (V-Q) (pandapower only). Requires a subscription. Distinct from Grid Code Compliance (P-Q) and from the older combined Grid Code Compliance (P-Q & U-Q) menu item.
How to run it
- Model the plant with PCC, external grid, and wind turbines / static generators (and optionally a Park Controller).
- Simulate → Grid Code Compliance (V-Q).
- Set P at Pmax (% of Pn), plant Q dispatch (local or Park Controller), and a U-Q/Pmax template (for example ENTSO-E PPM U-Q inner). The voltage sweep uses the U (p.u.) vertices of that envelope; you do not enter a separate voltage list.
- Run the study. The results chart shows Q versus U; click red points to apply that load flow on the diagram.
Compliance: COMPLIANT when red capability fully covers the blue U-Q/Pmax envelope over the template voltage range. Un/Uc at the PCC work as in the P-Q study (applied voltage = p.u. × Uc/Un). This is a study walkthrough, not a TSO submission.
Based on: the same pandapower load-flow search as Grid Code Compliance (P-Q), with a single P setpoint and a voltage sweep.
Last updated: October 2026