Configuring a Z MAX switch to preheat nozzle for filament change
-
Greetings!
I realize I need to add the ZMAX pins in Config, and I'm guessing I need a separate Macro file, that will trigger the nozzle to heat up. I'd like it only to run if it isn't printing.
So there would be an M950 in main config under endstops. I'm not sure of the specific options. Would that point to a preheat macro? What Then I'd need M109 S215 to heat the extruder? Can that be in the printer config, or separate file.
Thanks.
-
Can you give us a detailed description of what you're actually trying to accomplish?
Are you trying to home to Z max, or are you trying to have an endstop trigger a macro to heat the nozzle?
-
@phaedrux I would like a physical button to preheat the nozzle for filament change, without having to use the web UI. On Youtube Chris Riley did a marlin centric video on how to set-up physical buttons.
The Z max pin was recommended to me as the easiest pin to use. I was told to avoid the X and Y max pins for some reason.
So, I can physically wire the switch. I'm just not 100% clear how much I need to add to my Config to get it to work.
Can the whole process be included in the printer config file, or should I have the actual nozzle heating up in a macro?
I know I need an M950 to set up the pin as a switch, but not sure of the details.
Then to heat the nozzle I'd need M109 S215 to set the nozzle to 215c.
I'm just not clear if I'm missing anything.
Thanks.
Max
-
@westech what board are you using? standard duet boards don't have XMax, YMax and ZMax endstops
-
@westech said in Configuring a Z MAX switch to preheat nozzle for filament change:
@phaedrux I would like a physical button to preheat the nozzle for filament change, without having to use the web UI. On Youtube Chris Riley did a marlin centric video on how to set-up physical buttons.
The Z max pin was recommended to me as the easiest pin to use. I was told to avoid the X and Y max pins for some reason.
So, I can physically wire the switch. I'm just not 100% clear how much I need to add to my Config to get it to work.
Can the whole process be included in the printer config file, or should I have the actual nozzle heating up in a macro?
I know I need an M950 to set up the pin as a switch, but not sure of the details.
Then to heat the nozzle I'd need M109 S215 to set the nozzle to 215c.
I'm just not clear if I'm missing anything.
Thanks.
Max
It sounds to me like an external trigger would fulfil your needs. First create a GPIO pin using M950 and do that in config.g https://docs.duet3d.com/User_manual/Reference/Gcodes#m950-create-heater-fan-spindle-or-gpioservo-pin
Wire your switch to that pin.
Then use M581 (also in config.g) to run a macro when that gpio triggers.
https://docs.duet3d.com/User_manual/Reference/Gcodes#m581-configure-external-triggerUsing R1 in the M581 will limit the trigger to only happen when printing.
Finally you write a trigger macro to do what you want (in this case heat the hot end).
So, e.g. in config.g you have..........
M950 J1 C"Pin Name"
M581 P1 T2 R1 Sn (where n is rising edge or falling edge); This will run macro called trigger 2then in the sys folder you have a file trigger2.g which will contain the commands you want to happen. e.g.
M109 S215. That's actually deprecated so if you are on later firmware, use M568/M117 instead https://docs.duet3d.com/User_manual/Reference/Gcodes#m568-set-tool-settings
EDIT. Here is a more detailed guide to using triggers https://docs.duet3d.com/en/User_manual/Tuning/Triggers
-
@deckingman Wow, thank you.