events: make required temp rise for calibration adjustable

This commit is contained in:
Paul Riseborough
2017-02-02 20:55:40 +11:00
committed by Lorenz Meier
parent 4ff5e7c5ab
commit 9e219fba0c
3 changed files with 20 additions and 9 deletions

View File

@@ -206,6 +206,10 @@ void Tempcalaccel::task_main()
}
}
// get required temperature swing
int32_t min_temp_rise = 24;
param_get(param_find("SYS_CAL_TEMP"), &min_temp_rise);
while (!_force_task_exit) {
int ret = px4_poll(fds, num_accel, 1000);
@@ -237,7 +241,7 @@ void Tempcalaccel::task_main()
if (!cold_soaked[uorb_index]) {
cold_soaked[uorb_index] = true;
low_temp[uorb_index] = accel_sample_filt[uorb_index][3]; //Record the low temperature
ref_temp[uorb_index] = accel_sample_filt[uorb_index][3] + 12.0f;
ref_temp[uorb_index] = accel_sample_filt[uorb_index][3] + 0.5f * (float)min_temp_rise;
}
num_samples[uorb_index]++;
@@ -257,8 +261,8 @@ void Tempcalaccel::task_main()
continue;
}
//TODO: Hot Soak Saturation
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > 24.0f) {
//TODO: Detect when temperature has stopped rising for more than TBD seconds
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > float(min_temp_rise)) {
hot_soaked[sensor_index] = true;
}

View File

@@ -172,6 +172,10 @@ void Tempcalbaro::task_main()
char param_str[30];
int num_completed = 0; // number of completed sensors
// get required temperature swing
int32_t min_temp_rise = 24;
param_get(param_find("SYS_CAL_TEMP"), &min_temp_rise);
while (!_force_task_exit) {
int ret = px4_poll(fds, num_baro, 1000);
@@ -201,7 +205,7 @@ void Tempcalbaro::task_main()
if (!cold_soaked[uorb_index]) {
cold_soaked[uorb_index] = true;
low_temp[uorb_index] = baro_sample_filt[uorb_index][1]; //Record the low temperature
ref_temp[uorb_index] = baro_sample_filt[uorb_index][1] + 12.0f;
ref_temp[uorb_index] = baro_sample_filt[uorb_index][1] + 0.5f * (float)min_temp_rise;
}
num_samples[uorb_index]++;
@@ -221,8 +225,8 @@ void Tempcalbaro::task_main()
continue;
}
//TODO: Hot Soak Saturation
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > 24.0f) {
//TODO: Detect when temperature has stopped rising for more than TBD seconds
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > (float)min_temp_rise) {
hot_soaked[sensor_index] = true;
}

View File

@@ -205,6 +205,9 @@ void Tempcalgyro::task_main()
}
}
int32_t min_temp_rise = 24;
param_get(param_find("SYS_CAL_TEMP"), &min_temp_rise);
while (!_force_task_exit) {
int ret = px4_poll(fds, num_gyro, 1000);
@@ -236,7 +239,7 @@ void Tempcalgyro::task_main()
if (!cold_soaked[uorb_index]) {
cold_soaked[uorb_index] = true;
low_temp[uorb_index] = gyro_sample_filt[uorb_index][3]; //Record the low temperature
ref_temp[uorb_index] = gyro_sample_filt[uorb_index][3] + 12.0f;
ref_temp[uorb_index] = gyro_sample_filt[uorb_index][3] + 0.5f * (float)min_temp_rise;
}
num_samples[uorb_index]++;
@@ -256,8 +259,8 @@ void Tempcalgyro::task_main()
continue;
}
//TODO: Hot Soak Saturation
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > 24.0f) {
//TODO: Detect when temperature has stopped rising for more than TBD seconds
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > (float)min_temp_rise) {
hot_soaked[sensor_index] = true;
}