RobotStudio event

Rotate tool around work object Z-axis

Greetings.
I am looking for a way to define a new point with the same pos-data as an old one, but rotated about 15 degrees around a work object's Z-axis.
That is, change the "ori" of a robtarget to be rotated around the Z-axis.
I still have not gotten the hang of Quaternions, so I was hoping there was a RAPID function to do this for me.
I am, however, unable to find such a function in my reference manual, and was hoping for some help.

This will be used for alligning a held item with two analog distance sensors. The exact position and orientation of the item on the gripper is not known, so these sensors will be used to account for that. I will move linearly using SearchL untill I hit both the sensors, then rotate using another SearchL untill the inputs from both sensors are equal, using an analog interrupt to set the bool to stop the searches.
I will use this routine with lots of different items, tools and tool orientations, so I need a way to calculate the point to rotate toward so that the rotation happens only along one axis of the work object that describes these analog sensors.

Comments

  • The function you want is RelTool

        VAR num nZaxisRotation:=-15;
        PERS tooldata Tooldata_1:=[TRUE,[[0,0,100],[1,0,0,0]],[1,[0,0,1],[1,0,0,0],0,0,0]];
        CONST robtarget Target_10:=[[302,0,458],[0,0,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
        CONST robtarget Target_20:=[[436.769200716,0,457.999973956],[0.000000008,0,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
        VAR robtarget pSearchPos1:=[[302,0,458],[0,0,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
        VAR robtarget pSearchPos2:=[[302,0,458],[0,0,1,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
     
        PROC Path_10()
            MoveL Target_10,v1000,fine,Tooldata_1\WObj:=wobj0; 
            SearchL\Stop,diSearch1,pSearchPos1,Target_20,v50,Tooldata_1;
            SearchL \Stop,diSearch2,pSearchPos2,RelTool(pSearchPos1,0,0,0\Rz:=nZaxisRotation),v50,Tooldata_1;
        ENDPROC

    Move to Target_10. SearchL towards Target_20. Stop when diSearch1 is made. The stop position is pSeachPos1.
    Next do a searchL rotating around the z axis of pSearchPos1 using RelTool -15 degrees to stop at pSearchPos2.

  • The function you want is RelTool
    I greatly appreciate your reply, but with all due respect, I disagree.
    As I understand the RelTool function, it uses the acitve tool's coordinate system, which is not what I want.
    I would like to rotate around the Z-axis of a work object, not the tool. The orientation of the tool can vary from call to call, but the work object is always the same.
    The work object Z-axis is parallel to the world coordinate system, so if rotating around world Z-axis is easier, that works too.
  • I think that I would look into using the PoseMult function.
    Lee Justice
  • You could use the workobject as tool and then use RelTool. Shouldn't be a problem.