Newsgroups: comp.robotics
Path: brunix!news.Brown.EDU!noc.near.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!ads.com!usenet
From: stevec@descartes.ads.com (Steve Ciccarelli)
Subject: Re: *]]] Robot motion, etc...
Message-ID: <1993Apr7.135432.9968@ads.com>
Sender: usenet@ads.com (USENET News)
Organization: Advanced Decision Systems, Mtn. View, CA (415) 960-7300
References: <BJmL2B1w165w@sys6626.bison.mb.ca>
Date: Wed, 7 Apr 1993 13:54:32 GMT
Lines: 54

In article <BJmL2B1w165w@sys6626.bison.mb.ca> baden@sys6626.bison.mb.ca  
(baden de bari) writes:
> 
>   I'm reqesting some input on an algorithm for the speed increase and 
>decrease of a robotic arm (let's say).  For instance, I when I start 4 
>steppers... have them do their task, be it -53 deg, +100 deg, etc., I 
>want them to start slowly, and pick up speed to max. speed, then slow 
>down to a complete stop at the final degree reqested.
>     I was wondering how to go about doing this.
>                Please foreward any information to any of the two 
>following addresses.
> 
>                Thanks.

What you're looking for is the equation for simple harmonic motion, which  
is best exemplified by the swinging of a pendulum.  

If the total time for the arm to swing from start to stop position is one  
unit of time, the equation for the desired position of the arm would be:

For 0<=T<=1:   1 - ((cos(T * PI) / 2) + 0.5)

The same equation could be used for position, substitute D (degrees) for T  
and normalize again to 1:  For a swing from 50 degrees to 90 degrees, the  
desired arc is 40 degrees which would become one "swing unit" for this  
motion.  At time .25, you should be at
1 - (((sqrt(2) / 4) + 0.5) swing units
simplified:  1 - ((1.414 / 2) +0.5)
             1 - (.3535 + 0.5)
             1 - (.8535)     or .1465 swing units.  Reconverting, we  
started at 50 degrees and are swinging through 40 degrees, so the position  
at .25 T should be 50 + (SU * 40)   or   55.86 degrees

At time .5, the arm should be halfway, and:
1 - ((cos (PI/2) / 2) + 0.5)
1 - (0 + .5)
5 swing units       50 + (40 * .5)     Right on schedule.

A little bit of calculus (which I am too rusty on to remember or attempt)  
will allow you to take the derivative of this function and get the  
velocity (second derivative should yield acceleration if I remember  
correctly, it's been a LONG time)

Since I'm a complete novice at robotics and lurk in this thread in the  
hope of one day getting more hardware experience, I'm sure that real-world  
motors would have a problem precisely following this algorithm.  However,  
since the desired position and the current position would probably be  
known in a given situation, this set of calculations could used as a  
heuristic to give the actual motor driving code a position to shoot for.
 
--
stevec@ads.com      Good software.  Good people.
Dennis Moore, Dennis Moore, riding through the land.
He steals from the poor and gives to the rich....
