Esp32C3 FTM

james chua
Posts: 1
Joined: Thu May 27, 2021 1:39 pm

Esp32C3 FTM

Postby james chua » Sat May 29, 2021 6:14 am

FTM Problem with Esp32C3

When two Esp32C3 only 0.5 meters apart yet the distance measurements are > 22 meters .
Using the [Show examples Projects] ftm code from ESP-IDF.
May i know why ??

W (106451) wifi:Starting FTM session in 0.200 Sec
W (108051) wifi:FTM session ends with 26 valid readings out of 31, Avg raw RTT: 187.860 nSec, Avg RSSI: -40
I (108051) ftm_station: FTM Report:
I (108061) ftm_station: | Diag | RTT | T1 | T2 | T3 | T4
| RSSI |
I (108071) ftm_station: | 5| 193750 | 6168893584375 | 6018054264062 | 6018159932812 | 6168999446875
| -40 |
I (108081) ftm_station: | 6| 195312 | 6199762584375 | 6048923092187 | 6049027932812 | 6199867620312
| -40 |
I (108091) ftm_station: | 7| 182812 | 6231808584375 | 6080968898437 | 6081073932812 | 6231913801562
| -40 |
I (108111) ftm_station: | 9| 193750 | 6367867584375 | 6217027145312 | 6217132932812 | 6367973565625
| -40 |
I (108121) ftm_station: | 10| 181250 | 6399724584375 | 6248883954687 | 6248988932812 | 6399829743750
| -40 |
I (108131) ftm_station: | 11| 182813 | 6431792596875 | 6280951787500 | 6281056932812 | 6431897925000
| -40 |
I (108141) ftm_station: | 12| 181250 | 6465709584375 | 6314868582812 | 6314973932812 | 6465815115625
| -40 |
I (108151) ftm_station: | 13| 179687 | 6567996584375 | 6417155007812 | 6417259932812 | 6568101689062
| -40 |
I (108161) ftm_station: | 14| 179687 | 6601138584375 | 6450296820312 | 6450401932812 | 6601243876562
| -40 |
I (108171) ftm_station: | 15| 193750 | 6632681584375 | 6481839656250 | 6481944932812 | 6632787054687
| -40 |
I (108191) ftm_station: | 16| 190625 | 6664037596875 | 6513195490625 | 6513300932812 | 6664143229687
| -41 |
I (108201) ftm_station: | 17| 179687 | 56933196875 | 6616976895312 | 6617081932812 | 57038414062
| -42 |
I (108211) ftm_station: | 18| 190625 | 88992196875 | 6649035726562 | 6649140932812 | 89097593750
| -42 |
I (108221) ftm_station: | 19| 182813 | 121086184375 | 6681129521875 | 6681234932812 | 121191778125
| -42 |
I (108231) ftm_station: | 20| 179688 | 153091196875 | 2247953125 | 2353532812 | 153196956250
| -42 |
I (108241) ftm_station: | 21| 193750 | 258386184375 | 107542360937 | 107647532812 | 258491550000
| -41 |
I (108251) ftm_station: | 22| 193750 | 290573184375 | 139729179687 | 139834532812 | 290678731250
| -40 |
I (108261) ftm_station: | 23| 181250 | 322481184375 | 171636987500 | 171742532812 | 322586910937
| -40 |
I (108281) ftm_station: | 24| 193750 | 354525184375 | 203680818750 | 203786532812 | 354631092187
| -40 |
I (108291) ftm_station: | 25| 193750 | 457095184375 | 306250240625 | 306355532812 | 457200670312
| -40 |
I (108301) ftm_station: | 26| 181250 | 489159184375 | 338314046875 | 338419532812 | 489264851562
| -40 |
I (108311) ftm_station: | 27| 193750 | 521223184375 | 370377879687 | 370483532812 | 521329031250
| -40 |
I (108321) ftm_station: | 28| 181250 | 555036184375 | 404190676562 | 404295532812 | 555141221875
| -40 |
I (108331) ftm_station: | 29| 195313 | 657344184375 | 506498112500 | 506603532812 | 657449800000
| -40 |
I (108341) ftm_station: | 30| 193750 | 689319196875 | 538472943750 | 538578532812 | 689424979687
| -40 |
I (108361) ftm_station: | 31| 195312 | 721404184375 | 570557751562 | 570663532812 | 721510160937
| -40 |
I (108371) ftm_station: Estimated RTT - 152 nSec, Estimated Distance - 22.90 meters
ftm>

Thanks

cuddlyfoxgirl
Posts: 1
Joined: Fri Aug 06, 2021 2:12 pm

Re: Esp32C3 FTM

Postby cuddlyfoxgirl » Fri Aug 06, 2021 2:16 pm

What a fantastic question! I just flashed the FTM example onto two ESP32-C3 dev boards an i'm experiencing the same problem. With <1m distance i get 4m… if i move away 50cm more it goes up to 8m… also, with an Android appi get completely differnt values that are even higher. What's going on, what am i doing wrong?

burtrum
Posts: 20
Joined: Mon Dec 28, 2015 1:34 pm

Re: Esp32C3 FTM

Postby burtrum » Sat Aug 07, 2021 8:58 pm

Hello,
This long answer is completely theoretical. I spent 15 minutes poking around.

You may be expecting to much from 802.11mc FTM. At best it has around 1 m accuracy and may not work well with small distances. You are testing at sub-meter distances. Try a much greater distance.

Indoors everything affects accuracy. While developing code I would consider some outdoor experiments. Also a quick search implies there is a lot of multiple samples and math to be considered, and multiple beacons. Most of the papers are by PhD students.

Search on 802.11mc FTM: All good reading.

1. https://github.com/espressif/esp-idf/bl ... /README.md

The README.md doc shows results at 5m with multiple samples.

W (393564) wifi:FTM session ends with 26 valid readings out of 31, Avg raw RTT: 49.218 nSec, Avg RSSI: -1
I (393564) ftm_station: Estimated RTT - 33 nSec, Estimated Distance - 5.07 meters

The final statement gives the average calculated RTT along with an estimated distance between the Station and the AP. This distance is measured by first adjusting the RTT with any physical analog delays and a calibration delta. Distances measured using RTT are not perfectly accurate, and are subjected to various errors like RF interference, multi-path, path loss, orientations etc. The design requires line-of-sight with straightforward propagation path with no less than -70dBm RSSI for better results.

2. https://users.ece.cmu.edu/~agr/resource ... 9-wang.pdf

This paper mentions testing at 5 m and 10 m.

3. https://source.android.com/devices/tech ... t/wifi-rtt

NOTE CALIBRATION statement and 2 meter accuracy statement at 80Mhz.

For Wi-Fi RTT to perform well, the ranges returned in the 802.11mc protocol are ideally accurate within the Key Performance Indicator (KPI). For the 90% CDF error, at the bandwidths listed, the recommended KPI for a range estimate is expected to have the following tolerances:
• 80MHz: 2 meter
• 40MHz: 4 meters
• 20MHz: 8 meters
To ensure the implementation of the feature is working correctly, calibration testing is necessary.

4. http://people.csail.mit.edu/bkph/ftmrtt.shtml

5. https://developer.android.com/guide/top ... y/wifi-rtt

6. https://www.mdpi.com/2079-9292/9/8/1193/htm
Download the PDF. Lots of math.

Getting accurate results does not seem simple.

Burtrum

pinkeen
Posts: 6
Joined: Mon Jul 12, 2021 2:55 pm

Re: Esp32C3 FTM

Postby pinkeen » Thu Aug 12, 2021 7:12 am

I've read some papers and there are a few methods to improve the accuracy. Still haven't tested any of them (just recently got my hands on the actual S2 boards).

Calibrate the error and correct in software

If you provide both the AP and STA or you know you will use a specific device combination it's possible that the result error offset is constant for the hardware. Measure the error in controlled conditions over wide range of parameters and check if there's a correlation of the error values and devise a function to correct it.

Simulate wider band

Repeat the measurements over all possible channels and just average the results (maybe after discarding any outliers).

Use any extra data to improve the results

Use wifi channel state information for improving the result. Not sure of the best way to do it yet, but for example - I imagine it could be used to detect and discard results which are most badly affected by multipath signal travel.

Also you could additionally use the RSSI and/or the CSI amplitude/offset for getting an alternative distance measurement.

Improve the hardware setup

Couple ideas: better antenna, fixed device orientation, multiple antennas at different angles (antenna diversity).

Use special hardware

If you really need sub-meter accuracy the you could use modules dedicated for RTLS. The 6Ghz USB modules started popping up but they are still quite pricey.

pinkeen
Posts: 6
Joined: Mon Jul 12, 2021 2:55 pm

Re: Esp32C3 FTM

Postby pinkeen » Thu Aug 12, 2021 7:18 am

PS I meant UWB modules - not USB.

On some related matter I wonder if esoressif plans to release any FTM-capable modules with multiple antennas. There is the ESP32-WROOM-DA but it has no FTM feature and I could not find it with any supplier.

PS I wonder what is the accuracy of the chip's ftm timer-counter because c * 1ns ~= 30cm. I've looked at some timer chips for tof applications and they can achieve up to 20ps accuracy.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 279 guests