Easy to build CNC Mill Stepper Motor and Driver circuits

Easy to build CNC Mill Stepper Motor and Driver circuits
This is a follow up to the Easy to Build Desk Top 3 Axis CNC Milling Machine Once you get the machine all put together its time to make it go.

So it's time to drive the motors. And here I've put together a circuit that I think is the absolute cheapest and easiest way to control stepper motors with step and direction signals. It works with many of the free or low cost softwares that produce step and direction signals through the parallel printer port. I'll explain how it works but for those of you who just want to get on with it... The_Next_Step

But I would suggest for those of you who are unfamiliar with circuits to do it on a bread board (see pictures). This way you can easly correct any mistakes and try different things.

This schematic is just to control one motor so for the milling machine you need 3 of these circuits and 3 motors.
From Left to right and top to bottom. I try to draw schematics so that positive voltages are toward the top and ground or negative volge is toward the bottom. Inputs are to the left and outputs to the right. Fist off the voltage that you are going to use to run the motor needs to be stepped down and regulated for the logic chips. I used a 6.2 volt Zener to do this because it's low enought for the logic chips to receive the signals from your printer port and high enough for the outputs to drive many of the standard power FETs, so you may not have to use logic FETs like the schematic shows. So the resistor R1 drops the voltage, the Zener diode regulates it to 6.2 volts and the capacitor C1 filters out any noise from the motor, and this voltage powers the two IC's.
The first IC (CD4516) is called an up/down counter. One signal from the printer port will tell the counter if it will count up or down and the other signal, called step, will increment or decrement the counter by one count. Now were only going to use two outputs from the counter Q1 and Q2. With this binary counting method there are only 4 combinations of output from the counter: 00, 01, 10, and 11. These lines are fed to the A and B inputs of the other IC (CD4028) which decodes these combinations to 4 seprate outputs.
I did a trick here using the C input to work as an Enable input. If the Enable(optional) is connected to the parallel port and the computor tells it to shut off all of the outputs to the FETs will go low(Off). So the four outputs of the decoder drive the FET transistors and the FETs drive the four poles of the motor.
Now everybody wants to know what the light bulb is for. Its not so much whether you use a bulb or a resistor, its that a bulb comes with a socket. You can get these wedge base light bulbs from 1 watt to 20 watts. Start with may be a 4 watt bulb and if you find you need a little more beef you just pull it out and put in a 10 watt bulb. It's really handy. And I found it's good to have some voltage drop there as kind of a ballast for the motor windings. The diodes catch some of the current that comes out of the motor each time the FET transistors turn off. The diode feeds this current back to the supply.
When you get the circuit up and running find a power supply that puts out more voltage than you really need and then change out light bulbs till you get it running smoothly. Some of my stepper motors are 5 or 6 volt and some are 12 volt but it all works out.
 
Remove these adsRemove these ads by Signing Up
 

Step 1The Circuit Board of Appeals

The Circuit Board of Appeals
OK here's what your all looking for. I made a simple PC board layout that includes 3 motor driver circuits connected to a 25 pin D sub Parallel printer port connector. Here's a picture of the layout. At the top of the picture you see a place for a voltage regulator. You can use that or you can put a resistor and Zener Diode in its place(like the schematic shows). On the right edge is a place for the 25 pin D-sub connector that connects to the parallel printer port. You just jam the PC board between the two rows of pins and solder it.
On the left side are places for the lamp sockets. You need to look over the schematic to see where some of the parts go but it's all there.
« Previous StepDownload PDFView All StepsNext Step »
1263 comments
1-40 of 1263next »
Jan 26, 2012. 12:32 AMbogdanalex says:
I managed to build this one , the motors are turning properly ... I still have some problems with "ignition" ... the serial port sometimes doesn't turn the driver on properly.

I was wondering how many Amps could I draw from this circuit powered by how many volts ?

Thanks!
Jan 4, 2012. 3:55 PMlemieux7 says:
Hi, Great project! I was just wondering. My stepper motors require 6 amps per phase. Would this driver configuration be adequate to drive them? If not, is it possible without a major re-design to just change out some components?

Thanks Carl
Jan 24, 2012. 11:35 AMoath111 says:
Hello! I think my level of knowledge is even lesser than yours, however pls I want you to assist me more over the electrical aspect of the 3d CNC Milling machine. I don't understand how I can connect the stepper motor to the circuit after the design, I also don't know the programme to write to control it, and also how I can feed the programme to the circuit for proper control. In short I'm done with coupling of the physical components since, but I've been helpless on how to proceed on the electrical aspect
Jan 24, 2012. 4:08 PMlemieux7 says:
Hello, I think I started the same way you did, not knowing very much about the electronics. I found out that all I needed was the stepper motors and driver boards in order to run three axis. However it got a little more complicated than that, come to find out I needed driver boards that could handle the motors that I bought. You need to know what size motors you have as far as voltage and amperage per phase. Then you have to find a driver board that will be compatible with the motors that you have bought. If you have not bought any motors yet there are a lot of good packages on eBay. Unfortunately I didn't know enough about the process so I bought my motors first then I had to try and find a driver board that was compatible with them. I found some components from this eBay store that I have listed here in the link. The man that owns this store has been very helpful to me. He not only had the components that I needed for my machine but he also gave me a schematic on how to wire them even though I didn't buy the motors from him. You can trust this man. I suggest you buy his CNC instructional book it explains a lot about how to wire your motors as well as what you'll need. As far as programming your machine, you will need some sort of CAD CAM package. You will also need a computer with a CNC controller software installed in it to control your CNC. I hope I have been of some assistance to you. Feel free to contact me with any other questions. I don't know everything there is to know about the subject but I think I could now build another CNC by the knowledge I've gained in this experience. http://stores.ebay.com/HUBBARD-CNC-INC?_trksid=p4340.l2563
Jan 2, 2012. 10:40 AMspy9925 says:
I can use USB to DB25 Parallel Printer ?
spec of motor?
Apr 10, 2011. 5:24 AMArduino Guy says:
Hi, I decided to test my computer's parallel port before building this driver and for some reason there is no step pulse on the pins it was assinged to for all X,Y and Z axises. I am using mach 3 on xp. Can someone help me solve this problem. Thank you.
Dec 30, 2011. 1:44 PMwllshaw says:
Did you figure it out. I have a mill running on K Cam. I would like to set it up for Mach 3 though. Did you get yours to run?
Apr 10, 2011. 7:45 PMwoodspinner says:
check your ports and pins setup

John
Apr 12, 2011. 4:21 AMArduino Guy says:
I set all the pins correctly, i know this because the direction signal for all axises works, can it be something else?
Apr 12, 2011. 6:55 AMwoodspinner says:
well, we know you got the direction pins and ports correct, are you sure you set the port on the step pins correctly? if so, then check your parallel port and cable carefully.
Apr 12, 2011. 6:56 AMwoodspinner says:
I just had a thought, easy it is to check direction signals , either high or low, but with step signals they dont last long enough to check them with anything but an oscope
May 10, 2011. 8:14 PMpfred2 says:
I like my scope fooling around with this CNC stuff mine shows up about 18 seconds in:

http://www.youtube.com/watch?v=cgbeyNNBZ68

I don't use Mach though I run EMC2 http://www.linuxcnc.org/index.php
Dec 28, 2011. 1:31 PMgeorgelstuart says:
Thanks so much for your contribution, I have been looking at reprap for a while and never understood the electronics. Yours make sense. I have ordered parts to build this circuit and I plan on driving it with Linux EMC2.

I am puzzled though, why don't you use voltage shifting transistors at the Step, Direction and if used, Enable inputs so that the entire circuit runs at full voltage, deleting the zener. The ICs are rated at 20 volts. Most fets need higher gate voltage to drive to saturation, (except the logic level parts you specify - but logic level fets I have found are much more expensive) and a couple of level shifter transistors at those inputs would be very cheap - maybe a few pennies.

Anyway, like I said, I plan on building your circuit as my first foray into CNC and I ordered parts to build this, and I'll try what I suggest too, see how it goes. Just curious if you had already considered that option and discarded the idea for some reason I don't see.
Dec 28, 2011. 3:38 AMtag3r1s says:
Hi,
I have a question. Can I run this circuit on 3V? because i have 3 3V 2.1A stepper motors. I'm scared of burning them by running at 12V.
Dec 19, 2011. 2:56 PMjackcamino says:
Merry Christmas!!
Please, help me with something here?
I want to build a CNC mill because my actual project is building a guitar so, for a neck that is about 26 in x 3 in x 2 in; and the soundboard around 15 in x 20 in x 3 mm should I shop for a larger or stronger or faster motor; how large? does it need to be a stepper motor or any motor would do the job?
And the other question is what software do you use and if it is mac compatible?
Thanks,

Jack
Dec 14, 2011. 5:12 AMcrispycat says:
thought id come back to this project as its been sitting on the shelf for a year or so after failing last time...
so everything appears to be in the correct place
the lights come on when i add power
everything is fine then after the computer gets past bios the lights switch off!
if i take the paralel out they all come back on again!!
any idea what i have done wrong?
Dec 14, 2011. 5:51 AMcrispycat says:
ok changed the settings in bios for parallel mode from ssp? to ecp and the lights have come back on
and yay i now have one axis working woowoo!!
Dec 7, 2011. 1:58 AMwirecase says:
Hi Tom,

Thanx for this circuit! It's been quite a chalenge for me to get it to work properly but now I've finally got it to work. First I build it on a breadboard and now it's on a protoboard, the first axis done now, yey!

Further more, I have the same question as Kodex, what kind of resistor do I need if I want to replace the lightbulb. All the resistors, with the +/- same resistance as the lightbulb i've been using, I tried so far are getting very hot during use...

Tom, Anyone...?

Greets,

Wire
Nov 6, 2011. 6:36 PMkodex says:
Gentlemen,

If I would like to replace the bulb with a resistor, how determine the ohms I need and the wattage it should handle?

Thanks,
Steve
Sep 27, 2011. 3:43 AMitstuck3r says:
Not gonna lie, I've built this board with about 7 different layouts and even got my electrical circuits teacher to proof read my work. I've built it correctly every time and it still fails...bout to just go buy a premade one or something :/
Sep 19, 2011. 7:28 AMragha anu says:
pls tel y stepper motor can b used for cnc machining centres?
wat is d fact?
Sep 10, 2011. 1:51 PMnikedp says:
Hi,
Firstly, I would like to say, that this tutorial is amaizing. Thank you for doing this.

But, I have a problem. I am using stepper motor stp-42d221-03 and I cant figure out, how to connect it with board. It has only 5 wires and all of them are grey (only first one has blue stripe). Please help. I tried connecting it about 100 times and it always goes few steps (about 5-10 depends on wire order) forward and few steps backward (about 2). I need help.

Thanks
Paul
motor.jpg
Sep 16, 2011. 7:39 PMwoodspinner says:
http://www.piclist.com/techref/io/stepper/wires.htm

start with this webpage and work forward
Jun 29, 2011. 2:43 PMadam.part says:
hi there, a very good design, wang to make one, cann't get the 4516, what should I do?

thanks

adam
Aug 1, 2011. 6:59 PMstewie0056 says:
i have used a 74191 instead of the 4516 and it works perfectly. just look at the two datasheets and find where the pins need to go. i ordered mine from www.allelectronics.com
if you need any help message me
Aug 2, 2011. 8:48 AMadam.part says:
thanks, i got 4516 and made a single axis circuit, but do not know how to start, i connect 25 pin on and set pin2 as step and goes to pin15 of 4516, pin3 as dir and goes to pin10 of 4516, pin4 as enable goes to pin12 of 4028, i am using mach3, what can i do now ?
Aug 5, 2011. 11:33 PMstewie0056 says:
right now i have a single axis too because i am waiting for better stepper motors to arrive.

you are correct on where the direction, step, and enable need to be.
to do a quick test unplug from computer. make your enable wire HIGH. make your direction wire HIGH or LOW. take a wire from your clock and move it from GROUND to VDD to GROUND......
everytime you touch VDD your stepper should move one step. change the direction wire and try it again. then ground your enable wire. if it stops power to the motor. if all that works everything is working onthe circuit side of the cnc driver.

i have not used mach3 yet but when i do ill let you know if anything needs changed. as far a kcam it works perfectly. just set up the port and the table settings and its works good. i cant seem to get it to run off of g code. only .gc files will work for some reason.

good luck
Aug 31, 2011. 12:09 PMadam.part says:
HI, stewie0056
Tried steps above and unfortunately, motor no move, must be something wrong, I just don't where?
Aug 31, 2011. 1:33 PMstewie0056 says:
What I did was start and test each component individually. The for example make sure your decade counter works buy putting leds on the outputs and have every thing else hooked up like the schematic except the parallel port wires. Then move your clock wire to high then low then high then low and so on. I every time it should count in binary from 0-15 if not then there's your problem. I if it does now move on to your decoder . Give it a known input by outing the input wires on your + 5 power and ground rails. The now check that the decoder is working properly and giving you the correct values. If so move on to the fets. I had bad luck with mine and I'm actually using a uln2003a instead of fets. Other changes I have made are I don't have a zener diode but I have a 7805 voltage regulator and I have added a 4700uf capacitor because my motors draw more current then my power supply can provide.

Aug 23, 2011. 11:56 AMking5star says:
Hello Mr : Tom

I have a question / Pin No.1 in lpt Running A Drill to Start ?
Aug 16, 2011. 10:16 AMcbarth says:
Hi,
thanks for this great instructable. However, I have a question according the IC CD4516. Can I also use a different IC instead f the CD4516 because this particular IC is not aviable in my country.

Thanks
Aug 6, 2011. 9:31 PMmoffett8 says:
Any chance you will do this board for a 5 axis CNC? I'm building one now but don't have the board for it.
Aug 2, 2011. 10:42 AMadam.part says:
noob asking again, in my cirsuit, one of the 4 IRFZ44N bun up and bunned the 1n4742, I cahnged into 1n4753 happened again, what happen there, help me please.
Jul 3, 2011. 6:15 PMjayeshshinai says:
All you insanely smart n helpful people!

i was suggested by my local vendor to use the 12n60 mosfet instead of the 12n10 as given...

now iv built the circuit, the motors power up on 2 axis but dont respond to KCam.
so is it because of the mosfets?

- also the bulb of the driver in the centre doesnt even light up...iv checked the circuit, nothing seems wrong..

suggestions pls?
Jun 28, 2011. 3:08 AMJorLouJr says:
Tom, the schematic is a bit difficult to read ... could you provide a better resolution one ?

Thanks and congrats ! ;-)

Jorge L.
Jun 15, 2011. 6:10 AMdwn77 says:
Gentlemen! I'm really sad because the day I finished my plate, and not getting hit, even out of primary tests.
Again I need help from the masters here.

I confess I'm lost! Do not know, what may be happening.

All 16 pins are having signal. The other pins 1-4-6-7 CD4028be, do not change status by clicking on the arrows.
Sometimes clicking on the arrows to hear the engine noise of contact very short.
List of board components:

CD4516BE
TC4028BP
K2391 (FET)
7806A
Lamp (i think is 18 volts or +)

Help me please, Thanks!
My.CNC.Board1024x768.jpg
Apr 5, 2010. 10:22 PMDamienb says:
I like the look of this project and have started to accumulate the mechanical parts side of things. My question though in regards to the circuitry... What if your PC (in this case i wish to use a laptop) doesnt have a parallel port?

Damien
Apr 6, 2010. 10:30 PMpunkhead58 says:
Simply buy a parallel port-to-USB adapter at your local electronics store.


May 4, 2010. 11:28 AMwoodspinner says:
 that wont work for this application
Jun 13, 2011. 2:11 PMdeanhenry14 says:
Hi

Im in the same situation as Damienb and i don't have a parallel connection on my laptop. I'm looking at getting a parallel port expresscard and i wonder will it suffice and provide the correct voltage for the steppers?

Cheers and thanks.
1-40 of 1263next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
347
Followers
2
Author:Tom McWire