Advertising

interrupt in the interrup trajectory program

  • Hello,

    i have an issue with my programs: if i call an interrupt during execution of another interrupt program, after coming back to first interrupt pointer moves one line. I checked it on KSS V8.3.28 and KSSV8.6.5 and it behaves the same. I have a structure:

    main_program:

    sub_program in loop


    interrupt to call loading trajectory "StopAndGoToMagazine"

    interrupt to stop the robot with PLC HMI stop button "halt_robot"



    Robot runs main_program and then subprogram, at any point an interrupt can open trajectory "StopAndGoToMagazine", meanwhile operator can also press button to stop the robot and interrupt "halt_robot" can be called. When conditions are met and start is send, robot leaves interrupt "halt_robot" but it goes to NEXT line of "StopAndGoToMagazine"


    Subprogram:




    interrupt with movements :





    interrupt to stop robot:


    Code
    global DEF halt_robot()
       INTERRUPT OFF NrInterrruptStopRob
       BRAKE
       HALT
       WAIT FOR (SignalToStopRob)
       WAIT SEC 0.1  
       INTERRUPT ON NrInterrruptStopRob
    end

    and additional definitions:




    Sounds maybe complicated but all is about calling an interrupt during execution of another interrupt. Why coming back from second interrupt to fist one, that was called, makes current line to be change into next one?

  • AD
  • if robot does interrupt program :


    Code
    DEF StopAndGoToMagazine( )
       INTERRUPT OFF NrInterruptLoadMag
       PTP {A6 -230}
       PTP {A6 -200}    
       PTP {A5 -55}

    and it is on the line PTP {A6 -230} , line 4 ,(I can make override to zero to make sure it will not reach the point, and physically robot is really in position on traj to point a6 -230) then I can make interrupt "halt_robot" to happen, program stops after line with halt, start it again, WAIT FOR (SignalToStopRob) and when it is True, robot comes back to StopAndGoToMagazine but to the line 5. I can do that with override zero and it will "finish" whole program not even moving a bit..

  • this is not going to do what you expected and ... it is not even close to what program structure should be,

    in fact it is not even using key instructions etc. so why not read literature and stick to design templates (examples in manuals or on this forum)?

    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

  • what do you exactly mean that the program is not working and doesn't have a correct structure? It works, stops, reloads magazine and so on. Generally program runs as it should, station works. I cut some parts to make it more concentrated on the main issue, which are the interrupts.


    I did read the literature several times, have some years of experience with all different brands of robots. Kuka has too many limitations and therefore reacquires some additional "tricks". I am writing here 'cos I want to improve if there is possibility. How would you implement it then? And why the program pointer is "jumping" ?

  • indeed , it was for physically stopping the robot.

    Does anyone know what stands behind this behavior of the interrupts ? is there any way to solve the issue ?

  • Hello,

    i have an issue with my programs: if i call an interrupt during execution of another interrupt program...

    are you sure that both interrupts have different priority?


    Quote

    Robot runs main_program and then subprogram, at any point an interrupt can open trajectory "StopAndGoToMagazine"

    not quite... main program loops but interrupt is declared in a subprogram. if pointer is in the main program, this interrupt should not work.


    as mentioned before, shown program structure is very ... unusual. and hard to follow. also it is unclear how cycle flag is programmed and when

    interrupts are constantly re-declared inside the same loop where they are supposed to do something - which is likely your issue. i would not expect or count on KRC to still remember relevant events after interrupt is re-declared.


    i would declare them in one place - before loop, and then just activate and deactivate as needed.

    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

  • Thank you for feedback. I have just check it and declared it in main program at the very begging . It didn't change the behavior.


    I simplified the programs to make it easier to read.


    Main program only declares interrupts and call subprogram


    Subprogram turns on interrupt and moves on the trajectory




    interrupt program didn't changed :



    magazine loading didn't changed



    Still if I make interrupt to halt the robot , it behaves like expected: calls the interrupt program and when start is pressed again it waits for flag and comes back to subprogram, and pointer is exactly at the like when interrupt happen.

    If I make conditions for "halt_robot" during loading of magazine (interrupt with movements) , when start is pressed again, it waits for flag and comes back to magazine trajectory, but pointer goes one more line.

  • you did not answer my questions so it is still a mystery how and where some of the things are declared and initialized, including cycle flags.


    you are using one flag as a condition to pause program, but ....

    you are using different one inside the ISR to keep BRAKE statement active.

    this makes no sense. they should be the same thing, otherwise BRAKE statement may still be active after program is paused. basically stuck in ISR forever


    if you are using $cycflag[5] as "keep running" then, triggering pause like this would make sense:


    GLOBAL INTERRUPT DECL 5 WHEN $cycflag[5]==FALSE DO halt_robot()


    but then, in the ISR called halt_robot() i would expect to see


    WAIT FOR $cycflag[5] ; keep robot program paused until ready to continue running. when $cycleflag[5] is on, ISR program ends and BRAKE command in that ISR is no longer active.



    but ...you have there:

    WAIT FOR (SignalToStopRob) ; if SignalToStopRob is FALSE even after $CYCFLAG[5] is true, robot will be stuck in ISR and .... well... pause will still be active.


    again this is one possible scenario, more info may be needed to really find out the problem.

    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

  • Can you see the issue on the movement? Or do you only see the program pointer jumping?

    Think it's not easy to see the issue with the actual movements, you have to stop the robot during PTP {a6 - 55} otherwise there is no difference in the movement weather the pointer jumps or not.

    I'm asking because during interrupts the screen doesn't always show the correct position of the program pointer.

  • it changes also the movements , it would collide because of that ..



    regarding flags they are in sps:



    $CYCFLAG[5] = SignalToStopRob


    $cycflag[17]= Signal2LoadMagazine


    both are signals from PLC (but it bahaves the same way if I use it as veriables) . PLC don't send the signal and robot stops, then PLS resends the signal, starts the robot and I only check it for sure if the signal is really on .

    Edited once, last by watchcat ().

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now