Results 1 to 7 of 7

Thread: I need make a loop in Mach

  1. #1
    Registered cnc_swe's Avatar
    Join Date
    Jan 2006
    Location
    sweden
    Posts
    108
    Downloads
    0
    Uploads
    0

    I need make a loop in Mach

    Anybody now how a loop makes in mach. I need a short g-code string to make example X 20.00 in 0.5mm/loop down to 10.00
    Can I do this in any M or G-code. (I was talking about turning)


  2. #2
    Registered holbieone's Avatar
    Join Date
    Feb 2007
    Location
    usa
    Posts
    633
    Downloads
    1
    Uploads
    0
    i don't think you are being clear enough for people to understand what you want

    from what your post looks like your trying to turn a taper?


  3. #3
    Registered cnc_swe's Avatar
    Join Date
    Jan 2006
    Location
    sweden
    Posts
    108
    Downloads
    0
    Uploads
    0

    Unhappy The loop I was looking for

    This is not a taper or thread only normal turning from X20 to X10.

    Well I donīt like write lot of code like this:

    ***** the sub text*******
    N10 G00 Z0 X20
    N20 G01 Z-10
    N30 G00 X21
    N40 G00 Z0
    N50 G00 X 19.5
    N60 G01 Z-10
    and so on to X is 10.00
    *********************
    (if my cut on X is 0.5 I need to write this N10-N60 20 times

    In some machin you are writing a sub menu as Sinumerik G901 R3=10 P1.
    Like IF THEN ELSE as Pascal or Basic code.

    IF <X10 call ***SUB TEXT *** again, until I have 10.00 on X

    Hope this explanation is better.
    Sorry about my english


  4. #4
    Registered holbieone's Avatar
    Join Date
    Feb 2007
    Location
    usa
    Posts
    633
    Downloads
    1
    Uploads
    0
    Quote Originally Posted by cnc_swe View Post
    This is not a taper or thread only normal turning from X20 to X10.

    Well I donīt like write lot of code like this:

    ***** the sub text*******
    N10 G00 Z0 X20
    N20 G01 Z-10
    N30 G00 X21
    N40 G00 Z0
    N50 G00 X 19.5
    N60 G01 Z-10
    and so on to X is 10.00
    *********************
    (if my cut on X is 0.5 I need to write this N10-N60 20 times

    In some machin you are writing a sub menu as Sinumerik G901 R3=10 P1.
    Like IF THEN ELSE as Pascal or Basic code.

    IF <X10 call ***SUB TEXT *** again, until I have 10.00 on X

    Hope this explanation is better.
    Sorry about my english
    this clears up what your looking for

    it all depends on the capabilities of controller your using to do stuff like that

    some times i write a block of g-code in note pad then copy-paste as many times as in need then go back and edit the line that needs to be incremented

    i have also written things in basic to automatically index the cuts

    do you have visual basic or any other basic software

    i can send you an example


  • #5
    Registered cnc_swe's Avatar
    Join Date
    Jan 2006
    Location
    sweden
    Posts
    108
    Downloads
    0
    Uploads
    0

    I found the answer

    Thankīs holbieone.
    I think if I hade been writing SUBROUTINE more people hade understand my question. The software I drive is Mach3. I found this on www.

    www.artsoftcontrols.com/forum/index.php?
    PHPSESSID=24644e697cb402c44ef2e650d300da9b&topic=310.0

    S300 M3
    M8
    G00 G43 H3 Z1.00
    G00 X1.0 Y2.0
    M98 P1000
    X2
    M98 P1000
    X3
    M98P1000
    M30


    O1000
    G01 F40 Z-.5
    G01 F80 Z1.00
    G04 P1.0
    G00
    M99

    I copy this becaurse I think more people in the forum was understand my
    "loop" question if they see the code from Brian Barker.
    If you have another code Iīm really intressted, so holbieone please write.
    Regards
    cnc_swe


  • #6
    Registered
    Join Date
    Jul 2004
    Posts
    370
    Downloads
    0
    Uploads
    0
    This is the way I do it, or just use a wizard.

    %Lathe Turning Multi-Pass
    #1001=0 %zero
    #1002=2 %feed rate
    #1003=3 %loops
    #1004=0.6 %cut distance
    #1005=.010 %pullback
    #1006=0.020 %size of cut

    F#1002
    G90
    G1 x#1001z#1001 %Go to 0,0
    M98 P321 Q#1003 %Run Subroutine
    G90
    M30

    O321
    G0 G91 x[-1*#1006]
    G1 G90 z[-1*#1004]
    G1 G91 x#1005
    G0 G90 z#1001
    G0 G91 x[-1*#1005]
    M99

    Ozzie
    Last edited by ozzie34231; 05-20-2007 at 05:19 AM. Reason: corrections


  • #7
    Registered
    Join Date
    Jul 2004
    Posts
    370
    Downloads
    0
    Uploads
    0

    Not exactly correct

    I just read what I posted and it's not exactly correct because it is very old, (before Mach), but you get the idea. By using relative and absolute moves you can accomplish what you're asking.
    Using a wizard is much quicker.

    Ozzie


  • Similar Threads

    1. Confused: Mach Turn, Mach Mill, Mach 2/3 ?
      By CanSir in forum Mach Software (ArtSoft software)
      Replies: 5
      Last Post: 02-16-2007, 05:41 AM
    2. Mach 3 closed loop ?
      By efrem in forum Mach Mill
      Replies: 5
      Last Post: 12-06-2006, 08:01 PM
    3. Lathe conversion - open loop vs closed loop
      By bhowden in forum General Metal Working Machines
      Replies: 7
      Last Post: 03-21-2006, 04:56 PM
    4. Closed loop....open loop?
      By DAB_Design in forum General Electronics Discussion
      Replies: 10
      Last Post: 06-26-2004, 05:02 PM
    5. Closed Loop Driver vs. Closed Loop Computer
      By ojibberish in forum Gecko Drives
      Replies: 3
      Last Post: 06-08-2004, 12:30 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.