Hi again!
You know that when you use fly-by-points, you can get this behavior.
MP = motion pointer
PP = program pointer
RP = robot position
pMirror :=Offs(CurrentPosition, …
TriggL p1
pMirror :=Offs(CurrentPosition, …
MP->TriggL p2
pMirror :=Offs(CurrentPosition, …
TriggL p3
pMirror :=Offs(CurrentPosition, …
TriggL p4
pMirror :=Offs(CurrentPosition, …
PP->TriggL p5
pMirror :=Offs(CurrentPosition, …
X---------X--------X--------X-----X
p1 | p2 p3 p4 p5
RP | |
MP PP
The program pointer is a couple of instructions before the motion pointer.
It walks ahead. The program needs to feed the system with new positions, so the
new positions can be calculated by the motion system.
Just one TRAP has executed (the one that says that you have been it p1
position). The TRAP executes when the robot is in the position.
But your assignments says that you are in position p5.
The pMirror values will be incorrect in this case.
You will get this behavior when using short movements and high speed.
If using longer movements, you can see that the program pointer is one instruction
before the motion pointer for a short time.
Use a counter in your program that is increased between each TriggL. Then you can
have another counter in the TRAP. Execute the program and do TPWrite on the counters after
you increase them. You will probably see a difference between them.
The program I used to check that the TRAP is executed right is the one below.
I run it on an IRB2400 Type A. Then I compared the values logged to file with the onces
that I had in the program.
MODULE MainMoves
TASK PERS tooldata tool1:=[TRUE,[[0,0,0],[1,0,0,0]],[10,[103,0,108],[1,0,0,0],0,0,0]];
TASK PERS tooldata L10tip:=[TRUE,[[138.695,150.023,98.9783],[0.709396,-0.704707,-0.00856676,0.00851007]],[10,[103.6,-0.7,108.5],[1,0,0,0],0,0,0.12]];
CONST jointtarget jpos10:=[[0,0,0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST jointtarget jpos20:=[[-10.4956,10.1942,43.8338,-15.7201,-46.1733,13.6386],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget p10:=[[933.43,-156.03,885.18],[0.714349,0.00968503,0.699448,0.0196065],[-1,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget p20:=[[869.38,-650.65,553.29],[0.00200615,0.711693,-0.702145,0.0219609],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget p30:=[[869.38,335.71,553.30],[0.00200546,0.711693,-0.702145,0.0219654],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget p40:=[[1200.65,335.71,553.30],[0.00200207,0.711693,-0.702145,0.0219671],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget p50:=[[1200.65,-470.31,553.29],[0.00200949,0.711694,-0.702144,0.0219611],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
VAR iodev logfile;
VAR num cnt:=1;
PROC main()
Open “LOGFILE.txt”, logfile Write;
MoveJSync p10, vmax, fine, tool1, “myproc”;
MoveJSync p20, vmax, z0, L10tip, “myproc”;
MoveLSync p30, vmax, z0, L10tip, “myproc”;
MoveLSync p40, vmax, z0, L10tip, “myproc”;
MoveLSync p50, vmax, fine, L10tip, “myproc”;
Close logfile;
Stop;
ENDPROC
PROC myproc()
VAR robtarget myp1;
myp1 := CRobT();
Write logfile, “Pos”+ValToStr(cnt)+“:“NoNewLine;
Write logfile,” [[” +ValToStr(myp1.trans)+“]“NoNewLine;
Write logfile,”[” +ValToStr(myp1.rot)+“]“NoNewLine;
Write logfile,”[” +ValToStr(myp1.robconf)+“]“NoNewLine;
Write logfile,”[” +ValToStr(myp1.extax)+“]”;
cnt:=cnt+1;
ENDPROC
ENDMODULE