fix resistance measurement factor 2 error

This commit is contained in:
Oskar Weigl
2017-08-19 23:05:24 -07:00
parent b01e43c9bd
commit 40e076b5e5
+1 -1
View File
@@ -823,7 +823,7 @@ static bool measure_phase_resistance(Motor_t* motor, float test_current, float m
motor->error = ERROR_PHASE_RESISTANCE_MEASUREMENT_TIMEOUT;
return false;
}
float Ialpha = -0.5f * (motor->current_meas.phB + motor->current_meas.phC);
float Ialpha = -(motor->current_meas.phB + motor->current_meas.phC);
test_voltage += (kI * CURRENT_MEAS_PERIOD) * (test_current - Ialpha);
if (test_voltage > max_voltage) test_voltage = max_voltage;
if (test_voltage < -max_voltage) test_voltage = -max_voltage;