2_link_kinematics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
2_link_kinematics [2018/09/20 19:16] – [Motivation and Audience] ntorresreyes | 2_link_kinematics [2018/09/25 22:09] – [Background and Theory] ntorresreyes | ||
---|---|---|---|
Line 10: | Line 10: | ||
<!-- Add a representative photo of your tutorial below. | <!-- Add a representative photo of your tutorial below. | ||
- | {{ torres: | + | {{ torres: |
\\ | \\ | ||
Line 29: | Line 29: | ||
\\ | \\ | ||
The rest of this tutorial is presented as follows: | The rest of this tutorial is presented as follows: | ||
+ | * Homogeneous Transformations | ||
* Background And Theory | * Background And Theory | ||
* Analytical Solution | * Analytical Solution | ||
Line 38: | Line 39: | ||
This section provides a short background of the problem and basic theory used. | This section provides a short background of the problem and basic theory used. | ||
+ | \\ | ||
+ | \\ | ||
+ | ** Homogeneous Transformations ** | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | In this case, we will only consider 2-dimensional homogeneous transformations. First, we must introduce homogeneous coordinates: | ||
+ | \\ | ||
+ | \\ | ||
+ | Vector v = [x y w]< | ||
+ | \\ | ||
+ | \\ | ||
+ | These coordinates are useful in applying rotations and translations and make transformations simpler than in Cartesian coordinates. | ||
+ | We can apply an elementary rotation about the z-axis (normal to the page) with matrix: | ||
+ | \\ | ||
+ | \\ | ||
+ | [R< | ||
+ | \\ | ||
+ | \\ | ||
+ | Where < | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | A translation vector **p** = p< | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Next, the translation matrix can be multiplied by the rotation matrix to obtain the complete homogeneous transformation matrix: | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | To obtain the coordinates for a given point **p** in frame B relative to frame A, the transformation matrix is multiplied by the vector of **p** in frame B. For example, in Matlab: | ||
+ | \\ | ||
+ | \\ | ||
+ | < | ||
+ | theta = 30*(pi/ | ||
+ | Px = 2; Py = 3; | ||
+ | PframeB = [1; 4; 1]; | ||
+ | T = [cos(theta) -sin(theta) Px; ... | ||
+ | | ||
+ | 0 0 1]; | ||
+ | |||
+ | PframeA = T*PframeB | ||
+ | |||
+ | PframeA = | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | In the above example, frame B is translated in the (x,y) direction of frame A by (2,3) and rotated counter-clockwise by 30 degrees along the z-axis. The **p** vector in frame B has coordinates (1, 4) and the same vector in frame A has coordinates (0.8660, 6.9641). | ||
\\ | \\ | ||
\\ | \\ | ||
Line 72: | Line 133: | ||
\\ | \\ | ||
---- | ---- | ||
+ | < | ||
clear; clc; format compact; | clear; clc; format compact; | ||
- | L1 = 1; \\ | + | L1 = 1; |
L2 = 1; | L2 = 1; | ||
- | L(1) = Link([0 0 L1 0]); \\ | + | L(1) = Link([0 0 L1 0]); |
L(2) = Link([0 0 L2 0]); | L(2) = Link([0 0 L2 0]); | ||
- | TwoLink_arm = SerialLink(L, | + | TwoLink_arm = SerialLink(L, |
+ | </ | ||
---- | ---- | ||
The code above in Matlab creates a planar 2-link robotic arm class with arbitrary link lengths. From this, many functions can be used to do simulations and numerical analysis. For example, forward and inverse kinematics can be easily calculated. The code below translates the end-effector in the x-axis only and creates a transformation matrix. The ' | The code above in Matlab creates a planar 2-link robotic arm class with arbitrary link lengths. From this, many functions can be used to do simulations and numerical analysis. For example, forward and inverse kinematics can be easily calculated. The code below translates the end-effector in the x-axis only and creates a transformation matrix. The ' | ||
\\ | \\ | ||
---- | ---- | ||
- | T = transl(1, | + | < |
+ | T = transl(1, | ||
T = | T = | ||
| | ||
Line 91: | Line 155: | ||
| | ||
| | ||
- | >> q = TwoLink_arm.ikine(T,' | + | >> q = TwoLink_arm.ikine(T,' |
q = | q = | ||
1.0472 | 1.0472 | ||
- | >> p = TwoLink_arm.fkine(q) | + | >> p = TwoLink_arm.fkine(q) |
p = | p = | ||
Line 101: | Line 165: | ||
| | ||
| | ||
+ | </ | ||
\\ | \\ |
2_link_kinematics.txt · Last modified: 2018/09/27 01:12 by ntorresreyes