soft4pes.control.common.utils#
Utility functions and classes for the control module.
Classes#
General first-order filter. |
|
Generic discrete-time transfer function implementation. |
Functions#
|
Wrap the angle theta to the range [-pi, pi]. |
|
Convert a voltage reference to a modulating signal. |
|
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.
- class soft4pes.control.common.utils.DiscreteTransferFunction(numerator_coeffs, denominator_coeffs=None)[source]#
Generic discrete-time transfer function implementation.
The transfer function is defined as
- Y(z) / U(z) = (b0 + b1 z^-1 + … + bm z^-m)
(a0 + a1 z^-1 + … + an z^-n)
- Parameters:
numerator_coeffs (array-like) – Numerator coefficients of the transfer function.
denominator_coeffs (array-like, optional) – Denominator coefficients of the transfer function. If not given, [1] is used.