AP_MotorsMulticopter: fix battery resistance calculation

This commit is contained in:
Leonard Hall 2016-12-14 11:07:11 +09:00 committed by Randy Mackay
parent 4ae9c0cf49
commit a09d4db4fd
1 changed files with 1 additions and 1 deletions

View File

@ -303,7 +303,7 @@ void AP_MotorsMulticopter::update_battery_resistance()
_batt_voltage_resting = _batt_voltage;
_batt_current_resting = _batt_current;
_batt_timer = 0;
} else if(_batt_voltage_resting < _batt_voltage && _batt_current_resting > _batt_current) {
} else if (_batt_voltage_resting > _batt_voltage && _batt_current_resting < _batt_current) {
// update battery resistance when throttle is over hover throttle
float batt_resistance = (_batt_voltage_resting-_batt_voltage)/(_batt_current-_batt_current_resting);
if ((_batt_timer < 400) && ((_batt_current_resting*2.0f) < _batt_current)) {