586,588 active members*
2,389 visitors online*
Register for free
Login
Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2010
    Posts
    171

    Zero setting from program.

    Hi

    Is it possible to measure zero on an axis from program?
    For example.

    G00G54Z50.X1000.T0101
    M00
    (TOUCH PART Z)
    "some code here for measure Z0."
    (PUSH NC START)
    G00Z50.
    X1200.
    Z0.
    G1X800.

    Controller Fanuc 18iTB

  2. #2
    Join Date
    Aug 2011
    Posts
    2517
    it can't be done fully automatically but almost.....

    G0 T0202
    G0 X100.0 Z3.0 (brings setting tool near part)
    T0200
    M0
    (SWITCH TO MANUAL, TOUCH PART FACE AND SET WORKSHIFT Z0)
    (SWITCH BACK TO AUTO, PRESS START)
    G0 T0202
    G0 X300.0 Z150.0
    T0200
    M1
    (the rest of the program here)

    I do this nearly every day. It takes less than 5 seconds to re-set the w/shift this way.

  3. #3
    Join Date
    Jan 2010
    Posts
    171
    That's how i do it now, problem is that every 1000th time or so i forget to measure zero
    Problem is mostly on C axis where i need to use an indicator in a hole, finding zero is usually done but pressing measure C0

  4. #4
    Join Date
    May 2004
    Posts
    4519
    #2601 - G54 workpiece zero point offset value 2nd axis
    #5022 - Machine coordinate 2nd axis position

    Position machine at Z work zero point.

    Press cycle start.

    %
    Oxxxx
    #2601=#5022
    G0 W1.
    .
    .
    .
    M30
    %

  5. #5
    Join Date
    Jan 2010
    Posts
    171
    Quote Originally Posted by txcncman View Post
    #2601 - G54 workpiece zero point offset value 2nd axis
    #5022 - Machine coordinate 2nd axis position

    Position machine at Z work zero point.

    Press cycle start.

    %
    Oxxxx
    #2601=#5022
    G0 W1.
    .
    .
    .
    M30
    %
    Can't find 2601 or 5022 in parameter or book.

  6. #6
    Join Date
    Aug 2011
    Posts
    2517
    ProT0ZyKo, those are Macro Variables.

    And very nice too I must say
    although I think 2601 is wrong?
    Code:
                      Z (lathe)
                      or
              X axis  Y axis  Z axis       
    External  #5201   #5202   #5203       
    G54       #5221   #5222   #5223       
    G55       #5241   #5242   #5243       
    G56       #5261   #5262   #5263
    G57       #5281   #5282   #5283
    G58       #5301   #5302   #5303
    G59       #5321   #5322   #5323
    Should be 5222 or 5202 (I personally use 5202 when hard-coding a Z workshift in my programs)

    Bear in mind with that method the tool still has to be manually moved to the Z0 position.

    Not sure how you can forget. The tool is near the part and stopped in M00 for a reason..... to MEASURE the workshift. I think if someone were there to kick your ass every time you forgot and scrapped a part or made some kind of machining error you would remember pretty quickly to press 'measure'
    but yes put those macro variables in the program (#5222=#5022.... assuming you have Macro B option) and your problems are almost solved (you still need to manually move the tool).

    In my case it's common to have to touch the face and take off 0.002". If you need to touch on and take something off do this.....
    #5222=#5022 + 0.002

    I'm going to try this at work tomorrow.... can you tell I'm excited?

  7. #7
    Join Date
    Jan 2010
    Posts
    171
    Ops my bad. Didn't catch the macro part right away.
    Still 2601 is not right, this is "Work Shift (Shift Value)" Not touching this one.
    #5222=#5022 will work
    But doesn't look like i have Macro B option. i get "009 ILLEGAL ADRESS INPUT"
    This is an option i will get.

    fordav11: like i said it happens like every 1000th time, not that often, easy to get distracted while climbing in and out of machine
    But this is a way to make my programs bulletproof.

  8. #8
    Join Date
    Aug 2011
    Posts
    2517
    the #2601 comes from this list......
    Fanuc system macro variables and macro programming
    Seems to be correct but it's for a mill only according to the info. whereas #5201 - #5323 is more commonly used for both lathe and mill.

  9. #9
    Join Date
    Aug 2011
    Posts
    2517
    It works great with one small change.
    On a lathe the Z workshift number must be a positive number (at least on all Fanuc controls I've ever seen). If you touch on the face at Z0 and set current machine coordinate system Z position into your G54 Z workshift using the above macro commands it puts a negative number into G54 Z because the turret has moved in negative direction to touch the face.
    The positional error is doubled when you try to move after that.
    I.E. if offset in G54 Z is -200.123 the Z position at the face will be -400.246

    The solution is very simple....

    #5222 = ABS[#5022]

    This works I just tested it.

    So now all you need to do is get the Macro B Option and your problem is solved

  10. #10
    Join Date
    Feb 2006
    Posts
    1792
    One may not always be working in G54.
    The program O8009 given in the attachment would identify the current WCS and would do the needful.

    Fordav11,
    I am still trying to understand the need for ABS function.
    What I know is you cannot be wrong. Fanuc does have illogical things.
    Attached Files Attached Files

  11. #11
    Join Date
    Aug 2011
    Posts
    2517
    ABS simply removes the minus sign from the number that is auto-inputted into the G54 Z workshift. I was at work with limited info available on macro commands (I didn't have a Fanuc manual handy) and this came to me from my computer programming days in the 80's on my trusty C64. It works as I want it to work but there may be better ways. It works so I have no reason to look into it deeper.
    This is kind of an advanced topic/usage for macro. If someone is using this to shift workshifts it is understood they know what it is for and why/when to use it.

  12. #12
    Join Date
    Feb 2006
    Posts
    1792
    Sometime back I tried these things on 0i Mate TC. It worked without ABS function.

  13. #13
    Join Date
    Aug 2011
    Posts
    2517
    well then in that case your machine needed a minus value in the G54.
    My machine requires a positive value in the workshift or the tool when at zero return will not be at zero but at a large minus value instead.

  14. #14
    Join Date
    Jan 2010
    Posts
    171
    Awesome thanks all, now i just need the macro option, maybe next time an operator forget to set zero :devious:

Similar Threads

  1. Setting Wear Offset via NC Program
    By itstom in forum Fanuc
    Replies: 6
    Last Post: 02-22-2012, 07:53 PM
  2. Setting up for Fluid Management program
    By juanvaldez in forum MetalWork Discussion
    Replies: 1
    Last Post: 11-20-2010, 10:21 PM
  3. Setting tool data for using EIA/ISO program
    By apylus444 in forum Mazak, Mitsubishi, Mazatrol
    Replies: 4
    Last Post: 01-09-2009, 12:15 PM
  4. vf2 setting for 8x program names?
    By PaintItBlue in forum Haas Mills
    Replies: 3
    Last Post: 06-27-2008, 06:45 AM
  5. Setting or Program fault?
    By Kiwi in forum BobCad-Cam
    Replies: 20
    Last Post: 04-28-2006, 12:42 PM

Posting Permissions

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