Possible to disable "Home X" in DWC, Panel Due?
-
My corexy printer has the X endstop switch on the extruder carriage which requires careful placement of the switch and an extra pair of wires in the cable to the carriage. The switch placement interferes with placement of a print cooling blower. I'd like to mount the X endstop switch on the machine's XY frame so it doesn't have to be on the extruder carriage. In my machine, Y homes to max, so the X end stop would be placed at the Y max end of the X axis. That means Y would always have to be homed first to ensure that when I home X, the carriage will bump the switch.
DWC and the Panel Due (and pronterface) have "Home X" commands accessible in one form or another. Is it possible to tweak the firmware so that a Home X command is always interpreted as "home Y then X" or to simply disable home X unless home Y has been performed first?
-
Place the following at the top of the "homex.g" file
M98 Phomey.g
See https://duet3d.dozuki.com/Wiki/Gcode#Section_M98_Call_Macro_Subprogram for more information.
-
What @tjb1 said. When you do Home X, it simply runs the macro homex.g which can be found in the .sys directory. You can put whatever commands you like in there. Either call the homey macro or manually or add the commands for homey.g to the start of the file.
-
Excellent! Thank you both!
-
I finally got around to remounting the switch, and I noticed that there are homey.g, homex.g, homeall.g, and homez.g files. I opened the homeall.g file and found a bunch of individual M and G commands that will home X before Y etc. They look the same as the contents of the homex.g, homey.g and homez.g files. Is there a reason why the homeall.g file doesn't just call the homex.g, homey.g, and homez.g macros? In my case, whenever I home X, I'm going to home Y first (with an M98 Phomey.g statement in homex.g), so I could replace the contents of the homeall.g file with M98 Phomex.g and M98 Phomez.g. Am I missing something?
-
@mrehorstdmd This is only for the case that you would do some things multiple times that only need to be done once, e.g. if you lift Z before homing X or Y then you do this once in
homex.g
and once inhomey.g
and at the end of both files usually you lower Z again to its previous position. If you home all axes at once you only need to lift Z once at the start and lowering will be part of homing Z.Another example would be - though it is not possible on your machine anymore - to move X and Y simultaneously to their endstop positions.
In the end it is just convenience and of course you can put three
M98 P...
commands in there if you don't mind that it is just a tiny bit less efficient. -
There's no reason homeall.g couldn't just call homex y and z macros. It's totally up to you.
It's just another way to customize for your needs.
With a corexy there is a small reason to have a seperate macro for homeall since you can move both axis at the same time, and it will stop both axis as soon as either hits an endstop, so you can save a little bit of movement time but it's miniscule.
; Home XY ; M913 X30 Y30 ; set X Y motors to 30% of their normal current for homing G1 S1 X-375 Y305 F3000 ; course home X or Y G1 S1 X-375 F3000 ; course home X G1 S1 Y305 F3000 ; course home Y G1 X5 Y-5 F1000 ; move away from the endstops G1 S1 X-10 F600 ; fine home X G1 S1 Y10 F600 ; fine home Y M913 X75 Y75 ; set X Y motors to 75% of their normal max current