586,377 active members*
2,543 visitors online*
Register for free
Login
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2005
    Posts
    89

    G-Code table surfacing program?

    My Sacrificial Table needs surfacing to get it perfectly flat.

    Is there any way of writing a Program in G-Code to do the number of passes without
    hand coding every pass?
    I had in mind an automatic routine that will make a full pass in the
    Y-Axis direction, stepping the X-Axis one tool width and then returning to Y00,
    stepping one tool width; ad infinitum, etc etc, untill done.
    or, a rectangular spiraling pattern that increments/decrements by one tool width each pass.

    Is this possible or is hand coding the only way to do it?
    Skype me on imagineeringnz
    ----------------------------
    Intuitor: (noun)
    A person with a passion for learning and innovating that is so strong it is often more powerful than the desire to eat, sleep or seek personal wealth.
    Ummm . . . Guilty as charged.

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    Should only take a few minutes using ACE converter and any CAD program.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

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

  3. #3
    Join Date
    May 2005
    Posts
    89
    Quote Originally Posted by ger21
    Should only take a few minutes using ACE converter and any CAD program.
    I'm now using TurboCAD - Ace - TurboCNC, and I'm sure that I can draw the path needed but I thought that there might be a way to actually 'program' with G-Code like you can with BASIC. ie;

    05 'something' = 1
    10 Do 'something'
    15 'something' = 'something' + 1
    20 GOTO 10

    That sort of thing.
    Skype me on imagineeringnz
    ----------------------------
    Intuitor: (noun)
    A person with a passion for learning and innovating that is so strong it is often more powerful than the desire to eat, sleep or seek personal wealth.
    Ummm . . . Guilty as charged.

  4. #4
    Join Date
    Mar 2003
    Posts
    35538
    You can, but for me it would be faster to do it in CAD. Read the TurboCNC docs, it should be in there.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

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

  5. #5
    Join Date
    Mar 2004
    Posts
    1543
    This is called parametric programing. I prefer it to CAM written programs for repetitive tasks like this. The program syntax is slightly different for every control, unfortunately. Here a program to cut the teeth in a lathe softjaw. It has two loops like you need:


    ;TEETH,ADJUST TRUE SOFT JAWS
    ;set second jaw back 0.100", third back 0.200"

    (*BLEC'*',CMST';',CNDL3,CNDR4,ZRSP0,PDOF0.05,FDOV0 *)

    %LAPPER = 0
    %ZDEPTH = 0.5000

    %START:
    %COUNTER = 0
    %ZDEPTH = %ZDEPTH + 0.025 *;DEPTH OF CUT FOR EACH PASS
    %LAPPER = %LAPPER + 1

    G92 X 0.00 Y 0.00 Z %ZDEPTH
    G90
    G00 X 0.000 Y -0.250 Z 0.00


    %LOOP:
    %COUNTER = %COUNTER + 1

    G42 T 02
    G01 X 0.008 Y 0.000 F 3.0
    G01 X 0.122 Y 0.000
    G03 X 0.096 Y 0.750 I -1.304 J 0.330
    G01 X 0.000 Y 0.750
    G02 X 0.008 Y 0.000 I -3.986 J -0.420
    G01 X 0.008 Y -0.125
    G01 G 40 X 0.2857 Y -0.25
    G92 X 0.000 Y -0.25 Z 0.00

    IF (%COUNTER LE 9) GOTO %LOOP

    G54
    G00 X 0.00 Y 0.00 Z 0.00

    IF (%LAPPER LE 5) GOTO %START *;DO ALL TEETH 5 TIMES

  6. #6
    Join Date
    Jul 2005
    Posts
    12177

    Geof

    This is the style of program I use for facing various size one offs on a vertical cnc. I have omitted all the stuff about tool selection, rpm, etc., this is just the tool path for a 3/4" dia. tool facing 18 inches by 14 inches.

    N100 G54 X0. Y0.
    N101 Z0.
    N102 G91 G01 Y-0.74 F100. M97 P1000 L10
    N103 G28 M30
    N1000 G90 X-19.5
    N1001 G91 Y-0.74
    N1002 G90 X0. M99

    Comments:

    Line N100; Put the work zero slightly more than one tool diameter positive from the corner of the workpiece nearest machine zero.
    N101 Set tool offset at the finished surface.
    N102 This increments the Y slightly less than one tool diameter and calls the subroutine starting at N1000 ten times.
    N1000 The uses absolute positioning to face across the X distance.
    N1001 This increments the Y again.
    N1002 This returns in absolute back to X 0. and returns from the subroutine.

    The Y travel for each call of the subroutine is 1.48" and the total Y travel is 14.8". For different size cutters and different size parts it is only necessary to change the Y increment, the X travel and the L count.

  7. #7
    Join Date
    May 2005
    Posts
    89
    Thanks Gerry, Karl T and Geof,
    My spindle at the moment is a Dremel which will only take a 1/8 shaft as a tool. This limits me to a 3mm dia end mill. Geof, I'll have a crack at your program and substitute your tool dia to utilise my 3mm tool. It'll take a few loops of the subroutine, but I think that this is a better way than drawing it up in CAD.

    Thanks guys.
    Skype me on imagineeringnz
    ----------------------------
    Intuitor: (noun)
    A person with a passion for learning and innovating that is so strong it is often more powerful than the desire to eat, sleep or seek personal wealth.
    Ummm . . . Guilty as charged.

  8. #8
    Join Date
    May 2005
    Posts
    89
    Geof,
    I thought that I could manage this program OK, but it seems not. :devious:

    I've rewritten it to achieve my aims of surfacing X=500 Y=380 with a 3mm dia Tool but when 'Dry Verifying' under TurboCNC it gives me an error message of "A target line (0 Word) is required". This appears to be in line N102 and I cannot figure it out. Where have I gone wrong??

    Attached File.
    Attached Files Attached Files
    Skype me on imagineeringnz
    ----------------------------
    Intuitor: (noun)
    A person with a passion for learning and innovating that is so strong it is often more powerful than the desire to eat, sleep or seek personal wealth.
    Ummm . . . Guilty as charged.

  9. #9
    Join Date
    Mar 2003
    Posts
    35538
    Change P1000 to O1000. It's in the manual under M97.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

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

  10. #10
    Join Date
    Mar 2003
    Posts
    35538
    Not sure if TurboCNC supports the L126 in the M97, btw. It doesn't list it in the manual, anyway.

    Also, you can change TurboCNC to possibly use the P instead of O by going to configure>dialect
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

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

  11. #11
    Join Date
    Jul 2005
    Posts
    12177

    Geof

    Quote Originally Posted by Imagineering
    Geof,
    I thought that I could manage this program OK, but it seems not. :devious:

    I've rewritten it to achieve my aims of surfacing X=500 Y=380 with a 3mm dia Tool but when 'Dry Verifying' under TurboCNC it gives me an error message of "A target line (0 Word) is required". This appears to be in line N102 and I cannot figure it out. Where have I gone wrong??

    Attached File.
    You haven't really gone wrong; just your machine talks wood dialect I talk metal. As Gerry said O not P.

Posting Permissions

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