Skip to content

swthewhite/CartoonTime-Modules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

UWB ๊ธฐ๋ฐ˜ ์–‘๋ฐฉํ–ฅ ๊ฑฐ๋ฆฌ ์ธก์ • ์‹œ์Šคํ…œ

์ด ํ”„๋กœ์ ํŠธ๋Š” Decawave DW1000Ng UWB ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜์—ฌ **์–‘๋ฐฉํ–ฅ ๊ฑฐ๋ฆฌ ์ธก์ •(TWR)**์„ ๊ตฌํ˜„ํ•œ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. ์ด ์‹œ์Šคํ…œ์€ Tag์™€ Anchors(A, B, C)๋กœ ๊ตฌ์„ฑ๋˜๋ฉฐ, ๊ฐ๊ฐ์˜ ์žฅ์น˜๊ฐ€ ํŠน์ • ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•˜์—ฌ ํƒœ๊ทธ์™€ ์•ต์ปค ์‚ฌ์ด์˜ ๊ฑฐ๋ฆฌ๋ฅผ ์ธก์ •ํ•ฉ๋‹ˆ๋‹ค.

์‹œ์Šคํ…œ ๊ตฌ์„ฑ

  1. Tag: ๊ฑฐ๋ฆฌ ์ธก์ •์„ ์‹œ์ž‘ํ•˜๋Š” ์žฅ์น˜์ž…๋‹ˆ๋‹ค. POLL ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†กํ•˜๊ณ , ์•ต์ปค๋กœ๋ถ€ํ„ฐ POLL_ACK๋ฅผ ์ˆ˜์‹ ํ•œ ํ›„ RANGE ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด ๊ฑฐ๋ฆฌ ์ธก์ •์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.
  2. Anchor A, B, C: ํƒœ๊ทธ์˜ POLL ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•˜์—ฌ POLL_ACK ๋ฉ”์‹œ์ง€๋กœ ์‘๋‹ตํ•˜๊ณ , RANGE ๋ฉ”์‹œ์ง€๋ฅผ ํ†ตํ•ด ๊ฑฐ๋ฆฌ ์ •๋ณด๋ฅผ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ์•ต์ปค๋Š” ํƒ€์ž„ ์Šฌ๋กฏ ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜์—ฌ ํŠน์ • ์‹œ๊ฐ„์—๋งŒ ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  • ์–‘๋ฐฉํ–ฅ ๊ฑฐ๋ฆฌ ์ธก์ •: ํƒœ๊ทธ์™€ ์•ต์ปค ์‚ฌ์ด์˜ ์™•๋ณต ์‹œ๊ฐ„์„ ์ด์šฉํ•ด ๊ฑฐ๋ฆฌ๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.
  • ํƒ€์ž„ ์Šฌ๋กฏ ๋ฐฉ์‹: ๊ฐ ์•ต์ปค๊ฐ€ ๊ณ ์œ ํ•œ ํƒ€์ž„ ์Šฌ๋กฏ์—์„œ ๋™์ž‘ํ•˜์—ฌ ๊ฐ„์„ญ์„ ํ”ผํ•ฉ๋‹ˆ๋‹ค.
  • MQTT ํ†ต์‹ : ์•ต์ปค์—์„œ ๊ณ„์‚ฐ๋œ ๊ฑฐ๋ฆฌ๋ฅผ MQTT ๋ธŒ๋กœ์ปค๋กœ ์ „์†กํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Tag์™€ Anchor ๊ฐ„์˜ ์ƒํ˜ธ์ž‘์šฉ

์•„๋ž˜ Sequence Diagram์€ Tag์™€ Anchors ๊ฐ„์˜ ๋ฉ”์‹œ์ง€ ๊ตํ™˜์„ ์‹œ๊ฐ์ ์œผ๋กœ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

sequenceDiagram
    participant Tag
    participant AnchorA
    participant AnchorB
    participant AnchorC

    Tag->>AnchorA: POLL ์ „์†ก
    AnchorA-->>Tag: POLL_ACK ์‘๋‹ต
    Tag->>AnchorA: RANGE ์ „์†ก
    AnchorA-->>Tag: RANGE_REPORT (๊ฑฐ๋ฆฌ ๊ณ„์‚ฐ)

    Tag->>AnchorB: POLL ์ „์†ก
    AnchorB-->>Tag: POLL_ACK ์‘๋‹ต
    Tag->>AnchorB: RANGE ์ „์†ก
    AnchorB-->>Tag: RANGE_REPORT (๊ฑฐ๋ฆฌ ๊ณ„์‚ฐ)

    Tag->>AnchorC: POLL ์ „์†ก
    AnchorC-->>Tag: POLL_ACK ์‘๋‹ต
    Tag->>AnchorC: RANGE ์ „์†ก
    AnchorC-->>Tag: RANGE_REPORT (๊ฑฐ๋ฆฌ ๊ณ„์‚ฐ)
Loading

Sequence Diagram ์„ค๋ช…

  1. Tag์™€ Anchor ๊ฐ„์˜ ์ƒํ˜ธ์ž‘์šฉ:

    • Tag๋Š” POLL ๋ฉ”์‹œ์ง€๋ฅผ ์•ต์ปค์—๊ฒŒ ์ „์†กํ•˜์—ฌ ๊ฑฐ๋ฆฌ ์ธก์ •์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
    • ์•ต์ปค๋Š” POLL_ACK ๋ฉ”์‹œ์ง€๋กœ ์‘๋‹ตํ•˜๊ณ , ์ดํ›„ Tag๋Š” RANGE ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
    • ์•ต์ปค๋Š” RANGE_REPORT ๋ฉ”์‹œ์ง€๋ฅผ ํ†ตํ•ด ๊ณ„์‚ฐ๋œ ๊ฑฐ๋ฆฌ๋ฅผ Tag์—๊ฒŒ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
  2. ํƒ€์ž„ ์Šฌ๋กฏ ๋ฐฉ์‹:

    • AnchorA๋Š” ์ฒซ ๋ฒˆ์งธ ํƒ€์ž„ ์Šฌ๋กฏ(0~200ms) ๋™์•ˆ ๋™์ž‘ํ•˜๋ฉฐ, ์ด ์‹œ๊ฐ„์— Tag์™€ ํ†ต์‹ ํ•ฉ๋‹ˆ๋‹ค.
    • AnchorB๋Š” ๋‘ ๋ฒˆ์งธ ํƒ€์ž„ ์Šฌ๋กฏ(200~400ms) ๋™์•ˆ ๋™์ž‘ํ•˜๋ฉฐ, Tag์™€ ํ†ต์‹ ํ•ฉ๋‹ˆ๋‹ค.
    • AnchorC๋Š” ์„ธ ๋ฒˆ์งธ ํƒ€์ž„ ์Šฌ๋กฏ(400~600ms) ๋™์•ˆ ๋™์ž‘ํ•˜๋ฉฐ, Tag์™€ ํ†ต์‹ ํ•ฉ๋‹ˆ๋‹ค.

ํƒ€์ž„ ์Šฌ๋กฏ ๋ฐฉ์‹

๊ฐ ์•ต์ปค๋Š” ์ผ์ • ์‹œ๊ฐ„ ๊ฐ„๊ฒฉ์œผ๋กœ ๋Œ์•„๊ฐ€๋ฉด์„œ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค. 600ms ์ฃผ๊ธฐ๋กœ 3๊ฐœ์˜ ์•ต์ปค๊ฐ€ ์ˆœ์ฐจ์ ์œผ๋กœ ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.

  • Anchor A: 0~200ms
  • Anchor B: 200~400ms
  • Anchor C: 400~600ms

์ด ๋ฐฉ์‹์€ UWB ์‹œ์Šคํ…œ ๊ฐ„์˜ ์ถฉ๋Œ์„ ๋ฐฉ์ง€ํ•˜๊ณ , ๊ฐ ์•ต์ปค๊ฐ€ ๋…๋ฆฝ์ ์œผ๋กœ ๋™์ž‘ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

Tag์˜ ์—ญํ• 

  1. POLL ๋ฉ”์‹œ์ง€ ์ „์†ก: ๊ฑฐ๋ฆฌ ์ธก์ •์„ ์‹œ์ž‘ํ•˜๊ธฐ ์œ„ํ•ด ์•ต์ปค์—๊ฒŒ POLL ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
  2. POLL_ACK ์ˆ˜์‹ : ์•ต์ปค๋กœ๋ถ€ํ„ฐ ์‘๋‹ต(POLL_ACK)์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.
  3. RANGE ๋ฉ”์‹œ์ง€ ์ „์†ก: ๊ฑฐ๋ฆฌ ๊ณ„์‚ฐ์„ ์œ„ํ•ด RANGE ๋ฉ”์‹œ์ง€๋ฅผ ์•ต์ปค์—๊ฒŒ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
  4. RANGE_REPORT ์ˆ˜์‹ : ์•ต์ปค๋กœ๋ถ€ํ„ฐ ๊ณ„์‚ฐ๋œ ๊ฑฐ๋ฆฌ ๊ฐ’์„ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค.

Anchors์˜ ์—ญํ•  (A, B, C)

  1. POLL ๋ฉ”์‹œ์ง€ ์ˆ˜์‹ : Tag๋กœ๋ถ€ํ„ฐ POLL ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค.
  2. POLL_ACK ์‘๋‹ต: Tag์—๊ฒŒ ์‘๋‹ต ๋ฉ”์‹œ์ง€(POLL_ACK)๋ฅผ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
  3. RANGE ๋ฉ”์‹œ์ง€ ์ˆ˜์‹ : Tag๋กœ๋ถ€ํ„ฐ RANGE ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•˜์—ฌ ๊ฑฐ๋ฆฌ๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.
  4. RANGE_REPORT ์ „์†ก: ๊ณ„์‚ฐ๋œ ๊ฑฐ๋ฆฌ ์ •๋ณด๋ฅผ Tag์—๊ฒŒ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.

์„ค์ • ๋ฐฉ๋ฒ•

  1. WiFi ๋ฐ MQTT ์„ค์ •: ๊ฐ ์•ต์ปค์™€ ํƒœ๊ทธ์˜ moduleConfig.h ํŒŒ์ผ์—์„œ WiFi SSID, ๋น„๋ฐ€๋ฒˆํ˜ธ, MQTT ๋ธŒ๋กœ์ปค ์ •๋ณด๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
  2. ์ฝ”๋“œ ์—…๋กœ๋“œ: ๊ฐ ์žฅ์น˜(ESP32 ๋˜๋Š” ์ง€์›๋˜๋Š” ์žฅ์น˜)์— ์ฝ”๋“œ๋ฅผ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.
  3. ์žฅ์น˜ ์—ฐ๊ฒฐ: ์žฅ์น˜๊ฐ€ WiFi์— ์—ฐ๊ฒฐ๋˜๊ณ , MQTT ๋ธŒ๋กœ์ปค์™€ ์—ฐ๊ฒฐ๋œ ์ƒํƒœ์—์„œ ๊ฑฐ๋ฆฌ ์ธก์ •์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๋ผ์ด์„ ์Šค

์ด ํ”„๋กœ์ ํŠธ๋Š” MIT License์— ๋”ฐ๋ผ ๋ผ์ด์„ ์Šค๊ฐ€ ๋ถ€์—ฌ๋ฉ๋‹ˆ๋‹ค. ์†Œ์Šค ์ฝ”๋“œ๋Š” ์ž์œ ๋กญ๊ฒŒ ์ˆ˜์ • ๋ฐ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

About

๐Ÿ“™CartoonTime's Modules (ESP32)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages