What controller are you using, as that will dictate what options are available?

Encoders/slot sensors are normally mounted on the spindle which a motor change shouldn't affect, and Mach must be seeing something if it's attempting a threading move (it should pause until it sees a suitable/stable spindle speed before moving).