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

Continuous movement in a loop

  • chocobo_ff
  • April 19, 2017 at 9:12 PM
  • Thread is Resolved
  • chocobo_ff
    Trophies
    3
    Posts
    32
    • April 19, 2017 at 9:12 PM
    • #1

    I am trying to move the robot based on external inputs, which updates a POS, P_offset, which is polled using a timer and updated in an interrupt. Timing of when P_offset gets updated is not critical.

    The main part of the code that moves the robot resides in a REPEAT loop. The robot follows the external input without problems, however it stops between each movement. I initially had:

    Code
    ; Set tool and base.
    $TOOL = TOOL_DATA[1]
    $BASE = $NULLFRAME	;BASE_DATA[1]
    
    
    CONTINUE
    REPEAT
    	PTP $POS_ACT:Sensor_Offset
    
    
    	CONTINUE
    UNTIL (run_saved==TRUE)
    Display More

    However this didn't work. I then tried to add a second pos in there hoping that it'll give the robot enough 'look ahead' to make the movement continuous, but this didn't work either:

    Code
    ; Set tool and base.
    $TOOL = TOOL_DATA[1]
    $BASE = $NULLFRAME	;BASE_DATA[1]
    
    
    CONTINUE
    P_current = $POS_ACT
    P_next = $POS_ACT:Sensor_Offset
    
    
    REPEAT
    	PTP P_current
    	PTP P_next
    
    	P_current = P_next
    	P_next = $POS_ACT:Sensor_Offset
    
    
    	CONTINUE
    UNTIL (run_saved==TRUE)
    Display More

    Software is v5.4. Any suggestions would be much appreciated :smiling_face:

  • Online
    Fubini
    Reactions Received
    270
    Trophies
    9
    Posts
    1,863
    • April 20, 2017 at 6:14 AM
    • #2

    How about activating approximation:

    PTP XP1
    PTP XP2

    robot stops.

    $APO.CDIS = 100
    PTP XP1 C_DIS
    PTP XP2

    no more stops.

    Fubini

  • chocobo_ff
    Trophies
    3
    Posts
    32
    • April 20, 2017 at 6:16 AM
    • #3
    Quote from Fubini


    How about activating approximation:

    PTP XP1
    PTP XP2

    robot stops.

    $APO.CDIS = 100
    PTP XP1 C_DIS
    PTP XP2

    no more stops.

    Fubini

    Display More

    Thank you for the suggestion. I tried C_DIS but had an error (can't remember what it is off the top of my head). I will give this a try tomorrow :smiling_face:

  • hotRoboter
    Guest
    • April 20, 2017 at 8:17 AM
    • #4

    You can use c_ptp aproximation - c_dis is for LIN moves.

  • Online
    Fubini
    Reactions Received
    270
    Trophies
    9
    Posts
    1,863
    • April 20, 2017 at 9:07 AM
    • #5
    Quote

    You can use c_ptp aproximation - c_dis is for LIN moves.

    Since KRC2 V5.5 this no longer is the case. You can use C_DIS in CP (LIN,CIRC) and PTP. Since KRC4 V8.x C_DIS is also the Default for PTP.

    Fubini

  • hotRoboter
    Guest
    • April 20, 2017 at 9:38 AM
    • #6

    Fubin,
    in my controler KRC4 I have en error using c_dis in PTP moves.
    I remember that I used it only when I change move (PTP, and next LIN - or vice versa, I.m not sure), but when I used only PTP moves I have error with c_dis aproximation...
    Do You now why?

  • Online
    Fubini
    Reactions Received
    270
    Trophies
    9
    Posts
    1,863
    • April 20, 2017 at 10:39 AM
    • #7

    What Error? Message Number?

    Fubini

  • hotRoboter
    Guest
    • April 20, 2017 at 12:28 PM
    • #8

    I don't remember now... Next time if error appear, I let You now

  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,026
    • April 20, 2017 at 5:33 PM
    • #9

    before you can use approximation, you must specify approximation distance.
    $APO.CDIS=100; used with C_DIS
    $APO.CPTP=100; used with C_PTP
    etc.

    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

  • chocobo_ff
    Trophies
    3
    Posts
    32
    • April 20, 2017 at 11:16 PM
    • #10

    Looks like the KRC2 controller died overnight ??? so I won't be able to try this until I get that sorted out...! :mad:

  • chocobo_ff
    Trophies
    3
    Posts
    32
    • April 27, 2017 at 11:53 PM
    • #11

    Have updated the code and unfortunately still doesn't move the way I want it - continuously. I have tried different values of $APO.CPTP (5-100) and nothing worked ???

    Perhaps I am going about this the wrong way?

    Code
    ; Set tool and base.
    $TOOL = TOOL_DATA[1]
    $BASE = $NULLFRAME	;BASE_DATA[1]
    $APO.CPTP = 25
    
    
    CONTINUE
    
    
    P_current = $POS_ACT
    P_next = $POS_ACT:Sensor_Offset
    REPEAT
    
    
    	PTP P_current C_PTP
    	PTP P_next C_PTP
    
    	P_current = P_next
    	P_next = $POS_ACT:Sensor_Offset
    
    
    	CONTINUE
    UNTIL (run_saved==TRUE)
    Display More
  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,026
    • April 28, 2017 at 12:35 AM
    • #12

    [size=2]where is this Sensor_Offset coming from? are you aware that I/O operations trigger advance run stop[/size]

    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

  • chocobo_ff
    Trophies
    3
    Posts
    32
    • April 28, 2017 at 2:44 AM
    • #13

    Sensor_Offset is updated in an interrupt that is set to run every 50ms, it's data over DeviceNet. Every interrupt Sensor_Offset is updated:

    Code
    DECL POS Sensor_Offset
    ...
    Sensor_Offset.X = dir*const

    Where dir is a direction (1 or -1), and const is how much to move by, e.g. 10.

    I have just looked up advance run stop in the KSS 5.2 manual, this is what it says:

    Quote

    In applications where this advance run stop should be prevented, the command CONTINUE
    must be programmed immediately before the relevant instruction.

    So I'll try that soon and report back. Otherwise is there anything else I might be doing wrong?

  • panic mode
    Reactions Received
    1,262
    Trophies
    11
    Posts
    13,026
    • April 28, 2017 at 4:16 AM
    • #14

    you may want to reduce $ADVANCE to 1 and introduce intermediate point.

    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

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
  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