Accel stepper library with support for 28byj-48 motor

If you indent your code consistently it is easier to see the problem

void loop()
{
       // Change direction at the limits
    if (stepper3.distanceToGo () == 0) {
        stepper3.moveTo(1700);
    }
    stepper3.run();
    stepper3.moveTo(0);
    stepper3.run();
}

The command stepper3.run() is what makes the motor move and it must be called more often than the motor needs to take steps. It does not implement the entire move with one call. For that you need the blocking function runToPosition()

The way your code is written, as soon as you set the distance to 1700 you set it back to 0.

Try this variation and see what happens

void loop()
{
       // Change direction at the limits
    if (stepper3.distanceToGo () == 0) {
        stepper3.moveTo(1700);
    }
    stepper3.run();

}

...R