mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:28:53 +08:00
events: make required temp rise for calibration adjustable
This commit is contained in:
committed by
Lorenz Meier
parent
4ff5e7c5ab
commit
9e219fba0c
@@ -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) {
|
while (!_force_task_exit) {
|
||||||
int ret = px4_poll(fds, num_accel, 1000);
|
int ret = px4_poll(fds, num_accel, 1000);
|
||||||
|
|
||||||
@@ -237,7 +241,7 @@ void Tempcalaccel::task_main()
|
|||||||
if (!cold_soaked[uorb_index]) {
|
if (!cold_soaked[uorb_index]) {
|
||||||
cold_soaked[uorb_index] = true;
|
cold_soaked[uorb_index] = true;
|
||||||
low_temp[uorb_index] = accel_sample_filt[uorb_index][3]; //Record the low temperature
|
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]++;
|
num_samples[uorb_index]++;
|
||||||
@@ -257,8 +261,8 @@ void Tempcalaccel::task_main()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Hot Soak Saturation
|
//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]) > 24.0f) {
|
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > float(min_temp_rise)) {
|
||||||
hot_soaked[sensor_index] = true;
|
hot_soaked[sensor_index] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ void Tempcalbaro::task_main()
|
|||||||
char param_str[30];
|
char param_str[30];
|
||||||
int num_completed = 0; // number of completed sensors
|
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) {
|
while (!_force_task_exit) {
|
||||||
int ret = px4_poll(fds, num_baro, 1000);
|
int ret = px4_poll(fds, num_baro, 1000);
|
||||||
|
|
||||||
@@ -201,7 +205,7 @@ void Tempcalbaro::task_main()
|
|||||||
if (!cold_soaked[uorb_index]) {
|
if (!cold_soaked[uorb_index]) {
|
||||||
cold_soaked[uorb_index] = true;
|
cold_soaked[uorb_index] = true;
|
||||||
low_temp[uorb_index] = baro_sample_filt[uorb_index][1]; //Record the low temperature
|
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]++;
|
num_samples[uorb_index]++;
|
||||||
@@ -221,8 +225,8 @@ void Tempcalbaro::task_main()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Hot Soak Saturation
|
//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]) > 24.0f) {
|
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > (float)min_temp_rise) {
|
||||||
hot_soaked[sensor_index] = true;
|
hot_soaked[sensor_index] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
while (!_force_task_exit) {
|
||||||
int ret = px4_poll(fds, num_gyro, 1000);
|
int ret = px4_poll(fds, num_gyro, 1000);
|
||||||
|
|
||||||
@@ -236,7 +239,7 @@ void Tempcalgyro::task_main()
|
|||||||
if (!cold_soaked[uorb_index]) {
|
if (!cold_soaked[uorb_index]) {
|
||||||
cold_soaked[uorb_index] = true;
|
cold_soaked[uorb_index] = true;
|
||||||
low_temp[uorb_index] = gyro_sample_filt[uorb_index][3]; //Record the low temperature
|
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]++;
|
num_samples[uorb_index]++;
|
||||||
@@ -256,8 +259,8 @@ void Tempcalgyro::task_main()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Hot Soak Saturation
|
//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]) > 24.0f) {
|
if (hot_soak_sat[sensor_index] == 10 || (high_temp[sensor_index] - low_temp[sensor_index]) > (float)min_temp_rise) {
|
||||||
hot_soaked[sensor_index] = true;
|
hot_soaked[sensor_index] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user