diff options
| -rw-r--r-- | api_layers/firmware/esp32_stringPot/esp32_stringPot.ino | 38 | ||||
| -rw-r--r-- | logs/daq_20260421_131953.csv | 366 | ||||
| -rw-r--r-- | plugins/enabled.json | 3 |
3 files changed, 21 insertions, 386 deletions
diff --git a/api_layers/firmware/esp32_stringPot/esp32_stringPot.ino b/api_layers/firmware/esp32_stringPot/esp32_stringPot.ino index 63d4349..236f728 100644 --- a/api_layers/firmware/esp32_stringPot/esp32_stringPot.ino +++ b/api_layers/firmware/esp32_stringPot/esp32_stringPot.ino @@ -36,13 +36,26 @@ */ #include <EEPROM.h> +// EEPROM-persisted configuration +#define EEPROM_SIZE 64 +#define EEPROM_MAGIC 0xC1 + const int sensorPin = A0; const unsigned long sampleInterval = 2000; unsigned long lastSampleTime = 0; -// EEPROM-persisted configuration -#define EEPROM_SIZE 64 -#define EEPROM_MAGIC 0xC1 +// Calibration (mirrors cfg, kept as separate globals for fast access in loop()) +float calibration_factor = 1.0; +float calibration_offset = 0.0; + +// 2nd-order Butterworth low-pass (biquad, direct form II transposed) +const float butterworth_sampleHz = 1000000.0 / sampleInterval; +float butter_b0, butter_b1, butter_b2, butter_a1, butter_a2; +float butter_z1 = 0.0, butter_z2 = 0.0; + +String serialLine; +bool streamingEnabled = true; +bool calibPointSet[2] = {false, false}; struct StoredConfig { uint8_t magic; @@ -58,19 +71,6 @@ StoredConfig cfg = { 0.5 }; -// Calibration (mirrors cfg, kept as separate globals for fast access in loop()) -float calibration_factor = 1.0; -float calibration_offset = 0.0; - -// 2nd-order Butterworth low-pass (biquad, direct form II transposed) -const float butterworth_sampleHz = 1000000.0 / sampleInterval; -float butter_b0, butter_b1, butter_b2, butter_a1, butter_a2; -float butter_z1 = 0.0, butter_z2 = 0.0; - -String serialLine; -bool streamingEnabled = true; -bool calibPointSet[2] = {false, false}; - void setup() { Serial.begin(115200); @@ -93,8 +93,11 @@ void loop() { lastSampleTime = currentTime; float filtered_displacement = butterworthLowPass(readCalibratedPosition()); + float raw_displacement = readCalibratedPosition(); if (streamingEnabled) { - Serial.println(filtered_displacement, 2); + Serial.print(filtered_displacement, 2); + Serial.print(", "); + Serial.println(raw_displacement, 2); } } @@ -231,6 +234,7 @@ void printConfig() { Serial.println(calibration_offset, 6); Serial.print("Butterworth cutoff (Hz):\t"); Serial.println(cfg.butterworth_cutoffHz, 3); + interruptibleDelay(10000); } void printHelp() { diff --git a/logs/daq_20260421_131953.csv b/logs/daq_20260421_131953.csv deleted file mode 100644 index e856dac..0000000 --- a/logs/daq_20260421_131953.csv +++ /dev/null @@ -1,366 +0,0 @@ -elapsed_s,dio_0/di0[],dio_0/do0[],dio_0/do1[],dio_0/do2[],dio_0/do3[],ai_0/A0[V]
-21.7493,,,,,,0.00000
-21.8494,,,,,,0.00000
-21.9498,,,,,,0.00000
-22.0500,,,,,,0.00000
-22.1503,,,,,,0.00000
-22.2506,,,,,,0.00000
-22.3509,,,,,,0.00000
-22.4512,,,,,,0.00000
-22.5516,,,,,,0.00000
-22.6519,,,,,,0.00000
-22.7521,,,,,,0.00000
-22.8524,,,,,,0.00000
-22.9527,,,,,,0.00000
-23.0529,,,,,,0.00000
-23.1532,,,,,,0.00000
-23.2534,,,,,,0.00000
-23.3537,,,,,,0.00000
-23.4540,,,,,,0.00000
-23.5541,,,,,,0.00000
-23.6545,,,,,,0.00000
-23.7548,,,,,,0.00000
-23.8551,,,,,,0.00000
-23.9555,,,,,,0.07000
-24.0558,,,,,,0.30000
-24.1561,,,,,,0.51000
-24.2563,,,,,,0.64000
-24.3566,,,,,,0.78000
-24.4570,,,,,,0.95000
-24.5573,,,,,,1.15000
-24.6576,,,,,,1.30000
-24.7580,,,,,,1.56000
-24.8581,,,,,,1.62000
-24.9585,,,,,,1.64000
-25.0588,,,,,,1.95000
-25.1592,,,,,,2.05000
-25.2592,,,,,,2.14000
-25.3595,,,,,,2.29000
-25.4596,,,,,,2.52000
-25.5599,,,,,,2.69000
-25.6601,,,,,,2.86000
-25.7601,,,,,,3.07000
-25.8602,,,,,,3.50000
-25.9603,,,,,,3.73000
-26.0605,,,,,,3.91000
-26.1607,,,,,,3.89000
-26.2609,,,,,,3.05000
-26.3610,,,,,,2.63000
-26.4613,,,,,,2.57000
-26.5614,,,,,,3.06000
-26.6616,,,,,,3.46000
-26.7618,,,,,,3.75000
-26.8619,,,,,,3.84000
-26.9623,,,,,,3.89000
-27.0626,,,,,,3.17000
-27.1628,,,,,,2.92000
-27.2629,,,,,,3.02000
-27.3633,,,,,,3.83000
-27.4636,,,,,,4.46000
-27.5637,,,,,,4.46000
-27.6639,,,,,,3.68000
-27.7641,,,,,,3.30000
-27.8644,,,,,,3.04000
-27.9646,,,,,,3.03000
-28.0649,,,,,,3.79000
-28.1653,,,,,,3.84000
-28.2656,,,,,,3.89000
-28.3659,,,,,,3.89000
-28.4662,,,,,,3.22000
-28.5666,,,,,,3.23000
-28.6669,,,,,,3.23000
-28.7670,,,,,,3.28000
-28.8674,,,,,,3.50000
-28.9678,,,,,,3.78000
-29.0681,,,,,,3.65000
-29.1684,,,,,,3.54000
-29.2686,,,,,,4.43000
-29.3689,,,,,,4.27000
-29.4693,,,,,,3.48000
-29.5696,,,,,,3.11000
-29.6700,,,,,,3.22000
-29.7703,,,,,,3.75000
-29.8706,,,,,,3.90000
-29.9710,,,,,,3.67000
-30.0713,,,,,,3.56000
-30.1716,,,,,,3.52000
-30.2719,,,,,,3.63000
-30.3720,,,,,,3.64000
-30.4723,,,,,,3.75000
-30.5727,,,,,,3.33000
-30.6730,,,,,,3.16000
-30.7734,,,,,,3.17000
-30.8737,,,,,,3.75000
-30.9738,,,,,,3.84000
-31.0742,,,,,,3.37000
-31.1745,,,,,,3.24000
-31.2747,,,,,,3.75000
-31.3748,,,,,,3.60000
-31.4750,,,,,,3.46000
-31.5752,,,,,,3.15000
-31.6752,,,,,,3.03000
-31.7753,,,,,,3.87000
-31.8756,,,,,,3.88000
-31.9756,,,,,,3.22000
-32.0758,,,,,,3.03000
-32.1760,,,,,,3.21000
-32.2761,,,,,,3.59000
-32.3762,,,,,,3.88000
-32.4764,,,,,,4.01000
-32.5764,,,,,,4.12000
-32.6765,,,,,,4.35000
-32.7767,,,,,,4.39000
-32.8769,,,,,,4.57000
-32.9771,,,,,,4.77000
-33.0773,,,,,,4.72000
-33.1773,,,,,,4.73000
-33.2775,,,,,,4.83000
-33.3778,,,,,,4.84000
-33.4779,,,,,,4.87000
-33.5781,,,,,,4.88000
-33.6782,,,,,,4.84000
-33.7783,,,,,,4.96000
-33.8785,,,,,,4.91000
-33.9787,,,,,,4.84000
-34.0789,,,,,,4.95000
-34.1793,,,,,,4.93000
-34.2795,,,,,,4.85000
-34.3799,,,,,,4.73000
-34.4802,,,,,,4.85000
-34.5805,,,,,,5.00000
-34.6806,,,,,,5.00000
-34.7808,,,,,,4.98000
-34.8810,,,,,,4.34000
-34.9811,,,,,,4.34000
-35.0812,,,,,,4.93000
-35.1814,,,,,,3.41000
-35.2815,,,,,,4.98000
-35.3818,,,,,,4.99000
-35.4820,,,,,,5.00000
-35.5820,,,,,,4.99000
-35.6821,,,,,,4.98000
-35.7825,,,,,,4.98000
-35.8829,,,,,,4.98000
-35.9832,,,,,,4.99000
-36.0836,,,,,,4.99000
-36.1839,,,,,,4.99000
-36.2842,,,,,,4.99000
-36.3843,,,,,,4.99000
-36.4845,,,,,,4.97000
-36.5848,,,,,,4.99000
-36.6850,,,,,,4.99000
-36.7854,,,,,,5.00000
-36.8856,,,,,,4.38000
-36.9857,,,,,,4.90000
-37.0859,,,,,,4.89000
-37.1862,,,,,,4.89000
-37.2863,,,,,,4.88000
-37.3865,,,,,,4.88000
-37.4867,,,,,,4.88000
-37.5870,,,,,,4.87000
-37.6874,,,,,,4.17000
-37.7877,,,,,,4.96000
-37.8879,,,,,,4.89000
-37.9881,,,,,,4.93000
-38.0885,,,,,,4.89000
-38.1887,,,,,,4.96000
-38.2890,,,,,,4.96000
-38.3893,,,,,,4.95000
-38.4897,,,,,,4.98000
-38.5901,,,,,,4.99000
-38.6904,,,,,,4.99000
-38.7906,,,,,,5.00000
-38.8910,,,,,,4.98000
-38.9914,,,,,,5.00000
-39.0917,,,,,,4.99000
-39.1921,,,,,,4.98000
-39.2923,,,,,,4.91000
-39.3925,,,,,,4.69000
-39.4927,,,,,,4.35000
-39.5928,,,,,,4.30000
-39.6929,,,,,,4.07000
-39.7931,,,,,,3.90000
-39.8932,,,,,,3.58000
-39.9932,,,,,,3.36000
-40.0933,,,,,,3.26000
-40.1935,,,,,,3.56000
-40.2936,,,,,,3.79000
-40.3938,,,,,,3.65000
-40.4940,,,,,,3.64000
-40.5942,,,,,,3.73000
-40.6942,,,,,,3.62000
-40.7943,,,,,,3.55000
-40.8945,,,,,,3.58000
-40.9946,,,,,,3.70000
-41.0947,,,,,,3.68000
-41.1949,,,,,,3.49000
-41.2951,,,,,,3.49000
-41.3954,,,,,,3.76000
-41.4955,,,,,,3.93000
-41.5957,,,,,,3.72000
-41.6958,,,,,,3.65000
-41.7959,,,,,,3.72000
-41.8961,,,,,,3.87000
-41.9965,,,,,,3.80000
-42.0968,,,,,,3.70000
-42.1971,,,,,,3.70000
-42.2972,,,,,,3.75000
-42.3975,,,,,,3.54000
-42.4979,,,,,,3.38000
-42.5983,,,,,,3.39000
-42.6984,,,,,,3.51000
-42.7988,,,,,,3.51000
-42.8989,,,,,,3.57000
-42.9990,,,,,,3.57000
-43.0991,,,,,,3.49000
-43.1992,,,,,,3.46000
-43.2994,,,,,,3.65000
-43.3995,,,,,,3.65000
-43.4996,,,,,,3.57000
-43.5997,,,,,,3.76000
-43.6998,,,,,,3.79000
-43.7999,,,,,,3.79000
-43.9002,,,,,,3.67000
-44.0006,,,,,,3.82000
-44.1008,,,,,,3.83000
-44.2009,,,,,,3.83000
-44.3013,,,,,,3.59000
-44.4017,,,,,,2.99000
-44.5018,,,,,,2.70000
-44.6020,,,,,,2.63000
-44.7022,,,,,,2.17000
-44.8022,,,,,,1.56000
-44.9024,,,,,,1.56000
-45.0025,,,,,,1.44000
-45.1026,,,,,,1.44000
-45.2027,,,,,,1.47000
-45.3030,,,,,,1.47000
-45.4033,,,,,,1.54000
-45.5034,,,,,,1.54000
-45.6037,,,,,,1.55000
-45.7041,,,,,,1.55000
-45.8043,,,,,,1.71000
-45.9047,,,,,,1.71000
-46.0051,,,,,,1.71000
-46.1054,,,,,,1.71000
-46.2056,,,,,,1.85000
-46.3058,,,,,,1.52000
-46.4062,,,,,,1.55000
-46.5062,,,,,,1.56000
-46.6063,,,,,,1.57000
-46.7067,,,,,,1.58000
-46.8071,,,,,,1.58000
-46.9071,,,,,,1.86000
-47.0075,,,,,,1.86000
-47.1078,,,,,,1.74000
-47.2082,,,,,,1.74000
-47.3084,,,,,,1.73000
-47.4087,,,,,,1.75000
-47.5090,,,,,,1.74000
-47.6092,,,,,,1.74000
-47.7092,,,,,,1.54000
-47.8094,,,,,,1.59000
-47.9096,,,,,,1.59000
-48.0097,,,,,,1.59000
-48.1099,,,,,,1.59000
-48.2101,,,,,,1.59000
-48.3101,,,,,,1.58000
-48.4102,,,,,,1.58000
-48.5103,,,,,,1.58000
-48.6105,,,,,,1.58000
-48.7106,,,,,,1.58000
-48.8108,,,,,,1.57000
-48.9109,,,,,,1.83000
-49.0111,,,,,,1.82000
-49.1112,,,,,,1.82000
-49.2113,,,,,,1.69000
-49.3115,,,,,,1.63000
-49.4116,,,,,,1.77000
-49.5118,,,,,,1.77000
-49.6120,,,,,,1.81000
-49.7121,,,,,,1.95000
-49.8123,,,,,,1.99000
-49.9124,,,,,,1.99000
-50.0125,,,,,,1.99000
-50.1126,,,,,,1.78000
-50.2127,,,,,,1.69000
-50.3129,,,,,,1.69000
-50.4130,,,,,,1.58000
-50.5131,,,,,,1.58000
-50.6135,,,,,,1.58000
-50.7138,,,,,,1.54000
-50.8140,,,,,,1.49000
-50.9141,,,,,,1.48000
-51.0142,,,,,,1.48000
-51.1146,,,,,,1.53000
-51.2147,,,,,,1.54000
-51.3149,,,,,,1.54000
-51.4153,,,,,,1.54000
-51.5156,,,,,,1.54000
-51.6158,,,,,,1.54000
-51.7161,,,,,,1.54000
-51.8164,,,,,,1.54000
-51.9168,,,,,,1.54000
-52.0170,,,,,,1.61000
-52.1173,,,,,,1.64000
-52.2175,,,,,,1.64000
-52.3177,,,,,,1.63000
-52.4178,,,,,,1.54000
-52.5182,,,,,,1.54000
-52.6185,,,,,,1.44000
-52.7186,,,,,,1.42000
-52.8188,,,,,,1.67000
-52.9191,,,,,,1.67000
-53.0195,,,,,,1.61000
-53.1197,,,,,,1.52000
-53.2198,,,,,,1.46000
-53.3199,,,,,,1.46000
-53.4203,,,,,,1.38000
-53.5204,,,,,,1.57000
-53.6208,,,,,,1.14000
-53.7212,,,,,,1.14000
-53.8215,,,,,,0.11000
-53.9217,,,,,,0.00000
-54.0220,,,,,,0.00000
-54.1221,,,,,,0.00000
-54.2225,,,,,,0.00000
-54.3226,,,,,,0.00000
-54.4230,,,,,,0.00000
-54.5233,,,,,,0.00000
-54.6237,,,,,,0.00000
-54.7239,,,,,,0.00000
-54.8242,,,,,,0.00000
-54.9246,,,,,,0.00000
-55.0247,,,,,,0.00000
-55.1249,,,,,,0.00000
-55.2253,,,,,,0.00000
-55.3253,,,,,,0.00000
-55.4255,,,,,,0.00000
-55.5259,,,,,,0.00000
-55.6259,,,,,,0.00000
-55.7261,,,,,,0.00000
-55.8261,,,,,,0.00000
-55.9262,,,,,,0.00000
-56.0263,,,,,,0.00000
-56.1265,,,,,,0.00000
-56.2266,,,,,,0.00000
-56.3267,,,,,,0.00000
-56.4268,,,,,,0.00000
-56.5270,,,,,,0.00000
-56.6272,,,,,,0.00000
-56.7272,,,,,,0.00000
-56.8273,,,,,,0.00000
-56.9275,,,,,,0.00000
-57.0276,,,,,,0.00000
-57.1278,,,,,,0.00000
-57.2280,,,,,,0.00000
-57.3282,,,,,,0.00000
-57.4282,,,,,,0.00000
-57.5284,,,,,,0.00000
-57.6285,,,,,,0.00000
-57.7287,,,,,,0.00000
-57.8288,,,,,,0.00000
-57.9289,,,,,,0.00000
-58.0291,,,,,,0.00000
-58.1294,,,,,,0.00000
-58.2297,,,,,,0.00000
diff --git a/plugins/enabled.json b/plugins/enabled.json deleted file mode 100644 index 7d3abd6..0000000 --- a/plugins/enabled.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "motion_capture": false -}
\ No newline at end of file |
