fieldform
CALIBRATION WORKSPACE / OFFLINE
Sensor tools / 01

Magnetometer calibration

CSV format: use columns x,y,z, mx,my,mz, or raw_x,raw_y,raw_z. Put one comma-separated reading per row, with numeric values in the same unit. Then upload your file below.

3-AXIS XYZ · CALIBRATION
Samples
—
points loaded
Hard-iron X
— counts
estimated offset
Hard-iron Y
— counts
estimated offset
Hard-iron Z
— counts
estimated offset

Magnetic field · axis projections

RAWCALIBRATED

X / Y PLANE

X / Z PLANE

Y / Z PLANE

Waiting for data · upload a CSV or load the sampleORTHOGRAPHIC PROJECTIONS

Calibration equation

STEP 02 · COPY TO FIRMWARE

Subtract the hard-iron bias, then apply the soft-iron matrix to each raw sample. The values below update when data is loaded.

Universal correction
V_cal = M_soft × (V_raw − B_hard)
Estimated hard-iron bias · counts
B_hard = [0, 0, 0]ᵀ
Soft-iron correction matrix
M_soft = [1, 0, 0; 0, 1, 0; 0, 0, 1]
C implementation
// Load data to generate calibration code

This quick-fit estimate uses per-axis min/max centers and diagonal scaling. It corrects offsets and axis scale, but does not estimate cross-axis rotation/shear. For best accuracy, collect samples covering a full 3D rotation; verify the calibrated plot is roughly circular in all projections.