Lite / Intelligent Robotic Systems / Week 17
Motion profiles: getting there smoothly
The fastest way from A to B is 'full speed, then stop'. Why does no real lift, robot or train move like that?
Why should I care?
Knowing where to go (IK) isn't enough; a robot must also decide how to get there over time. Motors have torque limits, payloads slosh, passengers feel jolts. A motion profile plans position, speed and acceleration together so the move is fast but feasible. The trapezoid is the workhorse of industry.
- Interpolate a position linearly between two points at constant velocity.
- Plan a trapezoidal profile with speed and acceleration limits and compute its duration.
- Recognise when a short move becomes a triangular profile.
Predict
A joint must move 2 rad with top speed 1 rad/s and acceleration limit 1 rad/s². How long does the trapezoidal move take?
- 2 s
- 3 s
- 4 s
- 1 s
Guess first, then reveal
3 s. Each ramp takes v/a = 1 s and covers 0.5 rad, leaving 1 rad of cruise at 1 rad/s (1 s). Total 1 + 1 + 1 = 3 s. The constant-velocity version would claim 2 s, but needs infinite acceleration at both ends.
Discover
Start with D = 2 m, v = 1 m/s, a = 1 m/s² and check the 3 s prediction. Then shrink D until the trapezoid becomes a triangle: at what distance does that happen? Finally raise a: what happens to the trapezoid's duration as a gets very large?
What the interactive shows (text version)
The profile comparer plots position against time (top) and speed against time (bottom) for a constant-velocity move (dashed orange: speed jumps instantly) and a trapezoidal move (solid blue: speed ramps up, cruises, ramps down). The readout gives both durations, the ramp and cruise times, and both positions at the chosen time.
Understand
Linear interpolation
The simplest trajectory: x(t) = x0 + (x1 − x0)·(t/T) for 0 ≤ t ≤ T. Constant speed |x1 − x0|/T the whole way. It's perfect for planning where to be in the middle of a move, but at t = 0 and t = T the speed jumps instantly, which would need infinite acceleration.
The trapezoid
Accelerate at the limit a until reaching the speed limit v, cruise, then decelerate at a to stop exactly at the target. The speed-time graph is a trapezoid; its area is the distance. Position during the first ramp is ½at²; during the cruise, v²/(2a) + v(t − ta); during the final ramp, D − ½a(T − t)².
Triangles and beyond
Short moves never reach v: the trapezoid collapses to a triangle. And the trapezoid still has instant jumps in acceleration (jerk), felt as a small jolt; lifts and precision machines use S-curves that also limit jerk, at the cost of a little more time. The Elevator Build's planner shows that next step.
Explain it another way
Intuitive
Driving between traffic lights: you pull away smoothly, hold a steady speed, then brake smoothly to stop at the line. You'd never floor it and slam on the brakes with a cup of tea on the dashboard.
Technical
A trapezoidal profile is the time-optimal bang-coast-bang solution under symmetric acceleration and velocity bounds. Its acceleration is piecewise constant (+a, 0, −a); jerk is unbounded at the switching instants.
Mathematical
D = 6.5 rad, v = 1.5 rad/s, a = 0.5 rad/s²: ta = 3 s, ramp distance 2.25 rad each, cruise 2 rad (1.333 s). T = 6.5/1.5 + 1.5/0.5 = 4.333 + 3 = 7.333 s.
Applied
CNC machines, 3D printers and robot arm controllers all plan trapezoidal or S-curve profiles for every move; the 'acceleration' setting in a 3D printer's firmware is exactly the a in these equations.
Derivation: Duration of a trapezoidal move
Ramp up from rest at acceleration a to speed v: time ta = v/a, distance ½·a·ta² = v²/(2a).
Ramp down is the mirror image: another v/a seconds and v²/(2a) metres.
Cruise covers the rest, D − v²/a, at speed v, taking (D − v²/a)/v = D/v − v/a seconds. This needs D ≥ v²/a.
Total: T = 2·(v/a) + D/v − v/a = D/v + v/a. The extra v/a, compared with D/v, is the price of smoothness.
If D < v²/a there's no room to cruise: the profile is a triangle with peak speed √(D·a) and duration 2√(D/a).
Worked example 1
D = 5.5 rad, a = 0.5 rad/s², v = 0.5 rad/s. Where is the joint at t = 6 s?
ta = 1 s, ramp distance 0.25 rad, T = 5.5/0.5 + 1 = 12 s. At t = 6 s it's cruising: 0.25 + 0.5 × (6 − 1) = 2.75 rad.
Common mix-ups
Raising the speed limit always makes the move faster by the same proportion.
✓ T = D/v + v/a: for short moves the ramps dominate, and a higher v can barely help (or the move is a triangle anyway).A trapezoidal profile is perfectly smooth.
✓ Its speed is continuous, but its acceleration jumps; S-curves smooth that too.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
A camera slider must cross 1.2 m in under 3 s without the camera's acceleration exceeding 1 m/s². Choose a speed limit, plan the trapezoid and check it in the comparer. Then look at the Elevator Build's S-curve planner and compare the trip time.
Reflect
Where in daily life have you felt a 'trapezoid' (or a bad, jerky profile)? What would you change?
Write your answer on paper or in your own notes. Lite never stores what you write.
Go further
- Motion planning (Wikipedia)
The wider field of planning paths and trajectories.