Yes, you'd need a special HAL driver that takes a velocity input to send
to the drive, and produces a position output to send back to emc.

Looking at the pdf you linked to, you would have to arrange for emc to
produce a 16-bit velocity command to be written to register 0x30
("Velocity Word FIFO input"), then read 32 bits from register 0x48
("Buffered DRO output") to get the feedback position.  Another 32 bits
would need to be read from register 0x58 ("Index counter") if index
handling is desired.

Back-of-the-envelope for doing this on the bit-banged parport:
* Each SPI bit written takes 2 or 3 outb()s
* Each SPI bit read takes 2 outb()s and 1 inb()
* Each read or write seems to take an 8-bit address plus 8, 16 or 32
  bits data
* The clock can be shared between all SPI channels, making the pin usage
  (drives+1) outputs and (drives) inputs.  The 5 input limitation of the
  standard parport will be the limiting factor here.
* A total of (24+48+48)=120 bits must be transferred, or 72 bits if no index
  handling is desired, or up to 360 I/O instructions.  That makes at
  least 360uS, more than 1/3 of a 1kHz/1ms servo cycle. (the same length
  of time would be required for 1 motor or for 5)

This could probably be done, but it would likely require the emc "servo"
period to be increased (e.g., to 2ms) because of the large amount of
time spent in I/O.

There's a lot that datasheet leaves unsaid, so it's possible I'm
completely off the mark here.

There's also no question that for high loop speeds you'd be better off
with dedicated hardware that is fast for EMC to talk to and which can
generate high speed SPI waveforms -- the 5i20 would be that, if only
emc's hal_m5i20 driver knew how to use the SPI interface.

Jeff

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to