Hi All,
I have been tasked with installing touch sensing for a range of cabinets that are being located off 2 holes and seem to not be in the same place each time. I have no macros for detecting this and so am trying to manually adjust the poisitons of the 4 external corners of the cabinet.
So far, this is the program I am looking to run:
GETS PX011 $PX011 ]
GETS PX012 $PX012 ]
GETS PX013 $PX013 ] Gets Ref Points 11-16 and puts in to P-Variables 11-16
GETS PX014 $PX014 ]
GETS PX015 $PX015 ]
GETS PX016 $PX016 ]
CNVRT PX011 PX011 RF ]
CNVRT PX012 PX012 RF ]
CNVRT PX013 PX013 RF ] Converts P-Variables to XYZ Robot Co-Ords
CNVRT PX014 PX014 RF ]
CNVRT PX015 PX015 RF ]
CNVRT PX016 PX016 RF ]
MOVL P011 V=100 ]
MOVL P012 V=100 SRCH RIN #(1) = ON DIS = 40 ] Moves from/to Ref Point
GETS B000 $B002 ] 11-12 and checks search
JUMP *1 IF B000 <> 0 ] was successful
PAUSE
*1
GETS PX005 $PX002 ] Gets contact position and puts in to PX005
CNVRT PX005 PX005 RF ] Converts to XYZ Robot Co-Ords
SUB P005 P001 ] Subtracts programmed corner #1 from contact position
GETE D001 P005 (1) ] Saves shift value (X - Value) to variable
MOVL P013 V=100 ]
MOVL P014 V=100 SRCH RIN #(1) = ON DIS = 40 ] Move from/to Ref Point
GETS B000 $B002 ] 13-14 and check search
JUMP *2 IF B000 <> 0 ] was successful
PAUSE
*2
GETS PX005 $PX002 ] Gets contact position and puts in to PX005
CNVRT PX005 PX005 RF ] Converts to XYZ Robot Co-Ords
SUB P005 P001 ] Subtracts programmed corner #1 from contact position
GETE D002 P005 (2) ] Saves shift value (Y - Value) to variable
MOVL P015 V=100 ]
MOVL P016 V=100 SRCH RIN #(1) = ON DIS = 40 ] Move from/to Ref Point
GETS B000 $B002 ] 13-14 and check search
JUMP *3 IF B000 <> 0 ] was successful
PAUSE
*3
GETS PX005 $PX002 ] Gets contact position and puts in to PX005
CNVRT PX005 PX005 RF ] Converts to XYZ Robot Co-Ords
SUB P005 P001 ] Subtracts programmed corner #1 from contact position
GETE D003 P005 (3) ] Saves shift value (Z - Value) to variable
-------
Corner 2
-------
GETS PX017 $PX017 ]
GETS PX018 $PX018 ]
GETS PX019 $PX019 ] Gets Ref Points 17-22 and puts in to P-Variables 17-22
GETS PX020 $PX020 ]
GETS PX021 $PX021 ]
GETS PX022 $PX022 ]
CNVRT PX017 PX017 RF ]
CNVRT PX018 PX018 RF ]
CNVRT PX019 PX019 RF ] Converts P-Variables to XYZ Robot Co-Ords
CNVRT PX020 PX020 RF ]
CNVRT PX021 PX021 RF ]
CNVRT PX022 PX022 RF ]
MOVL P017 V=100 ]
MOVL P018 V=100 SRCH RIN #(1) = ON DIS = 40 ] Moves from/to Ref Point
GETS B000 $B002 ] 17-18 and checks search
JUMP *4 IF B000 <> 0 ] was successful
PAUSE
*4
GETS PX005 $PX002 ] Gets contact position and puts in to PX005
CNVRT PX005 PX005 RF ] Converts to XYZ Robot Co-Ords
SUB P005 P002 ] Subtracts programmed corner #2 from contact position
GETE D004 P005 (1) ] Saves shift value (X - Value) to variable
MOVL P019 V=100 ]
MOVL P020 V=100 SRCH RIN #(1) = ON DIS = 40 ] Move from/to Ref Point
GETS B000 $B002 ] 19-20 and check search
JUMP *5 IF B000 <> 0 ] was successful
PAUSE
*5
GETS PX005 $PX002 ] Gets contact position and puts in to PX005
CNVRT PX005 PX005 RF ] Converts to XYZ Robot Co-Ords
SUB P005 P002 ] Subtracts programmed corner #2 from contact position
GETE D005 P005 (2) ] Saves shift value (Y - Value) to variable
MOVL P021 V=100 ]
MOVL P022 V=100 SRCH RIN #(1) = ON DIS = 40 ] Move from/to Ref Point
GETS B000 $B002 ] 21-22 and check search
JUMP *6 IF B000 <> 0 ] was successful
PAUSE
*6
GETS PX005 $PX002 ] Gets contact position and puts in to PX005
CNVRT PX005 PX005 RF ] Converts to XYZ Robot Co-Ords
SUB P005 P002 ] Subtracts programmed corner #2 from contact position
GETE D006 P005 (3)
SETE P006 (1) D001 ]
SETE P006 (2) D002 ]
SETE P006 (3) D003 ] Set shift values for X, Y and Z from
SETE P006 (4) 0 ] contact position offset of corner 1
SETE P006 (5) 0 ]
SETE P006 (6) 0 ]
SETE P007 (1) D004 ]
SETE P007 (2) D005 ]
SETE P007 (3) D006 ] Set shift values for X, Y and Z from
SETE P007 (4) 0 ] contact position offset of corner 1
SETE P007 (5) 0 ]
SETE P007 (6) 0 ]
SFTON P006 ] Move to shifted corner 1
MOVJ P001 ]
SFTOF ]
SFTON P007 ] Move to shifted corner 2 with
MOVJ P002 ] welding arc on and off at the
ACROF ] end
SFTOF ]
This is based off of a simple 2D internal search program I found but have modified to suit a 3 side external corner. However, I am very new to yaskawa Motoman controllers and unsure whether this logic would even work? Furthermore, the rapid inputs do not seem to come on when searching for R1 despite an obvious spark when the part touches!
Can anyone help out at all with this?