Project

General

Profile

Actions

Scaling and Maps » History » Revision 1

Revision 1/2 | Next »
Adam Klama, 06/21/2026 02:54 PM


Scaling & Maps

Many inputs read a raw value (a voltage, a frequency, a CANbus signal) that
must be converted into a meaningful engineering value (°C, bar, rpm…). There
are two ways to do that conversion, from simplest to most flexible.

Schema: the in/out scaling fields of config/AdcConfiguration.proto and
config/CanbusInputConfiguration.proto; the 1D map in
config/MapInputConfigData.proto / config/MapOutputConfigData.proto.

Two-point interpolation

The simplest conversion is a straight line defined by two points: a low point
and a high point. You give the raw value and the engineering value at each end,
and everything in between is linearly interpolated:

output = out_min + (raw - in_min) * (out_max - out_min) / (in_max - in_min)
  • In min → Out min and In max → Out max define the line.
  • Values between the points are interpolated; values outside can be clamped
    (saturated) or extrapolated, depending on the input's settings.

Two-point interpolation is built directly into analog inputs and CANbus
inputs
via their in/out scaling fields. Use it whenever the sensor is
linear — for example a 0.5–4.5 V pressure sensor reading 0–10 bar.

Multi-point scaling

When a sensor is non-linear (e.g. an NTC temperature sensor), two points are
not enough. Use a Map Input: a 1D lookup table of
raw value → output value with as many points as you need, interpolated between
points along the curve. Feed the raw input into the Map Input and reference the
Map Input's output as your scaled channel.

The matching Map Output applies the same kind of 1D
lookup on the way to an output.

Editing a map

  • Enter the raw value on the X axis and the engineering value as the output.
  • Keep X values strictly increasing.
  • Add points where the curve bends; the controller interpolates between them.

The map's internal interpolation type is managed by the controller and is not
something you normally set.

Updated by Adam Klama 1 day ago · 2 revisions