Rotate Robot
Samucha
✭
in RobotStudio
Hi, All
I have many questions. I get Position X , Position Y, Angle of component from camera,but I don't know how to use command(Rapid) for robot move to new Position.
I know I can use command MoveL offs( ... ); for move new position x ,y .But I don't know how to use command for Rotate(Angle).
Ex. Values from camera Delta x = 10 mm. , Delta y = 20 mm. , Delta Angle = 5°
I use
MoveL Offs(robot_cur,10,20,0),v100,fine,tool0;
I sorry if you understand, I use google translate.
Thank for help.
I have many questions. I get Position X , Position Y, Angle of component from camera,but I don't know how to use command(Rapid) for robot move to new Position.
I know I can use command MoveL offs( ... ); for move new position x ,y .But I don't know how to use command for Rotate(Angle).
Ex. Values from camera Delta x = 10 mm. , Delta y = 20 mm. , Delta Angle = 5°
I use
MoveL Offs(robot_cur,10,20,0),v100,fine,tool0;
I sorry if you understand, I use google translate.
Thank for help.
0
Comments
-
Hello Samucha
I understand that you want to rotate the position after you have made an offset.
Please read the help section about orient in RobotStudio.
It its possible to use OrientZYX(anglez, angley, anglex) instead of the object orient1 if needed.VAR robtarget p20;
VAR orient orient1;<div>orient1 := [0.707, 0, 0.707, 0];</div><div> </div><div>p20 := CRobT(\Tool:=tool0\wobj:=wobj0);</div><div>p20 := Offs(p20,10,0,0);</div><div><b>p20.rot := orient1; // </b><b>p20.rot := OrientZYX(30,30,30); Hope it was the answer you're looking for /Oskar</b></div>
1 -
Hi, OskarHenriksson
Thanks for reply.<b>p20.rot := OrientZYX(30,30,30); 30 is Angle ? If I want to rotate z-axis only. What is command to use? </b><pre class="CodeBlock"><b></b>But I try this command p20.rot<b> :=</b> OrientZYX(30,0,0); . It not work. <span>Thanks for help.</span> </pre>
0 -
Example:PERS robtarget p10:=[[423.76,413.882,0],[3.78552E-08,0.866025,0.5,2.18557E-08],[0,2,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];VAR num anglex;VAR num angley;VAR num anglez;PROC main()!Get current angles for p10anglex:=EulerZYX(\X,p10.rot);angley:=EulerZYX(\Y,p10.rot);anglez:=EulerZYX(\Z,p10.rot);p10.rot:=OrientZYX(anglez,angley,anglex);MoveJ p10,v1000,z50,tool0\WObj:=wobj0;WaitRob\InPos;p10.rot:=OrientZYX(anglez+30,angley,anglex);MoveJ p10,v1000,z50,tool0\WObj:=wobj0;WaitRob\InPos;
ENDPROC1 -
Check out the RelTool function... this will allow you to use a position and optional rotation in degreesBasic examplesThe following examples illustrate the function RelTool.Example 1MoveL RelTool (p1, 0, 0, 100), v100, fine, tool1;The robot is moved to a position that is 100 mm from p1 in the z direction of the tool.Example 2MoveL RelTool (p1, 0, 0, 0 \Rz:= 25), v100, fine, tool1;The tool is rotated 25° around its z-axis.1
-
try to combine offset and reltool in the same command
MoveL Offs(RelTool(robot_cur,0,0,0\Rx:=0\Ry:=0\Rz:=5),10,20,0),v100,fine,tool0;
0 -
It depends if you want to use the "active tool coordinate system" or "object coordinate system". In case of the "active tool coordinate system", then you can use the function RelTool as stated above.
In your first post you indicate using the function Offs for translation, which uses the "object coordinate system". If this is also the case for the rotations, i would recommend just quaternion multiplications. Remark, you have to be careful in which order you apply the rotations, for example the function "RelTool" and "OrientZYX" uses the ZYX order. You can think of a function like this:<div> FUNC robtarget Angle(robtarget Point,num Rx,num Ry,num Rz,\switch ZYX|switch XYZ|switch ZXY)<br></div><div> VAR robtarget PointRot;<br></div><div> VAR orient rot;<br><div class="post-text-align-left"><br></div></div><div> ! copy robtarget<br></div><div> PointRot:=Point; </div><div><br></div><div> ! rotate 180 degrees around x-axis to get "object coordinate system<br></div><div> PointRot.Rot:=Point.rot*OrientZYX(0,0,180); </div><div><br></div><div> ! choose rotation order and define rotation<br></div><div> IF present(XYZ) THEN<br></div><div> rot:=OrientZYX(0,0,Rx)*OrientZYX(0,Ry,0)*OrientZYX(Rz,0,0);<br></div><div> ELSEIF present(ZXY) THEN<br></div><div> rot:=OrientZYX(Rz,0,0)*OrientZYX(0,0,Rx)*OrientZYX(0,Ry,0);<br></div><div> ELSE<br></div><div> ! OrientZYX uses the order: rotation around Z-axis, rotation around the new Y-axis, rotation around the new X-axis<br></div><div> rot:=OrientZYX(Rz,Ry,Rx);<br></div><div> ENDIF<br></div><div><br></div><div> ! apply rotation and rotate back 180 degrees around x-axis<br></div><div> PointRot.Rot:=PointRot.Rot*rot*OrientZYX(0,0,180);<br></div><div><br></div><div> ! return rotated robtarget<br></div><div> RETURN PointRot;<br></div><div> ENDFUNC</div>
1
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings