I am trying to setup some worldzones to avoid our system from colliding with an overhead crane.
I have two park locations for the crane with sensors wired to digital inputs to the robot that tell when the crane is in one of those locations (diCranePark1, diCranePark2)
when the crane is in either of these park locations i define worldzone and apply the limit to stop the robot from entering this area, when the crane is in neither of these locations i apply a larger wordzone limit as i dont know where the crane is. I then made some interupts and traps that enable or disable the correct zones.
WzFree wzCranePark1;
WzFree wzCranePark2;
WzFree wzCranePark3;
WzLimJointDefInside, sCranePark1, jCranePark1_low, jCranePark1_high; WzLimJointDefInside, sCranePark2, jCranePark2_low, jCranePark2_high; WzLimJointDefInside, sCranePark3, jCranePark3_low, jCranePark3_high;
WzLimSup Temp, wzCranePark1, sCranePark1;
WzLimSup Temp, wzCranePark2, sCranePark2;
WzLimSup Temp, wzCranePark3, sCranePark3;
WzDisable wzCranePark1;
WzDisable wzCranePark2;
WzDisable wzCranePark3;
IF diCranePark1 = 1 THEN
WzEnable wzCranePark1;
ELSEIF diCranePark2 = 1 THEN
WzEnable wzCranePark2;
ELSE WzEnable wzCranePark3;
ENDIF
CONNECT intCranePark1 WITH trpCranePark1;
ISignalDI diCranePark1,edge,intCranePark1;
CONNECT intCranePark2 WITH trpCranePark2;
ISignalDI diCranePark2,edge,intCranePark2;
Now I have 2 problems with this solution.
-
The interupts only work whilst the robot is running, is there a better way to enable/disable the worldzone limits that would work whilst the robot was not running.
-
The worldzones all get wiped when we reset the program pointer to main or load a new program (which is something we do every time we run a program on the robot). I tested it with wzstationary instead of wztemporary and then I cant use wzenable / wzdisable.
Any ideas on how to do this?