From 371d1ec65d2ddd280086e661fb80c16ecf63573d Mon Sep 17 00:00:00 2001 From: whowechina Date: Thu, 7 Nov 2024 07:14:30 +0800 Subject: [PATCH] Dual sensor mode optimization and doc --- Production/Firmware/geki_pico.uf2 | Bin 192000 -> 192000 bytes README.md | 9 ++++++++- README_CN.md | 9 ++++++++- firmware/src/airkey.c | 12 +++++++++--- firmware/src/commands.c | 3 +-- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Production/Firmware/geki_pico.uf2 b/Production/Firmware/geki_pico.uf2 index 99308a5a03771dfc86ac5a8c22f3904c6ed1b3b1..8c63a5a7ff951162c628f1ffff453b5a2863b550 100644 GIT binary patch delta 17742 zcmch8dstOv+V}G;HVDYpB@304x;CHzqM@P@ks;ucQ;Ld&N`%TNnJJm+wn)gxm~zZo z=!0O5IZlIz3{So0Xp!UFc&gc?)1X;{reX)1HI0+VM)>Y~KYQ=B)_m_=^Ih*BpVxJ> z*1Fg4_q*@=IjqC8w$+#VR$uDd+$s3UW2u-q_CSwNNUJhozl9LlKAFhfE2&6`MMiV& zi?ELd|0<>gWCdvDPBMiM|C^*8Tn^*}Eg zBJQt?^bykB`vp9FYG0ne^)XYpe?vVWnV4x?t3z^RTDprsUP@18hE3N*hp+}E0I+j{Ze(( zVAUEJMz5>)1WxzO?zRH#`M@DF&pUl>$)t}~>C9DrpGKk%%%`s7^-e1LX>r|8m**(X zG%0OP`pii;Lo+8|Y4sVEaw$mb=M2=2I4xSkT{%yNpzWPDvM6R~mPLC)y%`u5{>ELa zw)yVhEUPx8Yw*J(%R?U}0U1N~RVOrS15X!=#KE$n^us#Oc`a$)`@;L8eD}9z71?v zIw6UNe%ai6yP`KV%TIf>vwyoqOX?=jRMWbN_MDSw*Fbl6&t-SBZH0=7EiFAz%kA~m zs=Be02HhpG-#Fx`#}zyp21l11<(W?^77}ZxiDojvJyT0ie-QJ(T4qIgIM%L>$n zI*BYEI}AyPheC<4JIwB@k=_GA)=WwtQK$F2mp-Jv(C@j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mn#2Pq8K^}FTP(nsc`*iF zjQ(P=yrG;v)Icvr*b<<7^0qwAVUHVNOAuD#Ra@#QBiVo|k#=-yk_Z{k4UxclctS~>6M75s=zWErcZN4-&)c@_5JDm+}~Raxz+ zJH;SUChf@o2!0gMgHn2#N{{A`B%eK42|r+;7VaKVFWp z`u@py=(mfE`x$KK8vMyy?#&w}Pa3a2&5(FGmbX@bG4on1doB9c34V*p>8gRg4q@v> z*hmf=X@IRq*ak1`HBTp|8&De%^@bb8T(9F)c>{eLy-X-0lLyE&P&XoMlL*V=uq*>? z6T%!KEStl!4KN47ws>Ki;a<80e+XVf#hcBo3QofbBYy9NTnDg>gXlZtWkMNKdEluA>LG+37GTVL7y}?p!M^}>#M%9vq5eTt|WH;TDF!!l~ncihW_GG_7sGY!<^2sK6UUc0&gE8!Rp}wu@MZu8YBLDO^F6{dgk$?F+k$1up`TbvroN=4Tqkbi_?>&C}FD@bvZy|Cm z*a%p{4SPW3(-M`BQTWChmQBsDZ-(ViE7 * To emulate IO4 TEST/SERVICE/COIN, you can put your hand in SHIFT zone. When you see the WAD lights flashing, the AUX buttons become TEST and SERVICE, and swinging the lever for "INSERT COINS". * AIME is on a secondary COM port. You can set mode or toggle virtual AIC function. +* ToF mixing algorithms in dual sensor each side configuration. + * `primary` and `secondary`: always use primary or secondary sensor, fallback to the other one if the chosen one has no reading, `strict` option means no fallback. + * `max` and `min`: use the larger or smaller reading of the two sensors, `strict` option means if one sensor has no reading, result will be no reading. + * `average`: use the average of the two sensors, `window` option means readings from both sensors must be within a certain range, otherwise result will be no reading. `window` set to 0 means no range check. +* You can set trigger window for left WAD, right WAD and shift by `tof trigger ...` command. The window is in millimeters. In is the window to trigger, out is the window to release. +* You can use `tof diagnose [on|off]` command to toggle diagnose mode. In diagnose mode, the ToF sensor will continuously print the raw distance data from all sensors. It's useful for diagnostics. ## CAD Source File I'm using OnShape free subscription. It's powerful but it can't archive original designs to local, so I can only share the link here. STL/DXF/DWG files are exported from this online document. diff --git a/README_CN.md b/README_CN.md index 68f867b..1f7fbf1 100644 --- a/README_CN.md +++ b/README_CN.md @@ -158,7 +158,8 @@ https://discord.gg/M8f2PPQFEA * 步骤 1. 用 M3\*8mm 螺丝把摇杆总成固定到底部。 - 2. 把 ToF 传感器焊接到主 PCB 上,每个需要 4 根线。 + 2. 把 ToF 传感器焊接到主 PCB 上,每个需要 4 根线。 + 如果你用的是旧版本 PCB,它很可能只支持每边一个传感器,这时候你需要手动接线。`次 ToF` 使用和 `主 ToF` 使用相同的 SDA, SCL 和 GND 引脚,但 VCC 引脚需要直接从 Pico 上去接,右边的 `次 ToF` 的 VCC 接 GP7,左边的 `次 ToF` 的 VCC 接 GP9。 3. 用 VHB 胶带把 ToF 传感器固定到底部的两侧座位上。 4. 把扬声器焊接到主 PCB 上,每个需要 2 根线。 5. 用 VHB 胶带把扬声器固定到底部的地板上。 @@ -190,6 +191,12 @@ https://discord.gg/M8f2PPQFEA * 为了模拟 IO4 的 TEST/SERVICE/COIN 这些按钮和功能,你可以把手放到 SHIFT 区域,当你看到控制器两侧指示灯闪烁的时候,两个辅助按钮就变为了 TEST 和 SERVICE,摇动摇杆则是“投币”。 * AIME 在第二个串口端口,你可以设置工作模式或者开关虚拟 AIC 功能。 +* 每边两个 ToF 情况下的混合算法。 + * `primary` 和 `secondary`: 总是使用主 ToF 或者次 ToF,如果选择的那个没有读数,就会使用另一个,`strict` 选项表示即使没有读数也不允许使用另一个。 + * `max` 和 `min`: 使用两个传感器中的较大或较小读数,`strict` 选项表示如果一个传感器没有读数,结果将是没有读数。 + * `average`: 使用两个传感器的平均值,`window` 选项表示两个传感器的读数必须在一定范围内,否则结果将是没有读数。当 `window` 为 0 表示不比对范围。 +* 你可以使用 `tof trigger ...` 命令来设置左右 ToF 和 SHIFT 的触发窗口。窗口单位是毫米。In 是触发窗口,Out 是释放窗口。 +* 你可以使用 `tof diagnose [on|off]` 命令来切换诊断模式。在诊断模式下,ToF 传感器将持续打印所有传感器的原始距离数据。方便调试。 ## CAD Source File 我使用的是 OnShape 的免费订阅。它很强大,但是它不能将原始设计存档到本地,所以我只能在这里分享链接。STL/DXF/DWG 文件是从这个在线文档导出的。 diff --git a/firmware/src/airkey.c b/firmware/src/airkey.c index 2944f67..f023dad 100644 --- a/firmware/src/airkey.c +++ b/firmware/src/airkey.c @@ -91,6 +91,11 @@ static uint16_t tof_mix[2]; static void tof_read() { for (int i = 0; i < TOF_NUM; i++) { + if (!tofs[i].init_ok) { + tof_dist[i] = 0; + continue; + } + if (tofs[i].model == TOF_VL53L0X) { vl53l0x_use(i); tof_dist[i] = readRangeContinuousMillimeters(); @@ -107,16 +112,17 @@ static void tof_read() static uint16_t mix_dist(airkey_side_t side, uint16_t primary, uint16_t secondary) { tof_mix_algo_t algo = geki_cfg->tof.mix[side].algo; + bool strict = geki_cfg->tof.mix[side].strict; if (algo == MIX_PRIMARY) { - return primary; + return (strict || (primary != 0)) ? primary : secondary; } if (algo == MIX_SECONDARY) { - return secondary; + return (strict || (secondary != 0)) ? secondary : primary; } - if (geki_cfg->tof.mix[side].strict && (primary == 0 || secondary == 0)) { + if (strict && (primary == 0 || secondary == 0)) { return 0; } diff --git a/firmware/src/commands.c b/firmware/src/commands.c index 9f462f6..f41ec2e 100644 --- a/firmware/src/commands.c +++ b/firmware/src/commands.c @@ -410,8 +410,7 @@ static bool handle_tof_diag(int argc, char *argv[]) static void handle_tof(int argc, char *argv[]) { const char *usage = "Usage: tof roi <4..16>\n" - " tof \n" - " tof [strict]\n" + " tof [strict]\n" " tof [window]\n" " tof trigger [ [out_high]]\n" " tof diagnose [on|off]\n"