🗂

Bluetooth発信端末からの距離測定方法の勉強

2021/02/06に公開1

他の方の記事をかいつまんで自分なりに編集しただけなので
目新しい情報はないです...

内容

BLE端末との距離の測定方法は観測範囲だと「RSSI値からの計算」と「RSSI値とTxPower値からの計算」の2種類があるみたいですが
RSSI値だけを用いたBluetooth発信端末との距離の測定よりも、もう一つTxPowerを用いた計算方法のほうがもう一つ値をもちいてるのでなんとなく正確性が高いのかなと思ったので
ここではTxPowerとRSSIを用いたBluetooth発信端末との距離測定方法についてまとめていきます

以下この結論に至るまでに参考にした記事とその中で書かれている文章の引用

推定距離を算出せず、RSSIの値をそのまま平均して閾値処理にかけて近接度を判定するという実装もみかけます。RSSIは対数ベースの値だし、あまり適切ではないと思うのですが、どうなんでしょうね。。
https://qiita.com/shu223/items/7c4e87c47eca65724305

ちょっとでも無線をかじったもんなら、受信強度から距離を測る無意味さはわかると思います
受信強度や電界強度は周囲の環境に大きく依存しますんで、ちとムリゲーのようにおもいます。
https://teratail.com/questions/197055

RSSIとTxPowerってなに?

ざっくりいうとどちらも電波強度らしいので何が違うのかちがいがわからない...

RSSI

  • 受信電波強度
  • RSSI値は距離と送信電波強度に依存する
  • 送信側のMaxの電波強度は+4dBmで距離が「40 ~ 50m」の場合RSSI値の範囲は 「-26 ~ -100」になる
  • 受信側と送信側の距離を測定するには受信側のRSSIと送信側の使用しているもう一つの値を利用する
    • つまり距離 = RSSI とanother value defined by the iBeacon standardで算出される?
  • absorption(吸収)/ interference(干渉)/ diffraction(回析)などの外部要因が電波に影響で変動しがちで、受信側と送信側の距離が離れれば離れるほどRSSI値は不安定、不正確になる

以下RSSIについて参考にした記事と引用

RSSI stands for Received Signal Strength Indicator. It is the strength of the beacon’s signal as seen on the receiving device, e.g. a smartphone. The signal strength depends on distance and Broadcasting Power value. At maximum Broadcasting Power (+4 dBm) the RSSI ranges from -26 (a few inches) to -100 (40-50 m distance).

RSSI is used to approximate distance between the device and the beacon using another value defined by the iBeacon standard: Measured Power (see below).

Due to external factors influencing radio waves—such as absorption, interference, or diffraction—RSSI tends to fluctuate. The further away the device is from the beacon, the more unstable the RSSI becomes.

参考: https://iotandelectronics.wordpress.com/2016/10/07/how-to-calculate-distance-from-the-rssi-value-of-the-ble-beacon/

TxPower

  • 冒頭の内容とRSSIについて書いた内容からTxPowerというのがRSSIについて記載のある「another value」に該当すると考えられるのでTxPower = 送信側の持つ電波強度
  • この記事でいうMessured PowerがおそらくTxPowerと呼ばれるもので、送信側電波強度になると思う(以後Measured Powerと書く)
  • 送信側から1m離れたところで測定可能な値で、その地点でおおよそRSSI値がどれくらいであるかを示す
    • 1m離れたところで受信されるRSSIの基準値(おそらく製造段階で設定されているっぽい?あるいは他の記事を見ていると製品専用アプリの方で変更もできるっぽい)
  • RSSIと組み合わせることで、送信側と受信側の距離を測定することができる

Measured Power is a factory-calibrated, read-only constant which indicates what’s the expected RSSI at a distance of 1 meter to the beacon.

Combined with RSSI, it allows to estimate the distance between the device and the beacon.

計算式

計算式は「自遊空間(=障害物のない理想空間)の場合」と「障害物があって電波の受信強度が変わってくる場合」で異なります
これは障害物の有無などで電波の受信強度が変わってくるためです

凡例
- Distance
- Measured Power: -69
- RSSI
  1. -60の場合
  2. -69の場合
  3. -80の場合
- N (Constant depends on the Environmental factor. Range 2-4): 常用対数
  一方で[別の記事](https://qiita.com/shu223/items/7c4e87c47eca65724305)では
    - N = 2.0 : 障害物のない理想空間
    - N < 2.0 : 電波が反射しながら伝搬する空間
    - N > 2.0 : 障害物に吸収され減衰しながら伝搬する空間
 とも書かれているので不確か
  1. 自遊空間(=障害物のない理想空間)の場合の計算式
Distance = 10 ^ ((Measured Power – RSSI)/(10 * 2))
  1. 障害物があって電波の受信強度が変わってくる場合の計算式
Distance = 10 ^ ((Measured Power – RSSI)/(10 * N))

それぞれの計算式の理由については電波の伝わり方: 減衰という記事がわかりやすかったので知りたい人は読んでみるとおもしろいかもしれないです

実際に計算

先程書いた凡例を元にそれぞれのRSSIの値の場合の距離を計算してみます

  1. RSSIが-60の場合
    10 ^ ((-69 – (-60))/(10 * 2)) = 0.35 meter

  2. RSSIが-69の場合
    10 ^ ((-69 – (-69))/(10 * 2)) = 1 meter

  3. RSSIが-80の場合
    10 ^ ((-69 – (-80))/(10 * 2)) = 3.54 meter

正確な距離の計算はむずかしい...

注意してほしいのはこれらの式を使った計算でも算出される値はおおよそのもので正確な値ではないようです
冒頭で参照した記事内でも書かれている通り電波は周囲の環境に大きく依存・影響を受けるので
電波の受信強度から正確な数値を出すことは外的要因(≒電波の減衰要因)を0にしないかぎりむずかしいようです

Obviously, the Distance calculated is the approximated distance and not the exact distance as for calculating exact distance we have to make the loss factor (from environmental factors) zero.

追記(advertising interval)

送信側(ここではビーコン)は絶えず送信しているのではなく、blinkして送信している
Advertisiing Intervalはそのblink間の時間は0.1 ~ 2.0秒。このadvertising Intervalが短ければ短いほどBluetoothの信号は安定している。Advertising Intervalを調整することがバッテリーの寿命に大きく影響する

Beacons do not broadcast constantly. They ‘blink’ instead. Advertising Interval describes the time between each blink.The value ranges between 100 ms and 2000 ms. The shorter the interval, the more stable the signal. Keep in mind that adjusting Advertising Interval will impact battery life in a big way

参照記事一覧

https://iotandelectronics.wordpress.com/2016/10/07/how-to-calculate-distance-from-the-rssi-value-of-the-ble-beacon/
https://qiita.com/shu223/items/7c4e87c47eca65724305
https://techweb.rohm.co.jp/iot/knowledge/iot01/s-iot01/01-s-iot01/1582
https://teratail.com/questions/197055

Discussion