亿迅智能制造网
工业4.0先进制造技术信息网站!
首页 | 制造技术 | 制造设备 | 工业物联网 | 工业材料 | 设备保养维修 | 工业编程 |
home  MfgRobots >> 亿迅智能制造网 >  >> Manufacturing Technology >> 自动化控制系统

计算 6 轴机器人的欧拉角


空间方向如何用欧拉角表示?

如果您使用六轴机器人手臂,例如本教程中使用的 Mecademic Meca500,您很可能对定位其工具(末端执行器)感兴趣 ) 在不同的方向。换句话说,您需要能够对机器人进行编程,使其末端执行器同时移动到所需位置和所需方向(即移动到所需的姿势 ).当然,您始终可以微动机器人的末端执行器或手动将其引导到大致所需的姿势,但这种所谓的在线编程方法 很乏味而且非常不精确。离线计算和定义所需姿势效率更高。此外,为了定义工具参考系 与您的末端执行器相关联(如此处显示的图像所示),您需要计算该工具参考系相对于法兰参考系的姿态 .
在3D空间中,你至少需要六个参数来定义一个姿势。例如,机器人末端执行器的位置,或者更准确地说是 TCP (工具中心点 ), 通常定义为 x , yz 工具参考系原点相对于世界参考系的坐标 .但是,您如何定义空间方向?

空间方向的表示是一个复杂的问题。 欧拉旋转定理 指出,在 (3D) 空间中,以刚体上的点保持固定的方式进行的刚体的任何位移都等效于绕通过固定点的轴的单次旋转。因此,这种旋转可以用三个独立的参数来描述:两个用于描述轴,一个用于描述旋转角度。然而,空间方向可以用其他几种方式表示,每种方式各有优缺点。其中一些表示使用的参数超过了必要的最少三个参数。

从一个笛卡尔 (3D) 参考系 F 转换位置坐标的最常见方法 ,对另一个,F' , 是旋转矩阵 .因此,这个 3×3 矩阵可用于表示参考系 F' 的方向 关于参考系 F .然而,这种表示虽然经常是必要的,但我们稍后会发现,它并不是定义方向的紧凑和直观的方式。
另一种定义方向的更紧凑的方式是四元数 .这种表示形式由四个标量的归一化向量组成。四元数通常用于机器人控制器,因为它不仅比旋转矩阵更紧凑,而且不易受到近似误差的影响。此外,在两个不同方向之间的插值过程中,四元数的元素不断变化,避免了三维参数化(如欧拉角)中固有的不连续性。然而,四元数很少用作用户和机器人控制器之间的通信方式,因为它不直观。

欧拉角的详细定义

到目前为止,在 CAD 软件或机器人控制器中向用户传达空间方向或允许用户定义方向的最常用方法是使用欧拉角 .由于术语欧拉角经常被误用,我们准备了这个交互式教程。

欧拉角是三个角的集合(或者更确切地说是一个序列),例如可以表示为 α , β , 和 γ . (通常,欧拉角用 roll 表示 , 推介偏航 .) 欧拉角定义如下:考虑两个笛卡尔右手 3D 参考系,其中一个将被任意称为固定 框架和另一个将被称为移动 框架。这两个参考系最初重合。要定义第三个框架的方向(所有三个框架共享相同的原点),移动框架按如下所示的顺序通过旋转移动框架与第三个框架重合

  1. 关于 x , y , 或 z 固定框架的轴或 x' , y' , 或 z' 移动框架,由 α 学位,
  2. 然后关于 x , y , 或 z 固定框架的轴或 x' , y' , 或 z' 移动框架,由 β 学位,
  3. 最后是x , y , 或 z 固定框架的轴或 x' , y' , 或 z' 移动框架,γ 学位。

完成三个旋转的顺序很重要。因此,我们总共有 216 (6 3 ) 可能的序列:xz , yz , zz , x’→yz , y’→yz , z'→yz ,等等。但是,三个旋转的序列,其中两个连续旋转围绕同一轴(例如,yz ) 无法描述一般方向。此外,在第一次轮换之前,xx 重合 ‘, yy 一致 ‘, 和 zz 重合 ‘。因此,在所有这 216 种组合中,只存在 12 个独特的有意义的有序旋转序列,或者 12 个欧拉角约定 :XYX, XYZ, XZX, XZY, YXY, YXZ, YZX, YZY, ZXY, ZXZ, ZYX, ZYZ。
也就是说,十二种组合中的每一种都相当于其他三个序列。换句话说,每个欧拉角惯例都可以用四种不同的方式来描述。例如,ZYX 约定等同于序列 zx , x '→y '→z ‘, yz '→xyxz ‘。幸运的是,没有人用序列描述欧拉角,其中一些旋转是关于移动框架轴的,而另一些是关于固定轴的(例如,像 y 这样的序列 →z '→xyxz ').
因此,虽然有十二种不同的欧拉角约定,但通常以两种不同的方式描述每一种约定:要么作为围绕固定坐标系轴的旋转序列,要么作为围绕固定坐标系轴的旋转序列移动框架。因此,谈论固定和移动约定可能很方便,尽管它们是等价的。 For example, the fixed XYZ Euler angle convention is described by the xyz  sequence, while the mobile ZYX Euler angle convention is described by the z’y’x’  sequence, but both are equivalent, as we will see later.
In robotics, FANUC and KUKA use the fixed XYZ Euler angle convention, while ABB uses the mobile ZYX Euler angle convention. Furthermore, Kawasaki, Omron Adept Technologies and Stäubli use the mobile ZYZ Euler angle convention. Finally, the Euler angles used in CATIA and SolidWorks are described by the mobile ZYZ Euler angle convention.

At Mecademic, we use the mobile XYZ Euler angle convention, and therefore describe Euler angles as the sequence x ‘→y ‘→z ‘. Why be different? The reason is that we used to offer a mechanical gripper for handling axisymmetric workpieces (see video), which was actuated by the motor of joint 6. A six-axis robot equipped with such a gripper can only control two rotational degrees of freedom, or more specifically the direction of the axis of joint 6, that is to say the direction of the axis of symmetry of the workpiece. In the chosen Euler angle convention, angles α  and β  define this direction, while angle γ  is ignored because it corresponds to a parasitic rotation that is uncontrollable.
Our applet below will help you understand Euler angles. You can select one of the twelve possible Euler angle conventions by clicking on the x, y, and z boxes of the first, second and third rotation. (The default Euler angle sequence is the one used by Mecademic.) To switch between rotations about the axes of the fixed or mobile frames, you need to double-click on any of these nine boxes. The axes of the fixed frame are drawn in gray while the axes of the mobile frame are in black. Axes x  and x ‘ are drawn in red, y  and y ‘ in green, and z  and z ‘ in blue. Gliding along any of the three blue horizontal arrows with your mouse changes the corresponding Euler angle. Alternatively, you can directly set the Euler angle value (in degrees) in the corresponding textbox bellow the arrow. Finally, you can drag your mouse over the reference frame to change the viewpoint.


α  :

β  :

γ  :

R  = R x(0°) R y(0°) R z(0°) =
1.000 0.000 0.000
0.000 1.000 0.000
0.000 0.000 1.000

Calculating Euler angles via rotation matrices

With the above applet, you will see the orientation of the mobile frame with respect to the fixed frame, for a given set of Euler angles, in the far right subfigure. Unfortunately, however, in practice, the situation is usually the opposite. You frequently have two reference frames, and you want to find the Euler angles that describe the orientation of one frame with respect to the other.
For orientations in which at least two axes are parallel, you could attempt to guess the Euler angles by trial and error. For example, look back at the image at the beginning of this tutorial and try to find the Euler angles used by Mecademic that define the orientation of the tool reference frame associated with the gripper, with respect to the flange reference frame. The answer is α  = −90°, β  = 0°, γ  = −90°. Not so easy to get, is it? To be more efficient therefore, you must learn about rotation matrices after all.
As we have already mentioned, any orientation in space can be represented with a 3×3 rotation matrix. For example, a rotation of α  about the axis x , a rotation of β  about the axis y , and a rotation of γ  about the axis z , respectively correspond to the following three rotation matrices:

R x(α ) =
1 0 0
0 cos(α ) −sin(α )
0 sin(α ) cos(α )
 ,
R y(β ) =
cos(β ) 0 sin(β )
0 1 0
−sin(β ) 0 cos(β )
 ,
R z(γ ) =
cos(γ ) −sin(γ ) 0
sin(γ ) cos(γ ) 0
0 0 1
 .

We will refer to the above matrices as basic rotation matrices . To obtain the product of basic rotation matrices that corresponds to a sequence of rotations, start by writing the basic rotation matrix corresponding to the first rotation. For example, if the first rotation is about the x  (or x ‘) axis, then write R x(ψ ), where ψ  is the angle of rotation. For every subsequent rotation, post-multiply (right multiply) the current result with the next rotation matrix, if the rotation is about an axis of the mobile reference frame, or pre-multiply (left multiply) the current result with the next rotation matrix, if the rotation is about an axis of the fixed reference frame. Use our applet to see the resulting product of basic rotation matrices. For example, the rotation sequence x ‘→y ‘→z ‘ corresponds to the product R  = R x(α )R y(β )R z(γ ). Thus, the rotation matrix that corresponds to the Euler angles used by Mecademic is:

R (αβγ ) =
cos(β )cos(γ ) −cos(β )sin(γ ) sin(β )
cos(α )sin(γ ) + sin(α )sin(β )cos(γ ) cos(α )cos(γ ) − sin(α )sin(β )sin(γ ) −sin(α )cos(β )
sin(α )sin(γ ) − cos(α )sin(β )cos(γ ) sin(α )cos(γ ) + cos(α )sin(β )sin(γ ) cos(α )cos(β )
 .

Therefore, for a given orientation, you will need to do two things:First, you need to find the rotation matrix that corresponds to your orientation. Second, you need to extract the Euler angles using a couple of simple equations. Let us first show you two ways to find your rotation matrix.
Consider the example shown in the figure below where we need to find the rotation matrix representing the orientation of frame F’  with respect to frame F . (Recall that we always represent the x  axis in red, the y  axis in green, and the z  axis in blue.)

Here, it is easy to see that if we align a third reference frame with the F , which will act as a mobile frame, then rotate this frame about its z ‘ axis at θ  degrees, and then rotate it about its y ‘ axis at φ  degrees, we will obtain the orientation of F . Thus, the rotation matrix we are looking for is:

R desired = R z(θ )R y(φ ) =
cos(θ )cos(φ ) −sin(θ ) cos(θ )sin(φ )
sin(θ )cos(φ ) cos(θ ) sin(θ )sin(φ )
−sin(φ ) 0 cos(φ )
 .

Alternatively, we can obtain the above rotation matrix directly. Its first, second and third columns represent the coordinates of the unit vectors along the xy  and z  axis, respectively, of frame F’ , with respect to frame F .
Now that you have the rotation matrix that represents your desired orientation, you simply need to solve the system of nine scalar trigonometric equations R desired = R (αβγ ), for αβ , and γ . Fortunately, this problem has a generic solution and we’ll simply give you the equations to use.
Let the desired orientation of a frame F’  with respect to a frame F  be represented by the following rotation matrix:

R desired =
r 1,1 r 1,2 r 1,3
r 2,1 r 2,2 r 2,3
r 3,1 r 3,2 r 3,3
 .

The Euler angles (in degrees), in keeping with the mobile XYZ convention used by Mecademic, are then obtained according to the following two cases:
Case 1:  r 1,3 ≠ ±1 (i.e., the z’  axis of frame F’  is not parallel to the x  axis of frame F ).

β  = asin(r 1,3),   γ  = atan2(−r 1,2, r 1,1),   α  = atan2(−r 2,3, r 3,3).

Case 2:  r 1,3 = ±1 (i.e., the z’  axis of frame F’  is parallel to the x  axis of frame F ).

β  = r 1,390°,   γ  = atan2(r 2,1, r 2,2),   α  = 0.

In the general Case 1, we actually have two sets of solutions where all angles are in the half-open range (−180°, 180°]. However, it is useless to calculate both sets of solutions, so only the first is presented, in which −90° < β  < 90°. Also, note that we use the function atan2(y, x) in our solution. Beware that in some programming languages, in some scientific calculators and in most spreadsheet software, the arguments of this function are inverted.
Finally, note that Case 2 corresponds to a so-called representation singularity . This singularity is present in any three-parameter representation of orientation in 3D space (not only in Mecademic’s choice of Euler angles). It is similar to the problem of representing points on a sphere by only two parameters. For example, longitude is not defined on Earth at the South and North Poles on the Earth. In other words, this singularity has nothing to do the singularities of mechanisms (e.g., the so-called gimbal lock ), which correspond to actual physical problems (e.g., the loss of a degree of freedom).

Exercice

Consider the following real-life situation that occured to us. We wanted to attach a FISNAR dispensing valve to the end-effector of our Meca500 robot arm. Naturally, the engineer who designed and machined the adapter didn’t care about Euler angles and was only concerned with machinability and reachability. In his design, there were essentially two rotations of 45°. Firstly, he used two diametrically oposite threaded holes on the robot flange to attach the adapter, which caused the first rotation of 45°. Secondly, the angle between the flange interface plane and the axis of the dispenser was 45°.

The figure above shows the actual installation (left) and the tool frame (right) that needed to be defined. Note that when using axi-symmetric tools, it is a common practice to allign the tool z-axis with the axis of the tool. This is particularly useful with the mobile XYZ Euler angle convention, since the redutant rotation about the axi-symmetric tool corresponds to the third Euler angle, γ. Thus, the first two Euler angles define the axis of the tool, while the third one can be used to choose the optimal configuration of the robot (i.e., far from singularities).

Returning to our example, we will show now that it is impossible to come up with the Euler angles according to the mobile XYZ convention by trial and error. Indeed, for this choice of tool reference frame, we can represent the final orientation as a sequence of the following two rotations: R  = R z(45°)R y(45°). From here, we can extract the Euler angles according to the mobile XYZ convention using the equations previously described and obtain: α  = −35.264°, β  = 30.000°, γ  = 54.735°. Are you convinced now that you do need to master Euler angles for situations like this?

Representational singularities and orientation errors

In the case of the mobile XYZ Euler angle convention, if the z’  axis of frame F’  is parallel to the x  axis of frame F , there are infinite pairs of α  and γ  that will define the same orientation. Obviously, you only need one to define your desired orientation, so we have arbitrarily set α  to be equal to zero. More specifically, if β  = 90°, then any combination of α  and γ , such than α + γ = φ , where φ is any value, will correspond to the same orientation, and be output by Mecademic’s controller as {0,90°,φ}. Similarly, if β  = −90°, then any combination of α  and γ , such that α − γ = φ , where φ is any value, will correspond to the same orientation, and be output by Mecademic’s controller as {0,−90°,−φ}. Note, however, that if you try to represent the orientation of a frame F’  with respect to a frame F  and the z’  axis of frame F’  is almost parallel to the x  axis of frame F  (i.e., β is very close to ±90°), the Euler angles will be very sensitive to numerical errors. In such a case, you should enter as many digits after the decimal point as possible when defining the orientation using Euler angles.
Consider the following situation which has caused worries to several users of our Meca500. You set the orientation of the tool reference frame with respect to the world reference frame to {0°, 90°, 0°}, which is a representational singularity. Then you keep this orientation and move the end-effector in space to several positions. At some positions, because of numerical noise, the controller does not detect the condition r 1,3 = ±1 (Case 2, as mentioned above) and calculates the Euler angles as if the orientation did not correspond to a representational singularity. Thus, the controller returns something like {41.345°, 90.001°, −41.345°}, which seems totally wrong and very far away from {0°, 90°, 0°}. Well it’s not.
Unlike position errors, which are measured as √(Δx 2  + Δy 2  + Δz 2 ), orientation errors are not directly related with the variations in the Euler angles, especially close to representational singularities. To better understand this so-called non-Euclidean nature of Euler angles, consider the spherical coordinates used to represent a location on Earth. At the North Pole, the latitude is 90° (North), but what is the longitude? Longitude is not defined at the North Pole, or it can be any value. Now imagine that we move only 1 mm away from the North Pole in the direction of Greenwich. In this case, the latitude will be 89.99999999°, but the longitude will now have the value of 0°. Imagine once again that you return to the North Pole and move 1 mm in the direction of Tokyo. The new longitude will be approximately 140°. Between your two locations, the error in longitude is 140°! However, the real angular error will be approximately 0.00000002°.
The situation described above is similar in all other Euler angles conventions. Depending on the Euler angle convention, the correspoding representation singularity occurs when a specific axis of frame F’  is parallel to another specific axis of frame F . In such a representation singularity, the first and third rotation become dependant.
In conclusion, unless you master Euler angles (or use sophisticated offline programming software), and more specifically the convention used for programming your robot, you will hardly be able to program anything but simple pick and place operations. Because robotics is not simple, we do our best to help you understand the basics.


Looking For Industrial Automation Parts? We Can Help!

SHOP PARTS


自动化控制系统

  1. 注塑成型:新型小型 6 轴机器人
  2. 机器人在 NPE:更快、更强、更智能
  3. 'Artistic' Robot At NPE
  4. 让机器人保持忙碌
  5. 低成本、高速组装机器人
  6. 在美国组装的机器人夹持器
  7. 机器人问题?自动化答案
  8. 自动化:重新设计的机器人生产线
  9. 通用机器人迎来新总统
  10. 小型、快速的六轴机器人
  11. SCARA 机器人生产线扩展
  12. 全球机器人密度几乎翻倍