Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OE FPGA Acq Board plugin impedance measurement fails after loading a previous config but works from empty signal chain #602

Open
ChucklesOnGitHub opened this issue Feb 22, 2024 · 6 comments

Comments

@ChucklesOnGitHub
Copy link

User using OE acquisition board with an Intan headstage can get impedance measurements but sometimes the impedance measurement fails.

When the impedance measurement fails, the loading bar of the Impedance measurement just jumps from 0 to 100 and no measurements are taken. See video.
https://github.com/open-ephys/plugin-GUI/assets/16124331/7cbf01e2-5e6f-4dc3-bced-bd9970cc549d

User says: This impedance measurement error seems to occur whenever Open Ephys loads the lastConfig.xml file or the recoveryConfig.xml file. I had noticed that I tend to close open ephys by closing the Open Ephys GUI window (instead of the console window). After reopening the GUI, it automatically loaded the lastConfig.xml file and the measurement didn’t work anymore. When closing the GUI by closing the console window and then reopening, this window appears:
image

Only when I clicked “empty signal chain” and build the signal chain again, did the Impedance measurement work. When I clicked “recovery config” or “last config”, it of course loaded the recoveryConfig.xml file or lastConfig.xml file and the impedance measurement did not work anymore.

See attached document for detailed troublehooting report from the user, console log marked in red whenever it informs that a config file was loaded and with a note at the end if the Impedance measurement worked or not. Not working means showing the weird behavior in the video.

recreatingImpMeasError.docx

@jsiegle
Copy link
Member

jsiegle commented Feb 23, 2024

I figured out what's going on...the first time the plugin is added, the variable that holds the DSP cutoff frequency in the plugin editor is not initialized, and this gets saved as a very high or very low value. If you look at the OE FPGA Acquisition Board plugin in the video, you can see three dots next to the "DSP" button, indicating a value so high it can't be displayed. This prevents impedance measurement from running. Changing that to a lower value (e.g. 0.1 or 0.5) should make it work again, and will also ensure the value is saved properly in the config file.

I fixed the initialization issues in this branch. @anjaldoshi can you put out a new release of this plugin?

@anjaldoshi
Copy link
Member

✅ Merged and released as v0.2.5

@shababo
Copy link

shababo commented Mar 11, 2024

Hi, I've discovered what might be a similar issue. It seems running "Measure Impedances" does not work when I set the sampling rate to 5.0 kS/s. I tested by running the measurements first at the default 30.0 kS/s which worked. Then switching to 5.0 kS/s resulted in the measurement window hanging at 0%. I could then cancel this, switch back to 30.0 kS/s, and it worked again.

UPDATE: After running a failed impedance measurement (any sampling rate other than 30 kS/s seems to fail), the first attempt to acquire signal reports an error in the Console: Error reading ONI frame: received malformed frame code -28. The next attempt works.

Also, while I'm posting, is it possible to run the impedance measurements 1) for only a subset of the channels and 2) via the python API/REST API?

Thanks so much!

@jsiegle
Copy link
Member

jsiegle commented Mar 12, 2024

Thanks for posting, we will look into why it's failing for lower sample rates.

Those are great feature requests, I just created issues for them here and here.

@shababo
Copy link

shababo commented Mar 12, 2024

Awesome! I really appreciate it. I'm happy to help with some of these. Would love to be able to PR additions to the REST API to allow for full programmatic control, and generally add functionality as needed.

@jsiegle
Copy link
Member

jsiegle commented Mar 14, 2024

That's great! To add the ability to remotely change parameters or trigger impedance measurement, you'd need to implement the handleConfigMessage function in the DeviceThread class. You can use the same function in the Neuropixels plugin as a guide. If you get stuck on anything, don't hesitate to open an issue in the rhythm-oni-plugin repo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants