X27.168 Stepper to Speedometer

To use the X27.168 stepper effectively at maximum resolution, a special pulse sequence is required. You can find articles and Arduino libraries on line that go into the details, including here in this very forum. Very handy guide here.

In general, steppers have to be "homed" at startup. Most people drive them until a limit switch or end stop is reached, call that zero and then go about their business.

It does not damage a stepper motor to stall it, e.g. by driving into an end stop.