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

How to trigger a thermistor temp too high error without a heater

Scheduled Pinned Locked Moved
Duet Hardware and wiring
4
10
628
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.
  • undefined
    Oliver_Briggs
    last edited by 28 Feb 2021, 19:21

    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!

    undefined 1 Reply Last reply 1 Mar 2021, 01:48 Reply Quote 0
    • undefined
      Argo
      last edited by Argo 28 Feb 2021, 19:29

      I think you could use daemon.g for this:

      if sensors.analog[0].lastReading > 300
      your gcode

      See in the Object Browser (Plugin) which address your sensor has.

      undefined 1 Reply Last reply 1 Mar 2021, 03:14 Reply Quote 1
      • undefined
        JD @Oliver_Briggs
        last edited by 1 Mar 2021, 01:48

        @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.

        1 Reply Last reply Reply Quote 0
        • undefined
          Oliver_Briggs @Argo
          last edited by Oliver_Briggs 3 Jan 2021, 03:15 1 Mar 2021, 03:14

          @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?

          undefined 1 Reply Last reply 1 Mar 2021, 04:49 Reply Quote 0
          • undefined
            OwenD @Oliver_Briggs
            last edited by 1 Mar 2021, 04:49

            @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"
            undefined 1 Reply Last reply 1 Mar 2021, 21:06 Reply Quote 2
            • undefined
              Oliver_Briggs @OwenD
              last edited by 1 Mar 2021, 21:06

              @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?

              undefined 1 Reply Last reply 1 Mar 2021, 21:59 Reply Quote 0
              • undefined
                OwenD @Oliver_Briggs
                last edited by 1 Mar 2021, 21:59

                @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"
                1 Reply Last reply Reply Quote 1
                • undefined
                  Oliver_Briggs
                  last edited by 1 Mar 2021, 22:52

                  @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?

                  undefined 1 Reply Last reply 2 Mar 2021, 07:40 Reply Quote 0
                  • undefined
                    OwenD @Oliver_Briggs
                    last edited by 2 Mar 2021, 07:40

                    @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

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      Oliver_Briggs
                      last edited by 2 Mar 2021, 19:42

                      @OwenD thanks!
                      I actually ended up looking through the object model and finding that it stores the last message as an option

                      so 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! 🙂

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