Palletizing block with different heights

  • Hello ,




    KRC1 Vkr200/2
    kss 4.1.14 pp02


    My application its the next :


    stack blocks with different heights max tolerance +/-3cm
    first stack block on vertical position , next block horizontal position , i repeat this operation for 12 stacks.


    i fabricate the gripper , with sensors necessary to do it , and reconfigured 16 I/O digital via DeviceNet


    As the blocks has different heights, and need to be released to 5 mm up ( for the characteristics of the block and characteristics for the gripper )


    My idea its the next:


    -the robot took the first block
    -open the gripper and stack on vertical position (the first block was released at floor)
    -the robot took the second block
    -the robot was moving down, until detect the first stack using a sensor attached to bottom of gripper
    -the robot stop when detect the first stack
    -the robot move up 5mm
    -the robot released the second stack on horizontal
    -the robot took the 3rd block
    -the robot was moving down, until detect the second stack using a sensor attached to bottom of gripper
    -the robot stop when detect the second stack
    -the robot move up 5mm
    -the robot released the 3rd stack on vertical
    .......


    all these was repeated to stack 12 blocks


    Question 1
    how can i transfer to KRL the part :
    -the robot was moving down, until detect the X stack using a sensor attached to bottom of gripper
    -the robot stop when detect the X stack
    ?
    Question 2
    when the sensor was activated how i transfer to KRL
    -the robot move up 5mm
    ?



    Maybe i can use something like this:




    Question 3 :
    If its possible , how can i put on a "FOR cicle" to do this 12 times



    Thanks a lot BR,

  • i don't quite follow the process but your program seem to be doing a lot of detecting/scanning and - that is very time consuming.
    did you consider using laser distance sensor? you can take reading instantly and be on your way to pickup or drop part...

    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

  • skyfire, panic mode , thanks a lot for you reply.


    i like the idea to use a laser, did you suggest to me a brand, kind , model laser ?



    But before to bought a laser i like to start using digital inputs, to detect the stack, and instantly stop the robot, then move up 5mm


    As skyfire suggest to me , yes , i know that i need to use the things mentioned before.


    i need to stop the robot using an interrupt:

    Code
    INTERRUPT 1 DECL 1 when $IN[1] do detect_stack ()


    yes , work it , the robot stop , but i need to confirms messages , yes i can configure de aut ExT and assig a diital input to config mess, but i need to made the hardware apropiate when the interupt On


    so inside a program i put the next code :

    Code
    ...
    repeat
    lin {z-1} c_dis
    until $in[1]==true 
    lin {z+5} c_dis
    ...


    the robot moves down with little increments on z negative with low speed , using the parameter $vel.cp=0.010
    until the $IN[1] comes high ! the next process its the robot up on z positive 5mm


    but doesnt work ! :mad: the robot not stop!
    i try using flags

    Code
    ...
    repeat
    lin {z-1} c_dis
    until $flag[1]==true 
    lin {z+5} c_dis
    ...


    on sps put:


    $flag[1]=$out[1]


    attached found the programs for more details.



    BR

  • Your code with the repeat .. until should work.
    But the problem is that the standard value of $advance is 3.
    So Your loop will stop after 3 loops after detecting the signal.
    One 'solution' is to set the $advance to 1 or 0. The value 1 means that the loop will stop after one more loop after detecting the signal, the value zero inhibits the advance and the c_dis statement will have no effect, so the robot will stop after every move.


    In this cases always use an interrupt.
    This is discussed in some other threads.

  • this is not going to work...


    for example you are not setting tool and base, so last used inline form motion will determine tool and base.
    this means you are using world coordinate system so your loop will send repeatedly robot to a point that is bellow floor:


    LIN {Z -1} ; note, world origin is at Z=0


    you may want to consider LIN_REL instead of LIN.

    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

  • The simplistic way:

    Code
    Shift = $NULLFRAME
    Shift.Z = -1.0
    REPEAT
      LIN_REL Shift
    UNTIL (($POS_ACT.Z < MinimumHeight) OR $IN[1])
    WAIT SEC 0
    Shift.Z = 5 + $ADVANCE ; compensate for Advance-run lag
    LIN_REL Shift


    The correct way to handle this is to use interrupts. However, using Interrupts properly requires setting up a chain of subroutines correctly:

  • thanks to all for you reply's Panic mode, hermann , Skyfire


    Skyfire , your example work correctly :flower: :toothy9:
    but with a little changes


    as you see i remove with ";" some parts like:


    Code
    ;lin {x 0 , y 0 , z 100 , a 0 , b 0 , c 0} : $pos_int
    ;shift.z=100 + $advance
    ;lin_rel shift


    and put it :
    shift.z=100 + $advance
    lin_rel shift[/code]

    on the section: "searchmotion ()"
    an add:

    Code
    $VEL.ORI1=100
    $VEL.ORI2=100



    what happend wih the sections
    lin {x 0 , y 0 , z 100 , a 0 , b 0 , c 0} : $pos_int
    shift.z=100 + $advance
    lin_rel shift


    why doesnt work ? why the problem "read protection" ? (picture attached)
    ive not reconfigured tool and base yet , im doing tets on the "air" to avoid crashes


    here the code that work correctly :


    attahed 2 programs: "main" work correctly and main "main2" appears error read protection


    so , i just need "polish"the program to palletizing 12 stacks wih a for ,op/cl gripper etc

  • no offense but this has no hope of working in this form, some major reconstruction is needed :icon_frown:


    in order to write working programs, one must read manuals and understand what each instruction does...


    some of the notable issues include:


    adding $advance to position variable makes no sense,
    $POS_INT is only usable inside interrupt subroutine (this is why you get the message)
    there is nothing to turn off interrupt after search (if interrupt was not triggered during search - it remains active... this is how you crash robot! worse - this can happen weeks after programming was "complete").
    there is no need to do loop etc inside search motion - single long motion instruction is all you need, no point in "inching" (moving mm by mm).
    there is no need to check for $in[1] inside search routine
    there is nothing to keep advance run pointer inside search routine during search,

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

  • To be fair, most of those mistakes are mine -- I was just dashing off some concept-example code that was never intended to be fully bulletproof.


    Forgot about that $POS_INT quirk. Need to record it to another variable inside the interrupt routine. And add a WAIT SEC 0 or something to the Search routine.


    And yes, I neglected turning off the Interrupt in the event of a failed search. :grinning-smiley:


    Adding $ADVANCE to the position variable was to compensate for the "overshoot" effects of the Advance pointer when using a simple 1mms/step search routine (which I forgot to put C_DIS on, :waffen100:)

  • panic mode, thanks for your advices! :top:


    of course , i need to reconstrcut it
    about:
    there is nothing to turn off interrupt after search (if interrupt was not triggered during search - it remains active... this is how you crash robot! worse - this can happen weeks after programming was "complete").
    yes i need to create something to prevent it
    there is no need to do loop etc inside search motion - single long motion instruction is all you need, no point in "inching" (moving mm by mm).
    yes, maybe i just need to move the robot on "-z" , and ON an interrupt , the interrupt was triggered when $in[1]
    there is no need to check for $in[1] inside search routine
    ??? did you reefer to use an iterupt?
    there is nothing to keep advance run pointer inside search routine during search
    the stack need to delivery up 5mm (the tongs of the gripper interfere with the stack from the down ), als as skyfire say to compensate for the "overshoot" effects


    thanks.

  • Quote


    there is no need to check for $in[1] inside search routine
    ??? did you reefer to use an interrupt?


    no, I mentioned loop that is inside SEARCH()


    Code
    repeat
    lin_rel shift
    ;until (($pos_act.z < 500) or $in[1])
    until $in[1]==true


    when $IN[1] turns true, ISR is called, RESUME command kills everything bellow level where interrupt is declared and program returns to MAIN(), just after SEARCHMOTION()


    so inside SEARCH() code after loop never happens either

    Code
    shift.z=100 + $advance
    lin_rel shift

    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

  • Okay, those were two different examples of how to go about this.


    The loop-search was the primitive but easy method. The Interrupt-based search is better, but more complicated. These two programs do not mix. SearchMotion() and PartFound() are part of the interrupt-driven method. Search() is the loop-based method. You cannot use both.

  • that may be intention but it is not how they work.
    in both cases SEARCHMOTION() calls SEARCH(), both use interrupt with $IN[1] and in both examples there is a loop evaluating same input as used as interrupt condition.

    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