If you have been following along at home, then you’ll know that last time I had a successful attempt at engraving a sign. With one main caveat. The backlash on the x-axis was still evident and ran to about 2mm.
During the week I tried rebuilding the x-axis captured nut setup to have 2 captured nuts which is common in ánti-backlash arrangements. I did the same on the y-axis and made an attempt to improve the overall alignment. Sadly this did not fix the backlash issue on the x-axis. I was just about to pack up for the day when I thought to just move the x-axis by hand to see the ‘play’ in it and look for signs as to what is moving. Once again I kind of kicked myself for overcomplicating things in the past and not just realising this was the simplest way to check for the problem in the first place.
This quickly revealed the real issue was the x-axis coupler. If you have really been following the whole series of posts, you may recall that early on I sheared off the first x-axis coupler when I had the alignment slightly off. In my haste to get things up and running again I didn’t really allow any time for the silicone to set, my impatience meant that the coupler didn’t wind up with a nice tough rubbery layer joining the two pieces in a firm connection. It wound up squidging out of place and left the couple with… you guessed it… 2 mm of extension/compression movement. Every time you changed directions it first had to compress or extend the coupler.
So after berating myself for the various failures that both caused the problem and took so long to diagnose it. I was happy that I had a spare coupler which I joined with silicone at the same time as the other. So this was now very much set and I could just switch it in.
It worked! I would now estimate that the backlash in all axis to be somewhat less than 1mm, certainly less than I can currently measure.
My first run with a fully armed and operational cnc rounter…
I was particularly pleased with this both due to the end result and due to having started from nothing on the same day. I designed the box in openSCAD over breakfast in the morning, Generated the tool path in PyCam over coffee. And finally spent an afternoon running the sequence and creating the real physical box. To be fair the design was just a copy of one I found on thingiverse and originally I was going to use that. However I needed to make adjustments to the part layout to fit the wood I wanted to use. I also had intended to use 5mm hardboard but the thingiverse design was for 3mm. After making adjustments in inkscape, I then had trouble getting pycam to successfully generate a toolpath and I didn’t really understand why. So I created my own parametric model in openSCAD. Same design, but with the ability to change a variable like material thickness and have the whole thing automatically adjust. (openSCAD is awesome) . I uploaded my derivative design here. I love that thingiverse has built into it the idea of expressing the lineage of a design, you can set links to show where inspiration came from or what parts you used.
Whilst I’m at it, I think its time to acknowledge that my own CNC creation was possible due to ‘standing on the shoulders of giants’. Lets list out those giants…
To send logic signals to these I needed something to interface with the computer. I came across GRBL which is an awesome open source gcode interpreter that runs on an arduino. The Arduino Uno itself is a cool piece of kit and pretty cheap, with lots of help and resources around it.
Then of course there is PyCam another amazing free program for generating the gcode from your models. it has some quirks, and can be very slow at 2.5D models, but for 2d stuff is generally very fast. And its FREE!
At the top of the chain, as I mentioned before is openSCAD Which lets me model what I want in a very ‘programmer’ sort of way which I find easy to work with.
Atop these giants building my CNC router was possible, and relatively cheap. Having done some research, gcode generators (CAD) programs alone can cost $250+ which is a steep ask for a personal project. So I am immensely grateful for the work of these other projects that made my own possible.
Woo hoo!, today I had what I’m categorising as my first full on successful run though a whole sign engrave program.
There are caveats, the backlash, particularly in the x axis is evident in a few places, however it was consistent and over 3 passes (1mm step down per pass) I got very consistent results.
After the first successful run, I upped the feed rate about 25% and upped the seek rate about 50% and ran again. I got another very consistent result. 3 full passes and very little deviation from the path each time. So I am very happy.
Here is the customary timelapse, you can tell that the second pass is running faster.
I did try to cut a piece for an anti-backlash block, however that failed when the bit slipped a little then bit into the wood and just pulled in. However it was also clear at that point that the model I downloaded wasn’t really scaled quite right for my needs. So the plan for this week is to design my own, and maybe hand craft the gcode a little to work around the backlash issue.
I’ve also been designing an openSCAD design for one of the rubber band guns I made a while ago, I think it would be cool to cnc out the parts for a second.
Pretty such since the first time I turned on my cnc machine I became familiar with the term ‘binding’ the various axis had points where due to slight inaccuracies of construction the threaded rod was rubbing against something causing so much friction that the motor stalled. Normally a gentle nudge by hand was sufficient to get things moving again, however binding is very bad. Every time this happens you have effectively ‘lost’ a move that your cnc was trying to make. It may even recover its self, but you quickly come to recognise the sound of a failed move. This is the sound of failure.
The CNC is no longer where it thinks it is relative to any previous move. Initially I had binding issues on all 3 axis. I had foolishly built the original structure with various ‘support’ points for the treaded rod, these were not responsible for any driving action, but they were drilled to be only barely larger than the threaded rod. That turned out to be a terrible idea, as short of absolutely perfect alignment each of these just provided a point for the rod to rub against and increase friction. So job one was to remove all of those, each axis really just needs to have the threaded rod connected at the motor, and ‘supported’ by the driving nut. That done the z-axis became pretty reliable, no more binding. The X axis still suffered some issues that I talked about previously, where my driving nut was enclosed in a block that was just a little too tall, at the far end of the workspace from the motor things seemed ok. But as the gantry was pulled back to the motor the height difference between the motor and the driving nut caused things to strain, and ultimately sheared the coupler in half. The Y-axis was a little more tricky, the brackets that hold it on the rails are metal, and the original design had tapped holes through the brackets that acted as the driving nut. one on each side. When this wasn’t working I elected to replace it with a block with a captured nut as I had in the x-axis. But that required me to totally dismantle the y-axis and open out the holes through the metal brackets. Sadly I already drilled the hole with the largest drill bit I own. So I had to go at it with a dremel and some cutting discs, and an abrasive but to work the hole open wider.
With the last adjustments made I finally found I could run my machine without binding. This has the effect that I can also run it faster, since less friction means the motor can operate with less concern over torque.
Home free? well no. As I wrote about previously, I was still seeing what seemed like odd behaviour which I eventually tracked down to the ‘sloppiness’ when changing direction, between the nut being pushed up hard against one side, and it become pushed up hard against the other.
This effect ( I now know) is called ‘backlash’ To a greater of lesser extent it is a very common issue in cnc systems. It turns out that most of the ‘real’ parts you might build an axis from are specifically designed to minimise/eliminate backlash. But of course it turns out that this is the yin to bindings yang. The closer you make the tolerances to avoid backlash, the more friction, the more friction the more binding. I took apart the x-axis and found there to be a small gap allowing movement. which I filled with a carefully cut piece of wood. Then clamped closed again. Excited to test out I rushed to repeat my test and found that I had reduced the backlash to 2mm. woohoo, 33% better… but still off. clearly I need to take more action in this area. But more on that later.
So it turns out that whilst it was binding I wasn’t really seeing these issues as clearly, since the very friction that was causing the problems was providing drive instantly after a direction change. But now I have mostly eliminated binding, I’m at the mercy of backlash. Now that is not a bad thing, I’ll take backlash over binding any day. And here is why…
Binding is an ostensibly random effect that drops ‘some’ moves and has a random impact on the resulting movements. Where as backlash is entirely predictable. It always has the same impact, and it always happens when you change direction. Also backlash is not additive. It cancels out when you turn back. This is how I came to realise the nature of the problem, by looking at the results of my cribbage board drill attempt, I realised that whilst I had apparently had an inaccurate move back to drill one hole, a little time later in the pattern everything lined up perfectly again. This hints at a way to work around backlash, at least for certain applications, until I can find the right balance in the hardware to eliminate the effect. If you always approach every cut/drill from the same direction, you’ll maintain perfect accuracy.
Let me give an example The machine starts having previously moved forwards into what we now consider 0. You then move forwards 10mm. which it does exactly. then you move right 10 and drill again. this is fine. a parallel hole. Now we move backwards 10mm, but we stop at 2, not 0. If you drill here then you are off and your pattern is ruined. It would be tempting to suggest that you tell the machine to go to -2 and drill there. since you know you will lose 2mm and it will actually be at 0. This is not such a great idea, it means that you end up drilling at places that are different in reality to where the machine thinks they are. It would be difficult to make this adjustment all over the place and keep things straight in your head. However. If you instead go back to -4, what you arrive at is -2. From there, you ask to go back to 0. The machine thinks its at -4 so attempts to move 4mm forwards, the first 2 mm is lost in backlash, and so it actually moves just 2mm. so There you are, back at 0. and importantly the machine thinks its zero as well. An issue here is that I have no control over the way pyCam generates Gcode. it uses an algorithm with the objective of minimising machine movements. and has no concept of backlash. and GRBL (0.8) also has no built in support for managing it, though it is on their future list. However for a simple program like my cribbage board drill program, I could simply edit the commands by hand. Which is what I did this week. I move the machine back behind the start point, then bring it forwards to the first hole. From there I drill every hole forwards of that point in that row. Then I move the machine over to the next row, and backwards to past 0 again, then forwards to the start of that row, then repeat. Here is the result
It worked! well, that part worked, I had a bunch of other issues. the zaxis was giving me grief and it stopped adjusting height correctly, on the first pass it wound up too high and stopped drilling, on the second pass it wound up too low and effectively crashed the drill bit through the wood. however for the purposes of this test it was successful, I got two parallel lines of drilled holes all correctly spaced.
Clearly this approach can’t work in all circumstances. and it would make most things very slow, as you ostensibly have to always move backwards past the point you want to drill then move forwards to it. However, for certain jobs, like my cribbage board, this provides a way to achieve the specific accurate result you want, despite the backlash. So the question becomes, can I use this approach to help me machine out parts that are accurate enough to help me actually fix the root problem?
What is required is an ‘anti-backlash’ setup, and the design I’ve found that seems the way to go is to have 2 nuts, separated by a compression spring. The spring acts to take the slack out of the nuts motion on the threaded rod. The question I have is whether I can put this together and maintain low enough friction to avoid binding. So now I have a two pronged attack on inaccuracy in my CNC machine, the first is software, by manipulating the sequence of commands, can I ensure I always cut in the positive direction and thus work around the problem. The second is hardware, can I build a setup for the xaxis that actually eliminates the backlash, or at least reduces it to levels low enough to not be a problem. I figured if I can get it down to less than 1mm it would likely be acceptable for most applications I’m likely to have.
Of course I could just buy a proper leadscrew and associated anti-backlash components… but where is the fun in that?
Last weekend was the first time I got my cnc router to do something recognisable. After some tuning I got it to plot out a simplified version of my blog logo, backwards… followed fairly swiftly by me breakinng the x-axis because the plastic coupler that joins the motor shaft to the threaded rod sheared in two.
This weekend the first job was to replace this component, and see if I could fix whatever issue caused the break. I had my friend print me up another coupler on his makerbot this week (one day I really should get my own, but for now it is super helpful to know someone that has one). In fact he printed me two, so that next time I break one I have a reserve ready to go.
So i took apart the x-axis, removed the old coupler and started to put the new one in place. This time I realised that when fitting the couplers I really need the axis as close to the motor as possible, and this revealed the problem. there was a slight high difference between the motor shaft, and the mounted nut on the x-axis carriage. When the axis was pushed further away the height difference didn’t matter much. However, as it got closer and closer to the motor that difference caused binding, and general stress on the coupler joint. Eventually this just snapped all the lugs that held the coupler together.
Simple fix, take the mounting block off, cut a few mm off the bottom and remount. No post would be complete without some timelapse video of me doing the deed…
At the end of that video you can see I started a router test. However a couple of things didn’t work so well, the main one being that the screws I used to hold the workpiece down didn’t bite properly and the piece lifted into the cutter. causing smoke, and general badness. Luckily limit switches are readily available to hit to stop the machine and then I could just turn off the rotary tool.
Worth mentioning at this point, I realised last week that starting, and stopping the rotary tool caused enough of an EM spike (I’m guessing) along its cable, that when the cable was next to the wires for one of the limit switches it caused a limit trigger. I since ran the cables a little differently to avoid that issue.
I was generally wondering whether the rotary tool, and in particular the cutter I was using was really appropriate to this task. I do want to setup a mount for my actual router, and at some point by a proper cnc router bit for it. However for the moment my range of cutters is limited. So I decided to move on to a drill test.
During the week I made up a model of a cribbage board. For those that have never played, its a card game, in which you score points. ostensibly you need to be the first to score 120 points, but this is normally measured out on a board with a few tracks of holes, 30 holes in a row, 2 rows make a track for each player. you go around the board twice. marking your score with pegs. Its not important, but my wife and I play occasionally and years ago I made a crib board ‘by hand’ with a printed template and my pillar drill. it came out ok, and we still use it. However, I did think that the cnc would do a much neater job of drilling the holes. or at least in theory it is capable of doing so.
I knocked up a model in openScad (my modelling program of choice) and came up with this simple model:
Then I imported it into pyCam and created a tool path. The trick here is that by default it will want to follow around the outside of the ‘holes’ rather than drill them. However it lets you set an offset from the lines. If you set this to the radius of the hole, and you have a cutter specified that is the diameter of the hole, then what you get is a tool path that just hits the centre of the hole. I also don’t want it dragging my drill bit around the perimeter of the shape,since it won’t be a routing bit, so I set my boundaries to be inside the shape, but outside the holes. the last thing is to set the ‘depth per pass’ to the depth of the holes you want. so the resulting program will move from hole to hole, then drop down the entire depth of the hole in one go, come all the way back up, then move to the next hole. The output looks like this:
So with a drill bit in the rotary tool, I manually job the machine to the 0,0 point, which i this case is above where I want the first hole to be. Then power up the tool, and hit go on the program…
and of course disaster. well, not disaster, but not good either. the drill bit I was using was too long, and had too much lateral vibration at the tip, this combined with some problems moving the axis reliably put some holes very close to each other and the bit tried to wander off into a previous hole…generally not good. so I hit the limit switch and thought about what went wrong.
The first point was the choice of bit, too long, too much vibration. fortunately I had another much shorter bit which seemed much more appropriate for the task. Second problem, was a combination. I originally screwed up my model, I had mixed up diameter and radius and set the holes twice the size I wanted them, and thus confused the spacing and it wound up smaller than I wanted. I fixed all this in the model. However it soon transpired that there was also the issue of the machine binding up again. I had been a little over optimistic, after refitting the x-axis I found I could set the seek speed way higher than previously used, and up at 200mm/min it moved smoothly (seemingly) however apparently this was not reliable enough, and certainly at some extremes of either the x or y axis this get a little less reliable.
So I reconfigued the model, reconfigured grbl and set off again….and again… and well again. in the video below you can see evey time I stop and reset. that is because it would get a certain way in then screw up. weirdly 3 times in a row is screwed up in exactly the same place despite having been perfect up to that point. I realised that the notable bit of the program was that it was the first time the x-axis moved backwards from a position. for the first several holes it was effectively doing ‘drill – right -drill – forward – drill – left- drill- forward- drill-right’ etc. but then it did ‘drill-forward-drill-forward-drill-right-drill-back-drill’
but the backward move didn’t travel the same distance as the forward movement leaving a hole out of alignment.
You can see in this picture the various attempts and its easy to spot the first hole that goes off program. I take heart that the first several holes really are perfect.
The problem of the back move is a little perplexing. I manually tried entering the commands to go forward 20, back 20, forward/back repeat , and each time it did it perfectly. but for some reason in the program its not quite right. Later I will actually manually review the gcode, just to make sure something weird isn’t wrong in the instructions. However I think the reality is either the machine needs to be set to an even slower speed to try to make it stay reliable. Or I need to manually resequence the gcode so that it doesn’t take a backward step. it should be easy enough to drill all the wholes in a sweeping back and forth on the y axis, then stepping one row forward and repeating, so we never back off the x-axis. Obvioulsy that is a last resort. If I can’t get the program to work reliably today, then some evenings this week I will manually re-work the gcode to see if I can get better results next weekend.
With the last few minutes before I needed to stop for the day I decided to try the routing pass again on my logo. This time with the feed rates lowered back to the levels that worked so well on the plotting last week.
You can see this at the end of the video above. I don’t get all the way through before aborting.
It is clear that there is a big difference between dragging a pencil over paper, and pushing a cutter through wood. the axis struggled to move reliably and that pushed everything off position. Also I realised that I was just reusing the same gcode as I used with the pencil, but a pencil is a very fine point, and a cutter is 3mm wide. Following the same path was causing a mess. So I need to refine the program to account for the size of the cutter. probably there is a minimum size that I could reliably carve this into wood with a 3mm cutter without it cutting into the space between letters etc.
So this weeks test was …mixed.
Positives – I figured out how to make a drilling pattern which I’m sure will be really helpful in various applications. and for at least the first 9 holes or so, the machine seemed to stay accurate and capable of good precision.
Negatives – it really only takes one skip of a move, one revolution that stalls and doesn’t happen to screw up your whole program. once the machine is off position that is that. For now at least, I haven’t hit on the right balance of settings/machine setup to give me complete reliability of movement even when not under the stress of a cut. And when it is under the stress of a cut things get worse.
Well obvious next step is to try the drill program with a really really conservative set of feed rates. This will take a long time to run, but if it works will be worth it. I also need to start making the support for my real router. I think some of my problems under cutting stress are due to using a bit which is really not suited to this use. its find for slowly grinding away on some metal, but it really isn’t a good choice for wood cutting. The sooner I can mount a real router spindle, the better.
This week I figured out what I needed to in order to send sensible gcode to my DIY cnc. I think the thing that I had been missing was the idea that you don’t really need a single consistent co-ordinate system and that actually you might have a few for different purposes. Eg you might light to manually move the tool to a point on your machine, then reset that to be 0,0,0 such that your gcode is interpreted relative to that point. In that way you can have your models centred around 0,0,0 and work with the easier than if you had to have them offset to some point that would be the middle of your machine.
So with that in mind I took my inkscape file of my website name ‘maker | geek’ not rendered in appropriate font, just typed in with regular font etc, just to get something quickly. I then imported it into pyCam, centered it around the 0,0 and offset negative z by the distance my rigged up pencil was above the bed.
Once I had homed the machine, then moved it back to somewhere near the centre, I stored the location by using the G28.1 code. In theory this means I can always return to this same point by homing, then entering g28.
Once there I reset grbl so that this became my 0,0,0 point.
Having duct-taped a pencil to the z-axis. I then positioned some paper on the bed, and kicked off a simple stream of the gcode to the arduino. And everything started to spring to life!
I quickly realised that I’d rather messed up the scale of my model, and made it way too small. so I was just getting odd little squiggles. I was fairly sure this also indicated that not all was well, I could tell the Y-axis was binding up and stalling. but I went back to pyCam, doubled the size, reset and set off again.
After a few minutes I was rewarded with this output:
Impressive huh? The more observant reader may say ‘wasn’t that supposed to say maker | geek’ to which I respond…well yes it was, and if you squint and look at the right angle and use your imgaination that is indeed what it says. However it was very apparent that the Y axis was just not moving reliably. However the approximate spacing of the ‘letters’ on the x axis did seem about right. That was all I had time to try on that occasion since it was an evening mid week. However I resolved to return to the garage this weekend, strip down the Y-axis and rebuild it.
Cue timelapse of me fixing the Y-axis….
Sadly most of the work wound up at the bench, and so not really in shot….
Basically the original design (throughout the whole machine) I had attempted to get fairly tight tolerances and holes lined up across the length of the axis. This was a bad plan since I failed to get a precise alignment this just caused binding issues. To fix it I basically widened all the holes, leaving just the coupling to the motor and a single ‘captured nut’ in a block attached to the Y carriage. The captured nut was set so that it could slid up and down, but not back and forth. This means the rod is free to wobble a little laterally to the turn, but the nut/carriage has no slack in the direction of travel. This seems to have improved things.
but still suffered some binding and stalls. So I dropped the rate of feed/seek down to 80mm/minute. I then also jumped the text up to fill more of the page. And then at last… success!! it plotted perfectly (well as perfectly as I have any right to expect)
Ok, yes its back to front. But that is just a minor issue with flipping the Y-Axis, but the actual plot worked! including where it returned at the end to fill in the centre of the ‘e’s and the a.
Emboldened by success I attached the rotary tool which you can see at the end of the timelapse. My intentionw as to carve the same text into a length of wood. and perform my first actual cutting pass.
However, as I was setting up the position I was suffering more binding on the X-axis. I think the alignment is out such that the closer it gets to the motor end, the more out of line it is and the harder the binding. Just as I was thinking about this,…disaster. The x-axis coupling sheered completely in two.
And so the end of the plotting test was forced upon me. I now have to wait until I can replace the coupler before I can continue. However I think it will just require a little fettling of the x-axis to avoid it doing this again. (hopefully) However on the plus side this shows I’m not lacking for torque in the motors. When reduced to a slower rate of travel, they were able to develop enough to sheer straight through the plastic lugs that held the two halves of the coupler together.
At the end of the day this was my first properly successful test of a DIY cnc router that I built from scratch, for less than £250 and I’m very happy with how things are going. Excuse me whilst I go feel just a little pleased with myself…