Data transfer LinuxCNC to / from custom board - Solved

More
2 years 3 months ago #304488 by tommylight
Another wrench in the machine:
Mesa 7i73, RS422 use differential signaling, pretty sure there is no serial that can do that, but still could be done using some line drivers, that implies using intermediary boards, lots of wiring mess, ...
Normal serial ports do 115K as Cornholio mentined, ESP32 can do much more through USB to serial using it's built in whatever it uses.
Did anyone check if Mesa 7i73 can be made to communicate at lower speeds?
Aaaand arduino jumps in... :)
Do you have a 7i93 mentioned above?
Forgot what 7i93 does, so i'll go hide under a rock.
The following user(s) said Thank You: slowpoke

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

More
2 years 3 months ago #304499 by Cant do this anymore bye all
Yeah the 7i73 can do 115200, and few others, but they are nvram values so it’s something Mesa might have to set pre delivery.

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

More
2 years 3 months ago #304503 by PCW

1) I guess that you connect the 7i73 RS-422 interface to a serial port of the Linux PC, and then enable some sort of 7i73 driver in LinuxCNC that magically establishes the communication link between the two?

No, the 7I73 connects to one of the 7I95s two RS-422 interfaces.
The following user(s) said Thank You: slowpoke

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

More
2 years 3 months ago - 2 years 3 months ago #304603 by slowpoke

Keystrokes are a pretty bad way to interface to LinuxCNC.

Can I suggest that you consider a Mesa 7i73 ? That can interface the control panel directly into the realtime layer of LinuxCNC.
store.mesanet.com/index.php?route=produc...oduct&product_id=116

It's probably not as much fun as your custom board, but it will work out of the box.

There is a strange HAL component that I wrote that might help if you choose to go your own way. It's strange because it does two completely different things in one component.
linuxcnc.org/docs/stable/html/man/man9/matrix_kb.9.html
The side that might help you is converting scancodes into HAL pins.


 
Andy,
I'm exploring the various ways to get data to and from Linux to my board. I already have hard wires connections for EStop, and machine power.

Focusing for the moment on data from my board to Linux I made a table of the 50 or so button presses that I would need to send, and from playing with a Axis and a regular keyboard using showkey it seems there is a hot key or key sequence that covers all 50 buttons that I anticipate using. There are a few anomalies that requires sending two key strokes or in the case of the jog increment keeping track of how many I's or shift- I's were sent so that has the potential to get out of sync, but other than that it seems really straightforward to just have my little on board uC scan my buttons and send the key or key sequences based on the keycode in the table below.

I found the table "most Common Keyboard Shortcuts" in the Axis documentation.
Do you know if there are additional commands documented elsewhere?

When you say it's a pretty bad idea to do this perhaps there is something I have overlooked?.

The Mesa 7i73 is interesting, but probably not a good fit for this project for a couple of reasons:
1) Physically if mounted as a daughter board would make the overall board depth thicker than I want.
2) I want to use the little touchscreen as I have used it before and it allows easy GUI enhancement in the future for things I can't anticipate now.

Assuming this will work for data to Linux, I now need to put my thinking cap on to figure out how to best get the Linux status data I would like to use back to my board so I can optimize the GUI. Jog Increment value would be a good start, I need to make a list.
 
Last edit: 2 years 3 months ago by slowpoke.

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

More
2 years 3 months ago #304613 by Cant do this anymore bye all
Just one thing to consider a USB connected device is not “realtime” and is at the mercy of all the delays, latency and disconnection and reconnection that comes with it.
Where as the 7i73 is realtime, rock solid and I’ve never seen it lose a connection.
Another great thing is due to the use of Cat5 cable for connection it can be mounted anywhere.
Unless you design your device to use native USB, which I can only recall one project that did ie: it enumerates as a HID device, you’ll basically be operating at serial port speeds rather than 2.5M bits a second. This may not be an issue depending on packet size.

Basically what it boils down to a 7i73 pendant is going to be more responsive than a USB based one.

Now there is always the possibility of implementing the smart serial protocol into your device.
The following user(s) said Thank You: slowpoke

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

More
2 years 3 months ago - 2 years 3 months ago #304638 by slowpoke
Good points. I did a reality check on responsiveness by setting jog increment to 0.001" and then banged in 10 moves as fast as I could and it caught all 10, so faster than me.

I'm not ruling out the 7i73, one option would be to buy one and then remove the chip and solder it to my board I don't need the other stuff on the board, or perhaps Mesa will sell me just the chip? This approach still looks a little messy because the data from the touchscreen also needs to make its way to the 7i73.

Earlier (IIRC) (EDIT you  actually it was spumco) provided a link to an ArduinoConnect project. This is another possible solution I watched the video and thought hmmm this might just work? So pulled a little Nano out of the smorgasbord of wires etc on my bench and perhaps 20 minutes later it was hooked up to my Linux machine and visible in HAL configuration however when I manipulated the one input and output it did not work. I will try and find some time today to see if I can get it working. From my really quick perusal of the code other than the 5 s heartbeat it's static unless something changes so hopefully low burden and hopefully responsive enough.

I made a quick list of things I want to get from Linux back to my board and it's really not much (from memory)
Mode: jog, MDI, gcode running = 2 bits
Status: Estop, machine power, spindle on = 3 bits
Limit switches: = 6 bits or 3 if I code them
Rates: jog, feed = 8 bits each.

I don't have a sense of how much Linux time will be required for the .py code used for the HAL interface to deal with a small amount of data like this? I will need to learn about Linux tools for evaluating timing and burden. Bored in retirement ya.... sure;-)
Last edit: 2 years 3 months ago by slowpoke.

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

Time to create page: 0.156 seconds
Powered by Kunena Forum