mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-22 16:14:37 +08:00
save L R vals dispite out of range
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
* USB communication deadlock
|
||||
* EXTI handler redefiniton in V3.2
|
||||
|
||||
### Changed
|
||||
* Resistance/inductance measurement now saved dispite errors, to allow debugging
|
||||
|
||||
## [0.2.0] - 2017-11-12
|
||||
### Added
|
||||
* UART communication
|
||||
|
||||
@@ -684,11 +684,11 @@ static bool measure_phase_resistance(Motor_t* motor, float test_current, float m
|
||||
queue_voltage_timings(motor, 0.0f, 0.0f);
|
||||
|
||||
float R = test_voltage / test_current;
|
||||
motor->phase_resistance = R;
|
||||
if (fabs(test_voltage) == fabs(max_voltage) || R < 0.01f || R > 1.0f) {
|
||||
motor->error = ERROR_PHASE_RESISTANCE_OUT_OF_RANGE;
|
||||
return false;
|
||||
}
|
||||
motor->phase_resistance = R;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -726,12 +726,12 @@ static bool measure_phase_inductance(Motor_t* motor, float voltage_low, float vo
|
||||
float dI_by_dt = (Ialphas[1] - Ialphas[0]) / (current_meas_period * (float)num_cycles);
|
||||
float L = v_L / dI_by_dt;
|
||||
|
||||
motor->phase_inductance = L;
|
||||
// TODO arbitrary values set for now
|
||||
if (L < 1e-6f || L > 500e-6f) {
|
||||
motor->error = ERROR_PHASE_INDUCTANCE_OUT_OF_RANGE;
|
||||
return false;
|
||||
}
|
||||
motor->phase_inductance = L;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user