Part placement is off by one position

  • Good evening,

    I am currently having a problem placing a part on the cart with the FANUC robot I am working on. The cart can take up to 48 parts, the robot will load all the parts but is off by one position. The robot will place a part in the same location for part 1 and the next part (Part 2) after then it will now begin to apply the offset (in this case 25mm) to subsequent parts. The robot is programmed to apply an offset of 25mm from one part to another. The problem I am having is the robot will place part 1 and part 2 in the same location and then place part 3 in the location of where part 2 suppose to be and then it goes on like that until it gets to the last part which is 48, it then will place part 48 in the location of where part 47 suppose to be. I am off by one position and I don't know how to get this rectify. It wasn't doing this before, it just started doing it after I made a change using the TP to reprogram position 1 to prevent the robot from crashing into the cart when the parts placement gets to position 48 cos it was very close and will crash at times. Any suggestion will be highly welcome.


    Thanks!

  • 1: TIMER[1]=START ;

    2: DO[24:Cycle Time Bit 1]=PULSE,1.0sec ;

    3: COL DETECT ON ;

    4: UFRAME_NUM=0 ;

    5: UTOOL_NUM=1 ;

    6: PAYLOAD[1] ;

    7: R[200:SPEED]=GI[3:SPEED OVERIDE] ;

    8: OVERRIDE=R[200:SPEED] ;

    9: GO[1:SPEED OVERIDE ACK]=R[200:SPEED] ;

    10: ;

    11: ;

    12:J PR[5:HOME] 90% FINE ;

    13: ;

    14: R[10:HOMING]=100 ;

    15: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    16:L P[4] 4000mm/sec CNT100 ;

    17: DO[56:BlowOff On To PLC]=PULSE,1.0sec ;

    18:L P[5] 4000mm/sec CNT100 ;

    19: //L PR[17:MiniPickAppr] 4000mm/sec CNT100 ;

    20: WAIT DI[49:Part At Pickup]=ON ;

    21: ;

    22: IF DI[53:Dry Run Request]=ON,JMP LBL[4] ;

    23: //L P[2] 4000mm/sec FINE ;

    24:L PR[16:MiniPickPoint] 4000mm/sec FINE ;

    25: LBL[4] ;

    26: DO[55:Suction Off To PLC]=OFF ;

    27: DO[54:Suction On To PLC]=ON ;

    28: IF DI[53:Dry Run Request]=ON,JMP LBL[2] ;

    29: WAIT RI[2:SUCTION 2]=ON AND RI[3:SUCTION 3]=ON AND RI[4:PART PRESENT]=ON TIMEOUT,LBL[86] ;

    30: LBL[2] ;

    31: PAYLOAD[2] ;

    32: //L PR[17:MiniPickAppr] 4000mm/sec CNT10 ;

    33:L P[1] 4000mm/sec CNT10 ;

    34: IF DI[53:Dry Run Request]=ON,JMP LBL[3] ;

    35: WAIT RI[2:SUCTION 2]=ON AND RI[3:SUCTION 3]=ON AND RI[4:PART PRESENT]=ON TIMEOUT,LBL[86] ;

    36: LBL[3] ;

    37: DO[49:Part Picked / EOAT Clear]=PULSE,3.0sec ;

    38:L P[7] 4000mm/sec CNT50 ;

    39: ;

    40: R[10:HOMING]=120 ;

    41: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    42:L P[9] 4000mm/sec CNT50 ;

    43: ;

    44: R[10:HOMING]=200 ;

    45: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    46:L PR[8:EnterCart1] 4000mm/sec CNT50 ;

    47: ;

    48: ;

    49: UFRAME_NUM=1 ;

    50: UTOOL_NUM=1 ;

    51: R[1:X~OFFSET ]=GI[1:POS X~OFFSET] ;

    52: R[2:Z~OFFSET]=GI[2:POS Z~OFFSET] ;

    53: PR[1,1:OffsetX~Z]=R[1:X~OFFSET ] ;

    54: PR[1,3:OffsetX~Z]=R[2:Z~OFFSET] ;

    55: ;

    56: ;

    57: PR[10:1MiniAbovePoint]=PR[11:1MiniAboveReset] ;

    58: PR[10,1:1MiniAbovePoint]=PR[10,1:1MiniAbovePoint]+PR[1,1:OffsetX~Z] ;

    59: R[10:HOMING]=220 ;

    60: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    61:L PR[10:1MiniAbovePoint] 3000mm/sec CNT50 ;

    62: ;

    63: PR[12:1MiniNearPoint]=PR[13:1MiniNearReset] ;

    64: PR[12,1:1MiniNearPoint]=PR[12,1:1MiniNearPoint]+PR[1,1:OffsetX~Z] ;

    65:L PR[12:1MiniNearPoint] 1000mm/sec FINE ;

    66: ;

    67: ;

    68: PR[14:1MiniPlacePoint]=PR[15:1MiniPlaceReset] ;

    69: PR[14,1:1MiniPlacePoint]=PR[14,1:1MiniPlacePoint]+PR[1,1:OffsetX~Z] ;

    70:L PR[14:1MiniPlacePoint] 750mm/sec FINE ;

    71: ;

    72: IF RI[4:PART PRESENT]=OFF,JMP LBL[9999] ;

    73: DO[54:Suction On To PLC]=OFF ;

    74: DO[55:Suction Off To PLC]=ON ;

    75: DO[56:BlowOff On To PLC]=PULSE,1.0sec ;

    76: DO[51:Part Placing To Cart 1]=PULSE,2.0sec ;

    77: DO[50:Part Placed]=PULSE,0.5sec ;

    78: WAIT .25(sec) ;

    79: ;

    80: PAYLOAD[1] ;

    81:L PR[14:1MiniPlacePoint] 1000mm/sec CNT10 Offset,PR[2:OffsetZ 300] ;

    82: ;

    83: ;

    84: UFRAME_NUM=0 ;

    85: UTOOL_NUM=1 ;

    86: PAYLOAD[1] ;

    87: ;

    88:L PR[8:EnterCart1] 4000mm/sec CNT10 ;

    89: ;

    90: R[10:HOMING]=200 ;

    91: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    92:L P[16] 4000mm/sec CNT50 ;

    93: ;

    94: R[10:HOMING]=120 ;

    95: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    96:J PR[5:HOME] 100% FINE ;

    97: R[10:HOMING]=1 ;

    98: GO[2:HOME TRACKER BITS]=R[10:HOMING] ;

    99: ;

    100: ;

    101: TIMER[1]=STOP ;

    102: DO[37:Cycle Time Bit 2]=PULSE,1.0sec ;

    103: R[11:CYCLE TIME C1Mi]=TIMER[1] ;

    104: TIMER[1]=RESET ;

    105: ;

    106: ABORT ;

  • I currently do not know, I have just been working to modify the code because a lot of steps were missing earlier, so I checked a similar program from Cart 2 (The code I posted is for cart 1). I am only having this problem when the robot is placing the part in cart 1, the same robot will not do that when placing in cart 2. Cart 1 is to the left of the robot, while cart 2 is to the right of the robot. It just started doing this, I have ran this same program before and it worked fine, until I decide to touchup some position registers. I did not mess with the GI's.

  • Basically you move from MiniAboveRest to MiniNearReset to MiniPlaceReset but are applying an offset that is given to you in your GI.

    (Which by the way you can program more efficiently using the "Offset,PR[...]" motion instruction option. Lines 57-70 could be reduced down to about 5 lines)


    Your offset is currently only applying an X offset which is input from GI1, you're not actually doing anything with GI2 or the Z-Offset, at least from what you have shown.


    If you are returning to the same position in multiple iterations of this program, than the value of GI1 hasn't changed between those iterations. Find where/How GI1 comes to you. At the very least, STEP through the program for all 48 places, and keep track of what the GI1 value is for each iteration.

  • So, what the robot is doing is after placing part 1 at point 0mm which is shown on the HMI. It comes back and place part 2 at location 0mm also even tho it shows on the HMI as point 25mm. Part 3 is then place at the location where part 2 should have been, on the HMI it will display 50mm but in reality the part was part at 25mm from the starting position and it keep accumulating like that until it get to the last part and everything is one position off because part 1 and 2 where placed on the same spot.

  • I suggest you troubleshoot it. Add a pause at line 55, and rerun each iteration, look at the value of GI1 (and R1) before you resume. Your HMI might be telling you one thing, but the GI is telling you another. The code you posted isn't doing any math, it's straight up applying the GI to the offset.

  • I checked the GI and RI are they were changing as required. I decided to go ahead and just re-program the place point, I ran the code couple of times and it works fine. Thanks for your input, I really appreciate.

Advertising from our partners