Stepper motor speed control by encoder

peitroc:
Hi Robin, thanks for the reply.
Actually I did not tested the program yet, as I have my test bench my work only.

And what if your program is working properly - then we would all be wasting our time.

The blocking of Arduino in this case should not be an issue. I don't want to do anything else while running the stepper (this is actually a peristaltic pump). Only when encoder is turned, I like to change rpms of the stepper.

Does that mean that you only want to dial in another speed when the motor is stationary? If so, then blocking stepper code won't matter.

...R