Adding a DAC, DRO wrapping



Hello all,  I think this is my first time posting to this list,
although I've been quite active on CAD_CAM_EDM_DRO of late.

I've been working with an EMC-Aug-200/rtlinux_09J/2.0.36(redhat)
system for the past week, chosen due to rumors of crashes in the newer
versions.  (I left space to install a later version in another
parition, too).

So far I've gotten it up and running with an old light machines CNC
sherline lathe (wimpy unipolar L/R steppers... 6ipm).  I really want
to run a 13" engine lathe though.

So I wrote a driver for an analog devices RT802 dac board, using the
stg driver and a comedia rt802 driver as models.  (The board uses
12-bit pm/an7545 DAC's and has registers for channel, low byte and
high nibble)

Today I was finally able to build a new module, rt802dromot.o which
uses this card for output and Tom Kulaga's LS7266 dro and associated
driver for input. 

No sooner had I gotten the loop closed than I noticed that the dro.c
code does not appear to handle overflows of the 24bit count register,
although I could be mistaken.  Has anyone else experienced this?  I
copied some code from the stg.c encoder section to handle this, and
now I can wrap the rotary encoder around the overflow all day.

I guess my basic questions are - am I duplicating work others have
already done?  Or is this code worth trying to clean up and eventually
figuring out how to contribute to the cvs tree?  

Also, would it make sense to have a generic 'model' driver for a DAC
that people could easily modify for various boards?  Part of the
complicaton of adding a new driver is putting it in the half dozen
places in the emcmot/Makefile, and making sure the resulting module is
mentioned in emc.run so it can get loaded and unloaded.  It would be
nice to have either instructions or a script for doing this, or simply
a prototype driver (something like myservo.o) that had all the
necessary files and was mentioned in the right places, so that people
could simply edit their particular outb's and inb's into the source
file, rebuild, and run.  (This is essentially what I did at first
time, hacking up the stg driver, but that didn't seem very clean, so I
built a new module).

Oh, one more question: what are the units for the MAX_VELOCITY in the
.ini file?  Is this the velocity for G0 rapids?

Chris

-- 
Christopher C. Stratton, stratton-at-mdc.net
Instrument Maker, Horn Player & Engineer
22 Adrian Street, Somerville, MA 02143
http://www.mdc.net/~stratton
NEW PHONE NUMBER: (617) 628-1062 home, 253-2606 MIT






Date Index | Thread Index | Back to archive index | Back to Mailing List Page

Problems or questions? Contact