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

INTERRUPT ON BETWEEN PTP C_PTP

  • rvsh
  • May 30, 2020 at 3:31 PM
  • Thread is Unresolved
  • rvsh
    Trophies
    3
    Posts
    26
    • May 30, 2020 at 3:31 PM
    • #1

    Hi,

    I want to move without advance run stop to F_MOVEDOWN position.

    Pseudo code:

    PTP to F_MOVE2 C_PTP

    PTP to F_PICK C_PTP

    start interrupts

    PTP to F_MOVEDOWN and stop when interrupts are triggered and Z position is saved to F_TEMP.Z

    but the problem is I want to move with C_PTP between F_PICK an F_MOVEDOWN.

    Interrupt ON is stopping ADVANCE run.

    Is there a possibility to run INTERRUPT ON somehow between two movements without stopping advance run?

    I tried to just add function and running:

    CONTINUE

    interrupt on etc.

    but I'm worried that interrupt will be triggered before ptp to F_PICK movement end and there will be collision.

    Any suggestions?

    Here is the code:

    Code
    INTERRUPT DECL 21 WHEN $CYCFLAG[1] == FALSE DO IR_MOVESTOP()
    INTERRUPT DECL 22 WHEN I_HSENS == FALSE DO IR_MOVESTOP()
    
    go to pick pos but dont change z
    ;FOLD PTP F_MOVE2 Tool[1] Base[1]
    $BWDSTART = FALSE
    PDAT_ACT=PPDATMAX
    BAS(#PTP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_PTP,100)
    PTP F_MOVE2 C_PTP
    ;ENDFOLD
    
    ;FOLD PTP F_PICK Tool[1] Base[1]
    $BWDSTART = FALSE
    PDAT_ACT=PPDATMAX
    BAS(#PTP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_PTP,100)
    PTP F_PICK
    ;ENDFOLD
    
    ;**********************************************
    ;******** LIN F_MOVEDOWN **********************
    ;**********************************************
    
    F_TEMP.Z = 0
    INTERRUPT ON 21; $CYCFLAG[1]
    INTERRUPT ON 22; $I_HSENS
    MOVEDOWN()
    INTERRUPT OFF 22
    INTERRUPT OFF 21
    $ADVANCE = 3
    Display More
    Code
    DEF MOVEDOWN()
    ;FOLD LIN F_MOVEDOWN
    $BWDSTART = FALSE
    LDAT_ACT=LCPDATMAX
    BAS(#CP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_CP,0.3)
    ENDIF
    LIN F_MOVEDOWN
    ;ENDFOLD
      $ADVANCE = 0
    END
    
    ;********* INTERRUPT FROM SENSORS**************
    DEF IR_MOVESTOP()
      INTERRUPT OFF 21
      INTERRUPT OFF 22
      BRAKE
      F_TEMP = $POS_INT
      RESUME
    END
    Display More
  • rvsh May 30, 2020 at 3:35 PM

    Changed the title of the thread from “INTERRUPT ON BETWEEN PTP C_DIS” to “INTERRUPT ON BETWEEN PTP C_PTP”.
  • rvsh
    Trophies
    3
    Posts
    26
    • May 30, 2020 at 4:01 PM
    • #2

    I tried something like this.

    Pseudo code:

    Interrupts on

    run movetopick

    In this routine run three moves:

    ptp to F_MOVE2 C_PTP

    ptp to F_PICK C_PTP

    ptp to F_MOVEDOWN

    in interrupt check coordinates it POS_INT.X and POS_INT.Y is different from F_MOVEDOWN.X and F_MOVEDOWN.Y just resume - dont runt interrupt code.

    INT_OMIT is used because these interrupts are used in other lines of this program too - so to not affect that code.

    Will it work? Any help?

    Code
    BOOL INT_OMIT
    
    DEF MOVETOPICK()
     INT_OMIT = TRUE
    ; go to pick pos but dont change z
    ;FOLD PTP F_MOVE2 Tool[1] Base[1]
    $BWDSTART = FALSE
    PDAT_ACT=PPDATMAX
    BAS(#PTP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_PTP,100)
    PTP F_MOVE2 C_PTP
    ;ENDFOLD
    
    ;FOLD PTP F_PICK Tool[1] Base[1]
    $BWDSTART = FALSE
    PDAT_ACT=PPDATMAX
    BAS(#PTP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_PTP,100)
    PTP F_PICK C_PTP
    ;ENDFOLD
    
    F_TEMP.Z = 0
    ;FOLD LIN F_MOVEDOWN
    $BWDSTART = FALSE
    LDAT_ACT=LCPDATMAX
    BAS(#CP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_CP,0.3)
    LIN F_MOVEDOWN
    ;ENDFOLD
      $ADVANCE = 0
      INT_OMIT = FALSE
    END
    
    
    ;********* INTERRUPT FROM SENSORS**************
    DEF IR_MOVESTOP()
      IF ($POS_INT.X <> F_MOVE.X) AND ($POS_INT.Y <> F_MOVE.Y) AND (INT_OMIT == TRUE) THEN
        GOTO INT_RESUME
      ENDIF
      INTERRUPT OFF 21
      INTERRUPT OFF 22
      BRAKE
      F_TEMP = $POS_INT
    INT_RESUME:
      RESUME
    END
    Display More

    Edited once, last by rvsh (May 30, 2020 at 5:28 PM).

  • Online
    panic mode
    Reactions Received
    1,278
    Trophies
    11
    Posts
    13,079
    • May 30, 2020 at 4:03 PM
    • #3

    "I want to move without advance run stop"

    ok, just don't use anything that causes advance run stop


    "Interrupt ON is stopping ADVANCE run."

    No it isn't.


    "I tried to just add function and running:

    CONTINUE

    interrupt on

    but I'm worried that interrupt will be triggered before ptp to F_PICK movement end and there will be collision."

    INTERRUPT ON does not cause advance run stop so do not use CONTINUE there.

    stop is caused by BRAKE command after interrupt is triggered. so do not call MOVEDOWN() and remove BRAKE from ISR and there will be no stop.

    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

  • rvsh
    Trophies
    3
    Posts
    26
    • May 30, 2020 at 8:40 PM
    • #4

    Thanks - I was mistaken regarding INTERRUPT ON stopping the advance run.

    I would like to achieve movement with aproximation like this:

    PTP to F_MOVE2 C_PTP

    PTP to F_PICK C_PTP

    PTP to F_MOVEDOWN

    but I would like interrupts on (with brake) only when PTP to F_MOVEDOWN.

    If the INTERRUPT ON doesn't stop advance run does this mean that the Interrupt will be on on all three moves (if $advance = 3) even if i put the command INTERRUPT ON just before F_MOVEDOWN??

    Like this:

    PTP to F_MOVE2 C_PTP

    PTP to F_PICK C_PTP

    (here INTERRUPT ON)

    PTP to F_MOVEDOWN

    Thank you in advance.

  • Online
    panic mode
    Reactions Received
    1,278
    Trophies
    11
    Posts
    13,079
    • May 30, 2020 at 8:53 PM
    • #5

    learn to walk before you run. in this case learn about advance run before getting into interrupts.

    CONTINUE is an example of command that only has effect on the very next line. but when it comes to program instuctions, this is rather an exception, not the rule...

    just about everything else has effect from the moment it is set, to the moment it is rest.

    that inclused interrupt on/off

    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

  • rvsh
    Trophies
    3
    Posts
    26
    • May 30, 2020 at 8:59 PM
    • #6

    So you are saying that adding simple C_PTP (line 22) like below will do the job and all moves will be with approximation (no "approximation not possible error")?

    Code
    INTERRUPT DECL 21 WHEN $CYCFLAG[1] == FALSE DO IR_MOVESTOP()
    INTERRUPT DECL 22 WHEN I_HSENS == FALSE DO IR_MOVESTOP()
    
    go to pick pos but dont change z
    ;FOLD PTP F_MOVE2 Tool[1] Base[1]
    $BWDSTART = FALSE
    PDAT_ACT=PPDATMAX
    BAS(#PTP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_PTP,100)
    PTP F_MOVE2 C_PTP
    ;ENDFOLD
    
    ;FOLD PTP F_PICK Tool[1] Base[1]
    $BWDSTART = FALSE
    PDAT_ACT=PPDATMAX
    BAS(#PTP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_PTP,100)
    PTP F_PICK C_PTP
    ;ENDFOLD
    
    ;**********************************************
    ;******** LIN F_MOVEDOWN **********************
    ;**********************************************
    
    F_TEMP.Z = 0
    INTERRUPT ON 21; $CYCFLAG[1]
    INTERRUPT ON 22; $I_HSENS
    MOVEDOWN()
    INTERRUPT OFF 22
    INTERRUPT OFF 21
    $ADVANCE = 3
    Display More
    Code
    DEF MOVEDOWN()
    ;FOLD LIN F_MOVEDOWN
    $BWDSTART = FALSE
    LDAT_ACT=LCPDATMAX
    BAS(#CP_DAT)
    FDAT_ACT=FB1
    BAS(#FRAMES)
    BAS(#VEL_CP,0.3)
    ENDIF
    LIN F_MOVEDOWN
    ;ENDFOLD
      $ADVANCE = 0
    END
    
    ;********* INTERRUPT FROM SENSORS**************
    DEF IR_MOVESTOP()
      INTERRUPT OFF 21
      INTERRUPT OFF 22
      BRAKE
      F_TEMP = $POS_INT
      RESUME
    END
    Display More
  • DannyDJ
    Reactions Received
    67
    Trophies
    6
    Posts
    503
    • May 31, 2020 at 5:07 PM
    • #7

    Hello, you can also try and use trigger command beetwen points to turn it on...

  • Online
    panic mode
    Reactions Received
    1,278
    Trophies
    11
    Posts
    13,079
    • May 31, 2020 at 6:13 PM
    • #8
    Quote

    So you are saying that adding simple C_PTP (line 22) like below will do the job and all moves will be with approximation (no "approximation not possible error")?

    no.... i did not say all of them. but that would make move in line 22 approximated.

    however i would advise to consider using different motion type there if you are going to approximate.

    i stated that you seem to battle on two fronts and get dragged into interrupts programming while still unclear on advance run.

    one simple thing to try is:

    if you suspect that INTERRUPT ON/OFF is causing advance run stop, comment them out and see if the motions are blended. or read system variable manual and try $stopnoapprox....

    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

  • rvsh
    Trophies
    3
    Posts
    26
    • May 31, 2020 at 7:01 PM
    • #9

    I will try if the code works with blended moves. If not I will try to use TRIGGER - that looks like very good idea - Hadn't thought about it this way. Thanks DannyDJ!

    Panic Mode - I know how advance run works and I need to use interrupts. I don't know any other more effective solution to stop at search path. Still I learned something - thank you. I read a lot of your answers on forum and you helped me many many times even that you didn't know it :smiling_face:

    $stopnoaprox isn't a solution - message is not important - not blended moves are.

    I will publish results tommorow.

  • rvsh
    Trophies
    3
    Posts
    26
    • June 2, 2020 at 9:01 AM
    • #10

    Hi,

    Last code works ok. Just C_PTP and moves are blended and interrupts are on. Thank you Panic Mode.

    TRIGGER doesn't work - there is an error that INTERRUPT ON must be placed on new line.

    Thanks for help

  • Online
    panic mode
    Reactions Received
    1,278
    Trophies
    11
    Posts
    13,079
    • June 2, 2020 at 1:09 PM
    • #11

    You can place it into a subprogram and call it by trigger. Dont forget to specify priority.

    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

  • DannyDJ
    Reactions Received
    67
    Trophies
    6
    Posts
    503
    • June 2, 2020 at 3:36 PM
    • #12
    Quote from rvsh

    Hi,

    Last code works ok. Just C_PTP and moves are blended and interrupts are on. Thank you Panic Mode.

    TRIGGER doesn't work - there is an error that INTERRUPT ON must be placed on new line.

    Thanks for help

    To me it does work, you just have to try harder :winking_face:

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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • 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
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • KRC2
  • interrupt
  • trigger
  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