Best ARM SBC to use with LinuxCNC

More
04 Sep 2023 12:57 - 04 Sep 2023 13:24 #279824 by itsemast
I'm planning to build a very simple, small and cheap 3-axis CNC machine. I recently learned about Remora and RIO, and I would like to try both. My initial plan is to use SPI to talk to Remora or RIO that would generate STEP/DIR signals. Here is a simplified diagram:

I am a bit lost with the choice of the SBC, because there are so many options! The obvious leaders among chip manufacturers and their options for real-time Linux:
  • Broadcom (Raspberry Pi)
    • precompiled PREEMPT_RT kernel
    • Xenomai kernel patch
  • Texas Instruments (e.g. BeagleBone)
    • precompiled PREEMPT_RT kernel
    • Xenomai kernel patch
  • Rockchip
    • PREEMPT_RT kernel patch
  • Allwinner
    • PREEMPT_RT kernel patch
    • Xenomai kernel patch

Maybe I missed something in my research? Let me know. Maybe there are also not so obvious software/hardware options that I have missed. As I understand, RTAI was also ported on ARM at some point, but it's currently unsupported. What would be the best ARM SBC for running LinuxCNC?
Last edit: 04 Sep 2023 13:24 by itsemast. Reason: BeagleBone uses SoC from TI, not from NXP/Freescale

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

More
04 Sep 2023 14:05 #279831 by cornholio
I'd leave the BBB out of the equation, anyway they have PRUs that work fine for step generation, but you have to find an old wheezy image of machine kit. Unless you're happy with Wheezy an old version of machinekit (think linuxcnc 2.7 ish) and 512MB ram......

Raspberry Pi is not a bad candidate, well supported, some premade images based of Bookworm being made. The driver Scott has developed seems to be aimed and the RPi.

If Linuxcnc drivers are available for other hardware I'm not so sure.

As far as I know only the RT_PREEMPT is tested on the RPi (tho I maybe wrong).
Linuxcnc-RIO is a good option, also Litex-CNC (ethernet based) is good option. The following errors have all been sorted

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

More
04 Sep 2023 14:15 #279833 by cakeslob
Its down to drivers. Remora right now only have an RPi Driver . A rockchip/allwinner driver would be very cool.
I dont think realtime kernel will be such a big deal because you are using an external driver board

PocketNC still builds machinekit on BBB btw

But if you wanna use Remora (idk about RIO driver) you need RPi at the moment

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

More
04 Sep 2023 20:22 #279881 by itsemast
Yes, I also took a brief look at Litex stuff, but disregarded it for now as it uses Ethernet (the same hardware is supported by RIO through SPI).

The Linux side of both Remora and RIO seems mostly the same and only tested with RPi.

Internal PRU is a cool alternative, but it seems that it was only done on BBB and Orange Pi/Banana Pi with H3 SoC (allwincnc project is now declared unsupported). Newer chips from Rockchip and Allwinner are equiped with Cortex-M0 and RISC-V cores that can theoretically do the job, but they are mostly undocumented. The fact that someone wrote software that made use of H3's ARISC core is a miracle.

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

More
05 Sep 2023 03:56 #279921 by rodw
Personallly I think the SBC path is one of coutless hours of fruitless effort. You could start with an old Corporate PC or use a small Celeron  based 4 core. eg J1900 and higher. 

One such PC is the Odroid H3+ SBC. I am hesitant to recommend it as a couple of users  have reported issues despite my having the earlier Odroid H2+ working perfectly. I have a couple of Gigabyte Prix PCs with N3160 and J1900 which are still good performers.

Getting the PI to work should be solved  with an installer I am working on but how good the performance is remains to be seen.

Any of the other boards typically require the kernel to be built to get PREEMPT_RT and that is difficult, then you have to coax some performance out of them. I have tried getting an Odroid N2+ working with no luck.

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

More
05 Sep 2023 07:44 #279931 by itsemast
Older x86 hardware is cheap, powerful and very well supported, but the biggest problem with it is SPI bus. I have found AX99100 PCIe bridge that can be configured to work in SPI mode which even has a Linux driver, but then I need to find a board with that chip configured in the desired mode. And after this, I still need to modify LinuxCNC component to work with it. This is why I prefer to stick to ARM SBC.

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

More
05 Sep 2023 08:19 #279932 by cornholio
Linuxnc-RIO uses ICE40 FPGAs and work with SPI but there is an option to use a WT32-ETH0 as a Ethernet to SPI bridge.
Any PCIe to SPI bridge will need more than likely need a customlow level driver to suit Linuxcnc, the kernel driver may not be suitable.

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

More
05 Sep 2023 09:50 - 05 Sep 2023 10:33 #279938 by royka
I would say the Orange Pi 5, although I haven't tested the SPI I don't see a reason it wouldn't work. I've tried the RPi4 before but I've never used it, way too slow, no fun to work with.
Eventually managed to use the Orange Pi 5:

forum.linuxcnc.org/18-computer/39371-res...cnc?start=330#268433

forum.linuxcnc.org/18-computer/48079-can...cnc?start=220#273771

forum.linuxcnc.org/18-computer/48079-can...cnc?start=190#272208

​Guglielmi even managed to build a GPIO driver:
forum.linuxcnc.org/18-computer/48079-can...cnc?start=200#273554

Edit: After reading cakeslob's post I see that Remora indeed has a Raspberry Pi specific SPI driver. Remora over ethernet should work. Software stepping with the GPIO pins is a possibility too.
Last edit: 05 Sep 2023 10:33 by royka.

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

More
05 Sep 2023 11:43 #279945 by itsemast
Indeed, OPi5 seems very powerful. According to the datasheet, there are three Cortex-M0 cores in RK3588, the first is used for power management firmware, the other two are unused. This arrangement seems common on new Rockchip SoCs, but it doesn't seem anyone figured out how to make use of it.

Both Remora and RIO are using bcm2835 library on the Linux side for SPI, which makes it RPi specific, however it seems that it should be easy to change to spidev and make it run on any hardware.

Also, I had another thought: what if the MCU/FPGA used for STEP/DIR signal generation can be completely omitted? If I replace the A4988 drivers with something "smarter", it should be possible. For example, DRV8434 and TMC2130 support SPI for configuration and control. I am sure something like this was discussed before.

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

More
05 Sep 2023 12:40 #279958 by cornholio
I think hm2_spi works with spidev, rather than being Rpi specific like hm2_rpspi. That maybe an option.
Tho I think getting a RT kernel on the other boards might not be straight as forward.

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

Time to create page: 0.080 seconds
Powered by Kunena Forum