Showing posts with label Kinematics. Show all posts
Showing posts with label Kinematics. Show all posts

Wednesday, January 9, 2013

Rotations in 3D space using Euler angles

Rotations in 3D space to relate body reference frame of a device to world reference frame using an Euler angle sequence are discussed. Euler stated that

Any two independent orthonormal coordinate frames can be related by a sequence of rotations (not more than three) about coordinate axes, where no two successive rotations may be about the same axis.
The illustration of the world reference frame, {M}, and the body reference frame, {B}, is shown in the following figure.

Pan angle rotation, α, is acquired using computer vision. And, tilt angle rotation, β, and roll angle rotation, γ, are acquired by sensing the gravity, g, using onboard accelerometers. Let us consider the roll angle first, assuming there are no pan and tilt angles. When the roll angle, γ, is zero Y-axis is upward vertical and X-axis is horizontal pointing according to right handed rule. The gravity sensed by X-axis accelerometer and Y-axis accelerometer are denoted by gx and gy respectively. The definition of the roll angle is illustrated in the following figure.
The roll angle, γ, is calculated as

$$ \gamma = \tan^{-1}\frac{gx}{gy} $$.

Then, it is checked for second and third quadrants as
if(gy<0)
  if(gx>=0)
    γ=π+γ;
  else
    γ=-π+γ;
  end
end
The roll angle rotation matrix, Rγ, is obtained as follows.

$$ \mathbf{R}_{\gamma}= \begin{bmatrix} \cos(\gamma) & -\sin(\gamma) & 0 \\ \sin(\gamma) & \cos(\gamma) & 0 \\ 0 & 0 & 1 \end{bmatrix}$$

After the roll angle is corrected, let us consider for tilt angle. The definition of the tilt angle is illustrated in the following figure.
The tilt angle, β, can be calculated from Y and Z components of the gravity. It is important to note that these gravity component values should be in the roll angle rotated frame. The new values for the gravity components are obtained as

$$ \begin{bmatrix} gx2 \\ gy2 \\ gz2 \end{bmatrix} = \mathbf{R}_{\gamma} \begin{bmatrix} gx \\ gy \\ gz \end{bmatrix} $$

The tilt angle, β, is calculated as
$$\beta = \tan^{-1}\frac{gy2}{gz2} $$.
Then, it is checked for second and third quadrants as
if(gz2>=0)
  if(gy2>=0)
    β=-π+β;
  else
    β=π+β;
  end
end
The tilt angle rotation matrix, Rβ, is obtained as follows.

$$ \mathbf{R}_{\beta}= \begin{bmatrix} 1 & 0 & 0\\ 0 & \cos(\gamma) & -\sin(\gamma) \\ 0 & \sin(\gamma) & \cos(\gamma) \end{bmatrix}$$

Similarly, calculation of the pan angle rotation matrix, Rα, and description of pan angle definition are as follows.

$$ \mathbf{R}_{\alpha}= \begin{bmatrix} \cos(\alpha) & -\sin(\alpha) & 0 \\ \sin(\alpha) & \cos(\alpha) & 0 \\ 0 & 0 & 1 \end{bmatrix}$$

The product of rotation matrices is itself a rotation matrix. $$ \mathbf{R}=\mathbf{R}_{\alpha} \mathbf{R}_{\beta} \mathbf{R}_{\gamma}$$
And, M=RB
Since R is a rotation matrix, inverse of R is obtained by transposing R. The implementation of this 3D rotation in LabVIEW using MabLab code is shown in the following figure.

Quaternion algebra is also easy and popular approach for such 3D transformation.

Reference:
Kuipers, Jack B., Quaternions and rotation sequences : a primer with applications to orbits, aerospace, and virtual reality, Princeton University Press, 1999, ISBN: 0691058725.

Thursday, May 5, 2011

Degrees of Freedom of the Human Arm

Have you ever think how many degrees of freedom the human arm has (excluding palm and fingers)? I would like to share a short excerpt from a book by Saeed Benjamin Niku, Introduction to Robotics -Analysis, Control, Applications. The shoulder, the elbow, and the wrist are three joint clusters in the human arm. The shoulder has 3 degrees of freedom. The upper arm can swing up and down in the coronal plane. It can also swing back and forth in the transverse plane. And rotation with respective to the axis along humerus can be done also. The following is the illustration of human anatomy planes from Wikipedia.

The elbow has only 1 degree of freedom- flexing and extending. The wrist has 3 degrees of freedom -up and down, and side to side, and rotation of forearm with respective to the axis along ulna. Therefore, the human arm has a total of 7 degrees of freedom.

Friday, March 4, 2011

Simple 6 DOF Translation and Rotation Stages

I had the requirement to control a device in 6 degrees of freedom (DOF). There were 3 motorized translation stages to control the position of the tool in 3D space and 3 rotary motorized stages to control its orientation. Although it could be thought as a robot arm having 3 prismatic joints and 3 revolute joints, I did not want to involve complex forward and inverse kinematics for this simple testing equipment.

Here is an example transformation. By arranging rotational axes of rotary motorized stages to intersect at the tool, a simple direct 6 DOF control could be achieved. The following figures show schematic diagram and 3D drawing for the equipment that I designed.

Tuesday, February 22, 2011

Denavit-Hartenberg Representation of Robots

The D-H model of representation is a simple way of modeling robot links and joints that can be used for any robot configuration. We will have to assign a z-axis and an x-axis for each link. The D-H representation does not use the y-axis at all. Let Lk be the frame associated with link k.




1. Define Z Axis from All Joints

From the axis of joint k+1, define the zk axis for link k. If the joint is revolute, the z axis is in the direction of rotation as followed by the right hand rule for the rotations. If the joint is prismatic, the z-axis for the joint is along the direction of the linear movement.

2. Define Origins

The intersection of the zk and zk-1 axes is selected as the origin of Lk . If they do not intersect, use the intersection of zk with a common normal between zk and zk-1. There is always one line mutually perpendicular to any two skew lines, called common normal, which is the shortest distance between them.

3. Define X-axis

Assign xk in the direction of the common normal between zk and zk-1. If z-axes are intersecting, select xk to be orthogonal to both zk and zk-1 (the direction of the cross-product of the two z-axes). If zk and zk-1 are parallel, point xk away from zk-1 colinear with the common normal of the previous joint.

4. Define Y-axis

Select yk to form a right-handed orthonormal coordinate frame Lk.

5. Define the Four Kinematic Parameters

k is defined as the angle between xk-1 and xk axes about the zk-1 axis. *dk is the distance between xk-1 and xk axes along zk-1 axis. *ak is the distance between zk-1 and zk axes along xk axis. *αk is the angle between zk-1 and zk axes about xk axis.

6. Transferring Frame k-1 to Frame k

*Rotation of Lk-1 about the zk-1 axis by θk will make xk-1 and xk parallel to each other. This is true because the common normals ak-1 and ak are both perpendicular to zk-1 axis. *Translation of Lk-1 along zk-1 axis a distance of dk will make xk-1 and xk colinear. *Translation of Lk-1 along xk axis a distance of ak will bring the origins of Lk-1 and Lk together. *Rotation of Lk-1 about xk axis by αk will make zk-1 and zk axes parallel. At this point, frames Lk-1 and Lk will be exactly the same.



For simulation, a nice free software called Robotassist can be downloaded at www.kinematics.com

Ref:
Introduction to Robotics -Analysis, Control, Applications; Second Edition, Saeed Benjamin Niku
Fundamental of Robotics -Analysis & Control, Robert J. Schilling