Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: trapezoidal triangular motion calcs
Date: Sun, 3 Feb 2008 03:57:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 62
Message-ID: <fo3e2e$gea$1@fred.mathworks.com>
References: <fnkquv$sge$1@fred.mathworks.com> <fnlaup$imv$1@fred.mathworks.com> <fntmc9$2ir$1@fred.mathworks.com> <fnu13k$5ur$1@canopus.cc.umanitoba.ca> <fnu1ue$6ul$1@canopus.cc.umanitoba.ca> <fnu80l$5vl$1@fred.mathworks.com> <fo35m9$d5p$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1202011022 16842 172.30.248.35 (3 Feb 2008 03:57:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 3 Feb 2008 03:57:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:448986


"Mark " <medwar19.nospam@hotmail.com> wrote in message <fo35m9$d5p
$1@fred.mathworks.com>...
> Hello,
> 
> Thanks for your time and method of dealing with 
> acceleration. I'm interested in writing a script that will 
> allow me to put any path and calculate a bunch of motion 
> parameters including the minimum velocity, accleration and 
> jerk that can be used to get round the path in a specific 
> time.
> 
> This is a common robotics problem that has proven harder to 
> solve that I expected.
> 
> Once again, I appreciate your time and insight.
> 
> Regards,
> 
> Mark.
-----------
  For any pair of successive points in your path, I am assuming you have three 
given quantities in advance: 1) D, the distance between the points, 2) T, the 
allowed time for making the trip, and 3) A, the maximum permissible 
acceleration and deceleration to be used along the way.  As I have previously 
indicated, the least possible maximum velocity is achieved by first 
accelerating at the maximum amount, A, for some as yet unknown time t and 
reaching maximum velocity v, then coasting at that constant velocity for time 
T-2*t, and finally decelerating at maximum -A for time t so as to come to a 
stop, with t being chosen so as to have traveled a total of D distance.

  Expressing this as an equation with t as the unknown, we get

 D = 1/2*A*t^2 + A*t*(T-2*t) + 1/2*A*t^2 = A*t*(T-t)

 A*t^2 - A*T*t + D = 0

 t = (A*T-sqrt(A^2*T^2-4*A*D)/(2*A) = T/2 - sqrt((T/2)^2-D/A)

With a plus sign in front of the square root, t would exceed T/2 which is 
impossible, so we have rejected that solution to the above quadratic.  If (T/2)
^2-D/A is negative, A is too small to allow a real solution and you have an 
impossible problem.  Otherwise, the maximum velocity would be

 v = A*t = D / (T/2 + sqrt((T/2)^2-D/A))

where we have multiplied numerator and denominator by

 T/2 + sqrt((T/2)^2-D/A)

to rationalize the numberator.  Notice that if the permissible A is very large, 
then v approaches D/T and t approaches 0.  If A is at the minimum possible 
value with (T/2)^2-D/A = 0, then v = 2*D/T and t = T/2 which gives the 
triangular velocity profile.

  When I originally described this problem, I asserted that it would lead to a 
linear equation, which as you see was incorrect.

  This may not fully answer the question you posed above, but I will confine 
my contribution to what I have written here.

Roger Stafford