User Tools

Site Tools


2_link_kinematics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
2_link_kinematics [2018/09/27 00:39] – [Numerical Simulation - MatLab] ntorresreyes2_link_kinematics [2018/09/27 01:12] (current) – [Graphical Simulation] ntorresreyes
Line 293: Line 293:
 ==== Graphical Simulation ==== ==== Graphical Simulation ====
 \\ \\
-Matlab can be used to produce a graphical simulation of the 2-link arm mechanism for a given angle.+Matlab can be used to produce a graphical simulation of the 2-link arm mechanism for a given angle. Many of these simulations are based on the [[http://petercorke.com/wordpress/toolboxes/robotics-toolbox|Robotics Toolbox]] created by Peter Corke for Matlab. The link contains information on how to download the toolbox and install into Matlab. The [[https://robotacademy.net.au/masterclass/inverse-kinematics-and-robot-motion/?lesson=256|Robot Academy]] also has resources on using the Robotics Toolbox for inverse kinematics. 
 +\\ 
 +\\ 
 +The following code can be used to model a planar 2-link arm. Many of the functions behind the arm use the same theory and math covered previously in the tutorial.
 \\ \\
 \\ \\
 <code> <code>
 +>>mdl_planar2 
 +>>p2.plot(qz)
 </code> </code>
 +Which results in the following image:
 +\\
 +\\
 +{{:torres:tutorials:2_link_tutorial_22.png?nolink&450|}}
 +\\
 +\\
 +Next, a translation can be made and inverse kinematics applied:
 +\\
 +\\
 +<code>
 +>> T = transl(1.5,0.5,0)
 +T =
 +    1.0000                    1.5000
 +            1.0000            0.5000
 +                    1.0000         0
 +                            1.0000
 +>> q = p2.ikine(T,'mask',[1 1 0 0 0 0])
 +q =
 +   -0.3373    1.3181
 +>> p2.plot(q)
 +</code>
 +Which will plot the arm with the joint angles that will result in the end-effector having a position of (1.5, 0.5)
 +\\
 +\\
 +{{:torres:tutorials:2_link_tutorial_23.png?nolink&450|}}
 +\\
 \\ \\
 +By changing the T matrix with different values of transl(x,y,0), and using the inverse kinematic function, one can obtain the joint angle values for any possible position and simulate them graphically in the easiest way possible.
 ==== Final Words ==== ==== Final Words ====
  
 \\ \\
-TBA+Hopefully, the information presented in this tutorial is enough for the reader to gain a good understanding of the background, theory, and practical knowledge required to apply this to a 2-link planar robot arm and possibly a 3-link planar arm.
 \\ \\
 \\ \\
2_link_kinematics.txt · Last modified: 2018/09/27 01:12 by ntorresreyes