Hello Guest it is April 22, 2019, 01:05:48 PM

Author Topic: Using M98 and M99  (Read 1910 times)

0 Members and 1 Guest are viewing this topic.

Using M98 and M99
« on: November 20, 2016, 12:55:56 AM »
Would someone be so kind as write a sample of code.  I've done several searches and watched numerous videos but still unclear about this one.  If I could see a sample of code I believe it would help me understand the commanded machine movements more.  I write a lot of simple linear codes for myself but I'm trying to understand more how the M98 function works.
Here is all I need the machine to do.  First I'll briefly describe the set up.  Mill...XYZ with a rotary A drive with a separate control so it does not need to be included in the code.  It just basically operates as a continuous rotating lathe spindle.  I need to slice off a row of "buttons" from a rotating piece in the A drive.  
So here is what I need the M98 code to do.....from X0 (the end of the part)Y0...Z0 will be top of the part.  The Z starts at 1. above Z0 then retract to .050 above Z0 for the clearance.
The X will do a G0 move to -.042 and the Z go -.25 at a G1Fxx from Z0 and just repeat that X and Z incremental move 25 times with the Z retracting to the .050 after each -.25 depth cut.
After it has completed all 25 passes return to X0Y0Z1.
I need a 1 inch Tool Length offset in the program.

So basically at the start of the program....Z will be 1. above the part at X0Y0 and have the X to move into the minus .042 of an inch and each time the X moves the Z needs to retract -.25....all this 25 times before return back to its start.

I would very much appreciate a sample of what this code should look like and I'm confident I can do my modifications, if needed, from there.

Thank you
Regards Dave aka cnc rookie

Offline RICH

*
  • *
  •  7,313 7,313
    • View Profile
Re: Using M98 and M99
« Reply #1 on: November 20, 2016, 08:49:39 AM »
Read the Mach Mill Manual, see pages 10-30 & 31.

Simple example as used in a Gcode:

M98 P01 L10  ' the 01 is the subroutine and 10 is the number of times it will repeat
M30          ' program end and rewind
O01          ' start of the subroutine
G1 X 1.0 F5  ' add gcode commands for whatever you want to do
     "                         "
M99          ' return from subroutine  / repeat


RICH
Re: Using M98 and M99
« Reply #2 on: November 20, 2016, 09:13:16 AM »
Gee....I would have never thought to look in the manual that was written for the software. ???
I'm searching all over the web for the information.
They don't call me rookie for nothing!
Thanks RICH for pointing me in the direction of greatness. ;)

Offline RICH

*
  • *
  •  7,313 7,313
    • View Profile
Re: Using M98 and M99
« Reply #3 on: November 20, 2016, 09:20:30 AM »
Glad it helped and enjoy the learning curve.

RICH
Re: Using M98 and M99
« Reply #4 on: December 15, 2016, 04:43:28 PM »
Hi, im not shure if it it will help and it is not fom me but translat it and giv a try!

Good luck