Greetings all. I am using a ProDriver in my project to drive a lead screw to move a load. I use the step command with clock-in stepping to move the lead screw by, let’s say, 2000 steps or 10 rotations. During these 2000 steps, the microcontroller is blocked from doing anything else. Is there a way to operate the ProDriver in a non-blocking fashion over multiple steps while using the step command? I ask because I’m using the microcontroller to read several sensors and, ideally, I would use these sensors to give feedback to the motor (i.e. stop it if it exceeds a certain linear position).
I have tried advancing the motor single steps in a loop while the sensors are concurrently read, but the motion is too jerky for my application. I have also tried using FreeRTOS using the two cores of the ESP32 Thing Plus, one to run the motor and another to run the sensors… while this was initially promising, I ended up getting unexpected behavior when switching microstepping which lead me to abandon this approach as unreliable. I then moved to having two microcontrollers run the motor and sensors separately, now currently working on serial connection between them to exchange data however this seems like a cumbersome solution and I’m not sure it will work.
Thank you.