soft4pes.control.mpc.controllers.rl_grid_mpc_curr_ctr#

Model predictive control (MPC) for the control of the grid current (RL grid).

Classes#

RLGridMpcCurrCtr

Model predictive control (MPC) for RL grid. The controller aims to track

Module Contents#

class soft4pes.control.mpc.controllers.rl_grid_mpc_curr_ctr.RLGridMpcCurrCtr(solver, lambda_u, Np, disc_method='forward_euler')[source]#

Bases: soft4pes.control.common.controller.Controller

Model predictive control (MPC) for RL grid. The controller aims to track the grid current in the alpha-beta frame.

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 ‘forward_euler’.

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

solver[source]#

Solver for MPC.

Type:

solver object

vg[source]#

Grid voltage [p.u.].

Type:

1 x 2 ndarray of floats

C[source]#

Output matrix.

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:

Three-phase switch position or modulating signals.

Return type:

1 x 3 ndarray of floats

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 2 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 2 ndarray of floats