RobotStudio event

Can you use tool load data to perform a toolcheck?

Our robot sometimes does not manage to close it's collet while picking up a tool due to buildup from the manufacturing process. The issue when this happens is that it doesn't clear the tool shaft and rips the tool rack out of the ground. My solution to this is to program the robot to determine whether it has picked up the tool using the saved load data for the tool. Essentially want to perform a load check every time it picks up a tool. Is there a function that already exists within the IRC5 controller? Is it even possible for the robot to even determine a load change through just a z move? I know that when you perform the load identify function the robot has to articulate itself into different orientations in order for it to determine the mass and center of gravity for the tool but is a simple z move enough to determine a resistance change on the robots motors. I would think yes but even so how would one program this. Here is a sample of the code I was trying out but didn't work.

Here is the code I tried:

MODULE ToolPickupCheck

PERS num ERR_TOOL_NOT_IN_RACK := 1001;

PERS num ERR_TOOL_IN_COLLET := 1002;

PERS num ERR_PICKUP_FAILED := 1003;

PROC rPickBuffer1Check()

! Ensure no tool is in the rack or collet

IF diTool1Present<>1 THEN

RAISE ERR_TOOL_NOT_IN_RACK;

ENDIF

IF NOT (diTool1Present=1 AND diTool2Present=1 AND diTool3Present=1 AND

diTool4Present=1 AND diTool5Present=1 AND diTool6Present=1 AND

diTool7Present=1 AND diGearbox8Present=1 AND diGearbox9Present=1) THEN

RAISE ERR_TOOL_IN_COLLET;

ENDIF

! Move robot to pick buffer

MoveJ pHOME,vAIR,z100,toolSensor\WObj:=wobj0;

MoveJ pAPPR_TOOL_RACKS,vAIR,z100,toolSensor\WObj:=wobj0;

MotionSup\On\TuneValue:=300;

rOpenAutoCollet;

MoveL pOFF_BUFFER1,v400,fine,toolSmallBuffer\WObj:=wobjToolRacks;

MoveL pABOVE_BUFFER1,v50,z50,toolSmallBuffer\WObj:=wobjToolRacks;

MoveL pAT_BUFFER1,v5,fine,toolSmallBuffer\WObj:=wobjToolRacks;

WaitTime 0.5;

rCloseAutoCollet;

MoveL pABOVE_BUFFER1,v20,fine,toolSmallBuffer\WObj:=wobjToolRacks;

! Verify the buffer has been picked up by checking the tool load

WaitTime 0.5; ! Allow time for load measurement stabilization

IF LoadCheck(loSmallBuffer, loSmallBuffer, 10) = FALSE THEN

RAISE ERR_PICKUP_FAILED;

ENDIF

MoveL pAPPR_BUFFER1,v50,fine,toolSmallBuffer\WObj:=wobjToolRacks;

MoveL pAPPR_TOOL_RACKS,vAIR,z100,toolSensor\WObj:=wobj0;

MotionSup\Off;

MoveJ pHOME,vAIR,z100,toolSensor\WObj:=wobj0;

ERROR

SetDO doVRedStackLight,1;

TEST ERRNO

CASE ERR_TOOL_NOT_IN_RACK:

UIMsgBox\Header:="Tool Not In Rack","There is no buffer in slot #1 of the tool rack."\Icon:=iconError;

CASE ERR_TOOL_IN_COLLET:

UIMsgBox\Header:="Tool still in Collet","There is a tool in the Collet or one of the tool nests is empty."\Icon:=iconError;

CASE ERR_PICKUP_FAILED:

UIMsgBox\Header:="Pickup Failed","Please check the collet or buffer alignment."\Icon:=iconError;

ENDTEST

SetDO doRedStackLight,0;

EXIT;

ENDPROC

FUNC bool LoadCheck(toolSmallBuffer)

VAR num currentLoad;

VAR num expectedLoad := toolSmallBuffer.ExpectedWeight;

VAR num tolerance := toolSmallBuffer.Tolerance;

! Read the current load from the sensor

currentLoad := ReadLoadSensor();

! Verify if the load is within the expected range

IF (currentLoad >= expectedLoad - tolerance) AND (currentLoad <= expectedLoad + tolerance) THEN

RETURN TRUE;

ELSE

RETURN FALSE;

ENDIF

ENDMODULE

Answers

  • Hey ...
    Have you tried using the torque value for this?
    Check if a combination using GetMotorTorque and GetTorqueMargin can help you.
    If so, post the solution. Hug.
    Good job.
  • lemster68
    lemster68 ✭✭✭
    Please consider having prox switches or tool ID switches to know the present state of; robot has a tool present and which one is it?

    On another note:
    diTool7Present=1 AND diGearbox8Present=1 AND diGearbox9Present=1) THENRAISE ERR_TOOL_IN_COLLET;ENDIFIf these signals are mapped in sequence, you could map in a group output which then is evaluated for the binary value for which state is OK or not OK.&nbsp; It can make the code a lot cleaner.
    </code>IF NOT (diTool1Present=1 AND diTool2Present=1 AND diTool3Present=1 AND</pre><p><code>diTool4Present=1 AND diTool5Present=1 AND diTool6Present=1 AND
    Lee Justice