home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / robotics / 1680 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  4.3 KB

  1. Xref: sparky comp.robotics:1680 comp.realtime:1031
  2. Path: sparky!uunet!sun-barr!rutgers!micro-heart-of-gold.mit.edu!news.media.mit.edu!fredm
  3. From: fredm@media.mit.edu (Fred G Martin)
  4. Newsgroups: comp.robotics,comp.realtime
  5. Subject: Re: Miniboard 2.0 - I need to support LOTS of motors..
  6. Message-ID: <1992Sep2.045803.4051@news.media.mit.edu>
  7. Date: 2 Sep 92 04:58:03 GMT
  8. References: <1992Aug29.222049.4513@magnus.acs.ohio-state.edu> <1992Sep2.001302.3074@PacBell.COM>
  9. Sender: news@news.media.mit.edu (USENET News System)
  10. Distribution: na
  11. Organization: MIT Media Laboratory
  12. Lines: 86
  13.  
  14. In article <1992Sep2.001302.3074@PacBell.COM> tlhouns@ns.pacbell.com
  15. (Lee Hounshell) writes:
  16.  
  17. > The robotics application I'm constructing (which will probably be
  18. > using the miniboard) needs to control a lot of motors.  I'll only need
  19. > one speed, however.  I'll also need forward/backward control.  I'm
  20. > thinking of a modification add-on board that will permit each of the
  21. > miniboard's 4 motor ports to control 16!!!  motors (for a total of 64
  22. > motors per miniboard). I would appreciate any net
  23. > feedback/comments/suggestions/etc.. that anyone may have.
  24.  
  25. Wow!  That's a lot of motors!  Pray tell what ever for, I am
  26. curious...
  27.  
  28. > At the moment, each of the motors uses a "control" register to control that
  29. > motor's direction and speed.  The register is divided in half.. 4 bits to
  30. > control forward direction/speed and 4 bits for backward direction/speed.
  31. > This gives us 16 speeds forward and 16 speeds backward.
  32.  
  33. If you're referring to the Mini Board design, this isn't right.  The
  34. Mini Board uses the 6811 Port B register to control the motor chips.
  35. The four upper bits are used for on/off control and the four lower
  36. bits are used for direction control.
  37.  
  38. The speed control is purely a software thing.
  39.  
  40. > The miniboard actually sends current (or no current) to the motor in pulses..
  41. > If you think of a "time segment" as being divided into 16 units, then the
  42. > motor will receive power (or not receive power) for each of the 16
  43. > units.
  44.  
  45. Right, this is how it works; it's known as "pulse width modulation."
  46. The PWM routines I wrote for the Mini Board switch on and off at a 1
  47. Khz rate.
  48.  
  49. I have two suggestions for how to control lots of motors from Mini
  50. Boards: 
  51.  
  52. (1) Build 16 Mini Boards and use the SPI (serial peripheral interface,
  53. or network for short) system to tie them together.  Implement a
  54. network protocol so that one board is a master and can send commands
  55. to the 15 others.  Use this board's serial line to connect to your
  56. Sparc; it receives serial line commands from the Sparc and acts as a
  57. "repeater," sending the command over the SPI network to all the
  58. other boards.
  59.  
  60. OK, it's a bit wasteful of 6811's, but it's a nice modular solution,
  61. and requires zero new hardware design.
  62.  
  63. (2) Use shift-register chips hooked up to the SPI port.  When you
  64. write a byte to the 6811's SPI register, it gets shifted out of the
  65. 6811 and into your bank of shift registers.  
  66.  
  67.     +---------+
  68.     |  SPI OUT|--->[shift reg 0]--->[SR 1]--->[SR 2]---+
  69.     | 6811    |                       |
  70.     |         |                          |
  71.     |   SPI IN|<---[SR 15]-------< .... <-----[SR 3]<--+
  72.     +---------+
  73.  
  74. If you use 16 shift register ICs, each one eight bits wide, then you
  75. have 128 bits of output.  If you shift 16 bytes from the 6811, the
  76. resulting bitstream exactly fills your bank of shift registers.
  77.  
  78. Two motor chips can hook up to each shift register in the fashion
  79. implemented on the Mini Board:  four bits direction and four bits
  80. on/off (you need 4/6 of an inverter chip to get the direction lines
  81. wired right, as done by the M.B.).
  82.  
  83. Sooo, after wiring this whole thing up, you would write 16 bytes out
  84. the SPI port, and they'd get shifted through the whole bank of shift
  85. registers.  When you stop shifting, the motor bits settle down, and
  86. you've just issued a new set of commands to all your motors.
  87.  
  88. It's true that while the bits are making their way through the shift
  89. register bank, each shift register output bit would be vacillating
  90. between 1's and 0's as per the current state of the bit stream.  But,
  91. since the 6811 can clock the bits at 1Mhz, and you're shifting only
  92. 128 bits per motor bank update, you only have 128/1000000 sec ~=
  93. 1/8000 of a second of motor control indecisiveness, which is small
  94. enough of a pertubation that your DC motors won't even notice.
  95.  
  96.     - Fred
  97.  
  98. P.S.  I think the shift register chip you want for this deal is the
  99. 74HC194, but my memory could be wrong.
  100.