585,761 active members*
4,107 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2004
    Posts
    162

    Cutting at multiple depths.. looping ??

    I have a question about how do dosomething in MACH3, which I am sure would is simple, but I am unable to figure it out.

    When I use TURBOCNC, I use a gcode that uses a repeitive loop, based on current location. The code is as follows:

    F50
    G01 z.2
    g00 X14 Y0
    F42.0
    #1=14.00 ; Material width
    #2=.175 ; Width Of cut per pass
    g00 z-.02
    #3 = #1 F50 ; Set first cut depth & Feed rate
    N0100 #3=[#3-#2] ; Start of loop, compute new depth
    G00 y0 x#3 F50
    G00 y12 x#3 F50; Set new Row
    IF #3 GT 0 M97 O0100 ; Jump to start of loop (if not done)
    N0300 M02 ; Program End


    Unfortunately, this code will not run in MACH3. I don't think MACH3 supports the M97 command, if I recall the problem correctly.

    My question is: how would the best way of converting this to MACH3 compatibility? I use this same way to cut out a part at increasing depths, by using the variable to set the Z depth, thus I can cut out a part to a max Depth of .75 inches in increments of .05 Inches, while only having the actual cutting code entered one time, instead of for each incremental depth.

    Hope this question makes sense.. Any assistance would be greatly appreciated.

    Eddie

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    The latest versions of Mach3 have a wizard to cut in multiple passes. It will convert your single pass code to multiple passes.

    With previous versions, you could use the Multipass, which is (was?) on the main page.
    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
    Apr 2004
    Posts
    162
    I was never able to understand how the Multipass worked.. should I remove all the Z depth commands from my G-Code and allow MACH3 to determine hem, or should he program ignore all Z commands, etc.. ?

    Perhaps I should D/L the newer version, and see if i have better luck with it ...

    Eddie

  4. #4
    Join Date
    Mar 2003
    Posts
    35538
    I believe the new wizard is replacing the multipass. I haven't tried the wizard, but your right, the multipass is/ was a bit tricky to figure out. It does work good after a bit of trial and error.

    I think with either method, you're g-code should be to the final (full) depth.
    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
    Apr 2005
    Posts
    3634
    I'm not sure about Mach, You have some lower case letter "G-commands", & "Axis-letters" Does that matter ?
    g00 z-.02
    Also is this supposed to be "GOTO"? And, does "Mach" support "GOTOB"?
    IF #3 GT 0 M97 O0100 ; Jump to start of loop (if not done)
    Should this be "N0100" ?
    IF #3 GT 0 M97 O0100 ; Jump to start of loop (if not done)
    Also does the "If' have to have a "EndIf", and what are you asking in your code, "IF #3" what? What is your condition, for the "If"?

    IF #3 GT 0 M97 O0100 ; Jump to start of loop (if not done)


    Is this a part of a larger program, a sub program?

    You might want to just start over, write it out by hand in notepad, etc. or If you post your entire program, maybe we could get a better idea what your trying to do.

    .

  6. #6
    Join Date
    Apr 2004
    Posts
    162

    Entire program

    NO.. that is the entire program, and it runs perfectly in TurboCNC. It is just that TurboCNC is not even 1/5 as fast as MACH3 is. I use this program to cut (Level(?)) the top of my sacrificial table whenever i replace it., but I would rather let MACH3 do it, since it runs so much faster. I just don't know how to program it ..

    As for the lowercase Z, it does not appear to cause any problems, but I should fix that. It was just a personal program, and i never cleaned it up since I never expected it to be viewed by anyone else until now.

    Also the O0100 seems to be the proper form to use when you are referencing where it is going TO, as aopposed to a location where it is at.. if that makes any sense at all.. I pulled this originally from another G-Code source, and played with it until I got it working correctly, and was able to make it do what I wanted when I wanted to do it..

    The 'IF' statement seems to hang by itself with no requirement for an ENDIF as is necessary in programming. There was no ENDIF in the original program.
    The GT in the same line means:
    IF (variable) #3 is GT (GREATER THAN) 0 M97(jump to routine) O01000

  7. #7
    Join Date
    Apr 2005
    Posts
    3634
    I'm not sure how you Define anything in Mach (With 840D, I do it at the top of the page before any code) Like Counter in the code below

    I didn't know the max length in "Y", I'm thinking the length in "X" was 14.00

    I assume you will use a endmill, and zero the tool face to the table top surface before running the code below.

    % ; Start program

    G90 ; Absolute

    G00 X0.0 Y0.0 Z0.0 F50 ; Send all axis home

    G91 ; Incremental

    FOR Counter1 = 1 TO 3 ; Loop 3 times. depth in "Z"

    G91 ; Incremental

    G01 Z-0.5 F50 ; Infeed "Z"

    FOR Counter2 = 1 TO 40 ; Loop 40 times

    G91 ; Incremental

    G01 X-14.0 F50 ; Infeed "X"

    G01 Y-0.175 F50 ; Infeed "Y"

    G01 X14.0 F50 ; Return "X"

    G01 Y-0.175 F50 ; Infeed "Y"

    ENDFOR ; End loop

    G90 ; Absolute

    G00 Z0.0 F50 ; Send axis home

    G00 X0.0 Y0.0 Z0.0 F50 ; Send all axis home

    G91 ; Incremental

    G01 Z-0.5 F50 ; Infeed "Z"

    ENDFOR ; End loop

    G90 ; Absolute

    G00 Z0.0 F50 ; Send axis home

    G00 X0.0 Y0.0 Z0.0 F50 ; Send all axis home

    M30 ; End of program


    If the code above works for you, you might want to adjust the feed on the return home, so your not waiting all day for all axis to go home.
    Example:
    G00 X0.0 Y0.0 Z0.0 F50 ; Send all axis home
    G00 X0.0 Y0.0 Z0.0 F250 ; Send all axis home
    I don't know what kind of machine your running (Homebuilt etc.) as far as the Rapid Feed goes, you don't want to lose steps, again though, your only using it to level a table.

    I don't know If this was any help, heck I don't even know If Mach supports "FOR - ENDFOR"

    Run at your own risk, I don't know your exact situation. So go slow, the first few cuts.




    .

  8. #8
    Join Date
    Nov 2004
    Posts
    118
    You could use the surface wizard and save your setting This will make it so you could shange any think you like...

    Hope that helps
    Brian

  9. #9
    Join Date
    Apr 2004
    Posts
    162

    Surfacing wizard ??

    My ignorance is showing through again... What is the surfacing wizard?? don't recall seeing this one..

    Eddie

    Quote Originally Posted by Barker806
    You could use the surface wizard and save your setting This will make it so you could shange any think you like...

    Hope that helps
    Brian

  10. #10
    Join Date
    Nov 2004
    Posts
    118
    It should be in the Mach3 wizards... I have it here.. press the load wizards button on the screen and it is called surface.

    Hope that helps
    Brian

Posting Permissions

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