機械手臂建模基礎:使用Python利用DH參數求解關節轉換矩陣

D-H參數的求解

這個是我們機器人末端執行器進行一系列分析的基礎

Visual Servoing Platform官網下載

Visual Servoing Platform官網下載
Linux中 anaconda 啓動其終端命令行

$ source ~/anaconda3/bin/activate root
$ anaconda-navigator

轉換矩陣的求解

Python 轉換矩陣的求解
比較簡單,一步一步跟着做就好

(base) warmtree@warmtree-HP-Pavilion-Laptop-15-cc5xx:~$ python3
Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy as sp
>>> from sympy.physics.vector import init_vprinting
>>> init_vprinting(use_latex='mathjax', pretty_print=False)
>>> from IPython.display import Image
>>> Image('fig/2rp_new.png', width=300)
<IPython.core.display.Image object>
>>> from sympy.physics.mechanics import dynamicsymbols
>>> theta1, theta2, l1, l2, theta, alpha, a, d = dynamicsymbols('theta1 theta2 l1 l2 theta alpha a d')
>>> theta1, theta2, l1, l2, theta, alpha, a, d 
(theta1, theta2, l1, l2, theta, alpha, a, d)
>>> rot = sp.Matrix([[sp.cos(theta), -sp.sin(theta)*sp.cos(alpha), sp.sin(theta)*sp.sin(alpha)],
...                  [sp.sin(theta), sp.cos(theta)*sp.cos(alpha), -sp.cos(theta)*sp.sin(alpha)],
...                  [0, sp.sin(alpha), sp.cos(alpha)]])
>>> rot
Matrix([
[cos(theta), -sin(theta)*cos(alpha),  sin(alpha)*sin(theta)],
[sin(theta),  cos(alpha)*cos(theta), -sin(alpha)*cos(theta)],
[         0,             sin(alpha),             cos(alpha)]])
>>> trans = sp.Matrix([a*sp.cos(theta),a*sp.sin(theta),d])
>>> trans
Matrix([
[a*cos(theta)],
[a*sin(theta)],
[           d]])
>>> last_row = sp.Matrix([[0, 0, 0, 1]])
>>> m = sp.Matrix.vstack(sp.Matrix.hstack(rot, trans), last_row)
>>> m
Matrix([
[cos(theta), -sin(theta)*cos(alpha),  sin(alpha)*sin(theta), a*cos(theta)],
[sin(theta),  cos(alpha)*cos(theta), -sin(alpha)*cos(theta), a*sin(theta)],
[         0,             sin(alpha),             cos(alpha),            d],
[         0,                      0,                      0,            1]])
>>> m01 = m.subs({alpha:0, a:l1, theta:theta1, d:0})
>>> m01
Matrix([
[cos(theta1), -sin(theta1), 0, l1*cos(theta1)],
[sin(theta1),  cos(theta1), 0, l1*sin(theta1)],
[          0,            0, 1,              0],
[          0,            0, 0,              1]])
>>> 

Different Approach to Solving Inverse Kinematics

anarytic solution

Wrist的作用

A wrist where the three axes of rotation intersect is called a spherical wrist. These have the advantage that the mathematical model used to calculate the wrist joint angles from their position and orientation in space is soluble.

One problem in achieving spherical wrist design is the physical difficulty of fitting all the components into the available space. The size of the human wrist is small because the muscles which power it are located in the forearm, not in the wrist. Wrist design is a complex task, involving conflicting goals. Desirable features of a wrist include:-small size-axes close together to increase mechanical efficiency-tool plate close to the axes to increase strength and precision-soluble mathematical model-no singularities in the work volume-back-driving to allow programming by teach and playback-decoupling between motions around the three axes-actuators mounted away from the wrist to allow size reduction-paths for end effector control and power through the wrist-power proportionate to the proposed task-rugged housing.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章