Introduction: Mini CNC Milling Machine

About: My name is Miyuki and I love being involved in all things makerspace related! Right now I teach in and manage a university makerspace and I enjoy building tutorials that students can follow to build their fabr…

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

Step 1: Design

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.

Step 2: Fabrication

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.

Step 3: Assembly - 1

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.

Step 4: Assembly - 2

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.

Step 5: Assembly - 3

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

Step 6: Assembly - 4

Now add pilot holes and the wood screws.

Step 7: Assembly - 5

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

Step 8: Assembly - 6

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

Step 9: Assembly - 7

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.

Step 10: Assembly - 8

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.

Step 11: Assembly - 9

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

Step 12: Assembly - 10

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.

Step 13: Assembly - 11

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

Step 14: Assembly - 12

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.

Step 15: Assembly - 13

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.

Step 16: Assembly - 14

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.

Step 17: Assembly - 15

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

Step 18: Assembly - 16

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.

Step 19: Assembly - 17

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.

Step 20: Assembly - 18

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!

Step 21: 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.

Step 22: Electronics - 1

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.

Step 23: 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.

Step 24: Electronics - 3

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.

Step 25: Electronics - 4

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.

Step 26: Electronics - 5

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.

Step 27: Electronics - 6

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.

Step 28: 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.

Step 29: 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.

Step 30: Post Processor

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.

Step 31: Test Cuts!

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.

CNC Contest

Participated in the
CNC Contest