Strain & rosette math¶
strain_from_volts / bridge_value_from_volts turn a measured bridge voltage
into engineering units via the SDK conversions; the rosette helpers in
dtollib.utils do pure application-side rosette reduction. See the
TEDS guide for context.
Volts → strain / bridge value¶
dtollib.strain ¶
Strain / bridge volts→engineering conversion helpers — §8.B6.
The strain/bridge read path is two stages: a normal voltage acquisition
(poll / record) yields the bridge output voltage, then these
helpers turn that voltage into engineering units (strain ε, or the
bridge transducer's rated quantity) via the SDK's
olDaVoltsToStrain / olDaVoltsToBridgeBasedSensor.
The helpers read the gage/bridge parameters straight off the channel
spec, so a caller only supplies the measured unstrained/strained
voltages. The conversions are pure SDK math (no HDASS, no capability
gate) — the capability gate lives upstream at configure time
(:func:dtollib.tasks.builder._require_io_type_supported).
Pure application-side rosette transforms (rectangular / delta) live in
:mod:dtollib.utils for callers who prefer not to round-trip the SDK.
bridge_value_from_volts ¶
bridge_value_from_volts(
backend,
spec,
*,
v_unstrained,
v_strained,
v_excitation=None,
temperature_coefficient=0.0,
)
Convert a measured bridge-transducer voltage to its engineering value.
Reads the bridge parameters (nominal resistance, lead resistance,
rated sensitivity) from spec; v_excitation defaults to the
spec's configured excitation voltage.
Source code in src/dtollib/strain.py
strain_from_volts ¶
Convert a measured strain-bridge voltage to strain (ε).
Reads the gage parameters (configuration, gage factor, resistance,
lead resistance, Poisson ratio) from spec; only the two measured
voltages are supplied per reading. v_excitation defaults to the
spec's configured excitation voltage.
Source code in src/dtollib/strain.py
Rosette and thermocouple helpers¶
dtollib.utils ¶
Pure-Python helpers: NIST ITS-90 thermocouple math + rosette transforms.
These helpers do not depend on the SDK and are testable on any platform without hardware. They exist for two use cases:
- Client-side validation in :class:
~dtollib.tasks.ThermocoupleInput__post_init__— reject TC ranges outside the operating envelope before the SDK rejects them, with a precise error message. - Application-side TC linearisation (deferred-by-default).
When
OLSSC_SUP_LINEARIZE_TCisFalseon a subsystem, the wrapper applies these polynomials itself.
Coefficient source: NIST Monograph 175 (Burns et al., 1993), the ITS-90 reference functions for letter-designated thermocouples.
Status by type:
- Type K — full forward + inverse polynomial.
- Type J — full forward + inverse polynomial.
- Other types — operating range only; the forward/inverse polynomials are not implemented.
Calling an unsupported type at the polynomial layer raises
:class:~dtollib.errors.DtolValidationError naming the supported set
(J, K) and the NIST reference needed to add others.
compute_delta_rosette ¶
Compute principal strains from a 0/60/120 delta rosette.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eps_0
|
float
|
Strain reading on the 0° gauge. |
required |
eps_60
|
float
|
Strain reading on the 60° gauge. |
required |
eps_120
|
float
|
Strain reading on the 120° gauge. |
required |
Returns:
| Type | Description |
|---|---|
float
|
|
float
|
the angle of the principal axis from the 0° gauge. |
Source code in src/dtollib/utils.py
compute_rectangular_rosette ¶
Compute principal strains from a 0/45/90 rectangular rosette.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eps_0
|
float
|
Strain reading on the 0° gauge. |
required |
eps_45
|
float
|
Strain reading on the 45° gauge. |
required |
eps_90
|
float
|
Strain reading on the 90° gauge. |
required |
Returns:
| Type | Description |
|---|---|
float
|
|
float
|
the angle of the principal axis from the 0° gauge, in |
float
|
radians. |
Source code in src/dtollib/utils.py
convert_temperature_to_volts ¶
NIST ITS-90 forward polynomial: temperature → thermo-emf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tc_type
|
str
|
Single-letter TC type ( |
required |
temperature_c
|
float
|
Temperature in degrees Celsius. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Thermo-emf in volts (not millivolts — the SDK's |
float
|
|
Raises:
| Type | Description |
|---|---|
DtolValidationError
|
|
Source code in src/dtollib/utils.py
convert_volts_to_temperature ¶
NIST ITS-90 inverse polynomial + CJC: thermo-emf → temperature.
The thermocouple emf is measured relative to the cold junction; to recover the absolute hot-junction temperature we add the emf the cold junction would emit at its measured temperature, then invert the polynomial.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tc_type
|
str
|
Single-letter TC type. |
required |
volts
|
float
|
Measured thermo-emf in volts. |
required |
cjc_temperature_c
|
float
|
Cold-junction temperature in degrees
Celsius. Defaults to |
0.0
|
Returns:
| Type | Description |
|---|---|
float
|
Hot-junction temperature in degrees Celsius. |
Raises:
| Type | Description |
|---|---|
DtolValidationError
|
|
Source code in src/dtollib/utils.py
get_thermocouple_range ¶
Operating temperature range for a thermocouple type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tc_type
|
str
|
Single-letter type designation ( |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
|
Raises:
| Type | Description |
|---|---|
DtolValidationError
|
|