Please check the phasing of the cable/motor combination. See https://duet3d.dozuki.com/Wiki/Choosing_and_connecting_stepper_motors#Section_Using_the_internal_drivers and the following section of the same wiki page.