Change the code to issue one step at a time and check the voltages going to the windings - at least one must be wrong.