As noted in the second portion of how NOT to build a CNC mill we reference the need for a new controller board. This board is designed to interface with EMC2 over a parallel port.
- integrated stepper drivers
- current selection via inexpensive single turn pots
- automatic idle current cutback
- spindle on-off control (connector for external relay)
- emergency stop switch input
- home switch input
- multiple power options
- ATX power supply
- auxiliary logic voltage
- auxiliary motor voltage
- parallel port connector
Probably the most noteworthy feature this board is automatic idle current, which deserves a bit more discussion. A small MCU will be included on the board which will be looking at the step signal of each axis. When the microcontroller sees that a single motor's step signal has been inactive for a period of time (i.e. one second) it will throttle the amount of current going to that motor. Since the current is controlled by a voltage going into the A4982's Vref pin, and analog multiplexer will be used to select between the running reference voltage and the idle reference for voltage (which is approximately 33% of the running idle current). Including this feature on the control board minimizes the number of outputs required from parallel port. Although disabling the stepper drivers would be easier, it is more advantageous to still supply a small amount of current to provide holding force since there could be some back driving force on the motors when cutting material. This holding torque will prevent the motors from moving unintentionally, which would result in inaccuracies.
What Isn't Included
This board is intended to be small, inexpensive, but above all provide the essential functionality to adequately control a CNC. With all this in mind, there is no isolation between the controller board and the PC.
This is done for two reasons:
- Optical isolators require a fairly large amount of current to drive ( usually around 10-20mA): not all parallel ports are capable of providing this current. Traditionally, optical isolation is used in industrial situations where there can be a large potential difference between two circuits that are being connected. In our home CNC applications, will generally be plugging the computer into the same outlet as the CNC controller, so there should be little to no difference in potential between these two circuits.
- Galvanic isolation requires two separate logic supply voltages in order to provide proper isolation. This means that we would need a logic supply for the PC side and a another logic voltage supply for the controller side, which gets costly.
There is also no ESD protection provided other than what is already included on the IC's. Again, this is to reduce costs - this is geared towards being an inexpensive board for home hobby use, not industrial environments.
Since this board will (hopefully) be used for quite a while, some effort was put into a better, more user-friendly design than the A3982 stepper driver board.
Considerably more attention is paid to heat dissipation. The stepper IC's all have thermal vias underneath them going down to a solid ground plane on the secondary side of the PCB. This ground plane contains no thermal reliefs around the vias, which will help to transfer the heat efficiently. The planes were also continued uninterrupted for as long as possible to provide a greater amount of surface area to dissipate the heat.
Low Impedance Current Paths
A fair amount of attention was paid to creating short, direct current paths for all high current signals. Polygon fills were used extensively on a per signal basis to increase the amount of copper on each trace, but still get around other components without interference.
All vias going to the thermal ground layer have direct connections (no thermal breaks or "wagon wheels") to efficiently transfer heat. Routing was done in such a way as to minimize the number of thermal breaks in the ground layer.
Routing of the 24 V power line was also given careful consideration. Its route is as short as possible with as wide a trace as is practical, with no layer changes.
Liberal On-Board Documentation
There are few things worse than coming back to a project a few months after it's made and having to go and dig up the schematic before making any connections. With this in mind, a fairly large amount of documentation is included on the board. Jumpers are not only labeled, but each configuration is detailed in a graphical manner.
Specific jumper to cut options are also detailed on the board. Most I/O on the board is labeled on a per signal basis, both on the parallel port, motor, and home switches have individual signal labels. Even the voltages of the ATX power connector are labeled on the secondary side of the board for quick reference.
One of the really nice features of some of the industrial stepper controllers is something referred to as "automatic current cutback". Basically, the controller senses when the stepper motor isn't being driven, if it's idle, reduced current is delivered. This is good for several reasons: it reduces the heat dissipated by the motor and driver, as well as reduces the current load on the power supply. Things don't get as warm/hot and everything should last longer.
The reason the reduction in current should work in our application is partly because of the lead screws - they provide a type of gearing, which makes it more difficult to "back drive" the motor when it doesn't have full torque applied to it. If you've ever tried to turn the end of a geared-reduced motor, you've experienced back diving force - the gear-reduced shaft is extremely hard (if not impossible) to turn by hand.
This controller implements automatic current reduction with a small PIC MCU that is monitoring the step lines coming from the computer. When a channel's step line doesn''t toggle at least once a second, the MCU flips an analog mux that selects a voltage reference that is around 33% of the set current.
Flexible Supply Voltages
Several different supply options can be selected. The board can be powered directly from an ATX power supply, providing 12V to the motors and 5V to the on-board logic. This is convenient/inexpensive if you have an old computer power supply laying around collecting dust.
One of the advantages to using constant current drivers for commutating the stepper motors is the fact that higher supply voltages can be used to drive the motor coils. These higher voltages help to overcome the inductance of the motor coil, reducing the time it takes to energize the coil, and let the motor spin faster. An external input voltage connector is included if a separate, higher voltage (e.g. 24V) supply is desired. Motor voltage is selected via an ATO fuse selection - no soldering is required.
In addition to the high voltage input, the board also has a 5V regulator, so only a single external supply is needed. Just in case the regulator is overheating with a higher input voltage, a separate 5V input is also provided (jumper selectable). The high current motor voltage is selected via an ATO style automotive fuse, with the clips arranged like a 2 way jumper. If you're interested in high current jumpers, they're discussed in the wiki.
The board itself is based upon the Dangerous Prototypes DP10080 Sick of Beige board layout. The goal of the SoB layouts is that common inexpensive acrylic cases can be made and PCB designers can simply design a board around these dimensions. This board was already setup to the max dimensions allowable in the free version of Eagle, so it was pretty simple to round off some edges and move our mounting holes to be compatible with the sick of beige layout. For more information on the cases check out the DP blog category.
At this point, it doesn't look like any cases are available for the DP10080 layout. Acrylic wouldn't really be the best option for this design anyway - an Aluminum base plate with some thermal pads under the driver IC's would work well as a heat sink - carrying heat away from the driver chips and spreading it onto the case.
Eagle schematic and board files are in the hardware SVN repository. This version is tagged revA. For a "bleeding edge" version, you can take a look at the stepperDriveInterface trunk.
The A4982 QFN drivers that were designed into this board seem to be back ordered for a few months just about everywhere. TSSOP equivalents are available (which would require a layout change), so the actual board will either be slightly different or delayed into 2013.
If you've read a few of these design posts now - what do you think? Is there other information that would be useful that's not included, something that is especially useful, etc? Let us know in the comments (or forum for lengthier discussions).