Skip to main content

Range, Calibration & Spline

A raw sensor reading is almost never the number you actually want to use. ADCs return 0..65535 but your downstream module wants 0..100. A load cell reads "1 250 312" but you want grams. A pedal sensor's physical travel covers ADC values 2 800..14 600 but downstream you want 0..100. NodeBlue groups the modules that handle this signal-conditioning step.

Range — the linear remap​

The basic Range modules (Operators tutorial → Range mapping) just remap one numeric range to another, linearly:

ModuleNotes
nRange16 bits signed Integer in / out — (In Min, In Max) → (Out Min, Out Max).
nRangeDeadZoneSame, plus configurable dead zones at the low and high ends of travel — designed for pedals so the mechanical hard-stops reliably read 0 % and 100 %.
nFloatRangeThe floating-point variant — handy when you're converting to a physical unit (ADC code → volts, raw load-cell → grams).

For a pedal whose mechanical extremes you can measure once with a ruler, that's enough — type Min/Max into the dialog and you're done.

When you can't type Min/Max — nRangeModule​

For a wheel, pedal or lever you can't accurately read by hand (and which will drift over time anyway), nRangeModule learns its In Min / In Max from a calibration sweep.

ParameterDescription
In Min / In MaxInitial values (can be 0 / 0 — they get overwritten on first calibration).
Out Min / Out MaxThe output range you want to map to.
ClampWhether to clip values outside the learned input range.

The trick is its Calibration input: hold the input high (or pulse it from a button), move the source through its full physical travel, then drop the input. The module observes the actual min and max it saw during that time, stores them in EEPROM and uses them from then on.

This is the same trick the IDE's game-controller axis calibration uses behind the scenes. Wire a calibration button to the input, dedicate it to "calibrate", and the user can re-calibrate on the field whenever pedal travel changes (loose bracket, worn potentiometer …).

Calibration workflow in practice​

A typical pedal:

  1. Pedal sensor (potentiometer, AS5600, load cell, whatever) → its raw reading.
  2. → nRangeModule with its Calibration input wired to a momentary calibration button.
  3. → nRangeDeadZone (optional, for the end-of-travel deadbands).
  4. → nFloatIIRFilter (optional, for smoothing).
  5. → Whatever consumes the value: HID axis, motor command, dashboard.

To calibrate: press-and-hold the calibration button, push the pedal slowly through full travel, release the button. Min/Max are stored.

Dead zones — nRangeDeadZone​

nRangeDeadZone is end-of-travel dead-zone shaping, designed for pedals: ignore the first and last few percent of travel so the mechanical hard-stops reliably read 0 % and 100 %. Set the DZL (dead-zone low) and DZH (dead-zone high) percentages and the linear remap is "stretched" through what's left — the user still gets full output range with a clean zero plateau on each end.

Non-linear curves — nCubicSpline​

Sometimes a linear remap isn't enough — a brake pedal's force vs. position is non-linear, a throttle wants progressive sensitivity around zero, an analog gauge wants a logarithmic scale. nCubicSpline lets you draw an arbitrary curve through a set of control points and the module interpolates between them with a smooth cubic spline.

ParameterDescription
Nb PointsNumber of control points (more = finer control).
Point X, Point Y arraysThe (x, y) coordinates of each control point, in input units / output units.

The module's edit dialog typically draws the curve so you can shape it visually. The spline is C¹-continuous (no slope kinks at the points), so the output is smooth — no nasty derivative spikes through downstream filters.

A common pairing: nRangeModule (calibrate) → nCubicSpline (shape) — the Range module gets the input into a standard 0..N range, then the spline applies whatever non-linear character you want on top.

Sim-racing clutch — nClutchManager​

A specialised module for the dual-paddle racing clutch problem. Two paddles each produce a 0..100 % signal; the wheel base sees a single combined clutch value. nClutchManager combines the two paddles per the configured mode and applies a bite point, outputting a single clutch value.

ParameterDescription
ModeHow the two paddles combine — Mix, Max or Average.
Bite Point ThresholdDead-band on the analog bite-point input, to keep ADC noise from moving the bite point.

Sim-racing-specific, but the same module is the cleanest answer whenever you have two independent paddles that need to feed one output (any dual-pedal launch system, hand-actuated brake-bias controllers, etc.).

The module gets a tutorial of its own — modes, bite-point sources, SimHub integration and a worked example: Clutch & Paddle Bite Point.

Putting it together​

A real pedal chain on a sim-racing rig might look like:

HX711 (raw load cell, 24 bits, very noisy) → FloatIIRFilter (smooth) → RangeModule (learn physical extremes from a calibration sweep) → RangeDeadZone (ignore the bottom 2 % and top 5 %) → CubicSpline (progressive brake feel) → HID axis.

Every link in that chain is a NodeBlue module covered above. Compose them as you'd compose functions; the project canvas reads like a signal-flow diagram, which it is.

Now let's look at how to combine and split the signals carried through such chains: Multiplexers.