PowerQuality
VoltageFluctuation
Bases: object
process(start_sidx, hp_data, raw_data)
calc_harmonics(fft_data, num_periods=10, num_harmonics=100)
Calculate harmonic rms and phase for a given FFT dataset. Grouping according to IEC 61000-4-7
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fft_data
|
ndarray
|
The FFT data array. |
required |
num_periods
|
int
|
The number of fundamental periods in the origin time domain data |
10
|
num_harmonics
|
int
|
The number of harmonics to calculate. |
100
|
Returns:
Type | Description |
---|---|
Tuple[ndarray, ndarray]
|
Tuple[np.ndarray, np.ndarray]: harm_rms (np.ndarray): The RMS values of the harmonics. harm_phi (np.ndarray): The phase angles of the harmonics in degrees. |
calc_interharmonics(fft_data, num_periods=10, num_iharmonics=100)
Calculate interharmonic rms for a given FFT dataset. Grouping according to IEC 61000-4-7
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fft_data
|
ndarray
|
The FFT data array. |
required |
num_periods
|
int
|
The number of fundamental periods in the origin time domain data |
10
|
num_iharmonics
|
int
|
The number of interharmonics to calculate. |
100
|
Returns:
Name | Type | Description |
---|---|---|
iharm_rms |
ndarray
|
The RMS values of the interharmonics. |
calc_mains_signaling_voltage(u_fft_rms, msv_freq, num_periods, f_fund)
Calculate mains signaling voltage according to IEC 61000-4-30 with method of fft-neighbourhood.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_fft_rms
|
ndarray
|
magnitude (rms) fft result |
required |
msv_freq
|
float
|
frequency of expected msv |
required |
num_periods
|
int
|
number of periods used for calculation of fft |
required |
f_fund
|
float
|
fundamental frequency |
required |
Returns:
Name | Type | Description |
---|---|---|
msv_rms |
float
|
magitude of msv |
calc_over_deviation(u_rms, u_din)
Calculate Overdeviation according to IEC 61000-4-30
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_din
|
float
|
Dimensioned voltage (typ. nominal voltage) |
required |
u_rms
|
ndarray
|
Array of n-period voltage rms values |
required |
calc_thd(harm_rms, max_harmonic=40, min_harmonic=2, fund_rms=None)
Calculate the Total Harmonic Distortion (THD).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
harm_rms
|
ndarray
|
The RMS values of the harmonics. |
required |
max_harmonic
|
int
|
The maximum harmonic order to include in the THD calculation. |
40
|
min_harmonic
|
int
|
The minimum harmonic order to include in the THD calculation. |
2
|
fund_rms
|
float
|
The RMS value of the fundamental frequency. If None, the first harmonic is used. |
None
|
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
The calculated THD percentage. |
calc_unbalance(u_cplx)
Calculate voltage unbalance of a 3-phase power system according to IEC 61000-4-30 with method of symmetrical components.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_cplx
|
list
|
List of complex voltage vectors of each phase |
required |
Returns:
Type | Description |
---|---|
tuple
|
Tuple[float, float]: u0: relative zero sequence in % u2: relative negative sequence in % |
calc_under_deviation(u_rms, u_din)
Calculate Underdeviation according to IEC 61000-4-30
Parameters:
Name | Type | Description | Default |
---|---|---|---|
u_din
|
float
|
Dimensioned voltage (typ. nominal voltage) |
required |
u_rms
|
ndarray
|
Array of n-period voltage rms values |
required |
normalize_phi(phi)
Normalize phase angle to +-180°
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phi
|
float
|
Phase angle to normalize |
required |
Returns:
Type | Description |
---|---|
float
|
normalized phase angle |
resample_and_fft(data, resample_size=None)
Resample the input data to a specified size and compute its FFT.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
ndarray
|
The input data array. |
required |
resample_size
|
int
|
The size to which the data should be resampled. If None, the size is determined as the next power of 2. |
None
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The FFT of the resampled data, scaled by sqrt(2) and normalized by the resample size. |