Temp: have heater update on 250ms intervals.
Thermal managers (PID, bang-bang, etc.) assume they're being ticked on 250ms intervals. In reality, they were being updated on each temperature reading, which was between 10ms and 250ms. This caused thermal management to malfunction. https://github.com/Traumflug/Teacup_Firmware/issues/211
This commit is contained in:
parent
803ff6e8b3
commit
8e977d50ce
2
clock.c
2
clock.c
|
|
@ -84,6 +84,8 @@ static void clock_250ms(void) {
|
|||
}
|
||||
}
|
||||
|
||||
temp_heater_tick();
|
||||
|
||||
ifclock(clock_flag_1s) {
|
||||
#ifdef DISPLAY
|
||||
display_clock();
|
||||
|
|
|
|||
19
temp.c
19
temp.c
|
|
@ -393,10 +393,6 @@ void temp_sensor_tick() {
|
|||
temp_sensors_runtime[i].temp_residency = 0;
|
||||
}
|
||||
|
||||
if (temp_sensors[i].heater < NUM_HEATERS) {
|
||||
heater_tick(temp_sensors[i].heater, temp_sensors[i].temp_type, temp_sensors_runtime[i].last_read_temp, temp_sensors_runtime[i].target_temp);
|
||||
}
|
||||
|
||||
if (DEBUG_PID && (debug_flags & DEBUG_PID))
|
||||
sersendf_P(PSTR("DU temp: {%d %d %d.%d}"), i,
|
||||
temp_sensors_runtime[i].last_read_temp,
|
||||
|
|
@ -407,6 +403,21 @@ void temp_sensor_tick() {
|
|||
sersendf_P(PSTR("\n"));
|
||||
}
|
||||
|
||||
/**
|
||||
Called every 250ms from clock.c. Update heaters for all sensors.
|
||||
*/
|
||||
void temp_heater_tick() {
|
||||
temp_sensor_t i;
|
||||
|
||||
for (i = 0; i < NUM_TEMP_SENSORS; i++) {
|
||||
if (temp_sensors[i].heater < NUM_HEATERS) {
|
||||
heater_tick(temp_sensors[i].heater, temp_sensors[i].temp_type,
|
||||
temp_sensors_runtime[i].last_read_temp,
|
||||
temp_sensors_runtime[i].target_temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Report whether all temp sensors in use are reading their target
|
||||
* temperatures. Used for M116 and friends.
|
||||
|
|
|
|||
Loading…
Reference in New Issue