464.8 mm. Each axis includes a stepper motor
(Telcomotion, 4H5618C2906), which is responsible
for the automatic motion of a top plate (mobile point).
Each stepper motor has a resolution of 0.9 degrees per
step with an accuracy +/- 5%. The top plate is where
the load (transducers, hydrophones, or a third axis)
is to be attached. Each axis has two limit-switches,
which prevents from equipment damage and are also
reference points (Arrick Robotics, nd).
2.1 Power Stage
Between the Processing Unit (PU) and each mo-
tor there is a driver circuit, responsible to adapt the
current sent by the PU (in the range of mA) to a
current necessary (in the range of A) to move the
motor with high torque. To mention that all stepper
motors work in half-step mode (Yeadon and Yeadon,
2001).
2.2 Processing Unit
For the Processing Unit (PU) we used three microcon-
trollers PIC 16F84A (Microchip Technology, 2001)
from Microchip, to control both stepper motors.
One of the microcontrollers is called the PIC
Master (PICM), which receives orders from the PC.
The information from the PC to the PU is sent in a
group of 10 Bytes. The information transmitted is:
• target axis;
• direction;
• speed;
• number of steps;
• synchronization bytes.
After data processing the PICM starts the commu-
nication with the PIC Slaves (PICSs), that are
connected to the target stepper motors through the
driver circuit. Whenever a certain motor has to move
a step, PICM signals the corresponding PICS, which
only has to change the output pins state in order to
give a step.
If a switch (at the limits) is pressed, the PICS
that detected it, signals the PICM. When the move-
ment stops, the PICM sends a feedback byte to the
PC, on which it informs if the operation was or not
successful.
Whenever both stepper motors have to move the
same distance (same number of steps), they move at
the same time. Otherwise, only one motor moves at a
time.
The PU is designed to allow to control up to four
axis. The PICM has some pins that are not connected
to anything and can be used to add a new axis. If
the new axis don’t have any special requeriment, the
firmware of the PICSs will all be the same. This char-
acteristics makes our system scalable.
2.3 PC/PU interface
The interface between the PC and the PU is done
through a USB to parallel FIFO module (FTDI
UM245R) (FTDI Ltd, 2005), integrated in the PU.
The UM245R is a module with a lot of poten-
tial, since that it’s not needed to develop USB-specific
firmware to handle the USB protocol. Besides this,
it’s possible to communicate through a Synchronous
Bit Bang Mode that allows to keep a synchronous
communication.
3 SOFTWARE
The software for this project was developed in an
open source environment, so it can be used in other
applications that involves stepper motors.
In Unix/Linux environments as in others OS, the
hardware is controlled by specific programs called de-
vice drivers. In particular case of Linux, this pro-
grams can be loaded to kernel at run time, and they are
called kernel modules. With this modules it’s possi-
ble in user mode, to communicate with the hardware
without direct access, hiding all the low level func-
tions.
One of the requirements was to develop the soft-
ware as a Python module, to be integrated in other
Python programs (Teixeira et al., 2006). Since a func-
tional userspace library in C language and at the mo-
ment there isn’t any Python module for FTDI modu-
les for Linux, it was necessary to create a C Python
Extension (van Rossum, 2008). This enabled the in-
tegration of the necessary C code to control the linear
positioning table.
Figure 2 presents the software structure. The main
program is called table.py and implements a state ma-
chine that handles computer and user events. The
interfaceGUI.py file is responsible to create all the
graphical interface and the methods to access to all
the values that the user can change or configure. A
Python module called pylab included in matplotlib
library (Matplotlib Project, nd) was used to display
the motors movement. The options.py file includes
classes and methods for all the stepper motors op-
tions.
The session is saved in two data files, in order to
keep the data for next sessions. The options file has
the characteristics of each motor, and the settings file
A SCALABLE AND OPEN SOURCE LINEAR POSITIONING SYSTEM CONTROLLER
411