RobotStudio event

Rotate tcp around z-axis

Hi,

I'm trying to rotate tool0 90-degrees around world X from it's current location but when I'm not sure how to do that? Is there a way to only rotate tool0? 

In the screenshot I want to rotate tool0 in such a way that the local coordinate system rotates around its' Z (blue) which is world X (red).

image

Thanks
p

Comments

  • The tool0 Is a fixed coordinate system, that can not be modified and will always be in the same position relative to the robot.
  • Hey svoldgaard, 

    Oh sorry, I probably didn't mean tool0 then. But my goal is to rotate the x-axis around the z-axis. I'm talking about the red, blue and green lines in the screenshot above. 

    p
  • Do you mean as a robot movement or to make a new tool?
  • As a robot movement. I created a video from what I'm trying to explain with rotation the 'tcp'/tool0. I've recorded a video with RobotStudio that shows what I'm trying to accomplish. So I want to keep the robots position the same and only rotate the tcp.


    p
  • ahh you can do that by reading the current value of the robot. either as a robtarget or a jointtarget, with the instructions. 
    The easiest is using jonttarget:

    joints := CJointT(); 

    then you modify the target:

    joints .robax.rax_6:=joints .robax.rax_6+90; 

    Now you can simlpy move to that target, and only the 6th axes will move

    MoveAbsJ joints \NoEOffs,v1000,fine,tool0\WObj:=wobj0;





  • Hi svoldgaard,

    Thanks so much! Got that working now. I've uploaded a video here: https://www.flickr.com/photos/diederick/15160786114/ 

    First I write some "text" (ipsum), then I draw a square followed by a sin wave. 

    Cheers
    p
  • Nice:-)

    can't see you video though...
  • Oh sorry, it look like the link got messed up. This is the correct link to the video.
  • This thread is awesome and has really helped me! I did have one question related to the video you posted if you do not mind. I am fairly new to robot studio and was wondering if you might be able to tell me how you were able to display the coordinates and rotation there in your simulation
  • I was wondering if anyone has solved how to do this for something other than tool0 tcp? I have implemented this and tried with a tcp that is offset from tool0 and it does not rotate around that tcp. It looks like this RAPID motion command is only meant to move joint 6. What if we need to move more to rotate around a different tcp??
  • Use Reltool function
    Lee Justice
  • I've discovered this thread as we've needed to do something similar with our robot. This helped me to achieve what I needed, thank you!.

    However, my joint 6 rotation is very quick, even when I reduce velocity right down to v10.  The only way I've slowed the movement down is to add a time in too, so v10\T:=5 for example.

    I have another rotational move I need to do but I need to rotate until a sensor is made. How can I slow that joint 6 rotation down? Adding Time in this instance won't work.
  • Tompanhuhu
    Tompanhuhu ✭✭
    edited October 28
    You can define your own speeddata, this is copy-paste from manual.

    The following example illustrates the data type speeddata:

    VAR speeddata vmedium := [ 1000, 30, 200, 15 ];

    The speed data vmedium is defined with the following velocities:

    1000 mm/s for the TCP.
    30 degrees/s for reorientation of the tool.
    200 mm/s for linear external axes.
    15 degrees/s for rotating external axes.

    vmedium.v_tcp := 900;
    The velocity of the TCP is changed to 900 mm/s.
    Systemintegrator - Web / C# / Rapid / Robotstudio

    If I helped, please press Vote Up  :smile:

    ☑️2024 - RobotStudio® User Group
  • mandolas
    mandolas
    edited November 4

    Hi...

    A few months ago, I encountered the same situation and resolved it by creating my own function.

    My goal is to ensure that the tip of the object being carried moves at a speed comparable to linear motion. Since we work with parameterized programs where the user defines the robot's execution speed, this adjustment becomes necessary.

    Here’s the code; feel free to modify and use it as needed. If you find any improvements for the routine, please share them with us.

        ! Adjust Orientation Speed to Resemble Linear Speed
        ! Version: 1.1.1
        !
        ! Purpose: This procedure converts linear speed into angular speed based on the reference object’s radius. This is useful when only linear speed is known, but an object’s rotation speed is needed, with the radius derived from the object’s dimensions.
        ! Angular Speed Adjustment (v_ori): Adjusts the angular speed (v_ori) of an object relative to its linear speed (v_tcp), taking into account the reference object's dimensions.
        ! Radius Calculation: Computes the reference object’s radius using its width (objRefP.width) and length (objRefP.length). The radius is half the hypotenuse of a right triangle formed by these dimensions.
        ! Linear to Angular Speed Conversion: Converts linear speed (v_tcp) to angular speed (v_ori) using the calculated radius. This formula translates the linear speed unit (mm/s) to angular speed (degrees/s).
        ! Assigning Angular Speed: The computed angular speed is assigned to the v_ori property of the setVelR object, which is of type speeddata.
        !
        ! Version History
        !	1.1.1 - Modification
        !		The optional overflowP parameter is now capped at 300%.
        !		Added the optional \switch FULL option, which, when enabled, equates TCP speed with joint orientation speed, so v_tcp = v_ori.
        !	1.1 - Modification
        !		Added an optional parameter to set the percentage to override the calculated speed, constrained by the maximum allowable speed.
        !	1.0 - Original
        !
        ! Parameters
        !	\switch FULL: Sets reorientation speed to match TCP speed, bypassing any mm to degree conversion.
        !	INOUT speeddata setVelR: Return speed to be set.
        !	\object objRefP: Reference object for calculation.
        !	\num rayP: Option to specify a radius parameter instead of the object.
        !	\num overflow: Overrides speed by a specified percentage.
        ! Return
        !	Returns speeddata for axis orientation to achieve a result similar to the linear movement specified in setVelR.
        ! Usage Example
        !	MODULE ModPRG()
        !		RECORD object
        !			num width ;
        !			num length ;
        !			num height ;
        !		ENDRECORD
        !
        !	    PERS speeddata myVel := [7000, 7000, 5000, 1000];
        !	    VAR object obj;
        !	    VAR num radius;
        !
        !	    PROC main()
        !	        obj := [100, 200, 0];
        !	        radius := 100;
        !
        !	        AdjustVOriWithVTCP(myVel\objRefP := obj);     ! >>~ myVel := [7000, 3587.28, 5000, 1000]
        !	        AdjustVOriWithVTCP(myVel\rayP := radius);     ! >>~ myVel := [7000, 4010.7, 5000, 1000]
        !	        AdjustVOriWithVTCP(myVel);                    ! >>~ myVel := [7000, 700, 5000, 1000] -> v_tcp*0.1
        !	        AdjustVOriWithVTCP(myVel\overflowP := 80);    ! >>~ myVel := [7000, 560, 5000, 1000] -> v_tcp*0.1*0.8
        !	    ENDPROC
        !	ENDMODULE
        !
        PROC AdjustVOriWithVTCP(\switch FULL,INOUT speeddata setVelR\object objRefP\num rayP\num overflowP)
            ! ## ATTRIBUTES ##############################################################################
            VAR num overflowL:=1;
            ! ## ATTRIBUTES ##############################################################################
    
    
            ! Checks whether to set the maximum speed for reorientation...
            IF Present(FULL) THEN
                setVelR.v_ori:=setVelR.v_tcp;
            ELSE
                ! Checking speedup and limiting it to 300%...
                IF Present(overflowP) THEN
                    IF overflowP>300 THEN
                        Add overflowL,overflowP/100;
                    ELSE
                        Add overflowL,300/100;
                    ENDIF
                ENDIF
    
                ! Calculate the speed...
                IF Present(objRefP) THEN
                    ! Radius = Hypotenuse / 2
                    ! Angular Velocity (degrees/s) = (Linear Velocity (mm/s) / (2 * pi * Radius)) * 360
                    setVelR.v_ori:=(setVelR.v_tcp/(pi*Sqrt(Pow(objRefP.largura,2)+Pow(objRefP.comprimento,2)))*360)*overflowL;
                ELSE
                    IF Present(rayP) THEN
                        ! Using the radius value...
                        setVelR.v_ori:=(setVelR.v_tcp/(2*pi*rayP)*360)*overflowL;
                    ELSE
                        setVelR.v_ori:=(setVelR.v_tcp*0.1)*overflowL;
                    ENDIF
                ENDIF
            ENDIF
    
            RETURN ;
        ERROR
            ! #############################################################################################
            ! HANDLING POSSIBLE ERRORS
            ! #############################################################################################
    
            ! If you encountered an error while dividing by ZERO...
            IF ERRNO=ERR_DIVZERO THEN
                IF Present(FULL) THEN
                    setVelR.v_ori:=setVelR.v_tcp;
                ELSE
                    setVelR.v_ori:=(setVelR.v_tcp/(pi*Sqrt(Pow(1,2)+Pow(1,2)))*360)*overflowL;
                ENDIF
    
                RETURN ;
            ENDIF
        ENDPROC

    Good Job.