## Tuesday, 1 May 2007

### On the right path

Having tried a cheap mini drill as a router and found it lacking I ordered a cheap laminate trimmer to try instead. While I was waiting for it to arrive I remembered that I had inherited a Minicraft drill from my aunt.

To my surprise this seems quite promising. The bearing is solid and it revs to 20000 RPM without too much noise. It also has the advantage that it is small and light so is suited to a multi-headed machine. I decided to see if I could use the first drill to mill a mount for the new one out of a block of hard plastic. I designed a simple two part clamp using Visio.

I represented the outline of the parts using a couple of Python lists.
bottom_clamp = [Line(0,34), Line(13,34), Arc(30,34,47,34), Line(60,34), Line(60,0), Line(0,0)]top_clamp = [Line(0,26), Line(60,26), Line(60,0), Line(47,0), Arc(30,0,13,0), Line(0,0)]
Line and Arc are simple classes with a do method which instructs HydraRaptor to move along the segment. E.g.
class Line:   def __init__(self,x,y):       self.end = (x,y)   def do(self,hydra):       hydra.feedto_xy(self.end)
It was then trivial to get HydraRaptor to draw the outlines with a pen using a for loop :-
for seg in outline:   seg.do(hydra)
However in order to be able to mill it out I need to create a tool path which is offset by the radius of the bit. This is a little harder than it sounds. It is easy enough to offset a line at right angles to its direction but then the ends no longer meet. A new intersection point has to be calculated and a different calculation is required for each possible pair of segment types. I decided to prove to myself that I could still do O-level maths and worked out the equations from scratch. A quick Google afterwards verified that they were correct before coding them up. Here is the "line to line" case http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/ and here is "line to arc" http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/. The trick is to represent lines with a pair of parametric equations rather than simply y = a +bx to avoid having special cases for verticals.

Having done that I got HydraRaptor to draw the tool paths with the pen. Here is the result :-

The next step it to actually mill it. I am not sure how I am going to hold the plastic block down yet. I think I will try double sided tape and if that fails contact glue.

#### 2 comments:

1. It is common practice in woodwork, especially when turning on a lathe, to hold awkward pieces with hot-melt glue. After machining, the joint can be parted with a screwdriver. The best glue I have used is 3M Jet Melt.

2. Thanks for the tip s0lStice. I have a hot melt glue gun so I will give that a try first.