Two-Port Models
Two-port models in RAMSES connect two AC (or AC/DC) buses and inject currents at both ends simultaneously. Each model receives the voltage and current phasors at bus 1 () and bus 2 () and computes the algebraic or differential equations governing the device.
The RAMSES data keyword is TWOPOR:
TWOPOR name bus1 bus2 model_name param1 param2 ... ;HVDC Models
Section titled “HVDC Models”twop_HVDC_LCC — Line-Commutated Converter HVDC
Section titled “twop_HVDC_LCC — Line-Commutated Converter HVDC”Description
Section titled “Description”Models a point-to-point Line-Commutated Converter (LCC) HVDC link consisting of a rectifier station (bus 1) and an inverter station (bus 2). LCC-HVDC uses thyristor valves that require an external AC voltage for commutation. The rectifier controls DC current (or power), while the inverter controls DC voltage (or extinction angle). Reactive power is always consumed at both stations and must be supplied locally.
The model includes:
- Configurable rectifier control modes: constant current, constant power, minimum firing angle (), or blocked
- Configurable inverter control modes: constant voltage, constant extinction angle (), minimum , reduced current, or blocked
- Transformer tap changers on both sides (handled via
dctl_hvdc_lim) - Reactive power compensation shunts on both sides
Scientific Description
Section titled “Scientific Description”Rectifier DC voltage (bridge equation):
where is the number of rectifier bridges, is the open-circuit secondary voltage, is the transformer ratio, is the AC voltage magnitude, and is the DC current.
Rectifier overlap angle (commutation equation):
Inverter DC voltage:
Inverter overlap angle:
DC link voltage balance (series resistance ):
Reactive power consumption at the rectifier:
Active power injections (in per unit):
where is the number of poles (monopolar or bipolar).
Rectifier control equation (mode-dependent):
rec_ctl | Control mode | Constraint |
|---|---|---|
1 | Constant current | |
2 | Constant power | |
-1 | Minimum | |
3 | Blocked |
Inverter control equation (mode-dependent):
inv_ctl | Control mode | Constraint |
|---|---|---|
1 | Constant voltage | |
2 | Constant | |
-2 | Minimum | |
-1 | Reduced current | |
3 | Blocked |
The current order is obtained from the desired current through a first-order filter with time constant .
Parameters Table
Section titled “Parameters Table”| Parameter | Description | Unit |
|---|---|---|
p | Number of poles (1 = monopolar, 2 = bipolar) | — |
rec_ctl | Rectifier control mode (1=current, 2=power, −1=αmin, 3=blocked) | — |
inv_ctl | Inverter control mode (1=voltage, 2=γ, −2=γmin, −1=reduced Id, 3=blocked) | — |
Br | Number of bridges in series at rectifier | — |
Bi | Number of bridges in series at inverter | — |
Er | Rectifier open-circuit secondary voltage (at 1 pu AC) | kV |
Ei | Inverter open-circuit secondary voltage (at 1 pu AC) | kV |
Rcr | Rectifier commutating resistance per bridge | Ω |
Xcr | Rectifier commutating reactance per bridge | Ω |
Rci | Inverter commutating resistance per bridge | Ω |
Xci | Inverter commutating reactance per bridge | Ω |
RL | DC line series resistance | Ω |
Rcomp | Compounding resistance for voltage control | Ω |
Tp | Time constant for power/current order filter | s |
Idset | Initial (and setpoint) DC current | kA |
nr | Initial rectifier transformer ratio | pu/pu |
ni | Initial inverter transformer ratio | pu/pu |
Control Structure
Section titled “Control Structure”Pset or Idset ──► [Power/Current → Ides] ──► [1st-order filter Tp] ──► Iord │ rectifier firing angle α │ Vdr ────────────┘ │ ─── RL ─── Vdi │ inverter: voltage/γ controlThe rectifier minimises (advances firing) to maintain the current order. The inverter maintains DC voltage via the compounding characteristic .
Usage Example
Section titled “Usage Example”TWOPOR HVDClink BUS_RECT BUS_INV HVDC_LCC 2 ! p: bipolar 1 ! rec_ctl: current control 1 ! inv_ctl: voltage control 2 ! Br 2 ! Bi 200.0 ! Er (kV) 200.0 ! Ei (kV) 0.5 ! Rcr (ohm) 10.0 ! Xcr (ohm) 0.5 ! Rci (ohm) 10.0 ! Xci (ohm) 5.0 ! RL (ohm) 20.0 ! Rcomp (ohm) 0.01 ! Tp (s) 1.5 ! Idset (kA) 1.0 ! nr 1.0 ! ni ;twop_HVDC_VSC — Voltage Source Converter HVDC
Section titled “twop_HVDC_VSC — Voltage Source Converter HVDC”Description
Section titled “Description”Models a point-to-point VSC-HVDC link in which bus 1 is the AC-side connection and bus 2 is the DC side (DC voltage appears as ). The converter uses IGBT-based switches that are self-commutating, enabling independent control of active and reactive power on the AC side and DC voltage on the DC side.
The model implements:
- Phase reactor dynamics ()
- Phase-Locked Loop (PLL) for grid synchronisation
- Inner current control loops (- and -axis PI controllers)
- Outer loop for active power (P or ) and reactive power/AC voltage control
- Low-voltage reactive current injection (grid-code FRT support via piecewise-linear characteristic)
- DC capacitor dynamics
Scientific Description
Section titled “Scientific Description”PLL dynamics (tracks ):
Park transformation (bus-1 reference frame):
Phase reactor dynamics (in - frame):
Inner current controller (-axis, decoupling):
Outer active power / DC voltage loop (combined P-V droop):
The integrator state feeds through gain to produce , which is then limited to .
Outer reactive power / AC voltage loop:
The integrator state feeds through gain to produce .
Low-voltage reactive injection (piecewise-linear):
DC capacitor dynamics (electrostatic inertia ):
AC–DC power balance (lossless converter):
Current magnitude limit:
Parameters Table
Section titled “Parameters Table”| Parameter | Description | Unit |
|---|---|---|
R | Phase reactor resistance | pu |
L | Phase reactor inductance | pu |
Hdc | DC capacitor electrostatic inertia | s |
Snom | Nominal apparent power | MVA |
Pnom | Nominal active power (DC side rating) | MW |
Kp | Inner current controller proportional gain | — |
Ki | Inner current controller integral gain | — |
Kpd | Outer -axis loop proportional gain | — |
Kid | Outer -axis loop integral gain | — |
Kpq | Outer -axis loop proportional gain | — |
Kiq | Outer -axis loop integral gain | — |
Kpw | PLL proportional gain | — |
Kiw | PLL integral gain | — |
alpha1 | P–V outer loop: active power coefficient | — |
beta1 | P–V outer loop: DC voltage coefficient | — |
alpha2 | Q– outer loop: reactive power coefficient | — |
beta2 | Q– outer loop: AC voltage coefficient | — |
Vs1 | AC voltage threshold for reactive support activation | pu |
Vs2 | AC voltage for full reactive support | pu |
Internal (auto-initialised) parameters: Pref, Vdcref, Qref, Vacref, switch.
Control Structure
Section titled “Control Structure”Pref, Vdcref ─► [P-V droop: α1·ΔP + β1·ΔVdc] ─► [Integr. 1/Kid] ─► idref_unlim │ [Limiter Idmin/Idmax] │ idref [Inner current PI] ◄────┘ vd, ω·L·iq ──────────────────────────────────────────► vmd vq, ω·L·id ──────────────────────────────────────────► vmq
Qref, Vacref ─► [Q-Vac droop: α2·ΔQ + β2·ΔVac] ─► [Integr. 1/Kiq] ─► iqref1_unlim │FRT boost ────► iqref2 ────────────────────────────────────────────────► iqref = iqref1 + iqref2 │ [Inner current PI] ◄────┘Usage Example
Section titled “Usage Example”TWOPOR VSC1 AC_BUS DC_BUS HVDC_VSC 0.003 ! R (pu) 0.15 ! L (pu) 3.5 ! Hdc (s) 1000.0 ! Snom (MVA) 900.0 ! Pnom (MW) 1.0 ! Kp 50.0 ! Ki 0.0 ! Kpd 10.0 ! Kid 0.0 ! Kpq 20.0 ! Kiq 2.0 ! Kpw 40.0 ! Kiw 1.0 ! alpha1 0.0 ! beta1 1.0 ! alpha2 0.0 ! beta2 0.9 ! Vs1 0.5 ! Vs2 ;twop_HVDC_VSC_SC — VSC-HVDC with Self-Commutation (Grid-Forming)
Section titled “twop_HVDC_VSC_SC — VSC-HVDC with Self-Commutation (Grid-Forming)”Description
Section titled “Description”An enhanced VSC-HVDC model with self-commutation capability and synchronous machine emulation. Unlike the standard twop_HVDC_VSC, this variant includes a frequency droop loop (via Kwi, the virtual synchronous machine inertia gain) in the outer active power control, enabling the converter to participate in primary frequency regulation as if it were a synchronous machine. It is suited for modelling converters operating as grid-forming or frequency-supporting devices.
Key differences from twop_HVDC_VSC:
- Outer active power loop uses frequency droop:
- The integrator output is accumulated (not driven to zero), producing a continuous
- External power correction signal allows participation in hub-level coordination
Scientific Description
Section titled “Scientific Description”Outer active power control with frequency droop:
where introduces inertia-like damping: when grid frequency deviates from 1 pu, the converter adjusts its active current reference to oppose the deviation.
Outer reactive power control (droop on Q and AC voltage):
The inner current loop equations, PLL, phase reactor, and DC capacitor dynamics are identical to twop_HVDC_VSC.
Current limits (priority to active current):
Parameters Table
Section titled “Parameters Table”| Parameter | Description | Unit |
|---|---|---|
R | Phase reactor resistance | pu |
L | Phase reactor inductance | pu |
Hdc | DC capacitor electrostatic inertia | s |
Snom | Nominal apparent power | MVA |
Pnom | Nominal active power | MW |
Kp | Inner current controller proportional gain | — |
Ki | Inner current controller integral gain | — |
Kpp | Outer active power loop proportional gain | — |
Kip | Outer active power loop integral gain | — |
Kwi | Frequency droop / virtual inertia gain | — |
Kpq | Outer reactive power loop proportional gain | — |
Kiq | Outer reactive power loop integral gain | — |
Kpw | PLL proportional gain | — |
Kiw | PLL integral gain | — |
Vs1 | AC voltage threshold for reactive support | pu |
Vs2 | AC voltage for full reactive support | pu |
Internal (auto-initialised): DeltaP, P0, Q0, Vac, switch.
Control Structure
Section titled “Control Structure”ω1 ─────────────► Kwi·(1-ω1) ─►┐P0, ΔP ─► ΔP/Snom ──────────────┼─► N1 ─► [Int. 1/Kip] ─► N1a ─► idref_unlim │ │ │ └───────────────┘ Kpp·N1 ─────┘ [Lim] ─► idref ─► [Inner PI] ─► vmdUsage Example
Section titled “Usage Example”TWOPOR VSC_SC1 AC_BUS DC_BUS HVDC_VSC_SC 0.003 ! R (pu) 0.15 ! L (pu) 3.5 ! Hdc (s) 1000.0 ! Snom (MVA) 900.0 ! Pnom (MW) 1.0 ! Kp 50.0 ! Ki 2.0 ! Kpp (outer P loop P gain) 5.0 ! Kip (outer P loop I gain) 10.0 ! Kwi (frequency droop gain) 0.0 ! Kpq 20.0 ! Kiq 2.0 ! Kpw 40.0 ! Kiw 0.9 ! Vs1 0.5 ! Vs2 ;twop_DCL_WCL — DC Link with Wind Converter Link (Offshore Wind HVDC)
Section titled “twop_DCL_WCL — DC Link with Wind Converter Link (Offshore Wind HVDC)”Description
Section titled “Description”A comprehensive model of an offshore wind HVDC connection consisting of:
- Converter 1 (offshore, bus 1): Grid-forming VSC station connected to an offshore AC network (wind farm collector bus). It controls AC voltage and frequency at the offshore bus (island operation) and exports active power via the DC link.
- DC cable: A lumped-parameter -model with series resistance and shunt capacitances at each end (represented as DC capacitors with inertia constants and ).
- Converter 2 (onshore, bus 2): Grid-following VSC station connected to the main AC grid. It controls DC voltage (ensuring power balance) and reactive power/AC voltage support.
The model fully captures:
- PLL dynamics at both converters
- Inner - current control loops at both converters
- Offshore power/speed droop outer loop
- Onshore DC voltage control with Q/ support
- DC cable current dynamics
- Current limiters at both ends
Scientific Description
Section titled “Scientific Description”Converter 1 — Offshore (Grid-forming, active power + frequency droop)
Outer active power loop with speed droop:
Outer reactive power loop with QV droop (slope ):
Converter 2 — Onshore (Grid-following, DC voltage control)
Outer DC voltage loop:
Outer Q/ control with combined droop:
Phase reactor dynamics (both converters, in - frame):
DC link (Ohmic drop + shunt capacitors):
where is the shunt conductance computed at initialisation to balance active power at the onshore DC terminal.
AC–DC power balance (both converters, lossless):
PLL (both stations):
Current limits (both converters):
Parameters Table
Section titled “Parameters Table”| Parameter | Description | Unit |
|---|---|---|
R_1 | Phase reactor resistance | pu |
L_1 | Phase reactor inductance | pu |
Hdc_1 | DC capacitor electrostatic inertia | s |
Snom_1 | Nominal apparent power | MVA |
Kpp_1 | Outer active power loop proportional gain | — |
Kip_1 | Outer active power loop integral gain | — |
Kwi_1 | Speed/frequency droop gain | — |
Kpq_1 | Outer reactive power loop proportional gain | — |
Kiq_1 | Outer reactive power loop integral gain | — |
Kpw_1 | PLL proportional gain | — |
Kiw_1 | PLL integral gain | — |
betaV_1 | QV droop slope () | pu/pu |
| Parameter | Description | Unit |
|---|---|---|
R_2 | Phase reactor resistance | pu |
L_2 | Phase reactor inductance | pu |
Hdc_2 | DC capacitor electrostatic inertia | s |
Snom_2 | Nominal apparent power | MVA |
Kpd_2 | Outer -axis (DC voltage) loop proportional gain | — |
Kid_2 | Outer -axis (DC voltage) loop integral gain | — |
Kpq_2 | Outer -axis (Q/Vac) loop proportional gain | — |
Kiq_2 | Outer -axis (Q/Vac) loop integral gain | — |
Kpw_2 | PLL proportional gain | — |
Kiw_2 | PLL integral gain | — |
alpha2_2 | Q– droop: reactive power coefficient | — |
beta2_2 | Q– droop: AC voltage coefficient | — |
| Parameter | Description | Unit |
|---|---|---|
Pnom | Nominal active power (DC link rating) | MW |
R_dc | DC line series resistance | pu |
Vdc0 | Initial offshore DC voltage | pu |
Control Structure
Section titled “Control Structure”Wind farm ─► Bus 1 (offshore AC) │ ┌───────┴────────┐ │ Converter 1 │ PLL → id/iq transform │ Grid-forming │ │ P/ω droop │ idref ← P0+ΔP droop + Kwi·Δω │ QV droop │ iqref ← βV·ΔQ └───────┬────────┘ │ idc1, vdc1 ┌───────┴──────────────────────────┐ │ DC CABLE: Rdc, Hdc1, Hdc2 │ └───────┬──────────────────────────┘ │ idc2, vdc2 ┌───────┴────────┐ │ Converter 2 │ PLL → id/iq transform │ Grid-following│ │ Vdc control │ idref ← Kpd·ΔVdc + Kpd·∫ΔVdc │ Q/Vac droop │ iqref ← α2·ΔQ + β2·ΔVac └───────┬────────┘ │ Bus 2 (onshore AC grid)The offshore converter establishes the AC voltage and frequency for the wind farm. The onshore converter maintains DC voltage. An optional hub coordinator can inject a power correction to the offshore converter via the parameter DeltaP.
Usage Example
Section titled “Usage Example”TWOPOR WF_HVDC OFFSHORE_BUS ONSHORE_BUS DCL_WCL 0.003 ! R_1 (pu) 0.15 ! L_1 (pu) 3.5 ! Hdc_1 (s) 900.0 ! Snom_1 (MVA) 2.0 ! Kpp_1 5.0 ! Kip_1 10.0 ! Kwi_1 0.0 ! Kpq_1 20.0 ! Kiq_1 2.0 ! Kpw_1 40.0 ! Kiw_1 0.05 ! betaV_1 0.003 ! R_2 (pu) 0.15 ! L_2 (pu) 3.5 ! Hdc_2 (s) 900.0 ! Snom_2 (MVA) 0.0 ! Kpd_2 10.0 ! Kid_2 0.0 ! Kpq_2 20.0 ! Kiq_2 2.0 ! Kpw_2 40.0 ! Kiw_2 1.0 ! alpha2_2 0.0 ! beta2_2 800.0 ! Pnom (MW) 0.05 ! R_dc (pu) 1.0 ! Vdc0 (pu) ;