585,749 active members*
3,875 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    105

    G-Code repeat cycle

    I have my lathe CNC retrofit completed and running on Mach3. I can write a basic step in step out code and the machine performs well. I would like to do a basic turning program that repeats and steps the X axis in by 0.1mm each time a cut is taken until the final depth in reached. Rather than write dozens of lines with each line giving a step in increment of 0.1mm each time. Is there a G-Code command that can be used that will allow repeating of each step giving a new X axis value each time?
    How would this look?
    Any help would be greatly appreciated.

    Cam

  2. #2
    Join Date
    Feb 2008
    Posts
    586
    You might have a G74 available, which is usually used as a canned drill cycle.

    X10.Z1.
    G74 X1. Z-10. I-.1 K-10. F.1
    G80

    (Check your documentation to find out the usage and wording)

  3. #3
    Join Date
    Sep 2011
    Posts
    68
    Not easily done with Mach3. It does not support any looping or conditional execution constructs in its programming language.

    The closest you can come is to put the cutting operations in a subroutine that is called with a repeat count (M98 P# L#). Make the X axis move in incremental (G91) mode.

  4. #4
    Join Date
    Apr 2004
    Posts
    105
    Thanks for the reply's, I guess if Mach wont allow this type of turning cycle I could cheat and use the turning Wizard to create the code which has increments and cut and paste that into my own G-Code for that particular part of my program.

    Cam

  5. #5
    Join Date
    Sep 2011
    Posts
    68
    I'm pretty sure that you could do it using a subroutine call with the repeat (L) parameter. It is the only looping type construct that Mach3 supports, but it should be up to the task.

    It would be nice if Mach3 supported things like DO/WHILE loops and IF statements. I use Mach3 on my desktop mill and wrote a program that allows it to run CNC programs written for over 3 dozen different CNC machines... just to get around its limitations.

Similar Threads

  1. G-code step-and-repeat
    By MechanoMan in forum MetalWork Discussion
    Replies: 6
    Last Post: 05-21-2012, 12:45 AM
  2. Repeat G-Code
    By thomasz in forum Fadal
    Replies: 10
    Last Post: 10-01-2011, 12:30 PM
  3. whole G-Code REPEAT command ??
    By LockTech in forum G-Code Programing
    Replies: 14
    Last Post: 08-08-2010, 04:21 PM
  4. Repeat G-Code lines
    By rckdef in forum G-Code Programing
    Replies: 3
    Last Post: 07-22-2010, 09:00 AM
  5. How to Repeat in G81-cycle with G91
    By brinchen in forum Okuma
    Replies: 1
    Last Post: 03-06-2009, 03:38 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
  •