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

External motor motion skipping

  • capital9
  • November 14, 2022 at 9:36 AM
  • Thread is Unresolved
  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • November 14, 2022 at 9:36 AM
    • #1

    Hey guys,

    I have been working with KRC4 8.6.6, it is connected to 8 external motors , 3 motors are used as robot motor while 5 are asynchronous external axes.

    To make it clear i have attached a picture regarding the connections. All the motors works fine except for one which is E4 motor, E4 motor is endless type and uses degrees for position measurement and this motor is also coupled because its position has to reset(coupling/decoupling method) to zero at certain location. For this motor 1 degrees is 1m.

    This motor has 3 different type of motion depending in situation and this motions are under conveyor_auto2ok(). This sub program is called under test( ), as you can see in below code.

    Inside conveyor_auto2ok() program, there are 3 stop_points, stop_point 1 and 3 are working perfect, but somehow stop_point 2 doesnt work as it should.

    the exact problem is in the external mode stop_point 2 motion is missing in the loop of test(). By the way this skipping of motion does not happen in T2 mode, happens only in external mode.

    when the program runs for first time it completes conveyor_auto2ok(1), then moves toward conveyor_auto2ok(2) and conveyor_auto2ok(3), all the motion are completed in first round, but then comes loop where it should repeat conveyor_auto2ok(2) and conveyor_auto2ok(3) but for some unknown reason it skips through conveyor_auto2ok(2) and only completes conveyor_auto2ok(3).

    if i do the same program in T2 mode this does not happen it works nice and smooth. but not in external mode. is there any explanation for such behaviour. i have tried to check the position variable that commands motor to move to certain position i.e E4_relative.E4 . E4_relative.E4=1.05 just before motion command and after motion command. but there is no movement from motor at all.

    is there anything that i should know about ASYPTP motion command? i dont understand how motion works in T2 mode but not in External mode.


    ======================= test.SRC ======================

    DEF test( ) ; main program for testing the conveyor/E4 motor (Asynchronous)


    conveyor_auto2ok(1)

    asycancel 4

    wait sec 2

    loop

    conveyor_auto2ok(2)

    wait sec 2

    conveyor_auto2ok(3)

    asycancel 4

    endloop

    END

    ======================= test.SRC ======================


    ==========================conveyor_auto2ok.SRC===================

    DEF conveyor_auto2ok(stop_point:in)

    INT stop_point

    E4_relative=$AXIS_ACT

    $OV_ASYNC=50

    wait sec 0

    if stop_point==1 then

    E4_relative.E4 = 5;

    wait for $async_state<>#busy

    ASYPTP E4_relative ;motion command for conveyor.

    wait for $async_state<>#busy

    Reset_2()

    endif


    if stop_point==2 then

    if pallet_width_HMI>1200 then ; position according to pallet size.

    E4_relative.E4 = E4_relative.E4 + 1.05 ;positions are in degrees.

    else

    E4_relative.E4 = E4_relative.E4 + 0.78 ;positions are in degrees.

    endif

    wait sec 3

    ASYPTP E4_relative ;motion command

    wait for $async_state<>#busy

    endif

    if stop_point==3 then

    N=N+1

    if (N<13) then

    E4_relative.E4 = + 1.79; back to 0

    else

    E4_relative.E4 = 1.79-0.01; back to 0

    N=0

    endif

    ASYPTP E4_relative ;motion command

    wait for $async_state<>#busy

    Reset_2() ;reset subprogram resets to zero after reaching the final position.

    asycancel 4 ;just incase to avoid the extra movement

    endif

    END

    ==========================conveyor_auto2ok.SRC===================

    Images

    • Capture1.PNG
      • 79.05 kB
      • 1,550 × 751
      • 9
  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,380
    • November 14, 2022 at 4:33 PM
    • #2

    In External mode, do Stop-1 and Stop-3 execute? Does any part of the Stop-2 IF/THEN branch execute? I recommend adding a $FLAG or $OUT setting inside that branch to mark if the branch has executed.

    Is this executing in the SPS, or in the Robot Interpreter?

    Waiting for wait for $async_state<>#busy immediately after the ASYPTP command is not the best method. I recommend:

    ASYPTP point

    WAIT FOR $ASYNC_STATE<>#IDLE ; ensure motion starts

    WAIT FOR $AYNNC_STATE<>#BUSY ; motion complete, or cancelled

    The interpreter might get to the first WAIT before the motion controller changes the state from #IDLE to #BUSY.

  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • November 15, 2022 at 7:44 AM
    • #3

    SkyeFire

    Stop point 1 and 3 are fine they do execute well.

    About stop point 2, when i checked the e4_relative.e4 just before it starts to move the value was 1.05 that means it went through the IF statement. but again mysteriously skipped the motion. Also i did add monitoring variable that goes true inside the IF statement of stop point 2 , the monitoring variable went to true as well.

    This is executing in robot interpreter.

    ASYPTP point

    WAIT FOR $ASYNC_STATE<>#IDLE ; ensure motion starts

    WAIT FOR $AYNNC_STATE<>#BUSY ; motion complete, or cancelled

    what if do it like this:

    ASYPTP point

       WAIT FOR $ASYNC_STATE==#BUSY ; if motor does not move it will wait in this line.

       WAIT FOR $ASYNC_STATE<>#IDLE ;TO ENSURE THE MOTOR HAS STARTED

       WAIT FOR $ASYNC_STATE<>#BUSY ;TO ENSURE MOTOR HAS COMPLETED THE MOTION.

    About this i can check if that works, it will take few days or week probably.

    How do i use SPTP or LIN for external motor, it always gives me error regarding the frame, pos?

    Edited once, last by capital9 (November 15, 2022 at 9:25 AM).

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • November 15, 2022 at 2:16 PM
    • #4

    "error regarding the frame"?

    please post messages in original form, do not try to share them in digested them (see READ FIRST).

    motion that use POS/E6POS/FRAME as position value need defined tool and base

    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

  • Online
    SkyeFire
    Reactions Received
    1,039
    Trophies
    12
    Posts
    9,380
    • November 15, 2022 at 2:36 PM
    • #5
    Quote from capital9

    How do i use SPTP or LIN for external motor, it always gives me error regarding the frame, pos?

    What type of external motor? How are you using the command? Show the code.

    Typically, if an external axis is configured such that it can be controlled by ASYPTP, it cannot be controlled using interpolated motions like LIN.

  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • November 15, 2022 at 2:45 PM
    • #6

    SkyeFire panic mode

    lets say same E4 motor that used in the above code, what if i wanted to use the LIN motion for it,

    because it is asynchronous motor we use ASYPTP,

    what if we synchronize it ? synchronization is possible then probably LIN or SLIN should be possible as well. isn't it ?

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • November 15, 2022 at 2:53 PM
    • #7
    Thread

    READ FIRST...

    how to post correctly:

    1. be a good citizen and follow common sense. this includes no sharing or asking for copyrighted material. such posts will get you banned (because we don't want Kuka legal team stepping in and request ban on all manuals). an example of something that will get you in trouble is any material from Kuka College.

    1.5 make SURE to post in the right forum section (manuals in manuals section, IIWA and Sunrise topics in IIWA section). see attached example for IIWA... sigh.. :tired:

    Please…
    panic mode
    June 5, 2016 at 4:30 PM

    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

  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • November 15, 2022 at 3:08 PM
    • #8

    panic mode

    In the image attached, there is an example that says external axes i.e. motor can be moved synchronously or asynchronously. i am not talking about asynchronous motion, but if the external axes are made synchronous would they move with PTP, i think they do,

    but it does not mention anything about SLIN or LIN motion, so i am asking can they move with SLIN or LIN command as well.

    Images

    • Capture1.PNG
      • 89.8 kB
      • 776 × 641
      • 5
  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • November 15, 2022 at 3:41 PM
    • #9

    you cannot read or you are reading very selectively and ignoring important parts.

    $EX_AX_ASYNC is used to configure one or more axis to be permanently async.

    permanently asynchronous axes cannot be switched at runtime back to sync - they remain async and as such can only be used with ASYPTP.

    if the $EX_AX_ASYNC was set to 'B0010111' then E1,E2,E3 and E5 are permanently async (and can only move with ASYPTP) but E4 and E6 could be switched to sync/async and - when synced, they could be moved together with robot.

    "synchronous" means external axis moves TOGETHER with robot - using PTP/LIN/SLIN etc.

    "asynchronous" means external axis does not move TOGETHER with robot. can only be moved with ASYPTP

    check the part highlighted in yellow:

    by "KRL statements" they mean in runtime using line in a KRL program

    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

  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • November 16, 2022 at 7:36 AM
    • #10

    panic mode thankyou very much, I got my answer.

  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • November 29, 2022 at 9:14 AM
    • #11

    panic mode  SkyeFire

    hey guys i am summoning you here,

    lets recap this thread little bit, so there was a problem of skipping of motion in Automode and external mode but not in the T2 mode, code can be found up above in the thread,

    SkyeFire gave an excellent solution regarding this, but it still did not work, the skipping kept on happening randomly like after 4/5 or even after 10 loops. so i went throug the whole program found out there was ASYPTP motion command running all the time in SPS sub.

    DEF  E4relative ( )

    E6AXIS E4_relative

    E4_relative=$AXIS_ACT

    $VEL_EXTAX[4]=100

    $ACC_EXTAX[4]=100

    $OV_ASYNC=100

    if (($ASYNC_STATE<>#BUSY) and (E4start_REL== true)) then

    E4_relative.E4 = E4_relative.E4 + E4_input_REL

    endif

    ASYPTP E4_relative

    END

    There was this E4relative(), that was running in the SPS sub, E4_relative was the common name used which was not intentional, it was a mistake, i am suspecting the problem I mentioned in this same thread occurred because of this. as the SPS sub is running all the time the motor always does ASYPTP motion, since the variable is same it acquires data depending on the speed of program and SPS sub. and that would make sense if it skips the motion, i am going to make a test again soon removing the these from SPS and see if that works.

    but still the mystery is that skipping doesn't happen in T2 mode, even though same thing runs in sps sub. I just wanted quick reviews regarding this issue, what is your thoughts regarding the problem?

    have there been any similar mysterious problem for you guys too ?

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • December 1, 2022 at 3:54 PM
    • #12
    Quote from capital9

    but still the mystery is that skipping doesn't happen in T2 mode, even though same thing runs in sps sub. I just wanted quick reviews regarding this issue, what is your thoughts regarding the problem?

    my thought is that there is not much to go on. "it does not work" does not describe the issue. when dealing with program issues, common approach is to post code for review. maybe there is something in SPS like this:

    Code
    IF $MODE_OP==#T2 THEN
      E4Relative()
    ENDIF 

    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

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • December 1, 2022 at 3:56 PM
    • #13

    also setup variable overview page with key things so you can see the values of important things. that includes axis state, axis position, start flag, position increment value etc.

    Quote

    E4 motor is endless type and uses degrees for position measurement and this motor is also coupled because its position has to reset(coupling/decoupling method) to zero at certain location. For this motor 1 degrees is 1m.

    i have no idea what that means... why is there discrepancy in units (degree /meter). is this linear or rotary axis? why is there a need to reset position to zero and how do you keep track of that?

    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

  • capital9
    Reactions Received
    3
    Trophies
    2
    Posts
    71
    • December 2, 2022 at 8:13 AM
    • #14
    Quote from panic mode

    my thought is that there is not much to go on. "it does not work" does not describe the issue. when dealing with program issues, common approach is to post code for review. maybe there is something in SPS like this:

    Code
    IF $MODE_OP==#T2 THEN
      E4Relative()
    ENDIF 

    there is no code in sps sub like that, also i removed all the code that would affect the external axis from SPS.sub but some how it still does that skipping.

    we are now trying different structure of program to run the motor. actually, this happens for certain cases only, not for all cases even though the code are same for all cases, so now we are trying a different approach to program, lets hope it goes fine.

    Quote from panic mode

    also setup variable overview page with key things so you can see the values of important things. that includes axis state, axis position, start flag, position increment value etc.


    i have no idea what that means... why is there discrepancy in units (degree /meter). is this linear or rotary axis? why is there a need to reset position to zero and how do you keep track of that?

    we did check the positions, even the program has

    ASYPTP point

       WAIT FOR $ASYNC_STATE==#BUSY ; if motor does not move it will wait in this line.

       WAIT FOR $ASYNC_STATE<>#IDLE ;TO ENSURE THE MOTOR HAS STARTED

       WAIT FOR $ASYNC_STATE<>#BUSY ;TO ENSURE MOTOR HAS COMPLETED THE MOTION.

    waiting for the program to be busy then not idle then not busy, it goes through all the lines, probably that means it just thinks motor moved and reached its destination and then stopped.

    motor is Rotatory axis which uses degrees, because the motor was made as an endless axis as there was need of coupling and decopuling which i was not able to do it in other axis mode, only in endless mode. And coupling/ decoupling was needed to reset the motor to zero. it does the reset every 1.79 m because the application requires it to be like that.

  • panic mode
    Reactions Received
    1,267
    Trophies
    11
    Posts
    13,033
    • December 2, 2022 at 2:54 PM
    • #15
    Quote

    WAIT FOR $ASYNC_STATE<>#BUSY

    that confirms that axis is not busy. it does not confirm that axis has completed motion. it does not check position.

    Quote

    there is no code in sps sub like that, also i removed all the code that would affect the external axis from SPS.sub but some how it still does that skipping.

    more of the same. just pointless word salad instead of posting actual code or something concrete. in other words, there is nothing in your posts that can be used to help find the root cause of problem you experience. it would be better for you if your posts contained something substantial giving others chance to see what you have (or not have) and comment on it.

    plenty of examples of feedback that was never addressed:

    Quote

    why is there discrepancy in units (degree /meter).

    Quote

    is this linear or rotary axis?

    Quote

    why is there a need to reset position to zero

    Quote

    and how do you keep track of that?

    but this seem to boil down to your communication skills and grasp of terms. for example you do not distinguish basic terms like motor and axis. they are not the same. yes all servo motors are rotary devices. but motor is only a part of an axis and axis may be rotary or linear.

    keeping track of position reset could be done in different ways. one of them is to simply count every time reset code is called. then you can see the counter value changes and tell if reset happened only once as expected or... maybe the reset was called 27 times and you just do not know it. this could explain why axis does not move when you think it should. you have no way of verifying what your code does and you are not letting others see it.

    Quote

    there was need of coupling and decopuling which i was not able to do it in other axis mode, only in endless mode.

    coupling of axis can be done on any axis type. it is done on linear axis, servo gun etc.

    Quote

    And coupling/ decoupling was needed to reset the motor to zero.

    still wrong... KRL code does not care about motor position, it cares about axis position.

    Quote

    it does the reset every 1.79 m because the application requires it to be like that.

    it makes no sense to do that on a linear axis. sounds like you have a rotary axis and you need to reset position every 180deg.

    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

Tags

  • KUKA
  • KRC4
  • Motor
  • External axes
  • ASYPTP
  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