'zeroing' and external axis position inside a loop

  • Hi, I am new to this forum and having failed to find the answer via KRC manuals or internet searches I am hopeful someone can help me with a programming problem.


    I have am generating programming instruction in software for a 6 axis Kuka robot (KRC 2) that has an external axis E1. The external axis is a rotating station but is configured as a linear axis.
    I very simplified example is shown below, with an initial position and a repeated loop of positions. A real example might have many hundreds of lines. Note that at the last position
    in the loop all axes are back to the original position EXCEPT for E1 which continuously increases. What I need do is reset/zero/datum) E1 AT ITs CURRENT position at this last point.


    example1:


    LIN {X +350.000, Y +0.000, Z +400.000, A 0.000, B 0.000, E1 0.000}
    HALT


    FOR N_CYC=1 to 37
    LIN {X +370.000, Y +5.000, Z +400.000, A +1.905, B +0.000, E1 +100.00} C_DIS
    LIN {X +400.000, Y +10.000, Z +410.00, A +1.489, B +0.000, E1 +200.00} C_DIS
    LIN {X +475.000, Y +20.000, Z +410.000, A +1.092, B +0.000, E1 +300.00} C_DIS
    LIN {X +500.000, Y +20.000, Z +450.000, A +2.378, B +0.000, E1 +400.00} C_DIS
    LIN {X +200.000, Y +10.000, Z +410.000, A +3.379, B +0.000, E1 +500.00} C_DIS
    LIN {X +350.000, Y +0.000, Z +400.000, A 0.000, B 0.000, E1 +600.000} C_DIS
    ; I now need a way to reset E1 to the initial position e1=0.000
    ; before doing the next loop
    ENDFOR


    another way might be something like below. Yes I know the syntax shown is not valid but some suggestion along these lines that works would be good.


    example2:


    LIN {X +350.000, Y +0.000, Z +400.000, A 0.000, B 0.000, E1 0.000}
    HALT


    MYREALVAR=600.0


    FOR N_CYC=1 to 37
    LIN {X +370.000, Y +5.000, Z +400.000, A +1.905, B +0.000, E1=MYREALVAR*(N_CYC-1)+100.00} C_DIS
    LIN {X +400.000, Y +10.000, Z +410.00, A +1.489, B +0.000, E1=MYREALVAR*(N_CYC-1)+200.00} C_DIS
    LIN {X +475.000, Y +20.000, Z +410.000, A +1.092, B +0.000, E1=MYREALVAR*(N_CYC-1)+300.00} C_DIS
    LIN {X +500.000, Y +20.000, Z +450.000, A +2.378, B +0.000, E1=MYREALVAR*(N_CYC-1)+400.00} C_DIS
    LIN {X +200.000, Y +10.000, Z +410.000, A +3.379, B +0.000, E1=MYREALVAR*(N_CYC-1)+500.00} C_DIS
    LIN {X +350.000, Y +0.000, Z +400.000, A 0.000, B 0.000, E1=MYREALVAR*(N_CYC-1)+600.000} C_DIS
    ENDFOR


    Any help would be most appreciated
    Andrew

  • I don't think that is possible.... What you may want to do is create another variable just for E1 position then do some math.


    for example





    Where Mod360.src is something like this:

    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


  • Simple enough.

  • Or if you have a newer KRC4 simply


    SPTP_REL {X +350.000, Y +0.000, Z +400.000, A 0.000, B 0.000, E1 -<Your starting angle>}


    For relative spline movements the KRC does no longer use modulo 360 degrees.


    Fubini

  • Thanks for your comments guys.
    Something along the lines of SYKFIRE's post is what I will tryout. It is rather a shame that it seems not possible to make a mathematical assignment to an element (axis) within a line of motion such as a LIN. We thus need three lines of code for each position (define, modify, move) which makes the program far less readable. Hayho, that's life :smiling_face:

  • you can try one more thing you can make the axis e1 as decouplable axis. you have to make few changes in your mada file. you can use this logic where you want to make e1 axis 0.


    precondition to do this you have to change the value of variable $brk_mode to B1010 to B1101 in mada. and have to declare the axis decouplable in mada.


    $async_axis='B000001' ; to make the e1 axis asynchronous


    wait sec 1


    $async_ex_ax_decouple= 'B111110' ;to decouple the eternal axis
    $axis_act.e1=0




    WAIT FOR $AXIS_JUS.E3==TRUE
    $async_axis='B000001' ; to couple it again

    Edited once, last by mayank ().

  • mayank. Interesting thanks. That will be useful for me to reset the E1 axis in some other circumstances but not in this case. The loop is a continuous motion and the axis reset would cause unwanted pauses.



  • DEF RESET_E2()
    ptp $pos_act
    $ASYNC_AXIS='B00010'
    WAIT SEC 0.5
    $ASYNC_EX_AX_DECOUPLE='B00010'
    WAIT SEC 0.5
    $AXIS_ACT.E2=0
    WAIT SEC 0.5
    $ASYNC_EX_AX_DECOUPLE='B00000'
    WAIT SEC 0.5
    $ASYNC_AXIS='B00000'
    END


    Gives an error message:


    Ackn. de-/coupling not allowed for axis E2


    stops at this line: $ASYNC_EX_AX_DECOUPLE='B00010'


    What's the matter?

  • true but my response was not to OP. and if someone chooses not to share system info, i will choose to assume platform... :icon_wink:

    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


  • Use WoV to configure axis... Enable coupling


    I did as you said. But I had another problem.
    I could not manually move the axis E2
    Look at 1st image.


    I also had to change the terminals from 1 and 2 to 7 and 8. Since when I switched on the coupling in WorkVisual, they changed from 1 and 2 to 7 and 8. Look at 2nd and 3rd image.


    When I go into the proposal proposal, WorkVisual wants to remove RDC. Look at video. :icon_wink:

  • [size=2]You will be banned for spamming. this is the last and only warning. R[/size][size=2]ead READ FIRST and stop hogging resources. many old topics are not longer available because of ignorance and indifference of some users.


    Not only you are posting same things in multiple threads but you also duplicated attachments. :wallbash: [/size]
    [size=2]That is countering investments and hard work of those that try to keep this place free and great resource. [/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

    Edited once, last by panic mode ().


  • [size=2]You will be banned for spamming. this is the last and only warning. R[/size][size=2]ead READ FIRST and stop hogging resources. many old topics are not longer available because of ignorance and indifference of some users.


    Not only you are posting same things in multiple threads but you also duplicated attachments. :wallbash: [/size]
    [size=2]That is countering investments and hard work of those that try to keep this place free and great resource. [/size]


    I am very sorry. I have to solve this problem as soon as possible. :help:

Advertising from our partners