soft4pes.control.common.utils#

Utility functions and classes for the control module.

Classes#

FirstOrderFilter

General first-order filter.

Functions#

wrap_theta(theta)

Wrap the angle theta to the range [-pi, pi].

get_modulating_signal(v_ref, v_dc)

Convert a voltage reference to a modulating signal.

magnitude_limiter(input_signal, limit)

Limit the input in to maximum magnitude. The input can be in alpha-beta or dq-frame, and given

Module Contents#

soft4pes.control.common.utils.wrap_theta(theta)[source]#

Wrap the angle theta to the range [-pi, pi].

Parameters:

theta (float) – The angle in radians.

Returns:

The wrapped angle in radians.

Return type:

float

soft4pes.control.common.utils.get_modulating_signal(v_ref, v_dc)[source]#

Convert a voltage reference to a modulating signal.

Parameters:
  • v_ref (ndarray) – The reference voltage in alpha-beta frame.

  • v_dc (float) – The dc-link voltage.

Returns:

The modulating signal in abc-frame.

Return type:

ndarray

soft4pes.control.common.utils.magnitude_limiter(input_signal, limit)[source]#

Limit the input in to maximum magnitude. The input can be in alpha-beta or dq-frame, and given as a vector or complex number.

Parameters:
  • limit (float) – Maximum magnitude [p.u.].

  • input_signal (1 x 2 ndarray of floats or complex) – Unlimited input [p.u.].

Returns:

Limited output [p.u.].

Return type:

1 x 2 ndarray of floats

class soft4pes.control.common.utils.FirstOrderFilter(w_bw, size)[source]#

General first-order filter.

Parameters:
  • w_bw (float) – The bandwidth of the filter [p.u.].

  • size (int) – The size of the signal to be filtered, i.e. the length of the input vector.

w_bw[source]#

The bandwidth of the filter [p.u.].

Type:

float

output[source]#

The filtered signal.

Type:

ndarray

update(value_in, Ts, base)[source]#

Update the filter with a new input signal of the defined size.

Parameters:
  • value_in (ndarray) – The input signal to be filtered.

  • Ts (float) – The sampling interval [s].

  • base (object) – The base values object containing the base angular frequency.