Guidance, Navigation and Control · Theory · M7
M7-T5 — The Aiding Sensors of Aircraft and Spacecraft
Every aiding sensor measures something simple and is wrong in a way that is simple to describe. Knowing the equation and the dominant error is what lets a filter use it without trusting it too much.
A navigation filter can only use a sensor once it knows what the sensor measures, as an equation in the state, and how it is wrong. This lesson gives both for six sensors that aircraft and spacecraft carry besides satellite navigation: the barometric altimeter, the air-data system, the magnetometer, the sun sensor, the star tracker and terrain matching. For each there is a measurement equation, the dominant error, and a computed number from Hopper's range, and the pattern that emerges is that the dominant error is rarely the noise.
Learning objectives
After this lesson, you should be able to:
- Write the measurement equation of each of six aiding sensors in terms of the navigation state.
- State the dominant error of each and say whether it is noise, bias or model error.
- Compute the altitude error from a pressure error, the airspeed error from a density error and the heading error from a hard-iron offset.
- Say when terrain matching works and when it cannot.
The intuition
UAV M1-T8: IMU, barometer, magnetometer and GNSS introduces the sensors of a small drone. This lesson adds the ones of aircraft and spacecraft, and treats all of them in the same way: an equation, a dominant error and a number. The point is that a filter needs a model of the error as much as of the measurement.
Pressure and altitude
A barometric altimeter measures static pressure and converts it to height with the standard atmosphere. Near the ground a metre of height is 12 Pa, so 1 hPa of pressure error is 8.3 m of height; at 3000 m it is 11 m. The dominant error is not noise (0.1 hPa is 0.8 m) but the weather: the pressure at a fixed height changes by several hPa over hours, 25 m for 3 hPa. Barometric altitude is therefore good for changes of height, bad for absolute height, and a filter models its bias as a slowly wandering state.
Air data
A pitot tube measures the dynamic pressure, from which the airspeed is . The density is not measured and is taken from a model, so a wrong density gives a proportional error of half its size in the speed: sea-level density used at 1000 m gives 4.7% too low, 2.4 m/s at 50 m/s. More fundamentally the speed is relative to the air, and a wind of 8 m/s makes the groundspeed 42 or 58 m/s for a true airspeed of 50. Air data measures velocity relative to the air, not the Earth.
Magnetic field
A magnetometer measures the Earth's field, and the heading is the angle of its horizontal part. A hard-iron offset (a magnetized part of the vehicle) adds a constant to the field, and it gives a heading error that varies with the heading itself: a 5% offset gives 2.9°, 20% gives 11.5°, 50% gives 30°. Calibration, a circle fit to a full turn, removes it exactly in the example. The local declination, the angle between magnetic and true north, is a heading bias of several degrees to tens of degrees that must come from a model.
Stars and the Sun
A sun sensor gives the direction of the Sun to a fraction of a degree to a few arc minutes, a vector measurement for the attitude of the previous lessons. A star tracker images stars and matches their pattern with a catalogue to give the attitude to arc seconds. Its accuracy is anisotropic: with a 20° field of view, 1024 pixels and a centroid error of 0.1 pixel (7 arc seconds per star), ten stars give 2.2 arc seconds across the boresight and 19 arc seconds about it, because stars at a radius of about a third of the field constrain rotation about the boresight only through their small displacement.
Terrain matching
A radar altimeter measures the height above the ground. Compared with a map of terrain height along the track, a profile of 30 samples gives the along-track position. Over rough terrain the matching cost has a sharp minimum, and an inertial error of 60 m is reduced to 0.1 m rms. Over flat terrain the cost is a broad valley, and the error stays at 52 m: the sensor works where there is information in the terrain, and nowhere else.
Each aiding sensor is an equation and an error. The dominant error is usually not the noise: weather for the barometer, density and wind for air data, the vehicle's own magnetization for the compass, geometry for the star tracker, and the terrain itself for terrain matching.
Definitions
- Barometric altitude
- in the standard atmosphere, with the sea-level values and L the lapse rate.
- Dynamic pressure and airspeed
- , so relative to the air.
- Hard-iron offset
- A constant magnetic field fixed to the vehicle, added to the Earth field in the magnetometer output.
- Declination
- The angle between magnetic north and true north at the vehicle position.
- Terrain profile matching
- Estimating the along-track error by minimizing the squared difference between the measured terrain heights and a map.
Derivation: three sensitivities and the star tracker geometry
Each sensitivity follows from one line of physics.
Hydrostatic balance in the atmosphere: the pressure falls with height by the weight of the air per unit area.
At sea level; at 3000 m the density is 0.91 and the figure is 11.2 m. The weather changes at a given height, which the instrument cannot tell from a change of height.
Differentiate with the measured dynamic pressure fixed. At 1000 m the density is 9.2% below the sea-level value, so using the sea-level density gives − 1 = −4.7%.
Magnetometer with an offset
The horizontal field in the body frame for heading , plus the constant offset of the vehicle.
The heading computed from the measurement. The offset moves the centre of the circle traced in a turn away from the origin.
The largest angle between the measured vector and the true circle: the tangent from the origin to the displaced circle. For it is exactly 30°.
A least-squares fit over a full turn finds the centre, which is the offset, and subtracting it removes the heading error.
The star tracker
Each of N stars gives an independent measurement of the boresight direction with the centroid error ; averaging improves it as the square root of N.
A rotation about the boresight moves a star at radius from the centre by , so the angle error is the centroid error divided by the radius; is about a third of the field of view. For 20° it is 0.116 rad.
The measurement equations are simple physics: hydrostatics, Bernoulli, a displaced circle, averaged centroids. The dominant error comes from an assumption outside the instrument: the weather, the density model, the vehicle's own magnetization, the star pattern, the map.
A worked example
Numbers for each sensor on Hopper's range, from the program below.
- Barometer. One hectopascal is 8.33 m of altitude at the surface, 8.38 m at 60 m, 9.18 m at 1000 m and 11.2 m at 3000 m. A weather change of 3 hPa in an hour is 25 m; a sensor noise of 0.1 hPa is 0.8 m. Against Hopper's 3 m landing requirement the barometer is useful for rates, not for absolute height.
- Air data. At 50 m/s the sea-level density at the range (60 m) gives an airspeed 0.29% low. At 1000 m, sea-level density gives 47.63 m/s for a true 50 (−4.74%); with the correct density, exact. A wind of 8 m/s along the track makes the groundspeed 58 or 42 m/s.
- Magnetometer. A hard-iron offset of 5%, 20% and 50% of the field gives peak heading errors of 2.87°, 11.54° and 30.00°. A circle fit over a turn recovers the offset exactly in noise-free data (to rounding), and the heading error becomes 0.
- Star tracker. A 20° field over 1024 pixels is 70 arc seconds per pixel; a centroid error of 0.1 pixel is 7.0 arc seconds per star. With ten stars the cross-boresight error is 2.2 arc seconds and the roll error about the boresight 19 arc seconds.
- Terrain matching. A profile of 30 samples at 10 m spacing with 1 m of altimeter noise corrects an along-track inertial error of 60 m to 0.1 m rms over rough terrain, but leaves 52 m over flat terrain (200 trials each).
import math
import random
import gnckit as g
D2R = math.pi / 180
G0, R_AIR, T0, P0 = 9.80665, 287.053, 288.15, 101325.0
def isa_p(h): return P0 * (1 - 2.25577e-5 * h) ** 5.25588
def isa_h(p): return (1 - (p / P0) ** (1 / 5.25588)) / 2.25577e-5
def isa_rho(h):
T = T0 - 0.0065 * h
return isa_p(h) / (R_AIR * T)
print('Barometric altitude: p(h) from the standard atmosphere, h from p by inversion; what 1 hPa of pressure error is worth')
for h in (0.0, 60.0, 1000.0, 3000.0):
dp = 100.0 # 1 hPa in pascals
dh = isa_h(isa_p(h) - dp) - h
print(f' h = {h:6.0f} m: pressure {isa_p(h) / 100:8.2f} hPa, 1 hPa error = {dh:5.2f} m of altitude (rho g = {isa_rho(h) * G0:5.2f} Pa/m)')
print(f' a weather change of 3 hPa over an hour at the range: {3 * 8.3:.0f} m; a sensor noise of 0.1 hPa: {0.1 * 8.3:.1f} m')
print('Airspeed from a pitot tube: V = sqrt(2 qc / rho); error when the density used is wrong')
V = 50.0
for h_true, h_used, lab in ((60.0, 0.0, 'range at 60 m altitude, sea-level density used'), (1000.0, 0.0, '1000 m, sea-level density used'), (1000.0, 1000.0, '1000 m, correct density')):
qc = 0.5 * isa_rho(h_true) * V * V
Vh = math.sqrt(2 * qc / isa_rho(h_used))
print(f' {lab:48s} indicated {Vh:6.2f} m/s for a true airspeed of {V:.0f} m/s ({(Vh / V - 1) * 100:+.2f}%)')
print(' air data gives speed relative to the air: with a wind of 8 m/s along the track the ground speed is %.0f or %.0f m/s for a true airspeed of 50' % (V + 8, V - 8))
print('Magnetometer heading with a hard-iron offset, level flight, one full turn:')
Bh = 1.0 # horizontal field in units of itself
for hi in (0.05, 0.2, 0.5):
off = (hi * 0.8, hi * 0.6)
errs = []
pts = []
for k in range(360):
psi = k * D2R
mx, my = Bh * math.cos(psi) + off[0], -Bh * math.sin(psi) + off[1]
pts.append((mx, my))
errs.append(math.degrees(math.atan2(-my, mx) - psi))
errs = [((e + 180) % 360) - 180 for e in errs]
# calibrate: circle fit mx^2 + my^2 + a mx + b my + c = 0
A = [[sum(p[0] ** 2 for p in pts), sum(p[0] * p[1] for p in pts), sum(p[0] for p in pts)],
[sum(p[0] * p[1] for p in pts), sum(p[1] ** 2 for p in pts), sum(p[1] for p in pts)],
[sum(p[0] for p in pts), sum(p[1] for p in pts), float(len(pts))]]
rhs = [-sum((p[0] ** 2 + p[1] ** 2) * p[0] for p in pts), -sum((p[0] ** 2 + p[1] ** 2) * p[1] for p in pts), -sum(p[0] ** 2 + p[1] ** 2 for p in pts)]
a_, b_, c_ = g.mat_solve(A, rhs)
c0 = (-a_ / 2, -b_ / 2)
errs2 = []
for k in range(360):
psi = k * D2R
mx, my = pts[k][0] - c0[0], pts[k][1] - c0[1]
errs2.append(((math.degrees(math.atan2(-my, mx) - psi) + 180) % 360) - 180)
print(f' offset {hi:4.2f} of the field: heading error up to {max(abs(e) for e in errs):6.2f} deg uncalibrated, {max(abs(e) for e in errs2):.1e} deg after the circle fit (offset found {c0[0]:.3f}, {c0[1]:.3f}; true {off[0]:.3f}, {off[1]:.3f})')
print(' a declination of 10 degrees (the angle between magnetic and true north) is a heading bias of 10 degrees until it is corrected from a model')
print('Star tracker, cross-boresight and roll accuracy from the star centroids:')
fov, npix, cent, N = 20.0, 1024, 0.1, 10
px = fov / npix * 3600
sc = cent * px
rho = math.radians(fov / 3)
print(f' one pixel {px:.0f} arcsec, centroid error {cent} pixel = {sc:.1f} arcsec per star; with {N} stars cross-boresight {sc / math.sqrt(N):.1f} arcsec, roll about the boresight {sc / (math.sqrt(N) * rho):.0f} arcsec')
print('Terrain-relative navigation: along-track fix from radar altimeter profile against a map')
def make(rough):
if rough:
return lambda x: 30 * math.sin(x / 50) + 15 * math.sin(x / 17.3 + 1) + 8 * math.sin(x / 7.1)
return lambda x: 1.0 * math.sin(x / 200.0)
rnd = random.Random(8)
for name, rough in (('rough terrain', True), ('flat terrain', False)):
tm = make(rough)
errs = []
for _ in range(200):
x_true = 5000.0
xs = [x_true + 10.0 * i for i in range(30)]
off = 60.0 # INS along-track error: it believes the vehicle is 60 m further on
alt = 200.0
meas = [alt - (alt - tm(x)) + rnd.gauss(0, 1.0) for x in xs] # terrain height seen by the altimeter, noise 1 m
best = None
for s in range(-150, 151):
ss = sum((meas[i] - tm(xs[i] + off + s)) ** 2 for i in range(30))
if best is None or ss < best[0]: best = (ss, s)
errs.append(off + best[1]) # remaining position error, metres (zero if the match is right)
rms = math.sqrt(sum(e * e for e in errs) / len(errs))
print(f' {name:14s}: INS error 60 m, error after the profile match: rms {rms:6.1f} m')Barometric altitude: p(h) from the standard atmosphere, h from p by inversion; what 1 hPa of pressure error is worth h = 0 m: pressure 1013.25 hPa, 1 hPa error = 8.33 m of altitude (rho g = 12.01 Pa/m) h = 60 m: pressure 1006.06 hPa, 1 hPa error = 8.38 m of altitude (rho g = 11.94 Pa/m) h = 1000 m: pressure 898.75 hPa, 1 hPa error = 9.18 m of altitude (rho g = 10.90 Pa/m) h = 3000 m: pressure 701.09 hPa, 1 hPa error = 11.22 m of altitude (rho g = 8.92 Pa/m) a weather change of 3 hPa over an hour at the range: 25 m; a sensor noise of 0.1 hPa: 0.8 m Airspeed from a pitot tube: V = sqrt(2 qc / rho); error when the density used is wrong range at 60 m altitude, sea-level density used indicated 49.86 m/s for a true airspeed of 50 m/s (-0.29%) 1000 m, sea-level density used indicated 47.63 m/s for a true airspeed of 50 m/s (-4.74%) 1000 m, correct density indicated 50.00 m/s for a true airspeed of 50 m/s (+0.00%) air data gives speed relative to the air: with a wind of 8 m/s along the track the ground speed is 58 or 42 m/s for a true airspeed of 50 Magnetometer heading with a hard-iron offset, level flight, one full turn: offset 0.05 of the field: heading error up to 2.87 deg uncalibrated, 0.0e+00 deg after the circle fit (offset found 0.040, 0.030; true 0.040, 0.030) offset 0.20 of the field: heading error up to 11.54 deg uncalibrated, 0.0e+00 deg after the circle fit (offset found 0.160, 0.120; true 0.160, 0.120) offset 0.50 of the field: heading error up to 30.00 deg uncalibrated, 0.0e+00 deg after the circle fit (offset found 0.400, 0.300; true 0.400, 0.300) a declination of 10 degrees (the angle between magnetic and true north) is a heading bias of 10 degrees until it is corrected from a model Star tracker, cross-boresight and roll accuracy from the star centroids: one pixel 70 arcsec, centroid error 0.1 pixel = 7.0 arcsec per star; with 10 stars cross-boresight 2.2 arcsec, roll about the boresight 19 arcsec Terrain-relative navigation: along-track fix from radar altimeter profile against a map rough terrain : INS error 60 m, error after the profile match: rms 0.1 m flat terrain : INS error 60 m, error after the profile match: rms 52.4 m
In robotics
Which sensors to carry is decided by the dominant errors above.
- Aircraft. Barometric altitude and air data are standard and are fused with the inertial and satellite solutions; the filter carries the barometer bias and the wind as states, because they are the dominant errors.
- Heading. Small vehicles use a magnetometer, with a calibration flight or turntable run. Near structures and power cables the field is distorted beyond what the offset model fits, and a filter has to be ready to reject it. Large aircraft use the inertial heading and a magnetic model only for initialization.
- Spacecraft. Star trackers set the attitude of nearly every spacecraft that needs arc-second pointing, with gyros to carry the attitude between images and through periods when the Sun or Earth blocks the view. The roll about the boresight is the weakest axis, so two trackers are often mounted with their boresights at a large angle: the geometry of the attitude-from-vectors lesson again.
- Terrain and map matching. Cruise missiles and some aircraft correct inertial drift by terrain matching; planetary landers do it by matching images with a map of craters (terrain-relative navigation). Both fail where the terrain is featureless.
- Treating errors honestly. A filter that models the barometer as noise with white 0.8 m error will believe it too much and follow the weather. The error model in the filter should include the bias that dominates.
The vector measurements of the sun sensor and the star tracker feed the attitude solution of M7-T3: Attitude from Vector Observations: TRIAD and Wahba's Problem and the filter of M7-T4: Attitude Filters: Complementary and Multiplicative; the last lesson of the module asks when a sensor should be rejected.
Common misconceptions
“The barometer is accurate to 0.1 hPa, so to under a metre.”
Its resolution is, but the pressure at a fixed height changes by several hPa with the weather, so the absolute altitude is wrong by tens of metres. It is a good rate sensor.
“Airspeed from a pitot tube is groundspeed.”
It is speed relative to the air. A wind of 8 m/s changes the groundspeed by 8 m/s, and a wrong density changes the airspeed itself by half the density error.
“A magnetometer needs no calibration if it has low noise.”
The error of an uncalibrated compass is mostly a systematic offset from the vehicle, 11.5° for a 20% hard-iron field, far larger than the noise. Calibration is what makes it usable.
“A star tracker is equally accurate about all axes.”
About the boresight it is about ten times worse than across it (19 against 2.2 arc seconds in the example), because the stars constrain rotation about the boresight only through their small displacements.
“Terrain matching works anywhere with a map.”
It needs terrain with enough variation along the track. Over flat ground the matching cost is nearly constant and the position cannot be found: the error after matching stayed at 52 m of the original 60.
Key takeaways
- Barometric altitude: 1 hPa is 8.3 m at the surface; the weather, not the noise, is the dominant error.
- Airspeed is relative to the air and half as sensitive to density as density is to itself (−4.7% for the sea-level density at 1000 m).
- A hard-iron offset of fraction f of the horizontal field gives a heading error up to (30° for f = 0.5); a circle fit removes it.
- A star tracker is accurate to arc seconds across the boresight, about ten times worse about it.
- Terrain matching reduced a 60 m error to 0.1 m over rough terrain and failed over flat terrain.
- The dominant error of an aiding sensor is usually an outside assumption, not noise, and the filter must model it.
References and further reading
Each source is marked free or paid. Free to read does not mean free to reuse: the course resources page lists every source with its licence.
- P. D. Groves, Principles of GNSS, Inertial, and Multisensor Integrated Navigation Systems, 2nd edition, Artech House, 2013, chapters 13 and 16 on other aiding sensors. Paid.
- J. R. Wertz (ed.), Spacecraft Attitude Determination and Control, Springer, 1978, the chapters on sun sensors, magnetometers and star trackers. Paid.
- C. C. Liebe, "Accuracy performance of star trackers: a tutorial", IEEE Transactions on Aerospace and Electronic Systems 38(2), 2002. Paid (IEEE).
- The NASA Technical Reports Server (search for "terrain relative navigation") hosts the reports on the Mars landers' navigation. Free to read; US government works, usually public domain.
Knowledge check
Three questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A weather system lowers the sea-level pressure by 3 hPa while Hopper sits on the pad. By how much does the barometric altitude change, and why can the filter not tell?
Explanation
At 8.3 m per hPa the altitude reading rises by 25 m while the vehicle has not moved. The barometer measures pressure, and a pressure change from the weather is indistinguishable from a height change at the same location. A filter therefore treats the barometer as a measure of height changes over seconds, and models its bias as a slowly varying state to be calibrated against the radar altimeter or a fix.
Question 2
An uncalibrated magnetometer has a hard-iron offset equal to 20% of the horizontal field. What is the largest heading error, and what does a circle fit do to it?
Explanation
The largest error is arcsin(0.2) = 11.5°, found where the line from the origin is tangent to the displaced circle. The error varies with heading, so it cannot be corrected by a constant. A least-squares circle fit through a full turn finds the centre of the circle, which is the hard-iron offset, and subtracting it recentres the circle at the origin; in the example the remaining error was zero to rounding.
Question 3
Why does terrain matching reduce a 60 m error to 0.1 m over rough terrain but not over flat terrain, with the same altimeter?
Explanation
The matching cost is the sum of squared differences between the profile and the map at the trial shift, and its sharpness depends on how much the terrain height changes with position. Over rough terrain a shift of a few metres changes the height by several metres, so the minimum is sharp compared with the 1 m noise. Over flat terrain a shift of 60 m changes the height by under a metre, so the cost is nearly flat and noise decides the minimum. The information is in the terrain, not in the sensor.
What’s next
Related content
Nothing below is required to finish this lesson.
- BeforeM7-T4: Attitude Filters: Complementary and Multiplicative
Build a complementary filter on gyro and vector measurements, and state how a multiplicative extended Kalman filter keeps the quaternion constraint.
Other courses on this site treat neighbouring topics from their own angle:
- UAV M2-T1: GNSS fundamentals
- UAV M2-T3: GNSS receivers and positioning
- UAV M2-T4: GNSS errors and multipath
- UAV M2-T6: GNSS jamming and spoofing
- UAV M3-T6: Error-State Kalman Filter
- UAV M3-T5: Extended Kalman Filter
- UAV M3-T11: Multi-sensor fusion architectures
- UAV M3-T13: Innovation monitoring
- UAV M3-T16: Sensor fault detection and isolation
- UAV M6-T5: PX4 state estimation and EKF2
- UAV M2-T11: Visual-Inertial Odometry
- SLAM M8-T5: GPS-Denied Localization
- Linear Algebra M5-T6: Weighted Least Squares
- Linear Algebra M6-T5: Singular Value Decomposition
- Probability for Robotics (modules 7, 8 and 12: Kalman, extended and error-state filters)
This course leaves the following to the pages that already teach them:
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.