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

More
2 years 8 months ago - 2 years 8 months ago #294835 by wez
Proof of the revised smooth motion engine on the ESP32 (works across all ESP32, S2 and S3).
Ultra high speed, high precision and high accelerations. 80khz on a Nema 23 stepper servo. No pulse filtering enabled on the driver either.

A 2$ microcontroller.

Listen to it scream!

Those are actual mm units flying by on LinuxCNC. 320 Axis scaling (5mm pitch ballscrew) at 1600ppr driver. 



 
Last edit: 2 years 8 months ago by wez.
The following user(s) said Thank You: tommylight, hairy

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

More
2 years 8 months ago - 2 years 7 months ago #294860 by wez
Conscious of development scope creep...

After more research, subject to licensing and legal review, I've concluded that it is possible to implement EtherCAT. This could be a slave device with LinuxCNC being the master due to the amazing work on LinuxCNC that's been done already.

It should work over USB since the stack just sees Ethernet frames, ideally though, ESP32 or new ESP32-P4 with native Ethernet PHY would be most appropriate. Why not both?

No TCP/UDP overhead, configurable, fits into any existing EtherCAT setups. Proven. EoE (Ethernet over EtherCAT) support so ESP32 can continue to be configured/diagnosed via its WebUI too.

What's the interest in an EtherCAT multi-axis stepper & DC motor controller?

EDIT: EtherCAT will solve the minor ferror delay since master (LCNC) and slave (ESP32) will be timing synchronised over Ethernet. Therefore LCNC should know precisely where an axis is at any point in time. 
It's also no longer a "slave" card anymore, as others may put it, take a look at AC Servo drives and LinuxCNC - Marco Reps video for example.
Effectively becomes a well integrated extension of LCNC for steppers and DC servos. Once Encoder support is added then allowing LCNC to perform axis PID closed loop with all the benefits that brings.

For those that say its impossible.... wanna bet? :) Lets start at 1 BTC and go from there?

EDIT:
Well... I'll eat part of my hat... it's "technically" possible to develop a solution without an ESC via the ET9300 slave stack and build a virtual state machine (there are slave simulators) and most of the work can be done in DMA etc - I'd ultimately still have to be part of the ET group (usual membership licensing) in order to actually use it and so realistically whilst it's "possible" it's not feasible considering the cost vs time benefits. 
External hardware can be purchased (ESC IC) but that's not the project goal. ESC ICs are reasonably priced (LAN9252 etc), SOES exists as open source so developing a EtherCAT slave motion controller is most certainly realistically feasibly (look at EasyCAT) - but is it actually worth it for the use-case?

I believe a bespoke "simple" custom Ethernet frames would be faster to develop overall with no extra hardware dependencies, given that (IMHO at least anyway) most Stepper/DC servo driven LinuxCNC deployments are a point-to-point motion controller and not aimed at an industrial solution (Ethernet based). Nothing prevents users from using multiple Ethernet interfaces if they require EtherCAT master in LCNC in addition to a stepper solution (rarely, but it's possible).

That's not to say an ESP32 hardware with an ESC IC and being fully EtherCAT slave "compliant" won't be developed in future though, once the current opensource UDP version is proven.

I'm sure a multi-axis EtherCAT ESP32 motion controller board will be beneficial to the project longer term. Trust will eventually build on the ESP32s, I've had 7 years of continual experience with them (various ECOs etc) in numerous environments - IC cost and "tinkerer" reputation really should not be a consideration. IC reliability, availability and longevity should!
 
Last edit: 2 years 7 months ago by wez.
The following user(s) said Thank You: tommylight

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

More
2 years 7 months ago #294882 by wez
The important part - position repeatability and look for step losses at high speeds.
Essentially the test is to zero the X axis where it starts from then move randomly to different positions using absolute machine co-ords and then back to X0. Switches to relative positioning after that with much the same.


So far so good. A couple of things to improve which are listed on the video description but all things considered and the speeds, I don't think it's half bad...


The following user(s) said Thank You: aparecido, Mecanix

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

More
2 years 7 months ago #294886 by michalb
Hi, i think I2S output, may be good solution for more axis on higher frequency. I have i 3d printer with TinyBee (ESP32) board and this working very well. I2S Should give nice buffering. I don't test it but maybe I2S may working as input. This mean 32 fast Input and output. But this is not implemented in FastAccelStepper.
The following user(s) said Thank You: wez

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

More
2 years 7 months ago - 2 years 7 months ago #294888 by wez
Thanks for the suggestion. I've had a few people recommend this and I've done quite a bit of analysis around it.

I2S is great and certainly usable, and as probably already know is used in other projects. However realistically speaking, Espressif don't "officially" support the I2S peripheral as a stepper driver, strictly speaking. Only for their RMT.

RMT can be extremely fast, with minimal interrupt load.
With additional tuning, which I plan on digging into eventually at some point, it will likely go high than 200khz total. That's if it's actually needed.

Performance testing of RMT has proven to be excellent, BUT more importantly - reliable - never missing a single step at all speeds on 6 axes - which is ever so important to this project.
I'm not saying that I2S would if it were adapted to this use-case, but its best to stick with something that's proven specifically for this case.

Adjusting the existing libs that's used elsewhere (FluidNC etc) will require a reasonable amount of work (testing included) to not utilize trajectory planning in addition to adjusting accel/decel profiles as well as passing speed, position, velocity feedback to the host with near zero latency which for this use-case is absolutely essential.

I hope you have seen my earlier video showing the speeds and smoothness at 80khz?

Really though - how many people need an 80khz step pulse on single axis??
I truthfully can't think of any but certainly open to reasons why, and so if there are please provide them!

200khz total for 6 axis - all 6 motors moving simultaneously at 33khz, really?

Thanks
Last edit: 2 years 7 months ago by wez.
The following user(s) said Thank You: aparecido

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

More
2 years 7 months ago #294889 by michalb
I've seen all your videos. It looks promising. At the moment I'm using 4 axes at 50kHz div 8 microstepping. I prefer div 16, but I'm using Paralelport, so at 100khz, the Paralel port works, but the PC is not responsible. You're right, 4 axes 50kHz will be suitable for more than 99% of Hobby machines.
The following user(s) said Thank You: wez

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

Time to create page: 0.570 seconds
Powered by Kunena Forum