ESP32/S2/S3 LinuxCNC Controller (6 axis hardware step gen), USB plug-and-play

More
2 years 8 months ago #294312 by Cant do this anymore bye all
Ethernet or using gpio only, really upset about SPI not going yet. And spidev being not suitable, works fine during a “static” halrun session but fails once added to a thread.

So until then my RPi5 and nvme adapter sit in a box on a shelf.
So my FPGA board will use EPP to a x86 and if & when the RPi5 has a working hostmot2 drive I’ll change firmware and go that way. The small saving will be great for my location.

I’m still curious as to how the USB real-time thing works. Has there been recent developments in getting USB operating in real-time. I know some projects that buffered the data but would seem it not suitable for threading and rigid tapping.
Reading the code wouldn’t work for myself as I’m a bit of a knuckle dragging Luddite ;)

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

More
2 years 8 months ago - 2 years 8 months ago #294313 by Cant do this anymore bye all
Oh yeah the RPi5 is kinda of similar to a low end modern x86 system with regards to responsiveness.
I was surprised in the speed to which it could build a kernel and  Linuxcnc. Even when using an SD card. Not enough spare beers tokens yet to buy an drive to go with my adapter.
Last edit: 2 years 8 months ago by Cant do this anymore bye all.
The following user(s) said Thank You: wez

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

More
2 years 8 months ago - 2 years 8 months ago #294317 by wez
Yea I think RPI5 may have been rushed to market a tiny bit, but the foundation has always been a progressive development style for its software, which is completely understandable.

Re: USB RNDIS/ECM networking.

It uses the S2/S3 built-in USB PHY hardware peripheral much like the native Ethernet RMII PHY on the older ESP32.
The networking stack (LWIP) is pretty much the same as Ethernet so the same optimisations can be applied resulting in low latency and jitter.
The only difference this time are two things:
1) the idea of using it with knowledge of USB stack, descriptors and drivers and pursuing it enough to get desired results (risk vs time sink)
2) someone digging deep into S2/S3 LWIP stack in the esp-idf and wrote a driver and made sure it actually works. Me, ha.

It's always been possible but requires compatible hardware (MCU peripherals) and software engineering. Just look at Mach 3 USB control boards as an example which operate in a similar fashion USB HID etc but are closed firmware sources mostly.

EDIT: Just for clarity, I don't mean a "driver" on the PC/Host - I mean one for the esp-idf usb stack running on the MCU itself. esp-idf USB networking has always been sort of half-baked, e.g not fully implementing host based access to its networking stack (wifi bridging mode only)
Last edit: 2 years 8 months ago by wez.

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

More
2 years 8 months ago #294326 by Cant do this anymore bye all
So at the PC end is the physical connection via a USB port or an Ethernet port ?
If the physical connection at the PC is USB how are you getting the USB subsystem working in a real time environment.
With Mach3 and USB I was lead to believe that almost all the heavy lifting was performed via the USB board. Some also mentioned that threading was not possible.

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

More
2 years 8 months ago #294328 by Cant do this anymore bye all
Had a quick look and since I last had a play with Mach3 around 2014/15 apparently threading with a smoothstepper board is possible.

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

More
2 years 8 months ago #294329 by wez
It can be either USB or Ethernet. ESP32 will be Ethernet. ESP32 S2/S3 will be USB.

The MCU does all the heavy lifting with "threading" - really though it uses a mixture of FreeRTOS (to do the threading), hardware interrupts, hardware timers, RMT hardware peripheral for step generation and since it has 2 cpu cores - one is dedicated to all realtime tasks like network packet handling.
Encoder inputs uses the hardware PCNT (pulse counter) peripheral coupled with some special handling to ensure it can handle high counts

Hope it helps

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

Time to create page: 0.212 seconds
Powered by Kunena Forum