jzolee / HAL2UDP

External step generator and IO interface for LinuxCNC over Ethernet with dual-core ESP32 and W5500 modules.
GNU General Public License v2.0
19 stars 11 forks source link

Limit of stepper frequency/ stepper number #2

Closed disc0018 closed 7 months ago

disc0018 commented 1 year ago

The steppers limited to 4 with your design, due to the 4 hardware timers of the Esp32. Ist there a possibility to cascade the Esp32 based on the SPI bus. To use more than 1 Esp32 to drive more than 4 steppers?

The steppers frequency is limited by the 4 timers. Your Esp32 uses a clock speed of 80Mhz. In this settings you reached a stepper frequency of 40khz. Is it possible to reach a stepper frequency of 120khz with a maximum clock speed of 240 MHz?

You isolated the stepper to a separate core of the Esp32. How long is the delay between sending the UDP Paket from linuxcnc and the getting the result of the Esp32. I was thinking about a similar Project using an Raspi Pico and driving the Steppers high speed with the 8 PIO State machines. But on the other hand the MESA Card with SPI Bus is a very straightforward option for an Raspi4 etc.

jzolee commented 1 year ago

The frequency of the steppers is not limited by the timers, but by the fact that even during the shortest pulse it is necessary to be able to calculate the length of the next pulse for all axes. This is the only way to achieve perfect acceleration. Therefore, if we were to use only one axis, the step frequency would be about 120 KHz. However, using 4 axes, only 30 KHz is possible. I wrote the project on the Arduino platform, so I think it ticks at 240MHz. The udp packet exchange: ~0.55 milliseconds. (if you watch the video, you can see the udp-thread time).