PropForth Robot Control Vocabulary            V.0.8        Nicholas G. Lordi    5/2012

    This document defines the PropForth robot control words common to the Parallax Stingray and Eddie robot  
platforms.  Most of these words also apply to the PropBOEBot which are also defined in the pfrcboe.txt program
listing. The words are listed according to their category. 

User Modifiable Parameters

     lduty, rduty  :  left and right PWM duty cycles 
                              (default range : -100 to 100  practical range : -95 to 95)
                             Positive values drive the wheels in a forward motion: - values reverse the direction
                             of motion.

     period : (default values  - Stingray: 4000  Eddie: 3500)
                     A number which adjusts the PWM period to 125 us (the default), i.e., 8000 HZ, the
                     maximum allowed frequency.  The period can only be increased, lowering the frequency.

     scale :  (default value  : 100)
                 The scaling factor sets the duty cycle (speed) range.  The default value (maximum) sets the
                  range to +100. Changing the scale to 10 enables a range of +1000, increasing the resolution.
                  If the frequency is reduced, the scale should be  increased using the following formula: 
                  scale = clkfreq/(PWM frequency*range) where range is 100 to 1000. 

     ladj :  (default value : 0)
               An adjustment applied to the left wheel speed to align it with the right wheel speed.    If the 
               left wheel runs faster than the right wheel, ladj is a negative for forward motions and positive 
               for backward motions.

Ping Related Variables    

    Unlike the BoeBot, both my Stingray and the InfoAge Eddie (for which I am responsible) use 3 fixed pings -
 left, right, and center.  The variables ldist, cdist, and rdist  store the distances measured by the pings in inches.   

User Executable Words 

    set_defaults :  Sets user modifiable variables to their default values.

    set_duty :   ( n1 n2 --- )  where n1 sets rduty to value n1*scale and n2 sets lduty to n2*scale+ladj.

   Wstart :  Initializes and starts wheel driver rc_wheel in Cog 1.
                  The Stingray motor controller uses two pins per motor, where the PWM signal is switched
                  between the two pins to change the direction of rotation.  The Eddie motor controller uses
                  three pins per motor.  The PWM signal is connected to one pin and the hi/lo states of the 
                  other two pins is  switched to change the direction of rotation.

    Pstart :  Initializes and starts ping driver rc_ping in Cog 2.
                  The three pings share one counter and are continuously activated in a round-robin fashion.

    START  : Executes set_defaults, Wstart and Pstart.   

    These are the only words needed to develop complex robot motions.  
However, it is convenient to include some words which define the usual standard robot movements.

    STOP :   Steps down the robot speed, stopping the current motion.

    The following words all have the same syntax, ( n -- ), where n is the desired speed setting.

    FRW : Moves forward.

    BKW : Moves backward.

    CW : Clockwise rotation in place.

    CCW : Counter clockwise rotation in place.

    RTURN : Turns right, centered on right wheel..

    LTURN : Turns left, centered of left wheel.

Special EddieWords

     The Eddie platform includes 3 Sharp IR distance detectors which are connected to the on board 
MCP3008 chip (10 bit resolution).  

       Astart : Initializes and starts the ADC driver rc_adc  in Cog 3.

      The variables ladc, cadc, and radc store the distances measured by the Sharp detectors in digital units, 0 – 1024, 
representing 0 – 5 volts input.