From 46ce870879da0e1b13ba3ca7c23dd55b40feed94 Mon Sep 17 00:00:00 2001 From: Jeff Chang <kaichieh121@gmail.com> Date: Thu, 2 Dec 2021 13:12:07 -0600 Subject: [PATCH] pushing last notebook update --- .DS_Store | Bin 8196 -> 8196 bytes code/.DS_Store | Bin 6148 -> 8196 bytes demo/.DS_Store | Bin 6148 -> 6148 bytes demo/demo_video/.DS_Store | Bin 8196 -> 8196 bytes notebooks/.DS_Store | Bin 6148 -> 6148 bytes notebooks/Jeff Chang/.DS_Store | Bin 10244 -> 10244 bytes notebooks/Jeff Chang/notebook_kcchang3.md | 39 ++++++++++++++++++++++ 7 files changed, 39 insertions(+) diff --git a/.DS_Store b/.DS_Store index 895af9e669b27dce9939844f3376be7cf9064787..76ad7ebf555cc17fd78ead806c0ba074f489e5f7 100644 GIT binary patch delta 102 zcmZp1XmQwZL4d=+$U;ZK*wk|JFG1(Y(t<&ZCnx6#HgHQ+R~wla=qMOjngL~G8D~zG p5Rzw{wb??5m6;u)$87RXL8r}aqK!<O*(AQROr9uUk0w*k1OPKk9;^TW delta 102 zcmZp1XmQwZL4d==$XG|g*uY@&PeIwqUj-^AdkeIp3#u))5n@IcRN34r+Q_t-UE&+d M<Ou=}*re;20F7E8iU0rr diff --git a/code/.DS_Store b/code/.DS_Store index 89fe58b0c01df38375acda570a02748dddc405cc..f189e0956d763e52fdcca85f4c49d792b64bd956 100644 GIT binary patch delta 419 zcmZoMXmOBWU|?W$DortDU;r^WfEYvza8E20o2aMA$iFdQH}hr%jz7$c**Q2SHn1@A zPv&8X4`gTXVMt|2VF&?|#SA5$Ir+&+Ir&K-tqcrI=|EcVKNtX63=EtM0SwLzP7KBj z@jxA}48aT`XgaP=p1`6qxq;;fhk=oWj)JkN<zye$)Ov2HMyNGF?an}py-_tYI0CJh zhh!ZOhAwx8NQNK=e>8pT(ez>1767!&mB9s78>1|mHg=$Y0vJ58hXrFdvg*z2ShE;6 pd+{7$=91tBO1Of8db1$Mcjn3bBA%1|c{n&2A+f-)Ii6<@GXNv-X1f3Y delta 123 zcmZp1XfcprU|?W$DortDU=RQ@Ie-{Mvv5r;6q~50$jG@dU^g=(=VTs%_{skTL?=HG zI5K&Qu;=8rf-0LI3#BtoEPlV3or6P=8K?;e1h|2OD@gyw!tczJ`DHvorZF%<Oa@uT KusNP*4l@9M-x-tu diff --git a/demo/.DS_Store b/demo/.DS_Store index 24c1aed27847285c5858a860124767fa33122e08..dd6663f061fc2e61b828dfa7c6fdc0f01a4ede21 100644 GIT binary patch delta 70 zcmZoMXffC@m4)%d<Y_Do8sgQ}7REXXMi!>EItta6<|aA{rsgKKwVWK{s)n|n3AvS3 a)it$sGbTH*$}`T~oWQ!AX)`Owe|`W1<`wS% delta 48 zcmZoMXffC@m4)%t<Y_DoJd)Mbh9*YFIts=H29p(7Wf^BpwquoNoV_`Ybve^!c8<UN E0B}bRd;kCd diff --git a/demo/demo_video/.DS_Store b/demo/demo_video/.DS_Store index e0540ae4579d384993a566df48be74f82de1481a..be132b76ff140724b1a8ff824956e761c68e54a8 100644 GIT binary patch delta 29 hcmZp1XmQxEQ-HOXfq_wC^F9H77S`Wj<|Pp$ZUBZ+2rvKu delta 29 hcmZp1XmQxEQ-HObfq}7Z^F9H77S^9&<|Pp$ZUB!x2>1X1 diff --git a/notebooks/.DS_Store b/notebooks/.DS_Store index b05c131501c604a394d1520ca03692f92c79626a..70bcdd38a770865a6c2c749adde2a1fe2930e657 100644 GIT binary patch delta 55 zcmZoMXffFEf`!At$U;ZK*vw$EBb)4GUe*<plUZ7!f~J;GL6yx-Y%PqN**X650|2kx B4=exx delta 33 pcmZoMXffFEf`#40$XG|g*kJN|mSdAS+0SlnW@};G%*OGL9{|Kw3!eZ0 diff --git a/notebooks/Jeff Chang/.DS_Store b/notebooks/Jeff Chang/.DS_Store index 706d3d188230431f476be8e37565e40e5d66e9a6..b042cc39dd3c8dc786dc12ea715745a872a66285 100644 GIT binary patch delta 29 kcmZn(XbITBEX849WTB&AY-TWdzJ%;#Z()_qK2ke)0et)jR{#J2 delta 29 kcmZn(XbITBEX84BVWy*CYG^WfzJ%;#Z()_qK2ke)0e!CsU;qFB diff --git a/notebooks/Jeff Chang/notebook_kcchang3.md b/notebooks/Jeff Chang/notebook_kcchang3.md index 1842e7e..1d2e08b 100644 --- a/notebooks/Jeff Chang/notebook_kcchang3.md +++ b/notebooks/Jeff Chang/notebook_kcchang3.md @@ -535,3 +535,42 @@ if(a1[0]>=220){ continue; } ``` + +## Dec 2nd, 2021 (Acceleration, Backup Code, Verification) +### Acceleration +We added a final section to strengthen the end-of-movement detection algorithm. This code basically book keeps which direction we are going, and doesn't allow velocity to go in the opposite direction in a certain period of time. Specifically, we use old_mouseX and old_mouseY to store the previous direction, and set the mouse direction to be zero when we see a jump of sign. +``` +if ((mouse[4] > 0 && old_mouseX < 0) || (mouse[4] < 0 && old_mouseX > 0)) { + mouse[4] = 0; +} +else { + old_mouseX = mouse[4]; +} +if ((mouse[5] > 0 && old_mouseY < 0) || (mouse[5] < 0 && old_mouseY > 0)) { + mouse[5] = 0; +} +else { + old_mouseY = mouse[5]; +} +``` +### Backup Code +In our testing, we realized it might be more stable to use components of gravitational acceleration for calculating position update. If we tilt our hand to the right, we will see the gravitational acceleration component in the y direction. Using these values, we can simply add a counter and continuously send position update in that position just like how we wrote the code for volume control. In the code below, you can see we set a threshold to see if the hand is tilted enough, then just continuously send a +5 or -5 position update to the PC using mouse[4] and mouse[5], until that tilt in the device goes below 50. Since our usual implementation is prone to hand instability, we plan on flashing this version during demo as well. +``` +if(abs(a1[1])>=50) { + mouse[4] = 5*(a1[1]/abs(a1[1])); +} +else { + mouse[4] = 0; +} +if(abs(a1[0])>=50) { + mouse[5] = -5*(a1[0]/abs(a1[0])); +} +else { + mouse[5] = 0; +} +``` +### Verification +After all the code implementation, I conducted the verification for most subsystems. All the data are collected in the file "data445.xlsx" and will be presented in the presentation, so I will not copy them here again. I took videos of all the testing and that information has been pushed under "[demo/demo_videos](https://gitlab.engr.illinois.edu/zy8/ece445-lab-notebook/-/tree/develop/demo/demo_video)" + +# This marks the end of the project. + -- GitLab