soft4pes.control.lin#

Linear control algorithms for power electronic systems.

Submodules#

Classes#

GridCurrRefGen

Grid current reference generator. This class generates the grid current reference based on the

RLGridStateSpaceCurrCtr

State-space current controller with anti-windup scheme for grid-connected converter with

LCLConvCurrCtr

Current Controller for converter current with an LC(L) filter.

LCLVcCtr

Voltage Controller for the control of the capacitor voltage.

RFPSC

Reference-feedforward power synchronization control (RFPSC).

Package Contents#

class soft4pes.control.lin.GridCurrRefGen[source]#

Bases: soft4pes.control.common.Controller

Grid current reference generator. This class generates the grid current reference based on the active and reactive power references using grid voltage. The equations are in per unit. Grid voltage orientation is assumed, i.e. vg_d is aligned with d-axis of the dq-reference frame. Moreover, the positive grid current flows from the converter to the grid.

execute(sys, kTs)[source]#

Generate the current reference.

Parameters:
  • sys (object) – System model.

  • kTs (float) – Current discrete time instant [s].

Returns:

output – The output of the controller, containing the current reference in dq frame.

Return type:

SimpleNamespace

class soft4pes.control.lin.RLGridStateSpaceCurrCtr(sys, base, Ts, ig_ref_seq_dq)[source]#

State-space current controller with anti-windup scheme for grid-connected converter with RL load.

Parameters:
  • sys (system object) – System model.

  • base (base-value object) – Base values.

  • Ts (float) – Sampling interval [s].

  • ig_ref_seq_dq (Sequence object) – Current reference sequence instance in dq-frame [p.u.].

Rf#

Resistance [p.u.].

Type:

float

Xf#

Reactance [p.u.].

Type:

float

Ts#

Sampling interval [s].

Type:

float

Ts_pu#

Sampling interval [p.u.].

Type:

float

ctr_pars#

A SimpleNamespace object containing controller parameters delta, K_i, k_ii and K_ti

Type:

SimpleNamespace

uc_ii_dq#

Converter voltage reference after current controller integrator in dq frame [p.u.].

Type:

1 x 2 ndarray of floats

uc_km1_dq#

Previous converter voltage reference in dq frame [p.u.].

Type:

1 x 2 ndarray of floats

ig_ref_seq_dq#

Current reference sequence instance in dq-frame [p.u.].

Type:

Sequence object

data#

Controller data.

Type:

dict

__call__(sys, kTs)[source]#

Perform control.

Parameters:
  • sys (system object) – System model.

  • kTs (float) – Current discrete time instant [s].

Returns:

Modulating signal.

Return type:

1 x 3 ndarray of floats

get_state_space_ctr_pars()[source]#

Calculate state-space controller parameters.

Returns:

Controller parameters.

Return type:

SimpleNamespace

state_space_controller(ic_dq, ic_ref_dq, uf_dq, u_max)[source]#

State-space controller in dq frame.

Parameters:
  • ic_dq (1 x 2 ndarray of floats) – Grid Current in dq frame [p.u.].

  • ic_ref_dq (1 x 2 ndarray of floats) – Reference current in dq frame [p.u.].

  • uf_dq (1 x 2 ndarray of floats) – Grid voltage in dq frame [p.u.] (In case: Without considering the filter).

  • u_max (float) – Maximum converter output voltage [p.u.].

Returns:

Converter voltage reference in dq frame [p.u.].

Return type:

1 x 2 ndarray of floats

voltage_reference_limiter(u_max, uc_ref_dq_unlim)[source]#

limit the converter voltage reference.

Parameters:
  • u_max (float) – Maximum converter output voltage [p.u.].

  • uc_ref_dq_unlim (1 x 2 ndarray of floats) – Unlimited converter voltage reference [p.u.].

Returns:

Limited converter voltage reference [p.u.].

Return type:

1 x 2 ndarray of floats

save_data(ig_ref, u_abc, kTs)[source]#

Save controller data.

Parameters:
  • ig_ref (1 x 2 ndarray of floats) – Current reference in alpha-beta frame.

  • u_abc (1 x 3 ndarray of floats) – Converter three-phase switch position or modulating signal.

  • kTs (float) – Current discrete time instant [s].

get_control_system_data()[source]#

This is a empty method to make different controllers compatible when building the new control system structure.

class soft4pes.control.lin.LCLConvCurrCtr(sys)[source]#

Bases: soft4pes.control.common.controller.Controller

Current Controller for converter current with an LC(L) filter.

Parameters:

sys (object) – System model containing electrical parameters and base values.

u_ii_comp#

Integrator state for the converter voltage reference in the dq-frame.

Type:

complex

v_conv_kp1_comp#

Next converter voltage reference in the dq-frame.

Type:

complex

u_km1_abc#

Previous converter voltage reference in the abc-frame.

Type:

ndarray (3,)

sys#

System model containing electrical parameters and base values.

Type:

object

ctr_pars#

Controller parameters including delta, K_i, k_ii, and K_ti.

Type:

SimpleNamespace

set_sampling_interval(Ts)[source]#

Set the sampling interval and compute controller parameters.

Parameters:

Ts (float) – Sampling interval [s].

execute(sys, kTs)[source]#

Execute the Current Controller (CC) and save the controller data.

Parameters:
  • sys (object) – System model.

  • kTs (float) – Current discrete time instant [s].

Returns:

Three-phase modulating signal.

Return type:

1 x 3 ndarray of floats

class soft4pes.control.lin.LCLVcCtr(sys, curr_ctr, I_conv_max=1.2)[source]#

Bases: soft4pes.control.common.controller.Controller

Voltage Controller for the control of the capacitor voltage.

Parameters:
  • sys (object) – The system model containing electrical parameters and base values.

  • curr_ctr (object) – The current controller containing its controller parameters and attributes.

  • I_conv_max (float (optional)) – The maximum converter current in per unit (p.u.).

u_iu_comp#

Integrator state for the converter voltage reference in the dq-frame.

Type:

complex

sys#

System model containing electrical parameters and base values.

Type:

object

I_conv_max#

The maximum converter current in per unit (p.u.).

Type:

float

ctr_pars#

Controller parameters including delta, K_u, k_iu, and K_tu.

Type:

SimpleNamespace

curr_ctr#

The current controller containing its controller parameters and attributes.

Type:

object

set_sampling_interval(Ts)[source]#

Set the sampling interval and compute controller parameters.

[Ref.]. H.-S. Kim, H.-S. Jung, and S.-K. Sul, “Discrete-time voltage controller for voltage source converters with LC filter based on state-space models,” IEEE Trans. Ind. Appl., vol. 55, no. 1, pp. 529-540, Jan./Feb. 2019.

Parameters:

Ts (float) – Sampling interval [s].

execute(sys, kTs)[source]#

Execute the Voltage Controller (VC) and save the controller data.

Parameters:
  • sys (object) – System model.

  • kTs (float) – Current discrete time instant [s].

Returns:

The converter current reference in dq-frame for Current Controller (CC).

Return type:

1 x 2 ndarray of floats

class soft4pes.control.lin.RFPSC(sys, Ra=0.2, Kp=None, w_bw=0.1)[source]#

Bases: soft4pes.control.common.controller.Controller

Reference-feedforward power synchronization control (RFPSC).

Parameters:
  • sys (system object) – System model.

  • Ra (float, optional) – Virtual damping resistance [p.u.].

  • Kp (float, optional) – Proportional gain of the active power droop control [p.u.]. If not provided, it is calculated based on the nominal frequency, nominal grid peak voltage and the virtual damping resistance.

  • w_bw (float, optional) – Current filter bandwidth [p.u.].

Ra#

Virtual damping resistance [p.u.].

Type:

float

theta_c#

The angle of the synchronous reference frame set by the droop control. The initial angle is set to -pi/2 to align the q-axis with the grid voltage.

Type:

float

ig_filter#

First-order filter for the current.

Type:

FirstOrderFilter

Kp#

Proportional gain of the active power droop control [p.u.]. Recommended selection is Kp = wg * Ra / Vg, where wg is the nominal grid angular frequency, Ra is the virtual damping resistance (default 0.2 p.u.) and Vg is the nominal grid peak voltage. If value is not provided, nominal grid angular frequency and nominal grid peak voltage are assumed to be 1 p.u. For more details on the tuning and default values, see the reference above.

Type:

float

execute(sys, kTs)[source]#

Execute the RFPSC control algorithm.

Parameters:
  • sys (system object) – The system model.

  • kTs (float) – Current discrete time instant [s].

Returns:

A SimpleNamespace object containing the modulating signal for the converter (u_abc) and a capacitor voltage reference in case LC(L) filter is used (vc_ref).

Return type:

SimpleNamespace