DWC 'home all' vs 'homeall.g'
-
@Exerqtor, thanks, I will experiment with G28.
-
G28 Z works great ... but is there a way where I can run that without it also running homez.g? Specifically I only need to re-home z but don't think I need to do the tilt correction that is a normal part of homez.g on my Jubilee printer.
-
@jens55 the commands G28, G28 Z etc call the macros homeall.g homez.g etc, there is no difference between using the button in DWC, or sending the G28 command.
Can you outline what behaviour you are trying to achieve, we may be able to put some conditional gcode into the homing files to achieve what you want.
-
@T3P3Tony, according to my testing, there is indeed a difference between running homez.g and running g28 z. I think it might be related to a flag that says 'this axis is not homed' .... this is a wild guess though.
To give you an idea what is happening, let's say that physically I am at z 100 but the printer thinks that I am at z 5 (and these are off the top of my head things that were not actually tested but reflect what is happening).
All other axis are homed.
When I select 'home z' or when I run homez.g, the bed moves towards the printhead for a bit (or printhead towards bed) and then gives me an error message that the endstop was not triggered (don't recall exact message but can verify)
If I run homeall.g, the exact same thing happens (see above for content of homeall.g)
If I press the 'Home all' in DWC, the bed does not stop after a short move toward the head but continues until the z endstop activates.
If I run G28 Z, the bed also reaches the end stop in the same manner it does when pressing the 'home all' button in DWC.
Now my homez.g file includes measuring the tilt of the bed and adjusting the three z screws to eliminate the tilt. The G28 Z runs all of homez.g including the tilt correction in addition to enabling the z axis to reach the end stop. In my particular case, the tilt was corrected when the printer was first homed and this has not changed. I subsequently ran a macro to measure z nozzle offset with a knobprobe. This screws up everything the printer knows about z and requires that I re-establish z=0 after the knobprobe is removed. I only need to re-establish z and not the build plate tilt. What I would like to do is to just re-set z=0.
While this is what I would like to achieve, the stickler for details in me also wants to find out what G28 Z does besides running the homez.g file.
I hope this makes sense .... -
@jens55 ok, yes it may well be different running M98 P"homez.g", but I thought pressing the he Z button in DWC should be the same as running G28 Z. Hopefully @chrishamm can confirm.
What I suggest is you build the correct behaviour into G28 Z. It might be possible to check the axis home state in the Object Model before deciding what the macro should do, but that needs checking as I guess the axis is set to unhomed as the first step. If not you may need to use a global variable to track the state.
-
@T3P3Tony, I agree that it 'should' be possible to change homez.g but object model programming is something that has so far eluded me.
-
@jens55 An easy way would be to move the things that are in homez.g that aren't needed to, well, home Z, into start.g so it gets executed before you start a print, but not when you just want to home z. If you want to go the extra mile, move that stuff into another Macro you call from start.g so you can_also_ call it whenever you feel like it without starting a print, but separately from homez.g.
-
@oliof, moving the stuff to start.g is not workable (do not want or need to do this every time I print) but I do need to do that every time I run homez.g.
For now, I will just put up with the extra steps that are part of homez.g but it is annoying. I will eventually try and figure out a way to do it via the object model but was hoping to be able to do it without getting into the nitty gritty of object model programming.
For now I just want to figure out what g28 Z does that doesn't happen in homez.g and maybe, if it is a matter of a flag, I can set the flag directly and run all the required steps (and only the required steps) by themselves in the offset measuring macro.Edit: possibly clearing move.axes[?].homed .....
-
@jens55 running G28 Z sets the Z axis to unhomed (see src/GCodes/GCodes.cpp, line 3107). Calling homez.g as a macro does not flag the axis as unhomed.
Running G28 sets all axes to unhomed. If you use a Z probe to home Z, calling G28 means you will need to rehome X and Y on a Cartesian/Core kinematics for example.
-
@oliof, interesting, so my guess of a 'homed' flag was actually correct? Cool .....
-
@jens55 said in DWC 'home all' vs 'homeall.g':
@oliof, interesting, so my guess of a 'homed' flag was actually correct? Cool .....
Yes, G28 flags the axes mentioned as not homed (or all axis of you didn't mention any) before it runs any homing macros.