KUKA external axes.

  • hey people,

    I am trying to run external axis with the HMI button, but I have been constantly receiving errors that says:

    $ACC_AXIS variable write protected in the module BAS line 418,

    I have attached the project file, and I have been using codes:


    if forwardB== true then

    BAS(#INITMOV,0)

    $ASYNC_AXIS='B0001'

    $OV_ASYNC= 100

    ASYPTP {E1 0}

    endif


    the forwardB is linked with pushbutton in the HMI.

    The reason to use the BAS(#INITMOV, 0) is to get rid of another error which was:

    Value assignment inadmissible: nicht von R_INT.

    I just found that code in the internet and manual jogging was successful but with HMI it gives the error (upper one).


    Anyone have been through this or any idea you guys can share?



  • AD
  • with the HMI button

    Which one there are a few.


    with pushbutton in the HMI

    whats the push button. Any button on the HMI can be pushed.


    I suspect ypu try to call this code from submit. you can not set all data inside submit. since BAS uses some data that is not allowed to be modified in submit you can not use BAS-Calls in submit.

    Value assignment inadmissible: nicht von R_INT


    Exact message is this mixture from German and English? Can you give the error number?


    Fubini

  • the code runs in robot interpreter without complaint.


    so i guess you are trying to run it in a submit and using BAS() and few other things in submit is ... not going to work.


    so you need to program things manually, initialize everything using variables. also may want to make sure to check if axis is busy and not start another motion while one is already running... and you may want to make sure that your axis is already async. you cannot use in submit this either


    $ASYNC_AXIS='B0001'



    for example

    Code
    $VEL_EXTAX[1]=100
    $ACC_EXTAX[1]=100
    $OV_ASYNC=100
    ;...
    
    IF $ASYNC_STATE<>#BUSY THEN
      if forwardB== true then
         ASYPTP {E1 1E38}
      endif        
    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

  • Fubini for the mix german and english error the number was: KSS01446

    and about the HMI button it is from KUKA HMI easy. Simple Pushbutton.


    panic mode ok so i made a expert module under program where i write those code and defined them inside forward() and called them in the SPS sub and it did not work.

    Now from your explanation what i understood was, the BAS() would not work if it is somehow written under SPS sub. similarly few other things wont work because it could be system rule,

    but using the $ASYNC_AXIS='B0001'

    where else am i going to define the external axes after all i have to activate it.


  • If the axis is permanently async you can set it in machine data to async.


    If it is temporariliy async you need a handshake with a robot program run inside roboter interpreter (R_INT, non submit program) doing this for you. You can access global variables from either submit or robot interpreter.


    Fubini

  • .. ok so i made a expert module under program where i write those code and defined them inside forward() and called them in the SPS sub and it did not work.

    What do you mean by 'those code' the code from panic mode or your old one?

    You old one won't work, even if you write the code into an external program called by sps.sub. There's no difference wether the code ist written in SPS.SUB or in a called routine.

  • hermann

    Panic modes code as well as mine both doesn't work, mine code gave me error and didn't work,

    panic modes code didn't gave error but also it didn't work,


    I am trying to configurate and change few things in Machine.dat and option.dat to see if i can do anything about this. for example:

    INT $EX_AX_NUM=1


    INT $EX_AX_ASYNC='B0001'


    INT $ASYNC_T1_FAST='B0000'


    DECL EX_KIN $EX_KIN={ET1 #EASYS,ET2 #NONE,ET3 #NONE,ET4 #NONE,ET5 #NONE,ET6 #NONE}


    DECL ET_AX $ET1_AX={TR_A1 #E1,TR_A2 #NONE,TR_A3 #NONE}


    I found out I need to make small changes like add #E1 after TR_A1, similarly #EASYS after ET1.

    if you have any suggestion I am open to try and Remember my goal is to use KUKA HMI easy, so that i can press a push button and make the external axis move.

  • Fubini  panic mode  hermann

    i forgot to mention the external axis connected with the robot, so my goal is when robot makes a certain movement then it would trigger one of the signal and there comes HMI when the signal is turned on then i press the button and external axis makes certain position movement.

    Fubini does this change anything? or do i need to add or look at anything?

  • if it is permanently async, change the value in MADA. then axis will be (and behave) completely independent of the robot. PTPASY command is not blocking so program does not wait until that command is finished. so to prevent repeated triggering (and risk running out of resources) you need to add some checks and conditioning. the code i shared here was not a complete, just a pointer in the right direction. you need to decide how the axis is to work.

    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

  • Btw: Have you considered using $ASYNC_AX1_P and ASYNC_AX1_M? Those allow running asynchron axes directly by using IO.


    Fubini

    yeah i have but havent tried it yet, i thought this would let me rotate to 2 different direction but would not actually let me take the axis to my own desired position

  • that is correct... for positioning you need to use motion commands. also the $ASYNC_AX1_P and ASYNC_AX1_M are jog signals. it means they are mapped to I/O (inputs in this case) and that may complicate things when trying to test code offline or simulating

    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

  • n the external axis connected with the robot

    How is it connected? Like a base, robroot or tool kinematic? Stil I do not get it. If the axis is async it can not be kinematically integrated with the robot. Async states its independant of robot. Hence no kinematics integration needed and even if you set it up as a dummy kinematic your TCP will not reflect the real relationship between robot and async axis and lets say TCP.


    Fubini

  • panic mode yes the external axis is independent of robot.

    and i figured out i was still missing lots of thing in the code,

    but what do you mean by repeat triggering, once the motion is completed or position is reached it should stop or halt, because the command would be clear enough isnt it?

    ASYPTP {E1 180}


    when E1 reaches 180 there is no way it is going to repeat??

  • no....


    that would be case for PTP motion which IS blocking.

    blocking means that instruction pointer does not process to next instruction until this instruction is completed.


    but ASYPTP is non-blocking. it starts the motion and after that instruction pointer is immediately processing next instruction.


    guess what...


    if this is running in SPS, it is inside loop so even this ASYPTP instruction will be run again and again all the time (even though instance of it is ALREADY RUNNING!!!). this will simply try to run another instance (and another, and another...). but system cannot handle such resource waste without consequences. this is something PROGRAMMER is supposed to be aware of and manage (that would be you).

    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

  • Finally the motor moves, I don't know how i never tested it before but when i linked the HMI push button to $OUT[1] or simply one of the signal, so that when button is pressed signal goes on, and this somehow works. of course, it was meant to work like this but i just figured it out.

    so I wrote a very simple program Under SPS sub. There i defined a motion function, and called it and that's it.

    Thankyou Fubini  panic mode  hermann, appreciate all your efforts.



    def motion()


    $VEL_EXTAX[1]=100

    $ACC_EXTAX[1]=100

    $OV_ASYNC=100

    if $OUT[1]== true then

    ASYPTP{E1 -180}

    endif


    end

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