八、轨迹规划:掌握三次曲线插值规划机器人运动,给定边界条件,会求三次曲线函数
考虑在一定时间内将工具从初始位置移动到目标位置的问题,应用逆运动学接触对应目标位置的每个关节的关节角,同样我们也知道初始位置每个关节的关节角,在 t 0 t_{0} t0时刻对应关节的初始位置,在 t f t_{f} tf时刻对应关节的目标位置,用三次光滑函数对关节角进行插值。
通过选择初始值和最终值可得到对函数值的两个约束条件:
θ
(
0
)
=
θ
0
θ
(
t
f
)
=
θ
f
\begin{aligned} &\theta(0)=\theta_{0} \\ &\theta\left(t_{f}\right)=\theta_{f} \end{aligned}
θ(0)=θ0θ(tf)=θf
另外两个约束条件需要保证关节速度函数连续,即在初始时刻和终止时刻关节速度为零。
θ
˙
(
0
)
=
0
θ
˙
(
t
f
)
=
0
\begin{aligned} &\dot{\theta}(0)=0 \\ &\dot{\theta}\left(t_{f}\right)=0 \end{aligned}
θ˙(0)=0θ˙(tf)=0
我们设三次多项式为
θ
(
t
)
=
a
0
+
a
1
t
+
a
2
t
2
+
a
3
t
3
\theta(t)=a_{0}+a_{1} t+a_{2} t^{2}+a_{3} t^{3}
θ(t)=a0+a1t+a2t2+a3t3
所以对应于该路径的关节速度和加速度显然有
θ
˙
(
t
)
=
a
1
+
2
a
2
t
+
3
a
3
t
2
θ
¨
(
t
)
=
2
a
2
+
6
a
3
t
\begin{aligned} &\dot{\theta}(t)=a_{1}+2 a_{2} t+3 a_{3} t^{2} \\ &\ddot{\theta}(t)=2 a_{2}+6 a_{3} t \end{aligned}
θ˙(t)=a1+2a2t+3a3t2θ¨(t)=2a2+6a3t
把这四个期望的约束条件代入式中,可以得到含有四个未知量的四个方程:
θ
0
=
a
0
θ
f
=
a
0
+
a
1
t
f
+
a
2
t
f
2
+
a
3
t
f
3
0
=
a
1
0
=
a
1
+
2
a
2
t
f
+
3
a
3
t
f
2
\begin{aligned} \theta_{0} &=a_{0} \\ \theta_{f} &=a_{0}+a_{1} t_{f}+a_{2} t_{f}^{2}+a_{3} t_{f}^{3} \\ 0 &=a_{1} \\ 0 &=a_{1}+2 a_{2} t_{f}+3 a_{3} t_{f}^{2} \end{aligned}
θ0θf00=a0=a0+a1tf+a2tf2+a3tf3=a1=a1+2a2tf+3a3tf2
解出方程中的
a
i
a_{i}
ai,可以得到
a
0
=
θ
0
a
1
=
0
a
2
=
3
t
f
2
(
θ
f
−
θ
0
)
a
3
=
−
2
t
f
3
(
θ
f
−
θ
0
)
\begin{aligned} &a_{0}=\theta_{0} \\ &a_{1}=0 \\ &a_{2}=\frac{3}{t_{f}^{2}}\left(\theta_{f}-\theta_{0}\right) \\ &a_{3}=-\frac{2}{t_{f}^{3}}\left(\theta_{f}-\theta_{0}\right) \end{aligned}
a0=θ0a1=0a2=tf23(θf−θ0)a3=−tf32(θf−θ0)
这样我们可以求出从任何起始关节角位置到期望终止位置的三次多项式,但是该解法仅适用于起始关节角速度与终止关节角速度均为零的情况。
Exp.1:一个具有旋转关节的单杆机器人,处于静止状态时, θ = 1 5 ∘ \theta=15^{\circ} θ=15∘。期望在3s内平滑地运动关节角至 θ = 7 5 ∘ \theta=75^{\circ} θ=75∘。求出满足该运动的一个三次多项式的系数,并且使操作臂在目标位置为静止状态。画出关节的位置、速度和加速度随时间变化的函数曲线.
将已知条件代入式中,可以得到
a
0
=
15.0
a
1
=
0.0
a
2
=
20.0
a
3
=
−
4.44
\begin{aligned} &a_{0}=15.0 \\ &a_{1}=0.0 \\ &a_{2}=20.0 \\ &a_{3}=-4.44 \end{aligned}
a0=15.0a1=0.0a2=20.0a3=−4.44
然后我们即可得到位置、速度和加速度的函数
θ
(
t
)
=
15.0
+
20.0
t
2
−
4.44
t
3
θ
˙
(
t
)
=
40.0
t
−
13.33
t
2
θ
¨
(
t
)
=
40.0
−
26.66
t
\begin{aligned} &\theta(t)=15.0+20.0 t^{2}-4.44 t^{3} \\ &\dot{\theta}(t)=40.0 t-13.33 t^{2} \\ &\ddot{\theta}(t)=40.0-26.66 t \end{aligned}
θ(t)=15.0+20.0t2−4.44t3θ˙(t)=40.0t−13.33t2θ¨(t)=40.0−26.66t
出自:机器人导论:轨迹规划(点此进入)