Introduction: Parallel Port 3 Axis CNC Driver, Opto-Isolated, Unipolar Steppers


Controls 3 Unipolar Stepper Motors, for use with CNC Machines. Simple driver with automatic coil  shutdown, to ensure efficient operation.  Opto-isolated for protection of the P.C. Supports most parallel
port based CNC software, such as KCAM.

Supports up to 20 watts per Phase. Or 2 Amps per phase.

Full Kits with all the parts needed to recreate this Instructable can be purchased on my Website

Get a Full 3 Axis CNC Kit with Driver, Stepper Motors, Power Resistors, all the electronics and wire needed, excluding a PSU.

3 Axis CNC Driver KitAssembly and Testing can be added.

Printed Circuit Boards are Available with Free Shipping

and Programmed PIC Microcontrollers can be purchased

or Grab the a combined PCB & programmed PIC Microcontroller

Included in the ZIP below are the files for the Copper-side, the Top-Side layer, Datasheet and the drill files.

The source code is written in Assembly and can be purchased Here

Those who purchase Kits or programmed PIC will receive the source code for Free.

*UPDATE: Added the HEX files that use the PIC16F876A instead of the 16F870.

Disclaimer: Even though this is opto-isolated there still is a danger to your parallel port if a short were to occur. Recreate this project at your own Risk.


Step 1: Parts & Supplies

Notice 6/21/12: Get A free 3-Month Instructables Membership Code with the purchase of a  CNC Kit with a driver, motors, wire, and resistors. Limited Codes Available. Find it Here

Layout all the Parts:
- PIC16f870 - DIP or a PIC16F876A(must use a different firmware)
- Printed Circuit Board or strip board
- 20 mhz series oscillator, a regular one could be subed, just need to add 2x 22pf caps to gnd
- 12x logic level MOSFETs TO-220 package, i chose IRL630A or RFP12N10L or FDP8878
- 12x 1kohm 1/4w resistors - Brown - Black - Red
- 8x 10k ohm 1/4w resistors - Brown - Black - Orange
- 6x 500 ohm 1/4 resistors
- 12x 1n4004 or better
- Right-Angle Male DB-25
- 1x 7805 Voltage Regulator
- 2x 10uF Capacitor
- 1x 1uF Capacitor
- 3x LTV-827 OptoCoupler or Equiv.
- 1x 28 pin DIP socket
- 1x 8 pin DIP Socket
- 1x 16 pin DIP socket

A Full kit with all the Components, PIC Micro, and PCB Can Be Purchased

or Get a CNC Machine Kit with Driver, Motors, Power Resistors and Wire, It can Be found Here

Optional:
- 4x 4 Pin header
- 4x 4 pin housing
- 1x 2 pin header
- 1x 2 pin housing
- 18 crimps

Notes: Male and
Female DB-25 have different pin outs, and can not be substituted.

Tools:
- Soldering Iron
- Volt Meter/Continuity Tester
- Needle Nose Pliers

Check http://www.chromationsystems.com/partexplain.html Info


Additionally, a power supply will be required. To calculate power supply requirements: Motor Voltage/Motor Coil Resistance = amperage per coil. When full stepping each motor will have 2 coils/phases on at a time so minimum requirement is 6 * amp per coil. Then always use a power supply rated for %150 - %200 higher than the minimum. Switched mode PSUs will work, but will perform extremely bad compared to a capable linear power supply. Linear power supply's can be identified by a large transformer and capacitor probably along with some circuitry, they are more expensive but worth it if you want a nice machine.




Step 2: Resistors and Diodes


R1 - R12 are 1kohm 1/4w

R13 - R19 are 10kohm 1/4w

R20 - R25 are ~500 ohm 1/4w

TOG is a 10kohm 1/4w

D1 - D12 are 1n4004 or better


Place all the resistors and solder them in. Diagram Below
TOG is a 10kohm 1/4w resistor, mounted vertically.

Diodes D1 - D12 are next. Save the extra lead clippings for the jumpers.
These clamp the back EMF, protecting the PSU and logic.

Step 3: Jumpers, Oscillator and Sockets


Jumper points A - P need to be jumped.
( there is no jumpers O, I forgot about it)

Points labeled 1 are jumped to points labeled 2.
Example:
A1 goes to A2
B1 goes to B2
Ect.

Take a look at the diagrams below.

Take a lead clipping from the diodes (which is plenty thick)
Using a needle nose pliers bend the wire into a U shape large enough to bridge the gap.

When placing the jumpers ensure that you keep them away from any other holes or components.

Next Place the Oscillator in the XTAL, it goes in either way.
Make sure this gets a good shiny solder joint.

Sockets are Next

The 14 and 16 pin socket go in as pictured, line the notch on the socket up with the notch on the illustration.

Its not completely necessary but pin 6 on the 28-pin socket (RA4 on the PIC) (see image) should be removed, as there is a positive supply rail routed through it. And make sure to fill in its solder pad and hole with solder.

Then carefully line up all the pins into the holes and push down gently, watching to make sure no pins get flattened.

Step 4: Capacitors, Headers, DB-25


C1 & C2 are 10uF Electrolytic

C3 is a 1uF Electrolytic

Capacitors first, these are polarized so they need to go in correctly.
The white stripe down one side of the capacitor is the negative pin.
In the top-side illustration the black half is the negative side.
*also shown in the image notes below.

Headers SV1 - SV5 are next.
If you are using locking headers consider what way you need the lock part facing.
Otherwise they can go in however.

SV1 is the Y axis motor
SV2 is the X axis motor
SV3 is the Z axis motor
SV4, pin 1&2 is Negative Supply
SV4, pin 3&4 is Positive Supply
SV5 is positive supply for the motors


The right angle, male, DB-25 port is last for this step.
*note: A female port will not work as the pinout is different. If you want to use a female port or a panel mount port, use some solid strand wire to run from the port to the PCB.

A right angle port can be kinda of tricky to get in, but get a thin piece of metal, a tweezers or nail, to pry and direct pins into their holes. Only pins 2-7 and 18-25 are used, so the other ones could be clipped off to make the placement easier.

Keep it flush with the PCB, nice and tight or later plugging and unplugging will damage on the connections. Then solder a few pins to keep it in place.

Flare out the mounting pins as pictured below, and solder.

Finish up the rest of the pins, remembering only pins 2-7 and 18-25 need to be soldered, the rest don't.



Step 5: MOSFETs and 7805


Find the 7805, its in the same package as the MOSFETs but is labeled "7805"

Its place is labeled IC2 in the illustration. The metal tab lines up with the black part in the illustration.
Solder in securely, and make sure that the center pin has a really good solder joint.

Then starting from one end, place and solder the MOSFETs. See the top-side illustration and align the tabs on the MOSFETs with the black part in the illustration.

note: The tabs on the MOSFETs must not touch, as the tab is probably tied to the drain and it will not function correctly. There should be no need to heat sink the FETs.


Step 6: Plug in the ICs, Interconnects


Opto-Coupler's are labeled LTV827

The 16-pin socket., labeled OPTO2, is shared by 2 8-pin opto-couplers.
The dots on the ICs go on the same end as the notch in the sockets.

The other 8-pin opto-coupler goes into the socket labeled OPTO

If you purchased a programmed and tested chip from my Store.
Carefully plug it into the socket, aligning the notch on the socket and the dot on the IC.

Otherwise, program a 16F870 with the HEX file in the .ZIP in step 1.
Check the readme for fuses or the image below.

Step 7: Auto Coil Shutdown


As discussed earlier RA5 is used to toggle the use of the automatic shutdown function.

By default, after a motor has stepped, a timer is started, and about 50 ms after all coils for that motor are shut off. And it will resume normal function the next time it is stepped.

If you do not want the motors to shut off, RA5 must be jumped to GND. See diagrams below.

Also the function can be easily turned off in software, if the source code is Purchased

Step 8: Motors and Power Supply


I am not going to cover motors here there is plenty of great info around on the net and here on Instructables.

Below(the image with blue background) is the the setup for the motors that are included in my Full CNC Kit with Motors, Power Resistors, Wire

All Axis' are have the same pinout, if a motor works on one it will function the same on the others.
A full step means 2 coils are on at once.

Example each bit represents Header 1 - 2 - 3 - 4
1100 - 0110 - 0011 - 1001

This driver does not have any on board resistors or chopping circuitry to regulate current for the motors.

I prefer to place high wattage resistors in line with each motor's V+. Hopefully you can find the datasheet for your motors and find out the required current and voltage for the motor. Then by using a web resistor calculator, you can find the correct ohm and wattage values for your motor.

Each motor needs its own resistor, otherwise it will force multiple motors to share current when multiple are on at the same time.

A 24 volt stepper motor will end up drawing a lot of wattage, be sure you have properly rated resistors to avoid damage.

Some Good Links on Current Limiting:
http://pheattarchive.emporia.edu/projects/stepper/unipolar.pdf

http://www.cs.uiowa.edu/~jones/step/current.html

I have tested this driver with 5 different unipolar motors, they all worked great.


To calculate power supply requirements: Motor Voltage/Motor Coil Resistance = amperage per coil. When full stepping each motor will have 2 coils/phases on at a time so minimum requirement is 6 * amp per coil. Then always use a power supply rated for %150 - %200 higher than the minimum. Switched mode PSUs will work, but will perform extremely bad compared to a capable linear power supply. Linear power supply's can be identified by a large transformer and capacitor probably along with some circuitry, they are more expensive but worth it if you want a nice machine.


Step 9: Limit Switches


While the driver does not use any external inputs from limit switches, they are easy to add without any more components other than the switch.

Take a Look at This PDF, page 6 shows schematics for both active low and active high method. 

The switch connections can be soldered from the bottom of the PCB to its input pin on the DB-25.


Step 10: Interconncts and Crimps


If you are using headers and housings to attach your motors to your driver board. You'll have to select some suitable wire and attach crimps to the ends.

After you've selected and cut your wire attach a crimp to the ends. The crimps then slide into the housings, which attach neatly to the locking headers on the PCB.

Follow my Tutorial for more Info

Step 11: Software & BIOS Setup


This driver has been tested and works great with KCam. But most CNC programs (Mach3) work in a similar way and should also work fine.

Parallel Port is set up as follows, pins referenced are on the DB-25 port.

X Step - Pin 4
X Direction - Pin 5
Y Step - Pin 6
Y Direction - Pin 7
Z Step - Pin 2
Z Direction - Pin 3


Ensure in the BIOS that the parallel port is enabled, address set ( 0x378 is default ), and mode set to EPP or EPP/ECP


A short Tutorial on Setting the Home Point and Eagle CAM Processor Info and more KCAM setup info.

Step 12: Enjoy


This driver was designed for a CNC Machine but it could be used in anything that requires a PC to control 3 unipolar stepper motors.

*UPDATE: New CNC Machine I have built utilizing this Driver.

*UPDATE: Unplugging the PSU from the Driver while the motors are on may cause the PIC to become damaged.

Please ask questions, PM's are best.

Thanks for reading.

If you found this information useful please support current and future projects by shopping at my Store or Donating

Please check out My Profile to view my other projects.





Comments

author
MohamedR90 made it!(author)2016-07-11

Hi Thx for this instructable

have a question. Is pin 18-25 joined by weld cuz in diagram pin 25 is not joined

with 18-24

author
MohamedR90 made it!(author)2017-05-26

Sorry for that question . i should do what in schematic

author
AndersunO made it!(author)2016-12-19

thanksssssssss

author
ShahzaibS7 made it!(author)2016-08-09

Can it do Milling of PCB's???

author
oasards. made it!(author)2016-07-03

hello , y make it this driver board with pic 16f876a , y put it the code on pic and

with kcam work just in one sens even i change direction, where is the problem?

in hex?

author
sanjaya456 made it!(author)2016-03-26

sir i have made your cnc driver and it works fine with kcam.is it support to mach3 ? i tried but didn't success. i used 6v 5amp power supply.my motors are 6volts so is it needs to connect power resistors? thank you for helping me.

author
farmandf made it!(author)2015-07-08

This...

19062015073.jpg
author
sanjaya456 made it!(author)2016-02-21

how did you burn hex to pic ??

author
ChromationSystems made it!(author)2016-02-22

You will need a PIC programmer, such as PICKIT or any of the numerous others. It is the only way to burn a HEX onto a new PIC.

author
sanjaya456 made it!(author)2016-02-24

thank you very much for your quick reply.

author
sanjaya456 made it!(author)2016-02-21

sir i already built this circuit using pic16f870. how can i burn hex files to pic ? is it possible to burn hex to pic through this circuit.waiting for an answer...

author
farmandf made it!(author)2015-10-16

!داداشای گلم همین عکسی که گذاشتم پی سی بیه دیگه

author
09193453996 made it!(author)2015-10-23

اقا فرزین میتونی این برد رو برای من بسازی هزینه و دست مزدش هم به رو چشمام تقدیم میکنم

author
farmandf made it!(author)2015-10-29

بله عزیز با ایمیلم در تماس باشید

farmandfarzin@gmail.com

author
farmandf made it!(author)2015-10-15

سلام عزیز نقشش همینه که بالا هست دیگه

author
09193453996 made it!(author)2015-10-16

سلام اقا فرزاد اگه شماتیک و pcb print رو دارید برای منم تو تلگرام بفرستید ممنون
09016019232

author
mamadeeshadi made it!(author)2015-09-27

فرزین جان سلام
اگه ممکنه نقشه ی ساخت کنترلری ک ساختی رو توی نت آپ کن و لینکشو واسم بفرست.
کارم لنگه ممنون میشم کمکم کنی.

author
farmandf made it!(author)2015-07-05

HELLO

please put setting for mach3

Thank you very much for awesome your driver this work excellent

author
andycuba made it!(author)2015-06-23

author
farmandf made it!(author)2015-06-13

This...

25052015066.jpg
author
farmandf made it!(author)2015-06-09

Hello I am build this board it work with 'kcam' very good but not work by mach3 please help me...sos... kind regard.

Mr.Farzin from iran

author
%C5%BDygimantasM made it!(author)2015-05-04

Hello I am trying to build this project and I want to save money as much as I could and I have a lot of salvaged mosfets bo none of your list. So I want to ask what mosfets can I use what the main properties should be ? Can I use different ones from what you have suggested?

author
Bowtie41 made it!(author)2014-12-23

All kits are gone and will not be restocked.

Well that sucks!!?!

author
abdelmajidask made it!(author)2014-12-14

Nice board plz did u make a hex for half & micro steep it will be great if u did ? we really likes your i work.& i need it so can you tell us where to find it i m newbie on programing pic

author
simo.wenseslavo made it!(author)2014-08-18

hola saludos desde venezuela, he conseguido uno de estas tarjetas, quisiera saber si es posible conectar 2 motores a una sola salida en esta tarjeta para en mi caso manejar un solo eje,(eje x) en una cnc fresadora que estoy construyendo, mucha gracias

Hello greetings from Venezuela, I've got one of these cards, I wonder if you can connect 2 motors to a single output this card in my case drive a single axis (x axis) in cnc milling machine that I'm building, many thanks

author
senanayeka made it!(author)2014-08-09

Ohoo nice CNC

ability control the Corel DRAW software?

my email :- gasenanayeka@gmail.com

author
conchomania made it!(author)2014-04-03

hola soy de venezuela esta tarjeta sirve para motor bipolar?

hi am from Venezuela this driver is for bipolar steppers?

author
thelife91 made it!(author)2013-07-12

i have a step motor.1.8˚/step and input < 5VDC.
my ATX power produce both +5V for step motor driver and +12V for stepper motor, but , now , i don't have any step motor 12 V
please help me to use my step motor ! ( power supply , ? ohm and wwat resistors )

author
quangphuc91 made it!(author)2013-07-12

Thank you for your answer !, I had 2 pair PC817A to get LTV-827 :D, i hope it work

author
quangphuc91 made it!(author)2013-07-10

i don't found any OPTO LTV-827 in my city, can i replace another one , please !

author
ChromationSystems made it!(author)2013-07-11

Check the datasheet for LTV-827, it has a functional diagram image, compare it to other types of dual Optocouplers. They must have the same pinout and similar electrical characteristics.

CNC-opto-compatible.png
author
TzarIgor made it!(author)2013-01-25

Great idea and its realization!
I suggest to use an old ATX power supply. It would work perfect because it produce both +5V for processor and +12V for stepper motor and you dont need to bye external power supply!

author
markitosb made it!(author)2013-01-14

Thank you for your answer then proves the mosfet IRFZ44

author
markitosb made it!(author)2013-01-14

hello I have such a good project and the best that is affordable but I have a small query if I could not use mosfet IRFZ44 N-type is here in Peru is difficult to find the model that is listed with repect to hexa code works with the one in the instructables page or just a demo grasias por time

author
ChromationSystems made it!(author)2013-01-14

I checked the datasheet and it seems they will work, though they are not specified as Logic Level. I also found: http://pminmo.com/PMinMOwiki/index.php5?title=Logic_level_mosfets which seems to confirm they will work. Good Luck,

author
GJ.Hoogeveen made it!(author)2012-12-06

Can someone make a CNC driver schematic and PCB design for 4 axis?
I want to make a CNC foam cutter.

author
saad_3122000 made it!(author)2012-10-08

Thanks!

author
Tutorial+Master made it!(author)2012-09-12

can you mail me a PCB :D

author
tgferreira184 made it!(author)2012-04-17

does it hold 24v?

author
tgferreira184 made it!(author)2012-04-17

does it hold 24v?

author
treflip made it!(author)2011-08-18

Have you had any problems with this running all three axis at the same time? I can run x and y but if I try to run z (it's usually generated in the gcode file with all three on one line) with them it won't work.

author
reco3141 made it!(author)2011-05-03

teşekkür

author
Binnukuttan made it!(author)2011-01-18

How can i modify the driver board to 3A PER phase version?

author
bikersambo made it!(author)2011-01-24

Uprate the Mosfets And feedback/cutoff diodes to a higher wattage... Hope that helps

author
alexis_4315 made it!(author)2010-12-01

why the source code are not open? it is just a common program...

author
funlw65 made it!(author)2010-12-26

Hi Alexis,

It is not just a common program because have a rare feature:
- it produces $2 per unit.

author
Oldrunk made it!(author)2010-12-16

Just put together the kit now testing and I can confirm that this 3axis CNC Driver works with linux EMC2.

author
Renietsnurb made it!(author)2010-12-04

I'm planning to buy one of your drivers. Assuming that i have three 24V, 140 Ohm, 160 mA motors what resistors do i need. And beside these what else do i need to drive my motors?

author
Oldrunk made it!(author)2010-11-16

Awesome work and thank you, I've been wanting for a long time to put together a small hobby CNC for some time and never got to the controller since there are many designs out there. Just bought a kit from your site and thank you again for supporting the hobbyists! And thank you for the instructable.
Just a couple of questions. Since the source comes with a full kit , just wondering if its possible to add limit switches to your design?
Other question is I bought a full kit with the steppers and I know I need a 12v PSU but what power rating do I need? If I'm doing my math right even a 200watt PSU should more then handle it.

author
ChromationSystems made it!(author)2010-11-17

For limit switches I use the active low method, Shown Here. Just attach a wire from the proper pin on the DB-25(Parallel Port) from the bottom side of the PCB, and run it to your switch.

For PSUs, calculate its Voltage / Phase Resistance,  the kit includes 12v @ 60 ohms = 200ma, since the motors full step, there is always 2 phases on per motor, with possible of all 3 motors on at the same time = 200ma x 6 = 1.2A. Then always use at least 150% of calculated current so about 1.8A @ 12v.

About This Instructable

171,317views

260favorites

License:

Bio: Designing electronic creations from microcontrollers, LEDs and anything else I can pull out of a dumpster and make use of. Check my Profile
More by ChromationSystems:Basic Roller Straightener For Light Gauge MetalMake a Rug With Carpet Remnants And Duct TapeAcrylic Bender From Laser Printer With Relay Timer Box
Add instructable to: