585,728 active members*
4,120 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Coding > tool size compensation - I think?!?
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2010
    Posts
    0

    tool size compensation - I think?!?

    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

  2. #2
    Join Date
    Jul 2005
    Posts
    12177
    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.

  3. #3
    Join Date
    Dec 2010
    Posts
    0
    Hello Geof
    many thanks for that
    it never occurred to me there'd be a gcode for it

  4. #4
    Join Date
    Sep 2012
    Posts
    1543
    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.

  5. #5
    Join Date
    Dec 2010
    Posts
    0
    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

  6. #6
    Join Date
    Sep 2012
    Posts
    1543
    Closed curve is inside or outside.

  7. #7
    Join Date
    Dec 2010
    Posts
    0
    Quote Originally Posted by BAMCNC.COM View Post
    Closed curve is inside or outside.
    indeed
    but how does the software get to find out which!?

  8. #8
    Join Date
    Sep 2012
    Posts
    1543
    You click a button during your cam setup. If its a closed circle, there can only be one inside and one outside.

  9. #9
    Join Date
    Jan 2005
    Posts
    1943
    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.

  10. #10
    Join Date
    Dec 2010
    Posts
    0
    Quote Originally Posted by 109jb View Post
    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.
    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

  11. #11
    Join Date
    Aug 2012
    Posts
    181
    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.

Similar Threads

  1. Replies: 1
    Last Post: 09-21-2012, 08:21 PM
  2. tool compensation
    By mbmmachining in forum Mori Seiki lathes
    Replies: 0
    Last Post: 03-02-2010, 02:59 AM
  3. Tool compensation
    By ssozonoff in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 8
    Last Post: 01-21-2009, 04:06 PM
  4. Tool compensation
    By bg_izio in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 3
    Last Post: 05-04-2006, 02:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •