2 Home positions
Rob84uk
✭
Need to make dual home positions using current system setup, but im not used to the way the current home position is done. "What is CJointT() ??????"
!
PROC control_reposo()
! Verificacion robot en posicion reposo y mantenimiento
! Reposo robot
jposActual_rob:=CJointT();
nDif_pos1:=Abs(jpos_Home_rob.robax.rax_1-jposActual_rob.robax.rax_1)+Abs(jpos_Home_rob.robax.rax_2-jposActual_rob.robax.rax_2);
nDif_pos2:=Abs(jpos_Home_rob.robax.rax_3-jposActual_rob.robax.rax_3)+Abs(jpos_Home_rob.robax.rax_4-jposActual_rob.robax.rax_4);
nDif_pos3:=Abs(jpos_Home_rob.robax.rax_5-jposActual_rob.robax.rax_5)+Abs(jpos_Home_rob.robax.rax_6-jposActual_rob.robax.rax_6);
nDif_pos:=nDif_pos1+nDif_pos2+nDif_pos3;
IF Abs(nDif_pos)<1 THEN
Set do_Home;
b_robot_home:=TRUE;
ELSE
Reset do_Home;
b_robot_home:=FALSE;
ENDIF
! Posicio mantenimiento
jposActual_rob:=CJointT();
nDif_pos1:=Abs(jpos_Mainten_rob.robax.rax_1-jposActual_rob.robax.rax_1)+Abs(jpos_Mainten_rob.robax.rax_2-jposActual_rob.robax.rax_2);
nDif_pos2:=Abs(jpos_Mainten_rob.robax.rax_3-jposActual_rob.robax.rax_3)+Abs(jpos_Mainten_rob.robax.rax_4-jposActual_rob.robax.rax_4);
nDif_pos3:=Abs(jpos_Mainten_rob.robax.rax_5-jposActual_rob.robax.rax_5)+Abs(jpos_Mainten_rob.robax.rax_6-jposActual_rob.robax.rax_6);
nDif_pos:=nDif_pos1+nDif_pos2+nDif_pos3;
IF Abs(nDif_pos)<1 THEN
Set do_Maintenance;
ELSE
Reset do_Maintenance;
ENDIF
WaitTime 0.05;
ENDPROC
ENDMODULE
PROC control_reposo()
! Verificacion robot en posicion reposo y mantenimiento
! Reposo robot
jposActual_rob:=CJointT();
nDif_pos1:=Abs(jpos_Home_rob.robax.rax_1-jposActual_rob.robax.rax_1)+Abs(jpos_Home_rob.robax.rax_2-jposActual_rob.robax.rax_2);
nDif_pos2:=Abs(jpos_Home_rob.robax.rax_3-jposActual_rob.robax.rax_3)+Abs(jpos_Home_rob.robax.rax_4-jposActual_rob.robax.rax_4);
nDif_pos3:=Abs(jpos_Home_rob.robax.rax_5-jposActual_rob.robax.rax_5)+Abs(jpos_Home_rob.robax.rax_6-jposActual_rob.robax.rax_6);
nDif_pos:=nDif_pos1+nDif_pos2+nDif_pos3;
IF Abs(nDif_pos)<1 THEN
Set do_Home;
b_robot_home:=TRUE;
ELSE
Reset do_Home;
b_robot_home:=FALSE;
ENDIF
! Posicio mantenimiento
jposActual_rob:=CJointT();
nDif_pos1:=Abs(jpos_Mainten_rob.robax.rax_1-jposActual_rob.robax.rax_1)+Abs(jpos_Mainten_rob.robax.rax_2-jposActual_rob.robax.rax_2);
nDif_pos2:=Abs(jpos_Mainten_rob.robax.rax_3-jposActual_rob.robax.rax_3)+Abs(jpos_Mainten_rob.robax.rax_4-jposActual_rob.robax.rax_4);
nDif_pos3:=Abs(jpos_Mainten_rob.robax.rax_5-jposActual_rob.robax.rax_5)+Abs(jpos_Mainten_rob.robax.rax_6-jposActual_rob.robax.rax_6);
nDif_pos:=nDif_pos1+nDif_pos2+nDif_pos3;
IF Abs(nDif_pos)<1 THEN
Set do_Maintenance;
ELSE
Reset do_Maintenance;
ENDIF
WaitTime 0.05;
ENDPROC
ENDMODULE
Regards
Rob
Rob
0
Comments
-
Hi,Definition from the RAPID manual:This function (CJointT) reads the current angle of the robot axes and external axes.So what the program is doing is getting the current angle of each axis and subtracting this from the home postions axis angles.If the over all result for all 6 axis is less than 1 the robot is said to be at the home postion, if it is greater than 1 it is not at home.Hope this helpsGraemegraemepaulin2011-08-09 02:33:130
-
thankyou Graemeis it possible to have 2 defined home positions in that wayor can you only use the function once?Thanks RobRegards
Rob0 -
Hi,I have updated my post above as I gave the definition for CRobT (reads current position)not CJointT (reads current axes angle). The functionality of the code is the same.You can use the CRobT function as often as you want.If you have 2 home postions, and you do not care which one the robot is at you can add another calculation for the second postion then nest a second IF statement to check if the robot is at the second home postion if it is not at the first.For example (I have assumed the result of the calculation for the second home postion is called nDif_pos2):
IF Abs(nDif_pos)<1 THEN<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Set do_Home;
b_robot_home:=TRUE;
ELSEIF Abs(nDif_pos2)<1 THEN
Set do_Home;
b_robot_home:=TRUE;
ESLE
Reset do_Home;
b_robot_home:=FALSE;
ENDIF
RegardsGraeme0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings