CNC Controller Board (revB)

cncControllerB PCBA4

Our CNC Controller has been build up and testing has commenced!  This revision has several improvements over revA (which was never fabricated).  Here’s a quick feature-set:

  • 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 inputs
  • multiple power options
    • ATX power supply
    • auxiliary logic voltage
    • auxiliary motor voltage
  • parallel port connector

Read more for all the gory details of the changes made. . .

Driver Availability


The original reason revB came into existence was the availability of the A4982’s in the QFN package.  When this was originally designed (back in September) chips weren’t going to be available until January 2013!  Being impatient, we went ahead and started modifying the design to use the TSSOP package instead.  As it turns out, the QFN’s became available before we even got revB off to fab (sometime in November) – but there were a lot of great features added in the mean time.


Here’s the TSSOP footprint dropped onto the existing QFN routing.  The high current nets going to the motor are highlighted in yellow and none of the routing has been changed yet (although some routes were removed).  The TSSOP and QFN’s have extremely similar layouts, so it isn’t too bad to change which package you’re using, as long as the layout isn’t super tight!

Footprint Pitch Mishap


The original footprint of the TSSOP was 0.5mm (the actual is 0.65mm).  Luckily, this was caught before the PCB was sent to fab on one of the final checks (admittedly it shouldn’t have made it that far).  In the image above, take a look at the far right and left pins on the top row – there are overlaps.  This needs to be fixed, which caused some layout headaches due to the usual chain-reaction of moving things on an already-finished PCB.


Rerouting and Thermal Vias

ThermalVias        VregThermalVias

While re-hashing the driver layout because of the pitch enlargement, lots of vias were added.  The majority were added for increased thermal conductivity to the secondary side of the board.  There were also several added to lower the resistance (and inductance) when making undesirable layer changes on the higher current nets, as well as bypass capacitors.  These additional vias should lower the resistance in the path of the current feedback resistors, which will equate to a more accurate current measurement.  A nice low-resistance current path here is important since the power resistors are only 0.1 ohms to start with.

On the right image, the linear regulator is shown.  The regulator is meant to supply a 5V rail form an input voltage of up to 35V.  Generally, this isn’t a very good idea because of the obscene amount of heat generated by the linear regulator, which drops voltage by outputting the difference as heat.  The larger device footprint and several handfuls of vias are an attempt at getting the heat to the bottom side of the board, which will probably be attached to a chassis, which will provide a heat sink – but several watts is still an extremely large amount of heat to remove.  Luckily, the only time a large amount of heat needs to be dissipated is when a large current is being supplied by the regulator.  The largest current consuming devices on this board are all of the indicators – the two rows of LED’s.  Most of the time the majority of these LED’s aren’t going to be on full-time, so the regulator won’t normally have nearly as hard of a job as the “worst case”.  Buck regulators using a switched capacitor topology were investigated, but they couldn’t handle the higher voltages required.  A full-blown switch-mode supply seems like overkill and would add complexity and cost to the design, so they’re being avoided for now.



While doing the layout, another thought came up – which way do those jumpers go in again?  This was fixed by slightly separating the headers, so what is essentially a 2×2 jumper block is now two 1×2’s, making it much easier for a user not to put a jumper in in the wrong orientation.

Resistor Improvements


Power Selection Simplification

5V selection with Jumper     5V selection with diodes

In the quick and dirty first implementation of this, we wanted to provide options for different 5V logic voltage sources.  The idea was to use the regulator to generate 5V from the motor voltage with a backup option to use an external 5V logic voltage if that regulator (see above concerns) turned out to be too hot.  Finally, it made sense to also take the logic voltage directly from the 5V output of the ATX supply, if that was being used.  Originally, this was implemented with some jumpers, and traces on the board which would have needed to be cut and components needing to be populated differently, depending on which option was used.  While this is fine for developers while the board is in development, it’s not very flexible for long-term use, when you’d like to use the board with as little external documentation as possible.

To accomplish easy-of-use, the cuts/jumpers and component DNP’s were “simplified” to a few diodes.  The diodes effectively let the voltage source with the highest voltage supply the current.  Because they don’t conduct when reverse biased, they’ll protect the supplies from “fighting” with one another in the event that more than one is plugged in.  So, basically instead of having to read through all of the documentation, cut the correct trace, populate the right components (on the left), just plug in whatever you’d like (solution on the right).  The only caveat here is that the supply with the highest voltage wins, so if the on-board regulator is outputting 5.00V and the external 5V supply is also 5.00V or 4.9V, the on-board regulator will still supply the current (which probably isn’t desirable).  So make sure to double check the voltage of the rails when going this route.

Better MCU  / hackability




One of the features of this board was to automatically cut-back the current driving the motors when they were sitting idle.  The idea is to monitor the step lines going to each driver, if a motor is idle for more than 1sec, back-off the current being supplied to that motor to around 33% of the current used when it is running.  This allows the board to stay on for long periods during inactivity without being overly hot.  It’s also easier on the motors, since it keeps them cooler when they don’t need to be doing “real work”.

The original MCU was a 12F series PIC.  This was intended to be programmed once and dropped onto the board after programming.  The original MCU was a SOIC (there wasn’t room for a DIP).  However, not having any good way of programming a SOIC out-of-circuit, we decided to go with a better MCU (for around the same price) in a higher pin-count (and tighter pitch) package and breakout the in-circuit programming header.  In the picture above, you’ll notice some yellow test points.  All of the unused pins of the PIC are brought out to test points so that anyone can easily reprogram the chip and have an easier time getting access to the extra I/O.

Test Points


Test points were added on the secondary side of the board in case we decide on making these available fully-assembled and tested.  This will facilitate automated functional testing of the boards to make sure everything is working correctly.  Through-hole test points were also added on the Vref signals to make it easy to monitor the current that will be supplied to the motors, which is adjustable by top-side pots.

Off to Fabrication!

RevB was sent off to hackvana for fabrication.  They did a wondeful job – next up, building the prototype and seeing how things turned out!

Posted in Electronics