PCB layouts and schematics for my CNC
I’ve received some email and comment requests for the layouts and schematics of the electronics running my CNC machine. I’ve pulled together what I can find for this article.
Power Filter Boards

I made these power filters for a few reasons. One is to protect the stepper motor drives from the inductive spikes that can come off of the motors. They can be pretty big. Another reason was that I wanted to use a switch-mode power supply to run the drives. There’s a lot of good reasons for this:
1. Switch-mode power supplies are cheaper than linear power supplies.
2. Switch-mode power supplies are smaller than linear supplies for equivalent output power.
3. Switch-mode power supplies come in a wide range of voltages, so you can run the stepper motors at the highest voltage possible. (The highest voltage your controller supports) This allows for more torque from any motor because a higher voltage will push more current through the inductance of the motor than a lower voltage. It will also do it quicker, so you should get a little more speed too.
However, I wasn’t sure that the chopper-style stepper driver would be okay with a switch mode supply, as it pretty much shorts out the supply every time the chopper turns on. So I needed a buffer.
I found this article at EETimesAsia by John Betten from TI. I modified the circuit for the voltage levels I wanted to run, and also found a suitable replacement for the FET since I couldn’t find one at the time. Here is the original schematic:
I’m using an IR IRFP9140N in place of Q1. I also replaced D2 with a 56V TVS from ON semi, 1.5KE56A. I used 56V because the LMD18245 motor driver IC I have has a continuous rating of 55V and an absolute max of 60V. I also oversized the output capacitor just to be on the safe side since I had some big ones laying around anyway. They are 22000uF 100V Panasonics. They are overkill, the voltage is rock-solid even when the motors are running at full clip. I wanted to be able to recycle the boards though if I ever upgrade to a bigger machine and have bigger motors. Here’s the layout for my circuit:

Opto-isolated Parallel Interface Board
I designed this parallel interface board after killing a parallel port with a breakout board that I bought off the internet. I think it just pulled too much current from the port. I designed this board to pull the smallest amount of current from the parallel port as possible, while also providing good drive characteristics for outputs. This board is customized to my application, so the voltages and bias might not be appropriate for all. Check to make sure your inputs will work before using the values here. I couldn’t find the schematic, just the layout but it’s not too complicated to figure out if you have the datasheets for the TLP2631 and the SN74LS244N.
The 74244 is just a buffer; high impedance inputs and good drive characteristics. All inputs and outputs have RC filters. Adjust these values to suit your application. The 2631 is an opto-isolator that keeps the PC’s voltage potentials isolated from the CNC machine’s voltage. That way no voltage spikes hit the PC and there are no ground loops with the power supplies. Complete isolation! You just have to run power over from a spare drive connector on the PC to wherever you put this board.

The astute observer will notice a fried resistor on the board. That’s the board doing just what it was designed to do, protect my computer from dumb screw-ups. I accidentally miswired one of my limit switches during the build and the little resistor took a hike. I could have just replaced the resistor, but I’m not using all of the inputs so I just moved the wire over and remapped the limit input pin. Here’s the layout. Click to view full size.
Stepper Motor Controller
I used the “Microstep” from EAS Electronics. It’s worked well, but the switching frequency is low enough to create an obnoxious whine when the motors aren’t moving. I read in the LMD18245 datasheet that you can adjust the chopping frequency, but I haven’t bothered to try. It’ s loud enough anyway when my router “spindle” is turning that it’s not too important to me.
It’s PIC based and the source is available if you want to modify it to do custom stuff. The microstep ranges are 10,8,4,half, and full step.
My next machine will use Automation Direct’s stepper drivers. They aren’t as cheap as building your own, but they are pretty close. I used two of their STP-DRV-4035 drives in a project at work along with their stepper motors and was pleased with the results. If you need really fine step rate control, they have one that is programmable but it costs more.
Leave a Reply
What I do
Recent Posts
- Pressure mapping with DIY foam load cells
- SMS remote control
- Flatbed scanner panoramic camera
- DIY Router table
- Build a 9-digit Pulse Counter for under $20
- Trailer turn signal update
- PCB layouts and schematics for my CNC
- Build a spot welder from a battery charger
- MAX4173 Current sense amplifier
- LED backlit desk sign
Archives
- August 2010 (1)
- July 2010 (3)
- April 2010 (2)
- March 2010 (2)
- January 2010 (2)
- December 2009 (2)
- October 2009 (2)
- September 2009 (1)
- August 2009 (15)
