This repository contains the necessary software, CAD, and PCB fabrication files, and instructions needed to setup a CV guided open-source active commutator for neural imaging. The software files include the Python and Teensy codes for live tracking and cable tangling elimination. The CAD files are a combination of SolidWorks assembly files, SolidWorks part files, and step files.
The Rx PCB Production and Tx PCB Production folders contain the files needed to fabricate the PCBs. The same folders also contain the BOM information for the PCBs.
The CAD folder contains the SolidWorks assembly files for the motorized commutator and the translating commutator.
If you are setting up just the rotation stage, there are two parts that you will need to 3D print:
-
Motor, Slip Ring, and Circuit Holder This part houses the motor, slip ring, and the motorized commutator PCB. The part also provides a means to attach the assembly to an arena using screws.
-
Cable Holder and Support with Pulley This part holds and supports the cables exiting the slip ring. Also, it is mounted directly on the slip ring and thus provides a means to drive the slip ring through a pulley system.
If you are setting up the translation stage as well, you will need to print an additional part for attaching the rotation state to the gantry: Motorized Commutator Gantry Attachment
The following steps assume you have Anaconda installed on your machine. The commands can be run through Anaconda Powershell Prompt.
Create a conda environment with Python 3.7 and tensorflow:
conda create -n dlc-commutator python=3.7 tensorflow-gpu==1.13.1 # if using GPU
conda create -n dlc-commutator python=3.7 tensorflow==1.13.1 # if not using GPU
Activate the conda environment, install the DeepLabCut-live package:
conda activate dlc-commutator
pip install deeplabcut-live
You can test the dlc-live installation by running the following command:
dlc-live-test
You can find more information about dlc-live installation from the Github page.
Install other necessary packages:
pip install pyserial
pip install keyboard
pip install matplotlib
Also, install the Arduino software from the Arduino Website. Once you have this installed, install the Teensy add-on in the Arduino IDE. This is needed to flash firmware to the Teensy microcontroller.
Switch to the directory that contains the live tracking software:
cd <path to folder>
These commands can be run through Anaconda Powershell Prompt to start the live tracking software:
python apa_live_tracking.py # APA live tracking for instance