LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

More
7 months 3 weeks ago - 7 months 3 weeks ago #343890 by meister
something like this:

 

and it will generate the code for all FPGA's and MCU's

the interlinks are RS422 over RJ45 cables (like smart-serial)
Last edit: 7 months 3 weeks ago by meister.
The following user(s) said Thank You: epineh, tommylight, kzali

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

More
7 months 3 weeks ago #343935 by epineh
Oh very nice, one of those micro's look like the waveshare 2040zero and the other a pi pico? I have been playing around with using the pico, probably a 2350b with 48GPIO as an expansion port via SPI and using a SYNC pin from the nano to take snapshots at 1KHz intervals to keep readings accurate for encoder positions. The Pico's are awesome for this kind of work, serious cheap hardware. I also plan to use Tang to SPI to pico bus topology for expansion boards, mainly IO, if I want step/direction I will try RioSub, most of my machines are closed loop to the controller so only pwm/dir to Hbridges, but I have friends that want to use step/dir with commercial drives. I will test this on my own machines, let me know if you want anything specific for me to test.
Cheers.
Russell.

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

More
7 months 3 weeks ago #343936 by epineh
What comms layer are you thinking for data between the FPGA and MCU? You mention rs422, so I assume high bandwith serial over differential driver? I was going to use SPI with included SYNC signal for timing integrity but serial will use two FPGA pins and a differential driver instead of my scheme that will use 5 pins. I love the Tang Nano, cheap, and great toolchain. If I could keep using it then life would be good, pin count is it's worst enemy!
Cheers.
Russell.

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

More
7 months 3 weeks ago #343939 by meister
yes, at the moment i play with 1Mbit over RS422-Drivers and the exsisting uart plugin, i allready test 2.5Mbit without problems between two FPGA's.
The protocol is the same generated like between FPGA and PC plus checksum for serial.
Since only the bare minimum is transferred, the delays are extremely small.

the Firmware generator supports RP2040 (incl. waveshare zero) and ESP32 MCU's
based on Arduino toolchain, but you can use the interface stuff (pure c) for other controllers and own drivers that rio can not generate as a template.

I used RS422 so that simple cables (network/RJ45) can be used to bridge longer distances without any problems. This means, for example, that the step/dir generators can be attached directly to the motor if they have built-in drivers.

I am currently testing an MPG based on pico, which is also connected via RS422 (including power supply).
The following user(s) said Thank You: jpn9900

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

More
7 months 3 weeks ago #343951 by kostas
I tried riocore with a Tang nano 9k last year, when I first read about it. I loved the idea and I think you have done a fantastic job so far.
So a big thank you, although I have not done anything productive with LinunxCNC and riocore yet, mainly because I already have some Mesa cards that I use in my machines and not the time that I would like to have to start experimenting with a fun project with riocore. I love the idea that for simple projects I could potentially use riocore with a cheap FPGA board though, so hopefully I'll do this in the near future!

I have a project in mind right now though, that would ideally use a microcontroller for sending commands to the FPGA for driving two motors and I would like to know if I could potentially connect an ESP32-S3 or ESP32-P4 that I already have. I'm only familiar with Arduino framework so far and I tried to dive further in ESP-IDF in the past but that was more hard for my current experience. Do you think it would be possible and fairly simple to communicate an ESP32 board with the Tang nano over SPI, like your LinuxCNC driver does?

Kostas

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

More
7 months 3 weeks ago #343983 by meister
Hi kostas,
it's possible, there are already generated parts to drive the boards without linuxcnc (from Python/C, over MQTT / JS / ROS).
there is no generator for a microcontroller master, but it's not so hard to use the C client as an template for that.
But if you want to drive motors in Position mode, you need an PID controller inside the microcontroller, not so hard, but you need to write one.

Olli
The following user(s) said Thank You: kostas

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

Time to create page: 0.159 seconds
Powered by Kunena Forum