为什么机器人运动学逆解最好采用双变量反正切函数atan2而不用反正/余弦函数?

一、采用 a t a n 2 ( y , x ) atan2(y,x) atan2(y,x)的三点优势

  机器人运动学逆解最好采用双变量反正切函数 a t a n 2 atan2 atan2而不用反正/余弦函数 a s i n asin asin a c o s acos acos的原因主要有:
   1 1 1.反正弦函数 a s i n ( x ) asin(x) asin(x)的值域为 [ − π / 2 , π / 2 ] [-\pi/2,\pi/2] [π/2,π/2],反余弦函数 a c o s ( x ) acos(x) acos(x)的值域为 [ 0 , π ] [0,\pi] [0,π],而双变量反正切函数 a t a n 2 ( y , x ) atan2(y,x) atan2(y,x)的值域为 [ − π , π ] [-\pi,\pi] [π,π]。机器人关节角度范围一般在 [ − π , π ] [-\pi,\pi] [π,π]之间,采用 a t a n 2 ( y , x ) atan2(y,x) atan2(y,x)更加方便、直接,避免了额外的角度范围判断。
   2 2 2. a t a n 2 ( y , x ) atan2(y,x) atan2(y,x)相对于 a s i n ( x ) asin(x) asin(x) a c o s ( x ) acos(x) acos(x),对输入变量 x x x y y y具有更好的容错性。这里的容错性,主要是指由于计算精度的影响, x x x的实际计算值有可能稍微大于1或小于-1,这时 a s i n ( x ) asin(x) asin(x) a c o s ( x ) acos(x) acos(x)的值是未定义的,而 a t a n 2 ( y , x ) atan2(y,x) atan2(y,x)可以得到正确的结果。当然,我们也可以通过判断 x x x的值在计算误差范围内是否可以认为是-1或1,强制赋值为-1或1,从而解决这个问题。
   3 3 3.对于函数 y = f ( x ) y=f(x) y=f(x) x x x的误差 Δ x \Delta x Δx引起 y y y的误差为 Δ y ≈ f ′ ( x ) Δ x \Delta y\approx f'(x)\Delta x Δyf(x)Δx
  若 f ( x ) = a s i n ( x ) f(x)=asin(x) f(x)=asin(x),当 x ∈ ( − 1 , 1 ) x\in(-1,1) x(1,1)时, f ′ ( x ) = 1 1 − x 2 ∈ [ 1 , + ∞ ) f'(x)=\frac{1}{\sqrt{1-x^2}}\in[1,+\infty) f(x)=1x2 1[1,+)
  若 f ( x ) = a c o s ( x ) f(x)=acos(x) f(x)=acos(x),当 x ∈ ( − 1 , 1 ) x\in(-1,1) x(1,1)时, f ′ ( x ) = − 1 1 − x 2 ∈ ( − ∞ , − 1 ] f'(x)=\frac{-1}{\sqrt{1-x^2}}\in(-\infty,-1] f(x)=1x2 1(,1]
  若 f ( x ) = a t a n ( x ) f(x)=atan(x) f(x)=atan(x),当 x ∈ ( − ∞ , + ∞ ) x\in(-\infty,+\infty) x(,+)时, f ′ ( x ) = 1 x 2 + 1 ∈ ( 0 , 1 ] f'(x)=\frac{1}{x^2+1}\in(0,1] f(x)=x2+11(0,1]
  由于实际机器人的臂长、零点、减速比等运动学参数有误差,使用 a s i n ( x ) asin(x) asin(x) a c o s ( x ) acos(x) acos(x)误差会放大,从保证逆解精度均匀性来看,在求解机器人运动学逆解时宜采用 a t a n 2 ( y , x ) atan2(y,x) atan2(y,x)
atan2(y,x)

二、参考文献/资料

机器人动力学与控制 霍伟

猜你喜欢

转载自blog.csdn.net/maple_2014/article/details/104594261