open-ephys / OpenEphys.Bonsai.Miniscope

Bonsai package for controlling and acquiring data from head-borne miniscopes for calcium imaging.
https://open-ephys.github.io/miniscope-docs/index.html
0 stars 1 forks source link

miniscope fails to re-connect after interruption #6

Closed dprotter closed 4 weeks ago

dprotter commented 2 months ago

I and a small team are using the openephys node to record miniscope data and synchronize with a logitech webcam and an arduino sending serial data. Generally things have been very smooth. However, we have now had a few instances where the miniscope feed stops while all other feeds remain active. It does not restart automatically, and the only solution is to stop the workflow and start it again.

No errors are found in the bonsai terminal, and none are thrown in the workflow.

We do not know how to reliably reproduce this issue, as it is uncommon, maybe 1 / 20 recordings.

I wish I could provide more helpful feedback, but let me know if anyone else has encountered this.

jonnew commented 2 months ago

Hi, thanks for the report. Although I'm not sure of the cause, it sounds like the scope may be loosing its communication lock during the recording. This can happen because

When this happens, is the lock LED still illuminated? If not, that would confirm the issue. It could of course be something entirely different but this is what comes to mind first.

jonnew commented 2 months ago

And, with respect to any automatic restart: this is possible, but will require an increase in code complexity and will not address the underlaying issue. It would be good to track that down first.

dprotter commented 2 months ago

Yep, sounds good. Its rare. We use external 5V supplies to power our scopes. We unfortunately do use relatively long cables, which is necessary for our setup at the moment. Our animals love to spin in circles, and shorter cables get too wound up, and we've had no luck with commutators.

I dont see the scope lock LED light turning off in the behavior video, but its quite hard to tell due to movement. If it did turn off, it must have very quickly turned back on again.

Even with the original UCLA miniscope software we do get disconnections that we see in the miniscope console. Generally since it just reconnects it hasnt been a problem, and is quite rare. However, the convenience of it automatically reconnecting is pretty nice.

Thankfully its been very rare, but it does seem like an important contingency to plan for.

jonnew commented 2 months ago

5V will not solve the issue, you need to bump that up. @ChucklesOnGitHub What is the recommended voltage for the external supply?

You do not need to use long cables. We have torque free commutators that can and are used for multi day experiments. These are milspec rotary joints not slip rings. They do not fail.

https://open-ephys.github.io/commutator-docs/index.html

ChucklesOnGitHub commented 1 month ago

The supply voltage needed depends on the user's setup and settings configuration such as cable length, type of cable, commutation, LED Brightness, etc. We suggest users to use a variable power supply and closely monitor how much power is actually reaching the scope to avoid damage, and then buy what they need.

You can check that the miniscope is receiving at minimum 4.5V at the coax cable connector, ideally 5V, maximum 6V. Do not power your scope in excess of 6V. (The voltage regulator in the Miniscope can't handle more than 6 V). image

For mini-coax tethers longer than 2.5m, a good starting point would be a 6V voltage. You can also use a wall adapter such as this one. You should go with as low of a voltage as needed to get stable functionality. In almost all cases, 6V is enough and will result in less heating of the PCBs.

The DC barrel jack can handle voltage between 5 and 9V. Remember if using external power you need to move the jumper on the DAQ to change from USB power to an external power supply, as explained here.

dprotter commented 1 month ago

Sounds good. Looks like our supplies are giving us about 4.3-4.4 at the scope. I found also 6V that gave me 5.34 at the scope. (~ 0.75V drop across that particular cable)

1) Are there other test pads I can use? we have to (per the advice of Daniel/Federico) use silicone to prevent the coax from wiggling and disrupting data acquisition during behavior.

2) I am searching for some variable power supplies I can tune so each scope is getting between 4.5-5V.

3) I still think it is valuable for the software to be able to reconnect to the scope, but it sounds like I'll need to do some C# myself and put in a pull request.