赞
踩
如今最主流的机械臂分为串联式和并联式机械臂,本文主要举例为六轴串联式机械臂工作区间的计算方法
为什么要计算工作空间,工作空间和使用目的相关,当确定机械臂确定要完成某项任务,比如夹取1m外的小苹果时,就需要根据需求,设计或选购能满足该任务的机械臂,机械臂的工作空间就是其中一项指标。这里我提到的工作空间区别于灵巧度空间(dexterity space),只要求机械臂末端执行器能到达该坐标点即可。
可以参考工业中KUKA机械臂的表示方法,该六轴机械臂的工作空间分为左视图和俯视图,分别表示X-Z二维平面的最大运动轨迹,和Y-X二维平面的最大旋转角度,通过三个维度的信息就可以计算工作体积(volume):
相信大家可以看出,一般工业机械臂的旋转轴都在J1,所以图右非常显而易见,和J1的旋转角有关
而左边这张图呢,我这边是通过python枚举末端点坐标的方式,获得的,直接上代码显而易见,值得一提的是,在设计计算的时候需要对关节进行简化,只有在X-Z平面内做旋转(或者直线)运动的关节才被显示,否则可以根据设计做融合简化:
- import numpy as np
- import matplotlib.pyplot as plt
- import pandas as pd
-
- d12 = 91
- d23 = 92
- d35 = 160.7
- d56 = 155
- theta23_min = -90
- theta23_max = 76
- theta35_min = -109
- theta35_max = 109
- theta56_min = -124
- theta56_max = 124
-
- angleinterval23 = np.linspace(theta23_min, theta23_max, 8)
- angleinterval35 = np.linspace(theta35_min, theta35_max, 8)
- angleinterval56 = np.linspace(theta56_min, theta56_max, 8)
-
- result = []
- origin = [91, 0] # [x, y]
- num = 0
- # Press the green button in the gutter to run the script.
- if __name__ == '__main__':
- print("the value of angle 23 is: \n", angleinterval23)
- print("the value of angle 35 is: \n", angleinterval35)
- print("the value of angle 56 is: \n", angleinterval56)
- for i in range(len(angleinterval23)):
- x23 = origin[0]+d23*np.cos(angleinterval23[i]*np.pi/180)
- y23 = origin[1]+d23*np.sin(angleinterval23[i]*np.pi/180)
- for j in range(len(angleinterval35)):
- x35 = x23+d35*np.cos(angleinterval35[j]*np.pi/180)
- y35 = y23+d35*np.sin(angleinterval35[j]*np.pi/180)
- for k in range(len(angleinterval56)):
- x56 = x35+d56*np.cos(angleinterval56[k]*np.pi/180)
- y56 = y35+d56*np.sin(angleinterval56[k]*np.pi/180)
- result.append([x56, y56])
- plt.figure()
- plt.plot([x23, x35], [y23, y35], linewidth =2)
- plt.plot([x35, x56], [y35, y56], linewidth =2)
- plt.plot([0, 95], [0,0], linewidth=2)
- plt.plot([95, x23], [0, y23], linewidth=2)
- plt.plot(x23, y23, "ko")
- plt.plot(x35, y35, "ko")
- plt.plot(x56, y56, "ko")
- plt.xlim(-100, 600)
- plt.ylim(-500, 500)
- # filename = "{i}_{j}_{j}".format(i=i,j=j,k=k)
- filename = num
- num += 1
- plt.savefig("C:/Users/liuy93/PycharmProjects/MazorXworkspace/jepg/"+str(filename))
-
- result = pd.DataFrame(result)
- result.to_csv("coordinate.csv")

得到的奇怪的图如下(左侧角度没有做充分的线性规划,所以显得有些不规则):
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。