Hi,
I try to do a rapid programm only with EGM RAPID code following the examples writed on documentation… but I cannot reach to understand what is the relationship with frames amb movements
when I am doing changes in Group Inputs. The mechanical unit is moving but it is doing to wrong directions :-((.
The question is, the robot must follow the path and change it base on the value of group input in this case?
Here is the code:
MODULE maimMod
TASK PERS tooldata tFroniusCMT:=[TRUE,[[12.3313,-0.108707,416.142],[0.903899,-0.00320735,0.427666,0.00765917]],[2.6,[-111.1,24.6,386.6],[1,0,0,0],0,0,0.072]];
TASK PERS wobjdata wobj_EGM1:=[FALSE,TRUE,“”,[[150,1320,1140],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
TASK PERS wobjdata wobj_EGM2:=[FALSE,TRUE,“”,[[0,1000,1000],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
CONST jointtarget jpos10:=[[0,0,0,0,35,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget p30:=[[1500,0,1500],[0.322151,-0.601023,0.672381,0.287914],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget p20:=[[150,1320,1140],[0.000494947,0.662278,-0.749217,-0.00783173],[0,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
VAR egmident egmID1;
VAR egmident egmID2;
CONST egm_minmax egm_minmax_lin1:=[-100,100];
CONST egm_minmax egm_minmax_rot1:=[-2,2];
CONST egm_minmax egm_minmax_joint1:=[-0.1,0.1];
! CONST jointtarget jpos10:=[[0,0,0,0,35,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST pose posecor:=[[1200,400,900],[1,0,0,0]];
CONST pose posesens:=[[12.3313,-0.108707,416.142],[0.903899,-0.00320735,0.427666,0.00765917]];
! corr-frame: world, sens-frame: world
VAR pose posecor0:=[[1500,0,1500],[1,0,0,0]];
VAR pose posesen0:=[[1500,0,1500],[1,0,0,0]];
!TASK PERS tooldata tFroniusCMT:=[TRUE,[[12.3313,-0.108707,416.142],[0.903899,-0.00320735,0.427666,0.00765917]],[2.6,[-111.1,24.6,386.6],[1,0,0,0],0,0,0.072]];
TASK PERS loaddata load1:=[5,[0,1,0],[1,0,0,0],0,0,0];
! corr-frame: wobj, sens-frame: wobj
! TASK PERS wobjdata wobj_EGM1:=[FALSE,TRUE,“”,[[150,1320,1140],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
VAR pose posecor1:=[[0,0,0],[1,0,0,0]];
VAR pose posesen1:=[[0,0,0],[1,0,0,0]];
! TASK PERS wobjdata wobj_EGM2:=[FALSE,TRUE,“”,[[0,1000,1000],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
VAR pose posecor2:=[[150,320,0],[1,0,0,0]];
VAR pose posesen2:=[[150,320,0],[1,0,0,0]];
PROC main()
MoveAbsJ jpos10\NoEOffs,v1000,fine,tFroniusCMT;
testAO;
ENDPROC
PROC testAO()
! Get two different EGM identities. They will be used for two different eGM setups.
EGMGetId egmID1;
! EGMGetId egmID2;
! Set up the EGM data source: Analog output signals and configuration “default”
! One guidance using Pose mode and one using Joint mode
EGMSetupGI ROB_1,egmID1,“default”\Pose\giR1x:=giX\giR2y:=giY\giR3z:=giZ;
!EGMSetupAO ROB_1,egmID2,“default”\Joint\aoR1x:=ao_MoveX\aoR2y:=ao_MoveY\aoR3z:=ao_MoveZ\aoR4rx:=ao_RotX\aoR5ry:=ao_RotY\aoR6rz:=ao_RotZ;
! Move to the starting point - fine point is needed.
MoveJ p30,v1000,fine,tool0;
! Set the signals
! Correction frame is the World coordinate system and the sensor measurements are also relative to the world frame
! No offset is defined (posecor0 and posesen0)
EGMActPose egmID1\Tool:=tFroniusCMT\WObj:=wobj0,posecor0,EGM_FRAME_WORLD,posesen0,EGM_FRAME_WORLD\x:=egm_minmax_lin1\y:=egm_minmax_lin1\z:=egm_minmax_lin1\rx:=egm_minmax_rot1\ry:=egm_minmax_rot1\rz:=egm_minmax_rot1\LpFilter:=20\SampleRate:=16\MaxPosDeviation:=1000;
! Run: keep the end position without returning to the start position
EGMRunPose egmID1,EGM_STOP_HOLD\x\y\z\RampInTime:=0.05\PosCorrGain:=16;
! Move to the starting point - fine point is needed.
MoveJ p20,v1000,fine,tFroniusCMT;
! Set the signals
! Run with the same frame definitions: ramp down to the start position after having reached
! the EGM end position
EGMRunPose egmID1,EGM_STOP_RAMP_DOWN\x\y\z\RampInTime:=0.05\PosCorrGain:=16;
! Move to the starting point - fine point is needed.
MoveJ p30,v1000,fine,tool0;
! Set the signals
EGMReset egmID1;
ENDPROC
ENDMODULE
Thank you
BR
Jordi