M98 FOR MACH3 using z offset


Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: M98 FOR MACH3 using z offset

  1. #1
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default M98 FOR MACH3 using z offset

    Sorry if this is an old many times solved issue. I searched. Im trying to make 9 passes for a profile outline, with .033 z offset on each pass. I cant seem to get this to work. The f70 was just to make the simulation run faster. In reality it would be more like f12.

    G90 G00 X0.Y0.Z.3
    M98L9
    G01 Z0.F7.
    G91 Z-.033
    G90
    G01 Y0.6623 F70.
    X-0.0996 Y3.5149
    X0.286 Y3.5284
    X0.3038 Y3.0193
    G03 X0.3241 Y3.0003 R0.0197
    G01 X1.0009 Y3.0239
    G03 X1.0199 Y3.0443 R0.0197
    G01 X1.0021 Y3.5534
    X1.3877 Y3.5668
    X1.4118 Y2.8763
    G02 X1.3774 Y2.7274 R0.2953
    G01 X1.3259 Y2.6306
    G03 X1.3053 Y2.5412 R0.1772
    G01 X1.3561 Y1.0872
    G03 X1.3829 Y0.9995 R0.1772
    G01 X1.441 Y0.9065
    G02 X1.4857 Y0.7604 R0.2953
    G01 X1.4961 Y0.4628
    Y0.
    X1.1457
    Y0.5118
    G03 X1.126 Y0.5315 R0.0197
    G01 X0.3701
    G03 X0.3504 Y0.5118 R0.0197
    G01 Y0.
    X0.
    M99
    G90 G00 Z.3
    G00 X2.5Y7.5
    M30


    Any help much appreciated.

    Similar Threads:


  2. #2
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    G90 G00 X0.Y0.Z.3
    M98L9
    G01 Z0.F7. (move up to absolute 0)
    G91 Z-.033 (Increment down -0.033, puts the tool in the same place as it was)
    G90
    G01 Y0.6623 F70.

    Try this:

    G90 G00 X0.Y0.Z.3
    M98L9
    G01 G91 Z-.033 F7 (Increment down -0.033, from previous position)
    G90
    G01 Y0.6623 F70.



  3. #3
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    You programed teh SUB incorrectly for Mach3.

    (;-) TP



  4. #4
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Ok, so I took out the g01 z0. However, I dont think thats a problem because z0. would be set at the top of the material. So, g00 x0.y0.z.3 puts the spindle at .3 above, g01 z0. puts the spindle at the top of the material, and then g91 z-.033 plunges the tool into the material. Do I need the g01 in there again with the g91 command? As typed out the simulation would run 1 cycle, but not 9.

    Anyway, its still not working. Do I have the m98 m99 commands somehow wrong? Is L the correct term for the number of repetitions?



  5. #5
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    It should be

    G90 G00 X0.Y0.Z.3
    M98 P0001 L9 (call sub routine 0001)
    O0001 (sub routine 0001)
    G01 G91 Z-.033 F7 (Increment down -0.033, from previous position)
    G90
    G01 Y0.6623 F70.



  6. #6
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Back to making 1 pass. I added the p0001, and the o0001. So it would not generate a tool path unless I remove the m99. After removing the m99, the simulator would run 1 pass.



  7. #7
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Try this, this is known good call sub code that I wrote some time ago. I assume you are using P and O, not p and o in the code

    G90 G00 X0.Y0.Z.3
    M98 P2 L9 (call sub routine 2, should run 9 passes)
    O2 (sub routine 2)
    G01 G91 Z-.033 F7 (Increment down -0.033, from previous position)
    G90
    G01 Y0.6623 F70.
    .........
    .......
    M99



  8. #8
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    I think this is what the code should actually look like

    BAD CODE Sorry

    Last edited by Jim Dawson; 01-30-2017 at 01:59 PM.


  9. #9
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    OK, ignore above post, this code works, I just tested it.

    %
    G90 G00 X0.Y0.Z.3
    G01 Z0 F7
    M98 P2 L9 (call sub routine 2, should run 9 passes)
    G90 G00 Z.3
    G00 X2.5Y7.5
    M30
    O2 (sub routine 2)
    G01 G91 Z-.033 F7
    G90
    G01 Y0.6623 F70.
    X-0.0996 Y3.5149
    X0.286 Y3.5284
    X0.3038 Y3.0193
    G03 X0.3241 Y3.0003 R0.0197
    G01 X1.0009 Y3.0239
    G03 X1.0199 Y3.0443 R0.0197
    G01 X1.0021 Y3.5534
    X1.3877 Y3.5668
    X1.4118 Y2.8763
    G02 X1.3774 Y2.7274 R0.2953
    G01 X1.3259 Y2.6306
    G03 X1.3053 Y2.5412 R0.1772
    G01 X1.3561 Y1.0872
    G03 X1.3829 Y0.9995 R0.1772
    G01 X1.441 Y0.9065
    G02 X1.4857 Y0.7604 R0.2953
    G01 X1.4961 Y0.4628
    Y0.
    X1.1457
    Y0.5118
    G03 X1.126 Y0.5315 R0.0197
    G01 X0.3701
    G03 X0.3504 Y0.5118 R0.0197
    G01 Y0.
    X0.
    M99
    %



  10. #10
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    heres the current configuration of my program. I put an M30 in right before the m99, also made sure to push "enter" button after typing m99, and added the % sighn. In this configuration, it will run 1 cycle, but still not getting 9 loops.

    G90 G00 X0.Y0.Z.3
    M98 P2 L9

    O2
    G01 G91 Z-.033F7.
    G90
    G01 Y0.6623 F70.
    X-0.0996 Y3.5149
    X0.286 Y3.5284
    X0.3038 Y3.0193
    G03 X0.3241 Y3.0003 R0.0197
    G01 X1.0009 Y3.0239
    G03 X1.0199 Y3.0443 R0.0197
    G01 X1.0021 Y3.5534
    X1.3877 Y3.5668
    X1.4118 Y2.8763
    G02 X1.3774 Y2.7274 R0.2953
    G01 X1.3259 Y2.6306
    G03 X1.3053 Y2.5412 R0.1772
    G01 X1.3561 Y1.0872
    G03 X1.3829 Y0.9995 R0.1772
    G01 X1.441 Y0.9065
    G02 X1.4857 Y0.7604 R0.2953
    G01 X1.4961 Y0.4628
    Y0.
    X1.1457
    Y0.5118
    G03 X1.126 Y0.5315 R0.0197
    G01 X0.3701
    G03 X0.3504 Y0.5118 R0.0197
    G01 Y0.
    G01 X0.
    M30
    M99
    %

    If I take the m30 out and put it back in at the very end or leave it out entirely, the program will not run. The mach3 simulator will not generate a path, and it highlights the O2 line as if that were an error. Ive looked at other mach3 codes with very similar usage of the m98 m99 commands, but this thing just isnt working. I think at this point it might be an issue of the m99 command not being recognised, but not sure how to make that happen. I havent added the finishing moves such as rapid out and away, then rapid to a clearance position,, just trying to make the subroutine work at this point.



  11. #11
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    My bad. I gave you bad code, see my post above



  12. #12
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Another interesting little thing. I just wrote this shorter loop to test, and it ran perfectly first time. This program should make a 1x1 square starting at x0y0 and ending there, 5 passes.

    G90 G00 X0.Y0.Z.5
    M98 P2 L5
    O2

    G91 G01 Z-.05
    G90G01 Y1.0
    G01 X1.0
    G01 Y0.0
    G01 X0.0
    G01 Z.3
    M99

    However, after opening up the editor, and trying to ad an f feed rate command, it would not run. So, I removed the f command, and it will still not run. It ran fine when it was freshly generated with no editing,, but after an edit, and back to first version, it will not run. So, I think something is happening in the saving of the edit, that is causing possibly both the O command and the m99 command to be not recognised.

    So, Jim, I think your help is spot on,, but something is happening after an edit, not saving correctly? My mach3 is using the note pad as the default test editor.



  13. #13
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Jim you fixed it! I copied and pasted your revised program into a fresh notpad, and ran it,, worked fine. So, i went ahead and edited the feed rate, and it worked fine again. So, I will finish the program and add the exit moves,, and see how it works again. So far though the % sign on top and on bottom, and re-positioning the m30 seems to have fixed the subroutine.



  14. #14
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Try this, the % is just a placeholder just to get a carriage return in there,to keep it from screwing up. Notepad is the default editor, but don't forget to save in notepad.

    %
    G90 G00 X0.Y0.Z.5
    M98 P2 L5
    M30
    O2
    G91 G01 Z-.05 F7
    G90 G01 Y1.0 F70
    G01 X1.0
    G01 Y0.0
    G01 X0.0
    G01 Z.3
    M99
    %



  15. #15
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Happy to help where I can



  16. #16
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Final version so far. i added a couple of z moves to clear the endmill with a blast of air between cycles. I think this will work.

    Thanks Jim!

    %
    G90 G00 X0.Y0.Z.3

    M98 P2 L9
    G90 G00 Z.3
    G00 X2.5Y7.5
    M30
    O2
    g01 z0.f7.
    G01 G91 Z-.033 F12.
    G90
    G01 Y0.6623
    X-0.0996 Y3.5149
    X0.286 Y3.5284
    X0.3038 Y3.0193
    G03 X0.3241 Y3.0003 R0.0197
    G01 X1.0009 Y3.0239
    G03 X1.0199 Y3.0443 R0.0197
    G01 X1.0021 Y3.5534
    X1.3877 Y3.5668
    X1.4118 Y2.8763
    G02 X1.3774 Y2.7274 R0.2953
    G01 X1.3259 Y2.6306
    G03 X1.3053 Y2.5412 R0.1772
    G01 X1.3561 Y1.0872
    G03 X1.3829 Y0.9995 R0.1772
    G01 X1.441 Y0.9065
    G02 X1.4857 Y0.7604 R0.2953
    G01 X1.4961 Y0.4628
    Y0.
    X1.1457
    Y0.5118
    G03 X1.126 Y0.5315 R0.0197
    G01 X0.3701
    G03 X0.3504 Y0.5118 R0.0197
    G01 Y0.
    X0.
    M99
    %



  17. #17
    Member vmax549's Avatar
    Join Date
    Oct 2005
    Location
    Lady Lake
    Posts
    1145
    Downloads
    3
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    You have the function correct now but I do not see it stepping down . The way it reads is it will simply repeat the same depth 9 times.

    (;-) TP



  18. #18
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    Quote Originally Posted by vmax549 View Post
    You have the function correct now but I do not see it stepping down . The way it reads is it will simply repeat the same depth 9 times.

    (;-) TP
    g01 z0.f7.
    G01 G91 Z-.033 F12. <<<<< This causes it to increment down on each pass through the loop. The G91 puts it in incremental mode
    G90



  19. #19
    Registered
    Join Date
    Apr 2014
    Posts
    26
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    I was wondering about the step down as well. In simulation it shows the z movements in the correct places, but not a measurement of each z move. However, theg01 g91 z-.033 should take care of that? Ill check my z moves. Perhaps by moving up in z,, I am cancelling out the effectiveness of the g01 g91 z-.033?



  20. #20
    Community Moderator Jim Dawson's Avatar
    Join Date
    Dec 2013
    Posts
    5717
    Downloads
    0
    Uploads
    0

    Default Re: M98 FOR MACH3 using z offset

    I just caught that, you put the ''g01 z0.f7. '' back in



Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

M98 FOR MACH3 using z offset

M98 FOR MACH3 using z offset