Hello!
I would like to check the torque of axis in rappid. After that I would like to connect these values to a interrupt. Is it possible?
How can I do this?
Hello!
I would like to check the torque of axis in rappid. After that I would like to connect these values to a interrupt. Is it possible?
How can I do this?
The function is GetMotorTorque.
Here's two examples from the manual.
Example 1
VAR num torque_value;
torque_value := GetMotorTorque(\MecUnit:=STN1, 1);
The current motor torque of the first axis of STN1 is stored in torque_value.
Example 2
VAR num pre_grip_torque;
VAR num post_grip_torque;
..
MoveJ p10, v1000, fine, Gripper;
! Read the torque for axis 5 before gripping the piece
pre_grip_torque:=GetMotorTorque(5);
! Grip the piece
grip_piece;
! Read the torque for axis 5 after gripping the piece
post_grip_torque:=GetMotorTorque(5);
! Compare torque for axis 5 before and after gripping the piece
piece_gripped:=check_gripped_piece(pre_grip_torque, post_grip_torque);
IF piece_gripped = TRUE THEN
GripLoad piece1;
ELSE
TPWrite "Failed to grip the piece";
Stop;
ENDIF
..
The current motor torque of axis 5 of the robot is read before gripping the piece. The piece is then gripped. The torque is read once again and the torques are compared to detect if there is an actual extra load in the gripper.
This function only works with in robotware 6.0 I've tried this with TestSignalInstructions but can't get it to work. Generates an error: Made the following:
CONST num Torque_channel :=2;
VAR num Torque_value;
TestSignDefine Torque_channel, torque_ref, ROB_1 , 2, 1.0;
<< code >>
<< Start picking up the product>>
MoveL Offs(pPick,0,-10,100), vHandling, z20, toolPick\WObj:=wobjPick;
MoveL Offs(pPick,0,-10,10),vSearch,fine,toolPick\WObj:=wobjPick;
<< do the torque measuring >>
If (TestSignRead(Torque_channel) > 6 ) Then <<< hier fout
TpWrite(“Torque value:”+ValToStr(Torque_channel)
Else
TpWrite(“Noting”);
END if
<< end code >>
I get the error that TestSigDefine has an undefined channel. What goes wrong?