Extended PIDs

Synthetic signals

Calculate a signal from other readings.

Synthetic signals calculate readings from other signals. Define them in the optional synthetics array of a signalset.

Each entry has a formula that uses other signal IDs. It can divide two readings or choose a reading based on an enumeration value.

Properties

The OBDb signals schema defines these properties for each entry:

PropertyTypeRequiredDescription
idstringYesUnique identifier for the synthetic signal
namestringYesHuman-readable name for the synthetic signal
pathstringYesPath for organizing the signal in a hierarchy
minnumberNoMinimum valid value for the synthetic signal
maxnumberYesMaximum valid value for the synthetic signal
unitstringYesUnit of measurement for the synthetic signal
suggestedMetricstringNoUser interface elements that can be connected to a signal
formulaobjectYesFormula used to compute this synthetic signal from other signals

The unit uses a Unit value. Formula references use signal IDs, not display names.

Ratio formula

A ratio formula divides the reading of signal a by the reading of signal b. All three formula properties are required:

PropertyTypeRequiredDescription
opstringYesMust be "ratio".
astringYesFirst signal ID used in the formula
bstringYesSecond signal ID used in the formula

This example entry calculates a fraction from two example signal IDs:

{
  "id": "EXAMPLE_CHARGE_FRACTION",
  "name": "Charge fraction",
  "path": "Battery",
  "min": 0,
  "max": 1,
  "unit": "scalar",
  "formula": {
    "op": "ratio",
    "a": "EXAMPLE_REMAINING_CHARGE",
    "b": "EXAMPLE_FULL_CHARGE"
  }
}

Both source readings must use the same unit for this fraction. The result is a fraction, not a percentage.

Pelican limits the result to min through max when max is greater than min. Missing readings or a zero denominator produce no result.

Selection formula

A selection formula chooses a reading based on another signal’s enumeration value. For example, a tire module can report which sensor belongs to each wheel.

All three formula properties are required:

PropertyTypeRequiredDescription
opstringYesMust be "select".
matchstringYesThe enumeration value (a map entry's value) that selects a key
casesobjectYesKey signal ID to the value signal ID it selects

This example formula selects the pressure reading for the slot whose position signal reports frontLeft:

{
  "op": "select",
  "match": "frontLeft",
  "cases": {
    "EXAMPLE_SLOT_1_POSITION": "EXAMPLE_SLOT_1_PRESSURE",
    "EXAMPLE_SLOT_2_POSITION": "EXAMPLE_SLOT_2_PRESSURE"
  }
}

The result is empty if no key matches, or if more than one key matches. The selected reading keeps its source unit; the synthetic’s unit doesn’t convert it.

Apps that predate select discard the whole signalset when they encounter this formula.

Keyboard shortcuts

for/
Search the Handbook.
⌘K
Search the Handbook, also while you type in a field.
Esc
Close the search or a dialog.
?
Show these shortcuts.