Engineering
Reference frames in sensor data: relative to what?
What to record beside every reading so two runs can still be compared a year later.
Computing America Hardware. Custom hardware for physical automation and monitoring.
Send the exports
In short
- Position relative to wherever the device powered on is consistent within a run and can't be compared across runs.
- Left implicit, each of the four frames is decided by whichever component was written first, and none of the failures raises an error.
- A reference frame and calibration traceability are different requirements. A measurement needs a stated frame and a calibration chain with stated uncertainty.
- Timestamp at the sensor. A timestamp applied at the collector silently encodes queue depth as measurement error, and it stays monotonic while it does, so nothing looks wrong.
- When the defect is in somebody else's firmware, a local workaround is faster, but it becomes part of your frame and the next owner won't know it's there.
A sensor measurement means something only relative to a frame, which has four parts: spatial (an origin and axes), temporal (a clock), scale (units) and identity (which device). Record all four with every reading, because a frame that wasn't written down at capture can't be recovered later.
On an autonomous vehicle test range, the vehicle reported position and rotation continuously, relative to wherever it sat when it powered on. Every run was smooth and internally consistent, and two runs of the same maneuver had nothing in common. We expressed position and rotation against magnetic north, a shared heading reference, so the axes of every run point the same way. Magnetic north is shared but not fixed: declination changes with location and time (opens in a new tab), and hard-iron and soft-iron biases from nearby metal degrade a magnetometer's heading (opens in a new tab) until they are compensated.
Run A
Own power-on origin and axes
- To Magnetic north
Run B
Own power-on origin and axes
- To Magnetic north
Magnetic north
A shared heading reference
- To Axes agree across runs
Axes agree across runs
Once declination by place and date, and hard-iron and soft-iron bias, are corrected
Two runs with their own origins share axes only once both are turned to magnetic north and corrected for declination and magnetometer bias.
SourceComputing America case study: comparable position data for an autonomous vehicle test range.
A system without its frames looks correct on the day and fails when someone compares two of its outputs, possibly months later. For a robot or any moving platform, that comparison is the point of the data.
Four frames, and what an implicit one costs¶
Unstated, each frame is decided by whichever component was written first, and the rest of the system inherits the choice. The table gives the cost of each. None of the four failures produces an error, an alarm or a gap.
| Frame | The question it answers | What an implicit answer costs |
|---|---|---|
| Spatial | Relative to what origin, along which axes, in which handedness | Runs that can't be compared to each other, to a map, or to the physical thing they happened on. The reference existed only at capture time. |
| Temporal | Which clock, at what resolution, stamped where | Two sensors that disagree by an amount nobody can characterize, because one is stamped at the device and one on arrival. |
| Scale | Raw counts or engineering units, and where the conversion happens | A calibration constant applied twice or not at all, found when a value is off by exactly the gain. Worse, a conversion that lives only in a script, so history can't be re-derived when the constant is corrected. |
| Identity | Which physical device produced this, and does its id survive replacement | A sensor swapped under warranty, the id reused, and months of data attributed to a device that is no longer installed. |
Stamp time at the sensor¶
The common architecture stamps a reading when it reaches the collector. It's easy and needs no clock on the device. It also records when the collector got round to the reading, so queue depth is silently encoded as measurement error.
And the result stays monotonic, so nothing looks corrupted. The error grows with load: smallest when nothing is happening and largest during the events the sensing was installed to capture. Measure the microsecond relationship between two signals through a shared queue under load and you can produce a confident, repeatable, wrong answer about which came first.
Clock discipline belongs to the instrument. A clock set once at commissioning drifts, and nothing downstream can tell. Pick the sync protocol for the precision the analysis needs. NTP can usually hold time to within tens of milliseconds over the public Internet and better than one millisecond on a local network under ideal conditions (opens in a new tab), which orders events a second apart but not a microsecond relationship between two signals. For that, use IEEE 1588 Precision Time Protocol, whose accuracy can be sub-microsecond (opens in a new tab) on a local network when the devices and switches timestamp packets in hardware. That requirement lands on the hardware design, and it's cheaper to notice while the enclosure is still on the bench.
A frame is not a calibration chain¶
Metrology has the vocabulary for part of what to write down. NIST defines metrological traceability (opens in a new tab) as a property of a measurement result, not of an instrument: the result can be related to a reference through a documented unbroken chain of calibrations, each contributing to the measurement uncertainty. That is a different requirement from a reference frame. A measurement needs both a stated frame (relative to what origin, axes and clock) and a calibration chain with stated uncertainty. A recorded frame doesn't make a number traceable, and a calibrated sensor doesn't say which frame its numbers are in.
When the defect is in somebody else's firmware¶
Sensing work is work against a device somebody else built, and eventually the device is wrong. On that vehicle platform it was pulse-width modulation faults that surfaced only under real test conditions, not on a bench or in the vendor's lab.
Compensating locally is fast: you know the shape of the defect and correct for it in your own layer. But you've folded the vendor's bug into your frame, and it's documented nowhere the vendor can see. The day the vendor ships a fix, your correction is applied to data that no longer needs it and every reading is wrong in a new direction. We diagnosed the faults and contributed the fix upstream. That was slower than a local correction, and the system can now be explained by reading the two things it's made of.
The test to run before anything is built¶
Take two measurements: one from today, one from a year out, after the device has been replaced under warranty and the firmware updated twice. Can they be plotted on the same axes, and could anybody defend the plot? If not, name the missing frame. Then:
- 1.Write each frame in the record, beside the value it applies to. Someone knowing it doesn't count.
- 2.Say what physical thing the origin is attached to and what happens if it moves. An origin defined by a device's power-on state changes with every power cycle.
- 3.Put the unit conversion in the record beside the value, so a corrected constant can be applied to history.
- 4.Decide now what happens when a device is replaced, and give the new unit a new id. Reusing one can corrupt a year of trend analysis.
- 5.Record the firmware version and the id of any correction you apply beside the value, so a workaround can be found and removed when the vendor ships the fix.
Sources
Next step
Send us two runs.
Two exports of the same thing measured on different days, or one export and the schema behind it. We will tell you which of the four frames is missing and whether it can still be recovered.
- Phone
- (214) 723-2510
- Reply
- A person replies, not a sequence: within one business day, from someone who would be on the engagement.
Packages
Start with a package
Four packages, each with its price on the page. Pick one and buy it online.
$199/month
Billed monthly
$182.42/month
Billed yearly
$499/month
Billed monthly
$457.42/month
Billed yearly
- Scammers stopped from sending email as you
- Your website and systems scanned every week
- Your email settings checked every week
- Everything in the 1 to 10 plan
- Covers up to 50 people
$199/month
after a one-time setup fee
- A site planned, designed and built for you
- Hosting and updates every month
$499/month
Billed monthly
$457.42/month
Billed yearly
$999/month
Billed monthly
$915.75/month
Billed yearly
- Your Google profile, fully set up
- A Google post every week
- 2 social posts a week
- Everything in Get found
- 4 social posts a week
- Your top 10 Google searches tracked
from$500/month
after a one-time setup fee
- Your data gathered from the tools you use
- A first analysis that answers your questions
- New findings every month
Related reading
Engineering4 min readFPGA peripheral to Linux driver: bringing up the stack layer by layer
A custom controller block on programmable logic crosses five layers before software can use it. Bring them up one at a time and every failure has one suspect.
Engineering5 min readCalibration certificates and traceability: what they actually prove
Eventually someone who didn't take a reading asks where it came from. What answers them is the chain behind the sensor, which is decided before the sensor is chosen.
Delivery4 min readHardware pilot projects: scope one to buy a decision, not a demo
Scope a pilot backward from the go or no-go it must produce. A demo that works under supervision settles nothing about the rollout.
