optimise stepper control