I'm currently working on a project that involves controlling stepper motors at high speeds using an ESP32 board with built-in WiFi. However, I'm facing issues with the ESP32 WROOM 32 Dev Module, as it is unable to run the motors properly alongside WiFi communication.
I'm now looking for recommendations on the most powerful ESP32 board that can handle high-speed stepper motor control while maintaining reliable WiFi communication. Any suggestions or insights into boards that have been successfully used for similar applications would be greatly appreciated.
Maybe easier to use MobaTools instead. MobaTools creates the steps by timer interrupts in the background. So you don't have to bother with step creation in your sketch, which makes it a lot easier. In the sketch you only tell the motor what to do ( speed, target, ramping ... ). The moving itself is done by the ISR ( without blocking the sketch!). I think you will not need any FreeRTOS task to do this job.
MobaTools is able to create up to 30000 steps/sec on esp32 Wroom 32.
There is also an example controlling a stepper via WiFi on ESP32 ( unfortunately it is commented in german )
I edited the ESP32Web example and added a simple RTOS task running in parallel ( printing to the Serial line every second ) and it worked.
What may be a problem is running MobaTools from different tasks in parallel. MobaTools methods are not written to be re-entrant. I tried that and it worked, but that was more of a coincidence and will not be reliable.
Alright may be there could be problem with my code
I have discussed it with a professional
He said that its not a good idea to use the interrupts with FreeRTOS. Our application cannot compromise over slow speed and also other task should also work smoothly.
So we have decided to use 2 esp32 boards and connect via UART. One esp32 will handle the stepper motors and the other will be handling the wifi and LEDs strip tasks.
I didn't say your driver doesn't work. In order for the stepper motor to move, the microcontroller must generate a pulse for each step. Since you are doing a lot of other things as well, I assumed that might be the problem. If you control a TMC driver by UART, you can tell it how many steps to take, and the rest is taken care of by the driver, and the microcontroller does not need to generate a pulse for each step.