Mini CNC Milling Machine

by TheMakerMachine in Workshop > CNC

23719 Views, 273 Favorites, 0 Comments

Mini CNC Milling Machine

finished_product.jpg
Mini CNC milling machine

Hi friends! In this Instructables, I’ll show you how I designed, fabricated, assembled, and got running this mini CNC milling machine. I love fabricating and I wanted to make a (relatively) low cost CNC mill to have at home during the pandemic. I also want to give a big shout out to the Jacobs Institute for Design Innovation and UMakers Makerspace for providing me the resources for this project. Additionally, inspiration for this project was drawn from these projects: [1] [2] [3]

Supplies

Here is a link to a spreadsheet for my bill of materials. It includes the quantity of individual parts in case you already have access to some, as well as links for some of the parts I bought. The parts for this project cost me approximately $375 not including my makerspace fee.

Tools:

  • CNC Router
  • Hand drill
  • Drill bits for pilot hole for wood screws
  • Hacksaw/other type of saw (for possibly cutting the linear rod and lead screws)
  • Allen keys (listed in the bill of materials)
  • Very little soldering
  • Wire cutter/stripper
  • Multimeter

Design

full_assembly.PNG
full_assembly1.PNG
spindle_mount.PNG
z-carriage.PNG

I made this frame using a CNC router with 0.5in (~12mm) thick plywood. I was able to use the shopbot at my local makerspace UMakers in Claremont, CA. This design would be difficult to cut with hand tools so if you don’t have access to one I would suggest trying this design instead.

Additionally, if you are interested in making modifications to this design, I have attached the Solidworks (2020) files and a step file here.

Fabrication

toolpath.PNG
toolpath1.PNG

I made the toolpath using Fusion360 and have attached a step file of just the frame laid out flat as well as the .f3d file with the CAM for the tools I used. For this toolpath I used a 1/8in flat endmill with a feedrate of 3in/s=180in/min. The parts can be cut out of a 25inx17inx0.5in plywood sheet. It will cut 0.04in into the spoilboard and I put in a lot of tabs. I attached the gcode file for the shopbot but I recommend going into the file and double checking and adjusting the settings to your preferences. All the files can be found here.

Assembly - 1

181167936_131538355580307_4456705977325757777_n.jpg
182103752_4026716267397678_1855140117271286079_n.jpg
182255736_490165799097253_9051587889698675368_n.jpg

Now the assembly for this design can be a little tricky because we want to ensure that there is no binding or extra friction in the moving parts. Because we are using wood screws to assemble the frame, it is harder to ensure that everything is at 90deg angles. For each axis, before it is screwed together, we want to put in the linear rods to make certain that it will align and then add the wood screws.

First assemble the base (without adding the wood screws) and loosely screw in the four x-axis linear rail supports with M5x20mm screws and nuts. Then add two 300mm linear rails and tighten the screws. It is important to put in the linear rails before using the wood screws to ensure alignment.

Assembly - 2

179479074_1565453076977222_6592851996820029459_n.jpg

Drill pilot holes (not pictured) and then the wood screws as shown in the photo. If you don’t use pilot holes you run the risk of splitting the wood.

Assembly - 3

181510610_252903666579479_1162452016460361082_n.jpg
180111244_808467939781711_3492205022704683825_n.jpg

Now connect the y-axis pieces (without wood screws) and add the four linear rail supports and two 300mm linear rails.

Assembly - 4

180111244_808467939781711_3492205022704683825_n.jpg
182499012_482677516278107_1634623502894032653_n.jpg

Now add pilot holes and the wood screws.

Assembly - 5

181544978_830098454267926_4160509502609313276_n.jpg
182428336_154058843324383_2246188895648258009_n.jpg

Add the x-axis nut holder piece, drill pilot holes and then add in the wood screws.

Assembly - 6

181543301_288342226167322_8807593783077803852_n (1).jpg

Screw in the lead screw nut using M3x20mm screws and nuts and the linear bearings using M4x16mm screws.

Assembly - 7

180661558_182582993717770_4036974082517879235_n.jpg
181343352_4622944121055136_7185122913243222829_n.jpg

Now remove the x-axis linear rails from the base and place the y-axis carriage such that the linear rails can be slid through the linear bearings and tighten the screws to fix the linear rods in place.

Assembly - 8

180438216_784084695581877_4773605897444568726_n.jpg
181188932_201399544958364_4869807430597395786_n.jpg
180505452_970100773394432_479452893876600026_n.jpg

Screw in the pillow bearing block using two M5x16mm screws and nuts as well as the x-axis motor using four M3x12mm screws. Then add the motor shaft coupling. After, slide the lead screw through the bearing end (you may need to loosen the set screw), thread it through the lead screw nut and into the shaft coupling. If you’re having trouble getting it to fit you may need to loosen the linear rails or the linear rail supports to get it to all line up.

Assembly - 9

180791934_1427132080959799_6461298669358183994_n.jpg
2180791934_1427132080959799_6461298669358183994_n.jpg

Additionally, you can add the y-axis motor and pillow bearing block.

Assembly - 10

176439936_795393317837259_4927731397526859705_n.jpg
180857420_2827552960794933_2085985483024242149_n.jpg

Similarly, with the z-axis carriage, assemble the pieces, add the linear rail supports and linear rails before drilling the pilot holes and adding the wood screws.

Assembly - 11

181120897_891074921459184_5811087071530309581_n.jpg
179631627_890320481863644_6189795236680288399_n.jpg
180944566_217759493100463_234009535349582207_n.jpg

Next add the y-axis nut holder piece, drill pilot holes and then wood screws. Then add the lead screw nut.

Assembly - 12

182632559_169898261602340_6012702674745220675_n.jpg
180619227_912044432924222_4870071255975685126_n.jpg

Now when adding the linear bearings put the linear rails through before tightening the M4x20mm screws to ensure they are aligned. You may have to loosen and tighten again when they are on the y-axis. Additionally you can add the z-axis motor and pillow bearing block.

Assembly - 13

180460257_1442259989449658_9191530380660083231_n.jpg
179221875_133526948794111_416692214394210852_n (1).jpg
181091958_275016420926122_8588604307074183023_n.jpg

Next, take the z-axis nut holder and screw in the lead screw nut. Then add that piece to the z-axis carriage. After, drill a pilot hole then add in the two small wood screws.

Assembly - 14

181431165_4132443786819329_7451754616583630045_n.jpg
178158591_162035539181897_8513922523555074247_n.jpg
178906507_844429366150827_501428309031892178_n.jpg

Place the M6 screws in their pockets before putting the linear bearings on top and screwing them in with the M4x20mm flathead screws. Tighten the screws so that they are flush with the wood.

Assembly - 15

180430247_905085523672967_7410752281251894381_n.jpg
180247568_317078509777768_5748517944165745295_n.jpg

Screw in the spindle clamp. You may have to tilt the part to ensure the screws will engage with the M6 nuts.

Assembly - 16

179221875_855323618394278_508778771959091469_n.jpg

Now slide the x-axis 150mm linear rods through the linear bearings to connect to the z-carriage. Then slide the 150mm lead screw through the pillow bearing block and thread it through the nut and into the coupling. This part was the trickiest for me to get aligned. It may require some loosening or even adding the spindle after the lead screw is threaded in.

Assembly - 17

182594247_921170395399359_8807779214201353994_n.jpg

The last step is to get the z-carriage onto the y-axis so repeat the process again of taking out the y-axis rods and sliding them through the linear bearings then threading the lead screw through the nut and into the coupling. After everything is put together ensure that all the screws are tightened very well including the coupling set screws and especially everything on the z-axis.

Assembly - 18

182472724_512778093077888_7994728414089016666_n.jpg
180606604_983993775742004_2687121617083599589_n.jpg

The very last thing you will want to do is slide the spindle up in the spindle clamp so that you have as much z-range as possible. To do so, loosen the M6 screws (not so much that it completely unthreads from the nut) and use a flathead screwdriver to widen the space in the clamp and slide the spindle up. Then tighten the M6 screws and you’re finished with the assembly!

Electronics

For the microcontroller+breakout board you can go with either the Arduino Mega 2560 + Ramps 1.4 or the Arduino UNO + CNC shield expansion board. The latter is cheaper and perhaps better for this purpose and the former is more typically used for 3D printers. I will be using the former because it is what I had access to at the time (though I would probably go back and change that). If you are interested in the latter option, there are many resources for how to use that.

Electronics - 1

motor_wires.png

Motor wires

Firstly you want to ensure that your motor wires are long enough. I chose to keep my microcontroller a little away from the machine so it wouldn’t get so messy so I needed long wires. You can extend the wires yourself if you have some and a soldering iron otherwise you can buy some long wires.

Secondly you want to have wires with the correct connectors. The wires linked here work for these motors but if you buy others, you want to ensure that they have the black dupont connectors on the end. The other tricky thing is checking that the wires are in the correct order. This depends entirely on the motor so you’ll have to check. Here is a resource for using a multimeter to check which wires are part of the same coil. The ones part of the same coil should be next to each other. If your wires are wrong, switch them. It doesn’t matter which coil is on the left two or right two wires because that will only change the direction. This can be modified in the firmware or by flipping the way the motors are plugged in.

Electronics - 2

Spindle wires

The wires connected to the spindle will need to be extended as well. I used 18 awg wire and soldered it to the wires coming out of the spindle then heat shrink around the exposed wire (you can also use electrical tape). You might be able to avoid soldering but really be careful that you don’t let the wires come loose or touch.

Electronics - 3

power_supply_wiring.png

12V power supply wiring

Connect the module plug fuse to the power supply as shown in the picture. Then wire the V+ and V- terminals to the green phoenix type connector using 18 awg wire. You can also 3D print a housing but make sure it fits your module plug fuse.

Electronics - 4

spindle_power_supply_wiring.png
180197520_410540760275846_9033761278758823460_n.jpg

Spindle power supply

Connect the module plug fuse as shown in the picture. The potentiometer (knob) was already plugged in for me and is used to change the spindle speed. (I have only been running it at max speed so far) Connect the spindle wires as shown and don’t mix up the order because then the spindle will spin the opposite way which will cause problems.

Electronics - 5

jumpers.png
180174877_2599532320341293_8771344219158487886_n.jpg
181489729_310819640409820_1107085851212171277_n.jpg
182069121_275745064223631_2203864693045967036_n.jpg

Stepper motor drivers

Firstly, plug in the little jumpers onto the RAMPS board as shown. These will allow us to microstep (which I won’t explain here but there are many resources on it). With all of them in we will be at 1/16th microstepping mode.

Secondly, it is a good idea to set the current limit. Follow the instructions at that link. You’ll need a small screwdriver and a multimeter. You can plug the stepper drivers into the board and turn on the power source and then set the limit. Make sure you orient them the correct way when plugging in.

Electronics - 6

cnc_axes.png
ramps_axes.png

Route wires and plug everything in

I used some cable sleeving to route my stepper motor wires and plugged them into the correct pins on my RAMPS board. The pictures show how I chose the x,y,z directions but you could potentially switch the x and y directions.

Firmware

For this project I used the Marlin firmware because that is what I was familiar with but if you were to use the Arduino UNO microcontroller+CNC shield I would use grbl firmware. First start by downloading the Marlin firmware. You will need either Arduino IDE or VS Code to edit and upload the firmware. Open the configuration.h file and make the changes listed below. Notes are listed in italics.

Marlin 2.0.7.2

L.130 BOARD_RAMPS_14_EFB

Choose BOARD_RAMPS_14 the ending doesn’t matter because it isn’t a printer

L.144 EXTRUDERS 0

L.744 DEFAULT_AXIS_STEPS_PER_UNIT { 400, 400, 400, 500 }

https://blog.prusaprinters.org/calculator_3416/ (leadscrew pitch = 8) These values may need to be tuned.

L.751 DEFAULT_MAX_FEEDRATE { 120, 120, 30, 25 }

L.746 DEFAULT_MAX_ACCELERATION { 400, 400, 100, 10000 }

L.799 DEFAULT_ACCELERATION 400

L.781 DEFAULT_TRAVEL_ACCELERATION 400

L.793 #define DEFAULT_XJERK 3.0

L.794 #define DEFAULT_YJERK 3.0

L.795 #define DEFAULT_ZJERK 0.2

L.828 #define S_CURVE_ACCELERATION (uncomment)

L.1089 #define INVERT_X_DIR true

L.1090 #define INVERT_Y_DIR false

L.1091 #define INVERT_Z_DIR true

The last 3 lines change the direction of the motors so if you later find that it is moving the wrong direction, change it here.

CNC Control Software

To connect my computer to the printer I used pronterface. It’s meant for 3D printing but is one of the few interfaces that will connect to the Marlin firmware. (If you are using grbl firmware you have more options.) Open the application, plug your computer into the microcontroller, and connect to the machine. Once connected, use the buttons to move in the +x -x, +y -y, and +z,-z directions. Ensure that positive is in the direction you want it. Remember that since we are not using limit switches/endstops the machine has no idea when it will run into a wall so be careful not to move it outside of its limits. This is especially easy to do by accident with the z-axis.

Post Processor

post_process_settings.png
post_process_mm.png

After making a toolpath in Fusion 360 or some other CAM software, we need to post process it into gcode that the machine can understand. This will depend on the kind of firmware you use, so we need a custom post processor for the Marlin firmware. Download the post processor here and add it to Fusion 360 according to these instructions.

Once added to Fusion 360, select the DIYCNC_Marlin20 post processor and change the settings shown in blue text in the picture. This will prevent the z-axis from running into its limits.

And always make sure you change your units to mm if that is not the default you are working in! I think you have to change it every time you open Fusion360 which is inconvenient and I will often forget. If your units are in inches, then your machine will try to move 0.2mm instead of 0.2in and it will look like it is not doing anything.

Test Cuts!

toolpath.png
180274505_2778584115805320_140963624657145406_n.jpg
181751033_1440278436307715_7333907610876118829_n.jpg

Ok finally we can do some cuts!

First, make a toolpath and post process it using our new custom post processor. After some testing, I have found that a feedrate of about 1in/s=60in/min works ok for this machine with softwoods and MDF.

Then, open pronterface and connect to the machine. Ensure that everything is moving smoothly. Move to the location you would like to be X0,Y0,Z0 according to your toolpath ensuring that there is enough room to complete the toolpath without hitting the sides. The post processor will set the starting location as X0,Y0,Z0. Plug in and turn on the spindle (which is not controlled by your microcontroller) and set it to the highest speed with the potentiometer. Then click the load file button to upload your gcode and click print to start. Be ready to quickly turn it off if something goes wrong.

I've attached pictures of my first successful run with softwood and my first successful carving out of MDF.