Stepper motors changing direction during homing function?

There are two sprockets 6 meters far so I connected a motor to each sprocket. There is the same configuration on a similar machine but with servo motors ... more expensive.