External motor motion skipping

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

  • Place your Ad here!
  • 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.

  • 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 ().

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

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

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

  • 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

    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.

  • 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

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

  • 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

  • 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

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


    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.

  • 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

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

Advertising from our partners