<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karan Gadani</title>
    <description>The latest articles on DEV Community by Karan Gadani (@karan_gadani).</description>
    <link>https://dev.to/karan_gadani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3626584%2F55ede526-2525-411e-a409-e6d5b0bc9552.png</url>
      <title>DEV Community: Karan Gadani</title>
      <link>https://dev.to/karan_gadani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karan_gadani"/>
    <language>en</language>
    <item>
      <title>UWB DWM1000: Time-Delay Problems, Solutions &amp; Trilateration</title>
      <dc:creator>Karan Gadani</dc:creator>
      <pubDate>Mon, 24 Nov 2025 06:59:51 +0000</pubDate>
      <link>https://dev.to/karan_gadani/uwb-dwm1000-time-delay-problems-solutions-trilateration-4884</link>
      <guid>https://dev.to/karan_gadani/uwb-dwm1000-time-delay-problems-solutions-trilateration-4884</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Ultra-Wideband (UWB) is famous for giving precise ranging down to a few centimeters, but only when the system is calibrated correctly.&lt;/li&gt;
&lt;li&gt;The Deca wave/Qorvo DW1000 / DWM1000 is sensitive to a variety of time-delay and environment-dependent effects. If these aren’t handled, you may see systematic range offsets, inconsistent measurements, or unstable trilateration positions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;1. What “time delay error” really means in UWB (DW1000/DWM1000)&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The DW1000 measures distance using Time of Flight (ToF) of RF pulses.&lt;/li&gt;
&lt;li&gt;Your measured distance becomes wrong when the ToF is wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sources of ToF bias in DW1000-based modules&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Antenna delay (biggest cause)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every module has internal TX/RX delay (RF front-end + antenna path).&lt;/li&gt;
&lt;li&gt;Adds a constant offset to all distance measurements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Clock offset &amp;amp; drift&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each node has its own oscillator.&lt;/li&gt;
&lt;li&gt;Single-Sided TWR is very sensitive to this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Power-dependent bias&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Received signal strength changes timestamp extraction → distance shifts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Multipath &amp;amp; NLOS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reflections cause the chip to timestamp the wrong path.&lt;/li&gt;
&lt;li&gt;Usually creates longer distances.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. Antenna Delay - Fix for DW1000 Range Errors&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Antenna delay is a constant nanosecond-scale offset caused by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RF transceiver output path&lt;/li&gt;
&lt;li&gt;PCB traces&lt;/li&gt;
&lt;li&gt;Antenna feed
If this is uncalibrated, your error will be large and constant (10–50 cm not unusual).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;What proper antenna delay calibration achieves&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Removes 90% of the systematic bias&lt;/li&gt;
&lt;li&gt;Makes ranges consistent across different distances&lt;/li&gt;
&lt;li&gt;Stabilizes trilateration position&lt;/li&gt;
&lt;li&gt;Reduces anchor-to-anchor variation&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;How antenna delay affects raw ranging&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If true distance = 1.00m and antenna delay adds +0.45 m
then your system will always show ~1.45 m (constant offset)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This explains why many users see &lt;strong&gt;stable but wrong&lt;/strong&gt; distances.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Ranging protocol choice: DS-TWR is mandatory for accuracy&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SS-TWR (Single-Sided Two-Way Ranging)

&lt;ul&gt;
&lt;li&gt;Fast, simple, but highly inaccurate when clocks drift.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;DS-TWR (Double-Sided Two-Way Ranging)

&lt;ul&gt;
&lt;li&gt;Cancels clock offset effects &lt;/li&gt;
&lt;li&gt;Less sensitive to timestamp error&lt;/li&gt;
&lt;li&gt;Recommended for all accurate positioning&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;SDS-TWR / Symmetric TWR

&lt;ul&gt;
&lt;li&gt;Variants exist for even better cancellation&lt;/li&gt;
&lt;li&gt;Useful when nodes cannot guarantee regular message spacing&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Multipath, NLOS &amp;amp; Environment Effects&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;UWB is resistant to multipath, but not immune.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Problems caused by NLOS: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Long positive bias (since first path is blocked)&lt;/li&gt;
&lt;li&gt;Unstable range (large variance)&lt;/li&gt;
&lt;li&gt;Trilateration “pull” toward one anchor&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Mitigation&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Median filtering&lt;/li&gt;
&lt;li&gt;Reject packets with high CIR noise&lt;/li&gt;
&lt;li&gt;Detect absence of a clean first-path peak&lt;/li&gt;
&lt;li&gt;If multiple anchors → down-weight the suspicious anchor in calculations&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;5. Temperature &amp;amp; Clock Drift Effects&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The DW1000’s internal oscillator drifts with temperature:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Anchor inside hot enclosure vs tag in open air → measurable bias&lt;/li&gt;
&lt;li&gt;Long-term TSF drift adds long-term offset&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Periodic recalibration&lt;/li&gt;
&lt;li&gt;Temperature compensation models &lt;/li&gt;
&lt;li&gt;DS-TWR (removes most clock effects)&lt;/li&gt;
&lt;li&gt;Anchors placed in thermally stable locations&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;6. Trilateration - How Position Is Computed from Distances&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Trilateration uses circles (2D) or spheres (3D).&lt;br&gt;
Each measured distance defines a circle around &lt;br&gt;
&lt;code&gt;anchor_i: (x − xi)² + (y − yi)² = ri²&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In reality, circles don’t meet perfectly&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because ranges include noise, the circles often:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don’t intersect&lt;/li&gt;
&lt;li&gt;Intersect in a small region &lt;/li&gt;
&lt;li&gt;Intersect in multiple points (bad anchor geometry)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thus practical trilateration uses:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Least-squares solution&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimize error between predicted and actual ranges.&lt;/li&gt;
&lt;li&gt;Weighted LSQ is best when some anchors are less reliable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Outlier rejection&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If one anchor is too far off, remove or reduce its weight.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Good anchor geometry&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid placing anchors in a line - the intersection becomes ambiguous.&lt;/li&gt;
&lt;li&gt;Use a triangle (2D) or tetrahedral shape (3D).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Diagram&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4nny1pftredzpyukmxb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx4nny1pftredzpyukmxb.jpg" alt=" " width="800" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The DW1000/DWM1000 can deliver accurate UWB ranging only when calibrated properly. &lt;/li&gt;
&lt;li&gt;Antenna delay is the main cause of constant distance error and must be corrected. &lt;/li&gt;
&lt;li&gt;DS-TWR provides stable measurements, while SS-TWR suffers from clock drift. &lt;/li&gt;
&lt;li&gt;Environment, NLOS, and temperature variations strongly affect range quality. &lt;/li&gt;
&lt;li&gt;With proper calibration and robust trilateration, true centimeter-level accuracy is achievable.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>iot</category>
      <category>performance</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
