Electronic brakes for stepper motors