Accelstepper

GF1021:
Robin2 ... here is the code with steeper.run removed.

This style of using AccelStepper is all wrong - and is more complicated than is needed.

void Mid() {
  for (i = 0; i <= 7500; i++) {
    stepper.setMaxSpeed(5000);
    stepper.setAcceleration(800);
    stepper.moveTo(i);
    stepper.setCurrentPosition(0);
    // stepper.run();  // Start moving the stepper
  }
}

Try this style and let the library do all the hard work

void Mid() {
    stepper.setMaxSpeed(5000);
    stepper.setAcceleration(800);
    stepper.moveTo(7500); // or maybe this should be stepper.move(7500);

}

and you could probably move the first two lines to setup() if they are always the same.

...R