588,191 active members*
7,306 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > very new to g-code. Can someone help with x,y edge finding and tool offsets?
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2007
    Posts
    19

    very new to g-code. Can someone help with x,y edge finding and tool offsets?

    (This might not be the right forum for the question so if there is a more appropriate one, let me know.)

    I finally got my Taig cnc mill up and running and the guys in the Cad/Cam software forum recommended I learn basic g-code before I just start designing parts. And that is exactly what I have been doing the last 2-days. I have been able to do very basics cuts like circles and squares etc. but now I am having trouble understanding cutter compensation and locating the x,y coordinates of the part you want to cut.
    I was hoping someone could explain to me how to find exact coordinates of the part you want to cut and how the tool compensation would work. For example, say you have a 1x1x1 inch square. On the top of that square (top meaning +z) you want to trim 1/8 of an inch off the four sides with, lets say a .1 inch depth of cut. Lets say you want to start the cut at the bottom left hand corner at the top of the square (call that 0,0,0 of your part). How do you align the endmill with your part so that the g-code/mach3 knows where 0,0,0 of your part is?
    I am at the point where I could write the g-code movements for this cut but I have no idea how to take into account tool offsets and x,y location. If anybody could explain this or recommend a website that explains this, I would really appreciate it. Thanks-Josh

  2. #2
    Join Date
    Jul 2005
    Posts
    12177
    Here is one approach.

    I like to place my Work Zeroes, the G54, G55, etc locations at the center of my part or at some distinctive feature on the part such as a hole. You have a 1" square so I would choose the center and locate the Work Zero this way:

    Put something in the spindle with a known and accurate diameter, this is your probe. Use the jog control to bring this probe down beside the part and jog slowly toward it using either the X or Y axis. Use a piece of paper between the probe and the part to know when you are getting close; just slide the paper back and forth and you will feel it get pinched. Of course you need to be moving in 0.001" steps for this. I know paper sounds crude but it is surprisingly precise at around 0.003" and you can always measure it with a micrometer. When the paper is pinched so that it can barely be moved without tearing your probe is about 0.002" from the part. Now for safety raise the probe above the part. The centerline of your spindle is now a distance away from the center of the part that is the sum of the radius of the probe + half the width of the part + 0.002" for the paper. If you have approached from the positive side you need to subtract this sum from the machine coordinates that are displayed for the current location of the probe; you make the distance more negative. Now you enter the result into the G54 Work Zero table for the axis you were doing then repeat everything for the other axis.

    At the end of this your Work Zero is placed at the center of your part.

    For the tool offset, the Z offset I nearly always use the top of the part and you find this by brinning the tool down carefully and use the paper again and then this machine coordinate position goes in the Z Tool Offset table.

    Tool Compensation how does it work?

    First consider writing the program without tool compensation: You have a part where the edge is 0.500" from the G54 Work Zero location in all directions. You want to go around this part 1/8" or 0.125" in from the edge or 0.375 from the Work Zero at the center. Let's say you are using a 1/4" cutter so the radius is 0.125". for the periphery of this cutter to be at the 0.375" poition from the Work Zero the center of the cutter must be at 0.500". So if you are starting at the bottom left corner you start at X-.5 Y-.5 and then move to X-.5 Y.5 then X.5 Y.5 then X.5 Y-.5 and back to X-.5 Y-.5 of course during this your Z position is Z-.1. Notice these moves are climb milling.

    With Tool Compensation you do not add the tool radius into your coordinates you write the program using the actual part coordinates; i.e. X or Y + or - .375. Then you enter into a Tool Diameter table for the Tool number either the diameter of the cutter or the radius depending on what your control works with and in the program you have a command G41 D01 which tells the control "for this tool use the entry in location D01 and figure out the correct moves to put the periphery in the correct place for the following coordinates in a manner such that the tool centerline is to the left of the direction of movement".

    Your 1" square is very simple but when you get to more complicated moves Tool Compensation means that some moves are not possible because they are shorter than the tool radius. Also with Tool Compensation you cannot reverse direction because the controller is trying to keep to the left of the direction of travel. When you reverse it will either try to move acros the cutline to the opposite side so it is on the left and this makes a big crunch; or it puts up an alarm.

    Good luck.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  3. #3
    Join Date
    Nov 2007
    Posts
    19
    Beautiful explanation. I going to try to write this code this evening just for practice. Thanks, this is just the information I needed!-Josh

  4. #4
    Join Date
    Apr 2005
    Posts
    3634
    Free DXF - vectorink.com

Similar Threads

  1. Another Aussie Adventure in Optical Edge/Centre Finding
    By Greolt in forum Mach Software (ArtSoft software)
    Replies: 8
    Last Post: 04-01-2008, 09:48 PM
  2. optical measuring, centering, edge finding
    By aminear in forum Calibration / Measurement
    Replies: 17
    Last Post: 06-21-2007, 03:04 PM
  3. tool center or edge?
    By spock in forum BobCad-Cam
    Replies: 8
    Last Post: 02-05-2007, 07:45 AM
  4. Edge finding a vertical bar?
    By CraigH62 in forum MetalWork Discussion
    Replies: 4
    Last Post: 01-08-2007, 01:37 PM
  5. Anyone have a edge finder G-code routine?
    By InspirationTool in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 5
    Last Post: 10-03-2006, 01:48 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
  •