/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1987, 1991 by John E. Lloyd and Vincent Hayward.	    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

#include "mk3.c"

/* Table of parameters which are loaded into the joint microprocessors
   by controller start-up time. */

/* RAM Parameters (for PUMA only) */

#define  ADDR	    0x0200	/* memory address to read with readm	*/
#define  KGAIN	    0x0300	/* proportional gain		        */
#define  ADAMPGAIN  0x0400	/* accelartion damping gain		*/
#define  IGAIN	    0x0500	/* integration gain		 	*/
#define  SCALE	    0x0600	/* output scale				*/
#define  WHLSIZ     0x0900	/* no. of encoder counts times 4	*/
#define  PENVELOPE  0x4800      /* position envelope		        */
#define  POSTOL     0x4a00	/* position tolerance (2 bytes)		*/
#define  INTTOL     0x4c00	/* integration tolerance (2 bytes)	*/
#define  ASCALE	    0x5400	/* acceleration scale			*/
#define  VDECAY	    0x5600	/* velocity averaging constant		*/
#define  NINTER	    0x5900	/* number of ticks per sample		*/
#define  INTSCL	    0x5a00	/* log 2 of the # of ticks per sample   */
#define  VGAIN	    0x5c00	/* velocity average gain		*/
#define  PRESCALE   0x6900	/* pre-integration output scale         */

unsigned short defaultRamTable [][7] =
	{ 

	  KGAIN,		0xf9,  0xfa,  0xfb,  0xfe,  0xfd,  0xfe,
	  ADAMPGAIN,		0xfc,  0xfd,  0xff,  0xff,  0xff,  0x00,
	  IGAIN, 		   9,     9,     9,     7,     7,     5,
	  SCALE, 		   0,     0,     0,     0,     0,     0,
	  WHLSIZ,		0xe8,  0x20,  0xe8,  0xe8,  0xe8,  0xe8,

	  PENVELOPE, 		0xf4,  0xf4,  0xbc,  0xa4,  0x40,  0xe8, 
	  PENVELOPE+0400,	0x01,  0x01,  0x02,  0x06,  0x06,  0x03, 
	  POSTOL, 		0x28,  0x28,  0x28,  0x28,  0x28,  0x14, 
	  POSTOL+0400, 		   0, 	  0,     0,     0,     0,     0, 
	  INTTOL, 		0x32,  0x32,  0x32,  0x32,  0x32,  0x19, 
	  INTTOL+0400, 		   0, 	  0,     0,     0,     0,     0,

	  ASCALE,		   0,     0,     0,     0,     0,     0,
	  VDECAY,		   2,     2,     2,     2,     2,     2, 
	  NINTER, 		0x40,  0x40,  0x40,  0x40,  0x40,  0x40,
	  INTSCL, 		   6,     6,     6,     6,     6,     6,

	  VGAIN, 		0xfe,  0xfd,  0xfe,     0,  0xff,     0,
	  PRESCALE,		0xfe,  0xff,     0,     1,     1,     2,

	  -1,			   0,     0,     0,     0,     0,     0};

int varClkRate = 1;		/* system clock rate can be changed */
int varClkParam = 6;		/* parameter used in changing clock rate */
int baseClkRate = 28;		/* nominal system clock rate (.1 msec.). */
int jntClkRate = 9;		/* joint servo rate (.1 msec.). */
