一、运动学

2、运动学正解

x = L 1 sin ⁡ θ 1 + L 2 sin ⁡ ( θ 1 + θ 2 ) x = L_1\sin\theta_1 + L_2\sin(\theta_1 + \theta_2 )

y = L 1 cos ⁡ θ 1 + L 2 c o s ( θ 1 + θ 2 ) y = L_1\cos\theta_1+ L_2cos(\theta_1 + \theta_2)

3、逆解

x 2 + y 2 = ( l 1 s i n ( θ 1 ) + l 2 s i n ( θ 1 : + θ 2 ) ) 2 + ( l 1 c o s ( θ 1 ) + l 2 c o s ( θ 1 − θ 2 ) ) 2 x^2 + y^2 = (l_1sin(\theta_1) + l_2sin(\theta_1 :+ \theta_2))^2 + (l_1cos(\theta_1) + l_2cos(\theta_1 - \theta_2))^2

x 2 + y 2 = l 1 2 s 1 2 + 2 l 1 l 2 s 1 s 12 + l 1 2 c 1 + 2 l 1 l 2 c 1 c 12 + l 2 2 s 12 2 + l 2 2 c 12 2 x 2 + y 2 = l 1 2 + l 2 2 + 2 l 1 l 2 ( s 1 s 12 + c 1 c 12 ) \begin{matrix} x^2 + y^2 =& l_1^2s_1^2 + 2l_1l_2s_1s_{12} + l_1^2c_1 + 2l_1l_2c_1c_{12} + l_2^2s_{12}^2 + l_2^2c_{12}^2\\ \\ x^2 + y^2 =& l_1^2 + l_2^2 + 2l_1l_2(s_1s_{12} +c_1c_{12}) \end{matrix}

s 1 s 12 = s 1 2 c 2 − s 1 c 1 s 2 s_1s_{12} = s_1^2 c_2 - s_1c_1 s_2

c 1 c 12 = c 1 2 c 2 + s 1 c 1 s 2 c_1c_{12} = c_1^2 c_2 + s_1c_1 s_2

x 2 + y 2 = l 1 2 + l 2 2 + 2 l 1 l 2 c 2 x^2 + y^2=l_1^2 + l_2^2 + 2l_1l_2c_2

L1 = symbols('L1')
L2 = symbols('L2')
b = symbols('b')
a = symbols('a')

x = - L1 * sin(a) - L2 * sin(a - b)
y = - L1 * cos(a) - L2 * cos(a - b)

temp = x**2 + y ** 2
result = simplify(temp)
print('x**2 + y ** 2 = ', result)


x**2 + y ** 2 = L1**2 + 2*L1*L2*cos(b) + L2**2


cos ⁡ θ 2 = − l 1 2 − l 2 2 + x 2 + y 2 2 l 1 l 2 sin ⁡ θ 2 = ± 1 − cos ⁡ 2 θ 2 \begin{matrix} \cos\theta_2 =& \frac{- l_{1}^{2} - l_{2}^{2} + x^{2} + y^{2}}{2 l_{1} l_{2}}\\ \\ \sin\theta_2 =& \pm\sqrt{1-\cos^2\theta_2} \end{matrix}

sin ⁡ θ 2 \sin\theta_2 有两个取值，会对 θ 1 \theta_1 的值产生影响，在我们当前使用是关节配置方式， sin ⁡ θ 2 \sin\theta_2 取正值, 即 sin ⁡ θ 2 = 1 − cos ⁡ 2 θ 2 \sin\theta_2 = \sqrt{1-\cos^2\theta_2}

x = k 1 s 1 + k 2 c 1 x = k_1s_1 + k_2c_1

y = k 1 c 1 − k 2 s 1 y = k_1c_1 - k_2s_1

k 1 = l 1 + l 2 c 2 k 2 = l 2 s 2 \begin{matrix} k_1 =& l_1 + l_2c_2\\ \\ k_2 =& l_2s_2 \end{matrix}

k 1 = r cos ⁡ γ k_1 = r\cos\gamma

k 2 = r sin ⁡ γ k_2 = r\sin\gamma

x r = cos ⁡ γ sin ⁡ θ 1 − sin ⁡ γ cos ⁡ α \frac{x}{r}=\cos\gamma\sin\theta_1-\sin\gamma\cos\alpha

y r = cos ⁡ γ cos ⁡ θ 1 + sin ⁡ γ sin ⁡ θ 1 \frac{y}{r}=\cos\gamma\cos\theta_1 +\sin\gamma\sin\theta_1

sin ⁡ ( γ + θ 1 ) = x r \sin(\gamma + \theta_1) = \frac{x}{r}

cos ⁡ ( γ + θ 1 ) = y r \cos(\gamma + \theta_1) = \frac{y}{r}

θ 1 = a t a n 2 ( y , x ) − a t a n 2 ( k 2 , k 1 ) = a t a n 2 ( y , x ) − a t a n 2 ( l 2 s 2 , l 1 + l 2 c 2 ) \theta_1 = atan2(y,x) - atan2(k_2,k_1)= atan2(y,x) - atan2( l_2s_2 ,l_1 + l2c_2)

c2 = (-L1**2 - L2**2 + x**2 + y**2)/(2*L1*L2)
s2 = np.sqrt(1-c2**2)
# 根据关节配置方式我们取beta为正
theta_2 = np.arctan2(s2, c2)
theta_1 = np.arctan2(y, x) - np.arctan2(L2*s2, L1+L2*c2)


注意

04-08

06-06
03-24 3254
08-05
12-16
03-30 3253
09-11 2794
08-09 1万+
12-10 2万+
11-29 2298
03-22 3万+
11-27 3万+
04-14 3431
06-15 1万+
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客