![]() |
This is an incomplete and slowly progressing project to build a CNC router for PCBs with as few COTS components as possible. Currently only the X-Axis is complete and the Y & Z axes are being redesigned (again). The X and Y axis drive systems are based on servo motors as opposed to stepper motors, and is therefore rather unusual in this class of machine. |
![]() |
The x-axis of the PCB mill being tested. The circuit board at the left is the PWM motor controller. The slotted disk at the back is part of the incremental encoder. The DC drive motor is mounted to the left of the rails and drives the lead screw via a toothed timing belt. The ribbon cable with D-25 connector to the right of the table is connected to the parallel port of a PC. Servo position commands are sent to the servo/encoder card as a serial data stream and a command/data bit. The test program runs on Linux and sends the signals via the parallel port user-space driver (IOCTL). |
![]() |
The encoder and servo are combined in one circuit. The slotted disk passes through a two channel IR interrupter with schmitt-trigger buffers. This device is intended for optical mice and produces a pair of pulse trains in quadrature. Both channels are connected to inputs of the AVR device and one channel triggers interrupts on both edges of a pulse. The ISR checks the levels of both channels and increments or decrements the actual position variable accordingly. |
![]() |
The small IR interrupter forward and left of the encoder disk provides a home reference mark. If the controlling
software sends a home command, the servo action stops and the hardware returns to the home position and zeros the
actual and required position variables. Other commands are used to enable and disable the servo, set the data mode to
be 16bit absolute or 8bit relative specification of the required position variable, and read-back the actual position. When the servo is enabled it operates as a PID controller with a 100Hz update cycle, driven by interrupts from an internal timer. The PID controller sets the duty cycle of a 20KHz PWM output signal and two outputs to control the drive direction. Two direction bits are used to allow for dead-time in direction changes. These three output signals are sent to the motor controller card. |
![]() |
The Motor Controller card has two functionally identical circuits and supports two motors (for the x and y axes). The logic input section produces logic-level H-bridge driver signals with shoot-through protection and is decoupled from the drive electronics via optoisolators. The power electronics can support a range of supply voltages, but are intended for 6-15V DC permanent magnet motors. |