Easy To Build Stepper Controller from Recycled Materials

****I take no responsibility for any injuries, fried computers, or anything of that manner. Follow these instructions at your own risk****

I am 13 I have always wanted to build a cnc machine but because inexpensive parts are hard to find in Canada I have had trouble trying to build a decent cnc controller. The purpose if these instructions is to show that anyone can build a cnc controller using an old scanner. The scanner I used was an old OpticPro scanner. I had previously extracted the stepper motor and experimented with it but not considered it for a cnc controller. All of the controllers on the Internet had a large number of expensive transistors or were ridiculously complex. I finally stumbled across this controller and realized I could build it. By reusing the parts from the old scanner and making the case from recycled cardboard, I am cutting back on my impact on the planet. Also, because this controller is so simple, it only needs one power suply, so, it only needs 1 12 volt (for both the logic and the motors), instead of 1 5volt (for the logic) and 1 12 volt (for the motors). This saves energy, especially when you run it for a long period of time.

If you don’t already know what a cnc machine is, it is a machine that uses special motors called stepper motors to move an object a percise distance. The difference between a stepper motor and a regular DC motor, is that stepper motors “Step”, not spin. if you don’t understand, refer to this artical. There are two types of stepper motors. There is Bipolar, and Unipolar. Bipolar motors have 4 wires. Unipolar motors can have 5, 6 and 8 wires. The difference between these two types of motors is that unipolar motors have 4 coil inside that, when energized in a certain order, allow it to step forward and backwards. This makes them easy to control and is why we are going to use them in this instructable. Bipolar motors only have two coils that can be energized in forward, or reverse. To drive a bipolar motor you need two H-bridges. Because of this, bipolar motors motor controllers are much more complex.

The first step to building your cnc controller is to extract your motor and control board. I did not take any pictures of this step because every scanner is different, but it is usually as simple as removing the glass and taking out a few screws. The two parts you are looking for are the stepper motor and the control board, but also keep the nice metal rods so that you can use them to test you motor.

Step 3: Remove Chip from Control Board

The next step is to locate the uln2003 chip on your stepper driver. If your board does not have one, you can order one online for about 50 cents. If your board has a uln2003, you must desolder the chip from the board. This step can be a bit tricky, but is not that hard. First, try to remove as much solder as you can using your desoldering pump. Once you have removed the solder, use gentle, prying force with the tip of a screwdriver. Carefully touch the tip of your iron to each pin, still applying force with your screwdriver.

The ULN2003

Step 4: Soldering

Now you need to solder the chip into your blank proto-board (I got mine at The Source).
Solder each pin to the board. My board had two power rails running up the center of the board, so I soldered the positive pin on the uln2003 (see schematic from here and pictured below) to the one of the rails and the negative pin to the other rail. Then, you must solder pin 2 on your parallel port connector to pin 1 on the uln2003. Solder pin 3 on the parallel port to pin 2 on the uln2003, pin 4 on the parallel port to pin 3 on the uln2003 and pin 5 on the parallel port to pin 4 on the uln2003. Now solder pin 25 on the parallel port to the negative rail on your circuit board. Now, solder the motor to the driver. Hooking up the motor to the board requires some trial and error. I just soldered wires so that I could use alligator clips. You could also use screw terminals or something similar. Simply solder a wire to pin 16, 15, 14 and 13 on the uln2003. Then solder a wire (preferably black) to the positive rail. Your driver is almost done. Finally, solder your barrel jack (I recycled mine from an old RC car) to the power rails on your circuit board. To prevent my wires from breaking off, I put hot glue over them.

The Schematic

Finished Soldering

Step 5: Install Control Software

Now for the software. The only software that will work with this driver that I know of is Turbo CNC. Download it from http://www.dakeng.com/turbo.html . Un-zip it and burn it to a cd. Now, on the computer that you are going to use as your controller, go to your c: // drive and make a folder called “tcnc”. Next, drag the files from the CD to the folder you just made. Exit all windows. You have now installed Turbo CNC.

Make a New Folder

Make a Folder

Copy the Files

Step 6: Configure Control Software

Click start and shut-down. Then check the box that says “Restart in MS-DOS mode”. You will get a command prompt. At the Prompt, type “C:\tcnc\TURBOCNC”. Then you will get a screen like the one in image 3. Press any key. Now you are in the main program menu. Press F1, and then use the arrow keys to select the “Configure” menu. Use the arrow keys to select “number of axis”. Press Enter. Enter the number of axies you will be using. I only made one driver, so I selected “1”. Press enter to continue. Now press F1 again and navigate to the “Configure” menu. Select “Configure axes”, then press enter twice.

You will see a screen that looks a little confusing. Do not worry, it is not that bad. Press tab until you get the box that says”Drive Type”. Press the down arrow to select ‘Phase. Press tab again to select the Scale box. If your computer has a mouse in dos (mine does not), click the calc button. If yours is like mine, you can simply run the program off a computer running Windows XP or Vista by double clicking on the TURBOCNC file. Then, follow the above steps.

To use the calculator, you must find the number of steps per revolution that your motor takes. Google your motor’s part number and look for how many degrees per step it takes. Then, divide 360 by the number of degrees per step to find your steps per revolution. For example, my motor turns 7.5 degrees per turn, so I divided 360 by 7.5 to get 48. Punch that number into your scale calculator. Leave the rest of the settings the same. Press ok, and then copy the number in the scale box to the scale box on the other computer. Next, change the value in the acceleration box to 20, as the default 2000 is way too fast for your system. Change the value of the start velocity box to 20, and the value of the max velocity box to 175. Change the value of the fast jog box to 175. Press tab until you get to the “Last Phase” option. Change its value to 4. Press tab until you get to the first row of x’s. Copy the following into the first four boxes:
1000xxxxxxxx
0100xxxxxxxx
0010xxxxxxxx
0001xxxxxxxx
Leave the rest of the boxes as they are. Select OK. You have now set up the software.

The Configuration Screen

Step 7: Build a Test Axis

The next step is to build a simple axis to use as a test system. Cut 3 pieces of wood and clamp them together. Draw a strait line on the wood to keep your holes strait. Drill two holes on the line. Finally, drill 1 hole centered below the line. Now you can un clamp your wood.

Place the two rods through the holes on the line. Screw a small screw into your rods to keep it in place. Slide your second piece of wood onto your rods. Mount your motor to the final piece of wood. It does not matter how you do this, be creative. I used two pieces of 1/8 threaded rod to hold mine in place. Now slide your wood with the motor attached to it on the other end of your rods. Screw the rods onto the wood. Slide your threaded rod through the third hole on your first piece. Screw your nut onto the rod. Slide the rod up to the second piece of wood. Turn the rod until it slides through the holes and up to the motor’s shaft. Using aquarium air hose and zipties, connect the motor shaft to the threaded rod. To attach the nut to the 2nd piece of wood, I used various screws and nuts to hold my nut in place, but anything should work. Finally, cut a piece of wood the size that you want your stage to be. Screw it onto the 2nd piece of wood. Make sure that your stage is level. Mine was not, so I used washers as spacers. You have now built an axis for your motor.

What you need

Step 8: Connect and Test motor

Now you need to connect the motor to the controller. First, connect the common wire (refer to your motor’s datasheet) to the wire that you soldered to positive. Connecting the next four wires is a matter of trial and error. Connect them all and then change their order if your motor is taking two steps forward and one step back or something similar.

To test it, connect your 12 volt 300ma dc adapter into your barrel jack. Then, connect your DB25 port into your computer. Open the attached program in TurboCNC to test your motor wire connections. When you are done testing and changing your connection you should have a fully working axis.

To test the scale of your machine, attach a marker to your machine and run the test program. Measure the line. If yours is 1 inch long, or close to it, then your machine is good to go. If it is off, check your math. If you have made it this far, congratulations, the hardest part is done.

Building an enclosure is the final step. I chose to make mine out of recycled cardboard because it is better for the environment than buying a brand new plastic one. Also, since the driver is built mostly from recycled parts, it makes sense that the enclosure should be made of recycled material too. My circuit board measured about 2 inches by 3 inches, so I decide to make my enclosure 3 inches by 4 inches by 2 inches to make room for the connectors.

Now you need to cut your panels. Cut two rectangles that are 3 inches by 4 inches, 2 rectangles that are 2 inches by 4 inches and two panels that are 3 inches by 2 inches (see pictures). Now you need to cut the holes for the ports and plugs. Trace your parallel port plug on one of the 4×2 inch sides. Cut it out. On the same side, trace your dc barrel connector. Cut that out too.

What you do in this step depends on if you soldered connectors to your motor connection wires. If you did, mount your connectors on the outside of your blank 4×2 inch panel. If you just used wires, poke 5 holes. Now, using hot glue, glue all of the panels together (except the top one, see pictures). I chose to paint mine silver.

All the pieces cut out

Finished!

Step 10: Make the Enclosure Part 2

Now you must glue the componants inside the enclosure. Be sure to put lots of glue on the plugs as they will be exposed to lots of force. To keep the box closed, you need to make some latches. You need to cut two tabs out of craft foam. Next, cut two strips of foam and four small squares. Glue two of the squares to each strip as shown in the photos. Glue a tab to each side of the enclosure. Glue the strips to the top of the box. This concludes building the enclosure.

This Concludes my instructable. I hope you found it interesting and helpful. Feel free to modify my design and let me know how it turned out. If you liked my instructable, please vote for it in the Epilog Laser Cutter Contest.

~Update~
Here is the three axis setup instructions and schmatic

To configure the program, follow to above steps, except when you go to enter the number of axis’, enter 3. For the configuration, follow the steps above for the first axis, for the second axis, keep it the same as the above steps, except in the first four phase lines, enter the following:

“XXXX1000XXXX
XXXX0100XXXX
XXXX0010XXXX
XXXX0001XXXX”

For the last axis, follow the same steps of the other axis’, only copy this into the first four phases

Hello I am interested to known if the controller develloed for you support motor step-step nema 23 , 2Amp, 4 Volt , 1.8 newton/metro and if yes, which modifications it must make, and compliments for the good job.

I am trying to do the controller for x axe. It is all checked and connect. The motor sound but do not run. I have filled the gaps in the cnc program. How can run this?.I have reset the ports, I tried to run from a file but I can load. Could you explain a little the process. I have not experience.

Hello
I am really interested this article and you make me to save about 100$ = 550 L.E Egyptian pound .
I shall implement 3 axis motion control home made using your idea , but i have one question
Can i use mach 3 or kcam with this project ?
thank you
Best regards!!

I am really impressed and I’m going to give this a try I don’t know much about electronics, but what the heck, Im willing to learn. it’s wonderfull to have people like you around. thnx for all the info.I’ll be coming back here more often now. Keep up the good work Murry

Im sorry to bougther you again but, I have 2 more questions.I mounted the chip on a bread board and connected the wires as in the schem. I connected everything in place,and found out that the motor without any power is moving but only 1 step forward and 1 step back. LOL. now, I have a serial cord connected to the computer cause my parrallel cord is 25-36. (next); My chip is mounted so the negativ and positive chanels are connected because of the bread board. is that right? LOL, I think you will laugh at me for being so dumb. But I don’t know much about all this.please either send me a ready to go board or help me. I am willing to pay for the board just to see how it’s done. thank you. E mail: frmco@sbcglobal.net

Hey Calvin: Thanx for the good info. I do not need any more help since you have not responded to your webside massages for a long time. And it seemes like if you are not interested. Anyway, I have figured out all of the questions I hadfrom you. well, good luck to you with your good work: Bye Bye. :))))

Hi,
Sorry for not responding in a while. I am glad that you have figured out your problem, and wish you luck in building a cnc machine. If you do build one, add it to the comments. I would love to see it.

Great Work. I have been searching the web for many hours to get a layout for my CNC stepper motors. I live in a town ware electronics is as scares as chicken teeth. I will look trough my old printers for that uln2003 chip.
You are one clever 13 year old.

The author of that instrucatble used this he said. But since I’m not very familiar with cnc’s and electronica i couldn’t tell if it was possible to make things like this: http://www.lirtex.com/images/robotics/CNC/CNC_IN_ACTION_640x480.JPG
with turbocnc. I’m on low budget but would love to experiment a little with electronica and cnc’s.
can anybody tell me if my idea would be possible?

Hello,
This driver would work fine for a machine of that size, but it all depends on the size of your motors. This driver works with unipolar stepper motors that draw 500ma or less. If your motors fit that criteria, then this controller would work very well. I know that instructable uses this controller, so it should work fine.

I’d say for a beginner CNC project EMC2 (linuxcnc.org) software would work better. It’s free, incredibly well-documented and has a great community that can help if you get stuck with any issue.

Also, for bipolar steppers it’s probably better to use a specialized driver chip, like Allegro A3967 – it’ll just take the step and direction commands from your software and convert into proper stepping (with microsteps, too). There’s a great product called EasyDriver board that had the Allegro chip laid out in an easily breadboard-able form factor. It’s about $15 per motor but it’s well worth it.

hey dreamer here again.
i didn’t had the time to start my project but now i’m almost in my last week of school i will have some time:)
i’ve got another question, i don’t know which type of breadboard to buy. finding the chips won’t be a problem. i assume that DB25 stands for sub-d 25 male connector?
greets!

Hi,
Yes, DB25 is the same as sub d male. If you want to permanetly solder your circuit, than any type of proto-board (a blank peice of circuit board with a bunch of holes in it) will work. If you are just testing the circuit, than a reusable breadboard will work.

Hi, I’m looking for old printers and scanners to test your project and build my own repstrap 3D printer.
I’ve to investigate more but, do you know if is possible to implement the optical strip encoder in your driver for a better feedback and position control?
As I’ve seen your project seems to be the only without Arduino for control and the savings involved.
Congratulations and thanks for your work. I’ve 38 and I feel like in the future where childs make their own robots.