1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. KUKA Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Program stuck executing motion command (LIN_REL), but robot is not moving.

  • RoboterEST
  • July 15, 2021 at 8:50 AM
  • Thread is Unresolved
  • RoboterEST
    Trophies
    2
    Posts
    7
    • July 15, 2021 at 8:50 AM
    • #1

    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)

    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:

    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"

  • hermann
    Reactions Received
    411
    Trophies
    9
    Posts
    2,622
    • July 15, 2021 at 9:13 AM
    • #2

    Interrupt off 17 should be at the beginning of heightmeasure(). Otherwise you can get one or more interrupts in between the interrupt routine, some kind of recursion.

    But things like that should be done in a different way: use the interrupt with a resume, use search function of forum to find many examples.

    The problem in your solution is, that after the interrupt in mid of the 10 mm the robot will do one some more movements, the amount depends on the value of $Advance.

  • RoboterEST
    Trophies
    2
    Posts
    7
    • July 15, 2021 at 9:48 AM
    • #3

    hermann Disabling the interupt earlier is a good suggestion. Will make that change and update this post, if this fixes the issue.

    To your second point, I am aware that the robot moves downwards after INTERRUPT 17 is triggered, but this "additional" movement after the interrupt causes no problemse. Currently RESUME variant can not be implemented easily and therefore changing this is not a priority (unless it could fix the issue at hand).

  • hermann
    Reactions Received
    411
    Trophies
    9
    Posts
    2,622
    • July 15, 2021 at 9:56 AM
    • #4
    Quote from RoboterEST

    ... Currently RESUME variant can not be implemented easily ...

    I have to disagree. It's easy in any case.

    One more thing: In your solution you don't have a second stop criteria if the sensor is defective. The robot will move endless until he runs into mechanical problems.

  • RoboterEST
    Trophies
    2
    Posts
    7
    • July 15, 2021 at 11:49 AM
    • #5

    hermann When moving downwards on the Z axis, the pressure cilinder will generate an interrupt when it encounters an object and presses on it. This INTERRUPT is enabled at the beginning of the main program and can be considered a stop criterion.

    I will try to rework the code today so it will use RESUME and add some additional stop criterion coordinates wise.

    UPDATE (Post #3): The operator seems to think that the change, where I turned the interrupt off immediately after function call, might have done the trick. Since the error was this rare of I am yet to be convinced, but will see.

  • Koppel
    Reactions Received
    19
    Trophies
    3
    Posts
    132
    • July 17, 2021 at 9:41 AM
    • #6

    Greetings from a fellow estonian.

    Are you sure you cannot do the "by the book" solution with essentially three programs.

    - Main()

    - search()

    - found()

    The concept is that you declare the interrupt in the main program.

    Call a search() from your main program

    The interrupt is turned ON in the search program

    This search program is tasked to go to the bottom of your stack... PTP SeachEnd. (You are just looping Z -10mm)

    You have a "WAIT FOR TRUE" at the end to prevent the advance run pointer to process anything more.

    "When the RESUME statement is activated, the advance run pointer must not
    be at the level where the current interrupt was declared. To prevent this, an
    advance run stop is triggered here via WAIT FOR TRUE."


    Code
    DEF PROG()
    INI
    ...
    INTERRUPT DECL 21 WHEN $IN[15] DO FOUND()
    PTP HOME
    ...
    SEARCH()
    ...
    END
    Code
    DEF SEARCH()
    INTERRUPT ON 21
    SPLINE 
    SPL START_SEARCH 
    SPL IN_BETWEEN 
    SPL END_SEARCH
    ENDSPLINE
    WAIT FOR TRUE
    ...
    END

    You have a third program Found() that turns the Interrupt OFF, brakes and reverses back to the point where the interrupt was called because braking takes some time and distance.

    Code
    DEF FOUND()
    INTERRUPT OFF 21
    BRAKE
    LIN $POS_INT
    ... ;The robot grips the found part.
    RESUME
    END

    RESUME causes the main program to be resumed after the part has been
    gripped. Without the RESUME statement, the subprogram SEARCH() would
    be resumed after END.

  • RoboterEST
    Trophies
    2
    Posts
    7
    • July 19, 2021 at 8:25 AM
    • #7

    Hello :smiling_face:

    Thank you for your input. This way of doing things works. I hope that implementing a INTERRUPT-RESUME system and turning the INTERRUPT off right after method call works. Since most of the factory side staff is on holiday I cant be 100% sure but I do believe that the issues pointed out solved the problem.

    Thanks hermann and Koppel.

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • KUKA
  • motion
  • interrupt
  • not moving

Users Viewing This Thread

  • 1 Guest
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download