RobotStudio event

EGM - Path correction with analog input

I'm making a program in RAPID using EGM path correction trying to move the robot in a simple linear path and correcting the height when moving over an object in the middle of the path. I'm using an analog input and have got the basic EGM movement to work except that it corrects in the opposite direction. Now the robot just moves further and further away from the object until the EGM corrections reaches its maximum.
When using path correction it can correct in y-, and z-direction, and the coordinate system is defined as the path coordinate system with x-direction defined as the direction of the movement. My guess is that the positive z-direction of this coordinate system have to be flipped with 180 degrees (rotated around the y-axis). 

I want the robot to move downwards if the input value is positive and upwards if the value is negative. The logical values converting the analog voltage signal cannot be flipped around. I guess there is some system settings I can change to make it work as desired but I cant figure it out. 

Here is some of my code:

        PERS tooldata tEGM:=[TRUE,[[118,0,151],[0.915311479,0,0.40274669,0]],[0.3,[0,0,1],[1,0,0,0],0,0,0]];
        PERS tooldata tLaser:=[TRUE,[[65,0,126],[0.906307787,0,0.422618262,0]],[0.3,[0,0,1],[1,0,0,0],0,0,0]];
        TASK PERS wobjdata Workobject_1:=[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[255,-318,235],[1,0,0,0]]];
PROC main()
        EGMReset egmID1;
        EGMGetId egmID1;
        egmSt1 := EGMGetState(egmID1);                                                
        EGMSetupAI ROB_1, egmID1, "Test" \PathCorr \APTR \aiR3z:=LaserSignal;    
        EGMActMove egmID1, tLaser.tframe \SampleRate:=48;
        MoveL p0, v100, z30, tEGM\WObj:=Workobject_1;
        MoveL p1, v30, z5, tEGM\WObj:=Workobject_1;
        MoveL p2, v20, fine, tEGM\WObj:=Workobject_1;
        EGMMoveL egmID1, p3, v10, z5, tEGM\WObj:=Workobject_1;
        EGMMoveL egmID1, p4, v10, z5, tEGM\WObj:=Workobject_1;
        EGMMoveL egmID1, p5, v10, fine, tEGM\WObj:=Workobject_1;
        MoveL p6, v100, z30, tEGM\WObj:=Workobject_1;
        EGMReset egmID1;


  • lemster68
    lemster68 ✭✭✭
    Can you just swap the wires for the analog input and just live with it like that?
    Lee Justice
  • I managed to make it work by rotating the tool coordinate system like this:
        PERS tooldata tEGM:=[TRUE,[[126.641,17.5,256.459],[0.5,0,-0.866025404,0]],[0.3,[0,0,1],[1,0,0,0],0,0,0]];
        PERS tooldata tLaser:=[TRUE,[[66.641,17.5,152.536],[0.5,0,-0.866025404,0]],[0.3,[0,0,1],[1,0,0,0],0,0,0]];
    Now the EGM path corrections works in the right direction.