Greetings
First time poster. I've read the READ FIRST post and will try to give all the relevant information. If something is missing I can specify.
Problem description
I've been programming a KUKA KR 120 R3200 PA robot arm. In one of the sections of the program the robot arm starts descending and waits for a signal ($IN[6]) from a ultrasonic sensor to trigger an interrupt. The interrupt switches a boolean variable in the main program, which the program interprets as a signal to stop descending. This works 99% of the time, but there are some (seemingly random) instances where the robot just stops moving after the interrupt is triggered and doesnt continue executing the rest of the program. When I look at the main pointer it is still at LIN_REL {Z -10} portion of the program (aka still descending), but the robot itself is at a standstill. When the program is reset and run from the beginning, this stopping problem persists, but when I reboot the system (with "Reboot control PC" button) the problem disappears and the rest of the program is executed as intended.
Additional information: When the issue occurs there are no errors displayed on screen (see image below). All the drives seem to be active, because when I move the robot and then press the play/start button the robot moves to the previous position. I've also checked the $VEL and $APO variables which seem to have normal values, meaning that the speed, acceleration values are ok. Also when observing the $POS_ACT value there seems to be no change, so the robot is not moving even in the slightest.
According to one of the operators the issue occurs when the program is reset and ran after one of the safeguards is activated and the program stops the robot. The safeguard is a pressure cylinder on the robot which stops the robot when it presses too hard against something. It is possible that this safeguard isn't triggered on time and the KUKA internal safeguards stop the robot, but from what I've seen my safeguard catches the issue and the program reset works fine.
Thoughts: I have a gut feeling that it has something to do with the interrupt (as it happens right after interrupt is triggered), but can't figure out what I'm doing wrong. The robot is operational 5 times a week around 5 hours a day and this kind of problem occurs once almost every day. Any guidance on how to solve or debug this issue when it reoccurs is much appreciated.
Code and screenshots
Descending to pack (code)
PalletOriginPos=$POS_ACT
BAS(#VEL_CP, 2.0)
; MÕÕDAB KÕRGUSE (Z KOORDINAAT)
StopZMoveOnInterrupt=TRUE
INTERRUPT ON 17 ;JYRGEN: Ultraheliandur.
WHILE StopZMoveOnInterrupt==TRUE
LIN_REL {Z -10} C_DIS
ENDWHILE
INTERRUPT OFF 17 ;JYRGEN: Ultraheliandur.
PalletOriginPos.Z=HitPoint.Z-78
Stop descending interrupt declaration and code:
INTERRUPT WITH BRAKE DECL 17 WHEN $IN[7]==TRUE DO HeightMeasure() ;DI7_Ultrasonic_SP1
...
GLOBAL DEF HeightMeasure()
BRAKE
HitPoint=$POS_INT
HeightOK=TRUE
IF StopXMoveOnInterrupt THEN
PhotoPointXAxis.X=HitPoint.X
StopXMoveOnInterrupt=FALSE
ENDIF
IF StopYMoveOnInterrupt THEN
PhotoPointYAxis.Y=HitPoint.Y
StopYMoveOnInterrupt=FALSE
ENDIF
IF StopZMoveOnInterrupt THEN
PhotoPointZAxis.Z=HitPoint.Z
StopZMoveOnInterrupt=FALSE
ENDIF
INTERRUPT OFF 18 ;JYRGEN: Ultraheliandur.
INTERRUPT OFF 17 ;JYRGEN: Ultraheliandur.
END
Display More
Image of program on SmartPad when robot is not moving but program is running:
robot-forum.com/attachment/31109/
Robot information
Robot "KUKA KR 120 R3200 PA"
Firmware version "8.6.6"
Software Architecture "KRC4"