Quote Originally Posted by BeagleBrainz View Post
If you disable the drive before switching the switching the STEP & DIR it may help with not generating any spurious steps. Just don't forget to re-enable the drive before kicking off again.
Not intended to drag this conversation onwards, but for clarity on the behaviour of a stepper driver:

A stepper driver can be described as a finite-state machine. It will present a series of currents to each of the two (e.g.) coils according to the number of micro-steps selected. The following is an extract from the data sheet for the TB6600 - though the principle applies to any stepper driver.

Click image for larger version. 

Name:	Screenshot 2021-12-16 at 07.53.14.png 
Views:	2303 
Size:	131.1 KB 
ID:	30712

You should be able to see that for a 1/8 micro-step, there's 32 discrete states for the A/B coil currents. Whether you move CW or CCW, you're just stepping either forwards or backwards in the state-machine ("phase", in my original post).

My point?, if using two stepper drivers, each will maintain it's own internal state as its operated. If you swap the outputs from one driver to another - unless there's the random fluke of each driver having the same state, there WILL be a discrete change in the coil currents appropriate to the different phase in the state machine that WILL result in a discrete change in shaft position. There's no mechanism available to synchronise the drivers. Disabling the drivers before switching the STEP/DIR will have no impact on this.

A_Camera's point of switching grounds is valid - or my lazy assumption that you share a common ground.