6.3.6 Velocity Profile

Given a distance $D$ to travel, a robot needs to plan for acceleration, constant velocity travel, and deceleration.

Given what we know from 6.6 that the distance for acceleration is $D_\mathrm{accel}=\frac{{v_\mathrm{max}}^2}{2{a_\mathrm{max}}}$. It takes the same distance to stop. In other words, the total distance to accelerate and decelerate is $D_\mathrm{ramp}=\frac{{v_\mathrm{max}}^2}{{a_\mathrm{max}}}$. What is $D < D_\mathrm{ramp}$?

If this is the case, it means that we need to stop accelerating and immediately begin deceleration before we reach ${v_\mathrm{max}}$.

Instead of predetermining the speed profile, we can do the following (in pseudocode). Assume $v$ is the current velocity.


\begin{algorithmic}
\IF{$\frac{v^2}{2{a_\mathrm{max}}} \ge D$}
\STATE start de...
...athrm{max}}$
\ELSE
\STATE stop acceleration
\ENDIF
\ENDIF
\end{algorithmic}

Sometimes it is necessary to change the target velocity. As a result, we usually want to use another term, ${v_\mathrm{set}}$, to represent the desired velocity. But this means that the current velocity can exceed ${v_\mathrm{set}}$. Our logic needs to be modified as illustrated in algorithm 1. Note that in this algorithm, $D$, ${v_\mathrm{set}}$ can both be changed dynamically.


\begin{algorithm}
% latex2html id marker 843\begin{algorithmic}
\IF{$D=0$}
...
...l velocity and acceleration based on
remaining displacement}
\end{algorithm}

Note that this code also handles positive and negative $D$ and ${v_\mathrm{set}}$.

In a program, $v$ should be replaced by ${f_{\mathrm{step}}}$, and ${v_\mathrm{set}}$ should be replaced by an appropriate frequency term. Furthermore, the acceleration term should be replaced by ${f_{f_{\mathrm{step}}\pm 1}}$, and ${a_\mathrm{max}}$ replaced by an appropriate frequency term determined by experiment.

Note that algorithm 1 should be executed independent of the stepping logic, but within the same tick. This logic should also be invoked whenever $D$ or ${v_\mathrm{set}}$ is changed.

Copyright © 2006-02-15 by Tak Auyeung