机械手臂建模基础:使用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.

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