Introduction: Build Your Own CNC Machine.

About: What's up everybody?! I am a self-taught hobbyist that loves DIY projects. I like to make food, drinks, décor, repurpose/recycle and some fandom type items. I learned a lot from books, friends, YouTube, and Te…

When I first moved to Pittsburgh, I had a serendipitous moment when I walked by a place called TechShop. Many of you may have heard of it but I didn't and the staff was kind enough to give me tour. The place blew my mind and to sweeten the pot, they told me veterans receive a year membership for free! I immediately took classes in wood & metal working, and welding. It was the 3D printing and laser engraver class that kept me coming back the most, though. I did so much laser engraving/cutting almost every free weekend I had. In fact, check out another instructable I was able to accomplish there ( And to add to that, I wouldn't have heard of if it weren't for TechShop! I had a great year but once it was over I knew I wanted to try and get my own laser engraver and 3D printer. Ha ha ha ha, yyyeah. That price tag though...So I was off to build my own.

I wanted to go further with the laser diode but I also want to add this instructable to the Epilog contest and ran out of time. I hope the info here with what I actually had encourages you to A. vote for me, but B. stay tuned for a follow up instructable.

I would like to share my experiences with this instructable in the hopes that if you, too, have little experience (like me) and have the ambition, you can achieve a very satisfying thing!

Step 1: Devising a Plan

My goals were: Keep cost to a minimum & engineer a functional CNC machine.

The problem is getting the knowledge to do such a thing. But no worries just take it step by step.

We need a X, Y & Z axis with motors, something to drive the motors, the circuit "brain", the project surface, the medium to do the work (like a laser or 3D printer extruder, in this case a simple pen to start), wiring and something to power the thing. Finally, we need a program to control the machine on the whole and a ton of patience.

For my instructable, I will number Steps that may be standard for any build. For times that pertain to my project specifically I will just lay it out in paragraph form.

I like having a numbered system so I can mark where I am at in case I get distracted or leave and come back the next day. I hope that helps those out there that share in that.

I have a video that gives a broad overview of what is to come.

Step 2: What's This Going to Cost Me?

Scrap & scavenging is key for keeping down cost, which was one of my key goals. For the big components, I had an old PC to salvage the power supply and CD rom from. I also had the old printer and a spare laptop to run all the programs on.

I bought a scanner from eBay for $4

4 spare CD roms from an eWaste recycling facility for $10

Most components from eBay for cheap: easy drivers - $2.50/ea, laser driver - $5, laser housing with glass lens - $9, 3D pen for $27, replacement 3D pen nozzle $9, standoffs - $7.50, M to F dupont jumper wires - $5, arduino - $15, 830 point solderless breadboard with plethora of M to M jumpers - $9

From the electronics store I purchased the resistors in 5 packs for $1.5/ea and transistors for $2. 22 AWG wire spool for $9.

Laser glasses for $43 online

Roughly, I spent < $200. I think that is stellar to ultimately have my very own plotter, 3D printer and laser engraver.

Three awesome CNC machines in one that I'll build myself!!

Step 3: Credit the References

Step 4: List of Materials

eWaste: a flatbed scanner, printer, CD-ROM drive, computer power supply

Base Electronic: Arduino UNO, easy drivers (x3), prototyping breadboard, male to male jumper wires, various other wires for various soldering,

CNC Medium supplies: (1) plotting ink pen, OR

(2) 3D printing pen, a transistor, various resistors (if you want to test the 3D pen hack), an LED (for testing stepper motors), wires, and filament, OR

(3) (I wish I could add more, but for the sake of time I will scratch the surface) Laser Diode (LD), wires, module with focusing lens (preferably glass), laser driver, laser wavelength specific safety glasses, 1N4001 diodes (4 for red laser, 6 for blue laser to calibrate laser driver with a "dummy load"), OR

(I will not show this here, but if you wanted) (4) DC motor to act as a router (like 18V), chuck, routing bits, wires

Suggested tools: ruler, drill, files, rotary tool, screwdrivers of various sizes (Philips, hex and so forth), soldering iron, wire strippers, wire cutters, multimeter, needle nose pliers, punch, level, square, hot glue gun, saw (like a hacksaw or better yet, band saw)

Hardware: screws, wood or other flat surface material, zip ties, solder, hot glue sticks, heat sinks, stand offs

Safety: goggles, dust mask, fume extractor (for soldering) or a fan, hearing protection, gloves, laser specific goggles if that is what you're working towards

Step 5: Collect Some EWaste

Since everyone's situation will be different I am just going over what you will see me work with in this instructable:

Power supply - from my old desktop I wound up reclycling.

Printer - I only know it was a HP printer, my apologies.

Scanner - HP scanjet 5300 cse

CDROM - LITE-ON IT corp. dvd/cd r/rw model sohw-1633s. Digging for some specs showed that the ...

dvd-r laser diode: 650nm (red) 3B class laser. (if you want to know, the cd laser is IR 1 class laser.)

The printer I had lying around, the scanner I got from eBay for litterally $1.99 and 2 dollars shipping, and the CDR rom/power supply I got from my super old desktop I recylcled.

After looking locally, many eWaste recycling places or even some universities will sell you their stuff dirt cheap (I mean, they are going to recycle it anyways, right?! Makes less work for them) and haggling is awesome to keep your wallet tight. My local university had tons of PCs, printers and scanners all waiting to be disassembled for the recycle bins.

I read from ianmcmill's frankenlaser instructable that you want to look for older printers and newer scanners for the better stepper motors. They made a great instructable and you can check it out for reference.

Step 6: EWaste Tear Down

Since everyone may have different electronics, I won't spend a lot of time talking about the tear down. You can refer to my pictures to see what I wound up with.

Power Supply: Open the computer tower, disconnect the plugs from the motherboard, unscrew and remove the whole power supply.

Printer: You need to have the carriage from the printer with the belt and stepper attached. That nice square printer carriage didn't have a stepper attached to the drive belt, it was a straight DC motor so I got one from an Epson printer and just placed the drive gear from the DC motor on there, secured it with some screws and it does the job. This, and the scanner tear down are pretty straightforward.

Scanner: The bed is what you need. The stepper motor should be visible on the bed. Keep it attached to the belt or any other rods it is attached to.

CD rom: All you want is the stepper motor assembly with rails and all. Sometimes the face where you put a disc won't eject. Use a straight pin or paper clip to release it so that you can disassemble the CD rom. Be careful when removing the tiny pieces from the laser assembly. You do not want to damage those delicate LDs.

Note: If it is compatible, Use that long printer USB cable to replace the shorter cable that comes with the arduino.

Note: I tried to take apart one of those old Brother typewriters from the 90's to get the printer carriage from that...I do not recommend it unless you have a heavy duty grinding wheel and not just a Dremel. That thing has wierd angles that makes it hard to mount on the scanner. On the other hand, if you wanted just the stepper motor and the belts/rods, you could use some aluminum angle and mount it that way, I'm sure! That is kind of what Ianmcmill did with the Frankenstein laser.

Step 7: Check Those Motors!

Now may be a good point to check to see if the motors you worked so hard for will run properly with the software and Arduino. You would not want to work hours connecting the pieces together just to find out that that printer stepper you got is why the thing was thrown away in the first place. To do that, we will now get the software for your computer and then connect all the wires to test it with GRBL controller. This is what I do in the video.

When I did this project originally, I used a CDROM stepper assembly that was fried. So after all that, I just found that I wasted a good bit of time adapting the drill holes and whatnot to a bunk piece of equipment...

Step 8: The Software

Programs I used:

Note: What I do, I do with Windows. I am not sure how the following differs from a MAC or Lenux!

Arduino 1.6.7 (free) - check out your device and the COM port number. You could simply do this from your devices folder on your computer

GRBL Hex file 0.8 (free) - Allows the Arduino to read GRBL Gcode. This is like a Notepad .txt file.

Xloader (free) - Aids in getting the Hex file loaded on the Aruino.

GRBL Controller 3.5.1 (free) - allows the Arduino to interpret Gcode and relay it to the CNC. (they have updated this since I downloaded it)

Inkscape 9.1 (free) - Used later for making vector images to use as Gcode.

Download the GRBL hex file and use Xloader to load it to the Arduino on the appropriate COM port. Then get GRBL controller to run your CNC with that same COM port. It's that simple.

Note: If you want a nice Gcode cheat sheet for some commands, check out this link:

Step 9: The Electronic Connection

sounds like a movie...but I digress...

The goal, connect: Motors >> respective Easydriver motor controllers >> Arduino >> your computer.

I have the printer carriage, the scanner bed and the CD rom as the X,Y, & Z, respectively.

1. Solder on the pins that the easy drivers come with. (I just used the 4 for the motor, 2 for power, and three for arduino)

2. Snap the easy drivers on the breadboard side by side. (it will be tight)

3. (Pic 1) Connect the motors to the A & B on the corresponding pins of the breadboard (remember, they follow a common vertical path on the bread board!)

4. GRD and M+ are ground and 5 (12) volts and need to be connected to the power supply. I made one side of the bread board 5V and the other 12V. The two share a common ground. (See pic 3 for the CPU power supply wire color code)

5. Finally, the easy driver connects to the Arduino via the bottom right of the board at GND, Step and Dir. The 3 axes share a ground on the breadboard that way only one common wire connects to the Arduino GND. Step and Dir for X, Y and Z are 2/5, 3/6/ 4/7 pins on the Arduino, respectively (pic 2)

6. Then, connect the arduino to the computer via the USB.

7. If you are using a computer power supply like me, you will have to jump the green wire to a ground (black) wire (pic 4). Do This With The Power Unplugged!!! Jumping the green and black will trick the supply to think it is properly connected as a stand alone. I believe I used 18AWG wire.

Note: Let's say your stepper motor doesn't just have 4 connections and has 5 or 6. How do you know which two wires would mate coil A+ and A- or B+ and B- ? Well my printer stepper has 6 wires and this puzzled me. The way to go is find a spare LED. Connect the LED's two wires and manually twist the motor. If it lights up, that is the pair. Now lets say the very first and second wire light up and then you go to test one and three and it lights up, what? Well the brighter of the two combinations is what you want. Then do the same with the remaining wires. My A was wire one & two and B was five & six. I found that a five wire was the outer two more often than not. (pic 8)

8. The easydriver has a potentiometer on it (pic 5) to adjust the current going to the stepper motor and if you can find the specs for your specific stepper to know the current rating you can adjust it properly. With a multimeter find the resistance, Rs, on pins 4 & 5 of the integrated circuit. Then use GND by the 5+ and TP1 to see the voltage and adjust the potentiometer until you get the right voltage for the rated current of your stepper. That way your motors don't overheat and "scream." (Last pic and shown in Video)

The formula is Vref = 8(I/Rs)

Example: I = 0.2 Amps (seems like the common for CD rom motors, but don't quote me), Rs = 0.6 Ohms

Vref = [(0.2 Amps)(8)]/(0.6 Ohms) = 2.67 Volts. Tune the pot to 2.67

I could not find my specs for my motors (however a common 0.2 Amps showed up for Max current for CD rom stepper motors whilst perusing the interweb) and boy did the scanner motor scream when I first connected it all together so I just decreased the amperage until it stopped. So far so good. I also added some heat sinks to the IC of the Easydrivers, though, just in case. Can't be too careful.

9. Attach your heat sinks to the IC on the easy driver, if you bought some, and allow them to cure.

10. With everything connected, power up and boot your computer with GRBL controller and open the appropriate COM port. A list of things like $1=500.000 and whatnot should show up. We can calibrate all this later (And you MUST!).

11. Set the step in GRBL controller (in the bottom right corner) from 10 to 1, just in case.

12. Jog each of the motors axes to make sure they move by hitting the arrow either up or down (left or right for X axis).

13. If they move, that is awesome and go to the next step. If not, check your connections or your pin out on the Arduino (esp. the CD rom since it is generally a Tight fit).

Note: If they move but in the wrong direction, go to Tools>Options>and check 'invert' for the axis.

Like I alluded to earlier, the CD rom gave me the biggest headache. Connecting, and by that I mean soldering, the four wires to jump to the breadboard is so tight that I kept getting two solder joints to fuse together effectively making the two points one. This makes the motor very unhappy and when you test it with GRBL, it will just jiggle, and not in a good way. You go to jog your motor and get very frustrated that it doesn't work. If you want to get serious with soldering or you already are, get a good non cheapy soldering iron with a fine tip, and some flux, especially if you are working with small gauge wire. But when I figured out that was all it was and that the motor actually worked properly, boy did I get a good boost in moral and a sense of accomplishment. I eventually soldered pins to the end of my wire that I connected to the motor which helped as well.

Step 10: Assembly

Now that you have the guts of the electronics tested and working properly, we need to "connect" all the axes together. This may take the longest in the project. Depending on the parts you use will determine your coarse of action. I am just showing my perspective.

I disconnected all the wires for ease of attachment. I used some wood paneling I had laying around and did a rough sketch of the scanner assembly that the stepper was attached to. I cut it to size and that way I could use some screws to attach the printer carriage to the scanner.

Next we need to connect the Z axis, the CD rom, to the X axis. The panel that the ink cartridge rested in makes a great support for this. I had to drill some holes in the sides of it and then cut some of the old CD rom housing to make L brackets. (Can you tell I really didn't want to go to the hardware store for this?) If you have some lying around, better on you. Or if you devise a better way to attach it, post a comment. There were a couple holes for screws already on the CD rom platter that I used and measured the holes to be drilled on my "L brackets." I attached it with standoffs. I then used two more standoffs on where the lasers were housed to attach our medium. I started with a regular ink pen to test the Gcode and GRBL itself.

This heap should start looking like a CNC machine now!

All that is left is you reattach your electrical connections on the bread board and the Arduino.

Step 11: Calibration

With everything reattached it is time to make sure that when you tell GRBL Controller to move 10 mm, it does precisely that.

Groover's instructable says that he uses 53.3333 for the Step/mm on the CD drive motor and this is pretty spot on, so I went with that. It works just fine.

Let's open GRBL Controller.

To adjust the specs, type $2 = 53.333 in the Command block and hit Enter. That will change the Z axis, in that example. $0, $1, $2 are X, Y, Z, respectively.

My X & Y are both belt driven and so I found this equation for that:

[(360/your motor steps)*(microsteps)]/ [(pulley pitch, mm)/(pulley gear teeth)]

Example: [(360 degrees/200 steps/degree {this step/deg is for a typical Nema17 in this example} )*(8 microsteps)]/[(1 pitch/mm)/(16 teeth total)] = 230.4steps/mm

For threaded rods, use:

[(360/your motor steps)*(microsteps)]/[(TPI)*(25.4)]

Example calc is the same just use 25.4 to convert from inches to millimeters.

These are good starting points. If you need to adjust further to make it more precise (and you probably will), take what you calculated and divide by what you saw and multiply by that number.

Example: Let's say you calculated the Y axis to 100mm but it actually moves 94mm. Your machine is off by 6mm. 100mm/94mm = 1.0638. 100*1.0638=106.38. Input $1 106.38 in Command and use that to compensate your axis to 100mm.

I had to do this for my Y (scanner) because I believe there may be some gear linkage that threw the ratio off. Now when I say to move 10mm it does.

You could also try going here:

These first three ($0, $1 & $2) are your main focus and if you want to change/learn about the other settings, use this link:

Step 12: Inkscape Quick Tutorial

You probably want to do a cool design for your test, huh?! So did I, but had no idea how to use Inkscape. I will try and bridge that gap with a very basic tutorial which simply gets you to an image. There are many great videos on YouTube that can help further your knowledge after this. So go ahead and find an image you like.

Note: I hear if you google an image, try to get one from the "transparent" tab. It would make it easier to convert to bitmap.

Note: when I tested this on my CNC plotter, it ran backwards (more on that in the next step). Therefore, I Needed to "Mirror" My Image!

After you download Inkscape for free from their website do the following:

Note: My version of Inkscape already came with the gcode tool plug-in but if you have trouble getting it let me know I will make an update.

1. Open Inkscape>File>New>Default

2. Click Document Properties and choose your boundaries in Custom Size for your bed. (I like millimeters)

3. Click Layers>New Layer. I name layer 1" Boundary" and layer 2 "Work"

4. Highlight the boundary layer and on the left tool bar, Click Draw Bezier Curve (it looks like a ink pen with a curved line)

5. Click the top left corner then the bottom left corner and lastly the bottom right corner of your boundary box>right click outside the boundary box. You should see dashed lines on your boundary box now.

6. Go back to left tool bar and select the regular cursor>Click Extensions>Gcodetools>Orientation Points

7.Choose 3 Points Mode, and a Z depth of -1

8. Choose File>Import>Select your picture

9. Click and drag to highlight the image>Ensure image is in your boundary box>Click Path>Trace Bitmap

10. Choose 'Color Quantization'>in Colors, choose 2 (this is black & white only)>Click Update. You may also have to click the box for Invert Image.

11. Click View>Display mode>Outline. You should now have a good outline of your image and also a Red box with an X. This is the original image and You Should Delete It.

11 1/2. (if you need to mirror your image, highlight it and Click Flip Horizontally)

Now you have your vector image you can use with the plotter or a laser.

12. Now you want to Click your image and Cut>Highlight the "work" layer and Paste it to "work"

13. Lock 'Boundary' by clicking the little lock by the eye in the layers box

14. Click image>Click Extensions>Gcodetools>Path to Gcode.

15. In the Preferences tab you want to make sure it is in your preferred units (mine was mm), then set your Z height to something safe and something your machine is capable of (like 2 mm) so it doesn't run into your completed work, and in Directory, save whatever folder or whatever you want it to.

16 Click the Options tab the Set Along Z is at 0.1, and the Minimum Arc Radius is (from what I understand) how deep the medium will plunge into something. For example, with an ink pen, I keep it at 1. If your had a router bit, you would want it to plunge into the wood or plastic, etc to cut out your object. Set it for that medium then.

17. Click the Path to Gcode tab and make sure Cutting Order is 'Subpath by Subpath,' Click your image so that it is highlighted and hit OK. A pop up will say something like, 'Cutting tool not defined.' If you're using a pen, it is fine, Click OK.

18. In the Boundary layer it will spit out a path box. Go to your folder you saved to and look for your image title.

19. Open with notepad>All text above the G21 you can delete

Some things to look for: Your gcode should say something at the top about a cutting tool and the next line should be a G0 (or G00) followed by a Z number (i.e. Z2.0). That should be what safety height you set above the work. Make sure it is properly positive or negative based on your CNC. Then it will go to some X & Y and the Z will start to plunge into your work (i.e. Z-0.1) . Again, Make Sure it is properly pos or neg depending on your machine.

20. Save your work.

My machine's Z raises up by going more negative so I had to double check this. And Again, I had to mirror my image. Just be sure you proofread your Gcode.

I never ran into a problem but I hear GRBL has a 50 - 70 characters per line limit. So you may want to choose "Round all values to 4 digits" in the 'Preferences' tab.

Now that you have your Gcode saved, let's plot for goodness sake!

Step 13: The Plotter

At this point, you probably just want to test this contraption and move on. This is why my pen plotter is quite crude, but for the sake of progress, it worked...eventually.

You simply perform the following:

1. Ensure there is power to the laptop and the power supply to your CNC

2. Open GRBL Controller

3. Open your COM port

4. Once it is loaded, Choose File for your image

5. The image will be in the Visualizer tab on the right. Again, proof the boundaries.

6. Click Begin

Granted, my first good plot was after many failures. Here is a recap:

* Like I mentioned in the prev. step, I didn't mirror my image and therefore, my CNC ran "out of bounds" since I didn't add end stops. The CNC had no idea it was trying to move beyond it's capability.

* I didn't double check my working surface in Inkscape and tried to draw at like 500 something millimeters out and sent my CNC way out of bounds. This furthers my want/need for end stops.

* Sometimes, and if anyone knows why please leave a comment, the CNC was running the Gcode over and over. This threw it out of bounds again. Perhaps there was a command in the gcode to restart the file??

* My wood surface area caused the image to have rough spots that made for a far from smooth plot.

* That very first failure was an image from the interweb that I converted, but I had no idea about the mirroring problem. I wanted to see what the plotter was doing so I knew what to do to proceed. To accomplish this, I manually drew (in the proper boundaries mind you) a rectangle and a small circle. When it plotted them I knew it was a mirror image of what was actually shown in Inkscape.

Step 14: Your Laser Diode-ectamy

I will show you how to remove your laser carefully, but again, look for an update to go further with a laser on this CNC.

1. You will want to locate the DVDr laser on the laser diode (LD) assembly you removed earlier. I was fortunate to have the CD IR laser labeled (pic 6) but I was also able to google the specs on the brand (pic 1, 2 & 3).

2. Snip the ribbon cable off (pic 7) and secured it to a vise (pic 9) or something robust. You do not want to crush the LD as it is very delicate.

3. My front panel was, however, removed by snapping it when I initially secured it to the vise. This was a happy accident, so please be careful (pic 10)!!

4. Remove the back part of the heat sink by utilizing a hack saw and carefully running it along the top and then swapping to the bottom. I did that back and forth little by little until I was able to use my hands to jimmy it apart (pic 11).

5. Buy laser goggles for the wavelength your LD operates in!!!!!!!

My laser operates in the Visible Spectrum that we humans can physically see at 650nm which is red. Since this laser is a class 3B IT WILL BURN YOUR EYES!! Please take that to heart and use special laser glasses that will filter out this wavelength. They are pricey but you only have one set of eyes! So spend some moneys to protect them. I saved this laser to add to the CNC as another attachment for a later project.

Step 15: Maybe Lasers Aren't Your Thing...

But 3D printing is!!

I will take some of the steps from gigafide's instructable (Which rocks, btw. Check it out) and use a 3D printing pen as our medium. He has a solid method to disassemble the pen and figure out how to get yours to work with the arduino. I will briefly summarize and add some pointers:

1. Unscrew the back

2. Disconnect motor & power jack

3. Unscrew & pry off power jack (be careful, this is a little tough and requires some finesse to not snap the tabs. However, I did break a tab and it still snaps back on no problem.)

4. Remove slide and slide button bar (push it out and away)

5. Unscrew the plastic filament tube & remove

6. Remove nozzle

7. Slide out the circuit board

8. Slide the pins of the nozzle back on and re connect the motor and power jack

9. Plug in the jack and heat your pen.

10. Figure out the two of four solder leads of the forward extrusion button that will power up the pen using the arduino. Touch two leads to each end of a 1K ohm resistor to figure out which ones will start the extruder.

11. Solder the two leads with wires being careful not to use a lot of solder. I drilled a hole in the back case to facilitate getting the wires out. (I should have made my hole closer to the power jack end honestly)

12. I had to use a longer length of my red wire because I had to maneuver it around the filament tube and out the hole. The first time I was going to put everything back together my solder joint came undone, even with hot glue holding it down due to the stress of its position. The second attempt, I prebent the wire in a U shape, soldered and then hot glued it before getting it out the hole. This worked out very well.

13. Solder pins or a male jumper pin to the pen's wires for ease of use with the breadboard (unless you plan on making your own circuit board).

14. Test the wire of the pen with the resistor while it is powered up to make sure the extruder motor still runs properly.

15. Reassemble the pen in the reverse order.

Step 16: Arduino Switch Circuit

I followed the steps of gigafied's arduino switch circuit and it played out very well. I do not recall the instructable stating what kind of transistor he used but I wound up using a 2N222A NPN transistor and a 100K Ohm resistor in the end. The plan is to find a resistor that has a resistance high enough so it will not allow ground to power the pen when you Don't want it to but low enough so when current is applied, the pen will power on when you Do want it to.

To make the circuit:

1. Connect one of the 3D pen's wires to the emitter (E) and the other to the collector (C) (it doesn't matter which)

2. Connect the arduino GND to C on the transistor and a resistor on connection to the base (B) pin of the transistor.

3. Power up the pen, leave arduino off

4. The other end of the resistor will be connected to GND on the arduino. (Pic 1) Start with a 1K ohm resistor. (We already saw from the previous step that when connected to ground, a 1K ohm resistor powers the pen. This is just a reference point)

5. If it turns the pen on, use a 10K ohm resistor and try again.

6. If it turns on, use a 100K ohm and so on until the pen does Not turn on.

7. Now that you have the resistor that will keep the pen off when connected to ground, you need to see which one will allow it to turn on when current flows. (So that means if you have too high resistance blocking current when powered up normally, then the pen will not run.)

8. Power up the arduino.

9. Take the wire connected to the resistor from Ground and connect it to the 5V pin on the arduino. (pic1 same set up except yellow wire going from GND to 5V pin)

10. If the pen does not turn on, the resistance is too high. Move to a lower resistor, i.e. 47K ohm.

11. If the pen still does not turn on, use a 22K ohm and so on.

Quick Recap:

Gnd/Gnd - 1K on, 10K on, 100K off, done.

Gnd/5V - 100K off, 47K off, 22K on, done. 22K is your resistor.

You want to take big jumps finding the ground resistance and then when the arduino is powered up lower it gradually between those levels. Hence, why in the example we went from 10K to 100K (ground, big jump), then from 100K to 47K to 22K (current applied, smaller jumps but higher than the 10K ohm value). If you are on Gnd/5V and you get back down to 10K (I don't know why it would) something is wrong and check your connections.

When I read gigafied's instructable, I thought, "yeah I got it," but when I actually did it, it confused me a little. I hope between that and mine that I explained it well enough. Also, hopefully the pics help.

Step 17: GRBL the 3D Pen

Now that we have the pen communicating with the arduino (and we loaded the arduino with GRBL in the software step) we need to make sure everything is groovy when the GRBL Controller program communicates.

I had enough room on the end of my breadboard to stick the transistor switching circuit on and connect it to the arduino. (pic 1) Attach the pen wires to the collector and emitter like before and make sure the Arduino is connected to GND and Pin 12. Power up the 3D pen, the power supply, the computer and run GRBL Controller. Open the COM port that the arduino is communicating with.

To test the pen you should try two things.

1. Click the box that says "Spindle." The pen motor should start the extrusion process. (You will notice in the big command window a M3 should pop up when on and M5 when off) Uncheck the box to turn it off.

2. Manually type M3 in the command box and press Enter to turn the pen on, and M5 to turn the pen off. That is G-code speak to turn your external medium on/off be it a pen extruder, laser diode or spindle for a router.

If it works, Awesome!!!

If not, don't fret. Neither did mine the first time. Turns out my pins I soldered to the pen's protruding wires came loose from dis/connecting all the time and I had to resolder them. I did that and then used a relative crap load of hot glue between the pin, the exposed wire and the protective plastic to keep it stiff and robust so that I could connect and disconnect the pen a lot.

Step 18: Mount the Pen

To get the pen on the Z axis and be as straight as possible was a tad more labor intensive than I originally thought.

I had those two standoffs protruding from the Z bed to act as a guide. Then I predrilled some holes on two pieces of scrap wood. I hot glued the pen to the wood on one side first, then as the second piece was in the standoff, I straightened the pen as much as possible and hot glued the second side.

Two things (pic 1):

1. the CD rom platter was too high, and

2. the 3D pen was too low

This made my little CD rom motor too stressed trying to "pull" the pen up when sending the Up GRBL command. The axis would move down no problem, kind of like how rolling a log down a hill is fine but pushing it up the hill, rough. This trashed my first nozzle because with no up motion, all that plastic flooded the nozzle and solidified. More on that later.

Learn from my mistake (check out the vids in the last step involving troubleshooting).

Plan accordingly (pic 2). I had to drill two more LEVEL holes and re-lineup the pen to the wood to be hot glued. I also raised the bed 1 cm. Only 1 because any higher and the Y platter would run into it...bad news. (Pic 3) is the final hook up.

Step 19: Enhance...Enhance...Enhance...OH Just Print the Darn Thing!!!

To make a test 3D print, I used

1. Open the webpage

2. (optional) In the upper right hand corner, change 'inch' to 'cm'

3. Click the 'hand' in the top left and use it to drag the grid to get your 0,0 axis to show up. You could also use the '+' or '-' if you so choose

4. Click 'Insert' and choose a shape (The hexagon I show in pic 4 has a radius of 1.5cm)

5. Click on the 'arrow' in the top left and click and drag to highlight the shape. It should turn a red orange color

6. Drag the shape to the 0,0 mark on the axis

7. Make sure your bed can accommodate the size of the shape

8. Click 'CAM' > 'Follow Path Operations'

9. Change the name, if you like. "Target Depth" is the height of your finished object. Change it to whatever you want. (I set mine to -1, this may not have been a good idea moving in increments of 0.33 because of the very small room between 0.99 and 1, however, it still worked fine) "Safety Height" & "Stock Surface" were set to 0. "Step Down" is the height of each layer of filament. I set mine to 0.33mm. "Feed rate" & "Plunge rate" I set to 100 each. They are the rate your pen extrudes and moves, resp. After my first nozzle clog, I set the 3D pen speed knob to its Slowest Setting!!

10. Click 'CAM' > 'Calculate Setting' and it should outline the path.

11. Click 'CAM' > 'Export GCode' and it will save your shape.

12. Open the file with Notepad and we need to make some mods to the gcode.

13. Every line that says "G0 Z0" delete it and replace with "M5" This will keep the nozzle from pushing into the bed (and ultimately your print) and stop the pen extrusion motor.

14. There is a line towards the top that says "G17" and below it is "M3" Delete that M3. That starts the extrusion too early. Instead, place a "M3" in the immediate next line following a "F100"

15. After the last "M5" place a new line saying "G0 Z-2" I make it say Z-2 because that will move the pen up and away from the printed piece after it is all done.

16. To move the whole thing away from the printed piece, place a "G0 X10 Y10" command after that "G0 Z-2" line. Or you could zero the thing and use "G0 X0 Y0" it is up to you.

Note: Similar to my pen plot, I had to change all of my "Z" coordinates from negative to positive based on that axis. My first print kept plunging into the bed and made a huge blob of plastic. After changing all my Z coordinates to positive numbers, everything was fine. So be aware that you may have to do this, too.

17. Save your code and Open GRBL Controller

18. Ensure all your gear is powered up

19. Open your COM port and after it loads, click 'Choose File' and load your shape file. The 'Axis Control' tab will change to your image in the 'Visualizer' tab and show its path.

Note: Double check your work and make sure your boundaries are right and your motors won't go out of bounds.

20. Click 'Begin' and watch the magic happen!

If you have the gcode cheat sheet and you are curious, you will notice that M6, M30 and G17 are not on there. Want to know what they mean?

M6 = tool change, no need to worry about that here.

G17 = selects the XY plane, it does this for your print. (on that note, G18 = XZ, G19 = YZ)

M30 = ends the program

So that is it in a nutshell. The program begins and starts the extruder, selects XY plane, prints layer, moves up, prints second layer, etc, stops, moves away and terminates the program. While is cool for basic stuff, I am looking a program (preferably free) to produce my own 3D objects to be converted to usable Gcode. 123D Design is cool but no Gcode...If anyone knows of one, please leave a comment. I figure there has to be a forum or something out there that would be helpful for this.

Step 20: Side Bar: My Personal Experiences and Various Troubleshooting.......... Lots and Lots of Troubleshooting

If you don't care about my troubleshooting/misfortunes and how I worked through them, then that is it.

This step is to aid first timers to see how I tried and failed (A LOT) with the planning, constructing and test printing. Many instructables show the direct path to the end without detours and that is perfectly fine. It wasn't so cut and dry with me and I think it may be useful to see how I hit bumps in the road along the way and, as much as I wanted to, did not give up. . .

My problems/solutions along the way:

* Figuring out the electronics/construction --> I knew I wanted to build a CNC machine & I had junk laying around and my wife doesn't like clutter. Solution: Here! Instructables has some brilliant and talented people posting projects and tips and whatnot. Use them. They know a LOT more than me concerning the planning, constructing, electronics, and programming. I am just trying to shed some light on the fact that with little knowledge and just a drive to have my own 3D printer built by myself, I succeeded! And you can, too! My hope here is give another perspective to help anyone out in their future production. Take Away: Read a little into something you are interested in and gain confidence.

* Actually getting started --> This may sound silly but with all the scrap and just an idea of the final product, I was quickly overwhelmed with how am I going to start. Solution: I literally took me about 8 months going through my disassembled parts, getting a game plan and all the electronics. That and juggling a work schedule. I tried to bargain shop for most things I needed to purchase. At most points that was great but other times I needed to fork over some cash to get good stuff. Planning is key. Mainly it was how I was going to mount the X axis carriage to the Y scanner. I had to search for a good old printer carriage. This is why there are gouge marks and dremeled off edges of the scanner bed plastic. But, once I actually did it, I was off! I was also waiting for the Christmas sale of a certain pen... Take Away: Plan, double check and plan some more. Oh and then double check that.

*...Deciding what 3D pen to actually use --> I really wanted to do this project with the 3Doodler 2.0. What's wrong with that? It is lighter (50g compared to 63.5g that mine pictured is, that is a 24% difference), it is sleek, and it has interchangeable nozzles. The problem was finding pics of the insides to see if I could Actually hack it like gigafied demonstrated. I didn't want to waste $100 ($80 if you wait for a certain craft store's sale) on a pen that I may not be able to successfully hack, esp. without pictures. Solution: I went with the cheaper, (and potential) sure thing.Take Away: Do what is in your budget and go for it.

* The Z Easydriver had no power when on the breadboard while X & Y did --> This is explained in the step The Electrical Connection pics #5 & 8. I didn't know those long breadboards have a partition in edges two power lines. Solution: I used a longer jumper to make the power connection. Stumped me for about an hour until I noticed the longer gap, as seen in pic 5's caption. Take Away: Check the power flow and any divisions in your bread board.

* The plotter went haywire --> My inkscape limits were set wrong, the gcode printed over and over and the image was mirrored. Solution: The limit was an easy fix, the gcode printing over and over, I have no idea. Please leave a comment if you know where I went wrong. And the mirror image problem, I am also not sure why my CNC defaulted to this. I read from the Frankenstein laser instructable that he made a note to mirror the image, too...hmmm. Take Away: Do a thorough test image to see if what you do is mirrored or not first.

* The Z axis...the scourge of my project--> CD rom stepper motors are high maintenance dates, if they aren't happy, they bail with no regards. I had to deal with more precise soldering, mounting, and the dreaded wiggle (with no movement) problems. Solution: deal with the individual problems as they came. Bad solder? Replaced. Bad wires? Replaced. Mounted too high? Drill new holes and remount. Take Away: All the little things add up to frustrate me and I just dealt with them individually.

* The 3D pen wasn't straight on my first mount --> bad for symmetric 3D printing. Solution? do it over again. NBD Take Away: use a level.

* First 3D test! Holy crap it is working, It Is Actually Workin... The nozzle jams with filament and I got an error code on the pen. With the nozzle cooling, so does the plastic. --> The nozzle is now essentially useless. Solution: order a new nozzle and, like a surgeon, carefully remove the jammed nozzle and solidified filament without destroying the hard work & time spent on the current pen circuitry. Take Away: Start extrusions tests slow and adjust accordingly.

Thank goodness, the new one worked and powers on without an error code!! :D

* I glued the wood supports on the pen too low --> This caused strain on the Z (CD rom) motor and it did that stupid wiggle jiggle where the axis doesn't move up nor down. Solution: This was too much weight for the Z axis to "drag" up. I tested it without the pen on and the Z motor moved just fine leading me to want to remount the supports.

* So... I glued the supports for the pen higher realizing --> the bed was now too low to get contact between the bed and the nozzle when the z axis was in the full down position. Solution: re-drill the CD rom drive so that that was mounted in a lower position & raise the bed 0.5 cm. (any higher and the Y axis would run into the bed and that is just no bueno) Take Away: Again, planning. Measure twice before you commit to rearranging, drilling or cutting

* After remounting the Z axis and the pen I went to do a retest. How is that a problem you might ask...well once again, my CD rom stepper motor was --> wiggle jiggling with what I thought was a better set up and this was after I checked the motor motion with no load and it was fine. So I removed the pen once again to make sure the motor was fine. This is where I thought the motor died because it just wiggled, with no motion up/down, and with no load! Check the resistance continuity of the wires and the current of the Easydriver and every thing seems fine. Solution: After such a stressful ordeal, I decided that, as much as I didn't really want to, I had to disconnect the entire Z axis and start from scratch with the wiring. My homemade jumper wires soldered from the motor to the breadboard failed catastrophically. I replaced it all with bigger 22AWG wires, soldered the pins and it worked just fine. WIGGLETAKE AWAY: The CD rom wiggle is an odd thing. I searched the vastness of the interweb & many forums, sometimes months apart, and there is good information. (Check the resistance continuity, voltage is high enough for the easy driver, easy driver potentiometer current adjust, the pin out to the arduino, the pin out from the motor itself, LED tests) However, in my case, none of it helped my motor. I can probably say that 100% of the problem was my soldering. Close motor pins should be avoided if possible. Soldering (carefully) extending pins helps. And if you splice jumpers to wires in an attempt to extend said wires, don't unless you really know what you're doing. I thought I did and I just made more heartache for myself. I took a short cut and paid for it. I should have started out with buying 22AWG wire and doing it that way instead of frankensteining my own longer male to male jumper wires.

So I like to end with a kind of...yeah. That is pretty much it. I am so glad that everything works with the pen and the 3D pen. I look forward to getting the rest of my laser supplies and rastering an image in the (hopefully) near future. I hope this helps those out there for making their own CNC!!

Make it Move Contest 2016

Second Prize in the
Make it Move Contest 2016

Full Spectrum Laser Contest 2016

Participated in the
Full Spectrum Laser Contest 2016