Wednesday, 30 May 2007


I have done quite a bit of milling with my Minicraft drill attached to HydraRaptor. I always considered it a bit underpowered for the job but it mills plastic and copper clad board reasonably well. Recently I started using it for drilling plastic. The first thing I drilled was 6mm Perspex. I programmed a pecking action to avoid the drill clogging as Perspex tends to melt when it is drilled at high speed. Again this worked reasonably well. The next thing I tried was drilling 25mm metal loaded resin. No matter how slowly I went I could not stop the drill from stalling once it got to a certain depth.

I decided the only way to solve the problem was to monitor the drill speed, detect when it was about to stall and automatically back off until it speeded up again. To this end I started investigating ways to monitor the speed. Off the top of my head I came up with four alternatives :-

  1. Monitor the current, because it increases as the speed reduces.
  2. Turn it off occasionally and monitor the generated voltage.
  3. Measure the frequency of the commutation noise.
  4. Put a black spot on the chuck and use a reflective opto detector to count shaft revolutions.
I attached the drill to a 12V switch mode PSU in order to take some voltage and current measurements and look at the current waveform on a scope. To my surprise the drill went much faster on the 12V PSU. The PSU that came with it is labelled 11.5V 400ma 4.6W but when loaded by the drill it was only giving about 8V. Then I looked at the drill and saw it was labelled 12V 40W. A bit of a mismatch! When driven from 12V it takes about one amp with no load. No wonder it was stalling so easily. It also explained why when it does stall it does not seem to care. Most drills start smoking pretty quickly if you stall them.

So it looks like the drill is ten times more powerful than I thought. The only problem is that it could do with some speed control as it goes a bit fast for plastic when running from 12V.

So now my next task is to tame it with PWM and monitor the speed somehow. I also want to control the vacuum cleaner with software as I am too lazy to switch it on and off.

Saturday, 26 May 2007

Tooled up

I wired up and tested the tool height sensor that I made last week and it worked fine. It gave consistent and repeatable results. Rather than use an OR gate I just connected two of the pins to two inputs of my micro and did the OR in software. I configured the micro to have internal pull downs and I connected the third pin of the sensor to 3.3V via a current limiting resistor. This configuration allows for the tool to be connected to ground, in which case either the tool touching the disk or any of the three contacts being broken will take at least one of the inputs low.

The software just plunges the tool into the sensor at full speed. As soon as one of the inputs goes low it backs up 1 mm and then descends slowly until it breaks the connection again.

There was only one small problem ... I made it for the wrong corner of my XY table! Having it on the right meant that the vacuum pipe had to clear it so could not be as close to the workpiece as it could otherwise be. No problem, I just got HydraRaptor to make another base for the left hand corner. I designed the part in Visio and then manually made a Python script to mill it. At some point I need to find a free CAD / CAM program for things like this.

Here is the drawing :-

This is what the script looks like :-
from Hydra import *
from Arc import *
from Tool import *
from Line import *

hydra = Hydra("")
top = 6.1
base = -0.3
hydra.work_origin = (-50,0)
hydra.work_height = top
hydra.tool = end_mill

tr = end_mill.radius

# recess
hydra.drill((0,0), 18.0, top, 5.6)
hydra.drill((0,0), 15.0, top, 5.6)

# spring well
hydra.drill((0,0), 10.0, top, 3.0)
hydra.drill((0,0), 2 * tr, top, 3.0)
hydra.drill((0,0), 7.0, 3.0, 1.0)
hydra.drill((0,0), 2 * tr, 3.0, 1.0)

# screw hole
hydra.drill((13.5,19), 5.0, top, base)

# outline
outline = [Line(-10,32.5), Arc(-9,32.5,-9,33.5,-1), Line(26,33.5), Arc(26,32.5,27,32.5,-1),
Line(27,-9), Arc(26,-9,26,-10,-1), Line(0,-10), Arc(0,0,-10,0,-1)]

hydra.mill(outline, top , base)

del hydra
And here it is installed :-

You can see that I used JB Weld to glue the pins in. I did that to stop them moving when I soldered the wires on, as Perspex melts very easily.

Below is a video of the new base being made. You can see the right handed version of the tool sensor being used at the beginning. I upped the feed rate to 15mm per second with no problems. Even so it took more that 15 minutes to make the piece so I have speeded up the video by a factor of two.

Obviously it is important to switch the spindle motor off when measuring the tool! At the moment I am doing this manually. I forgot once but I got away with it because it measures so quickly. The next job is to put the motor under software control.

Sunday, 20 May 2007

Let there be light

Taking close up video footage requires quite a lot of light because the maximum exposure is limited by the frame rate and zooming in wastes a lot of the light hitting the lens. I have previously been using a random collection of incandescent spot lights totalling about 200w. These gave an overly warm white balance with my camera, a Fuji Finepix 900, plus they tended to get in the way and gave off a lot of heat. I decided to try LED lighting as that seems to be the future. I suspended twelve 1W white LEDs over the top of the machine on a sheet of aluminium laminate plus another six on a strip of copper PCB laminate under the box that supports the Z-axis.

The LEDs were wired in groups of six in series and connected to the 24V supply with a small series resistor. I adjusted these to get about 300ma. A constant current source would have been better but I didn't have any suitable medium power transistors to hand and the supply is well regulated.

Here is what they look like in the machine viewed from below, they are not visible with the normal camera angle from above.

They seem to be bright enough for shooting video and they are only using 18W, 10 times less than my spot lights. If you compare my second video with the first you can see the difference although I didn't have the bottom six installed at that point.

Friday, 18 May 2007

How long is your tool?

I decided to make a tool height sensor as a high priority because finding the Z = 0 setting manually is time consuming and risks breaking expensive milling / drill bits. I got my design inspiration from The "One Penny" Touch Probe. I basically turned it upside down. My plan was to have a spring loaded disk pressing upwards against three contacts. Any movement of the disk downwards must break at least one connection. Note that the circuit in the aforementioned article is a little bit more complicated than it needs to be. Rather than use a three input OR gate you can just connect one of the contacts to ground and use a two input OR gate. That also dispenses with a connection to the disk.

Things went well to start with. I milled a ring with three flats on it out of 6mm Perspex. I drilled into the flats and inserted three gold plated pins extracted from a 0.1" header.

I then milled a base which bolts into one corner of the tray on top of my XY table. It has a circular recess to locate the base of the contact ring and a blind hole to house the spring. The corners are all radiused.

The small screw hole in both pieces was drilled manually with a small drill press, the rest was all done by Python script driving HydraRaptor with a 1/8 inch end mill. Here is a video of the ring being made, the flats were added by a third pass :-

The perspex milling went remarkably well at 10 mm per second feed rate, 0.1mm cut. I glued the sheet down onto the sacrificial base (floor laminate) using plasti-kote stencil mount. This worked well but I had to leave it 24 hours to dry because it was pretty much sealed between the two sheets. I removed it from the workpiece afterwards with Stain Slayer tar and grease remover.

The only slight defect was that the parts are slightly undersized for most of their height, but a bit bigger at the bottom. At first I thought that the tool wasn't plunging deep enough into the base material. I tried increasing that with no effect, so the explanation I came up with is that the tool gets a bit clogged with perspex and that rubs against the work piece making it slightly undersized and gives it a polished appearance higher up the edge.

Flushed with success, I thought making a conductive disk would be a doddle but it turned out much harder than I thought. My first idea was to mill a 9.5 mm disk out of PCB material. I stuck that down with stencil mount but I only left it to dry a few hours. It came lose while milling, creating an egg shape.

My second idea was to turn down a cupro-nickel disk on my watchmaker's lathe. I can't say where this disk came from but I can say that it cost exactly 5p. My plan was to hold it by its outside edge in a chuck and plunge a tool into the face to get the correct diameter. After an evening of trying every tool I had and shaking the lathe apart I realised that is not an operation you can do on a lathe. Normally you cut across a face or along the length of the piece. In that case only the leading edge of the tool is actually removing metal. If you try to plunge a tool into the face of the workpiece the whole of the tool width is trying to cut. It just digs in and stalls the lathe. Perhaps a very thin tool might work but I don't have one. The only way to reduce the diameter with the lathe is to turn it from the outside but then there is nothing to hold it by.

My third idea was to turn down a bit of 10mm brass bar and then cut the end off to make a thin disk. This worked at the second attempt, after I had improved my lathe skills a bit. Here are the three rejects :-

And here is the one that worked :-

I made a 5mm stalk on the back to locate the spring :-

And here is the assembled sensor :-

To my amazement when I metered it out there was no connection between the contacts. How could brass pressed against gold not make contact? After close inspection I realised that the disk was resting on small Perspex burrs where I had drilled the holes for the pins. I removed the pins and scraped off the burr with a pen knife and that fixed it.

Tomorrow I will wire it up and see how it performs. The only thing that worries me is that the brass might tarnish with time. At least it will fail safe if it does. I have a small gold watch case that I can cut a disk from if need be.

Sunday, 13 May 2007

Dust bustin'

I decided to tackle dust extraction as my first attempt at milling plastic made a right mess as you can see below in the video. The problem with taking a very fine cut is that you get very fine chips. These defy gravity and even stick to the underside of the things, presumably due to static.

My first idea was to enclose the tool in a pipe which reaches down to just above the workpiece. A vacuum feed then needs to come in from the side. I bought a small vacuum cleaner for the bargain price of £17.42.

It seems a bit ridiculous to use 1300W to remove dust from a machine that takes less than 5W to make it but I can't think of a better solution. I might be able to reduce the power with a motor controller if I find I have suction to spare. If not I can always put the air conditioning on to waste even more power.

I tried using a reducer and a small diameter pipe but the reduction in suction was too great so I decided to keep the full bore right to the workpiece.

I started with a small waste pipe T-junction and cut most of it away to leave the shape I wanted.

I then used HydraRaptor to mill a ring to reduce the top pipe diameter to the size of the drill shaft. This will also be the means of attaching it to the underside of the bottom motor mount. I practiced first on a piece of scrap 2.5mm polystyrene before making the final piece in 5mm ABS. You can see that it was a good idea to practise on the scrap first as I made two really stupid mistakes. The first one was to cut the outer circle first! The second one was to offset by just over the diameter of the ring to do a second one. I forgot to add the diameter of the tool! The ring on the right is the finished article. I was able to increase the feed rate to 20mm / second, sticking with the 0.1mm cut depth.

Here is the finished article :-

This is a bit of a landmark as it is the first useful item that HydraRaptor has made. Not very RepRap as it is a subtractive rather than additive process, but it is a part of itself.

While HydraRaptor was making the ring I held the vacuum cleaner nozzle close to the work piece. It was very effective at removing the dust even though there was only a very poor seal. It has the advantage that it does not need to move with the z-axis. It only needs to be suspended in a fixed position just above the work piece. I decide to abandon the piece I had just made and go for a bracket that can hold the nozzle at a fixed but adjustable height. I made this contraption out of a bracket that was formally used to hang a microwave oven on a wall.

This method works well for plastic but I may have to revert back to plan A when milling copper as the chips are a lot heavier.

BTW, I came across a much better plastic identification flow chart, than I mentioned last time, in the RepRap forums:

The next thing I intend to tackle is a tool height sensor as it is a pain getting Z = 0 to be exactly where the tool meets the sacrificial base material each time a tool is changed.

Tuesday, 8 May 2007

Successful milling

The new metalwork did the trick. It completely solved the snatching problem I had previously. I managed to mill this test shape out of 2.5mm polystyrene, at least that is what I thought it was. I found a site: which describes how to identify plastic by setting fire to it and the closest match is ABS, so it may in fact be ABS.

As you can see it has nice clean edges and it measures 34.07mm by 60.02mm by my cheap electronic calipers so is pretty accurate.

Getting the feed rate and cut depth right took a few attempts. The problem was that the plastic kept melting as you can see here :-

I found that with a cut depth of 0.5mm I could only feed at about 0.2mm per second to prevent melting. Reducing the cut depth to 0.1mm allowed me to increase the feed to 10mm per second which is ten times more productive. I probably could have pushed it further but I am not particularly interested in making anything from this material. Here is a video of the test :-

I now have a small but highly accurate CNC milling machine. A few improvements are definitely needed :-
  1. Dust extraction!
  2. Tool height detector
  3. Spindle motor control and stall detect

Monday, 7 May 2007

Stiffening up

Having severely underestimated how stiff a milling machine needs to be several times, I decided to make a solid job with my next attempt. Two days of metal (and plastic) work later here it is :-

The back plate is 6mm aluminium sheet strengthened up with a couple of 8mm by 20mm aluminium rails. The bottom mount is 13mm thick aluminium and the top mount is the mystery metallic plastic composit I mentioned earlier. I am still none the wiser as to what it is but I can say that it is light, very rigid and machines very nicely. Drilling makes perfect holes with no burr. The only thing I don't like about it is that it gives off a very fine dust. I expect that goes hand in hand with machining well.

The end result is solid as a rock. I think the only weak point now is the MDF frame but as I only want to do light milling I hope to get a way with it.

I have improved my metalwork techniques since the previous attempt. It is actually more difficult that one would imagine to drill accurate holes. Here is the method I use :-

  1. Make a template in Visio with the outline of the work piece and cross hairs where the holes should be.

  2. Print it out 1:1 and cut round the outline.

  3. Place it over the work piece and centre punch where the cross hairs are with an automatic punch.

  4. Drill pilot holes at 1.5mm, using a drill press.

  5. Open the holes out 2 or 3mm at a time by using successively larger drills until the target size is reached.

  6. De burr with a larger drill.

When drilling aluminium you need to keep the drill speed low, especially with larger holes. A drill with continuously variable speed is handy.

If the going seems to suddenly get tougher, for no apparent reason, then it generally means the bit has got clogged. Back out, switch off and pick the swarf out of the flutes. Using paraffin to lubricate helps to prevent this.

The next thing is to try milling again although I no longer need the drill mount I was trying to make earlier as I have had to make it by hand.

Thursday, 3 May 2007

Heavy metalwork

Just spent all evening making a 150mm cut across a 6mm sheet of aluminium. Not fun I can tell you. I used a jig saw and got through three HSS blades. After the first blade I tried using paraffin as a lubricant and it made a big improvement. Holding the saw for about an hour and a half on and off was horrendous because of the the vibration. It was all the more annoying because I paid over the odds on eBay to get a piece exactly the right size but the description changed during the auction. There was even a line already marked where I had to cut it.

Ironically, after finding it so hard to saw, I managed to clean up the edges on my bench sander demonstrating how soft aluminium is. I probably needed a saw with coarser teeth. Perhaps I should have tried a wood blade but I think that would have been too coarse.

Drilling next: I hope that goes a bit better. I will definitely use paraffin again. I am not sure where I got that tip from, it might have been my Dad.

PS: Found a better way of blogging my pictures so now you can click on them for a higher res version. If anybody wants to see a better version of a previously posted image let me know and I will upgrade it.

Wednesday, 2 May 2007

More trouble at' mill

Well things did not quite go to plan. The first problem was that most of my milling bits have ends that are smaller than the top of their shafts so they cannot go very deep. The only exception is a 1/8th inch end mill that came as part of my PCB routing set. It is intended for routing PCB board outlines. The problem was that my first drill did not have a collet big enough to take it. The Minicraft replacement has a three jaw chuck which will. So plan B, I fitted the Minicraft drill into the bottom MDF mount intended for my other drill. Rather than tackle the big block of hard plastic I thought I would try it out on a sheet of scrap polystyrene first. I stuck this down with double sided sticky tape.

I started with a feed rate of 4mm per second. This was far too high as it stalled the drill. I dropped down to 1mm per second and then to 0.5mm. At this point it seemed to be able to handle the cutting but it kept snatching horribly. I dropped down to 0.1mm per second which took ages but it still snatched. I only got as far as the first corner before I aborted. You can see that after the first 15mm it no longer goes right through the plastic. This is because I did not tighten the chuck enough and the bit slipped.

I might be wrong but I think the snatching is due to the set up not being rigid enough. I had already identified that as a weak point and the new motor mount was aimed at improving it. The first drill was supported at both ends but this one is too short so it needs a much stiffer mount, which is what I was trying to make! Perhaps the end mill bit is not suitable for styrene, or perhaps styrene is not very machinable, or perhaps the RPM is too high, or too low. Can you tell I am a bit out of my depth here?

One thing I can do to improve stiffness is to replace the 2mm aluminium plate with the 6mm slab I already bought for the job. I was putting that off until I got the new mount so as not to have to drill two sets of holes in it.

Another thing I might try is to make a top mount out of PolyMorph.

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):
It was then trivial to get HydraRaptor to draw the outlines with a pen using a for loop :-
for seg in outline:
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 and here is "line to arc" 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.