502,816 active members
4,524 visitors online
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Lathe "washer" loop programming- G92,G52,G10 Etc
Results 1 to 2 of 2
  1. #1

    Post Lathe "washer" loop programming- G92,G52,G10 Etc

    Hello all,
    I am no way new or afraid of running subs and loops while programming lathes. I have manually coded a sub within a sub within a sub to run on older lathes as well. My problem is that I have a Fanuc 18i that I would like to go back to basics on for the parts we will run. I have run macros on other lathes, but want to explore keeping it simple. There are alot of non answers out there or always saying, nope...you HAVE to do a macro. So I am hoping some folks here will have some input. I want the safest easiest and quickest way to change this main part to different Diameter/Length spacers so keep that in mind as well instead of loading in an entire new program. I have already set my parameter 6005 to do an internal sub and that works fyi. Any other parameters need to be looked at let me know.

    Lets say I have a very basic lathe loop and want to convert from an older G92 setup that is proven to something that can can be used in this controller. What I want to accomplish is resetting the work zero after it parts off each spacer to run multiple spacers out of one "pull" or stick out.
    I am putting the code below for just the spacer cut part, not any previous facing, turning, drilling to keep it focused and simple. Yes, I do also have turned each spacer and parted off with the MDT, just not this program. So focus just on this below:

    *2" dia with 1.250" thru hole around .187(9) wide/thick

    T0303(MDT/partoff)
    G0 X2.010 Z.1
    G0 Z0.0
    G1 X1.250 F.004


    G0 X2.020 Z.1
    G1 X2.010 Z0.0 F.02
    G92 X2.010 Z0.0
    M98 P1 L8(spacer count)
    G53 O0
    G90
    G97 S650
    G0 X13 Z10

    M30

    O1(Internal SUB)

    G1 Z.000 F.02
    G1 X2.000 F.002
    G1 Z-.015
    G1 X1.970 Z0.0
    G0 X2.010
    G0 Z-.292
    G1 X2.000
    G1 X1.970 Z-.307 F.002
    G1 X1.200 F.0025
    G0 X2.010
    G92 X2.010 Z0.0
    G90
    M99

  2. #2
    Registered
    Join Date
    Sep 2010
    Posts
    1222

    Re: Lathe "washer" loop programming- G92,G52,G10 Etc

    Quote Originally Posted by HalfRapid View Post
    Hello all,

    *2" dia with 1.250" thru hole around .187(9) wide/thick

    T0303(MDT/partoff)
    G0 X2.010 Z.1
    G0 Z0.0
    G1 X1.250 F.004


    G0 X2.020 Z.1
    G1 X2.010 Z0.0 F.02
    G92 X2.010 Z0.0
    M98 P1 L8(spacer count)
    G53 O0
    G90
    G97 S650
    G0 X13 Z10

    M30

    O1(Internal SUB)

    G1 Z.000 F.02
    G1 X2.000 F.002
    G1 Z-.015
    G1 X1.970 Z0.0
    G0 X2.010
    G0 Z-.292
    G1 X2.000
    G1 X1.970 Z-.307 F.002
    G1 X1.200 F.0025
    G0 X2.010
    G92 X2.010 Z0.0
    G90
    M99
    If you want the Safest, Easiest method, then you're not going to like the answer. Using Macro Variables and setting them via a Single Macro Call Block, or have the Variables grouped together at the Start of the program is much Safer and Easier than making edits to the program, where there is an increased potential for errors.

    1. Local (Internal) Subprograms are not called in the way you have shown with M98 P1, they're called with a Q address and a sequence number, for example:
    M98 Q100 will call the Local Subprogram starting with N100

    2. Local Subprograms don't start with an "O" program number, they start with a Sequence Number (N).

    3. G53 requires an axis address, not the "O" character.

    4. Using the Child Workshift Offset G52 is safer and easier than G92.

    5. Unless the control is set to use G Code System B, or C (the default is G Code System A), G50 will be used, not G92

    Regards,

    Bill

Similar Threads

  1. Replies: 1
    Last Post: 01-05-2018, 05:19 AM
  2. programming a loop
    By crazycnc in forum Fanuc
    Replies: 19
    Last Post: 10-17-2011, 05:00 PM
  3. Programming of IF loop
    By gnt1982 in forum SIEMENS -> GENERAL
    Replies: 5
    Last Post: 07-03-2008, 09:48 PM
  4. Macro WHILE DO END Loop (Lathe)
    By Jorge-D-Fuentes in forum G-Code Programing
    Replies: 18
    Last Post: 07-25-2007, 02:57 PM
  5. Lathe conversion - open loop vs closed loop
    By bhowden in forum Uncategorised MetalWorking Machines
    Replies: 7
    Last Post: 03-21-2006, 10:56 PM

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
  •