That looks like a bad idea. It would block the rest of the code from reading any sbus data for 3 seconds.
Can you tell from your serial monitor how often do you receive and process sbus messages?
I'd add a Serial.print("S")
in the sbus conditional, and a Serial.print("M")
next to the runSpeed().
I'd suspect that they tick tick tick along with each other at a 1:1 ratio, and ideally, you'd like the stepper to run as fast as it needs to, at the same time that you read the sbus as fast as packets come in, with neither waiting for the other. The several delay(15)
lines inside the if (sbus_rx.Read()) {...}
is going to make you skip sbus packets and slow the stepping to less than 1/(0.015s*3)=22Hz
. A 200step/rev motor in a program with that won't run faster than 200/22*60=6.6RPM
The code looks like it needs to consider the tricks in :