KRC4 interrupts without stopping motion

  • Hello everyone,


    I am programming a routine in a KRC4 controller with KSS 8.3.37 in which I while the robot is moving if an input changes status an interrupt is activated and it changes just a flag and returns. The problem I have is that the robot stops its motion for a second when the interrupt is activated and then resumes.


    I wanted to know if it is possible for the interrupt to be executed without stopping the motion.


    Here is the declaration of the interrupt and the interrupt subroutine:


    Thank you!

  • yes it is.... as long as you don't use BRAKE or RESUME and interrupt subprogram can be COMPLETED before robot finishes driving current motion segment.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • As Panic says, any ISR that does not include BRAKE, RESUME, or motion commands should execute without pausing robot motion.


    TRIGGER commands are essentially a special subset of Interrupts, reading up on them might help you understand what you can and can't do in an ISR.


    You might need to add a WAIT FOR TRUE to break the Advance Run Pointer before it hits the end of the main program.


    You can also look at IR_STOPM in the robot, which the default templates set up as Interrupt 3 usually. Since it's developed and debugged by KUKA to be part of every KRC's standard setup, it makes a good example to learn from.

  • panic mode, SkyeFire


    As you can see in my code I have not used BRAKE or RESUME in the ISR, it is an extremely simple routine and it is also structured just as the IR_STOPM function.


    I tried adding the WAIT FOR TRUE or WAIT SEC 0 to stop the Advance Run pointer but it changed nothing. Also, i tried triggering the interrupt by changing a variable instead of through an input but the result is the same.


    I am already using the TRIGGER command but inside other SPLINE motion blocks, it isn't applicable in this case because the interrupt does not depend on the position of the robot, just on the state of an input.


    It is my first time working with interrupts so I thought it best to start with a simple routine based on what I read on the manuals but I may be missing something.


    If you can think of anything else that can be causing this behaviour all help is welcome!

  • Fubini,


    This interrupt is used to set a flag that the main program will check after every iteration.


    If the "stop" pushbutton (the input that triggers the interrupt) is pressed while the robot is moving, it should set the flag while still moving and when it ends an iteration it checks the flag to see if it should start again.


    The program works as intended, the problem is the >1s stop when the interrupt Is triggered.

  • Hi Lads,


    I'll jump here with similar problem, different though.

    Kr3 R 540, Krc 4 compact, KSS 8.5


    I am using interrupt program as a monitoring function to stop robot in case part on the vacuum gripper is lost. The interrupt is declared in Cell as local interrupt because Im using brake and resume.

    I would like to switch of that monitoring function on the fly when robot is inserting the part into pocket and can possibly loose the vacuum signal.

    I'tried sps to do that but as it is local interrupt it doesn't bring needed effect.

    Next I tried my own submit that is started when cell is started - still no good.


    Any suggestions, ideas on that?

    Thanks,

    Radek.

  • Use an additional boolean to extend the trigger condition, e.g.


    Code
    INTERRUPT DECL _IntrGripperFault WHEN not $in[CIGripOn] and GripSafeOn DO GripLostResponse()

    When you want to ignore- set GripSafeOn to false.

    Or even easier- turn off the interrupt when inserting part into pocket and then turn it on.

  • sadly that may not work


    compounding is not allowed - interrupt condition must be a simple expression... without AND, OR etc.

    one workaround is to use cyclical flag.

    another is to evaluate additional conditions inside ISR


    EDIT ---


    did some tests on 8.5 and single AND,OR can be used with maximum one NOT on each side

    so the most complex permitted expression is of form:

    NOT A AND NOT B

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • I was trying to use bit INTERRUPT_SWITCH_OFF to trigger that during the motion and switching that through:

    1. if statement in sps

    IF INTERRUPT_SWITCH_OFF THEN

    INTERRUPT 10 OFF

    ENDIF

    didn't work because interrupt local declaration in cell (That's the explanation from Kuka support I got)


    2. same if statement in my own submit (called camera_handshake) started in cell by cwrite command (not sure if it is the right way to use it - never tried that before):

    CWRITE ($CMD, STAT, MODE, "RUN/R1/CAMERA_HANDSHAKE()")

    It seemed to be not working. Maybe I need to test more carefully.


    But wouldn't it be similar idea as using cyclical flag?

  • Mentant, yes i used trigger to switch the bit INTERRUPT_SWITCH_OFF to true.

    And then in my submit created if condition to turn off interrupt.

  • You have been pointed to the solution, use a cycflag and go to the next task, instead of beating around the bush:smiling_face:

    Code
    $cycflag[1] = not $in[DIGripOn] and bGripSafeOn
    INTERRUPT DECL IntrGripperFault WHEN $cycflag[1] DO GripLostResponse()
    
    ; now You can switch the interrupt by setting bGripSafeOn
    bGripSafeOn = TRUE   ; enable
    bGripSafeOn = FALSE   ; disable
    Trigger when distance=1 delay=0 do bGripSafeOn=TRUE
    ...

    Don't use submit logic for that, answers of submit can have short delays, because of the time slices. So it is possible that the interrupt will not be detected.

Advertising from our partners