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

More
2 years 8 months ago #294736 by Mecanix
Impressive already, not sure what else to say. I can't promise but I'll try to set-up an environment that match yours and see if I can contribute positive barebits. I'm currently keil and eclipse here, custom gcc & libs... I'd hate to screw this up. In other words I can't clone nor compile anything you did atm. Drives me nuts lool

Let me find a spare pc somewhere...

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

More
2 years 8 months ago #294737 by wez
I can see about porting the work over to Eclipse at the weekend if you like?

VS Code is just fast to get setup but being an industrial dev I'd like to move it over to Eclipse at some point anyway. Segger JTAG debugging is much 'easier' then in VS Code.

Just in case you didn't know the ESP-IDE native IDE is Eclipse based anyways. CMake under the hood etc

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

More
2 years 8 months ago #294738 by Mecanix
yeah I've seen you're using cmake, feeling at home with that already. Prolly better I set-up like you are with vs and the add-ons, I've actually never used vs let alone those arduino libs, all about learning new tricks.

If nothing works (I doubt) then we can think about porting over eclipse.

Assuming nothing works out of a vm (usb, comm parts) and I need a dedicated pc? Correct assumption?

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

More
2 years 8 months ago - 2 years 8 months ago #294739 by wez
Most hypervisors can do USB pass through, if it helps.
I believe MS Hyper-V Gen2 machine types would be the only ones that won't.

Which OS do you prefer?

VS Code and PlatformIO is easy and quick to use, once you get the fundamentals. Has its quirks when dealing with larger projects, it likes to randomly re-pull libraries occasionally (not an antivirus issue) which can slow things down sometimes. The "compile checks" on Upload can be infuriating so I flash using esptool from the build directory directly. I'm sure they can be disabled somewhere but not had chance to dig into it much.

The wokwi simulator has been very useful but it's not essential (looks are deceiving, it's actually good for testing non-motion related changes quick)

EDIT: here's a video of the dev simulator - don't think I've shared this on here before. Apologies if I have:
Last edit: 2 years 8 months ago by wez.
The following user(s) said Thank You: tommylight, Mecanix

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

More
2 years 8 months ago - 2 years 8 months ago #294742 by Mecanix
Dev on win10. Ok, using hypervisor and the usbid tool . Severe perf issue but it works (not so much lol). Cool. Let's set-up a successful compile in hyper-v first and take it from there.

Off to the weather channel. Anticipating a rainy day, and I'll get going! Appreciated man ++

edit. wait wait, hypervisor is the tech, not hyper-v. Tired, sorry... I'll update. 
Last edit: 2 years 8 months ago by Mecanix.
The following user(s) said Thank You: tommylight, wez

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

More
2 years 8 months ago - 2 years 8 months ago #294743 by wez
For those wondering - Once I get hands on one, for the ESP32-P4 I plan to experiment with developing a raw socket ioctl driver and custom ethernet frames. Essentially an abstraction layer for the Espressif RMT peripheral registers wants developing. If the native Ethernet PHY is anything like the current ESP32 that is...

With a custom emcmot driver it should, in theory, be possible to directly generate pulses from LinuxCNC RTAPI over native Ethernet via the ESP32-P4. It will not be easy.
High count rate servo encoders will likely be more of a challenge and I'm still undecided how to approach that just yet.

Goal being - have motion native to LCNC. I've had quite a few people ask for this already...

I recommend reading how the RMT peripheral generates pulses
docs.espressif.com/projects/esp-idf/en/v...peripherals/rmt.html
Multi TX, pulse bit stream etc

A stepper example via their IDF APIs here: github.com/espressif/esp-idf/tree/v5.2/e...ls/rmt/stepper_motor
 
Last edit: 2 years 8 months ago by wez.
The following user(s) said Thank You: tommylight

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

Time to create page: 0.386 seconds
Powered by Kunena Forum