Calculation somehow?
-
Hi *,
I attached an additional thermistor at a corner of the bed. The idea is to heat the bed and wait till the sensor reads a temperature which indicates that the head travelled trough the complete bed.
I know that that does not mean that the 100% on the heat map is on the surface etc, I just want to improve the current status.Long story short: I search for a way to multiply the designated bed temp by 0.8 to get a temperature which I can reach at a corner of the bed.
So the idea is:
I set a variable in the slicer start code. This variable will be used in the start.g for the "M190 S". Multiplying the variable with 0.8 and while loop after that. This wile loop will wait than till the reading from the corner sensor will be grater as the new variable.Any ideas how to get that done?
Cheers, Chriss
-
@chriss
If you set your bed temp using M190 R{nnn} , it should already wait until the desired temp is reached provided that the sensor is associated with the bed heater.
You could put M116 after that as well if you wish.EDIT: My original usage of the R parameter was wrong and thinking on it, wouldn't work in your scenario anyway unless you combine the two sensors per this page.
https://docs.duet3d.com/User_manual/Connecting_hardware/Temperature_connecting_thermistors_PT1000#thermistor-parametersHowever, if you need to do it with a while loop, then this is what I have in one of my preheat macros.
Note that using a while loop will mean you can't easily cancel, so I use a global variable "cancelled" which I can set in various ways (triggers etc) to abort from loops.
You may not wish to wait for the bed to cool if it is above the temp you set and you will need to change sensor numbers etc.while (heat.heaters[0].current > global.BedPreheatTemp + 3) || (heat.heaters[0].current < global.BedPreheatTemp - 3) M291 R"Waiting for bed..." P{"Current temp = " ^ heat.heaters[0].current ^ " : target = " ^ (global.BedPreheatTemp)} S0 T2 G4 S3 if global.Cancelled = true M98 P"0:/macros/heating/all_heaters_off.g" abort "heating cancelled"
-
Thank for your input but I think that I was not precise enough. I do not want to wait till the temp is at the associated sensor. I want to wait first till the temp at a other sensor is at 80% of the temperature of the bed.
So I need to calculate somehow the 80% out if the temp which comes from the slicer.Cheers, Chriss
-
@chriss
Then for your target temp useheat.heaters[0].active * 0.8
assuming your bed heater is heater 0
-
Thanks... for the calculation. But I do not think that this will work as I can not attach to sensors to one heater, obviously.
Me me rephrase my problem:
1 Heater (H0) (the bed with the sensor in the middle)
1 additional sensor at the corner of the the bed.The idea is no to wait till the "corner sensor" has reached 80% of the temp if the sensor under the bed.
The waiting is not so much the problem. Is is more the way to do the multiplication and pass it to a G command.
My idea was to create a variable in the slicer start g code and pass that to the "M190 S" in my start.g followed by the loop for the 80% wait.
Cheers, Chriss
-
@chriss
All you need do is create a macro with similar code to that I have given you.
Then in your slicer start gcode after you set the bed temp just putM98 P"path_o_my_macro.g"
The macro will do the calculation and the waiting.
So if your sensor number is for example sensor number 5 you'd havewhile sensors.analog[5].lastReading < (heat.heaters[0].active * 0.8) G4 S1
If you just want to wait till the difference is within 80% regardless of whether the bed has settled on the active temp then use
while sensors.analog[5].lastReading < (sensors.analog[0].lastReading * 0.8) G4 S1
-
THANKS you very, very much! That was exactly the snipit I was looing for! You helped me a lot with the understanding of working with the meta command!
I will start playing a bit with it that brings me to a view more ideas.
Thanks a lot...
Cheers, Chriss