Heater tuning via macro
-
I would like to set up a macro to do heater tuning but am stuck on a couple of points. This is the Macro:
; heater tuning should start with a cold heater, nozzle slightly over top of bed
T3 ; mount tool 3
G0 x150 y150 z1 ; go to center of bed
M291 P"Manually bring tool tip to approx 1 mm of build plate" S2
M303 T3 P1 S240 F0.80 ; P1 is 100% duty cycle, S240 is 240C, F0.80 is 80% fan
G0 z5 ; raise tool for clearance
T-1 ; unmount toolFirst question: The tool tip should be close to the bed but I would not like to assume that the tool offset in Z is correct. I would therefore like to prompt the user to place the tool at the appropriate height. M291 above prompts but does not allow user to adjust Z height. What would be a good way to let the user adjust Z and only then carry on with the tuning?
Question number two: The M303 command is started but immediately stopped and the tool is unloaded. Is it supposed to do that or am I doing something wrong? I would like for the tuning to complete and only then for the tool to be unloaded.
Bonus question: Is it normal for any interaction with the Duet to wait 2 or 3 seconds before the interaction is echoed back? Specifically, if I edit a macro file and start typing (or deleting) text, it takes a really annoying long time between me typing something and it coming back and the edit box reflecting what I just typed (2 or 3 seconds) . Do I maybe have something configured wrong? (Duet 6HC, DWC 3.4.5, Ubuntu 22.04 on laptop that is wifi connected to the network. Printer is hard wired to the network) -
If you use an axis parameter, M291 allow you to display jog buttons
SoM291 R"position" P"Jog to 1mm from bed" S3 Z1
Would achieve what you want.
I'm not sure what you mean by part
twothree of your post.
I've not seen that behaviour.Edit.
For part two..
You may need to do a wait to allow tuning to finish.while heat.heaters[nn].state = "tuning" G4 S1
-
Something may have changed, but I don't think heater tuning really works well in a macro.
-
One of our OEM customers does heater tuning in a macro, so it can't be too difficult. To make it easier, in RRF 3.5 I added an option to the M303 command to suppress advising the user to run M500 or edit config.g.
-
Thanks @OwenD and @Phaedrux. I will play with it a bit more and see if I can get this to work better but ifI can't get it to work I will just have to write myself a note on how to do it ... tuning isn't done very often and I tend to forget things which is why I wanted to write a macro for it.
Question #3, the bonus question, to explain in a different way, it seems to take a long time for the Duet to reply to my commands. It may be because I have too many browser windows open (8 to 10 usually) but the computer I am using has 16 cores and 64 Gb of ram so I am expecting a fairly quick response time. What happens as an example, I click on a particular macro, it takes 2 or 3 seconds for the computer to display the confirmation of "do you want to run the macro yes/no". Similarly, if I edit a macro, I might go to a new line (wait two seconds for the cursor to go to the new line, type in M291 P"blah blah blah" S2, wait another 2 or so seconds before the letters are repeated on my edit window and so on.
As I am typing this, I realize that I should really try this with no other windows open and possibly in a different browser to see if the delay is present under the different setup. I will get on that and test it and post the results. -
@dc42, thanks. I am not quite sure how that new option will help but I am happy to wait for DWC 3.5 to see how I can incorporate that.
-
Scratch question #3 - I started Chrome (my normal browser is Firefox) and with just one window open, the response is immediate. I am probably overloading Firefox but the issue is certainly not related to DWC.
Thanks for helping me to discover this. -
@OwenD , brilliant, just brilliant!
I got everything to work except one tiny bit that will have to wait for DWC 3.5. Thank you very much!