Depalletising

  • Hi all,


    :help:

    I have written a depalletising program.
    Now this is what my program does when I execute it:


    >Press start
    >robot takes a sack (rPick)
    >moves to a stationary knife and cuts open the sack (this is a simulation) (rPlace)
    >then moves to the dropping place and releases the sack (rDrop)
    >This goes on and on till the pallet is empty.



    Now this is what I want to do, but I can't seem to figure it out how i could:


    When an input is pushed, let's say di1. Then I want to take one sack, empty it and drop it.
    Then I want to go back to the home position and wait for another inputsignal to take second sack, empty it and drop it.
    And then the third sack and so on.....


    Can someone please help me?




    This is what I have programmed:


    %%
    VERSION:1
    LANGUAGE:ENGLISH
    %%%


    MODULE DEPALLETISING
    CONST robtarget pPlace:=[[560.77,-593.14,1596.95],[4.7E-05,0.397767,0.917487,-2E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget pPick:=[[808.56,-66.6,1599.05],[1.3E-05,-5E-06,1,-5E-06],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget pHome:=[[816.23,3.85,1596.91],[3.8E-05,1.5E-05,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget pDrop:=[[281.64,766.1,1896.96],[5.6E-05,-0.570325,0.82142,3.8E-05],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    VAR num nPlaceCtr;
    VAR num nZOffss;
    VAR num nLayerCtr;


    PROC main()
    rInitial;
    rHome;
    WHILE nLayerCtr<=2 DO
    WHILE nPlaceCtr<=6 DO
    rPick;
    rPlace;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    rHome;
    ENDPROC


    PROC rInitial()
    nZOffss:=0;
    nPlaceCtr:=1;
    nLayerCtr:=1;
    ENDPROC


    PROC rHome()
    MoveJ pHome,v1000,fine,tool0;
    ENDPROC


    PROC rPick()
    CONST num nXOffs{6}:=[0,-150,0,-150,0,-150];
    CONST num nYOffs{6}:=[0,0,150,150,300,300];


    MoveJ RelTool(pPick,nXOffs{nPlaceCtr},nYOffs{nPlaceCtr},nZOffss-300),v1000,z50,tool0;
    MoveL RelTool(pPick,nXOffs{nPlaceCtr},nYOffs{nPlaceCtr},nZOffss),v500,fine,tool0;
    rGrip;
    MoveL RelTool(pPick,nXOffs{nPlaceCtr},nYOffs{nPlaceCtr},nZOffss-300),v500,fine,tool0;
    ENDPROC


    PROC rPlace()
    MoveJ RelTool(pPlace,0,0,-300),v1000,z50,tool0;
    MoveL pPlace,v1000,fine,tool0;
    MoveL RelTool(pPlace,0,0,0\Rx:=30),vmax,z50,tool0;
    MoveL RelTool(pPlace,0,0,0\Rx:=-30),vmax,z50,tool0;
    MoveJ RelTool(pPlace,0,0,-300),v1000,z50,tool0;
    ENDPROC


    PROC rGrip()
    WaitTime 1;
    ENDPROC


    PROC rRelease()
    WaitTime 1;
    ENDPROC


    PROC rDrop()
    MoveJ pDrop,v1000,z100,tool0;
    MoveL RelTool(pDrop,0,0,300),v1000,z50,tool0;
    rRelease;
    MoveJ pDrop,v1000,z100,tool0;
    ENDPROC
    ENDMODULE

  • Place your Ad here!
  • Hi
    Im a bit confused with " wait for another inputsignal to take second".


    So, your pick up is consecutive (sack 1, sack 2, sack 3, ...) but your trigger could be any input ?
    I think your whole program is fine, you just need to loop back to the top and a trigger command (your inputs).
    You are going to have to add some logic when you are at the end of job



    PROC main()


    top:
    WaitUntil TestDI(di1) OR TestDI(di2) OR ..............


    rInitial;
    rHome;
    WHILE nLayerCtr<=2 DO
    WHILE nPlaceCtr<=6 DO
    rPick;
    rPlace;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    rHome;


    GOTO top;
    ENDPROC

    Retired but still helping

  • Hi


    The problem is that when my program starts, the whole pallet gets depalletised. This is because I will get stuck in the while loop.
    Now what I want is:


    When I push a button, i want to take the first sack, then stop.
    When I push that same button again, I want to take the second sack, then stop.
    ....

  • Don't know much about ABB, but I suppose that you should add Wait for Input after While command line.
    And in the end of the While you could check if input is off - just to be sure thet button is released.


    -Jussi-


    WHILE
    WHILE
    WAIT INPUT ON
    PICK
    PLACE
    WAIT INPUT OFF
    ENDWHILE
    ENDWHILE

  • Thank you for your answer,


    Now I have another question :winking_face:


    What if I want to depalletize 2 pallets.
    So when I push Button A, I take a sack of the left pallet.
    And when I push Button B, I take a sack of the right pallet.


    This is my new program that I wrote with 2 pallets


    My problem here again is that I empty the whole pallet when I press a button
    I have made a while loop with reg1<50 just because It otherwise won't work.





    %%%
    VERSION:1
    LANGUAGE:ENGLISH
    %%%


    MODULE DEPALLET

    CONST robtarget pPick1:=[[808.56,-66.6,1599.05],[1.3E-05,-5E-06,1,-5E-06],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget pPlace1:=[[560.77,-593.14,1596.95],[4.7E-05,0.397767,0.917487,-2E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    CONST robtarget pPick2:=[[808.56,-66.6,1599.05],[1.3E-05,-5E-06,1,-5E-06],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget pPlace2:=[[560.77,-593.14,1596.95],[4.7E-05,0.397767,0.917487,-2E-05],[-1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    CONST robtarget pHome:=[[816.23,3.85,1596.91],[3.8E-05,1.5E-05,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    CONST robtarget pDrop:=[[281.64,766.1,1896.96],[5.6E-05,-0.570325,0.82142,3.8E-05],[0,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

    VAR num nPlaceCtr;
    VAR num nZOffss;
    VAR num nLayerCtr;


    PROC main()
    While reg1<50 DO
    IF ButtonA=high THEN
    rPallet1;
    ENDIF
    IF ButtonB=high THEN
    rPallet2;
    ENDWHILE
    ENDPROC

    PROC rPallet1
    rInitial;
    rHome;
    WHILE nLayerCtr<=2 DO
    WHILE nPlaceCtr<=6 DO
    rPick1;
    rPlace1;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    rHome;
    ENDPROC

    PROC rPallet2
    rInitial;
    rHome;
    WHILE nLayerCtr<=2 DO
    WHILE nPlaceCtr<=6 DO
    rPick2;
    rPlace2;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    rHome;
    ENDPROC


    PROC rInitial()
    nZOffss:=0;
    nPlaceCtr:=1;
    nLayerCtr:=1;
    ENDPROC


    PROC rHome()
    MoveJ pHome,v1000,fine,tool0;
    ENDPROC


    PROC rPick1()
    CONST num nXOffs{6}:=[0,-150,0,-150,0,-150];
    CONST num nYOffs{6}:=[0,0,150,150,300,300];


    MoveJ RelTool(pPick1,nXOffs{nPlaatsCtr},nYOffs{nPlaatsCtr},nZOffss-300),v1000,z50,tool0;
    MoveL RelTool(pPick1,nXOffs{nPlaatsCtr},nYOffs{nPlaatsCtr},nZOffss),v500,fine,tool0;
    rGrip;
    MoveL RelTool(pPick1,nXOffs{nPlaatsCtr},nYOffs{nPlaatsCtr},nZOffss-300),v500,fine,tool0;
    ENDPROC

    PROC rPick2()
    CONST num nXOffs{6}:=[0,-150,0,-150,0,-150];
    CONST num nYOffs{6}:=[0,0,150,150,300,300];


    MoveJ RelTool(pPick2,nXOffs{nPlaatsCtr},nYOffs{nPlaatsCtr},nZOffss-300),v1000,z50,tool0;
    MoveL RelTool(pPick2,nXOffs{nPlaatsCtr},nYOffs{nPlaatsCtr},nZOffss),v500,fine,tool0;
    rGrip;
    MoveL RelTool(pPick2,nXOffs{nPlaatsCtr},nYOffs{nPlaatsCtr},nZOffss-300),v500,fine,tool0;
    ENDPROC


    PROC rPlace1()
    MoveJ RelTool(pPlace1,0,0,-300),v1000,z50,tool0;
    MoveL pPlace1,v1000,fine,tool0;
    MoveL RelTool(pPlace1,0,0,0\Rx:=30),vmax,z50,tool0;
    MoveL RelTool(pPlace1,0,0,0\Rx:=-30),vmax,z50,tool0;
    MoveJ RelTool(pPlace1,0,0,-300),v1000,z50,tool0;
    ENDPROC

    PROC rPlace2()
    MoveJ RelTool(pPlace2,0,0,-300),v1000,z50,tool0;
    MoveL pPlace2,v1000,fine,tool0;
    MoveL RelTool(pPlace2,0,0,0\Rx:=30),vmax,z50,tool0;
    MoveL RelTool(pPlace2,0,0,0\Rx:=-30),vmax,z50,tool0;
    MoveJ RelTool(Pplace2,0,0,-300),v1000,z50,tool0;
    ENDPROC


    PROC rGrip()
    WaitTime 1;
    ENDPROC


    PROC rRelease()
    WaitTime 1;
    ENDPROC


    PROC rDrop()
    MoveJ pDrop,v1000,z100,tool0;
    MoveL RelTool(pDrop,0,0,300),v1000,z50,tool0;
    rRelease;
    MoveJ pDrop,v1000,z100,tool0;
    ENDPROC
    ENDMODULE

  • You could do something to what you did before, BTW, there's a 1000 ways to skin a cat


    You push the buttonA, then the program takes you to rPallet1
    As soon as you get into rPallet1 you turn a flag on (varPallet1:=1)
    Then inside the WHILE (does not matter which part your are working on) you turn the flag off.
    At this point the main condition WHILE varPallet1=1 DO goes false and you are out of rPallet1


    Same for pallet 2


    !!!!!! You have to rename you variables (nLayerCtr, nPlaceCtr, etc, etc) to nLayerCtr1, nLayerCtr2 so the counters for each pallet are independent


    PROC rPallet1
    varPallet1:=1;
    rInitial;
    rHome;
    WHILE varPallet1=1 DO
    WHILE nLayerCtr<=2 DO
    WHILE nPlaceCtr<=6 DO
    varPallet1:=0;
    rPick1;
    rPlace1;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    ENDWHILE
    rHome;
    ENDPROC

    Retired but still helping

  • Hi Fabian,


    If I will apply the technique of the flag, it will not solve my problem will it?
    I will stay stuck at the while loop and empty my whole pallet.
    Instead I want to take just one sack. Then go back to the home position and only when i push the button A again I want to take the second sack


    greets,


    Wim

  • PROC rPallet1
    varPallet1:=1;
    rInitial;
    rHome;
    WHILE nLayerCtr<=2 AND varPallet1=1 DO What about now ?
    WHILE nPlaceCtr<=6 DO Key issue: Turn the flag ON at the beginning and OFF after one part
    varPallet1:=0;
    rPick1;
    rPlace1;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    rHome;
    ENDPROC

    Retired but still helping

  • When I will use your solution, I will take 6 sacks, that's not what I want


    What if I try this?



    PROC rPallet1
    varPallet1:=1;
    rInitial;
    rHome;
    WHILE nLayerCtr<=2 AND varPallet1=1 DO
    WHILE nPlaceCtr<=6 DO AND varPallet1=1 DO
    varPallet1:=0;
    rPick1;
    rPlace1;
    rDrop;
    Incr nPlaceCtr;
    ENDWHILE
    nPlaceCtr:=1;
    Incr nLayerCtr;
    nZOffss:=nZOffss+100;
    ENDWHILE
    rHome;
    ENDPROC


    But then my problem is that I my rInitial sets the counters again at 1, and I will never get to the second sack.

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