The rep has the control system for the 2-axis joystick used in Mathis et al, 2017 Somatosensory Cortex Plays an Essential Role in Forelimb Motor Adaptation in Mice. https://doi.org/10.1016/j.neuron.2017.02.049
- Joystick base, Digi-Key, Cat #679-2501-ND
- Joystick handle; replace d-pad (removed by screw) with any handle you prefer (the grip point was 2 mm in diameter)
- Joystick spring; you may need to exchange the base spring with a lower stiffness spring (should be independently verified)
- Note, we modified the joystick base to reduce the force required to move the joystick (0.1-0.2 N from 4N)
- NI-DAQ card, PCI-e6251 National Instruments, Cat # NI PCIe-6251 – 779512-01
- LabView 2013 or newer, National Instruments https://www.ni.com
- our custom LabView VIs
The main file is "Pull Behavior...". The other vi's are for grabbing frames from another source, i.e. 2-photon. They need to be included for the code to run. There are three output files (reward TTLs, a "trial start" TTL, and the full X and Y joystick trajectory + lick signal + frame count). You need to set up NIDAQ tasks, as shown in the media folder.
The experimental parameters is a text file that you load, so you can customize this to your system/needs. You specify a resting home box, start "box - i.e. when it crosses a point in Y space it will trigger a trial start", end box, delay times, water value open times, magnet on time, and magnet force. It's easy to customize too, if you want to make changes. Each line in the text file is a trial. i.e.;
Build the joystick. Wire the joystick as specified by the manufacturer; i.e 5 V power, ground, and X, and Y go into analog inputs in the NIDAQ card. Be sure you have a clean 5V signal. Test output in NI-MAX.
Based on how you build the joystick, your resting voltage may differ. Each rig should be measured and calibrated (i.e. what voltage delta = X mm distance).
The above values (expt settings file) are a good starting point assuming the voltage rests at 2.55. Set for your rig as needed. There is a exp array that is on the front screen of the vi so you can figure out which values are which, etc, but it doesn't match the order in the text file, thus I highlighted important variables. To note, this demo assumes the joystick rests at 2.55; and every .05 is 1 mm.
If you use this code please cite:
- Mathis et al, 2017 Somatosensory Cortex Plays an Essential Role in Forelimb Motor Adaptation in Mice. https://doi.org/10.1016/j.neuron.2017.02.049
We greatly thank Dr. Ed Soucy at the Harvard CBS Center for Neuroengineering with LabView code and expert advice throughout the development of this joystick system!