Skip to content

๐Ÿ† A prosthetic hand control project using OpenBCI and Arduino - PKNU International Capstone Design Contest 2021 Grand Prize

Notifications You must be signed in to change notification settings

Jo-dv/Capstone2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

67 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Capstone2021

๋ณธ repository๋Š” 21๋…„๋„ ๋ถ€๊ฒฝ๋Œ€ํ•™๊ต ์ปดํ“จํ„ฐ๊ณตํ•™๊ณผ ์กธ์—… ํ”„๋กœ์ ํŠธ ์†Œ์Šค ์ฝ”๋“œ ์ €์žฅ ๋ชฉ์ ์œผ๋กœ 21๋…„ 11์›” 15์ผ ์ฒ˜์Œ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

23๋…„ 4์›” 26์ผ ๋งํฌ ํ™•์ธ ๋ฐ ์ž‘์„ฑ ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

ํ”„๋กœ์ ํŠธ ๋‚ด์šฉ

OpenBCI๋ฅผ ์ด์šฉํ•œ ์ด์šฉํ•œ ์˜์ˆ˜ ์ œ์–ด

  • ํ•ด๋‹น ํ”„๋กœ์ ํŠธ๋Š” ์ƒ์ฒด์‹ ํ˜ธ ๊ฐ์ง€ ํ”Œ๋žซํผ์ธ OpenBCI๋ฅผ ์ด์šฉํ•˜์—ฌ ๋‡ŒํŒŒ(EEG) ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ ๋ฐ ๋ถ„์„ํ•˜์—ฌ ์ง‘์ค‘ ์—ฌ๋ถ€๋ฅผ ๊ตฌ๋ถ„ํ•ด ์˜์ˆ˜์˜ ์›€์ง์ž„์„ ์ œ์–ดํ•˜๋Š” ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค.

์ง„ํ–‰ ๊ธฐ๊ฐ„

  • 2021.03.04 ~ 2021.06.03 - 1ํ•™๊ธฐ
  • 2021.09.02 ~ 2021.12.02 - 2ํ•™๊ธฐ

์ฐธ์—ฌ ์ธ์›

1ํ•™๊ธฐ

  • ๊น€*๊ธˆ - ์ž๋ฃŒ ์กฐ์‚ฌ ๋ฐ ๋ฐœํ‘œ
  • ์กฐ*์žฌ - ์„œ๋ฅ˜ ์ฒ˜๋ฆฌ, ์˜์ˆ˜ ์ œ์ž‘ ๋ฐ ์ฝ”๋“œ ๊ตฌํ˜„

2ํ•™๊ธฐ

  • ๊น€*๊ธˆ - ์ž๋ฃŒ ์กฐ์‚ฌ ๋ฐ ๋ฐœํ‘œ
  • ์ด*ํ˜• - ์„œ๋ฅ˜ ์ฒ˜๋ฆฌ
  • ์กฐ*์žฌ - ์œ ์ง€๋ณด์ˆ˜

๊ฐœ๋ฐœ ๋ฐ ๊ตฌํ˜„ ํ™˜๊ฒฝ

Software

Hardware

Material

์ง„ํ–‰ ๋‚ด์šฉ

1ํ•™๊ธฐ

  • WiFi Shield๋ฅผ ์ด์šฉํ•œ Ganglion Board ์ž‘๋™ ํ…Œ์ŠคํŠธ
  • ์˜์ˆ˜ ์ œ์ž‘
  • OpenBCI์™€ Arduino(์˜์ˆ˜) ์—ฐ๊ฒฐ
    • GUI์˜ Networking Widget๊ณผ Focusing Widget ์‚ฌ์šฉ

2ํ•™๊ธฐ

  • Motor Imagery๋ฅผ ์ด์šฉํ•œ ์ œ์–ด๋ฅผ ์œ„ํ•ด Cyton Board๋กœ ๊ต์ฒด
    • Motoar Iamgery ์‹คํ—˜
      • ์‹คํ—˜ ์‹คํŒจ๋กœ GUI๋ฅผ ์ด์šฉํ•˜์—ฌ ๋…ผ๋ฌธ ์ง„ํ–‰
  • ๊ฒฝ์ง„๋Œ€ํšŒ ์ฐธ์—ฌ์šฉ ์ฝ”๋“œ ๊ตฌํ˜„

ํŠธ๋Ÿฌ๋ธ” ์ŠˆํŒ…

OpenBCI USB Dongle ์ธ์‹ ๋ฌธ์ œ
  • ๊ด€๋ จ ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์•„์„œ ๋ฐœ์ƒํ•œ ๋ฌธ์ œ
  • ๋“œ๋ผ์ด๋ฒ„(D2XX Driver)๋ฅผ ์„ค์น˜ํ•ด ์คŒ์œผ๋กœ์จ ํ•ด๊ฒฐ
Focus ์‹คํ—˜ ๋ฌธ์ œ
  • 1ํ•™๊ธฐ ์‹คํ—˜ ๋‹น์‹œ Focus Widget์€ High beta and low alpha, ์ฆ‰ Meditation ํ˜•ํƒœ์˜ ์ง‘์ค‘ ์ƒํƒœ๋ฅผ ์ธก์ •ํ•˜๋Š” Widget

    Reading the paragraph again, the โ€œresearchโ€ that led to the conclusion โ€œhigh alpha low betaโ€, was actually referring to the small tests we did using OpenBCI, when Jordanโ€™s performing meditation, and when other users are trying to โ€œfocusโ€ during our spring exhibition.

    For the exact values โ€œ0.7-2.0uvโ€ or โ€œ0.0-0.7uvโ€, they were also actually referring to this โ€œhigh alpha low betaโ€ pattern. Thatโ€™s why later versions of the focus widget would have tweak-able thresholds compared to set values.

    The word โ€œfocusโ€ was a generic term. While the original data was derived from my classmate Jordanโ€™s brainwave when heโ€™s doing โ€œmeditationโ€, it also mostly worked when I told users to โ€œfocusโ€. I would suggest โ€œfocus of visual attentionโ€ or โ€œmeditationโ€ as more accurate to describe the desired โ€œfocusedโ€ state.

    https://openbci.com/forum/index.php?p=/discussion/2418/gui-focus-widget-algorithm-question

    • ํ•ด๋‹น ์‚ฌ์‹ค์„ ๋ชจ๋ฅด๊ณ  Concentraion์— ๋งž์ถฐ ์‹คํ—˜์„ ์ง„ํ–‰ํ•˜์˜€๊ธฐ์— ์ œ์–ดํ•˜๋Š” ๋ฐ ์–ด๋ ค์›€์ด ๋ฐœ์ƒ
  • 2ํ•™๊ธฐ ์‹œ์ , ์—…๋ฐ์ดํŠธ๋œ GUI๋Š” Meditation๊ณผ Concentraion์„ ๋ชจ๋‘ ์ง€์›ํ•˜์˜€๊ธฐ์— ์ด๋ฅผ ์ธ์ง€ํ•˜๊ณ  ์‹คํ—˜์„ ์ง„ํ–‰ํ•จ์œผ๋กœ์จ ํ•ด๊ฒฐ

    Choose from "Relaxation" or "Concentration" as the desired flavor of Focus to detect.

    "Relaxation" generally looks at FFT values associated with Delta, Theta and Alpha brainwaves, while "Concentration" looks at Beta and Gamma brainwaves.

    Relaxation is usually achieved by "meditating" with eyes closed, while Concentration can be achieved by focusing intently with eyes open.

    https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#focus-widget

GUI ์—…๋ฐ์ดํŠธ ์ดํ›„ Arduino ๋น„์ž‘๋™ ๋ฌธ์ œ
  • Serial ํ”„๋กœํ† ์ฝœ์„ ์ด์šฉํ•œ Focus ๋ฐ์ดํ„ฐ ๋ณ€๊ฒฝ์œผ๋กœ ์ธํ•ด ๋ฐœ์ƒํ•œ ๋ฌธ์ œ
    • Networking Data Format ๋ณ€๊ฒฝ ์ „ํ›„
      ๋ณ€๊ฒฝ ์ „ ๋ณ€๊ฒฝ ํ›„
      "true\n" "1\n"
      "false\n" "0\n"
  • ์ˆ˜์‹ ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ๋น„๊ตํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ๋ณ€๊ฒฝ๋œ Format์— ๋งž์ถฐ ๋ณ€๊ฒฝํ•ด ์คŒ์œผ๋กœ์จ ํ•ด๊ฒฐ
    • ๋ณ€๊ฒฝ ์ „
      if (s.equals("false")) {
        \\Code
      }
      else if (s.equals("true")) { 
        \\Code
      }
      
    • ๋ณ€๊ฒฝ ํ›„
      if (s.equals("1")) {
        \\Code
      }
      else if (s.equals("0")) { 
        \\Code
      }
      
Motor imagery ์ ์šฉ ๋ฌธ์ œ
  1. NeuroPype Motor Imagery ํŒŒ์ดํ”„๋ผ์ธ ์‹คํ–‰ ์‹œ ์—๋Ÿฌ ๋ฐœ์ƒ
    • ์—๋Ÿฌ ๋‚ด์šฉ
      ERROR: The following error occurred in node Common Spatial Patterns: the leading minor of order 1 of 'b' is not positive definite. The factorization of 'b' could not be completed and no eigenvalues or eigenvectors were computed.  
      ERROR: CSP must be trained before it can be used
      ERROR: CSP must be trained before it can be used
      ERROR: CSP must be trained before it can be used
      ...
      ERROR: CSP must be trained before it can be used
      
    • ํ•ด๊ฒฐ
      • ํ•ด๋‹น ๋ฌธ์ œ์— ๋Œ€ํ•ด NeuroPype์— ๋ฌธ์˜ ํ›„, ํ•™์Šต ๋ฐ์ดํ„ฐ๊ฐ€ ๋ถ€์กฑ ํ˜น์€ EEG ์ฑ„๋„ ๊ฐ„ ๋‹จ๋ฝ์œผ๋กœ ๋ฐœ์ƒํ•˜๋Š” ๋ฌธ์ œ๋กœ ๋ณด์ธ๋‹ค๋Š” ๋‹ต๋ณ€ ์ˆ˜์‹ 
      • ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ์‹œ ์‹œ๋„ ํšŸ์ˆ˜ ๋ณ€๊ฒฝ: 120ํšŒ $\rightarrow$ 360ํšŒ
  2. ์—๋Ÿฌ ํ•ด๊ฒฐ ํ›„ ์ €์กฐํ•œ ์„ฑ๋Šฅ ๋ฌธ์ œ ๋ฐœ์ƒ
    • 5๋ฒˆ์˜ ์‹คํ—˜ ๋™์•ˆ ํ‰๊ท  ์•ฝ 46.2%์˜ Loss(MisClassification Rate) ํš๋“
      • ์ƒ์ƒํ•˜๋Š” ๋ฐฉ์‹์— ๋Œ€ํ•œ ์˜๋ฌธ ๋ฐœ์ƒ
    • ํ•ด๊ฒฐ
      • ์‚ฌ์šฉํ•˜์ง€ ์•Š์€ ์ฑ„๋„์„ ๋น„ํ™œ์„ฑํ™”ํ•˜์—ฌ ๋…ธ์ด์ฆˆ๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ๊ธฐ์กด CSP ์•Œ๊ณ ๋ฆฌ์ฆ˜์—์„œ FBCSP ์•Œ๊ณ ๋ฆฌ์ฆ˜์œผ๋กœ ๋ณ€๊ฒฝํ•˜์—ฌ ํ•™์Šต ์‹œ ๋ณด๋‹ค ๋งŽ์€ ํŒŒ๋ผ๋ฏธํ„ฐ ์ƒ์„ฑ
        • ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ์‹œ ์‹œ๋„ ํšŸ์ˆ˜ ๋ณ€๊ฒฝ: 360ํšŒ $\rightarrow$ 120ํšŒ
          • ์‹คํ—˜ ์‹œ๊ฐ„ ๋‹จ์ถ•
        • Loss 0.067 ํš๋“
  3. ์ƒ์ƒ์— ๋Œ€ํ•œ ๋ถˆํ™•์‹ค์„ฑ ๋ฌธ์ œ
    • ์›€์ง์ž„์„ ์ƒ์ƒํ•˜๋Š” ๊ฒƒ ๋Œ€์‹  ๋ˆˆ ๊นœ๋นก์ž„์ด๋‚˜ ์ด๋ฅผ ๊ฝ‰ ๋‹ค๋ฌด๋Š” ํ–‰์œ„๋ฅผ ํ•จ์œผ๋กœ์จ ๋ฐœ์ƒํ•˜๋Š” ๋…ธ์ด์ฆˆ๋ฅผ ํ•™์Šต์‹œ์ผœ ๊ฐ๊ฐ 0.01, 0.06์˜ Loss ํš๋“
    • ๊ฒฐ๋ก 
      • ๋ฏธ์ˆ™ํ•œ ์›€์ง์ž„ ์ƒ์ƒ์œผ๋กœ ์ธํ•ด ๋ฐœ์ƒํ•˜๋Š” ์ŠคํŒŒ์ดํฌ ๋ฏธ๋ฏธํ•˜์—ฌ 1๋ฒˆ ๋ฐ 2๋ฒˆ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒƒ์œผ๋กœ ์ถ”์ •
      • ์ดํ›„ ์‹คํ—˜๋“ค์—์„œ 2๋ฒˆ๋งŒํผ์˜ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค์ง€ ์•Š์•„์„œ ์‹œ๊ฐ„ ๊ด€๊ณ„์ƒ Motor Imagery ์‹คํ—˜ ์ค‘๋‹จ

๊ฒฐ๊ณผ๋ฌผ

๋™์ž‘ ๋ชจ์Šต

์™„์„ฑํ’ˆ

using GUI

  • ์ง‘์ค‘(Concentration) ์ƒํƒœ

using python

  • ์˜ต์…˜ ์ž…๋ ฅ ๋ฐ ์‹คํ–‰

  • ์ŠคํŠธ๋ฆผ ์‹คํ–‰ ๋ฐ ์ข…๋ฃŒ

์„ฑ๊ณผ

2021 ๊ต๋‚ด ๊ตญ์ œ ์บก์Šคํ†ค๋””์ž์ธ ๊ฒฝ์ง„๋Œ€ํšŒ ๋Œ€์ƒ

About

๐Ÿ† A prosthetic hand control project using OpenBCI and Arduino - PKNU International Capstone Design Contest 2021 Grand Prize

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published