Well, I think I've figured out a way to do what I want. I have a destacker robot that has a search routine that will save the last known position of found blanks. It's similar to a program I've used many times before (on ABBs / FANUCs). What I have been thinking about incorporating is an active torque monitor for the search as well.
Sometimes if blank stacks aren't stacked evenly (different heights), or if the sensors have been played with, the robot will collide with the blanks. I wanted to come up with something that will not only search for the blanks but monitor the torque in case of a collision, and if it detects a collision with the blanks, will pull out of the bin pallet just as if it was finishing a search.
I know I've posted a lot recently, but I know you guys all love programming as much as I do so I know you'll like looking through this. I also think it's great reference for someone trying to learn KRL or doing a Kuka project of their own.
I'm just wondering if I'm heading in the right path I think what I've come up with will work, maybe I am using a few incorrect variables here or there...
First, this goes into the submit interpreter:
DECL GLOBAL BOOL DESTACK_TORQ_ENABLE
DECL GLOBAL BOOL DESTACK_TORQ_EXCEEDED
DECL GLOBAL INT DESTACK_TORQ[7]
DESTACK_TORQ[0]=200
DESTACK_TORQ[1]=200
DESTACK_TORQ[2]=200
DESTACK_TORQ[3]=200
DESTACK_TORQ[4]=200
DESTACK_TORQ[5]=200
IF (DESTACK_TORQ_ENABLE == FALSE) THEN
DESTACK_TORQ_EXCEEDED=FALSE
ENDIF
IF (DESTACK_TORQ_MON == TRUE) THEN
FOR i=0 TO 5
IF ($TORQUE_AXIS_ACT[i] > DESTACK_TORQ[i]) THEN
DESTACK_TORQ_EXCEEDED=TRUE
ELSE
IF ($TORQUE_AXIS_ACT[i] < DESTACK_TORQ[i]) THEN
DESTACK_TORQ_EXCEEDED=FALSE
ENDIF
ENDIF
ENDFOR
ENDIF
Display More
This is my main "Unload Bin" program
DEF BIN_UNLOAD()
GLOBAL INTERRUPT DECL 1 WHEN $IN[63]==TRUE DO IR_SAVEPOS()
GLOBAL INTERRUPT DECL 2 WHEN (DESTACK_TORQ_EXCEEDED == TRUE) DO IR_DESTACKTORQ()
......
PTP ABOVESEARCH
INTERRUPT 1 ON
INTERRUPT 2 ON
DESTACK_TORQ_MONITOR=TRUE
SEARCH()
INTERRUPT 1 OFF
INTERRUPT 2 OFF
DESTACK_TORQ_MONITOR=FALSE
IF (FoundBottom == TRUE) THEN
GOTO NOBLANKS
ENDIF
......
END
Display More
search routine:
IR_SAVEPOS interrupt routine:
IR_DESTACKTORQ interrupt routine:
EDIT: I realized using a do while loop in the SPS probably isn't a good idea