1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. ABB Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Quaternion calculations

  • Jleon89
  • October 23, 2024 at 2:23 PM
  • Thread is Unresolved
  • Jleon89
    Reactions Received
    2
    Trophies
    3
    Posts
    50
    • October 23, 2024 at 2:23 PM
    • #1

    I'm trying to figure out the best way for a customer to make minor tweaks to a drop position without having the robot physically move to the drop position because the tool is hot and will begin to warp the end of arm tool on the robot after too much exposure. Altering the X,Y,Z coordinates is easy just measure the finished part and add or subtract the value in the program data. But when it comes to the rotation, I was hoping to be able to do the same and just add or subtract the appropriate number of degrees or radians, but the rotational data is stored in a Quaternion form and therefore would at the very least require several complex calculations that would have to be done on the fly.

    So I have 2 questions:

    1. Why does ABB use this, what is the benefit of using this Quaternion system vs simple pitch, roll, yaw coordinates? I understand how to calculate it, it just seems like an unnecessary extra step and very difficult if not impossible to go the other way.

    2. What would be the best way to set this up? I need the customer to be able to manually adjust the X, Y, Z, pitch, roll, yaw from the teach pendant without having to reverse engineer the Quaternion coordinates if possible.

  • Lemster68
    Reactions Received
    301
    Trophies
    9
    Posts
    2,493
    Blog Articles
    7
    • October 23, 2024 at 5:34 PM
    • #2

    Use the reltool function for your drop position. It already features the roll pitch yaw which you are wanting. As for why they use quaternions, I don't know.

  • gmumaugh
    Reactions Received
    13
    Trophies
    2
    Posts
    65
    • October 23, 2024 at 5:54 PM
    • #3

    Quaternions are much more computationally efficient than Euler angles and avoid some problems that arise when describing a rotation with Eulers. However, they are unitless, they only describe a given orientation. You can't "rotate by X quaternions", which is why all offset functions still accept Euler angles to build a new set of quaternions.

    If you want to understand them more, I would recommend reading the section on the orient data type in the RAPID Instructions, Functions, and Data Types reference manual, which describes how quaternions are calculated. There are also several examples of quaternions being used for spatial rotation, like this one: https://en.wikipedia.org/wiki/Quaternio…patial_rotation

  • Jleon89
    Reactions Received
    2
    Trophies
    3
    Posts
    50
    • October 24, 2024 at 5:19 PM
    • #4
    Quote from Lemster68

    Use the reltool function for your drop position. It already features the roll pitch yaw which you are wanting. As for why they use quaternions, I don't know.

    does Reltool redefine the position data? if for example i use MoveL Reltool (Drop_point, 0, 0, 50), v100, fine, tool1; it will stop 50mm above the drop point but Drop_point will still be stored at the original position, correct?

  • DS186
    Reactions Received
    201
    Trophies
    6
    Posts
    1,078
    • October 24, 2024 at 5:58 PM
    • #5
    Quote from Jleon89

    does Reltool redefine the position data? if for example i use MoveL Reltool (Drop_point, 0, 0, 50), v100, fine, tool1; it will stop 50mm above the drop point but Drop_point will still be stored at the original position, correct?

    That is correct. RelTool won't modify the data stored in your position. Keep in mind: RelTool is an offset relative to the active tool frame.

  • Lemster68
    Reactions Received
    301
    Trophies
    9
    Posts
    2,493
    Blog Articles
    7
    • October 24, 2024 at 6:46 PM
    • #6

    If you wanted to, Reltool can manipulate a position. For example, p10 := Reltool(p20,0,0,50);

    But I understand that this is not what you want to do, it is just for informational purposes.

  • Jleon89
    Reactions Received
    2
    Trophies
    3
    Posts
    50
    • October 24, 2024 at 7:21 PM
    • #7
    Quote from DS186

    That is correct. RelTool won't modify the data stored in your position. Keep in mind: RelTool is an offset relative to the active tool frame.

    how does the Offs command work in comparison? Would that offset the position relative to the active work object? I think that's what I need and that would explain why my +25 in the z value is driving it deeper into the part rather than further away.

  • Lemster68
    Reactions Received
    301
    Trophies
    9
    Posts
    2,493
    Blog Articles
    7
    • October 24, 2024 at 8:52 PM
    • #8

    Yes, offset is in the workobject coordinate system. But it will not allow for the orientation change that you requested. However, those two function can be used together or in succession.

    example:

    p20:= Offset(pDrop, 0, 0, 25);

    p30:= RelTool(p20,0,0,0\Rz:=10);

    OR p20:=Offset(Reltool(pDrop,0,0,0\Rz:=10);

    OR p20:=RelTool(Offset(pDrop,0,0,5)\Rx:=0\Ry:=0\Rz:=10);

    Sounds like fun, doesn't it?

  • DS186
    Reactions Received
    201
    Trophies
    6
    Posts
    1,078
    • October 24, 2024 at 9:11 PM
    • #9

    Offs is relative to the work object. You can use Offs, RelTool or a combination of both.

  • Mr.Robot
    Reactions Received
    6
    Trophies
    3
    Posts
    65
    • October 26, 2024 at 11:09 AM
    • #10
    Quote from Jleon89

    1. Why does ABB use this, what is the benefit of using this Quaternion system vs simple pitch, roll, yaw coordinates? I understand how to calculate it, it just seems like an unnecessary extra step and very difficult if not impossible to go the other way.

    Euler angles make you do three separate turns (one for each axis). Quaternions combine it into a single, smooth turn around a specific direction, which keeps things simple and fast, especially for computers.

  • MathewWallbank
    Reactions Received
    2
    Trophies
    1
    Posts
    21
    • October 28, 2024 at 2:50 AM
    • #11

    orientation an positional data of a robot target are stored independantly and can be changed as such. a searched (like searchL or seachC) or a camera pos value... or updated target declared as a variable or persistant can have its orientation changed with the following:

    (heres the declared data)

    CONST robtarget mydropositionROTZ30:=[[211.75,662.28,351.74],[0.060461,-0.374626,-0.872132,-0.308844],[-1,0,0,0],[0.0476658,9E+09,9E+09,9E+09,9E+09,9E+09]];

    PERS robtarget mydropposition:=[[228,732,272],[0.003551,0.034379,-0.946917,-0.319617],[-1,0,-1,0],[0.0456902,9E+09,9E+09,9E+09,9E+09,9E+09]];

    CONST pose ROTZ30:=[[0,0,0],[0,0,0.707107,-0.707107]];

    CONST orient orient1 := [1, 0, 0, 0];

    You can set the rotation value from another robot target like this:

    mydropposition.rot:=mydropositionROTZ30.rot;

    or Alternately you can record or calculate a pose value and update it like this:

    mydropposition.rot:=ROTZ30.rot;

    or you can record or calculate just the orientation (quaternion) like this:

    mydropposition.rot:=orient1;


    as they said above there is an instruction to convert euler angles into quaterions

    VAR num anglex;
    VAR num angley;
    VAR num anglez;
    VAR pose mydroppose;
    .
    mydroppose.rot := OrientZYX(anglez, angley, anglex)

    if you were somehow measuring those rotations or just wanted to input them from a table or something like that.


    anyway good luck

  • LogicNode
    Trophies
    3
    Posts
    3
    • November 13, 2024 at 10:09 PM
    • #12

    Why not create customized code for your customer?

    I put together an instructions for you. This was done quickly, so I haven't syntax-tested it, and there might be minor errors. Good luck with your project!

    Code
    MODULE myModule
      CONST robtarget rPos1:=[[1,2,3],[1,0,0,0],[1,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
    
      PROC MyCustomL(robtarget ToPoint, num X, num Y, num Z, num Yaw, num Pitch, num Roll, speeddata Speed, zonedata Zone, PERS tooldata Tool\ PERS wobjdata Wobj)
        MoveL [ToPoint.trans+[X,Y,Z],OrientZYX(Roll+EulerZYX(\Z,ToPoint.rot),Pitch+EulerZYX(\Y,ToPoint.rot),Yaw+EulerZYX(\X,ToPoint.rot)),ToPoint.robconf,ToPoint.extax], Speed, Fine, Tool \Wobj?Wobj;
      ENDPROC
    
      PROC UseMyCustomL()
        ! Go to original position
        MyCustomL rPos1, 0, 0, 0, 0, 0, 0, v100, fine, tool0;
        ! Displace X 50mm and change roll to 90 degrees
        MyCustomL rPos1, 50, 0, 0, 0, 0, 90, v100, fine, tool0;
        ! Lets go wild and change all coordinates and angles
        MyCustomL rPos1, 100, -30, 55, 5, 10, 15, v100, fine, tool0;
      ENDPROC
    ENDMODULE
    Display More

    Edited once, last by LogicNode (November 14, 2024 at 5:43 AM).

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Similar Threads

  • General conversion between different coordinate system types (KUKA, Fanuc, ABB, etc)

    • SkyeFire
    • January 7, 2022 at 5:36 PM
    • Robot Geometry, Linear Algebra, Forward and Inverse Kinematics
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download