584,874 active members*
5,244 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Posts
    71

    Calling all code writers....

    My first attempt at writing a subroutine using M98 and it's a fail.........

    G91 (Set *Incremental Mode)
    G00 Z.1 (Rapid Positioning to safe Z)
    M8 (Flood coolant on command turns on spindle)
    G4 P3 (Dwell for spindle to spin up to speed)

    M98 P1000 L5 (call O1000 subprogram and Loop 5 times)
    G00 Z.1(Rapid Positioning to safe Z)
    M9 (all coolant off command to turn off spindle)
    G90 (Set *Absolute Mode)
    G00 X0 Y0 Z.100 (Rapid home- Z.100)
    M30 (Program end and rewind)

    O1000 (Subprogram to call)
    G01 Z-.500 F3 (Linear Interpolation) (Feedrate 3 Z down -.5)G00 Z.600 (New line to pull cutter up)
    G00 Z.600 (Rapid Positioning raises Z .600)
    G00 X-.05 (Rapid Positioning moves X over .05)
    M99 (return from Subroutine)
    %

    I missing something somewhere and can't seem to find it.
    My machine is using the A as a spinner on my mill and I am trying to cut incremental grooves in a round piece.
    It seems for some reason it's not reading the incremental code and each time it moves over in the X it keeps adding to the .100 clearance over the piece and by the time it gets to the last loop is only plunging around .100 and retracting around .600
    I tried moving the G91 into the sub program to no avail.
    Using Mach3 on my mill.
    Any clues or help is greatly appreciated.

  2. #2
    Join Date
    Dec 2008
    Posts
    3110

    Re: Calling all code writers....

    IMO you may find fault finding better if you:-
    try to make just the sub as an incremental part, start with G91, end with G90, add up each address between those G codes separately... ie all the Z values must equal zero
    ... you can then introduce the X step.... suggest you put at the start of sub.... the XYZ start point should allow for the X step.

    Programming entirely in incremental can lead to a large problem, you've got a lot more to check.

  3. #3
    Join Date
    Aug 2006
    Posts
    71

    Re: Calling all code writers....

    Quote Originally Posted by Superman View Post
    IMO you may find fault finding better if you:-
    try to make just the sub as an incremental part, start with G91, end with G90, add up each address between those G codes separately... ie all the Z values must equal zero
    ... you can then introduce the X step.... suggest you put at the start of sub.... the XYZ start point should allow for the X step.

    Programming entirely in incremental can lead to a large problem, you've got a lot more to check.
    Thanks for your input....
    I'll give it a stab a little later today and see what I can come up with.
    I had another tell me that's where he had put the G91 and didn't seem proper to me but I give it a whirl.
    I had a sneaky feeling that may be part of the problem.

    I'll report back......................

  4. #4
    Join Date
    Aug 2006
    Posts
    71

    Re: Calling all code writers....

    Moved the G91 into the sub and prelims in air look good. I tried that yesterday but have put it on the wrong line. Another friend also helped straighten me out on it.
    Much appreciated Superman

Similar Threads

  1. PLUGIN WRITERS - READ THIS
    By Beefy in forum UCCNC Control Software
    Replies: 0
    Last Post: 10-18-2016, 03:39 AM
  2. Calling all G-Code warriors
    By Alfonzo in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 5
    Last Post: 10-22-2009, 03:48 PM
  3. Calling all machinist!
    By MattF811 in forum Employment Opportunity
    Replies: 5
    Last Post: 10-29-2007, 08:42 PM
  4. can someone recommend some good fiction writers?
    By posix in forum Community Club House
    Replies: 50
    Last Post: 05-01-2006, 01:26 AM
  5. Drafts: Tips for vendors and tips for RFQ writers...
    By InspirationTool in forum Employment Opportunity
    Replies: 3
    Last Post: 12-21-2005, 03:44 AM

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
  •