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

    Strange results with M190 using conditional G Code RRF 3.3b2

    Scheduled Pinned Locked Moved Unsolved
    Gcode meta commands
    3
    6
    225
    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.
    • OwenDundefined
      OwenD
      last edited by OwenD

      I'm raising this in it's own thread for clarity.
      Original discussion here https://forum.duet3d.com/post/220209

      If you run this macro, starting at say 70 degrees, the temp often goes straight to 39 degrees.
      Other times it decrements by 1 degree as expected

      while (heat.heaters[0].active > 60) && (heat.heaters[0].current > 60) && (heat.heaters[0].state = "active")
      	M190 P0 R{heat.heaters[0].active -1}
      	echo "wait"
      	G4 S20
      echo "cooldown finished"
      

      However if you use variables to set the target and use the variable in M190, the result is always exactly as expected.... A 1 degree reduction at each iteration

      var cooltemp = {heat.heaters[0].active}
      while (heat.heaters[0].active > 60) && (heat.heaters[0].current > 60) && (heat.heaters[0].state = "active")
      	set var.cooltemp = var.cooltemp -1
      	M190 P0 R{var.cooltemp}
      	echo "wait"
      	G4 S20
      echo "cooldown finished"
      
      OwenDundefined 1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD @OwenD
        last edited by

        • bump *
          Any thoughts on this?
        o_lampeundefined 1 Reply Last reply Reply Quote 0
        • o_lampeundefined
          o_lampe @OwenD
          last edited by

          @owend
          About the 39°C: I think it's related to the limitation of M190 R.
          The R value doesn't work below 40°C...Coincidence?
          I think that the question belongs in the "Beta firmware" section, as it seems to be an issue with M190.

          1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator
            last edited by

            I've asked @DC42 to take a look but I think he's been focused on other things. @o_lampe may be onto something with the 39c limit though.

            Z-Bot CoreXY Build | Thingiverse Profile

            OwenDundefined 1 Reply Last reply Reply Quote 0
            • OwenDundefined
              OwenD @Phaedrux
              last edited by

              @phaedrux
              Not sure how the 40 degree limit relates when we're starting at 60 or 70 degrees and reducing in 1 degree steps.
              It's not critical as I can work around it using variables to do the math before the M190
              It only fails if the math is done within the M190

              o_lampeundefined 1 Reply Last reply Reply Quote 0
              • o_lampeundefined
                o_lampe @OwenD
                last edited by o_lampe

                @owend
                If I had to integrate a Daemon.g into a very timing-related program such as RRF, I'd not run the whole Daemon at once, but would squeeze it between my already running program line by line. (or the shortest possible code snipped)
                That way you can set a waiting time with G4 S20 in Daemon.g, while the real print-routine goes on.

                That would work well, unless there is a line that calls another sub-program in a subprogram. M190 P0 R{heat.heaters[0].active -1} is such a line. It calls the 'math' routine with (-1) while being in the subroutine of M190.

                It's just wild guessing, but maybe there is a limitted level of subroutines for Daemon.g?

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