/*-=-=-=-=-=-=-=-=-=-=-=- 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 "mk1_std.c"

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

/* RAM Parameter addresses */

#define  PGAIN      0x0300 /* 001400 position error servo gain (0 to 7)	*/
#define  CC	    0x0400 /* 002000 control constant, not used (?)	*/
#define  IGAIN	    0x0500 /* 002400 integral servo gain		*/
#define  VGAIN	    0x5c00 /* 056000 velocity servo gain		*/
#define  SCALE	    0x0600 /* 003000 final output serror gain (0 to 7)	*/
#define  NINTER     0x5900 /* 054400 number of interps. default 32	*/
#define  INTSCL     0x5a00 /* 055000 see instructions. default 3	*/
#define  TICK	    0x0800 /* 004000 number of 8 micro second ticks	*/
#define  WHLSIZ     0x0900 /* 004400 no. of encoder counts times 4	*/
#define  OFFSET	    0x6900 /* 064400 ??? gravity compenation term (2 bytes)*/
#define  POSERR	    0x1100 /* 010400 ??? curr pos err			*/
#define  CURVEL     0x1500 /* 012400 curr vel				*/
#define  DACSIG	    0x2d00 /* 026400 ??? composite dac output		*/
#define  POSTOL     0x4900 /* 044400 position tolerance (2 bytes)	*/
#define  INTTOL     0x4b00 /* 045400 integration tolerance (2 bytes)	*/
#define  CURPOS     0x2a00 /* 025000 current position (2 bytes) 	*/

unsigned short defaultRamTable [][7] =
	{ WHLSIZ,		0xe8,  0x20,  0xe8,  0xe8,  0xe8,  0xe8,

	  VGAIN,		   1,	  1,	 2,	3,     3,     3,
	  PGAIN,		   1,	  1,	 1,	1,     1,     1,
	  CC,			   2,	  2,	 2,	2,     2,     2,
	  NINTER,		0x20,  0x20,  0x20,  0x20,  0x20,  0x20,
	  INTSCL,		   5,	  5,	 5,	5,     5,     5,

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

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

