This happens with basically any code I use. Here is an example of one where it runs smoothly for a bit then gets really jerky and jumpy.
#include <Stepper.h>
// Define a stepper and the pins it will use
Stepper stepper1(200*8, 6, 7);
int count1 = 0;
void setup()
{
stepper1.setSpeed(15);
}
void loop()
{
stepper1.step(5);
}