Skip to content

Commit 0ff0112

Browse files
authored
Merge pull request #157 from dreusel/patch-1
Cool thanks
2 parents 678c578 + 452e1b8 commit 0ff0112

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/utils/calibration/alignment_and_cogging_test/alignment_and_cogging_test.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ void testAlignmentAndCogging(int direction) {
3535

3636
for (int i = 0; i < sample_count; i++) {
3737

38-
float electricAngle = (float) direction * i * motor.pole_pairs * shaft_rotation / sample_count;
38+
float shaftAngle = (float) direction * i * shaft_rotation / sample_count;
39+
float electricAngle = (float) shaftAngle * motor.pole_pairs;
3940
// move and wait
40-
motor.move(electricAngle * PI / 180);
41+
motor.move(shaftAngle * PI / 180);
4142
_delay(5);
4243

4344
// measure

0 commit comments

Comments
 (0)