The Most Affordable CNC Machine

by Cagiva in Workshop > CNC

475 Views, 5 Favorites, 0 Comments

The Most Affordable CNC Machine

IMG_20210525_073705.jpg
IMG_20210525_073743.jpg
IMG_20210510_130635.jpg
IMG_20210512_143119.jpg
IMG_20210523_131435.jpg
IMG_20210523_123133.jpg
IMG_20210525_045444.jpg

SearchgoogleJust how cheap can you build one of these machines, and can it be built to be accurate and robust?

This is my 3rd attempt at such a machine and whilst not as simplest and affordable as it could be, it still works fine.

My main focus shifted towards good mechanics first, and then much later circled back to the electronics, without a detailed plan of the machine to start with it underwent, and is still receiving, constant change and improvement. With many more to come. Hence, I call this a prototype... not a finished tool. Yet, built for cheap out of total scrap (mostly).

The total cost of building the machine comes to about ZAR 590 (~$43) including shipping for the driver boards (Provided you pick up printer scrap, free or really cheaply as in my case).

The main objectives:

  • Must be suitable as a pen plotter (Doodles, layouts, PCBs, etc)
  • Should have an engraving attachment (Electromechanical)
  • Must have a decent build area: LWH 144 mm x 120 mm x 140 mm
  • Should be simple-ish
  • Must be as quite as possible
  • As affordable as is reasonable to achieve a decent result

Supplies

Lots and lots of small nuts and bolts (too many to count), sizes:

M4 x 8 mm

M4 x 10 mm

M4 x 12 mm

M4 x 16 mm

M4 x 20 - 45 mm

M5 X 60 mm (1 of)

M6 x 100 mm (3 of)

Plenty of washers (Various M4, M5, M6)

8 x Drawer Slides (4 sets) 30 / 35 cm

Some wood offcuts (Various)

Wooden board (6 x 180 x 250 mm)

Rare earth magnets (10 mm x 3 mm) for work holding

90 degree brackets X 10 (15 X 25 X 12 mm)

90 degree brackets x 6 (15 x 12.5 x 12)

Washing machine solenoid valves x 3

G2 Timing Belt (6 mm x 1000 mm)

GT toothed pulley X 4

5 or 12 volt 4 phase stepper motors X 4 (Salvaged from printers or 28BYJ-48-5V - no need for drivers ULN2003)

Adafruit/clone motor shield (If I'm not mistake the one used here is V2)

Arduino Uno or Pro Mini (I use a Cloned UNO R3)

ATX power supply or 12 volt 2 amp power supply

old cordless electric screwdriver or geared dc motor

Hook up wires

4.5 mm steel balls (24, if you don't loose any that is)

Small 100 mm cable ties

Stiff springs, 4 of ( 6 mm ID, no more than 20 mm length)

aluminium/steel flat bar 12 mm x 3 mm x 150 mm

Aluminium/steel plate (thicker is better)

Steel shelving brackets left and right 280 mm x 100 mm (From your local hardware or home improvement store) Ie: Sanlic Straight Left and Right Shelf Bracket (280mm or 305mm)

Other odds and ends

Special Tools:

step drill - metric 4 to 20 mm (inc. 2 mm)

Small Allen key set

Build the Frame

Firstly, the frame, for this machine a fixed gantry and moving table felt like a good idea and so I built around the gantry. After dismantling the drawer slides we're left with around three main pieces, two of which will form a nice linear slide - not very sturdy but surprisingly precise. Thus leaving one structural element. Bolt a pair of the larger elements together to form a rectangular tube. this will act as the base of the machine. Next fix the two shelf brackets and sliding elements to the base using a selection of 90 degree brackets and fasteners. The nice thing about using drawer runners is that a hole exists 90 percent of the time. Only when a new hole is absolutely necerary, drill through the sheet metal with a centre drill or step drill to avoid damaging the metal. Take care to clear out any metal chips.

Next, two more structural elements for the front and back of the bed frame (also fixed in place with brackets and fasters) and we have a rough outline to build on.

Carefully drill holes for the stabilising element seen 1/4 the way down from the top of the shelf brackets. This will stabilise the whole gantry and provide provide a fixed point for the Z axis to work against. It is import that the build is kept on a flat and level surface during construction of the frame. This is to ensure the maximum possible accuracy. You'll find that the runners are quite accurate from the factory and will fit together perfectly to produce very reasonable squareness.

First Axis

IMG_20210523_131850.jpg
IMG_20210525_041527.jpg
IMG_20210525_041042.jpg
IMG_20210522_171339.jpg
IMG_20210525_041638.jpg

The table of the machine should slide freely and be quite rigid. As wood is dimensionally unstable I tried to use it only as a brace or dampening material on the machine. However, some parts are just much easier to do with wood. Hence he two pieces in the front and back of the table. These members improve stability and allow us to attach a working surface. Using two of the smallest elements from a pair of sliders we can screw down 2 parallel bars and fix M4 bolts, pointing up through the holes. These bolts enable easy leveling of the bed and maintenance.

A single magnet on each bolt completes the assembly. A board can now be place over the magnets and be griped in place by resting more magnets on top.

The stepper motor mounts are made from drilling a suitably sized hole slightly off centre of a piece of wood to allow for the cabling to protrude. Next the finished brackets are pilot drilled and screwed in place on either end of the table assembly. The reason for two steppers is to increase torque and simplify the pulley arrangement. A tensioner spring fitted it the loop of timing belt takes up slack and give a little lea way when in operation. it is also acts as a relief system in case of a failure (ie: one of the steppers stops or the bed is halted). if tension into the belt increases beyond a certain point the spring will yield and cause the belt to slip, thereby eliminated damage to the pulley system.

the belt is fixed to the gantry by means of a M5 bolt passing through the base, in the center of the machine. A larger loop is provisioned when connecting the spring end and the bolt is passed through and held in place with a cable tie. Care must be taken to ensure that the belt is kept inline with the diameter of the pulleys (tangential).

The steppers are connected in parallel and then to the B side of the motor shield. With the Red wire connected to the ground (Centre terminal) of port A. Some effort is required to get both motors turning in the same direction.

In my case, two 8 mm ID 20 tooth pulleys were used. One fitted exactly over the existing gear on the stepper where as the second had to be filed down first. Pictured above, is a simple mandrel with the gear wheel mounted. I used a drill press at a high speed and a metal file to carefully smooth down the teeth to just under 8 mm OD. The grub screws of the pulleys bite nicely into the gear teeth and so there is no need to tighten them down a great deal.

Second Axis

IMG_20210524_182603.jpg
z axis lead screw.jpg
z axis lead screw build.jpg
IMG_20210525_041603.jpg
z axis lead screw full.jpg
IMG_20210525_041625.jpg

This part got tricky as the shelf brackets didn't have holes 90 degrees to the flats and so, fitting the slides was far more iffy. Since the slides rest at an angle towards the centre of the gantry, good stability is achieved with little play in the slides, however more friction is produced and the slides don't move freely. So far the build quality and overall ability of the machine looks to be promising though.

After a bit of trial and error, I found that leaving one half of the slides affixed to the gantry and completing the second half off the machine resulted in the best fit and squareness of parts. A second rectangular tube is made up, this time with a block of wood filling the hollow. This peace is then securely bolted at the foot of the second axis and forms its main structure. The second axis should have the for similar to a square, once all corers were verified as being square the nuts were tightened down as much as possible.

This axis uses a lead screw due to the significant weight of the parts. The lead screw and motor assembly is quiet simple and works better than expected. A simple thrust bearing was needed to reduce wear and improve performance. This item was made from two washers having 8 steel balls sandwiched between them. The cone shape can be achieved by pressing a centre punch trough the centre hole while resting the washer in a suitably sized socket.

A 125 mm M8 bolt is passed through the valve body's bracket and the thrust washer and locking nuts fitted. Next the 13 mm bolt driver is inserted and the motor pushed on. All holes of the bracket had to be drilled out to larger sizes to accept the parts. An aluminum plate secures the motor and bracket to the top of the second axis.

Old joining flanges (Used to make bed frames etc,) where bent according to the picture to produce a suitable bracket for the coupling nut to fit into. This bracket was securely bolted to the upper cross member of the fixed gantry and the coupling nut made to rest on it.

Last Axis

IMG_20210424_130249.jpg
IMG_20210430_093750.jpg
IMG_20210424_130225.jpg
IMG_20210510_142149.jpg
IMG_20210510_142229.jpg
IMG_20210510_221820.jpg
IMG_20210513_160732.jpg
IMG_20210513_163610.jpg
y axis oveview.jpg
IMG_20210513_160549.jpg
IMG_20210525_041203.jpg
IMG_20210525_041540.jpg
IMG_20210513_160414.jpg
IMG_20210512_143415.jpg
IMG_20210510_221837.jpg
IMG_20210510_142441.jpg
IMG_20210423_165440.jpg

This is by far the most time consuming job on the list. All is quite straight forward however, one step merges into the next and there is a small margin for error. One big mistake I made was gluing the large gear to each pulley. The glue eventually broke lose and caused the belt to slip. Initially I though that more glue would solve the issue but no such joy. the machine still works but there are a few instances where the gears tend to slip. Maybe jamming two nuts in there and squeezing everything together might help?

On the my previous machine the 5V steppers took all the radial load on their puny plain bearings and it seemed a bit harsh, so this time round I tried making a sort of spindle to take the main loads and be driven by the stepper - a more noble approach I'm sure. The bearing races are drilled in with a step drill. It works out that a 6 mm shaft and chamfered hole of 16 mm at the widest part held seven 4.5 mm steel balls perfectly. once the retaining washer is tightened down there is no wobble and the shaft spins freely. Having the bearings act as a pair enables them to self align concentrically with their respective holes. All lending towards a fairly nifty little device.

Attaching the steppers to the spindle assembly was not fun. After many failed attempts I was able to settle on using drilled aluminum flat bar as and adaptor plate to align all the holes. M4 nuts are used as a spacers to allow clearance for the bottom bearing and spindle. The cap of the screw is filed along with the last three threads to provide a smoother surface for the steel balls to roll over.

As the outer races are formed in mild steel, the hardened steel balls soon wear a groove, which in turn seats them better. Of course, such accelerated wear is not desirable, however, once the groove is deep enough the point of contact increases and so the force acting on the steel is bet spread out. Excess wear can be taken up by tightening the lock nut on top of the bolt. Lubrication is not necessary as the speed and load are comparatively low. Machine or sewing machine oil will help keep the steel from rusting.

Aluminium plates (25 x 70x 2.5 mm) where glued to only one half of the rectangular box section so the disassembly could be carried out if necessary. Once the glue was set the sliders where also glued down, one at a time. Using the upright sliders as a guide, pressing firmly into them, the new slide is kept straight and true. An 8 mm chrome plated bar was used to set the distance between the two sliders when gluing. Once the sliders were well secured holes were drilled between the sliders and aluminum plate and four 4.8 mm X 12 mm pop rivets inserted, one at each corner.

Next, brackets for the stepper assemblies were made up using the same method as before. Two tensioner springs are use as the gear drives present a lot of backlash. The springs do an excellent job of keeping the teeth positively meshed, no matter the direction of rotation or starting point.

The M6 bolt is fixed with a suitable spacer beneath the horizontal portion of the axis by means of a wood jointing flange which is screwed through the rectangular box section and into the wooden block. As before, the end of the bolt is looped in with the last coil of the spring.

A few notes:

It is important that there is no obstruction (such as built in stoppers) in the way of the ball carrier as this will cause the whole slider to get jam up. The overhang produced by the aluminium plate should be braced to prevent flexing and vibration, of course this is not necessary for plotting or laser engraving. Further more, the two horizontal sliders must be firmly clamped together so as to eliminate movement - much like regular ball bearings, these tend to move and wobble when working without a second unit.

Electronics and Software

IMG_20210525_042331.jpg
IMG_20210525_041227.jpg
Circuit.jpg
IMG_20210525_042357.jpg
IMG_20210525_042435.jpg
IMG_20210525_041018.jpg
IMG_20210525_172242.jpg
relay diagram.JPG

As for the software, grbl ended up posing too many issues.Instead, the machine uses a modified version of this code coupled with a chrome extension as the gcode sender. (https://chrome.google.com/webstore/detail/gcode-sender/ngncibnakmabjlfpadjagnbdjbhoelom/related)


The code is quite short and leaves plenty of resources available for for other functions. In place of servo motors the software has been upgraded to support two relays which control the z axis motor along with a few complementary components. Directional change is accomplished by supplying two relays with positive and negative respectfully, the first relay's NC output is connected to the motor BUS on the positive rail and the NO output connected to the negative rail. Similarly, the NC output of the second relay is connected to the negative terminal of the Motor Bus and it's NO output connected to the positive output. Both coils are connected in parallel, thus, when both coils are de-energised the current will flow conventionally through the motor and in the reverse condition when the coils are energised by means of a Servo output on the motor shield. The second servo connection drives a a separate relay which only supplies power to the relay network when need and when the devices are either energised or de-energised (To avoid a short circuit when switching polarity). This is further explained in the code comments for the penUp and PenDown functions. A 5 volt relay is used to switch the 12 volt relay coils in parallel via the 12 volt power supply from the 5v logic level coming from the Arduino shield.

Since the z axis motor has no stepping resolution ( it is either rotating or not) controlling precise movement can be challenging. For now the machine doesn't need precision on the z axis, only up and down. Raising the z axis up is no problem, the challenge begins when we want to move down to the same position repeatedly. The simplest solution I could think of was to incorporate a momentary switch as a collision detector. The push button is mounted facing downwards and is set to a corresponding height relative to the tool or pen tip. The z axis descends until the switch is activated. This is repeatable to within acceptable tolerances and mounting the push button outside the work area prevents it from getting in the way and makes adjustment easier. The upward movement can be controlled reliable by means of a simple time delay event (2500 Ms default to raise by +-5 mm). Feel free to modify the code to suit your requirements. A more practical solution: The M8 bolt used has a thread pitch of 1 mm, thus the travel is 1 mm / revolution, which can be measured via a rotary encoder and use to provide stepping resolution and solve forb steps per mm.

Pictured above is a simple electromagnetic engraver built from a couple of waste water valves salvaged from a washing machine. the thread former, having a blind hole, was drilled out to allow for a brass bearing from an old clock movement to be pressed and glued to the end. This provide a cylinder for the needle (made of the steel rod found in optic drives then cut to size and a point ground on) to reciprocate in. The rubber cap and soft spring of the second valve's armature prevent the needle from shooting out and provides a recoil action. The intact armature is placed into the thread former after the needle assembly and is responsible for propelling the need forward. The tube is sealed of with a piece of PVC tape to act as a noise damper. When 220V mains is supplied to the solenoid terminals the needle vibrates rapidly at the outlet frequency of 50hz. The force of the needle is very slight and is best suited for removing a thin line of paint or etchant mask from copper cladded board or marking patterns in paper - not tearing through it.