soft4pes.control.common.control_system#

Control system class to manage and execute a set of control loops.

Classes#

ControlSystem

ControlSystem class to manage and execute a set of control loops. The class accepts any number

Module Contents#

class soft4pes.control.common.control_system.ControlSystem(control_loops, ref_seq, Ts, pwm=None)[source]#

ControlSystem class to manage and execute a set of control loops. The class accepts any number of control loops and combines them to a complete control system.

Parameters:
  • control_loops (list) – List of controller instances. The control loops are executed in the order they appear in the list.

  • ref_seq (SimpleNamespace) – Reference sequences for the control system. The sequences must be of class Sequence. The references are given to the first control loop in the list.

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

  • pwm (modulator, optional) – Modulator for generating three-phase switch positions.

ref_seq[source]#

Reference sequences for the control system. The sequences must be of class Sequence.

Type:

SimpleNamespace

data[source]#

Data storage for the control system.

Type:

SimpleNamespace

Ts[source]#

Sampling interval [s].

Type:

float

pwm[source]#

Modulator for generating three-phase switch positions.

Type:

modulator, optional

control_loops[source]#

List of controller instances.

Type:

list

__call__(sys, kTs)[source]#

Execute the control system for a given discrete time step. The control system 1. Gets the references for the current time step. 2. Executes the control loops in the order they appear in the list. 3. Generates the three-phase switch position if modulator is used.

Parameters:
  • sys (object) – System model.

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

Returns:

u_abc – Three-phase switch position or modulating signal.

Return type:

ndarray

get_references(kTs)[source]#

Get the references for the current time step. A new SimpleNamespace object is created and the ‘_seq’ subscript is removed from the attribute names.

Parameters:

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

Returns:

ref – References for the first control loop of the control system.

Return type:

SimpleNamespace

save_data(kTs)[source]#

Save the current time step to the control system data.

Parameters:

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

get_control_system_data()[source]#

Fetch and save the data of the individual control loops. The data is saved with the name of the control loop class.