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

Wait for passive thermistor temprature to stabilize

Scheduled Pinned Locked Moved
Gcode meta commands
5
12
476
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
    o_lampe @garethky
    last edited by o_lampe 29 Jan 2021, 07:45

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

    1 Reply Last reply Reply Quote 1
    • undefined
      garethky
      last edited by 29 Jan 2021, 08:36

      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.

      undefined 1 Reply Last reply 29 Jan 2021, 15:15 Reply Quote 1
      • undefined
        dc42 administrators @garethky
        last edited by 29 Jan 2021, 09:42

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

        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

        undefined 1 Reply Last reply 29 Jan 2021, 18:03 Reply Quote 0
        • undefined
          o_lampe @garethky
          last edited by 29 Jan 2021, 15:15

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

          undefined 1 Reply Last reply 29 Jan 2021, 17:39 Reply Quote 0
          • undefined
            Phaedrux Moderator @o_lampe
            last edited by 29 Jan 2021, 17:39

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

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 1
            • undefined
              garethky @dc42
              last edited by garethky 29 Jan 2021, 18:03

              @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 the if 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
              undefined undefined 2 Replies Last reply 29 Jan 2021, 19:05 Reply Quote 0
              • undefined
                dc42 administrators @garethky
                last edited by 29 Jan 2021, 19:05

                @garethky, which firmware and DSF version are you running?

                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

                undefined 1 Reply Last reply 29 Jan 2021, 19:07 Reply Quote 0
                • undefined
                  garethky @dc42
                  last edited by 29 Jan 2021, 19:07

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

                  undefined 1 Reply Last reply 29 Jan 2021, 19:14 Reply Quote 0
                  • undefined
                    dc42 administrators @garethky
                    last edited by 29 Jan 2021, 19:14

                    Thanks, I've asked @chrishamm to take a look.

                    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
                    • undefined
                      chrishamm administrators @garethky
                      last edited by 29 Jan 2021, 19:18

                      @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 the while block before it can evaluate iterations.

                      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

                      Duet software engineer

                      undefined 1 Reply Last reply 29 Jan 2021, 19:37 Reply Quote 0
                      • undefined
                        garethky @chrishamm
                        last edited by 29 Jan 2021, 19:37

                        @chrishamm Thanks Chris!

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