Can linuxCNC be (easily) made to send commands over ethernet to my CNC machine?

More
3 years 4 months ago - 3 years 4 months ago #273856 by mlw19mlw91
EDIT: Here's the important stuff first:

I have a CNC machine that communicates over ethernet.  I have found documentation on the communication protocols and I can "reverse engineer" them.  I don't want to use a mesa or any other card if it can be avoided.

I've attached thorough documentation, and here's a brief description:  

File Attachment:

File Name: EMCOETHERN...6-19.zip
File Size:513.16 KB

Captured and preprocessed data were analysed to determine a hexadecimal repre-
sentation of commands sent from the front-end PC to the back-end PC responsible for
different tasks. Additionally, reply and auxiliary patterns were identified and suggested.
After establishing a connection, the back-end PC sends a command, which indicates that it
is ready to receive initialisation settings files. The front-end PC replies with eight files, each
prefixed with an 8-bit command, except the last one. The back-end PC replies with a series
of commands and files and finally indicates the end of the initialisation process. Most other
tasks are accomplished in a much simpler form, usually a request followed by a reply in
one or two packets ranging from 8 to 40 bits each. Furthermore, during the connection,
the two PCs broadcast auxiliary packets. These auxiliary packets can be seen as repeated
patterns in the communication stream. Depending on the state of the machine, this pattern
can represent the current mode of the lathe, a timer, or a ping indicator.
Here's also a link you can read the academic journal article at:
Machines | Free Full-Text | Digitising a Machine Tool for Smart Factories (mdpi.com)


The DNC documentation is available here: 
www.emco-world.com\fileadmin\pim\Description_of_the_DNC_interface__Binary_mode__01.pdf
www.emco-world.com\fileadmin\pim\Description_of_the_DNC_interface__ASCII_mode__01.pdf

According to the research paper, these machines use a fully featured back end PC running a realtime flavor of linux.  I presume it may even be possible to install linuxcnc on the back end PC and eliminate the need for a 2nd pc.  How difficult do you think that that might be as well?
The same (or a very similar PC) is also used in a lathe that has a front end PC, but you can actually install a different OS on the backend pc, and that's all that you need.  
www.emco-world.com\fileadmin\user_upload\_Group\Manuals\Digitalanzeige\Installation_von_Digitalanzeige_an_Maschinen_C40_FB450_FB600_EM14D_17D_20D.pdf


Original: 
I have a CNC machine that communicates over ethernet.  I have found documentation on the communication protocols and I can "reverse engineer" them.  I don't want to use a mesa or any other card if it can be avoided.

Before I bother with that though, about how much of a difficulty is it to kindof modify linuxcnc or hal to communicate over ethernet with custom commands?

Also, so the machine sends an acknowledgement message every time it recieves and executes a packet.  The original controller waits for this signal before sending another packet.  The machine also responds with positional data (periodically) and some other information.  So there's going to be a little more to it than simply controlling the machine, as I'd also want to utilize the communication from the machine to linuxcnc.  

I found someone who has made their own server to communicate with these machines, so I know it's possible.  I have some programming experience with python and Arduinos, have setup linuxcnc before (using the wizard).  Not sure on the best course of action
Last edit: 3 years 4 months ago by mlw19mlw91. Reason: added additional information and files

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

More
3 years 4 months ago #273862 by tommylight
LinuxCNC does control machines through ethernet/ethercat/CIA405 etc etc.
From what little info you gave us, my reply would have been just a simple NO.
More info, what machine, what protocol, what controler, how are things wired, etc etc.
If you have no info, pictures or video should help, we are pretty good at figuring things out of those.
The following user(s) said Thank You: mlw19mlw91

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

More
3 years 4 months ago - 3 years 4 months ago #273867 by mlw19mlw91
^ Not expecting help, but that's appriciated!  
I've gone and updated my original post to have the important stuff first.  

I'm going into IT so networking is my thing, but one of my biggest concerns was, how I can utilize the signals coming back from the machine in LINUX CNC, and how I would make linuxCNC transmit packets without commands, like the initial handshake.  Learning a new programming language is to do this is exciting, not sure which I would be best off using though.

I mean in theory, I should be able to have my own server communicating with the machine, and linuxcnc communicating with the server?  
Last edit: 3 years 4 months ago by mlw19mlw91. Reason: additional information

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

More
3 years 4 months ago #273876 by rodw
I don't know if it's broken or not but the NML messaging system was originally designed to be client/server
www.nist.gov/ctl/smart-connected-systems...-configuration-files

It's my understanding that normal use runs the client (HMI GUI) and the Linuxcnc server on the same PC.

There are some config files here but it's hard to find documentation about this.
github.com/LinuxCNC/linuxcnc/tree/master/configs/common

You might just need to build a broker that maps from your commands to NML
The following user(s) said Thank You: mlw19mlw91

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

More
3 years 4 months ago #273885 by mlw19mlw91
Some more questions on alternative methods of conversion:
the machine's controller seems to be a PCI device on the control PC.  I know that linuxCNC is capable of using parallel ports, I'm curious if it'd be possible to use the control hardware built into the original back-end pc.  On my wifi router, I can use a shell to access the GPIO pins directly, for example, and make the lights flash or whatever.  And it's just as easy as writing a pin high.  Is linuxCNC like this?  can it auto discover connected devices and their IO pins?  In python for example, I can use some code to discover all of the input output devices on any PC.  Curious if linuxCNC can do that.  

Still thinking of all the possibilities to control the machine.  I see that the MESA card uses a custom driver and does not merely transmit over regular TCP / internet protocol.  I'm curious if I could just write a similar driver to send the packets we need over TCP.  

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

More
3 years 4 months ago - 3 years 4 months ago #273906 by Aciera
Just so we are on the same page,
Looking at the provided 'Description of the DNC interface' documentation tells me that this is used for communication for some kind of remote machine panel. So basically you could do this with any python gui with the challenge of sending the signals over the DNC interface.
You don't need or even want LinuxCNC for any of this since you are not replacing the controller.

LinuxCNC would replace the backend PC that (presumably) contains the controller and would communicate with the motor drives through the PCI device you mentioned.
To interface LinuxCNC to that PCI device you would need to write a driver (likely in C or maybe C++) which would be a quite advanced task and likely near impossible without full documentation of the hard- and firmware of the PCI device.
Last edit: 3 years 4 months ago by Aciera.

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

Time to create page: 0.191 seconds
Powered by Kunena Forum