Wait for passive thermistor temprature to stabilize
-
@garethky
I have a bit of programming experience, but I'm relatively new to the RRF conditionals.
To me it seems, your routine breaks when the momentary value is close enough to the target value?That doesn't tell you the temp has stabilized, it's just a coincidental match.
The real temp graph could be in a wild overshooting phase and you won't notice.What really tells you the temp has stabilized, is the difference between momentary max. temp and min. temp.
If this difference is smaller than your threshold you're ready to go. -
This is not intended to run an active heater. This is for passively heated scenarios where an actively controlled heater is running at a constant temperature. Its usually the bed heater. So overshoot shouldn't be a concern here because the active heat source is being controlled. Does that make sense?
It takes a temperature delta between now and 500ms ago. It will break if the delta is negative or smaller than the threshold value.
The 500ms gap between samples is a substitute for sample smoothing. There might be momentary fluctuations or noise but over 500ms that should be dominated by real temperature change. Its crude but its works for this specific scenario.
-
@garethky said in Wait for passive thermistor temprature to stabilize:
Even without variables I still need to store the loop counter and the last temperature reading.
There is a built-in loop counter, it's called 'iterations'.
-
@garethky said in Wait for passive thermistor temprature to stabilize:
Does that make sense?
Yes, the chance to see overshooting is pretty low in that case.
I was focussed to understand the way you misused the workplace offsets, I've missed this detail. -
@o_lampe said in Wait for passive thermistor temprature to stabilize:
I was focussed to understand the way you misused the workplace offsets, I've missed this detail.
Clever workaround for lack of variables.
-
@dc42 I wanted that to work and I tried it first. Maybe this is an SBC thing but this program gives me an error when I try to use
iterations
in the echo statement inside theif
statement:while true echo "Iterations: " ^ iterations if iterations > 5 echo "Final iteration: ", iterations break
Console output:
1/29/2021, 9:59:44 AM M98 P"0:/macros/test-iterations.g" Iterations: 0 Iterations: 1 Iterations: 2 Iterations: 3 Iterations: 4 Iterations: 5 Iterations: 6 1/29/2021, 9:59:44 AM Error: Failed to evaluate "iterations": 'iterations' used when not inside a loop in line 4 of test-iterations.g
-
@garethky, which firmware and DSF version are you running?
-
@dc42 3.2 Final
=== Diagnostics ===
RepRapFirmware for Duet 3 MB6HC version 3.2 running on Duet 3 MB6HC v0.6 or 1.0 (SBC mode) -
Thanks, I've asked @chrishamm to take a look.
-
@garethky Thanks for reporting this, I can reproduce this problem. It's caused by
break
which doesn't wait for pending codes to finish, so it terminates thewhile
block before it can evaluateiterations
.You can work-around this problem by adding an empty while-loop for now:
while true echo "Iterations: " ^ iterations if iterations > 5 echo "Final iteration: ", iterations while false ; nothing break
-
@chrishamm Thanks Chris!