Skip to Navigation | Skip to Content

Electrical Design - Spring Semester


To tackle the complex task or reading a file, turning that file into machine movements, and handling user interface components, we needed a dedicated processor not unlike one you might find in your home computer. This processor must be able to run calculation-intensive algorithms to determine where the table and router are and where they should go. To fill this role, we felt that the NIOS II soft-core processor from Altera would be up to the task. The processor runs at 50 MHz, which has proven to be fast enough to calculate and instruct between motor steps. It is soft-core, which means that the processor is not a physical chip, but rather a design for a chip that we are able to write into a programmable chip called an FPGA(Field Programmable Gate Array). What’s nice about the soft-core processor is that we are able to customize in to fit our needs. And if we feel we need another feature, we can simply reprogram our FPGA instead or searching for, buying, and wiring up a different processor with the right features. For example, because position calculations use ultra precise “floating-point” numbers, we needed to include a special floating-point unit (FPU). This was added when the circular path algorithms were written. Because of the trigonometry, we needed the FPU to give us enough speed to make the calculations before it was time to step the motors again. We are also able to assign different interfaces to the processor. The processor interfaces, or talks, with three motor control boards. The job of the motor controller boards is to manage the positions of the motors and to provide a simple programming interface for the processor. The processor is programmed to a Cyclone II EP2C35 (672-pin package) FPGA. This FPGA sits in an Altera DE2 evaluation board, which is a special board with all sorts of interfaces already in place and ready to be programmed. For our prototype, we will use the DE2 board to show that our design works.

The Altera DE2 evaluation board

The FPGA used in the Altera DE2

Stepper Motors

To control the movement of all three axes, we decided to go with stepper motors. The advantage to stepper motors over other electrical motor with that we are able to place the motors in discrete locations. From a software perspective, this allows us to know where the motors are at all times by keeping track of how many times the motors are stepped and in which directions. What’s more important is that we can know these positions without any type of feedback, which would increase cost and decrease the speed we can run our machine at. The motors have 200 steps per rotation. Basically, stepper motors work by aligning a magnet with an electric field produced by current running through two coils. Depending on how much current is running through each coil, the motor will align itself in a discrete amount of directions. The motors we decided to go with were the 17Y4 Stepper Motors from Anaheim Automation. We chose these motors for their high torque (100 oz in) and reasonable price ($31.00).

A Stepper Motor

Motor Controller Boards

    The motor controller boards are software writers’ best friends. They provide a very easy to use and highly accurate interface. To “step” a motor, there are two digital lines. One of them determines which way to turn the motor. The other simply steps upon a digital pulse. They also provide more accuracy by breaking one motor “step” into eight “microsteps.” This gives us control that is eight times more precise than simple relying on the 200 steps the motor is capable of. So when we pulse a step to the boards, we are actually pulsing a microstep. Altogether, we can position any motor to 1600 different spots per rotation. For the X-Y axis, each rotation of the motor translates to 2.5” of travel, allowing us to position the table down to .156 thousandths of an inch. Of course there are physical tolerance issues which limit our accuracy, but from the software writers’ perspective, there are 6400 discrete, equally spaced locations per inch. The motor controller boards we went with were the EasyDriver v3 Stepper Motor Drivers from SparkFun Electronics. These boards were chosen because of their ease to interface, ability to increase accuracy, and reasonable prices (14.95).

One of the stepper motor control boards


When the program is started, the software first does some housekeeping tasks, such as setting the speed, specifying memory locations of different components, initializing position data, etc. This is all transparent to the user. The software then enters the calibration state. The calibration state “listens” for activity from the buttons and switches and then responds accordingly. During this state, the user may move the table and router to the desired “zero” location. The user then presses the “zero” button and this location becomes the origin for the program. Next, the user presses the “go” button and the printed circuit board is printed (hopefully!).