soft4pes.control.mpc.controllers.lcl_vc_mpc_ctr#

Model predictive control (MPC) for the control of the capacitor voltage.

Classes#

LCLVcMpcCtr

Model predictive control (MPC) for the control of the capacitor voltage.

Module Contents#

class soft4pes.control.mpc.controllers.lcl_vc_mpc_ctr.LCLVcMpcCtr(solver, lambda_u, Np, I_conv_max=1.2, xi_I_conv=1000000.0, disc_method='exact_discretization')[source]#

Bases: soft4pes.control.common.controller.Controller

Model predictive control (MPC) for the control of the capacitor voltage.

Parameters:
  • solver (solver object) – Solver for an MPC algorithm.

  • lambda_u (float) – Weighting factor for the control effort.

  • Np (int) – Prediction horizon steps.

  • disc_method (str, optional) – Discretization method for the state-space model. Default is ‘exact_discretization’.

  • I_conv_max (float) – Maximum converter current [p.u.].

  • xi_I_conv (float) – Slack variable weight for the current constraint.

solver[source]#

Solver for MPC.

Type:

solver object

lambda_u[source]#

Weighting factor for the control effort.

Type:

float

Np[source]#

Prediction horizon.

Type:

int

disc_method[source]#

Discretization method for the state-space model.

Type:

str

u_km1_abc[source]#

Previous (step k-1) three-phase switch position or modulating signal.

Type:

1 x 3 ndarray of floats

state_space[source]#

The state-space model of the system.

Type:

SimpleNamespace

vg[source]#

Grid voltage [p.u.].

Type:

1 x 2 ndarray of floats

R[source]#

Weight matrix for the soft constraints.

Type:

1 x 1 ndarray of floats

c[source]#

State constraints.

Type:

1 x 1 ndarray of floats

C_constr[source]#

Output matrix for the constrained states.

Type:

2 x 6 ndarray of ints

C[source]#

System output matrix.

Type:

2 x 6 ndarray of ints

Q[source]#

Weighting matrix for the output variables.

Type:

2 x 2 ndarray of ints

execute(sys, kTs)[source]#

Perform MPC and save the controller data.

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

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

Returns:

SimpleNameSpace containing the converter three-phase switch position or modulating signal.

Return type:

SimpleNamespace

get_next_state(sys, xk, u_abc, k)[source]#

Get the next state of the system.

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

  • xk (1 x 6 ndarray of floats) – The current state of the system.

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

  • k (int) – The solver prediction step.

Returns:

The next state of the system.

Return type:

1 x 6 ndarray of floats