PDA

View Full Version : tool size compensation - I think?!?



mmcp42
12-16-2012, 05:03 PM
I can see how one would write software to compensate for tool size
but how does the software know if your'e milling out a pocket(?)
or milling the outside of the same shape?

(imagine a square with rounded corners - could be a hole in a larger piece - or the edges of a smaller piece)

I hope the question makes sense

Geof
12-16-2012, 05:42 PM
Tool compensation is activated using a G41 or G42 command. G41 tells the controller to put the tool center to the left of the cut path, G42 to the right. This and your choice of code allows you to program for inside or outside cutting.

mmcp42
12-17-2012, 04:15 AM
Hello Geof
many thanks for that
it never occurred to me there'd be a gcode for it :)

BAMCNC.COM
12-17-2012, 03:32 PM
You said software, do you mean CAM? If so then there are options for left, right, or inside, outside the line. Then you tell it your tool size and it does the above gcodes.

mmcp42
12-17-2012, 03:45 PM
I was deliberately vague!
I'm writing my own software
Most of what I want is EAGLE related, not just the PCBs but also the enclosures
So I can currently take a .brd file and convert it to gcode (CAD?)
I have my own software that then reads the gcode (CAM?) and sends it to (my own) controller

now that I've started it using it in anger, I am stumbling across all the issues that were solved just the rest of the world decided that round was a good shape for wheels!

now, left and right of the line I can see how to do
it's working out whether you are "inside" or "outside" that has the grey matter stretched at the moment :)

BAMCNC.COM
12-17-2012, 08:33 PM
Closed curve is inside or outside.

mmcp42
12-18-2012, 03:03 AM
Closed curve is inside or outside.

indeed
but how does the software get to find out which!?

BAMCNC.COM
12-18-2012, 08:46 AM
You click a button during your cam setup. If its a closed circle, there can only be one inside and one outside.

109jb
12-18-2012, 10:51 AM
What kinf of program are you writing? Is it a CAM program or a machine controller?

If it is a machine controller, the program doesn't care if it is an inside cut (a pocket) or an outside cut (a boss). The only thing the machine controller cares about is which side fo the programmed line to compensate to. Look at this link for a description of the G40/G41/G42 cutter compensation code standards.

CUTTER COMPENSATION (G40, G41, G42) On GlobalSpec (http://www.globalspec.com/reference/74560/203279/cutter-compensation-g40-g41-g42)

If you are writing a CAM program, then the ones I have seen/used all ask the user if the profile is a pocket or a boss and then the program responds accordingly.

mmcp42
12-19-2012, 06:03 PM
What kinf of program are you writing? Is it a CAM program or a machine controller?

If it is a machine controller, the program doesn't care if it is an inside cut (a pocket) or an outside cut (a boss). The only thing the machine controller cares about is which side fo the programmed line to compensate to. Look at this link for a description of the G40/G41/G42 cutter compensation code standards.

CUTTER COMPENSATION (G40, G41, G42) On GlobalSpec (http://www.globalspec.com/reference/74560/203279/cutter-compensation-g40-g41-g42)

If you are writing a CAM program, then the ones I have seen/used all ask the user if the profile is a pocket or a boss and then the program responds accordingly.

109jb
that is the answer I have been looking for!
the G41 etc stuff is very useful too, just didn't know how you tell which to use
your answer has nudged me in the right direction
award yourself a virtual <<insert beverage of choice>>

cheers
Mike :)

MarcusWolschon
06-07-2013, 08:48 AM
If your software works on triangles, it's easy.
Calculate the part of the surface normal of each triangle, normalize that vector and move the origin of the triangle by that vector multiplied by the tool radius.
Do that during the collision test code for each triangle.
Since the normal points to the outside of the object, you're done.

The g-code method fails to account for pockets smaller then the tool diameter. It would collide with the opposite wall.