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.
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
Similar Threads:
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.
An open mind is a virtue...so long as all the common sense has not leaked out.
Hello Geof
many thanks for that
it never occurred to me there'd be a gcode for it
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.
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
Closed curve is inside or outside.
You click a button during your cam setup. If its a closed circle, there can only be one inside and one outside.
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
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.
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.