Documentation / Test / Calibration

Pair calibration

Estimate one antenna-delay correction for a specific initiator/responder pair, then hold it fixed while measuring performance across distance and orientation.

Calibration removes a constant offset; it does not prove accuracy.

Do not recalibrate at every test distance. That would force each test toward its reference value and hide scale error, multipath sensitivity, and distance-dependent bias.

Physical setup

  1. Use a surveyed or carefully measured 1 m separation between consistent antenna reference points.
  2. Mount both tags rigidly at the same height with clear line of sight.
  3. Use the same antenna orientation planned for the validation sweep.
  4. Keep people, metal objects, and large reflecting surfaces away from the direct path.
  5. Allow the stream to stabilize before collecting samples.

Procedure

python3 calibrate.py /dev/tty.usbmodem1201 \
  --true-mm 1000 \
  --samples 200

The script reads responder distance records, trims the lowest and highest 10%, computes a robust mean, converts the distance residual to DW3000 device-time units, sends CALIB <offset>, and stores the result by responder hardware ID.

Correction model

Residual
measured_mm - reference_mm. Positive means the pair reads long.
Conversion
The calibration tool converts the residual to a responder antenna-delay adjustment using the firmware's two-way-ranging timing model.
Applied value
A signed DTU offset sent to the responder with CALIB.
Scope
Specific hardware pair, firmware/PHY configuration, and antenna orientation.

Persistence

CALIB changes responder RAM and is lost on reset or power removal. The browser console stores the value locally and restores it when that responder reconnects. The host scripts store it in ~/.config/opentags/calibration.json keyed by hardware ID and reapply it on connection.

python3 info.py /dev/tty.usbmodem1201
# Confirm: mode=R, expected calib value, matching PHY

Calibration acceptance checks

CheckPass conditionFailure suggests
Sample countRequested valid samples collected without motionLink loss or unstable setup
SpreadNo abrupt multimodal clusters or large driftMultipath, movement, weak signal
RepeatabilityTwo independent runs produce similar offsetsReference or geometry is not controlled
Post-checkIndependent 1 m run has low biasWrong slot, wrong true distance, stale calibration

After calibration

Without changing the offset, collect repeated static runs at 1 m, 3 m, 5 m, and 10 m. Report mean error, median error, standard deviation, 95th-percentile absolute error, valid sample rate, and miss rate. Repeat at multiple antenna orientations and in at least one representative deployment environment.