Instructables

Easy to build CNC Mill Stepper Motor and Driver circuits

Featured
Picture of Easy to build CNC Mill Stepper Motor and Driver circuits
KCAM LPT Port Set.JPG
C:\Projects\Milling\Mill Blog\PortSetup.jpg
C:\Projects\Milling\Mill_Drive\Pictures\IMGP0801c.JPG
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
1-40 of 1380Next »
AminA116 hours ago

i made it and not workiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing

cutdact1 month ago

Hi! I'm making this driver for my CNC, but when i step in KCAM the motor vibrates back and forth and then stops, any idea what the problem is?

Thanks

cutdact

please guys what are the values of c3-c6 i just need that to finish :)
.1uf
and how about c6 is it imortant ?

Sorry to bring up an old thread but I have the same question. did you manage to get and answer?

thanks buddy and sorry for being late :)
thank you buddy i will finish it and post some pics :)
aozgen906 months ago

if i was to make changes to the design where it connects to the stepper can i make this circuit able to drive a 4 wire bipolar stepper motor

aozgen906 months ago

if i was to make changes to the design where it connects to the stepper can i make this circuit able to drive a 4 wire bipolar stepper motor

asad11117 months ago

I also have similar problem as "descartable" has. Any solution?

Thanks in advance.

descartable7 months ago

Hi , I just finished building a single motor drive but I have a problem, when I plug in the 12V the motor start moving erratically back and forward, vibrate a lot and that disappear when I disconnect the enable pin of the CD 4028, control via parallel port isn't working fine either.I build it using a perforated board,I check all the connections and are as per the diagram.Any suggestions???Thanks

Hasersys1 year ago
So I am having a hard time. My motor will hardly step once, and back once. The motor heats up pretty hot. I have the pm55l-048 motor to test with. runnning 16v. any suggestions?
bhadresh Hasersys8 months ago

Yes, Motor gets too hot. I've the same motor pm55l-048 and running on 12 V with driver IC UCN5804B, tested on Kcam.

I think it might be be too small for load (800ma). Have you solved your problem ? I'm planning for bigger motors.

jatinbatra11 months ago
Hi, After making the circuit (I'll be breadboarding it ) can I expect it to run with Arduino.Rather how I can make it run for an uno. I'm trying to do this for a 3d printer ?

Is it for unipolar (AS IT SEEMS TO BE CENTRE-TAPPED )? How can i make it run for a bipolar stepper ?
dirver jatinbatra11 months ago
Hi, I'm not a motorspecialist so I cannot give you an answer on that. Perhaps other users ?
With Arduino UNO you could better use Polulu-drivers.
jatinbatra dirver11 months ago
Thanks dirver for replying :)
Can you just let me know some details that how it is programmed , do you use a micro controller to run the three steppers or do you program it with some software.?
I'm just curious how I will program it for the 3d printer.Thanks : and sorry for trouble

hi jatin

I have tried to drive this controller through arduino uno and it works !

you should use something called grbl you will upload a sketch to your arduino and connect your wires (step and direction) for each motor and run it with a software compatible with grbl I used grbl controller .

and when I used the enable pin It didn't work

so good luck and let me know what you achieve :)

use the following link to download the library and put it in it's directory the open examples in arduino software >GRBL>GRBLtoArduino then upload it

https://github.com/Protoneer/GRBL-Arduino-Library

some guides :

https://github.com/damellis/gctrl

http://blog.protoneer.co.nz/grbl-arduino-g-code-processor-pin-layout/

Grbl_Pin_Layout[1].png
dirver jatinbatra11 months ago
Hi Jatinbatra,
For my cnc-router I use Mach 3, but I'm designing a 3D printer and then I use this Arduino-unit (including temperature controller, stepperdrivers, ....).
http://dx.com/p/elecfreaks-3d-printer-ramps-reprap-exaltation-kit-208068
If you make a 3D printer with the driver here described, you will still need 2x temperature controller and the 4th stepperdriver.
I first wanted to change my router for also 3D-printing but the 3th axis would not go high enough so I decited to make a 3D printer from scratch.
jatinbatra dirver11 months ago
Actually I'm only a novice and I don't know how to layout PCB, so it is pretty much cumbersome work to connect a sub25 connector .
What i'M doing is that I'm making everything on a generic (protoboard or breadboard ) kinda thing , so I wanted to know can you help me figuring out what should I do ?
dirver jatinbatra11 months ago
Hi Jatinbatra,
Depends on what you mean with "figuring out".
Do you want to make Tom's pcb or are you making a new design ?
jatinbatra dirver11 months ago
i just simply want to make the driver to run the steppers with computer control i.e the torque, speed (micro-steping) and direction via a pc for 3 motors.It doesn't matter to me whether it be CNC or 3D printer, All I want to do is run the motors .
I'm bit unaware about programming part ,.
dirver jatinbatra11 months ago
The programming can be done with Mach3.
Look at the picture of Tom for this.
Have you already bought the components ?
jatinbatra dirver11 months ago
No , I haven't bought the components but i have stepper motors which are all 4 wired , can't I use this circuit with four wires ?
dirver jatinbatra11 months ago
No, I don't think this pcb will work with less than 5-wires.
I only use this pcb with 5-wire-motors.
For 4-wire-motors I use the china-driver-boards (3x motor for my router).
Regards and Merry Christmas,

Dirk
jatinbatra dirver11 months ago
Ho,ho,ho , Happy Holidays Dirk.You are really a very helpful person :)

I have four wire steppers and Tom has a six wire motor , of which two wires are connected to the bulb (which is actually for testing the circuit the circuit ) so I think if I skip these two wires , then I think I can do that right.Please fell free to correct me.
lxsedov9 months ago

I'd like to know how to choose resistors or light bulbs? I have built this circuit and tried different bulbs/resistors, but could not understand how to make my motors run at full power

jatinbatra11 months ago
Any chance I can use this circuit with 4 wires stepper ?
no, this circuit only uses single transistor per motor winding (only can sink, not source).

bipolar motors require totem-pole drivers (able to both sink and source, it requires two transistors per motor wire and logic to prevent cross shooting).

Hello!
I'm new in electronics.So please tell me the use of light bulbs in this circuit.
Thanks in advance.
it is a simple and low cost solution for current limiting:
inductor (which is what motor winding is), is pretty much a short circuit for continuous DC (not a problem when pulses are short like when motors are stepping, but ....).
The light bulb absorbs any excess energy generated by the motors and protects the board
gakes11 months ago
Thanks for this wonderful instructable. I'm new to circuits so I made the breadboard model. Imust still fit the 6w bulb. How do I connect the board to the parallel port?
2013-12-24 11.55.48.jpg2013-12-24 11.55.48.jpg
Tom McGuire (author)  gakes11 months ago
Nice job on the bread board. If you do a search for "25 pin d-sub" you'll see what you need. You could cut up an old printer cable and use an ohm meter to find which wires go to which pins. Or you can buy a breakout board. Make sure the connector has male pins.
gakes Tom McGuire11 months ago
Thanks Tom. I'm struggling to find which points from the diagram to connect to the correct parallel port pins. Any help with that?
Tom McGuire (author)  gakes11 months ago
pins 2 = step, 3 = direction, and 4 = enable. And make sure to connect ground (0v) to one or all of the ground pins on the connector (pins 18 - 25).
gakes Tom McGuire11 months ago
I understand the p/port wiring.Where do I pull the wires from the breadboard?
Hi Tom , is this circuit only for 5 wires and above. Can't I use it with 4 wires?What alternative do I have if I have 4 wire stepper motors ?
HI, can I use USB to 25 male pin converter like this

http://cdn.shopclues.com/images/detailed/12/USB_To_Parallel_25_Pin_Female_Cable,Scanner_&_Printer.jpg

to connect to the circuit on breadboard and after that use KCAM to run the motors?
jatinbatra11 months ago
Any possiblity I can use this circuit for a four wire Bipolar steppers ?
Am I doomed if I have 4 wire steppers ?
1-40 of 1380Next »