Results 1 to 7 of 7

Thread: mill threading with sub' m99 m98 ?

  1. #1

    Default mill threading with sub' m99 m98 ?

    so ive been writing all my codes out never using subroutines (m99 m98) (mach3)

    like this below is how i always do it .... works well but there are better ways im sure
    (1/2 THREADER single cut )
    M3S3000
    M8
    G4 P1
    G0 X.125 Y0 Z.01
    G0Z0
    G2 X.125 Y0 Z-.0625 I-.125 J0 F30
    G2 X.125 Y0 Z-.125 I-.125 J0 F10
    G2 X.125 Y0 Z-.1875 I-.125 J0
    G2 X.125 Y0 Z-.25 I-.125 J0
    G1 X0Y0
    G0Z.1

    ive been looking to learn to put the m99 m98 and get it done in a few lines of code
    so i saw this on mach3 site which looks like it should work but doesnt for me . i think i just do not get how it doesnt work .

    M98 P1 L6
    O1
    G91
    G2 X0.0 Y0.0 I0.5 J0.0 z-0.06 F20.0
    M99

    i know it would do a completly different thread then first one i posted , but i dont know why i cant get the m99 an m98 to work so no way i can correct it anyway .
    mach3 always say '' returned call with no sub in effect ... looping''

    if it was in the middle of my list of code and the m98 was line # 50 would the P be 51?? and the O 51 ??
    or the O still be 1 for the repeating the lines 1 time .

    also wonder if the 91 is needed ??

    thanks

  2. #2
    Join Date
    Feb 2005
    Posts
    108

    Default

    Would it not be more sensible to ask on the Mach forum where you would be more likely to get an answer?
    http://www.machsupport.com/forum/index.php
    Hood

  3. #3

    Default

    i thought about that but i figure that's where i got the code i posted on here ( seems to not work but i like the idea) and i couldnt find much else on there , so i hoped for new ideas on a different forum .
    guess id better try there anyway .

  4. #4
    Join Date
    Feb 2005
    Posts
    108

    Default

    Lots of smart G Code guys on the Mach forum (of which I am NOT one )and I am sure if you had asked there you would have had an answer within minutes.

    See if this works

    M98 P1 L6
    m30
    O1
    G91
    G2 X0.0 Y0.0 I0.5 J0.0 z-0.06 F20.0
    M99
    %

    Hood

  5. #5

    Default

    the m30 was the missing part .makes sence. thanks ... i was probably searching the wrong thing .

    now i just need to figure out how to do it away from x0 y0 without getting sidway spirals.

  6. #6
    Join Date
    Feb 2005
    Posts
    108

    Default

    Easy enough, just define your start point in the main programme. In other words if you are in G90 (Absolute mode) and you do the following it will move to X1Y1Z0 before it starts the sub. The sub is in G91 (incremental ) mode so it will start from where it is and move the distance requested.

    G90
    G0x1y1z0
    M98 P1 L6
    m30
    O1
    G91
    G2 X0.0 Y0.0 I0.5 J0. z-0.06 F20.0
    M99
    %

    Note that the G90 to the M30 is the main programme and the sub is from the O1 to M99 You could have for example another sub below that which you would call from the main, eg

    G90
    G0x1y1z0
    M98 P1 L6
    M98 P2 L6
    m30
    O1
    G91
    G2 X0.0 Y0.0 I0.5 J0. z-0.06 F20.0
    M99

    O2
    G91
    G3 X0.0 Y0.0 I0.5 J0. z0.06 F20.0
    M99
    %


    As said asking on the Mach forum will get you answers very quickly when they relate to Mach, you should try it sometime
    Hood

  7. #7
    Join Date
    Feb 2005
    Posts
    108

    Default

    Also meant to say you really need to call the G90 again before the M30 as you will still be in incremental mode, from the subs, unless you do and it may give you some skid marks

    Hood

Posting Permissions

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