Building An Open-source Robotic Stereotaxic Instrument


Your institution must subscribe to JoVE's Neuroscience section to access this content.

Fill out the form below to receive a free trial or learn more about access:



This protocol includes the designs and software necessary to upgrade an existing stereotaxic instrument to a robotic (computer numeric controlled; CNC) stereotaxic instrument for around $1,000 (excluding a drill).

Cite this Article

Copy Citation | Download Citations

Coffey, K. R., Barker, D. J., Ma, S., West, M. O. Building An Open-source Robotic Stereotaxic Instrument. J. Vis. Exp. (80), e51006, doi:10.3791/51006 (2013).


This protocol includes the designs and software necessary to upgrade an existing stereotaxic instrument to a robotic (CNC) stereotaxic instrument for around $1,000 (excluding a drill), using industry standard stepper motors and CNC controlling software. Each axis has variable speed control and may be operated simultaneously or independently. The robot's flexibility and open coding system (g-code) make it capable of performing custom tasks that are not supported by commercial systems. Its applications include, but are not limited to, drilling holes, sharp edge craniotomies, skull thinning, and lowering electrodes or cannula. In order to expedite the writing of g-coding for simple surgeries, we have developed custom scripts that allow individuals to design a surgery with no knowledge of programming. However, for users to get the most out of the motorized stereotax, it would be beneficial to be knowledgeable in mathematical programming and G-Coding (simple programming for CNC machining).

The recommended drill speed is greater than 40,000 rpm. The stepper motor resolution is 1.8°/Step, geared to 0.346°/Step. A standard stereotax has a resolution of 2.88 μm/step. The maximum recommended cutting speed is 500 μm/sec. The maximum recommended jogging speed is 3,500 μm/sec. The maximum recommended drill bit size is HP 2.


Stereotactic rodent surgery is used in a wide variety of neuroscience applications, including lesioning1, iontophoresis2, microwire implantation3, stimulation4, and thin skull imaging5. However, there are major hurdles facing those who wish to apply these techniques, including the steep learning curve for performing accurate stereotactic surgery and the high probability of human error. Human errors include measurement and calculation failures, as well as the low accuracy and replicability of human movements. In an effort to reduce these confounding errors, stereotactic surgeons would benefit from a system that ensures that all surgical procedures are performed identically across subjects. The reduction of errors is also one method by which investigators can minimize the use of animal subjects, a primary goal of the National Institutes of Health for animal experimentation6. In an ideal world, all stereotactic surgeries would be perfectly replicable within experiments, and between labs. To address this issue, companies have developed new ultra-precise stereotaxics, and digital displays for reading measurements. To remove human movement errors, motorized micro manipulators and stereotaxics were produced commercially, but their high cost can be prohibitive to a laboratory with a limited budget. Also, their software is fully proprietary, and cannot be modified by the researcher to accommodate a new type of surgery.

An affordable solution to the human error problem is to build a robotic stereotax from a lab's existing model, using industry standard CNC equipment. Because of a burgeoning CNC hobbyist community, the materials are significantly less expensive than scientific equipment. This allows one to build an accurate CNC stereotaxic instrument, which is also highly flexible and inexpensive. With a basic knowledge of CNC machining and G-Code, individuals can program any stereotactic surgery that they imagine, without the limitations of proprietary software. And, in order to expedite the production of g-code for simple surgeries, this protocol includes software that allows the user to design surgeries (sharp edge craniotomy, thin skull windowing, hole drilling & implant lowering) within point and click menus. These programs output a completed g-code that may be run directly from CNC software.

In all, a motorized stereotaxic upgrade is ideal for those who have an interest in increasing the accuracy and replicability of surgeries, while retaining the flexibility and low cost of an open source platform.

Subscription Required. Please recommend JoVE to your librarian.


  1. Wire the bipolar stepper motors by screwing the wires into the connectors supplied with the driver board. Wire colors on bipolar stepper motors are standardized (Figure 1).
    Note: The described stepper motors have a resolution of 1.8°/step, geared to 0.346°/step. A standard stereotax has 3 mm/360° of travel. The final resolution is 2.88 μm/step. The motors are also capable of fractional stepping.
    1. Connect the green wire to A+, connect the black wire to A-, connect the red wire to B+ and connect the blue wire to B-.
  2. Slide the couplers over the stepper motors, being careful to align the mounting holes, and secure them using 12x M3 Socket Head Screws (20 mm) (Figure 2).
    1. Ensure that the couplers are firmly attached to the motors.
      Note: The 3D models do not include threads. The parts are labeled with thread size, but they must be tapped after they are manufactured.
  3. Remove the set screws from the thumb grips on all 3 axes of the stereotaxic instrument using a small hex key. The thumb grips are threaded, so turn them counter-clockwise for removal. Keep the PTFE washers in place on the arm (Figure 3).
  4. Screw the threaded end of the collars onto the threaded rods of the stereotaxic instrument's arms (Figure 3).
    1. Ensure there is no gap between the collars and PTFE O-rings. This guarantees that coordinates are maintained when the robot changes directions.
    2. Secure the collars onto the threads of the stereotaxic arms using 3x NF10-32 (1/4 inch) cup point set screws.
    3. Slide each motor and coupler over the collars & stereotaxic arms. Ensure that the motors sit flush with the arms, and the set screw holes on the collars line up with the flat portion of the motor shafts (Figure 4).
    4. Secure the couplers to the stereotax using the mounting holes and 6x NF10-32 (1/2 inch) cup point set screws (Figure 4).
    5. Secure the collars to the motor shafts using 3x NF10-32 (1/4 inch) set screws (Figure 4).
  5. Prepare the CNC driver board by setting each of the controller pins to half stepping.
    Note: This stepper motor driver comes as an exposed circuit board. A case may be built, although it is not necessary. Also, a number of different bipolar stepper motor drivers may be used. If so, ensure that the setup instructions are followed for the specific board purchased.
    1. Align all 6 pins per stepper motor in the same way. Half-stepping allows for double the step resolution in Degrees/step (Figure 5).
    2. Flip pin 1 to the on position, pin 2 to the off position, pin 3 to the on position, pin 4 to the off position, pin 5 to the on position, and pin 6 to the off position (Figure 5).
  6. Plug the motors (X - Y - Z) into the stepper motor driver, along with the 12 V power supply. The correct placement is marked on the driver. Also, attach the stepper driver to a computer's serial port using a DB25cable (Figure 6).
  7. Install CNC milling software onto a personal computer (this will need to be located in a surgical area) following the default instructions. Once installed, open the software to begin configuration.
    1. Configure the software to communicate with the stepper motors.
      Note: The following instructions are intended for use only with the TB6560 stepper motor driver.
    2. Click through the software's menus as follows. Open →Config→ Ports and Pins→Output Signals. Fill in the prompt to match Figure 7 and hit apply.
    3. Click through the software's menus as follows. Open→Config→Ports and Pins→Input Signals. Fill in the prompt to match Figure 8 and hit apply.
    4. Click through the software's menus as follows. Open→Config→Ports and Pins→Motor Outputs. Fill in the prompt to match Figure 9 and hit apply.
    5. Click through the software's menus as follows. Open→Config→Motor tuning. Fill in the prompt to match Figure 10 and click Save Axis Settings. Repeat the previous step for all 3 axes using the same values.
  8. Calibrate the stereotax to the scale of the CNC software.
    Note: The software is designed for standard milling machines, so its unit of measure will not be proportional to the travel of a stereotaxic instrument.
    1. Set the motors' velocity to 1 inch per minute, and "jog" the stereotaxic instrument's Z-axis with PgUp/PgDn to the nearest millimeter.
      Note: The maximum recommended jogging speed is 3,500 µm/sec and the maximum recommended cutting speed is 500 µm/sec.
    2. Zero the Z-axis, and Jog the stereotaxic instrument 1 mm. The distance traveled on the Z-axis in Mach3 is the "Scaling Constant". Machine coordinates are determined by multiplying skull coordinates (mm) by the "Scaling Constant".
    3. Perform random tests of all 3 axes by programming them to travel some known distances, and ensure the movements are accurate. If the stereotax travel is too far or short, modify the scaling constant accordingly.
      Note: Once scaling is complete, the included custom scripts may be used to generate g-code for surgeries. However, it is highly recommended that users become familiar with g-code before attempting to auto-generate surgeries. This is imperative for troubleshooting and modifying automated surgeries.
  9. Attach the micro motor drill to the stereotaxic instrument using the extra large probe holder. Note: The minimum recommended drill bit speed is 40,000 rpm.
  10. Auto-generate G-Code for a sharp edge craniotomy with 3 skull screw holes.
    1. Place all of the custom scripts from the software table into a single folder on a PC.
    2. Open the script "SharpEdgeCraniotomy.m"and run the code.
    3. Select Both to the prompt "What Type of Surgery Will You be Performing?" (Figure 11).
    4. Select Custom, to define the corners of the skull window. Fill in each prompt to match Figure 12.
    5. Define the X and Y positions of the craniotomy corners. Each coordinate must be entered in correct order, according the example in Figure 13.
    6. Enter 3 in the prompt to produce 3 skull holes (Figure 14).
    7. Select Define Using Coordinates, and enter the coordinates of each hole from the template in Figure 15.
      Note: If precise coordinates are not important, there is an option to point and click the holes' positions onto an image of a rat skull. Positions will be automatically generated.
    8. Define the drilling parameters. For the first tests surgery, accept the default values.
      Note: These values are dependent on the stepper motors, and the animal's skull. Every rat breed and target location has a slightly different skull thickness. For the initial few surgeries using this device, be prepared to test the drilling depths and remove any remaining skull pieces manually. The values can then be modified for future surgeries (Figure 16).
    9. Name the g-code; it will be automatically generated and saved to the working directory.
  11. Load the g-code into the CNC milling software and a test skull into the stereotaxic instruments ear bars.
    1. Manually jog the drill bit to Bregma using the arrow keys. Use a slow jog speed (~5 inch/m) to ensure accuracy.
    2. Start the drill bit rotating at greater than 38,000 rpm.
    3. Press CycleStart; the stereotax will perform many passes of the same cut, at different depths. Between each pass, the stereotax will pause, so the surgeon may continue or abort cutting. Press Continue Cycle (Alt-R) to continue cutting passes.

Subscription Required. Please recommend JoVE to your librarian.

Representative Results

The end result of the surgery designed in the methods will be a rat skull with a sharp edge craniotomy, and 3 skull holes (Figure 17). Note that the skull used to demonstrate the surgery was much wider than the prototypical rat skull. The sharp edge craniotomy may be used to insert a microwire array into the brain, for high density neural recordings. The CNC stereotax may also be used to lower the array with great precision. Software is included in this protocol that allows the surgeon to define the parameters of a microwire, or cannula lowering. Sharp edge craniotomies could also be used to uncover large portions of motor cortex, for sensorimotor mapping studies.

The skull holes may be used to insert skull screws (Figure 18). These can be used as anchors for dental cement when affixing a head stage to the animal. The holes may also be used to insert single electrodes into the brain. These electrodes may be used for anesthetized or chronic recordings. However, when using the stereotax for anesthetized recording, ensure the power to the motors is off before collecting data. The motors electrical properties may induce noise in the recording.

The CNC stereotax may also produce thin skull windows with a great deal of accuracy (Figure 19). These windows may be used for in vivo optical imaging in anesthetized animals. The uniformity of the thin skull allows for even light penetration, which is necessary for comparative or quantitative analysis of optical imaging data.

Figure 1
Figure 1. Wiring diagram for stepper motor plug.

Figure 2
Figure 2. Assembly diagram for attaching the couplers to the stepper motors.

Figure 3
Figure 3. Assembly diagram for attaching the collars to the stereotaxic arm.

Figure 4
Figure 4. Assembly diagram for attaching the motors/couplers to the collars/stereotaxic arm.

Figure 5
Figure 5. Switch diagram for setting the stepper motor driver to half steps.

Figure 6
Figure 6. Wiring diagram for stepper motor driver.

Figure 7
Figure 7. Configuration diagram for output signals in CNC software.

Figure 8
Figure 8. Configuration diagram for input signals in CNC software.

Figure 9
Figure 9. Configuration diagram for motor outputs in CNC software.

Figure 10
Figure 10. Configuration diagram for motor tuning in CNC software.

Figure 11
Figure 11. Prompt for choosing surgery type in the "surgery designing" software (sharpedgecraniotomies.m).

Figure 12
Figure 12. Prompt for choosing custom or preset target coordinates in the "surgery designing" software.

Figure 13
Figure 13. Prompt for entering window coordinates (4 corners) in the "surgery designing" software.

Figure 14
Figure 14. Prompt for choosing the number of skull holes in the "surgery designing" software.

Figure 15
Figure 15. Prompts for choosing the method of placing skull holes, and for entering the hole coordinates in the "surgery designing" software.

Figure 16
Figure 16. Prompt for defining the drilling parameters in the "surgery designing" software.

Figure 17
Figure 17. A skull showing the end result of running the previously designed surgery.

Figure 18
Figure 18. A skull showing skull screws inserted into a hole produced during the example surgery. The drill bits size will determine the hole's diameter and consequentially the screw size.

Figure 19
Figure 19. Shows the skull from the example surgery, containinga thin skull window, indicated by the arrows. Note that in the right panel, (skull lit from within) light seems to penetrate the thin skull window uniformly. Also note that the window does not need to be square, or contain 90° corners.

Subscription Required. Please recommend JoVE to your librarian.


The use of automated surgery equipment helps to eliminate some of the most common problems in neuroscience research. First, the tool paths are 100% reproducible. Every cut is guaranteed to be in the same location relative to Bregma. Second, it should reduce experimenter error. Although many researchers are highly skilled surgeons, it takes an exceptional amount of practice to become even a competent surgeon. This device will allow new students to quickly and easily perform highly accurate surgeries. Third, motorized surgery devices should reduce the number of animals needed to perform an experiment6. Surgeons will need less training, and mistakes will be made less frequently. Finally, the motorized stereotaxic is capable of making more precise and accurate movements than the human hand, allowing for more resolution in coordinate choice.

In today's neuroscience climate, there has been a push to increase the accuracy of surgical methods and techniques. It is no longer enough to target a brain region as a whole when it is clear that smaller subregions exist, and that they could be functionally distinct. One example comes from research focusing on microinjections into hippocampus. Not only do individuals desire to target subregions, like CA1 and CA3, but they wish to study dorsal and ventral subfields within these regions7. However, targeting these regions with a manual surgical technique is exceedingly difficult. The benefit of the motorized stereotaxic approach is that, once the correct coordinates of a target region are identified, every future surgery may be directed to the identical location. However, it's important to note that morphological differences in the skull and brains of animals will still contribute some error to surgeries.

Another field that would benefit from automating surgeries is chronic microelectrode implantations. Some labs are attempting to lower electrodes into subregions of nuclei, such as the subregions of globus pallidus or ventral pallidum8. Lowering electrodes with a motorized stereotaxic instrument will not only increase accuracy, but should increase recordable neuron yield. This is due to the fact that microwires cause damage as they are lowered. The robot is capable of lowering the electrodes slower than human hands and at a constant rate, minimizing damage to axons or neurons that very well may be afferent to the target region.

The robot's level of accuracy should also be beneficial to those who are imaging through skulls, to obtain quantitative measures of optical density9. The amount of light that may enter and exit through the skull is dependent on the skull thickness. Our motorized stereotax is capable of ensuring that the entire surface area of the thin skull window has identical depth. This helps light penetrate the window equally across its entire surface.

It is important to note the limitations of the included surgery generating software. First, all corners will be rounded off to the radius of the drill bit. For the hole drilling code, the diameter of each hole is dependent on the drills diameter. For the thin skull window and craniotomy codes, the center of the drill bit will follow the cutting path. This means that size of the window will increase on all sides by the radius of the drill bit. This may be remedied by subtracting the radius of the drill bit from the corner dimensions. Also for the thin skull window and craniotomy codes, the depth of drilling is static on each pass. This means that the entire window will be drilled to the same depth, regardless of the curvature of the skull. This is especially important to consider at extremely lateral coordinates, where the skull curves ventrally. However, there are no such limitations to the hardware, and researchers need not use the included software. With proper understanding of g-code, users may create surgeries from scratch that perfectly match the contour of the specific skull being used. Also, any hole larger than the current bit diameter may be made using simple circle interpolation. Movement in three dimensions is only constrained by the travel of the stereotax, and the user's proficiency at g-coding.

In all, automating surgeries provides a number of benefits for a modest cost, and as such, is becoming an increasingly popular technique10, 11. But it is important to recognize that the accuracy of the robot depends on quality machining, proper setup, and proper understanding of how CNC machines operate. As long as researchers are willing to take the time to understand the functioning of this motorized stereotaxic instrument, they may perform surgeries more accurately, with better replicability, and with less training. This makes integrating a motorized stereotaxic instrument into experiments a smart choice for any lab that performs a large number of surgeries.

Subscription Required. Please recommend JoVE to your librarian.


The authors have no competing financial interests to disclose.


This study was supported by the National Institute on Drug Abuse Grants DA 006886, and DA 032270.


Name Company Catalog Number Comments
1x Standard U Frame Stereotax Kopf Kopf This protocol should work with most existing stereotaxic devices.
3x 12 V, 1.6 A, 233 oz-inch Geared Bipolar Stepper Motor Phidgets Robot Shop Any high torque geared stepper motor should do. 
1x 3 Axis CNC Stepper Motor Driver Board Controller Toshiba Ebay Any 3 Axis CNC driver should do. Linked Item includes Mach3 CNC software. 
2x Arm Couplers: medial-lateral (ML) & dorsal-ventral (DV) custom machined Part Drawings These must be machined by your local machine shop. (costs will vary)
1x anterior-posterior (AP) Coupler custom machined Part Drawings These must be machined by your local machine shop. (costs will vary)
3x Motor to Stereotax Collar custom machined Part Drawings These must be machined by your local machine shop. (costs will vary)
View in Browser
12x NF10-32 Cup Point Set Screws McMaster Carr ½” Length You will need 6 of each.
¼” Length
12x M3 Socket Head Screws (20 mm) McMaster Carr 20mm Length You will need 4 for each motor
1x Micro-Motor Drill  Buffalo Dental X50 Any Micromotor drill will work.  At least 38,000 rpm recommended
1x 12 V DC Power Supply 12 Volt Adapters 12v DC – 7 Amp Any 12 V DC PSU should work (ensure amperage rating is higher than the sum of the motors’ amperage).
1x Extra Large Probe Holder Stoelting Stoelting
1x Grade B Rat Skull Skulls Unlimited Skulls Unlimited
Mach 3 Mill ArtSoft USA Trial Download Any Standard CNC controlling software should work.
Surgery Designer Kevin Coffey David Barker MATLAB File Exchange These codes are available to modify. We accept no responsibility for your use or modification of code.



  1. Yin, H. H., Knowlton, B. J., Balleine, B. W. Lesions of dorsolateral striatum preserve outcome expectancy but disrupt habit formation in instrumental learning. Eur. J. Neurosci. 19, (1), 181-189 (2004).
  2. West, M. O., Woodward, D. J. A technique for microiontophoretic study of single neurons in the freely moving rat. J. Neurosci. Methods. 11, (3), 179-186 (1984).
  3. Peoples, L. L., West, M. O. Phasic firing of single neurons in the rat nucleus accumbens correlated with the timing of intravenous cocaine self-administration. J. Neurosci. 16, (10), 3459-3473 (1996).
  4. Wolske, M., Rompre, P. P., Wise, R. A., West, M. O. Activation of single neurons in the rat nucleus accumbens during self-stimulation of the ventral tegmental area. J. Neurosci. 13, (1), 1-12 (1993).
  5. Bozza, T., McGann, J. P., Mombaerts, P., &Wachowiak, M. In vivo imaging of neuronal activity by targeted expression of a genetically encoded probe in the mouse. Neuron. 42, (1), 9-21 (2004).
  6. Pitts, M. Office of Laboratory Animal Welfare. Institutional animal care and use committee guidebook. (2002).
  7. Yoon, T., Otto, T. Differential contributions of dorsal vs. ventral hippocampus to auditory trace fear conditioning. Neurobiol. Learn. Mem. 87, (4), 464-475 (2007).
  8. Root, D. H., et al. Differential roles of ventral pallidum subregions during cocaine self-administration behaviors. J. Comp. Neurol. 521, (3), 558-588 (2012).
  9. Yang, G., Pan, F., Parkhurst, C. N., Grutzendler, J., Gan, W. B. Thinned-skull cranial window technique for long-term imaging of the cortex in live mice. Nat. Protoc. 5, (2), 201-208 (2010).
  10. Feng, L., Sametsky, E. A., Gusev, A. G., Uteshev, V. V. Responsiveness to nicotine of neurons of the caudal nucleus of the solitary tract correlates with the neuronal projection target. J. Neurophysiol. 108, (7), 1884-1894 (2012).
  11. Babaei, P., Soltani Tehrani,, B,, Alizadeh, A. Transplanted Bone Marrow Mesenchymal Stem Cells Improve Memory in Rat Models of Alzheimer's Disease. Stem Cells Int. 2012, 369417 (2012).



    Post a Question / Comment / Request

    You must be signed in to post a comment. Please or create an account.

    Usage Statistics