Machsupport Forum

Support => Downloads => MACH TOOL BOX => Topic started by: Ya-Nvr-No on October 31, 2010, 10:54:06 PM

Title: Multi pass facing program
Post by: Ya-Nvr-No on October 31, 2010, 10:54:06 PM
I have to clean up lots of top surfaces that need multiple passes to get flat. So I wrote this program to do what I needed. If nothing else it's a good example of doing multiple subroutines using variables. Hope it helps someone, I find it so much easier. I just enter in the width and Length of the face along with the number of passes I need to make to clean it up.
    Wish I could use if/then statements like I use with macro B but this does work well for me in Mach3. I tried to document to help ya. But I hope you will get the idea. Beats the Wizards for me.

Code: [Select]
   (CUTS Top Face of stock)
    (STARTED AT Z0 TOP OF rough PART)

    M03 (start spindle)
    G1G90X0Y0Z0.25F60. (Go to lower left corner of stock)
    Z0 ( Feed to face of rough stock)

    (load variables)
    #1000=[16] (Length in X in this case inches)
    #1001=[13] (Width in Y)
    #1002=[-0.1] (depth each of cut pass)

    #1004=0
    #1005=0.65 (offset cut distance smaller than .75 cutter diameter)
    #1006=[#1005*2] (Compute step over)
    #1007=[#1001/#1006] (Compute passes)

    M98 P5 L8 (call subroutine CUT DOWN IN Z in this case 0.1 * 8 = .8")
    M05 (stop spindle)
    G0G90Z.25 (move back up)
    X0Y0 (go home)
    M30 (All done)

    O5
    M98 P10 L1 (call sub to feed down)
    M98 P20 L1 (call sub to face part)
    G0G90Z0 (Move out of the way)
    X0Y0 (Go Home)
    M99

    O10
    #1004=[#1004+#1002] (Calculate New cut depth)
    G1Z[#1004] (MOVE TO CUT DEPTH)
    M99

    O20
    M98 P30 L[#1007] (call sub to cut reps ACROSS)
    M99

    O30
    (THIS IS THE SUB TO CUT FACE)
    G1 G91Y[#1005] (Increment over in Y)
    G90X[#1000]F80. (Cut across part)
    G91Y[#1005] (again increment over)
    G90X0 (Cut back across part)
    M99
Title: Re: Multi pass facing program
Post by: Ya-Nvr-No on March 24, 2012, 12:32:00 PM
Code: [Select]
O001
#100=-0.05(X Initial Home Start Point)
#101=-0.01(Y Initial Home Start Point)
#102=0.0  (Z Start Point)
#104=5.0  (X End Point)
#105=25   (Depth of Cut 25 *.002" = .05")
#106=15   (Number of Passes 15 * .02" *.02"= .6")
#107=0.002(Depth of Z cut)
#108=0.02 (Step over Y amount)

M3(Grinder Started)
G90
G0 Z0.1
X#100 Y#101(Go to the Initial Start Point)
Z#102
M98 P10 L#105
M5
M30

O10
#100=-0.01(X resets Home Start Point)
#101=0    (Y resets Home Start Point)
#102=0    (Z resets Home Start Point)
G0 X#100 Y#101
#102=[#102-#107]
G0 Z#102
M98 P20 L#106
M99

O20
#101=[#101-#108]
G1 Y#101 F90
X#104
#101=[#101-#108]
Y#101
X#100
M99
(Put comment here to make sure I have a carrage return on the last M99)
Title: Re: Multi pass facing program
Post by: juzer99 on November 02, 2018, 02:01:10 PM
Hello,
I am trying to modify your program for the machine to always cut in one direction. I removed the line that advances the cutter "on the other side" but I would like the Z to move up slightly before coming back and then drop back to previous level. I would appreciate some help.
Thanks
Robert

 O30
    (THIS IS THE SUB TO CUT FACE)
    G1 G91Y[#1005] (Increment over in Y)
    G90X[#1000]F80. (Cut across part)
    G90X0 (Go back across part)
    M99
Title: Re: Multi pass facing program
Post by: Ya-Nvr-No on November 02, 2018, 07:03:07 PM
You mean you want me to write it for you ???
try this:

    O30
    (THIS IS THE SUB TO CUT FACE)
    G91 G1Y[#1005] (Increment over in Y)
    G90 X[#1000]F80. (Cut across part)
    G0 Z.25 (GO UP TO CLEAR PART FACE)
    X0 (BACK TO STARTING SIDE)
    G1 Z[#1004] (MOVE BACK DOWN TO CUT DEPTH)
    G91 Y[#1005] (again increment over)
    G90 X[#1000] (Cut across part)
    M99
Title: Re: Multi pass facing program
Post by: juzer99 on November 05, 2018, 11:38:49 AM
It would take me several hours to get the same (hopefully) result. Thank you very much.

"If I have seen further it is by standing on ye sholders of Giants."
Isaac Newton
 
Title: Re: Multi pass facing program
Post by: juzer99 on November 11, 2018, 10:30:53 AM
I loaded the code into Mach3 but it appears my Mach3 does not understand M99 and/or L instructions.
 It runs all steps once and stops. I will look through the forum, there is probably something I am missing.
Title: Re: Multi pass facing program
Post by: Ya-Nvr-No on November 11, 2018, 11:09:38 AM
only two reasons I can think of why it might not work:

need a valid Mach3 license and it limits you to one loop or
you did not add a return/enter command after the M99

you will notice in the future a lot of programs, a comment statement or more likely a "%" on the next line to assure that it reads to the end of the loop or file.
insure yourself that a CR/LF (carriage return/line feed) is completing the line to be read by doing something like this:

M99
%
Title: Re: Multi pass facing program
Post by: juzer99 on November 13, 2018, 01:22:44 PM
Thanks! that explains it.