Project

General

Profile

Scaling and Maps » History » Version 2

Adam Klama, 06/21/2026 02:54 PM

1 1 Adam Klama
# Scaling & Maps
2
3
Many inputs read a **raw** value (a voltage, a frequency, a CANbus signal) that
4
must be converted into a meaningful **engineering value** (°C, bar, rpm…). There
5
are two ways to do that conversion, from simplest to most flexible.
6
7
## Two-point interpolation
8
The simplest conversion is a straight line defined by **two points**: a low point
9
and a high point. You give the raw value and the engineering value at each end,
10
and everything in between is **linearly interpolated**:
11
12
```
13
output = out_min + (raw - in_min) * (out_max - out_min) / (in_max - in_min)
14
```
15
16
- **In min → Out min** and **In max → Out max** define the line.
17
- Values between the points are interpolated; values outside can be clamped
18
  (saturated) or extrapolated, depending on the input's settings.
19
20
Two-point interpolation is built directly into **analog inputs** and **CANbus
21
inputs** via their *in/out* scaling fields. Use it whenever the sensor is
22
**linear** — for example a 0.5–4.5 V pressure sensor reading 0–10 bar.
23
24
## Multi-point scaling
25
When a sensor is **non-linear** (e.g. an NTC temperature sensor), two points are
26
not enough. Use a **[Map Input](Map_Input)**: a 1D lookup table of
27
*raw value → output value* with as many points as you need, interpolated between
28
points along the curve. Feed the raw input into the Map Input and reference the
29
Map Input's output as your scaled channel.
30
31
The matching **[Map Output](Map_Output)** applies the same kind of 1D
32
lookup on the way to an output.
33
34
### Editing a map
35
- Enter the raw value on the X axis and the engineering value as the output.
36
- Keep X values strictly increasing.
37
- Add points where the curve bends; the controller interpolates between them.
38
39
> The map's internal interpolation type is managed by the controller and is not
40
> something you normally set.