Newsgroups: comp.robotics
Path: brunix!news.Brown.EDU!qt.cs.utexas.edu!cs.utexas.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool.mu.edu!decwrl!csus.edu!netcom.com!nagle
From: nagle@netcom.com (John Nagle)
Subject: Re: Straight Lines on a Polar Coordinate Plotter - Help Please !
Message-ID: <1993Feb3.185210.9342@netcom.com>
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
References: <1993Feb3.114426.5989@nessie.mcc.ac.uk>
Date: Wed, 3 Feb 1993 18:52:10 GMT
Lines: 38

prg@nessie.mcc.ac.uk (Pete Green) writes:
>I have been given the problem of driving a rather unusual home-brew
>plotter which works in radius, theta coordinates. It uses circular
>paper on a stepper motor driven disc and a linear drive holding the
>pen running along a radius of the disc.
>Can anyone point me at algorithms for drawing straight lines on 
>such a monster ?  I have just about mastered drawing circles 
>centred on the disc !

       A general solution appears in "Manipulator Cartesian Path
Control":, by Richard Paul, in "Robot Motion, Planning, and Control"
by Brady et al. (1982, MIT Press, ISBN 0-262-02182-X).  It's overkill
mathematically, since it's a general 3D solution for straight-line
movement of jointed manipulators.  But it's a good introduction to the
problem.

       Your situation is a bit simpler.  There are no extra degrees of
freedom, and the one singular point is at the center of the disk.  
You can handle that by breaking up any line that goes within some 
small distance of the center into two lines to be drawn separately.

       Can you ignore the dynamics?  That is, can you stop the steppers at
any time in one step, or is there enough inertia that you have to ramp
the speed down?  If you can ignore the dynamics, the simple solution is to
compute, on each step cycle, the direction to the goal point in polar
coordinates.  Then determine which of the eight directions you can move
is closest to that vector, issue that command, and repeat.  This is
expensive computationally, but if you have an FPU on the controlling
computer, go for it.

       There may be a polar coordinate version of Bresenhams's algorithm.
Ask in comp.graphics.  Look at circle-drawing algorithms for ideas.

       If you have to handle dynamics, and need good accuracy, it's more
complicated, but the Brady book has the solution, although it is presented
in excessively theoretical terms.

					John Nagle
