Results 1 to 5 of 5

Thread: G-Code repeat cycle

  1. #1
    Me2
    Me2 is offline
    Registered
    Join Date
    Apr 2004
    Location
    Australia
    Posts
    102
    Downloads
    0
    Uploads
    0

    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
    Registered beege's Avatar
    Join Date
    Feb 2008
    Location
    USA
    Posts
    546
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Sep 2011
    Location
    USA
    Posts
    58
    Downloads
    0
    Uploads
    0
    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
    Me2
    Me2 is offline
    Registered
    Join Date
    Apr 2004
    Location
    Australia
    Posts
    102
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Sep 2011
    Location
    USA
    Posts
    58
    Downloads
    0
    Uploads
    0
    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 General Metalwork Discussion
      Replies: 6
      Last Post: 05-20-2012, 07:45 PM
    2. Repeat G-Code
      By thomasz in forum Fadal
      Replies: 10
      Last Post: 10-01-2011, 07:30 AM
    3. whole G-Code REPEAT command ??
      By LockTech in forum G-Code Programing
      Replies: 14
      Last Post: 08-08-2010, 11:21 AM
    4. Repeat G-Code lines
      By rckdef in forum G-Code Programing
      Replies: 3
      Last Post: 07-22-2010, 04:00 AM
    5. Need Help!- How to Repeat in G81-cycle with G91
      By brinchen in forum Okuma
      Replies: 1
      Last Post: 03-05-2009, 09:38 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.