How to mod Cyton firmware to allow >250Hz SD card sampling rate
Hi
We've been working getting the WiFi shields to work for a research project with the goal of acquiring at least 500Hz sampled data to approach academic-grade data quality. After much software effort, we realised all of our WiFi shields seem to suffer from pulse-like noise, exactly as described on this long-term issue https://github.com/OpenBCI/OpenBCI_GUI/issues/231
Going through this related discussion http://openbci.com/forum/index.php?p=/discussion/2108/measured-shield-regulated-3-3v-supply-has-6v-dip-at-1-second-intervals-with-resonant-ringing , I understand that this is a structural problem with the shield design, and, according to @alwayswearshats, even the soldering of a different capacitor (which I do not want to risk doing at this point) does not get rid of the artifacts even if it alleviates the power supply instability. The artifacts happen whether TCP, UDP, or UDP x3 is used, congruent with the electronics-related hypothesis of their origin. They disappear once I switch back to BLE, or at least when they happen, they are clearly linked to dropped packets, which I understand would not appear on the SD Card data unlike the WiFi artifacts.
In the end, we only need the high-sampling rate data offline, so we would be content with a live bluetooth 125Hz connection for monitoring while 500Hz data gets saved to the sd card.
I gathered from related issues this could be fixed at the firmware level, and indeed I do not see why not. I am trying to assess the difficulty of undertaking this task and wondering if you would have some pointers. I think this would be a high-priority bug fix (or feature) for research, as most of it does not rely on high sampling rate live data. Have any of you tried to do this?
Comments
Daniel, your mods are welcome. If you look around the forum here, you can find some old posts regarding enabling high sample rates to the SD card. I believe these were done with earlier firmware (V1 Cyton firmware). So not directly applicable to V3.
Most likely there is some piece of code in the Cyton / SD card firmware, that forces the Bluetooth sample rate, even if a high SD rate is set. Because the code apparently requires the ADS1299 sample rate to correspond to the streaming sample rate. You should be able to break this requirement. But note that simultaneous high rate to SD card, and 125 Hz low rate to the dongle, may be more difficult.
re: your power supply related artifacts: did you try the suggestion of Jason (alwayswearshats), to power BOTH Cyton and Shield from at least 6V power packs? This would reduce the power glitches because of more current being available. If you want smaller form factor (than AA pack) for the cells, you could also find what are called "2S" LiPo, which are 7.4 V total, containing two series 3.7 V LiPo cells.
Regards, William
PS, my plan is to order some appropriate Tantalum caps to see if adding that to the Shield might improve regulation. Sorry that this is going slower than anticipated.
What Jason is recommending, is using TWO batteries, one each for Cyton and Shield. And 6V, though I think the 7.4 2S packs might even be better. TWO 2S packs. Give that a try. Apologies that the Shield power circuitry is not optimal and responsible for these glitches. Let us know your experience with the enhanced 2 battery potential workaround.