Mesa smart serial or PktUART or serial over RS232 or udp for robot joints

More
22 Sep 2025 16:19 - 22 Sep 2025 16:23 #335287 by boksi
 [justify]Hello, I am looking for some advice here while still learning about Linuxcnc.I have robot arm with 6 custom drives and I would like to integrate it more with Linuxcnc and use kinematics module. Currently it is driven in joint space with mesa 6i25 via step/dir interface. From what I saw there are multiple ways to get joint positions into Linuxcnc. Have to tell here that encoders are in some way absolute as they use batteries and on power on send current position over uart and from that point and further on just behave as incremental and send A and B pulses (these pulses are added in software to first read out position). Position read is handled in drives. I am thinking about best way to transfer 6 encoder readings to Linuxcnc. Have to check with gear ratio but data from encoders would be at least 24 bits(with multiple turns) and lets fix it to be 4 bytes per encoder. Another thing is that this communication should be isolated from drives as step/dir are also isolated from drives.

My questions are :


1. Do I need this enc data only for handling robot joints limits and for first start up position read (as all loops are closed into drives)?

2. Are these encoders data needed every 1mS for servo tread (in respect that I want to move robot in Cartesian space)?

3. What would be constraints on timing and synchronization of these 6 encoder readings?
  
   My idea is to use one additional mcu (stm32) to do "fast" communication with 6 drives (via uart, spi, i2c or can but most probably uart(RS485) with speeds in range from 1Mbps to 2Mbps ), do acquisition of 6 encoder channels and send it Linuxcnc. Mcu could issue 6 read commands "simultaneously"  on 6 UARTs, wait for all responses (ISR with control logic in drives works at 16KHz so worst case ~62uS delayed response concerning priorities), pack data and send to Linuxcnc.

4.  Which one would be best/easiest to use? Mesa smart serial, Mesa PktUART, pc serial port with custom protocol, ethernet -> UDP or something else?

- PC serial port seems to be slow with max speed of 1115200 - 128000bps, have to do isolation

- Mesa smart serial, as I see no isolation (if I want to use it just with bare 6i25 + RS422 chip, perhaps there are some add on boards which offer isolation? ) and concerning post from 29 Aug 2021 18:33 #219118
"
Replied by PCW on topic Mesa Smart Serial Interface Questions (expanding and/or encoder card options)

PWM would be possible on sserial as would encoders.
    encoders use a lot of bits so it's not too practical to do multiple
    encoders on a remote sserial card due to the current 96 bit
    packet size limit (this has been expanded to 224 bits but no current
    sserial remotes use more that 96 in and 96 out)
    "
    If I use stm32 for acquisition of all enc data, I would need 6 encoder * 32 bits -> 192 bits in total (possibly little more), is there new firmware for packet size of 224bits already available for 6i25?  If so where I can find it?  If I don't want to use stm32 then I need fpga firmware (or mesa board) with at least 6 smart serial blocks but in this case each one of 6 drives would have to cummunicate over smart serial, not sure here if drives could follow smart serial timings due other higher priority tasks (as read on forum after sending request mesa serial is expecting reply in some time ~20uS(not sure in which phase discovery or...)      
    - stmbl code available
    - arduino code availale (work in progress as stated)

- Mesa PktUART, as I read available speeds can go very high around 10Mbps, have to provide isolation, Rx buffer size of 1024 bytes, would implementation be straight-forward or there could be some issues?
  I would still plan to use it with stm32 which collects 6 position data (24bytes) and send it via PktUART. Only issue here would be number of available UARTs on stm32 but possibly this could be resolved with remapping RX/TX pins.
  I suppose concerning fpga space, firmware for PktUART could be made along with 6 step gen for 6i25?

- Ethernet -> UDP seems to me as good option as it provides isolation and could be handled with available stm32 + W5500 and
  seems that there is some source code already available

 www.forum.linuxcnc.org/38-general-linuxc...or-linuxcnc?start=10

 forum.linuxcnc.org/24-hal-components/287...rduino-over-ethernet
 
Thanks[/justify]
Last edit: 22 Sep 2025 16:23 by boksi.

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

More
22 Sep 2025 17:09 #335293 by PCW
SSerialB is the large packet version of SSerial and firmware with SSerialB can
be built for any Mesa FPGA card the supports LinuxCNC.

But... if this is for a one-off  design it might be simpler to just have the required number of encoder
channels (either quadrature or absolute) built into the base interface.

(or if it's a big enough machine, use EtherCAT drives)

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

More
22 Sep 2025 18:10 #335298 by boksi
Thanks for fast answer.
I will check SSerialB, yes this is for one-off design and I will take a look at second proposal and see if my type encoder can be handled.

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

Time to create page: 0.248 seconds
Powered by Kunena Forum