Serial port driver for the MESA 7i96?

More
23 May 2018 13:47 #111060 by thadwald
Greetings,

I am working on a 24" x 24" engraver retrofit project. The reason being, the original driver for it was basically a printer driver, which is quite limited as a CNC controller. This machine has a 1HP spindle motor that is controlled by a Toshiba VF-S9 inverter. I would like to interface it with LinuxCNC using the MODBUS protocol.

I started this project with a MESA 7i96 because I have an older decommissioned iMac Core 2 Duo that I wanted to use. (As an aside, this is working nicely so far; Linux Mint 18, Preempt-RT kernel, 22000 max latency, if I keep the wifi off.)

I am using about half of the I/Os on the card so far. My question is, is it possible for the card to expose some pins as a serial port?

If this is not possible, my other option is to use a USB-Serial adapter. Are there issues with these kinds of adapters for spindle control?

I am referring this documentation: VFs11 driver

The documentation refers to a wiring schematic for converting the link to RS232. Unfortunately, the links to those schematics are broken. Could anyone provide those again here?

Thanks!

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

More
24 May 2018 15:03 #111084 by andypugh

I am using about half of the I/Os on the card so far. My question is, is it possible for the card to expose some pins as a serial port?

Yes, it is possible to use _some_ pins as a serial port, on _some_ cards.
Mesa has a UART (and pktUART) module in the firmware options.

In the case of the 7i96 you will not be able to use the IO pins as a serial UART because these are, themselves, serially addressed and only update once per mS. The existing RS485 port can be used (you would need a firmware that puts a UART on those pins in place of the smart-serial module) and also some of the pins on the expansion port could be re-allocated (by a firmware change).


If this is not possible, my other option is to use a USB-Serial adapter. Are there issues with these kinds of adapters for spindle control?

I use a USB dongle on my lathe to control the VFD and it does not seem to cause any problems. It might not be ideal if you wanted to use spindle orientation.
FWIW I found a hacky way to mount the adaptor directly to a motherboard header: forum.linuxcnc.org/forum/18-computer/306...485-connection#72351
The following user(s) said Thank You: thadwald

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

More
19 Jan 2020 23:35 #155211 by persei8
This was a while ago, but regarding the 7i96, Andy said:

"The existing RS485 port can be used (you would need a firmware that puts a UART on those pins in place of the smart-serial module) and also some of the pins on the expansion port could be re-allocated (by a firmware change)."

How would I go about getting this firmware? Do I have to write VHDL source code myself and reflash the FPGA? (geez, I hope not)
The reason I ask is that I would like to control my Huanyang GT series VFD via RS-485 directly from the 7i96 board. That is, without a USB to RS-485 dongle.

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

More
20 Jan 2020 00:57 #155216 by PCW
Theres standard firmware for this but no driver

7i96_pktd.bit

I notice that a new hal type has been added that
might make writing a clean hal interface to the UART easier:

hal_port

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

More
20 Jan 2020 21:53 #155278 by persei8
Thanks, this may be beyond my capability but I will investigate further. Were those references intended to be URLs?

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

More
20 Jan 2020 22:07 - 20 Jan 2020 22:08 #155280 by AgentWD40
Can you just put jumper wires on the pins in the p1 expansion connection, io34 - io50? Or is it not recommended as they wouldn't be protected this way without an actual expansion card?
Last edit: 20 Jan 2020 22:08 by AgentWD40.

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

More
20 Jan 2020 22:25 - 20 Jan 2020 22:26 #155282 by PCW
You can, but its like a bare parallel port.
If you connect to a voltage outside the range of about -0.8V to 7V
you will destroy the bus switch and possibly the FPGA.

You can use one of the cheap "5 AXIS MACH" breakout boards to
protect the I/O

If you use bare pins, include a 220 Ohm or so series resistor to protect the
negative input clamp diodes from excessive current.
Last edit: 20 Jan 2020 22:26 by PCW.
The following user(s) said Thank You: AgentWD40

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

More
15 Mar 2020 23:27 #160366 by persei8
I have made good progress (at least for me) but can't seem to get past how to connect to the uart in the 7i96. I wrote a userspace hal component that communicates with the VFD via a module that assembles and disassembles modbus packets. This works well using a fake uart routine. The example mesa_uart.comp isn't helping me at all and I can't find anything about pkt_uart in the linuxcnc source files on github. So, the question is - how do I connect the assembled modbus packets to the uart in the 7i96? Also, are there specs for pktuart somewhere? Any help is appreciated.
Thankyou.

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

More
More
16 Mar 2020 18:59 #160461 by persei8
I did not mean to imply it was a bad example. I'm sure it is a good example. After re-reading the above posts, it appears that my stock 7i96 does not include a UART and I would have to re-flash it with 7i96_pktd.bit firmware. The following terminal output seems to confirm that.

jim@LinuxCNC:~/linuxcnc/configs/mesa_uart$ halrun
halcmd: loadrt hostmot2
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
halcmd: loadrt hm2_eth
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
halcmd: loadrt mesa_uart names=hm2_7i96.0.uart.0
hm2: Can not find UART instance hm2_7i96.0.uart.0.

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

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