Step 2
Smooth acceleration
Add two more boundary conditions to get a quintic: no jolt at the start or end of a move.
Builds on Linear systems: calibrate a camera, from the free Foundations.
A jolt at the start
Your cubic starts and ends at rest, but look at its acceleration:
At it leaps from nothing to , which is 2.7 rad/s² for a 1 rad move over 1.5 s. A sudden change in acceleration means infinite jerk: the motors are asked for an instant step in torque. A real arm feels that as a knock. It shakes the payload, sets the links vibrating and wears the gearboxes.
Two more conditions
Ask for zero acceleration at both ends as well. Six conditions need six coefficients, which gives a quintic:
Its acceleration, , starts at zero, swells, and fades back to zero. This is the minimum-jerk curve that move_joints and move_to used in Pick & Place.
| cubic | quintic | |
|---|---|---|
| boundary conditions | 4 | 6 |
| at the ends | ||
| peak speed |
The smoothness has a price: for the same duration the quintic has to move faster in the middle.
Seeing it
The starter plots the base joint's acceleration for both curves, measured as a second difference of each profile:
It streams whatever quintic returns, which for now is still the cubic.
Your task
Implement quintic(q0, qf, T, t) (vectors in, vector out, clamped as before) and stream the same three 1.5 s moves with it.
The graders average each joint's commanded acceleration over the first and last 30 ms of every move. It must stay under 1 rad/s². The cubic's jolt is two to three times that.