Hi all,
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