-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bad movement in gcode_T when switching extruders #3829
Fix bad movement in gcode_T when switching extruders #3829
Conversation
2e3b783
to
bd1d256
Compare
@@ -555,6 +555,7 @@ void Config_ResetDefault() { | |||
|
|||
#if ENABLED(AUTO_BED_LEVELING_FEATURE) | |||
zprobe_zoffset = Z_PROBE_OFFSET_FROM_EXTRUDER; | |||
update_software_endstops(Z_AXIS); | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems to be problematic. Seems to be the same as in M851. We probably should not apply this immediately to the software endstops. We don't move the nozzle nor shift a coordinate system, just change the value without using it. So the correction for this should apply during the next homing and/or probing ( L 3624 https://github.com/MarlinFirmware/Marlin/pull/3829/files#diff-1cb08de130a6ece2d1b5b9c37bcfef48R3634)?
I guess it needs a dual stage strategy, holding back the new zprobe_zoffset until rehomed/probed and not to apply it accidentally by a G92 or Tool-change with a dual z axis system.
Should reloading the config and M851 reset the axis_is_homed flag for z, or for all axes, or at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the zprobe_zoffset
matters to the sw_endstop_min[Z_AXIS]
then the call to update_software_endstops(Z_AXIS)
is necessary to apply it here. Only the sw_endstop_min[Z_AXIS]
will be affected by this call, as nothing else will have changed.
Let's go one step back and take a look on the whole picture. When we are homing with the endstop and probing with the probe things become un-obvious. Likely we have to change from I guess currently it works most of the time because most people use the probe for homing when they have one and leave the |
@AnHardt I'm still trying to find a use-case or common instance where the extended Z floor makes sense. As you mention, the But when does the nozzle want to go "below the bed"? Or, to consider the other possibility, when is the Z position set "artificially" — as in a probe function — and then moved using a function that calls |
@thinkyhead 1 Software endstops are complete nonsense before homing. Because we do not know where we are. When we boot we set current_position to [0,0,0]. If our z-min-pos is 0, z-min endstop is enabled, we home with a probe what needs To your questions:
No. They describe the current chaos for the different probes. Not a reasonable plan for endstops - especially not for the software endstops.
No, i can't. If it then does not work other parts of the code are broken. |
bd1d256
to
d396a81
Compare
Ok, I will drop the extra (weird) offsets being applied to the Z sw endstop, give this a test and see what happens. I will have my printer set up again tomorrow. |
d396a81
to
e84f0aa
Compare
So far I see no problems in testing. Thinking about the In retrospect, adding (again) the negative part of |
320f516
to
fd6fb7a
Compare
fd6fb7a
to
d698c89
Compare
Background: When you switch extruders with the "T" command, the machine will attempt to move the selected extruder to the position of the previously-selected extruder. The machine still attempts to make this movement even with software endstops enabled because
gcode_T
is overridingcurrent_position
directly, but it doesn't follow up fully asG92
does, by updating the software endstops.This PR makes two changes:
gcode_T
when switching the extruder, apply the offsets toposition_shift
and callupdate_software_endstops()
for X and Y.update_software_endstops[Z_AXIS]
apply any negative offsets fromzprobe_zoffset
and/orhome_offset[Z_AXIS]
tosw_endstop_min[Z_AXIS]
. This is instead of applying these offsets inclamp_to_software_endstops
. (Some question as to why thezprobe_zoffset
constraint is needed outside of probing…?)zprobe_zoffset
now applies tosw_endstop_min[Z_AXIS]
generally, we now callupdate_software_endstops(Z_AXIS)
when changingzprobe_zoffset
.References: #3823, #3792