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

    M191 not waiting as expected

    Scheduled Pinned Locked Moved
    General Discussion
    4
    12
    812
    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.
    • SpoonUnitundefined
      SpoonUnit
      last edited by SpoonUnit

      Here's the last few lines of the GCODE I'm printing

      T2
      G10 P0 S120 R120
      M140 S25
      M191 P0 R35
      M141 P0 S0
      G1 Y-35 F3000
      T-1
      

      My expectation is that when M191 is reached, the printer will pause and await the chamber to reach 35 degrees before it then executes the move step G1. In practice, the move step is being executed immediately.

      Is there something else I need to do to achieve a guaranteed wait?

      Things in mind for me to try are to execute an M400 (though I thought this only applied to moves), and to execute an empty macro (because this might induce alternate code processing).

      While on the subject of M191, the documented example might need tweaking as the example given doesn't match the documentation above and seems to indicate that chamber 60 should do nothing at all. I can only assume this was an older form of the command.

      1 Reply Last reply Reply Quote 0
      • aidarundefined
        aidar
        last edited by

        Just guessing here, maybe chamber index (P parameter) must be same as heater channel used for chamber, so for example if its connected to heater3 channel, then M191 P3 T35 will work.

        1 Reply Last reply Reply Quote 0
        • SpoonUnitundefined
          SpoonUnit
          last edited by

          Thanks for the input. To add, I use this at the start of the file to await heating, rather than cooling.

          ; Wait for bed thermistor (chamber P0) to report reasonable temp
          M191 P0 R70
          ; Ignore thermistor now
          M141 P0 S0
          
          ; Home
          M98 P"homeall.g"
          

          This does work. The job waits at M191 until the chamber reports 69 degrees and then moves forward. That's why I don't understand it not working correctly at the end of the file.

          1 Reply Last reply Reply Quote 0
          • SpoonUnitundefined
            SpoonUnit
            last edited by SpoonUnit

            Now attempting to narrow down the problem, I have created the following separate GCODE test file:

            ; Home
            M98 P"homeall.g"
            ; Measure Mesh
            G29
            
            T0
            G0 Z10
            
            G0 X150 Y100
            M140 S50
            M191 P0 R40
            
            G0 X150 Y0
            M140 S30
            M191 P0 R30
            
            G0 X150 Y100
            M140 S50
            M191 P0 R40
            
            G0 X150 Y0
            M140 S30
            M191 P0 R30
            
            G0 X150 Y100
            M140 S50
            M191 P0 R40
            
            G0 X150 Y0
            M140 S30
            M191 P0 R30
            
            T-1
            

            The behaviour I observe is

            • Homing
            • Mesh Measurement
            • Tool collection
            • Move to bed center
            • Pause for chamber temp to be reached
            • Repeated moves back and forth after temp reached
            • Tool docked

            The behaviour I expect is

            • Homing
            • Mesh Measurement
            • Tool collection
            • Move to bed center
            • Pause for chamber temp to be reached
            • Move to second position
            • Pause for temperature to be lowered
            • Move to first position
            • Pause for temperature to be reached
            • Repeat
            • Dock

            What am I doing wrong that this works once and then not subsequently?

            1 Reply Last reply Reply Quote 0
            • SpoonUnitundefined
              SpoonUnit
              last edited by

              OK - I just spotted this on M190 documentation:

              Note: M190 will not wait for temperatures below 40c because in many cases they may never be reached due to ambient temps. So if you want to wait for a bed to cool, use 41c or higher.

              This isn't specified for M191, but I'm going to assume it's the same limit. If I'm working in Antarctica, or space, perhaps lower ambient temps are perfectly reasonable to expect. Will verify if this impacts M191 also. In my case, I'm trying to wait for a print to detach fully from the heated bed, which is coated with PEI. I find this happens around 35 degrees. If M191 will not permit me to wait for lower than 41 I'll be forced to insert a blind pause to accommodate the extra wait. Ambient bed temp when the bed isn't heated is current 23C, which is far lower than 40.

              1 Reply Last reply Reply Quote 0
              • SpoonUnitundefined
                SpoonUnit
                last edited by

                Verified.

                This works as expected:

                ; Home
                M98 P"homeall.g"
                ; Measure Mesh
                G29
                
                T0
                G0 Z10
                
                G0 X150 Y100
                M140 S60
                M191 P0 R45
                
                G0 X150 Y0
                M140 S41
                M191 P0 R41
                
                G0 X150 Y100
                M140 S60
                M191 P0 R45
                
                G0 X150 Y0
                M140 S41
                M191 P0 R41
                
                G0 X150 Y100
                M140 S60
                M191 P0 R45
                
                G0 X150 Y0
                M140 S41
                M191 P0 R41
                
                T-1
                

                M191 should reflect this limit of 41. Would be nice to be able to specify this, perhaps in the same breath as we can specify the max limit using M143.

                deckingmanundefined 1 Reply Last reply Reply Quote 0
                • deckingmanundefined
                  deckingman @SpoonUnit
                  last edited by deckingman

                  @SpoonUnit I thought maybe you could use M116 instead of M191 https://duet3d.dozuki.com/Wiki/Gcode#Section_M116_Wait

                  But when I checked the wiki, I see it has the same comments about temperatures<= 40.

                  I guess the firmware developers are between a rock and hard place with this because if they changed the limit to be say 35, then they would no doubt get complaints from people who live in warmer climes with M191 waiting forever and never reaching (cooling down) to the set point because the ambient is (say) 38.

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

                  1 Reply Last reply Reply Quote 0
                  • SpoonUnitundefined
                    SpoonUnit
                    last edited by

                    @deckingman It's fair to say that you can't please all the people all of the time :). 41 seems like a strange default, but there it is. It would be nice to be able to configure it though. At present, I now have a wait to 41 followed by a 5 minute blind pause, and that works just fine for now.

                    SpoonUnitundefined 1 Reply Last reply Reply Quote 0
                    • SpoonUnitundefined
                      SpoonUnit @SpoonUnit
                      last edited by

                      @dc42 is there any chance to permit configuration of this bottom limit of 41 described above? While it might be a sensible default, individual users may decide it doesn't work for them.

                      My blind wait of 5 mins today was not good enough due to the UK heat wave. As such, after 5 mins, the chamber temp had not got to 36 and my PETG item had not released from the bed. There was an almighty PING when the sweep finally applied enough pressure to release the item and it shot across the room. A blind wait of 10 mins might work, or maybe 15, but the neater answer would be able to simply put M191 P0 R36. Sadly all values of R below 41 result in the command returning instantly with no error.

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

                        @spoonunit I agree that the documentation should be updated. Also it would be a good idea to generate a warning message if the requested temperature is below 40C.

                        However, if you really want to wait for a heater to reach temperatures below 40C and you are sure that the ambient temperature is low enough for this to be possible, then you can call a macro containing a while-loop to achieve this. If we change the code to always respect the requested temperature, I think that will increase the load on our support engineers.

                        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

                        SpoonUnitundefined 1 Reply Last reply Reply Quote 0
                        • SpoonUnitundefined
                          SpoonUnit @dc42
                          last edited by

                          @dc42 Macro !. Brilliant. Thanks. I'd started looking at the code and was thinking of recompiling, but this will be much quicker. Cheers.

                          SpoonUnitundefined 1 Reply Last reply Reply Quote 0
                          • SpoonUnitundefined
                            SpoonUnit @SpoonUnit
                            last edited by SpoonUnit

                            @spoonunit For anyone else having a similar requirement, this can be inserted into GCODE

                            M98 P"0:/macros/waitForChamberTemp" A36
                            

                            Where param A with a value of 36 is the temperature you wish to wait for.

                            Now create this macro:

                            waitForChamberTemp

                            echo "starting"
                            while true
                            	if heat.heaters[6].current < param.A
                                            G4 S30 ; wait 30 seconds until next reading
                            		break
                            echo "bed temp reached"
                            

                            Note: Check the object model for your version so ensure the exact coordinates of the heater you're interested in as they have been known to move around. The above example works with RRF 3.3beta2.

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