586,114 active members*
3,168 visitors online*
Register for free
Login
Results 1 to 17 of 17
  1. #1
    Join Date
    Aug 2008
    Posts
    31

    Need help with pallet-count-driven tool changes

    I am working on a production program for a GX 480 APC. Fanuc Oi-MD controller.
    Essentially, I am trying to run tool life management without reading a tool change. We tried to set up TLM before, but the tool count would never go up with a redundant tool call, it would only increase with an actual physical tool change.

    There are two pallets(A&B), each with 24 collets. The program loops indefinitely with a GOTO command.

    I will post my code below to show the main and internal subprogram; as well as the variable counter, and what should be the condition statements that define the tool/offset number. I think I may be going a lond way about this, but I am new to macros.

    %
    O3001(PART)

    N1

    #100=0 (COUNTER-RESET)

    N3

    WHILE[[0 LE #100]AND[#100 LT 3.]] DO1
    G0G90G40G94G80G17
    G91G0G30Z0M19
    T1M6(.0925 CARB ENDMILL)
    G43 H1 Z5.0
    GOTO2
    END1

    WHILE[[2 LE #100]AND[#100 LT 5]] DO2
    G0G90G40G94G80G17
    G91G0G30Z0M19
    T2M6(.0925 CARB ENDMILL)
    G43 H2 Z5.0
    GOTO2
    END2

    WHILE[[4 LE #100]AND[#100 LT 7]] DO3
    G0G90G40G94G80G17
    G91G0G30Z0M19
    T3M6(.0925 CARB ENDMILL)
    G43 H3 Z5.0
    GOTO2
    END3

    /GOTO4

    N2

    M0(PALLET CHANGE CONFIRMATION)
    M101(PALLET-A)

    #100=#100+1 (PALLET-COUNT-UP-1)

    M66

    G54.1P1
    M98Q100

    M97(PART-COUNT-UP-1)

    G54.1P2
    M98Q100
    M97(PART-COUNT-UP-1)

    ...(24 WORK OFFSETS)

    M09
    G0G90G40G94G80G17
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0
    M1

    M67

    M0(PALLET-CHANGE-CONFIRMATION)
    M102(PALLET-B)

    #100=#100+1 (PALLET-COUNT-UP-1)

    M66

    G54.1P25
    M98Q100
    M97(PART-COUNT-UP-1)

    G54.1P26
    M98Q100
    M97(PART-COUNT-UP-1)

    ...(24 WORK OFFSETS)

    M67
    M09
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0

    GOTO3

    N4

    M30

    N100
    G90G0G80G40
    (MILL CCW SUB)
    G43 X-.3665 Y-.051 Z.512 S9500 M3
    (CUTTING SUBPROGRAM)
    M99
    %

    The Q100 is calling up the N100 subprogram at the end of the program. The M66/67 are for collet block clamping pressure checks, on/off.

  2. #2
    Join Date
    May 2004
    Posts
    4519
    Not 100% sure I understand what you are attempting. How are you wanting to manage tool life, by number of parts or time in cut, or ????? It would be a good idea to write out a detailed logic diagram of what you want to attempt to do before even starting on the macro programming.

  3. #3
    Join Date
    Aug 2008
    Posts
    31
    By number of pallet changes.

  4. #4
    Join Date
    Aug 2008
    Posts
    31
    Basically:

    Reset Pallet Count

    Call Tool #/Offset # Based on Pallet Count

    M0 (Allow for pallet change confirmation)
    Pallet A
    Pallet Count +1
    (24 work offsets calling subprogram)

    M0 (Allow for pallet change confirmation)
    Pallet B
    Pallet Count +1
    (24 work offsets calling subprogram)

    Loop back to tool call
    Check pallet count and determine tool number
    Continue back to Pallet A

  5. #5
    Join Date
    May 2004
    Posts
    4519
    Ok. Are you wanting the machine to stop at a certain number of pallet changes? If so, use a count-down on a variable. When variable reaches zero, either go to M00 or M30.

  6. #6
    Join Date
    Aug 2008
    Posts
    31
    No, I'd prefer it to count up, and at say 10 pallets, move on to tool2, at 20 move on to tool3, then at 30, either end the program, or loop back to a count reset based on the block delete.

  7. #7
    Join Date
    Aug 2008
    Posts
    31
    I am aware my program shows changes at 3, 5, and 7. That was just to dry run and see if it worked.

  8. #8
    Join Date
    May 2004
    Posts
    4519
    Quote Originally Posted by quadtard View Post
    Basically:

    Reset Pallet Count

    Call Tool #/Offset # Based on Pallet Count

    M0 (Allow for pallet change confirmation)
    Pallet A
    Pallet Count +1
    (24 work offsets calling subprogram)

    M0 (Allow for pallet change confirmation)
    Pallet B
    Pallet Count +1
    (24 work offsets calling subprogram)

    Loop back to tool call
    Check pallet count and determine tool number
    Continue back to Pallet A
    I think I would move reset pallet count to the end after check pallet count. Then stop machine. There are probably a dozen different ways to do this. The one you choose will be the one that fits in with your logic and way of thinking.

    I would start by defining some variables, like: (#100 is number of pallet cycles - start at 0).
    (#101 is number of pallet sets - start at 0 - is also tool increment).

    The logic here would be:
    Start
    If pallet sets are at or greater than max, reset all to 0 and goto end
    If pallet cycles are at or greater than max, reset pallet cycles to 0 and increment sets by 1
    Goto main program

    Does that make sense?

  9. #9
    Join Date
    Aug 2008
    Posts
    31
    Maybe this approach:

    %
    O3001(PART)

    N2

    #500=0 (PALLET COUNT RESET)


    N1

    IF[#500LT10.]THEN[#501=1]
    IF[[#500GE10.]AND[#500LT20.]]THEN[#501=2]
    IF[[#500GE20.]AND[#500LT30.]]THEN[#501=3]

    IF[#500GE30.]GOTO3

    G0G90G40G94G80G17
    G91G0G30Z0M19
    M1

    M0(Pallet change conf. button)
    M101(PALLET A)

    #500=#500+1 (PALLET COUNT UP 1)

    T[#501]M6(.0925 CARB ENDMILL)
    M66

    G54.1P1
    M98Q100

    M97(PART-COUNT-UP-1)

    ...(24 OFFSETS)

    M09
    G0G90G40G94G80G17
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0
    M1

    M67

    M0(Pallet change conf. button)
    M102(PALLET B)

    #500=#500+1 (PALLET COUNT UP 1)

    T[#501]M6(.0925 CARB ENDMILL)
    M66

    G54.1P25
    M98Q100
    M97(PART-COUNT-UP-1)

    ...(24 OFFSETS)

    M67
    M09
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0

    GOTO1(LOOP)

    N3

    /GOTO2

    M30


    N100
    G90G0G80G40
    ...(MILL SUBPROGRAM)
    M99
    %

  10. #10
    Join Date
    May 2004
    Posts
    4519
    If you reset the pallet count at the top of the program on each execution, if the program is ever stopped and reset and then restarted, your saved count goes out the window. Might want to have some type of test for this.

  11. #11
    Join Date
    Aug 2008
    Posts
    31
    That's what I'm wanting. Since it's an indefinite loop the loop (N1) occurs after the count reset. With block delete on, I can allow it to reset the count after 30.

    BTW, I just editted the location of the GOTO command to call up count reset.

    Trying to run the above program nets me a reset in 500 on my macro page, then a count of 1 on 501, but then I get a "PS0004:address not found" alarm before it gets fully through my If/Then statements.

  12. #12
    Join Date
    May 2004
    Posts
    4519
    Again, my logic/thought process is not necessarily the same as yours.

    What is the description of the associated alarm? This is where N numbers (block numbers) come in handy so you can try to identify which line in the program is causing problems.

    Also, I think I would be running this as the sub-program, calling it from the main program. Again, different ways of logic and thinking.

  13. #13
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by quadtard View Post
    That's what I'm wanting. Since it's an indefinite loop the loop (N1) occurs after the count reset. With block delete on, I can allow it to reset the count after 30.

    BTW, I just editted the location of the GOTO command to call up count reset.

    Trying to run the above program nets me a reset in 500 on my macro page, then a count of 1 on 501, but then I get a "PS0004:address not found" alarm before it gets fully through my If/Then statements.
    Check the status of parameter bit 6006.0. If Zero, the Logical AND in the Conditional Decision statement will give you this error. Make sure its set to "1"

    Regards,

    Bill

  14. #14
    Join Date
    Aug 2008
    Posts
    31
    Thanks angelw, I checked that bit, and it appears it is factory set to 0 on most i controls. Once we get another break in production, I will try it out to see if it gets the desired results.

  15. #15
    Join Date
    Aug 2008
    Posts
    31
    Quote Originally Posted by txcncman View Post
    If you reset the pallet count at the top of the program on each execution, if the program is ever stopped and reset and then restarted, your saved count goes out the window. Might want to have some type of test for this.
    Quote Originally Posted by quadtard View Post
    Maybe this approach:

    %
    O3001(PART)

    N2

    /#500=0 (PALLET COUNT RESET)


    N1

    IF[#500LT10.]THEN[#501=1]
    IF[[#500GE10.]AND[#500LT20.]]THEN[#501=2]
    IF[[#500GE20.]AND[#500LT30.]]THEN[#501=3]

    IF[#500GE30.]GOTO3

    G0G90G40G94G80G17
    G91G0G30Z0M19
    M1

    M0(Pallet change conf. button)
    M101(PALLET A)

    #500=#500+1 (PALLET COUNT UP 1)

    T[#501]M6(.0925 CARB ENDMILL)
    M66

    G54.1P1
    M98Q100

    M97(PART-COUNT-UP-1)

    ...(24 OFFSETS)

    M09
    G0G90G40G94G80G17
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0
    M1

    M67

    M0(Pallet change conf. button)
    M102(PALLET B)

    #500=#500+1 (PALLET COUNT UP 1)

    T[#501]M6(.0925 CARB ENDMILL)
    M66

    G54.1P25
    M98Q100
    M97(PART-COUNT-UP-1)

    ...(24 OFFSETS)

    M67
    M09
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0

    GOTO1(LOOP)

    N3

    /GOTO2

    M30


    N100
    G90G0G80G40
    ...(MILL SUBPROGRAM)
    M99
    %



    I could use block delete to decide whether I would want to reset the pallet count. Regardless, I would want the initial reset to be at the front of the program.
    That way, I can leave block delete off during the day to run endmills to breakage, and turn it on for 2nd and 3rd shift to run tool life as needed.

  16. #16
    Join Date
    Aug 2008
    Posts
    31
    I verified that the machine does indeed have Macro B enabled. Turned bit 0 of 6006 to 1, and it still gives "PS0004:address not found" when approaching those conditions. The code stops short of reading IF[#500LT10.]THEN[#501=1] however, in my Macro page, 500 resets, and then 501 counts to 1. Should I remove the "AND" conditions? Should I turn off look ahead?

  17. #17
    Join Date
    Aug 2008
    Posts
    31
    Got it figured out. I had the THEN statements in brackets, when I shouldn't have.

    %
    O3001(...)

    N2

    /#500=0 (PALLET COUNT RESET)


    N1

    IF[#500LT30.]THEN#501=1
    IF[[#500GE30.]AND[#500LT60.]]THEN#501=2
    IF[[#500GE60.]AND[#500LT90.]]THEN#501=3

    IF[#500GE90.]GOTO3

    G0G90G40G94G80G17
    G91G0G30Z0M19
    M1

    M0(Pallet change conf. button)
    M101(PALLET A)

    #500=#500+1 (PALLET COUNT UP 1)

    T[#501]M6(.0925 CARB ENDMILL)
    M66

    G54.1P1
    M98Q100
    M97(PART-COUNT-UP-1)

    ....


    M09
    G0G90G40G94G80G17
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0
    M1

    M67

    M0(Pallet change conf. button)
    M102(PALLET B)

    #500=#500+1 (PALLET COUNT UP 1)

    T[#501]M6(.0925 CARB ENDMILL)
    M66

    G54.1P25
    M98Q100
    M97(PART-COUNT-UP-1)

    ....


    M67
    M09
    G53 Z-6.0 M19
    G53 X8.0 Y-8.0

    GOTO1(LOOP)

    N3

    /GOTO2

    M30


    N100
    G90G0G80G40
    (MILL CCW SUB)

    G43 H[#501] X... Y... Z... S.... M3
    ...
    M99
    %

Similar Threads

  1. Part Count
    By Jerseycnc in forum Parametric Programing
    Replies: 16
    Last Post: 03-09-2012, 04:33 PM
  2. direct driven or belt driven
    By jeremy0203 in forum Benchtop Machines
    Replies: 5
    Last Post: 07-27-2011, 05:23 AM
  3. mc40 tool and pallet change programme
    By vk_rathi in forum CNC Machining Centers
    Replies: 0
    Last Post: 07-14-2010, 05:19 PM
  4. 10T Parts Count counting tool changes?
    By RBrandes in forum Fanuc
    Replies: 0
    Last Post: 02-12-2006, 02:23 PM
  5. Britain's Big Bug Count
    By WallCrawler in forum Community Club House
    Replies: 0
    Last Post: 06-04-2004, 07:15 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
  •