Math Bridge: IMU and Barometer Calibration

← Back to Lab: Motion and Environment
Math BridgeSensorsStruggle-friendly runway

How does a floor become counts and pressure?

One thread from a physical change to IMU codes, gyro drift, and barometric evidence.

Phoebe, the physics guidePhoebe guides
The one targetTurn two sensor scales into checks.
The chapter case16,384 counts/g and 12 Pa/m.
What it buys youReject motion and floor claims that do not clear noise.

Try this in the MPU6050 motion-offset lab, where you change the X acceleration and see the corrected reading and motion state.

1. Start with two rulers

The IMU ruler measures acceleration in counts. The barometer ruler measures a height change through pressure. Neither raw number is yet a trustworthy event.

Phoebe: Calibration tells firmware where zero is and how long each ruler mark is.

2. Map gravity to counts

N = ag × 16,384 counts/g

At the chapter's +/-2 g setting, a still upright Z axis should be near 16,384 counts. A 0.1 g motion threshold is therefore about 1,638 counts away from the 1 g reference.

3. Map height to pressure

ΔP ≈ 12 Pa/m × Δh; Δh ≈ ΔP/(12 Pa/m)

For small changes near sea level, a 3 m floor gives 36 Pa, or 0.36 hPa. Compare that result with the stated +/-0.12 hPa relative accuracy before calling a floor.

4. Keep drift separate

0.01 deg/s × 60 s = 0.6 deg/min

A constant gyro offset accumulates with time. A pressure scale check cannot repair it; the IMU needs a still reference or another long-term orientation source.

5. Decide what passes

First verify the still count and sign. Then verify the pressure step against a known height. Finally record the range, offsets, time, weather, and mounting state that make those checks repeatable.

6. Check yourself

Why is 0.1 g about 1,638 counts?
Answer: Multiply 0.1 by the configured 16,384 counts/g scale.
Why is a 3 m floor about 0.36 hPa?
Answer: 3 m × 12 Pa/m = 36 Pa, and 100 Pa = 1 hPa.
Does a 3.0 ratio prove the floor every time?
Answer: No. It compares only the ideal step with one accuracy figure; weather, airflow, filtering, and reference drift still need evidence.
Honesty boundary.

The count conversion fixes the acceleration scale, while the height comparison uses a constant near-sea-level pressure gradient and the stated relative-accuracy figure. Weather, airflow, filtering, mounting, and reference drift are not resolved by that comparison, and a pressure check does not correct gyroscope drift.

16,384 counts/g
Configured acceleration-to-count scale
0.1 g
Motion detection threshold above gravity reference
12 Pa/m
Approximate pressure change per metre of height
+/-0.12 hPa
Stated barometer relative pressure accuracy
0.01 deg/s
Example gyroscope zero-rate bias

They support a calibration runway, not a complete MPU6050 or BMP280 error model and not a guarantee of floor detection.