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("10.0.0.42")
top = 6.1
base = -0.3
hydra.work_origin = (-50,0)
hydra.work_height = top
hydra.measure_tool(end_mill)
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.

2 comments:

  1. I've seen Mach3 mentioned a few times (www.machsupport.com) for controlling CNC machines. Perhaps it will do what you need.

    ReplyDelete
  2. Yes it looks like a nice program but I think it expects to interface directly to the hardware whereas my machine is controller by Ethernet. What I really need is something that is open source that I can hack into. Maybe I can just use the RepRap code and hack it to do subtractive as well as additive tool paths. I think the maths is basically the same, just swap the inside and the outside.

    ReplyDelete