ACCELSTEPER NEMA17 Maxspeed

How do I calculate the

 stepperX.setMaxSpeed(); // 

value for the NEMA17 stepper?
Or is it just try and error/luck
Harry

Have you looked at the library example sketches to see how they do it?

NEMA 17 is your motor face. NEMA has nothing to do with the electrical force or electrical specifications of your motor. Now exactly what motor do you have? Things like motor voltage and current?

Ron

Steps per rev?

The motor is a MKS Makerbase SERVO42C
200steps/rev

This is not just a ordinary stepper motor.
It has a builtin driver and added circuitry to count the actual steps taken and will compensate for missed steps. A very nice feature.

Basically yes.

Maximum speed is dependent on several factors.

The LOAD:
A heavier load will slow it down.
Normal steppers will start missing steps under to much load for the speed desired.
This stepper will compensate for that but it takes time to make up those steps so it still slows down.

The INPUT VOLTAGE:
The input voltage range for this Servo is 12-24v
The motors will have max torque at max input voltage.
This will help to maintain the highest speed under load by not missing as many steps.

The ARDUINO:
Which Arduino you are using can affect the speed.
An 8 bit Uno using Accelstepper can do about 4k steps a minute.
EDIT: correction 4K steps a second

Because of these factors it is hard to predict the max speed of a stepper motor.
But most steppers are not designed for high rpm.
Even under optimal conditions it is rare for a typical hobby stepper to reach an honest 1000 rpm.