flickermeter

typhoon.test.IEC61000.flickermeter(samples, reference_voltage, reference_frequency, nominal_voltage, nominal_frequency, returns='all_parameters')

This is a digital flickermeter based on 61000-4-30 standard. Is used for evaluating flicker severity and calculating the d parameters in relation to steady state conditions. This method is applied only to grids with a nominal frequency of 50.0 Hz or 60.0 Hz.

Parameters:
  • samples (pandas.DataFrame or pandas.Series) – Voltage samples captured from simulation.

  • reference_voltage (float) – Voltage value used to determine the parameters of the weighting filter block that simulates the frequency response of the human ocular system to sinusoidal voltage fluctuations of a coiled filament gas-filled lamp. This value can be 230.0 V or 120.0 V.

  • reference_frequency (float) – Frequency value used to determine the parameters of the weighting filter block that simulates the frequency response of the human ocular system to sinusoidal voltage fluctuations of a coiled filament gas-filled lamp. This value can be 60.0 Hz or 50.0 Hz.

  • nominal_voltage (float) – Nominal voltage of the grid to be measured. This value can be 100.0 V, 120.0 V, 220.0 V or 230.0 V.

  • nominal_frequency (float) – Nominal frequency of the grid to be measured. This value can be 60.0 Hz or 50.0 Hz.

  • returns (str) –

    Describes which parameters the function should return, considering the metrics calculated on the flickmeter project (IEC 61000-4-15). This parameter accepts the following arguments:

    • "d_parameters" - Return the values (dc, d_max, t_max).

    • "Pinst" - Return the Pinst values.

    • "Pst" - Return the Pst values.

    • "Plt" - Return the Plt values.

    • "all_parameters" - Return the (Pst, Plt, dc, d_max, t_max) values.

Returns:

  • Pst (numpy.array) – Is the Short-Term Flicker Severity, measures the severity based on an observation period (10 min). This is derived from the time-at-level statistics obtained from the level classifier in block 5 of the flickermeter.

  • Plt (numpy.array) – The long-term flicker severity (Plt), shall be dethe Short-Term Severity values (Pst). The Plt value is calculated over a 2-hour period measurement. This time frame is recommended for power quality measurements according to IEC 61000-4-30, and for measurements in accordance with IECs 61000-3-3 and 61000-3-11.

  • dc (float) – The highest absolute value of all steady state voltage change observations during an observation period.

  • d_max (float) – The highest absolute voltage change observed during an observation period.

  • t_max (float) – Maximum time duration during the observation period in which the voltage deviation exceeds the dc limit.

  • Pinst (numpy.array) – The output of block 4 represents the instantaneous flicker sensation (Pinst).

Raises:
  • ValueError – When the parameters passed for the function are different from what is specified in the documentation.:

  • ValueError – When the capture time calculated from the timedelta index is smaller than 7800 seconds (2h10min) using: returns="all_parameters" or returns="Plt".

  • ValueError – When the capture time calculated from the timedelta index is smaller than 1200 seconds (20min) using: returns="Pst".

  • ValueError – When the capture time calculated from the timedelta index is smaller than 10 seconds using: returns="d_parameters".

Note

The initial 2 seconds of the analyzed signal are not considered when using returns="d_parameters".

Examples

>>> import numpy as np
>>> import scipy.signal as sig
>>> from typhoon.test.IEC61000 import flickermeter
>>>
>>> # Parameters of the signal
>>> duration = 10
>>> sample_rate = 1000
>>> rms_voltage = 230
>>> frequency = 60
>>>
>>> # Signal and modulation signal
>>> time = np.linspace(0, duration, sample_rate * duration)
>>> fundamental_voltage = rms_voltage * np.sqrt(2) * np.sin(2 * np.pi * frequency * time)
>>>
>>> frequency_modulation, amplitude_modulation = 0.500, 0.597
>>>
>>> modulation = (amplitude_modulation / 2 / 100) * sig.square(2 * np.pi * frequency_modulation * time) + 1
>>>
>>> # pandas.Series of the ``voltages_sample = fundamental_voltage * modulation`` signals
>>> time_index = pd.to_timedelta(time, "s")
>>> voltage_samples = pd.Series(fundamental_voltage * modulation, index=time_index)
>>> dc, d_max, Tmax = flickermeter(voltage_samples, rms_voltage, frequency, rms_voltage, frequency, 'd_parameters')