How to trigger a thermistor temp too high error without a heater
-
Hi,
So the setup I have is a bit of a weird one.
We are using the duet for Direct Energy Deposition printing, using MIG welding heads to try and 3D print metal.
We have 3 thermistors and a thermocouple connected to the board that are located on various parts of the printer such as the head, on the welding electronics, the bed etc. We put them there because obviously welding gets very hot and we wanted to monitor the printer design to make sure that the 3D printed parts or bearings weren't getting too hot.
The thermistors are set up fine and output the temperature, but we were hoping that the duet could automatically turn the printer off when any of these sensors became too hot.This is very possible normally as you can use M141 or M143 to set maximum temperatures for a heated chamber or heater. The problem is that as we are using DED, we don't have any heaters. Therefore we cannot assign any of the sensors to a heater or have them trigger an error if it gets too hot.
Is there a way for the duet to monitor a temperature sensor during a print and trigger an error if it gets too hot without it being connected to a heater?
Or is there a way to setup a virtual heater (on RRF_3) that I can assign the sensor too but without there actually being a heater there?
I was wondering how people set up sensors that monitor electronics temperature or on laser cutters how you do it without a heater?
Any help would be much appreciated!
-
I think you could use daemon.g for this:
if sensors.analog[0].lastReading > 300
your gcodeSee in the Object Browser (Plugin) which address your sensor has.
-
@Oliver_Briggs Hi, I would also like a method that allows this. So far, I have been assigning pins as heaters against the thermistors but the heater pin is not actually attached to anything. I tried using a 'nil' pin but it didn't work. I don't remember if it did or didn't show up in the object model without it but it definitely didn't show on the web page without it.
-
@Argo This worked! Thank you! I had completely forgotten about daemon.g!
@JD I just used the following:
if sensors.analog[1].lastReading > 20 ;when temp0 goes above 20 degrees M25 ;pause Print M117 "Too Hot!" ;write message
I should say that I was testing it by putting my finger on the thermistor, hence the 20 degrees limit
I was wondering what code would allow me to resume the print once the temperature had gone below the threshold again (or another one)?
I tried playing around with various other if, whiles etc but couldn't get it to work, mostly because it kept looping the entire file and throwing up an error that it couldn't pause a print that was already paused when the temp was still above the threshold.
any ideas?
-
@Oliver_Briggs said in How to trigger a thermistor temp too high error without a heater:
if sensors.analog[1].lastReading > 20 ;when temp0 goes above 20 degrees
Something like this should work. Note I'm not in front of a printer so can't check for the correct state.
You can use "echo state.status" to check it from teh command line.if sensors.analog[1].lastReading > 20 ;when temp0 goes above 20 degrees if state.status=='processing' M25 ;pause Print M117 "Too Hot!" ;write message else ; temp is under 20 degrees if state.status=='paused' M24 ; resume print M117 "Job resumed"
-
@OwenD thanks! this works well at pausing the printer!
The only problem is that it also resumes a print if you pause it normally.
So if you press pause on the DWC it runs the pause script and then immediately resumes because it 1. is below the temperature threshold and 2. is in paused state.
any ideas on how to get around this? -
@Oliver_Briggs I suppose you could connect a switch to an input.
When you don't want it to resume automatically, throw the switch.
Then just check the state of the input in the else statement.
You could also use the switch to pause the print.if (sensors.analog[1].lastReading > 20) || (sensors.gpIn[3].value=1) ;when temp0 goes above 20 degrees or switch connected to GP input 3 is thrown if state.status=='processing' M25 ;pause Print M117 "Too Hot!" ;write message else ; temp is under 20 degrees if (state.status=='paused') && (sensors.gpIn[3].value=0) M24 ; resume print M117 "Job resumed"
-
@OwenD that could work
variables aren't an option in this code yet if I'm not wrong, but potentially could you use one of the unused items in the object model as a replacement variable and switch it according to what was being done? -
@Oliver_Briggs
Yes, you could create a pseudo variable by setting up a dummy fan, or tool and using one if its values.
You could even just set an I/O high or low without bothering to connect a switch, thereby having a "boolean variable".
you'd just have to have the correct logic in place in your daemon.g, pause.g and resume.g to cover all scenarios.
i.e. The print may be paused by demon.g but resumed using PanelDue etc etc -
@OwenD thanks!
I actually ended up looking through the object model and finding that it stores the last message as an optionso I put into the resume part of the daemon.g that it should only resume if the last message to have been written was to say that the printer is too hot! then if that is true and its cold enough, it resumes the print and posts a new message (so that the last message changes again)
here is my final code:
;daemon.g if (sensors.analog[1].lastReading > 25) && (state.status=="processing");when temp0 goes above 20 degrees and a print is in progress M117 "The right head is too hot! Starting Cooldown" ;write message M25 ;pause Print if (sensors.analog[1].lastReading < 20) && (state.displayMessage == "The right head is too hot! Starting Cooldown") && (state.status == "paused") ;if the status is paused, the temp is below 20 and the last message was from the overheating command M117 "Cooldown Complete - Print Resumed" ; write message M24 ; resume print
Thanks for the help!