![RobotStudio event](https://new.abb.com/images/librariesprovider89/default-album/rs_webinar_invitation_2025_2.jpg)
Can you use tool load data to perform a toolcheck?
![awilde](https://secure.gravatar.com/avatar/e4ada61dd6aa1f4b237d394ebd02c9de/?default=https%3A%2F%2Fus.v-cdn.net%2F5020483%2Fuploads%2Fdefaultavatar%2FK2266OAKOLNC.jpg&rating=g&size=200)
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.0
-
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) THEN
RAISE ERR_TOOL_IN_COLLET;
ENDIF
If 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. 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 ANDLee Justice0
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 18 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 321 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 807 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings