UWB Two-Way Ranging Workbench

Explore how UWB devices turn nanosecond flight time into a range estimate

animation
uwb
ranging
protocols
short-range
Learner-ready UWB two-way ranging workbench with SS-TWR and DS-TWR message timing, clock-drift and NLOS diagnostics, formula tracing, quick reference, guided practice, and primary source links.
Ultra-wideband Time of flight Two-way ranging

UWB Two-Way Ranging Workbench

UWB ranging estimates distance by timestamping short radio pulses. Use this workbench to compare single-sided and double-sided TWR, then watch how clock offset, reply delay, antenna delay, and non-line-of-sight bias change the range estimate.

Light travels 29.98 cm per ns
UWB principle ToF, not RSSI
SS-TWR risk Reply-delay drift
DS-TWR benefit Clock-offset compensation
Beginner ramp

What to notice first

A one-way UWB pulse flight time is tiny: at 10 m it is only about 33 ns. TWR avoids needing synchronized clocks by measuring a round trip and subtracting the responder's known waiting time.

1. Range comes from time

Distance equals one-way time of flight multiplied by the speed of light. The hard part is estimating that one-way time from timestamps.

2. SS-TWR is simple

The initiator sends a Poll, the responder waits, then sends a Response. It is efficient, but any error in the reply delay is converted into distance error.

3. DS-TWR adds a correction

Double-sided TWR adds a Final message so both devices contribute round and reply intervals. This greatly reduces first-order clock-offset error.

Interactive workbench

Trace the packets and the math together

Step through the message exchange or play the sequence. The animation, timestamp cards, formula, and diagnosis panels all update from the same model.

Ranging scene

Clean line-of-sight range with a short responder reply. The SS and DS estimates are close to the true distance.

SS-TWR Poll
Poll Initiator sends timestamped request

The first pulse starts the timing exchange.

Response Responder waits and replies

The reply delay must be subtracted from the round trip.

Final DS-TWR adds a second round

Extra timing evidence reduces clock-offset sensitivity.

Stage 1 Poll leaves initiator

T1 starts the round-trip measurement.

Stage 2 Responder receives and waits

The reply delay is intentional processing time.

Stage 3 Response returns

SS-TWR can estimate range after this message.

Stage 4 Final closes DS-TWR

Double-sided mode adds a second round interval.

Diagnosis

What the current setup teaches

The cards separate timing math from deployment risk. A clean formula can still produce a weak range when the radio path or calibration is poor.

Timing model Clean timing evidence

The measured round trip and reply interval are consistent.

Clock offset Low drift pressure

SS-TWR drift error is small with the selected reply delay.

Radio path Line-of-sight assumption

No extra path delay is added to the first-arrival timestamp.

Formula and evidence

Check the units before trusting the answer

UWB can feel magical because the timings are so small. The workbench keeps the speed-of-light conversion explicit.

SS-TWR teaching formula

ToF = (round_A - reply_B_reported) / 2
d = c x ToF

The initiator measures the full round trip. It subtracts the responder's reported reply delay, then halves the remaining flight time.

Quantity Current value Why it matters
One-way flight time 26.7 ns Every nanosecond is about 30 cm of range.
Measured round interval 500.1 us This includes two flights plus responder reply time.
Reported reply delay 500.0 us Clock offset during this wait creates SS-TWR range error.
Path/calibration bias 0 cm NLOS and antenna delay errors add directly to the distance estimate.
Quick reference

Use this when designing with UWB

These cards summarize the design tradeoffs without hiding the important caveats.

SS-TWR

Fewer packets and lower airtime. Best when reply delays are short, clocks are stable enough, and the range result only needs to live at the initiator.

DS-TWR

Adds timing evidence to reduce clock-offset sensitivity. Useful for moving devices, longer reply delays, and tighter accuracy budgets.

Secure ranging

IEEE 802.15.4z adds stronger UWB ranging support. System designers still need correct keys, session setup, and relay-resistance checks.

Deployment limits

Non-line-of-sight, antenna placement, body loading, interference, and calibration can dominate the error even when timestamp math is correct.

Guided practice

Three checks to run yourself

Try these in order. Each task maps directly to a decision a UWB system designer has to make.

Compare SS and DS with drift

Select Long reply drift, then switch between SS-TWR and DS-TWR. Watch the range error and clock diagnosis.

Find the reply-delay threshold

Keep a 10 ppm offset and increase responder reply delay until SS-TWR error exceeds 30 cm.

Separate timing from path quality

Select NLOS bias. Notice that DS-TWR helps clock offset, but it cannot remove a delayed first path.

Primary sources

Standards and implementation references

The page links to standards and vendor documentation so learners can trace the teaching model back to real UWB systems.

FiRa UWB overview

Industry overview of UWB positioning, ranging, and interoperability framing.

Open FiRa overview

Qorvo application notes

Implementation, calibration, NLOS, and TWR error references.

Open Qorvo notes
Deeper note: why the simple formula is not the whole system

This workbench uses a teaching model: it assumes a clean first-arrival timestamp and shows how interval math translates to range. Real receivers estimate arrival time from the channel impulse response, then apply antenna-delay calibration and quality checks.

  • Clock offset during long reply intervals is the classic SS-TWR weakness.
  • DS-TWR reduces first-order clock-offset error, but does not fix NLOS delay.
  • Secure access designs also need cryptographic session setup and relay-resistance analysis.
  • Multi-anchor positioning still needs geometry checks; poor anchor geometry can turn good ranges into weak positions.