XY Table


The table.
Arduino based prototype. Second generation of electronics.
3D rendering of the PCB with components.
The PCP top, bottom and silk screen layers.
Motor and coordinate system setup prior to taking control of the motors.
Manual movement of motors for translational alignment.
Following a path.

In 2009 a friend of mine started prototyping the hardware for an XY table. When he asked me if I would like to contribute with the software the answer was of course: hell yeah! Later I also found the electronics interesting to work with.


The hardware my friend provided is based on a very neat and sturdy wooden frame. Stepper motors are used to move the table in the Y direction and the head in the X direction. There is no Z direction yet but the head is interchangeable and can support a lightweight contraption in the future.


The first prototype of the electronics and software stepped the motors through the parallel port of an old computer. Unfortunately the parallel port provided less voltage than we anticipated which meant the electronics did not drive the motors at their full strength. Also timing in the software was not good enough to step the motors as fast and accurate as we wanted. But we got some motion which was the goal of the initial prototypes.

I set of to build a new version of the electronics based around 12 MOSFETs that is able to run up to three motors and integrated an Arduino to generate the control signals with sufficient timing.


Even though the motor control software runs on an Arduino is uses AVRLIB directly for timers and GPIO. I urged to keep the MCU software as simple as possible and push most of the functionality higher layers. The MCU deals with all that is timing critical and required to keep the motors synchronized but not much more. Part of the communication code is some high-level object oriented C++ (designed for the emulator, see below) that just happened to work right off the bat after some linker stubbing (to get virtual inheritance in a stream abstraction never meant for an MCU working).


On the PC side there is a thin native layer (C++) for dealing with communication. It also hosts a simple emulator which was easy to do since very little actual functionality is in the controller. Atop of that there is a Java GUI for high-level operations such as 3D path following and configuration.

In addition there are two separate tools that I wrote to generate some interesting test paths:

  • One that projects a simple 3D mesh into a plane and generates a 2D path to draw it to get interesting test paths.
  • One that generates the outline of the shapes in a Gerber file that could potentially be used for PCB milling in the future.


At this point the main limitation for speed is that the motors tend to skip a step every now and then if stepped too fast or sometimes just randomly caused by physical resistance. To counter this we decided to begin experimenting with using cheap digital calipers for feedback.

The electronics required to use calipers would require another board. I decided to attempt to join all the electronics on a single board and designed a PCB. Finally letting go of the Arduino that were so useful during prototyping. The board features:

  • An ATmega8 for control.
  • 16 latched MOSFET outputs (24V).
  • 6 1.5V inputs for reading three digital calipers.
  • 1.5V regulated power for the digital calipers.
  • FT232 for USB connectivity.
  • Status LEDs.
  • Reset.

I sent the board for prototype production but it failed a minor DRC check and I never bothered to make the adjustments since it became clear to me that the project was going to be on a break for a while due to lack of time.

XYZTableControl.zip (184.7 kB)-The PC side control software with the built in emulator.