Controlling 3 Stepper Motors

I'm trying to control 3 stepper motors, 2 NEMA 23 motors and 1 NEMA 17 motor, as well as a DC pump.

The sequence in which they operate is:

  1. Motor 1 runs for a set amount of time then stops and motor 2 must start.
  2. Motor 2 runs for a set amount of time then stops and this triggers the pump to turn on.
  3. When the pump turns off motor 3 will rotate in one direction and after a period of time reverse direction and finally stop.

The speeds of each motor are not the same.
I would appreciate any help regarding which libraries to use.

I'm using an Arduino Mega, 2 TB6560 drivers, 1 DM542 driver, 1 LN298 driver

The AccelStepper library is the most comprehensive and has good documentation. The standard Stepper library is not suitable for stepper drivers that take step and direction signals.

If you want the motors to move at higher speeds you will need to use acceleration.

Also, it is not difficult to control stepper motors that have drivers with step and direction inputs without any library.

...R
Stepper Motor Basics
Simple Stepper Code