Developing a Raspberry Pi Pico-based I/O Board for LinuxCNC

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 Mar 2025 11:10 #323820 by atrex77
Hi everyone,I've started developing an I/O board using the Raspberry Pi Pico. The prototype will feature 8x 24V outputs and 16x 24V inputs, communicating over Ethernet UDP with a real-time HAL driver. If everything works well, I plan to develop additional boards with step generation, analog outputs, and encoder inputs.At the moment, things are still evolving—I'm currently having the first batch of 5 PCBs manufactured and have already ordered the necessary components. Communication between the Pico and the real-time HAL is already working. :)I'll keep you updated as the project progresses!
The following user(s) said Thank You: Todd Zuercher, tommylight, elovalvo

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
14 Mar 2025 14:36 #323928 by atrex77
Hi everyone,
I recently ran a benchmark test on my LinuxCNC setup to measure the data request speed, and I thought I’d share the results with you all. I’d love to hear your thoughts or any suggestions for further optimization!
The setup was connected as follows: [Linux 4.19.0-27-rt-amd (core i5) PC (3 byte send 5 byte receive)] -> [switch (TL-SG1005D)] -> [W5100S-Pico]. This was a non-realtime throughput measurement, and the result I got was a stable 2500 requests/second, which I think is pretty solid. I’m curious about your experiences—has anyone else done similar benchmarks, and what do you think of this performance?

Thanks in advance for your input!

 
Attachments:
The following user(s) said Thank You: tommylight

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
14 Mar 2025 19:46 #323954 by atrex77
i make another test this time with raspberry pi4 (4gb)
 
Attachments:

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

  • andypugh
  • andypugh's Avatar
  • Away
  • Moderator
  • Moderator
More
14 Mar 2025 21:15 #323959 by andypugh
Looks promising. Many LinuxCNC hardware interfaces run at 1kHz, and that works fine for most purposes.
Are you using the PIOs to handle the communications? Maybe there are gains to be made there?

Does the Pi-Pico handle UDP natively?

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
14 Mar 2025 21:42 #323961 by atrex77
actually not using PIO now, the UDP data transfer runs on core0 and all io handling runs on the second core, i use the W5100s-evb-pico for the project with the wiznet library (using arduino ide) (for PIO testing i make a frequency generator (later stepgen) and send velocity from 1 of linuxcnc joint to it, it makes 2Mhz signal but dont have a fancy scope to find its jittering. Shock settled on my face, and a small smile appeared at the corner of my mouth when I saw the signal on the scope.

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
14 Mar 2025 21:47 #323962 by atrex77
i dont think all functions are able to handled with one pico, i have more time now for testing because the first PCB-s are only shipped on mar.23 and the components is in the coming week.

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
14 Mar 2025 21:56 #323963 by atrex77
i do not post it but i compiled my benchmark to windows also with nearly same results, so the pico is the bottleneck here.

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
14 Mar 2025 23:40 #323971 by atrex77
i have options to push the poll rate even further with PIO&DMA + using the W5100s interrupt pin.I won't be bored for a few days. :)

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

More
15 Mar 2025 02:46 #323979 by unknown
I think Scotta did some work with the Pico. Might be worth a look.

github.com/scottalford75/Remora-RP2040-W5500

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

  • atrex77
  • atrex77's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
26 Mar 2025 13:10 - 26 Mar 2025 13:11 #324962 by atrex77
Update: I'm making progress toward my goal. Here's a new screenshot of the burst transfer rate. I've moved away from Arduino IDE and switched to using the Pico-SDK and VS Code for coding. Added serial terminal to the code to set the IP address later without coding, the Pico now uses DMA and Burst SPI data transfer instead of byte-by-byte transfer. I don’t think I can push the transfer rate any further. Unfortunately, neither the PCB nor the components have arrived yet, so I can’t proceed with the I/O. In the meantime, I’ve started experimenting with the step generator.
 
Attachments:
Last edit: 26 Mar 2025 13:11 by atrex77.

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

Time to create page: 0.164 seconds
Powered by Kunena Forum