Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    smarter 15C heat deviation messages?

    Scheduled Pinned Locked Moved
    General Discussion
    4
    5
    243
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • r123undefined
      r123
      last edited by r123

      If understand correctly, currently (3.2.2) Duet gives a Heater Error and stops the print if

      abs (actual temperature - desired temperature) >=15C

      Maybe it could be smarter?

      Could we add additional conditions of the form"

      // if was at desired temperature

      and time to deviate from desired temp < 1 second

      => "Thermistor Error" + stop print //

      // if was at desired temperature

      and time to deviate from desired temperature > 3 seconds

      => "Heater Error" + stop print //

      Have deliberately left a gap in above example between 1 and 3 seconds because not overly familiar with these errors. But maybe there is no gray area, if it's a thermistor it's always really spiky?

      The point is that, if the heater is the problem it is going to take a reasonable amount of time for the block to change temperature. Laws of physics. (Though if a direct short, hmm... but that's not cooling.)

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @r123
        last edited by dc42

        It already is smarter. See the M570 command.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • r123undefined
          r123
          last edited by

          That's neat but I'm sticking with the defaults that have been shown to keep everyone else safe! ; )

          Was trying to suggest that Duet might be able to spot Thermistor faults and say "Thermistor fault!" rather than "Heater Error". How? Because (at least in some cases) Thermistor problems can result in changes in "temperature" so rapid that they could not be explained by normal heating or cooling of the hotend.

          Failing that maybe as a message:

          "Tool Temperature error (X degrees for more than Y seconds): check heater and thermistor"

          would be clearer than "Heater Error" ?

          OwenDundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
          • OwenDundefined
            OwenD @r123
            last edited by OwenD

            @r123 You can monitor and act on temperature excursions in daemon.g

            As far as I'm aware, RRF only monitors during a print, so I do this in case an SSR fails or something.
            Of course, they'll probably fail ON, so external measures must be used to shut it off in that case.

            You'll need RRF 3.2b3 3.3b2 to use variables like I have, or you can just use G4 commands to set the frequency.

            I use the following.

            ; 0:/sys/daemon.g
            ; runs continually in background at approximately 1Hz if not delayed internally
            
            
            ;HEATER CHECKS
            
            ; this section of daemon.g checks for heater faults
            ; RRF doesn't currently check for faults when idle but by default will shut down during printing if temperature excursion is > 15 degrees.
            ; Note: temp excursion value and time  may be manually set using M570
            ; checking if temp is rising requires a variable.  I have created variables for this and to do elapsed time since last check
            ; G4 could be used but would also delay anything else in daemon.g
            ; this way allows other checks to run more frequently if needed however the G4 delays inside the loop will affect the frequency of daemon.g
            
            
            while iterations < 2 ;#heat.heaters ; loop through all configured heaters
            	if state.upTime < 60
            		break; If uptime is < 60 seconds, break out so all fans etc have time to stabilise.
            
            	if ((global.LastCheckTime+10) > state.upTime) ; if checked in last 10 seconds escape loop and go to rest of daemon.g if present.  offset will be zero at startup via config.g
            		;echo "skipping loop " ^ " " ^ state.upTime  ^ " " ^ global.LastCheckTime+10
            		if global.LastCheckTime - state.upTime > 60 ; uptime must have rolled over so reset off set to zero
            			G10 P2 Y0
            			echo "upTime has rolled over.  Heater checking reset"
            		break
            	;echo "checking heater " ^ iterations ^ " " ^ state.upTime  ^ " " ^ global.LastCheckTime+10
            	if heat.heaters[iterations].state="tuning"
            		;echo "heater " ^ iterations ^ " is tuning - no check carried out"
            		continue ; don't check this heater as it is PID auto tuning
            	if (heat.heaters[iterations].current) > (heat.heaters[iterations].max) ; temp is over max so emergency shutdown required
            		;M41 P5 S1  ; activate output connected to externally powered latching relay here to sound alarm
            		echo "heater over max temp fault detected in daemon.g.  - shutting down"
            		M112; emergency shutdown
            		M81 S1 ; turn off power when fans have turned off
            	if (heat.heaters[iterations].current > 45) && (heat.heaters[iterations].active > 45); no real danger at below this temp as ambient may be close to this.  Likewise if active temp is set to < 45 it's probably set to zero.  Leaving out checking acttive leads to false positives if temp is set to zero on active heater.
            		;echo "heater " ^ iterations ^ " is above 45 degrees"
            		if (heat.heaters[iterations].state!="off") && (heat.heaters[iterations].current > heat.heaters[iterations].active + 15) ; temp is > 15 degrees above target.
            		;echo "heater " ^ iterations ^ " is on or in standby - checking if temp is rising"
            			set global.LastTemp = heat.heaters[iterations].current ; set the last check temp
            			G4 S3 ; wait 3 seconds
            			if (heat.heaters[iterations].current > global.LastTemp + 0.5) ; heat is rising by more than 0.5 degrees in 3 seconds
            				echo "heater runaway fault detected in daemon.g.  - shutting down"
            				if (state.status=="processing")
            					M25 ; pause print so you might be able to save it using M119
            				;M41 P5 S1  ; activate output connected to externally powered latching relay here to sound alarm
            				M0 ; unconditional stop.  If axes are homed and a print is being canceled will run cancel.g  otherwise will run stop.g
            				M81 S1 ; turn off power when fans have turned off
            			else
            				;echo "heater is on or standby but temp is falling on heater " ^ iterations ^ " - no action needed"
            		elif (heat.heaters[iterations].state="off") && ((heat.heaters[iterations].current) >= (fans[1].thermostatic.lowTemperature+0)) ; if heater is off and temp is greater than 50 there could be an issue
            			;echo "heater " ^ iterations ^ " is off but checking if temp is rising"
            			set global.LastTemp = heat.heaters[iterations].current;
            			G4 S3 ; wait 3 seconds
            			if (heat.heaters[iterations].current > global.LastTemp + 0.5) ; heat is rising by more than 0.5 degrees in 3 seconds
            				;echo "heater is off but temp is rising on heater " ^ iterations ^ "emergency shutdown"
            				;M41 P5 S1  ; activate output connected to externally powered latching relay here to sound alarm
            				echo "heater runaway fault detected in daemon.g.  - shutting down"
            				M112; emergency shutdown
            				M81 S1 ; turn off power when fans have turned off
            			else
            				;echo "heater is off & temp is falling or stable on heater " ^ iterations ^ " - no action needed"
            	else
            		;heater is below 45 degrees so only other fault may be an open circuit thermistor which should show -275 degrees
            		if heat.heaters[iterations].current < 0 ; we probably have a thermistor fault if heater is less than 0 degrees
            			M112 ; emergency shutdown
            			M81 S1 ; turn off power when fans have turned off
            
            	;Check if water pump is running correctly
            	if (iterations=1) && ((heat.heaters[1].current) > (fans[1].thermostatic.lowTemperature+0))
            		if fans[1].rpm <= 500 ; Coolant pump RPM off or low
            			echo "Water pump fault - shutting down heaters - RPM : " ^ fans[1].rpm
            			M25 ; pause print so you might be able to save it using M119
            			M0 ; unconditional stop.  If axes are homed and a print is being canceled will run cancel.g  otherwise will run stop.g
            			M81 S1 ; turn off power when fans have turned off
            		elif (fans[1].rpm > 500) && (fans[1].rpm < 1400)
            			echo "WARNING: Water pump RPM low - RPM : " ^ fans[1].rpm
            			if (state.status=="processing")
            				M25 ; pause print so you might be able to save it using M119
            				;M41 P5 S1  ; activate output connected to externally powered latching relay here to sound alarm
            				M0 ; unconditional stop.  If axes are homed and a print is being canceled will run cancel.g  otherwise will run stop.g
            				M81 S1 ; turn off power when fans have turned off
            		else
            			;echo "Coolant OK - RPM : "  ^ fans[1].rpm
            		if fans[5].rpm <=1000
            			echo "WARNING: Water pump FAN RPM low - RPM : " ^ fans[5].rpm
            			if (state.status=="processing")
            				M25 ; pause print so you might be able to save it using M119
            				;M41 P5 S1  ; activate output connected to externally powered latching relay here to sound alarm
            				M0 ; unconditional stop.  If axes are homed and a print is being canceled will run cancel.g  otherwise will run stop.g
            				M81 S1 ; turn off power when fans have turned off
            
            	if iterations == #heat.heaters-1 ; all heaters have been checked
            		set global.LastCheckTime = state.upTime ; set the new time to check
            
            
            ; END HEATER CHECKS
            
            
            ; run other checks after this line
            
            1 Reply Last reply Reply Quote 2
            • deckingmanundefined
              deckingman @r123
              last edited by

              @r123 said in smarter 15C heat deviation messages?:

              That's neat but I'm sticking with the defaults that have been shown to keep everyone else safe! ; )

              Was trying to suggest that Duet might be able to spot Thermistor faults and say "Thermistor fault!" rather than "Heater Error". How? Because (at least in some cases) Thermistor problems can result in changes in "temperature" so rapid that they could not be explained by normal heating or cooling of the hotend.

              Failing that maybe as a message:

              "Tool Temperature error (X degrees for more than Y seconds): check heater and thermistor"

              would be clearer than "Heater Error" ?

              More often than not, it's faulty wiring or a badly crimped connector which causes the error. Or in some cases, the temperature can drop due to an overly aggressive part cooling fan blowing directly at nozzle.
              Either of those cases might give the same temperature behaviour as a faulty heater or sensor and it's almost impossible to discriminate between them.
              You need to be very sure of the cause before giving specific messages, otherwise pendants will start to jump up and down. I can already imagine a post along the lines of "I use a thermocouple but the warning message tells me I have a thermistor fault.". 🙂

              Ian
              https://somei3deas.wordpress.com/
              https://www.youtube.com/@deckingman

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA