The answersDownload the PDF
Worksheet

U10.2 Velocity profiles

Following a trajectory · University · about 30 min

BugBotLab
NameClassDate

What this lesson is about

The trapezoid, the triangle when there is no room to reach cruise, and what jerk costs you.

Questions 7 marks in all

  1. [1 mark]A trapezoidal move covers 80 cm with an acceleration limit of 10 cm/s/s and a cruise speed of 15 cm/s. How long is the cruise (flat top) phase, in seconds to 2 decimal places?

  2. [1 mark]What does this print? It works out the whole duration of the same profile.

    D, A, V = 80.0, 10.0, 15.0
    t_acc = V / A
    d_acc = V * V / (2 * A)
    t_flat = (D - 2 * d_acc) / V
    print(round(2 * t_acc + t_flat, 2))
  3. [1 mark]The same limits (10 cm/s/s, 15 cm/s) are used for an 8 cm move. What peak speed does the profile reach, in cm/s to 2 decimal places?

  4. [1 mark]A trapezoid generator works on long moves, but every short move overshoots. What is the most likely bug?

    1. AIt always assumes a cruise phase, even when 2 d_acc does not fit inside the distance
    2. BThe acceleration limit is too low
    3. CIt samples the profile too often
    4. DThe deceleration ramp uses a different a from the acceleration ramp
  5. [1 mark]The BugBot's drive is a first order lag with a time constant of 0.25 s. Roughly what initial acceleration does a step command to 20 cm/s produce, in cm/s/s?

  6. [1 mark]The drive has no acceleration limit of its own. Which are good reasons to impose one anyway?

    Tick every answer that is true.

    1. ADemanding more than friction supplies makes the robot slip, which dead reckoning cannot see
    2. BA step demand is a current spike that can sag the battery and reset the robot
    3. CA profile the machine can follow leaves an error you can reason about
    4. DIt makes the move finish sooner than a step command would
    5. EThe drive rejects step commands above 10 cm/s
  7. [1 mark]A robot arm rings for a moment at the start and end of every trapezoidal move. What change addresses the cause?

    1. ALimit the jerk with an S-curve so the acceleration ramps instead of switching instantly
    2. BRaise the cruise speed so the move is over sooner
    3. CUse a triangle profile instead of a trapezoid
    4. DSample the trapezoid at a finer time step

The task: a trapezoidal profile

Build a trapezoidal profile that covers 80 cm with an acceleration limit of 10 cm/s/s and a cruise speed of 15 cm/s, sampled every 0.05 s. Plot v and s at every sample, with a wait(0.1) after every second one so the chart has a time axis (the simulator runs in 0.02 s steps, so a wait(0.05) would last 0.04 s), and print peak:, duration: and distance:, the last being the area under your own speed profile.

from bugbot import *
connect()

DISTANCE, A_MAX, V_MAX, DT = 80.0, 10.0, 15.0, 0.05

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/u10-2-velocity-profiles/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Ask for 8 cm with the same limits. Does your code produce a triangle, and is the peak sqrt(a * d)?
  2. Work out the peak acceleration a step command to 20 cm/s really produces, using the 0.25 s lag.
  3. Add a jerk limit by ramping the acceleration over 0.3 s at each corner. How much longer does the move take?