RobotStudio event

Why ABB robot doesn't follow set coordi accurately?

Hello, I couldn't find a solution using search so I have created a new topic.
I have been testing the robot(and the software that comes with it) in my university lab for a few days.  I have faced rather a queer problem with RAPID command line "MoveL". My aim is to draw a square as an example on a 2-D board which is near the robot. So whenever I use "MoveL" function I set only position in x and y directions,  and z coordinate is always set to 0. But when I run the code on the robot it moves in z direction as well even though it shouldn't. By moving 50 mm in x direction it moves 5 mm in z direction. So if I used a pen it would draw only two lines of a square as the tool goes up approx 5 mm and the pen couldn't reach the board. This occurs even if I don't have a tool mounted. Here I attach some simple code I am using.

PROC l()
     ConfL\On;
    StartMove;
    IF i=0 then
    MoveL RelTool(init,0,0, 0\Rx:=0\Ry:=0\Rz:=0),speed,fine,tool1\WObj:=wobj1;
    i:=1;
    ELSEIF i=1 THEN 
    MoveL RelTool(init,50,0,0\Rx:=0\Ry:=0\Rz:=0),speed,fine,tool1\WObj:=wobj1;
    i:=2;
    elseif i=2 then
    MoveL RelTool(init,50,-50,0\Rx:=0\Ry:=0\Rz:=0),speed,fine,tool1\WObj:=wobj1;
    i:=3;
    ELSEIF i=3 THEN 
    MoveL RelTool(init,0,-50,0\Rx:=0\Ry:=0\Rz:=0),speed,fine,tool1\WObj:=wobj1;
    i:=0;
    ENDIF 
    StopMove;
ENDPROC

Best Answer