Question 3 of 7: Two-segment cubic spline with continuous acceleration (20 marks)
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
Paper format. National Exams —
16-Mec-B12 Robot Mechanics, 3 hours, CLOSED BOOK, one 8.5″×11″ aid sheet
(both sides) and an approved calculator permitted. The paper runs in two sections: Section 1 holds
five questions of which the candidate answers only three, and Section 2 holds two
questions which are both compulsory. Each question is of equal value (20 marks),
and marks for each part are shown in parentheses. All seven questions are worked
here.
Reference texts. J. J. Craig, Introduction to Robotics: Mechanics and
Control, 4th ed. (this paper's leading-super/subscript notation, its modified DH
convention and its via-point spline formulae follow this text directly); M. W. Spong,
S. Hutchinson and M. Vidyasagar, Robot Modeling and Control, 2nd ed.; S. B. Niku,
Introduction to Robotics: Analysis, Control, Applications, 3rd ed.; K. M. Lynch and
F. C. Park, Modern Robotics, 1st ed.
Notation (from the exam's own nomenclature page). A leading superscript
names the frame a quantity is referenced to, so $^{A}V$ is the vector $V$ expressed in frame
$\{A\}$. A leading subscript together with a leading superscript names a transformation:
$^{B}_{A}T$ describes frame $\{A\}$ relative to frame $\{B\}$, and therefore maps
coordinates the other way, $^{B}P={}^{B}_{A}T\,{}^{A}P$. Keeping that direction straight is the
single most common source of lost marks on this paper, so every question below states explicitly
which way the given transform points.
The printed footer reads 16-Mec-B12/May 2019.
Check: sign convention for the revolute joint of Figure 3.
Figure 3 shows the direction of positive motion with a curved arrow but does not label a sense on
the base triad. Throughout Questions 6 and 7 the base frame is taken as $x_{0}$ along the
horizontal arm, $z_{0}$ vertically up and $y_{0}$ completing the right-handed set, with positive
$q_{2}$ following the right-hand rule about $+x_{0}$. Every result below is stated in that frame;
a candidate who assigns the opposite sense obtains the same magnitudes with
$q_{2}\rightarrow-q_{2}$.
Question 3: Two-segment cubic spline with continuous acceleration (20 marks)
Given. Three prescribed joint angles and two segment durations. Each segment
carries its own local time origin, so the second cubic is written in $t$ measured from the via
point, not from the start of the motion.
Given data
Quantity
Symbol
Value
initial angle (start of segment 1)
$\theta_{0}$
$-20^{\circ}$
via angle (end of 1 = start of 2)
$\theta_{v}$
$45^{\circ}$
goal angle (end of segment 2)
$\theta_{g}$
$25^{\circ}$
duration of segment 1
$t_{f1}$
$4\,\text{s}$
duration of segment 2
$t_{f2}$
$4\,\text{s}$
local start times
$t_{i1},\,t_{i2}$
$0,\;0$
Find. All eight coefficients $a_{10}\ldots a_{13}$ and $a_{20}\ldots a_{23}$
of the two cubics, together with the via-point velocity and acceleration that the continuity
conditions force on the path.
Figure 3.1 — the two-segment spline. Segment 1 (navy) accelerates from rest at $-20^{\circ}$ and crosses the via point at $45^{\circ}$ with a non-zero rate; segment 2 (teal) overshoots slightly, then decelerates to rest at the goal $25^{\circ}$. The dashed line marks the via point, where position, velocity and acceleration are all continuous.
Approach. Two cubics carry eight unknown coefficients, so exactly eight
constraints are needed: three prescribed angles (start, via, goal, the via counted once for each
segment), rest at both ends of the motion, and matching of velocity and of acceleration where the
segments join.
Write the two segments and their derivatives. With local time $t$ on each
segment,
$$\theta_{1}(t)=a_{10}+a_{11}t+a_{12}t^{2}+a_{13}t^{3},\qquad
\dot{\theta}_{1}=a_{11}+2a_{12}t+3a_{13}t^{2},\qquad
\ddot{\theta}_{1}=2a_{12}+6a_{13}t,$$
and identically for $\theta_{2}(t)$ with the coefficients $a_{20}\ldots a_{23}$. The manipulator
starts at rest and finishes at rest; nothing is prescribed about the rate at the via point, which
is precisely what makes a spline smoother than two independent cubics stitched together.
List the eight constraints. In order, they are
$\theta_{1}(0)=\theta_{0}$, $\theta_{1}(t_{f1})=\theta_{v}$, $\theta_{2}(0)=\theta_{v}$,
$\theta_{2}(t_{f2})=\theta_{g}$, $\dot{\theta}_{1}(0)=0$, $\dot{\theta}_{2}(t_{f2})=0$,
$\dot{\theta}_{1}(t_{f1})=\dot{\theta}_{2}(0)$ and
$\ddot{\theta}_{1}(t_{f1})=\ddot{\theta}_{2}(0)$. The last of these is the condition the
question names explicitly: it is what removes the torque step a merely velocity-continuous path
would demand of the actuator.
Read off the four constraints that solve themselves. Evaluating at the local
time origins gives $a_{10}=\theta_{0}$, $a_{11}=0$ and $a_{20}=\theta_{v}$ immediately, so
$$\boxed{a_{10}=-20^{\circ},\qquad a_{11}=0,\qquad a_{20}=45^{\circ}.}$$
Only five unknowns remain, and they are linear in the data.
Solve the remaining system. Because the two durations are equal,
$t_{f1}=t_{f2}=t_{f}=4\,\text{s}$, the system collapses to the standard closed form
$$a_{12}=\frac{12\theta_{v}-3\theta_{g}-9\theta_{0}}{4t_{f}^{2}},\qquad
a_{13}=\frac{-8\theta_{v}+3\theta_{g}+5\theta_{0}}{4t_{f}^{3}},\qquad
a_{21}=\frac{3(\theta_{g}-\theta_{0})}{4t_{f}},$$
$$a_{22}=\frac{-12\theta_{v}+6\theta_{g}+6\theta_{0}}{4t_{f}^{2}},\qquad
a_{23}=\frac{8\theta_{v}-5\theta_{g}-3\theta_{0}}{4t_{f}^{3}}.$$
Substituting $\theta_{0}=-20^{\circ}$, $\theta_{v}=45^{\circ}$, $\theta_{g}=25^{\circ}$ and
$t_{f}=4\,\text{s}$ gives, for the first segment,
$$a_{12}=\frac{540+(-75)+180}{64}=\frac{645}{64},\qquad
a_{13}=\frac{-360+75-100}{256}=-\frac{385}{256},$$
$$\boxed{a_{12}=10.0781\ \text{deg}\cdot\text{s}^{-2},\qquad
a_{13}=-1.5039\ \text{deg}\cdot\text{s}^{-3}.}$$
Finish the second segment. The same substitution gives
$$a_{21}=\frac{3(25+20)}{16}=\frac{135}{16},\qquad
a_{22}=\frac{-540+150-120}{64}=-\frac{255}{32},\qquad
a_{23}=\frac{360-125+60}{256}=\frac{295}{256},$$
$$\boxed{a_{21}=8.4375\ \text{deg}\cdot\text{s}^{-1},\qquad
a_{22}=-7.9688\ \text{deg}\cdot\text{s}^{-2},\qquad
a_{23}=1.1523\ \text{deg}\cdot\text{s}^{-3}.}$$
Notice that $a_{21}$ is not zero: the joint sweeps through the via point at
$8.4375\,\text{deg}\cdot\text{s}^{-1}$ rather than stopping there, which is the whole purpose of
splining two segments instead of running two separate point-to-point moves.
Check every constraint before quoting the answer. At $t=t_{f1}$ the first
cubic gives $-20+10.0781(16)-1.5039(64)=45^{\circ}$, its slope is
$2(10.0781)(4)+3(-1.5039)(16)=8.4375\,\text{deg}\cdot\text{s}^{-1}=a_{21}$, and its acceleration
is $2(10.0781)+6(-1.5039)(4)=-15.9375\,\text{deg}\cdot\text{s}^{-2}=2a_{22}$. At the end of the
second segment $\theta_{2}(4)=25^{\circ}$ and
$\dot{\theta}_{2}(4)=8.4375-63.75+55.3125=0$. All eight conditions are satisfied
exactly.
The path is worth reading as well as tabulating. Because the goal lies below the via point, the
second cubic must decelerate hard: it overshoots to $47.44^{\circ}$ at $t=0.610\,\text{s}$ after
the via point before falling back to the goal. That overshoot is a genuine property of a
cubic spline through a via point, not an arithmetic slip, and it is the reason a designer who
needs the tool to stay inside a corridor uses a higher-order or a linear-with-parabolic-blend
scheme instead.
Question 3 - spline coefficients
Segment
$a_{i0}$ (deg)
$a_{i1}$ (deg/s)
$a_{i2}$ (deg/s$^{2}$)
$a_{i3}$ (deg/s$^{3}$)
1, valid $0\le t\le 4\,\text{s}$
$-20$
$0$
$10.0781$
$-1.5039$
2, valid $0\le t\le 4\,\text{s}$
$45$
$8.4375$
$-7.9688$
$1.1523$
via-point rate $\dot{\theta}(t_{f1})$
$8.4375\ \text{deg}\cdot\text{s}^{-1}$
via-point acceleration $\ddot{\theta}(t_{f1})$
$-15.9375\ \text{deg}\cdot\text{s}^{-2}$ (identical on both sides)