home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 471 / rccl172 < prev    next >
Text File  |  1987-03-02  |  10KB  |  159 lines

  1. /*
  2.  * MAC  Version 2.0           Author :  Vincent Hayward
  3.  *                                      School of Electrical Engineering
  4.  *                                      Purdue University
  5.  *      Dir     : h
  6.  *      File    : addefs.h
  7.  *      Remarks : Not quite clean yet.
  8.  *      Usage   : Included in lsi11 pgs to control joint processors
  9.  */
  10.  
  11.  
  12. /*  This section contains all  of  the  hardware  address  definitions      */
  13. /*  needed for software communication to the joint microprocessors.         */
  14.  
  15.  
  16. /*                       Control Register Bits                              */
  17.  
  18. #define  SELECT        00       /* sets up data transfer                    */
  19. #define  CMDVLD        01       /* command validation                       */
  20. #define  REQA        0200       /* request a, acknowledge transfer          */
  21. #define  REQB     0100000       /* request b, signal attention request      */
  22.  
  23.  
  24. /*                  External Communication by the Host                      */
  25.  
  26. /*  The external I/O control and front panel switches are  defined  by      */
  27. /*  data values sent to or read from a latched  buffer when the output      */
  28. /*  buffer of the parellel interface is sent the value of 07.               */
  29.  
  30. #define  CNTRLR        07       /* enable external communication            */
  31.  
  32. #define  EXTERN0       01       /* external input/output                    */
  33. #define  EXTERN1       02       /* bit definitions                          */
  34. #define  EXTERN2       04       /*                                          */
  35. #define  EXTERN3      010       /*                                          */
  36. #define  EXTERN4      020       /*                                          */
  37. #define  EXTERN5      040       /*                                          */
  38. #define  EXTERN6     0100       /*                                          */
  39. #define  EXTERN7     0200       /*                                          */
  40. #define  ARMPWR      0400       /* high power on/off bit  (high/low)        */
  41. #define  OFFL       01000       /* external low signal to stop the arm      */
  42. #define  RUN        02000       /* front panel switch - run bit low         */
  43. #define  RESTART    04000       /* front panel switch - restart bit low     */
  44. #define  HNDOH      01000       /* close pneumatic hand/release  (high/low) */
  45. #define  HNDCH      02000       /* open pneumatic hand/release  (high/low)  */
  46. #define  EXTRA4     04000       /* spare output bit (not wired)             */
  47. #define  EXTRA0    010000       /* spare I/O bit (not wired)                */
  48. #define  EXTRA1    020000       /* spare I/O bit (not wired)                */
  49. #define  EXTRA2    040000       /* spare I/O bit (not wired)                */
  50. #define  EXTRA3   0100000       /* spare I/O bit (not wired)                */
  51.  
  52. /*                    Host Commands to the Joints                           */
  53.  
  54. #define  POSET        000       /* 16 bit unsigned position set point       */
  55. #define  DACSET       010       /* 12 bit signed dac setpoint               */
  56.                 /*   000000  minimum positive value         */
  57.                 /*   001777  halfway positive value         */
  58.                 /*   003777  maximum positive value         */
  59.                 /*   777777  minimum negative value         */
  60.                 /*   775777  halfway negative value         */
  61.                 /*   774000  maximum negative value         */
  62. #define  TOLBND       020       /* position tolerance                       */
  63. #define  STOPM        030       /* enter stop mode and set position         */
  64. #define  CALIB        040       /* calibrate                                */
  65. #define  GRAVTY       050       /* 16 bit signed gravity term               */
  66. #define  INTBND       060       /* set integration band                     */
  67. #define  SETPAR       070       /* setup joint servo parameters             */
  68. #define  STOPP       0100       /* stop w/o changing position count         */
  69. #define  UNSD1       0110       /* undefined                                */
  70. #define  UNSD2       0120       /* undefined                                */
  71. #define  UNSD3       0130       /* undefined                                */
  72. #define  READ        0140       /* read 16 bit unsigned position            */
  73. #define  JSTAT       0150       /* read joint status definitions            */
  74. #define  JRSERVO  0100000       /*              servoing enabled            */
  75. #define  JRINTBD  0040000       /*              integration enabled         */
  76. #define  JRTRQSV  0020000       /*              torque servo enabled        */
  77. #define  JRHLFCT  0010000       /*              1/2 count enabled           */
  78. #define  JRPOSSV  0004000       /*              position servo enabled      */
  79.                 /*    002000    undefined                   */
  80. #define  JFNDIXS  0001000       /*              index found and halted      */
  81. #define  JLOOKZI  0000400       /*              looking for index           */
  82. #define  JLOSTSY  0000200       /*              lost synch with encoder     */
  83. #define  JFIXFND  0000100       /*              first index found           */
  84.                 /*    000040    undefined                   */
  85.                 /*    000020    undefined                   */
  86.                 /*    000010    undefined                   */
  87.                 /*    000004    undefined                   */
  88.                 /*    000002    undefined                   */
  89.                 /*    000001    undefined                   */
  90. #define  READP       0160       /* read joint pot                           */
  91. #define  READM       0170       /* read micro memory set in location 2      */
  92. #define  SEQUENT     0200       /* sequential (to address all joints)       */
  93.  
  94.  
  95. /*                          RAM Parameters                                  */
  96.  
  97. #ifdef STAN
  98.  
  99. #define  STATUS     00000       /* index status register                    */
  100.                 /*   0200  lost synch with encoder          */
  101.                 /*   0100  set after first index found      */
  102. #define  MODE       00400       /* joint control and status register        */
  103. #define  MESERVO     0200       /*       | enable servoing                  */
  104. #define  MEINTBD     0100       /*       | enable integration band          */
  105. #define  METRQSV      040       /*       | enable torque servo              */
  106. #define  MEHLFCT      020       /*       | enable half count mode           */
  107. #define  MEPOSSV      010       /*       | enable position servo            */
  108. #define  MFNDIXS       02       /*       | set when found zero index        */
  109. #define  MLOOKZI       01       /*       | look for zero index              */
  110.  
  111. #define  ADDR      001000       /* memory address to read with readm        */
  112. #define  PGAIN     001400       /* position error servo gain  (0 to 7)      */
  113. #define  VGAIN     002000       /* velocity error servo gain  (0 to 7)      */
  114. #define  IGAIN     002400       /* integrated position error gain  (0 to 7) */
  115. #define  SCALE     003000       /* final output error gain  (0 to 7)        */
  116. #define  NINTER    003400       /* number of interps. default 32            */
  117. #define  INTSCL    004000       /* see instructions. default 3              */
  118. #define  TICK      004400       /* number of 8 micro second ticks           */
  119. #define  WHLSIZ    005000       /* no. of encoder counts times four         */
  120. #define  OFFSET    006000       /* gravity compensation term  (2 bytes)     */
  121. #define  POSTOL    007000       /* position tolerance  (2 bytes)            */
  122. #define  INTTOL    010000       /* integration tolerance  (2 bytes)         */
  123. #define  CURPOS    023000       /* current position  (2 bytes)              */
  124. #define  LSTPOS    024000       /* last servo position  (2 bytes)           */
  125. #define  CURVEL    027000       /* current velocity  (2 bytes)              */
  126. #endif
  127.  
  128. #ifdef PUMA
  129.  
  130. #define  STATUS     00000       /* index status register                    */
  131.                 /*   0200  lost synch with encoder          */
  132.                 /*   0100  set after first index found      */
  133. #define  MODE       00400       /* joint control and status register        */
  134. #define  MESERVO     0200       /*       | enable servoing                  */
  135. #define  MEINTBD     0100       /*       | enable integration band          */
  136. #define  MELSBSV      040       /*       | enable lsb servo                 */
  137. #define  MEHLFCT      020       /*       | enable half count mode           */
  138. #define  MEPOSSV      010       /*       | enable position servo            */
  139. #define  MFNDIXS       02       /*       | set when found zero index        */
  140. #define  MLOOKZI       01       /*       | look for zero index              */
  141.  
  142. #define  ADDR      001000       /* memory address to read with readm        */
  143. #define  PGAIN     001400       /* position error servo gain  (0 to 7)      */
  144. #define  VGAIN     002000       /* velocity error servo gain  (0 to 7)      */
  145. #define  SCALE     002400       /* final output error gain  (0 to 7)        */
  146. #define  NINTER    003000       /* number of interps. default 32            */
  147. #define  INTSCL    003400       /* see instructions. default 3              */
  148. #define  TICK      004000       /* number of 8 micro second ticks           */
  149. #define  WHLSIZ    004400       /* no. of encoder counts times four         */
  150. #define  OFFSET    010000       /* gravity compensation term  (2 bytes)     */
  151. #define  POSERR    011000       /* curr pos err                             */
  152. #define  CURVEL    012400       /* curr vel                                 */
  153. #define  DACSIG    014000       /* composite dac ouput                      */
  154. #define  POSTOL    ??????       /* position tolerance  (2 bytes)            */
  155. #define  INTTOL    ??????       /* integration tolerance  (2 bytes)         */
  156. #define  CURPOS    ??????       /* current position  (2 bytes)              */
  157. #define  LSTPOS    ??????       /* last servo position  (2 bytes)           */
  158. #endif
  159.