Infrared and ultra-wideband positioning
UAT 458 Indoor Autonomous UAS and Navigation Technology
Lesson
By the end of this module you will be able to
- Explain how infrared motion-capture systems work and compute the depth error of two-camera triangulation
- Explain UWB ranging by single-sided and double-sided two-way ranging and by time difference of arrival
- Compute the effect of clock offset and reply time on range error
- Solve position from ranges to several anchors by least squares, and assess the effect of anchor geometry and blocked signals
Why this matters
Module 6 concluded that the roof-inspection drone needs a reference every 30 m if it uses VIO. Placing tags so they are visible throughout a 120 × 72 m hall at every height is hard, so the team considers two more reference technologies from the course description: infrared, the most accurate but covering a small volume, and ultra-wideband (UWB), which covers the whole hall with a handful of radio anchors.
Both use the same mathematics: measure angles or ranges to points at known positions, then solve for position. The accuracy always depends on two things: the quality of each measurement and the geometry of the references around the drone.
Infrared motion capture
An optical motion-capture system places several cameras around a space. Each camera has a ring of infrared lights around its lens that illuminates small spherical retroreflective markers on the drone. The markers reflect the light straight back, appearing as bright dots on a dark image, and the camera finds the centre of each dot to a fraction of a pixel. When two or more cameras see the same marker, the software intersects the rays from each camera to obtain a 3D position, a process called triangulation (Hartley & Zisserman, 2004). Three or more markers in an asymmetric pattern give both the position and the attitude of the aircraft.
These systems are very accurate. Merriaux and colleagues (2017) tested a Vicon system and found a mean absolute static error of 0.15 mm and a dynamic error below 2 mm, provided the marker size and sampling rate suit the speed. The limits are that the system works only in the volume seen by several cameras at once, it is expensive, and sunlight or some lamps that emit infrared can interfere (Alarifi and colleagues, 2016).
For these reasons the Hall 3 team does not use infrared cameras to navigate the whole hall. Instead they install them in a 10 × 8 × 4 m test cage behind the control room as a ground truth many times more accurate than the systems under test, used to evaluate VIO and UWB in module 10.
Two cameras judge depth the way two eyes do. With a wide baseline between them, the difference between the marker’s image positions, the disparity , is large. Inverting gives and the depth error .
Example 1 Camera spacing in the test cage
The motion-capture cameras have a focal length of 1200 px and locate marker centres to 0.05 px. The team compares cameras 0.5, 2 and 6 m apart with markers at 4 and 8 m (assumed, treated as a parallel camera pair).
import math
# Example 1: depth error of a two-camera infrared triangulation (rectified pair, assumed values)
fx = 1200.0 # focal length of each motion-capture camera (px)
sigma_d = 0.05 # marker-centroid noise on the disparity (px), sub-pixel blob centre
def depth_err(Z, B):
return Z ** 2 / (fx * B) * sigma_d
for B in (0.5, 2.0, 6.0):
print(f"baseline {B:3.1f} m: error at 4 m {depth_err(4, B) * 1000:5.2f} mm, at 8 m {depth_err(8, B) * 1000:5.2f} mm")
baseline 0.5 m: error at 4 m 1.33 mm, at 8 m 5.33 mm
baseline 2.0 m: error at 4 m 0.33 mm, at 8 m 1.33 mm
baseline 6.0 m: error at 4 m 0.11 mm, at 8 m 0.44 mm
A 0.5 m baseline, like a stereo camera on a drone, gives 5.33 mm of error at 8 m; a 6 m baseline with cameras at opposite corners of the cage gives only 0.44 mm. Camera spacing matters as much as camera quality, which is why motion-capture cameras are spread around the space rather than grouped in one place.
How UWB works
UWB (ultra-wideband) transmits very short radio pulses spread over a very wide band. Short pulses allow the arrival time to be measured finely and the direct path to be separated from reflections better than with narrowband radio (Alarifi and colleagues, 2016). The IEEE 802.15.4 standard defines UWB physical layers and modes for precision ranging. The current edition is IEEE 802.15.4-2024, which incorporates the 802.15.4z-2020 amendment that improved the integrity and accuracy of ranging (IEEE, 2024). Radio equipment used in Thailand must be permitted under the NBTC notifications in force at the time.
A UWB system for drones has two parts: fixed anchors at surveyed positions and a tag on the drone. Radio waves travel at the speed of light, 299,792,458 m/s, so every 1 ns of time is 0.30 m of range. Decimetre ranging therefore needs nanosecond timing, and the main problem becomes the clocks of different devices do not run at exactly the same rate.
Two-way ranging
Two-way ranging (TWR) does not need synchronised clocks. Tag A sends a Poll; anchor B waits a reply time and sends a Response; A measures the round trip . The one-way time of flight is (Lian Sang and colleagues, 2019)
This is SS-TWR (single-sided). The problem is that is measured on A’s clock and on B’s. If the clocks run at rates that differ by , the time-of-flight error is about , which grows with the reply time. IEEE 802.15.4-2011 allows clocks to be off by ±20 ppm (Lian Sang and colleagues, 2019).
The remedy is DS-TWR (double-sided), which adds a third message (Final) from A to B so that both sides obtain a round trip and a reply time. The AltDS-TWR method of Neirynck and colleagues (2016) computes
where is each side’s round trip and its reply time. The formula does not need equal reply times and removes almost all of the clock-rate effect.
Example 2 How far off does a 25 ppm clock difference put the range?
The drone’s tag is 30 m from an anchor. The tag’s clock runs 15 ppm fast and the anchor’s 10 ppm slow (assumed, within ±20 ppm). Compare SS-TWR with AltDS-TWR at several reply times; in the double-sided case A’s reply time is 1.5 times B’s.
# Example 2: UWB two-way ranging with drifting clocks
c = 299_792_458.0
d_true = 30.0 # true tag-anchor distance (m)
tof = d_true / c
e_A, e_B = 15e-6, -10e-6 # clock errors of tag A and anchor B (+15 ppm, -10 ppm)
def ss_twr(reply_B): # single-sided: A measures round trip, B reports its reply time
t_round_A = (2 * tof + reply_B) * (1 + e_A)
t_reply_B = reply_B * (1 + e_B)
return (t_round_A - t_reply_B) / 2 * c
def alt_ds_twr(reply_B, reply_A): # alternative double-sided TWR (Neirynck et al., 2016)
Ra = (2 * tof + reply_B) * (1 + e_A); Db = reply_B * (1 + e_B)
Rb = (2 * tof + reply_A) * (1 + e_B); Da = reply_A * (1 + e_A)
return (Ra * Rb - Da * Db) / (Ra + Rb + Da + Db) * c
for reply in (100e-6, 300e-6, 1000e-6):
print(f"reply {reply * 1e6:5.0f} us: SS-TWR error {ss_twr(reply) - d_true:6.3f} m, "
f"AltDS-TWR error {(alt_ds_twr(reply, reply * 1.5) - d_true) * 1000:6.3f} mm")
reply 100 us: SS-TWR error 0.375 m, AltDS-TWR error 0.075 mm
reply 300 us: SS-TWR error 1.125 m, AltDS-TWR error 0.075 mm
reply 1000 us: SS-TWR error 3.748 m, AltDS-TWR error 0.075 mm
At a 300 µs reply time SS-TWR is 1.125 m off, useless against a 0.30 m requirement, and the error grows with reply time. AltDS-TWR is off by only 0.075 mm whatever the reply time, even with unequal reply times on the two sides. The cost is three messages per measurement. A system that must use SS-TWR has to estimate the clock offset from the received signal or keep reply times as short as possible. These figures exclude blocked signals, which are a different kind of error.
TDoA (time difference of arrival) is the other approach. The tag transmits once, and several anchors whose clocks are synchronised record when they receive it. The arrival-time difference between anchors and multiplied by the speed of light equals the range difference . Points with a constant range difference lie on a hyperbola, and the intersection of several hyperbolas is the tag position. Because the tag transmits only once, TDoA scales well to many tags; the price is synchronising every anchor (Alarifi and colleagues, 2016).
Position from several ranges
Given ranges to anchors at known positions , the drone position must satisfy for every anchor. The equations are nonlinear, so they are solved by Gauss-Newton: start from a guess, compute the expected ranges, their differences from the measured ranges and the Jacobian , whose rows are unit vectors from each anchor to the drone, then solve a least-squares correction and repeat until it settles (Groves, 2013). This is multilateration.
The accuracy of the result depends not only on range accuracy but also on the directions of the anchors around the drone. It is measured by the dilution of precision (DOP) from , giving HDOP horizontally and VDOP vertically. The position error is roughly the DOP times the range error, the same idea as GNSS DOP.
The most dangerous UWB error in the hall is non-line-of-sight (NLOS) propagation. When a steel booth or a crowd blocks the direct path, the signal that arrives has taken a longer indirect route, so the measured range is always too long, not randomly plus or minus.
Example 3 Where to mount UWB anchors in Hall 3
The team has four anchors. Layout one puts them on the four corner columns at 3 m height. Layout two groups them near the loading door in one corner at alternating heights of 3 and 15 m. The drone is at (40, 30, 12) m, random range noise is 0.10 m, and in a further case a steel stand blocks anchor 3 and makes its range 0.8 m too long (assumed).
# Example 3: 3D multilateration by Gauss-Newton least squares; anchor geometry and NLOS
import numpy as np
def solve(anchors, ranges, x0, iters=10):
x = np.array(x0, float)
for _ in range(iters):
diff = x - anchors
pred = np.linalg.norm(diff, axis=1)
H = diff / pred[:, None] # Jacobian of range wrt position
x = x + np.linalg.lstsq(H, ranges - pred, rcond=None)[0]
return x, H
def dop(H): # horizontal and vertical dilution of precision
Q = np.linalg.inv(H.T @ H)
return np.sqrt(Q[0, 0] + Q[1, 1]), np.sqrt(Q[2, 2])
true = np.array([40.0, 30.0, 12.0]) # drone under the roof truss (x, y, z in m)
layouts = {"corners": [[0, 0, 3], [120, 0, 3], [120, 72, 3], [0, 72, 3]], # four corner columns
"one corner": [[0, 0, 3], [20, 0, 15], [20, 15, 3], [0, 15, 15]]} # all near the loading door
for name, A in layouts.items():
A = np.array(A, float)
x, H = solve(A, np.linalg.norm(true - A, axis=1), [60, 36, 10])
h, v = dop(H)
print(f"{name:10s}: HDOP {h:.2f}, VDOP {v:.2f}; 0.10 m range noise -> {h * 0.10:.2f} m horizontal, {v * 0.10:.2f} m vertical")
A = np.array(layouts["corners"], float)
r_nlos = np.linalg.norm(true - A, axis=1) + np.array([0, 0, 0.8, 0]) # steel booth wall: anchor 3 reads 0.8 m long
x, _ = solve(A, r_nlos, [60, 36, 10])
print(f"NLOS on anchor 3: estimate ({x[0]:.2f}, {x[1]:.2f}, {x[2]:.2f}), error {np.linalg.norm(x - true):.2f} m")
res = np.linalg.norm(x - A, axis=1) - r_nlos # range residuals after the fit
print("residuals (m):", np.round(res, 2), "-> something is wrong, but not which anchor")
corners : HDOP 1.10, VDOP 3.67; 0.10 m range noise -> 0.11 m horizontal, 0.37 m vertical
one corner: HDOP 2.39, VDOP 2.84; 0.10 m range noise -> 0.24 m horizontal, 0.28 m vertical
NLOS on anchor 3: estimate (39.72, 29.72, 13.14), error 1.20 m
residuals (m): [-0.17 0.29 -0.31 0.2 ] -> something is wrong, but not which anchor
The corner layout gives HDOP 1.10, about 0.11 m horizontally, but VDOP 3.67 because every anchor is low and far away compared with the height differences, so height is off by 0.37 m. The team must take height from a rangefinder or LiDAR instead of UWB. Grouping the anchors in one corner worsens HDOP to 2.39 because they all lie in roughly the same direction as seen from the drone. In the NLOS case the 0.8 m excess pulls the position 1.20 m off, mostly vertically. The range residuals after the fit, about 0.2 to 0.3 m, are larger than normal noise, so the system can tell that something is wrong. But four anchors and three unknowns leave only one redundant equation, so the error is spread over every anchor and the blocked one cannot be identified. Real systems install more anchors to isolate the faulty one and check each range against the predicted position before using it, as module 8 shows.
Module lab
Lab: UWB ranging and multilateration
- Set up two UWB nodes in an open room. Measure the true range with a tape or laser distance meter at 2, 5, 10 and 20 m, log 200 UWB ranges at each, and compute the mean error and standard deviation
- If the devices allow it, compare SS-TWR with DS-TWR at the same ranges and explain the result with the code in Example 2
- Have a person stand in the direct path, then place a metal sheet there; log the ranges and check whether the error is always positive
- Mount 4 to 6 anchors around the room in two layouts, range from test points at known positions, and use the code in Example 3 to compute position, HDOP and VDOP against the true position
Common mistakes
Watch out
- Using SS-TWR with long reply times without correcting the clock offset, so ranges are metres off
- Mounting anchors in a line or on one side, which inflates DOP in some directions
- Trusting UWB height when all anchors are at similar heights and VDOP is very high
- Treating blocked ranges as random noise, when they are always too long and pull the position one way
- Installing too few anchors, so the system can tell that a range is wrong but not which one
- Not surveying anchor positions accurately: anchor position errors pass straight into the drone position
- Using infrared cameras in sunlight or outside the volume the cameras share
Summary
- Infrared motion capture is accurate to millimetres but covers only the volume the cameras share, making it a ground truth for a test cage; depth error shrinks with a wide camera baseline
- UWB times radio pulses, with 1 ns equal to 0.30 m. SS-TWR errs by the clock-rate difference times the reply time; DS-TWR removes nearly all of it; TDoA scales to many tags but needs synchronised anchors
- Position from several ranges is solved by Gauss-Newton, and its accuracy is DOP times the range error
- NLOS makes ranges always too long; there must be more anchors than unknowns and outliers must be rejected
Check your understanding
- A 2 ns error in the one-way time of flight gives what range error?
- Clocks 10 ppm apart and a 200 µs reply time: about how large is the SS-TWR range error?
- Two cameras with = 1200 px, a 3 m baseline and 0.05 px centroid precision see a marker 6 m away. What is the depth error?
- With HDOP 1.5 and a 0.10 m range error, about how large is the horizontal position error?
- Why can UWB with only four anchors in 3D not tell which anchor is blocked?
Answers
- m
- m
- m, or 0.5 mm
- m
- There is only one equation more than the unknowns. The residuals show that something is wrong, but the error is spread over every anchor, and dropping any one anchor leaves three that fit exactly, so the faulty one cannot be isolated. More anchors, or a predicted position from other sensors, are needed
Key formulas
| Depth error of two-camera triangulation | |
| Single-sided two-way ranging | |
| Alternative double-sided two-way ranging | |
| Range model and Jacobian | |
| Dilution of precision |
Key references
- Merriaux, P., Dupuis, Y., Boutteau, R., Vasseur, P., & Savatier, X. (2017). A study of Vicon system positioning performance. Sensors, 17(7), 1591. https://doi.org/10.3390/s17071591 link
- Alarifi, A., Al-Salman, A., Alsaleh, M., Alnafessah, A., Al-Hadhrami, S., Al-Ammar, M. A., & Al-Khalifa, H. S. (2016). Ultra wideband indoor positioning technologies: Analysis and recent advances. Sensors, 16(5), 707. link
- Lian Sang, C., Adams, M., Hörmann, T., Hesse, M., Porrmann, M., & Rückert, U. (2019). Numerical and experimental evaluation of error estimation for two-way ranging methods. Sensors, 19(3), 616. https://doi.org/10.3390/s19030616 link
- Neirynck, D., Luk, E., & McLaughlin, M. (2016). An alternative double-sided two-way ranging method. In 2016 13th Workshop on Positioning, Navigation and Communications (WPNC) (pp. 1–4). IEEE. link
- IEEE. (2024). IEEE standard for low-rate wireless networks (IEEE Std 802.15.4-2024). link
- Groves, P. D. (2013). Principles of GNSS, inertial, and multisensor integrated navigation systems (2nd ed.). Artech House. link
- Hartley, R., & Zisserman, A. (2004). Multiple view geometry in computer vision (2nd ed.). Cambridge University Press. link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results