Results 1 to 4 of 4

Thread: Radius compensation in Mach2?

  1. #1
    Gold Member MrBean's Avatar
    Join Date
    Oct 2003
    Location
    UK
    Posts
    593
    Downloads
    0
    Uploads
    0

    Radius compensation in Mach2?

    Does anyone know the syntax for using G41/G42.

    I have some simple gcode that I'm running under Mach2, but I cant figure out how to use the G41/42 commands.

    Any help is appreciated.

    Regards Terry.....


  2. #2
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,295
    Downloads
    0
    Uploads
    0
    You need to have a lead in move, which is incredibly complicated to explain. Sometimes you need two. The lead in can be an arc or straight line. I recently read something on the Mach2 group about the lead in move being on the same line as G41/G42. But, I don't think it always has to be. Here code for a 2" circle (hole) using a 1/4" bit, with an arc for the lead in move. This displays correctly in Mach2's toolpath display, so I think it works. The center is at 0,0.

    G0 Z0.1250
    G0 X-0.1250 Y0.7500 Z0.1250
    G42P0.125 (turn on offset right- P = tool radius)
    G2 X0.0000 Y1.0000 Z0.0000 I0.1250 J0.0000 F20 (lead in move)
    G2 X0.0000 Y1.0000 Z-0.1250 I0.0000 J-1.0000
    G2 X0.0000 Y1.0000 Z-0.1250 I0.0000 J-1.0000
    G0 X0.0000 Y1.0000 Z0.1250
    G40 (turn off comp)

    Instead of using P for the tool radius, you can also use D for the tool # in the tool table. G41D1 = Use Tool #1.

    You should play around with some simple stuff until you get the hang of it. Here is code for a 2" square with a 1/4" bit.

    G0 Z0.1250
    G0 X4.0000 Y3.0000 Z0.1250
    G1 X4.0000 Y3.0000 Z-0.1250 F10
    G42P0.125 (turn on offset right- P = tool radius)
    G1 X3.2500 Y3.0000 Z-0.1250 F20 (lead in move)
    G1 X1.0000 Y3.0000 Z-0.1250
    G1 X1.0000 Y1.0000 Z-0.1250
    G1 X3.0000 Y1.0000 Z-0.1250
    G1 X3.0000 Y3.1105 Z-0.1250 (I like to always start and end a little bit outside my part)
    G40 (turn off comp)

    Since I don't have my router finished, I haven't tested this. But I have done simulated runs in Mach2 which looked correct. I generated the code using my AutoCAD G-code macro.

    Hope this helps.
    Gerry

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Gold Member MrBean's Avatar
    Join Date
    Oct 2003
    Location
    UK
    Posts
    593
    Downloads
    0
    Uploads
    0
    Many many thanks for that, ger21. Much appreciated.

    I was trying to enter a diameter after the G41/42 I didn't realise you needed a P.
    That sounds odd. I don't mean you need the toilet.


    A reference text file would be handy for Gcode syntax's. Mach2 has a list of supported G/M codes, but no info on syntax, unless I missed something.

    Thanks again.

    Regards Terry.....


  4. #4
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,295
    Downloads
    0
    Uploads
    0
    The docs are kinda vague and imo quite confusing in regards to G41/G42.
    When using the P with G41/G42, you need to enter the RADIUS, not diameter. Also, if you look carefully at the arc lead-in move, you'll see that it can't be drawn in a CAD program, because the start and end are different distances from the center of the arc. Even more confusing, eh? Lets see if I can explain it. I'll use metric, maybe that will make it a little clearer.

    We'll do a clockwise leadin move, starting at 9:00. We'll use a 6mm tool, starting at 0,0. Move 1/2 the diameter to the left and position the tool.

    G0 x-3 y0

    The center is 0,0. Next line is your tool offset.

    G42P3

    Offset to the right 3mm radius tool. Now the tricky part. The next line has to finish at the offset position.

    G2 X0 Y6 I3 J0


    The arc starts with a 3mm radius, but ends with a 6mm radius. Make sense? The arc lead in move needs to be tangent to the next move, or you'll get gouging.
    The next move can either be G1 X5(or whatever) Y6, Or a G2 to wherever you want.


    Imo, you should only use arc leadin moves for the inside of cutouts, as it's far to complicated to hand code all the time.

    Be aware that when doing cutouts, all inside corners need to have a radius at least as big as the tool radius, preferably a little bigger, or the tool will gouge the corner. Mach2 doesn't look ahead to see where it needs to go, so each line or arc needs to be tangent to the previous one or the tool will gouge the work. I'd draw some pictures, but I really don't have time right now. Hope this is helpful for you.
    Gerry

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


Similar Threads

  1. Macro/Parametric Programming
    By screensnot in forum Fadal
    Replies: 4
    Last Post: 03-28-2005, 09:45 PM
  2. Cutter compensation woes!!
    By RBCMan in forum G-Code Programing
    Replies: 7
    Last Post: 02-16-2005, 10:43 AM
  3. Radius between tangents?
    By smythe in forum Rhino 3D
    Replies: 6
    Last Post: 10-29-2004, 04:14 PM
  4. Windows XP or Windows 2000 better with Mach2
    By Beezer in forum Mach Software (ArtSoft software)
    Replies: 2
    Last Post: 10-18-2004, 11:08 AM
  5. G Code and Mach2
    By InventIt in forum DIY CNC Router Table Machines
    Replies: 8
    Last Post: 03-13-2004, 02:46 PM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.