nibcq.lcr_compensation.LCRCompensationParameters

class nibcq.lcr_compensation.LCRCompensationParameters

Bases: nibcq.measurement.ConfigFileSupport

Parameters for LCR compensation generation.

This dataclass contains all configuration needed for the 7-step LCR compensation flow. The compensation data is stored on the device’s onboard memory (not in external files).

The parameters are divided into two groups:

Generate flags - control which perform_lcr_*() methods run:
  • generate_custom_cable: Custom cable compensation (Step 2)

  • generate_open: Open compensation (Step 4)

  • generate_short: Short compensation (Step 4)

  • generate_load: Load compensation (Step 5)

Enable flags - set on session for measurements after compensation:
  • enable_open: Use open compensation from onboard storage

  • enable_short: Use short compensation from onboard storage

  • enable_load: Use load compensation (requires open AND short!)

generate_custom_cable

If True, performs custom cable compensation. Requires physical open and short connections during procedure.

Type:

bool

generate_open

If True, performs open compensation. Requires physical open connection (no DUT).

Type:

bool

generate_short

If True, performs short compensation. Requires physical short connection.

Type:

bool

generate_load

If True, performs load compensation. Requires physical load connection with known reference.

Type:

bool

enable_open

Enable open compensation for verification measurement.

Type:

bool

enable_short

Enable short compensation for verification measurement.

Type:

bool

enable_load

Enable load compensation for verification measurement. Note: Requires both enable_open AND enable_short to be True!

Type:

bool

short_custom_cable_enabled

Also perform short custom cable comp (Step 2b).

Type:

bool

additional_frequencies

Extra frequencies for open/short compensation. Default frequencies are always included by the hardware.

Type:

list[float]

load_compensation_spots

Reference values for load compensation. Each spot specifies frequency and known impedance value.

Type:

list[nidcpower.LCRLoadCompensationSpot]

cable_length

Cable length setting for all compensation steps.

Type:

nidcpower.CableLength

voltage_amplitude

LCR voltage amplitude in Volts RMS (for load comp).

Type:

float

impedance_range

LCR impedance range in Ohms. 0 = auto-range.

Type:

float

dc_bias_source

DC bias source setting (OFF, VOLTAGE, or CURRENT).

Type:

nidcpower.LCRDCBiasSource

dc_bias_voltage_level

DC bias voltage if source=VOLTAGE.

Type:

float

dc_bias_current_level

DC bias current if source=CURRENT.

Type:

float

measurement_time

Measurement time setting (SHORT, MEDIUM, LONG, CUSTOM).

Type:

nidcpower.LCRMeasurementTime

custom_measurement_time

Custom time in seconds if measurement_time=CUSTOM.

Type:

float

lcr_frequency

Measurement frequency in Hz. 1000 Hz for ACIR, variable for EIS.

Type:

float

Examples

>>> # Simple open+short compensation
>>> params = LCRCompensationParameters(
...     generate_open=True,
...     generate_short=True,
...     enable_open=True,
...     enable_short=True,
... )
>>>
>>> # Full compensation with load
>>> params = LCRCompensationParameters(
...     generate_open=True,
...     generate_short=True,
...     generate_load=True,
...     enable_open=True,
...     enable_short=True,
...     enable_load=True,
...     load_compensation_spots=[
...         nidcpower.LCRLoadCompensationSpot(
...             frequency=1000.0,
...             reference_value_type=nidcpower.LCRReferenceValueType.IMPEDANCE,
...             reference_value=complex(0.01, 0.0),  # 10 mOhm known load
...         ),
...     ],
... )
classmethod from_json(json_data: Dict[str, Any]) LCRCompensationParameters

Create LCRCompensationParameters instance from JSON dictionary.

Parameters:

json_data (Dict[str, Any]) – Dictionary containing compensation configuration data.

Returns:

Instance configured from JSON data.

Return type:

LCRCompensationParameters

Raises:
classmethod from_file(file_path: str) LCRCompensationParameters

Create LCRCompensationParameters instance from JSON configuration file.

Parameters:

file_path (str) – Path to JSON configuration file.

Returns:

Instance configured from file.

Return type:

LCRCompensationParameters

Raises: