I might be mistaken, but I think there is a mix-up of electrical angle and shaft angle in the Aligment and Cogging test example. Ever since I have been trying to use this test I've had the issue that I'm getting a huge error, which is growing more over every step of the test. Looking at the code in the example, we see:
float electricAngle = (float) direction * i * motor.pole_pairs * shaft_rotation / sample_count;
// move and wait
motor.move(electricAngle * PI / 180);
However I think motor.move() expects the shaft angle. Also when I run the example my shaft rotates 14 turns (my number of poles) instead of 2 as it reads from the code it should.