mirror of https://github.com/rusefi/bldc.git
Updated hall_analyze deviation calculation
This commit is contained in:
parent
1016ab076b
commit
f9bbb3c0e6
|
@ -880,12 +880,13 @@ void terminal_process_string(char *str) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((max - min) <= 5) {
|
float deviation = (max - min) / 2.0;
|
||||||
commands_printf("Maximum deviation: %.2f degrees. This is good alignment.\n", (double)(max - min));
|
if (deviation < 5) {
|
||||||
|
commands_printf("Maximum deviation: %.2f degrees. This is good alignment.\n", (double)deviation);
|
||||||
} else if ((max - min) < 10) {
|
} else if ((max - min) < 10) {
|
||||||
commands_printf("Maximum deviation: %.2f degrees. This is OK, but not great alignment.\n", (double)(max - min));
|
commands_printf("Maximum deviation: %.2f degrees. This is OK, but not great alignment.\n", (double)deviation);
|
||||||
} else if ((max - min) < 15) {
|
} else if ((max - min) < 15) {
|
||||||
commands_printf("Maximum deviation: %.2f degrees. This is bad, but probably usable alignment.\n", (double)(max - min));
|
commands_printf("Maximum deviation: %.2f degrees. This is bad, but probably usable alignment.\n", (double)deviation);
|
||||||
} else {
|
} else {
|
||||||
commands_printf("Maximum deviation: %.2f degrees. The hall sensors are significantly misaligned. This has "
|
commands_printf("Maximum deviation: %.2f degrees. The hall sensors are significantly misaligned. This has "
|
||||||
"to be fixed for proper operation.\n", (double)(max - min));
|
"to be fixed for proper operation.\n", (double)(max - min));
|
||||||
|
|
Loading…
Reference in New Issue