Skip to content

koendv/xy-stage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microscope XY Stage

assembled

This is a small computer-controlled mechanical microscope stage, with a movement of 2.4mm in both x and y, with a resolution of 5 µm. Design goal is low component cost.

video

video of the stage in motion.

disassembled

The stage consists of

  • mechanical part
  • adapter plates
  • connector board
  • arduino nano controller
  • firmware

mechanical part

mechanical

Picture of mechanical part (to the left) and connector board (to the right). The mechanical part is the motion compensation part of a digital camera, bought from aliexpress. All signals are on a flat flexible cable.

The mechanical part consists of a small carriage, two stepper motors and two slotted optocouplers, one for x and one for y. The stepper motors have a step size of 10 µm. The stepper motors are run in half-stepping mode, resulting in a resolution of 5 µm.

adapter plates

The adapter plates give the microscope stage a flat base to sit on, and a flat top to put a microscope slide on.

The adapter plates are designed in openscad and 3D printed. The size of the carriage is 25mmx75mm, the same as a standard microscope slide. I've snipped a few plastic pieces off from the movement to make everything fit. Holes can be threaded with hand tapping tools, or reamed with a small drill.

connector board

pcb

The connector board breaks out the flat cable to the arduino pins. The xy stage contains two optical endstops, one for x and one for y. This is the schematic of one such optical endstop. There are current-limiting resistors for the optocoupler led, and pull-down resistors for the optocoupler output. The stepper motors are so small you can connect them directly to the microcontroller pins.

The flat cable connector has a small tab. Lift the tab to insert or remove the flat cable. Push the tab down to fix the flat cable in place.

The board project is at easyeda; and I've put up gerbers at github.

The easiest way to obtain a pcb board is to have it assembled for you. All files needed for pcb assembly are in the easyeda directory:

  • Gerber files
  • Bill of Materials ("BOM")
  • Pick and Place file ("CPL")

The Gerber files order the printed circuit board. The Bill of Materials orders the components. The Pick and Place file orders the components to be soldered to the board.

This is a walk-through of the ordering process:

  • Log in to jlcpcb.com.
  • Click "Order now"
  • Click "Add gerber file"
  • Select file "Gerber_PCB_xy stage breakout_2023-05-13.zip"
  • Select "PCB Assemly"
  • Choose "Assemble top side"
  • Click "Confirm"
  • Click "Next"
  • Click "Add BOM File"
  • Select file "BOM_PCB_xy stage breakout_2023-05-13.csv"
  • Click "Add CPL File"
  • Select file "PickAndPlace_PCB_xy stage breakout_2023-05-13.csv"
  • Click "Process BOM and CPL"
  • Next to the flat cable connector it says "No part selected". Click "Search". After the part has been found, click "Select".
  • Click "Next"
  • In product description, choose "Research/Education/DIY/Entertainment", "DIY"
  • Click "Save to cart"
  • Check out order

Make sure all parts are available before ordering assembly.

arduino nano controller

The microcontroller is a 5V 16MHz arduino nano. This processor was chosen because it can drive the stepper motor pins directly, at low cost. The arduino nano plugs in in the connector board.

Two firmware are available for the xy stage: an arduino sketch and the grbl g-code motion controller.

arduino sketch

The arduino/ directory contains an arduino project for the xy stage. To install this firmware in the arduino nano, start up the arduino IDE. Open the file xystage.ino in the arduino IDE, In the arduino IDE, choose "Tools -> Board -> Arduino AVR Boards -> Arduino Nano", compile and upload.

Connect to the arduino serial port with a terminal emulator, and get this prompt:

xy stage - w forward s backward a left d right x home
ok

Move the stage using the WASD keys: w is forward, s is backward, a is left, d is right. x homes the stage, and if you press shift the stage moves ten times faster.

key action
w forward 1 step
s backward 1 step
a left 1 step
d right 1 step
W forward 10 steps
S backward 10 steps
A left 10 steps
D right 10 steps
x home

If after power-up the led blinks and the serial console prints error then homing failed. Check the flat flexible cable connections, and that the carriage can move freely.

grbl

grbl logo

grbl is a g-code motion controller for the arduino nano. grbl allows stage control using G-code commands.

Example: Set the feed rate. Starting at the origin, first move the stage 1 mm in x, then 1 mm in y.

> Grbl 1.1h ['$' for help]
< F100
> ok
< G1X1
> ok
< G1Y1
> ok

See the grbl/ directory for grbl firmware for the arduino nano.

Using G-code is interesting if you wish to automate a microscope.

micro-manager

micro-manager is open source software for control and automation of microscope hardware. See the micro-manager/ directory for using the xy-stage with micro-manager.

closing thoughts

Looking back, the adapter plates could easily be improved. The adapter plates were printed in yellow, on a Prusa FDM printer. If I had to do this again, I would 3D print the adapter plates in a matte dark grey or black, not yellow. Using SLS or MJF, not FDM, to be able to design a carriage that weighs less yet is more rigid. And probably ordered at jlcpcb, the same place I had the printed circuits made.

bill of Materials

The list of materials used to build this project:

Name Part Qty
R1, R3 470R 0603 2
R2, R4 18K 0603 2
U1 Hirose FH26W-15S-0.3SHW(60) 1
20pin 2.54mm single row female header 2
arduino nano 3.0 atmega328 1
small xy stage 1
M2x8 screw 3
pcb 1
3D printed parts 1

ko-fi