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

More
03 Mar 2024 11:03 #295004 by wez
Thanks Tom.
I agree entirely but just thinking longer term here...
What happens if there's an FPGA shortage in the future or mesa have supply issues? I've both seen it and experienced it!

Espressif have proven supply commitments for 12 years and so far have lived up-to that commitment. The Sx series from 2020 onwards is 12 years.
FPGAs, certain models specifically *may* end up on long leads in the future. Never say never!

The only key differentiator is that Espressif are used absolutely bloody everywhere - when you look close enough. The chances of them them being on a long lead in the next, say 6+ years, I'd personally estimate as slim to none. Besides, buying a reel of 5k units is 5k or less!

PS: I wasn't thinking multiple boards - I mean a custom EMI compliant/resistant PCB with multiple ICs on it. So an all in one but flexible config :)
The following user(s) said Thank You: tommylight

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

More
03 Mar 2024 11:25 #295006 by tommylight
I agree with you on supply, strange that i do not think about that, but it is most probably as i got used to it, i have trouble getting M3 screws!
Again personally, i like Arduinos, they do have it's use cases, but only after getting ESP32 and seing what it can do i started using actually using them, cudos to Espressif for it, and 900 pages of documentation! :)
ESP32 can run Linux, in case you missed it, search for it on youtube, i think it was level14tech or similar channel.
There's an idea, whoever was complaining about this, make it run LinuxCNC, headless or toothless or whatever so we can all be impressed! :)
Back on topic, this is awesome.
The following user(s) said Thank You: wez

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

More
03 Mar 2024 11:38 #295010 by wez
Thanks!

Yeah they are truly amazing when you get to know them. Incredibly flexible.

Highest uptime I've had is 1686 days running an electricity monitor, WiFi up and down and all that.

Key part to reliability with them (as with most things) is firmware and board design/EMI. There's so much - not-so-great - quality out there but it's the IOT/tinkerer space so understandable.

Yeah I've have a go with the Linux side of things, really cool idea, it'd just be so much work getting all the peripherals to function at high speed, even then it'd need a split architecture like I mentioned to get anything "comparable" to an FPGA. Better just to write specifically optimised firmware natively for pulse gen and dev custom ethernet frames.

I do firmly believe RMT 700kHz for single axis pulse output is possible given what I know so far - it's a decent amount of work but reckon it will pay off in the long run... maybe!
The following user(s) said Thank You: tommylight

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

More
03 Mar 2024 12:55 - 03 Mar 2024 14:31 #295028 by wez
Off topic....
Hmmmm a brief scan of emc... theoretically porting it over to an ESP32-P4 may be possible. Piping sockets via eth for UI etc Might be worth it to help with all RT kernel shenanigans. Even if just supports EtherCAT. Near instant power on, rock solid, no jitter. May even be possible to do a decent res HDMi out and render an LVGL UI... Keep it modular

EDIT:
So Linux kernel 5.0 supports RISC-V. The current linux S3 support is via a RiscV VM on the Xtensa cores. ESP32-P4 in all likely hood will end up with an MMU or a VM that provides one much like the S3 but native Risc-V, With enough SRAM, stripping out components, reduce memory footprint and possibly a lot of kernel hackery I reckon it wouldn't be as difficult as one would imagine. Native PHY ethernet support is the main one. Jiggery pokery with some pipes, if needed. Lots of oversimplification but it'd be possible eventually...

Come on Espressif... release your qemu patches for the P4!

Also possible to run uClinux with nommu on RiscV natively which the P4 will likely run nicely. Stack overflow mgmt be a challenge but not impossible. Being able to easily add 64mb of osram on the p4 just like the s3. Yeah, it'll happen someday. Headless emc2. Perhaps even with stepper RMT peripheral support running too as well as possibly EtherCAT 
Last edit: 03 Mar 2024 14:31 by wez.

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

More
03 Mar 2024 13:00 #295031 by cornholio
Keep you eyes on the prize, don't get too distracted.

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

More
03 Mar 2024 13:02 - 03 Mar 2024 22:55 #295032 by wez
Haha I'm not, just a note. This gets done first and as good as can be :)
"Just because you can, doesn't mean that you should..." springs to mind
Last edit: 03 Mar 2024 22:55 by wez.

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

More
04 Mar 2024 06:24 #295111 by wez
Hey folks,
Another bump and update.

May be barking up the wrong tree here but here goes...

A consistent 500kHz pulse gen output on a single axis, including accurate pulse tracking, using a mix of Espressif IDF and registers via RMT has now been proven.

There remains quite a few improvements which can likely squeeze another 30% or so out of it. There may be more as efforts continue.

R&D was performed on a ESP32-S2 (less IRAM, single core) mainly to prove that it is possible on the smaller architecture. The S3 dual core will, in all likely hood, improve it further. P4 possibly more, but impossible to say currently. P4 may be capable of two to three axis at those rates, or a single axis but much higher.

Based on my math and current dev, as it stands: Encoder support at a max 60k~ quad and an axis PID controller (configured and monitored via LCNC) is reasonable with a bit of room to spare on the S3 or ESP32 (dual core).

Given the cost, reliability and abundancy of these ICs and time spent discovering an optimal solution; I will not be releasing this specific aspect as open source due to the impact and commercial interests surrounding it. I hope that people understand this.

A high step rate, precise, multi-axis solution (6 axis) that is robust via a custom EMI complaint PCB with multiple ICs including easy firmware management is all relatively easily achievable. 3.3-60v configurable PWM outputs, VFD control (rs485/modbus) and wireless probes are all features that can and will be included. Envisage two versions of PCB - one with integrated stepper drivers and multi-type encoders, just add motors & another that supports external drivers and multi-type encoders but can be disabled if not required.

As it stands currently, that's approximately 3Mhz of 6 axis pulse rates and closed loop encoders if one ICs per axis is used.

Native low latency & jitter via a single Ethernet connection to LCNC (ESP32) is already proven (master IC). Possible upgrade to P4 later subject to thorough testing.

Espressif offer (and have deployed previously) firmware security, signing and secure bootloaders to protect the end product.

Would anyone be interested in sponsoring/investing in this type of product in order to continue further development and testing of the hardware?

Can explore kickstarter/crowdsupply if needed but I believe having a reasonably priced, globally available controller for LinuxCNC (as well as other motion control applications) that would be suitable for the *majority* of machines that's also seamless to setup would be useful.

I still intend on releasing the current multi-axis multi-architecture of 200-300khz source which includes Ethernet & USB support.

This separate solution is aimed at the larger high precision machines to support retrofit application and will be tested to ensure it's suitable for micron level precision machining without AC servos.

Thanks all
The following user(s) said Thank You: tommylight

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

More
04 Mar 2024 12:55 - 04 Mar 2024 13:09 #295130 by wez
1Mhz controlled pulse output has been achieved on a single RMT channel. DMA backed. There's a load of work to get it into a maintainable state as it uses latest frameworks & APIs but it is possible.
Last edit: 04 Mar 2024 13:09 by wez.
The following user(s) said Thank You: spumco

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

More
05 Mar 2024 04:01 #295187 by wez
Tom - thanks for bearing with me and letting this sit under General Chat section for so long.

Happy for this to be moved over to Computers and OS's to similar place where Remora lives if you think it's more appropriate? Don't want to detract from others wanting help and whatnot. Thank you!

PS: 20Mhz of reliable multi-channel encoder input (pulse counting) validated on the S3. Specs state PCNT is capable of 40mhz but GPIO matrix holds it up a wee bit - might be able to tune a bit more. Direct GPIO which bypasses the mux is also possible on the S3.
The following user(s) said Thank You: tommylight

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

More
05 Mar 2024 12:35 #295226 by tommylight
20MHz ??? :)
Will move it later, thank you.

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

Time to create page: 0.096 seconds
Powered by Kunena Forum