mesa 5i20 and DAC

More
18 Feb 2010 11:09 - 18 Feb 2010 12:17 #1956 by stormpetrel
Hi All

I would like to convert a Maho MH400P from a broken Heidenhain TNC125 to EMC.
I have already bought the Mesa 5i20 and I'm currently designing an interface board to connect the 5I20 to my milling machine.

The Maho motor driver is controlled with a +/- 10V analog signal and I would like my home-brew board to produce it. There are all the components necessary on the board to do the job (microntroller, 16bit DAC, filters...), I just need to send my digital value through the 5I20 to the DAC.

The best way would consist in using 10 pins of the 5I20 configured as outputs. 8 of them will be used as a data bus to send the output value in byte format, 1 pin will indicate if the data byte is the MSB or the LSB and the last byte will indicate to the microcontroller that new data are available on the data bus.


The sequence would look likes:

//at each servo period

put LSB on databus
put MSB/LSB pin to 1
put data_available pin to 1
wait x us
put data_available pin to 0
wait y us
put MSB on databus
put MSB/LSB pin to 0
put data_available pin to 1
wait x us
put data_available pin to 0
done


Is it possible to do so with EMC? Would it be something easy to do?


Thank you in advance for your reply.
Last edit: 18 Feb 2010 12:17 by BigJohnT. Reason: change to u so post shows up

Please Log in or Create an account to join the conversation.

More
23 Feb 2010 18:17 - 23 Feb 2010 18:20 #2021 by PCW
Replied by PCW on topic Re:mesa 5i20 and DAC
That fairly awkward to do, especially with the delays. Also if you have many axis, this will use a lot of pins (unless you share the databus) If you really want to use parallel DACs, probably a specific FPGA configuration with a output state machine would be needed. This _may_ be supportable by a new HostMot2 module I'm working on (twiddler), that embeds a simple I/O processor in the FPGA and presents a simple set of 32 bit interface registers to HostMot2.
Last edit: 23 Feb 2010 18:20 by PCW. Reason: premature empostulation

Please Log in or Create an account to join the conversation.

More
24 Feb 2010 03:02 - 24 Feb 2010 12:07 #2024 by stormpetrel
Replied by stormpetrel on topic Re:mesa 5i20 and DAC
Thank you for your reply PCW!!!!
The Maho MH400P is a point to point milling machine. There is one common drive used with the 3 axis. The active axis is selected with electrically switched clutches. Consequently just 1 DAC is needed. I'm not sure the delay will be an issue. It's just a question of few us (10us max) to send the data to the DAC through the micro-controller and anyway, the bandwidth of the DAC would be the limiting factor (20kHz @16 bits).

Twiddler looks promising!!! Any idea about when it will be available?
Last edit: 24 Feb 2010 12:07 by BigJohnT. Reason: change micro symbol to u so message would show

Please Log in or Create an account to join the conversation.

More
24 Feb 2010 04:20 - 24 Feb 2010 16:18 #2027 by PCW
Replied by PCW on topic Re:mesa 5i20 and DAC
Oh OK, just one axis. The problem with short delays is that without
hardware support they would have to be done in the driver
(and busy-waiting in the driver is frowned upon as it wastes CPU)

I expect to work on twiddler after I finish the resolver module (which is a fair amount of work)
There may be some other solutions to do what you want. I'll give it some thought.
Last edit: 24 Feb 2010 16:18 by PCW. Reason: message appeared

Please Log in or Create an account to join the conversation.

More
24 Feb 2010 23:38 #2050 by stormpetrel
Replied by stormpetrel on topic Re:mesa 5i20 and DAC
It's good to know that it is or will be possible to do this.
As I urgently need to replace my broken Heidenhain controller (the milling machine can't work in manual mode without it), I will finish my micro-controlled board first and use it but without EMC. Once done, I could start playing with EMC and try to solve the DAC problem).

Thank you for your replies. They were really useful to me!

Please Log in or Create an account to join the conversation.

More
19 May 2010 03:55 #2903 by PCW
Replied by PCW on topic Re:mesa 5i20 and DAC
I have the twiddler module done so I could make a test configuration if you still want to try it.
I would need the timing, desired pinout, and DAC data format you want.
Also theres no driver support for the twiddler module but this can be worked around by using the
raw-write capability of HostMot2.

Please Log in or Create an account to join the conversation.

More
19 May 2010 21:42 #2916 by stormpetrel
Replied by stormpetrel on topic Re:mesa 5i20 and DAC
Thank you PCW
I will send you all the information this weekend.

Please Log in or Create an account to join the conversation.

More
26 May 2010 02:02 #3008 by stormpetrel
Replied by stormpetrel on topic Re:mesa 5i20 and DAC
Hi PCW


I use the P2 connector of the 5i20 mesa board for the encoders and the P3 connector to command the DAC and the relays of my Maho milling machine.

File Attachment:


OUT_RLY_X: mesa 5i20 output, x relay, the main electric motor drives the x axis
OUT_RLY_Y: mesa 5i20 output, y relay, the main electric motor drives the y axis
OUT_RLY_Z: mesa 5i20 output, z relay, the main electric motor drives the z axis
OUT_RLY_FAST: mesa 5i20 output, fast motion relay
OUT_RLY_DIR: mesa 5i20 output, direction relay
OUT_RLY_AUTO: mesa 5i20 output, automatic mode relay
OUT_RLY_STOP: mesa 5i20 output, stop relay

IN_RAPID: mesa 5i20 input, MAHO user interface switch, FAST motion
IN_START: mesa 5i20 input, MAHO user interface switch, START
IN_STOP: mesa 5i20 input, MAHO user interface switch, emergency stop


DAC control
D0-D7: mesa 5i20 output,data bus
MCDAC_MSB: mesa 5i20 output, select MSB or LSB
CS_MCDAC: mesa 5i20 output, chip select DAC

MCDAC_RDY: mesa 5i20 input, DAC ready for a new conversion




t1-2: >50ns
t2-3: >50ns
t3-4: >900ns
t5-6: >900ns

The DAC (AD5570) has a bandwith of 20kHz, however I will use it at a frequency between 100 samples/sec up to 1ksps.

Cheers, Dom

Please Log in or Create an account to join the conversation.

More
26 May 2010 03:07 #3012 by PCW
Replied by PCW on topic Re:mesa 5i20 and DAC
OK thanks for the detailed info, that makes it easy!
Are you sure the LSB selector is high for LSB? Seems backwards
( though any output polarity errors can be fixed with the HM2 invert option)

Ill try and get you a test config tomorrow

Please Log in or Create an account to join the conversation.

More
26 May 2010 06:08 #3013 by stormpetrel
Replied by stormpetrel on topic Re:mesa 5i20 and DAC
You are right! It makes more sense if MSB is on the data bus when MSB/LSB is high!

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.081 seconds
Powered by Kunena Forum