# Rotate tcp around z-axis

Netherlands
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).

Thanks
p

• Denmark
The tool0 Is a fixed coordinate system, that can not be modified and will always be in the same position relative to the robot.
• Netherlands
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
• Denmark
Do you mean as a robot movement or to make a new tool?
• Netherlands
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
• Denmark
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;

• Netherlands
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
• Denmark
Nice:-)

can't see you video though...
• Netherlands
Oh sorry, it look like the link got messed up. This is the correct link to the video.
• Burlington, MA
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
• Burlington, MA
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??
• United States ✭✭✭
Use Reltool function
Lee Justice