Skip to content
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 HOME_AFTER_DEACTIVATE behavior when steppers released #18907

Conversation

swissnorp
Copy link
Contributor

@swissnorp swissnorp commented Aug 2, 2020

Description

There are many situations where HOME_AFTER_DEACTIVATE does not work as i understand it to work. Especially if NO_MOTION_BEFORE_HOMING is enabled.

In most cases just axis_homed is checked (by TEST(axis_homed... or by function all_axes_homed) which does not respect HOME_AFTER_DEACTIVATE. Instead homing_needed() should be used instead of all_axes_homed()...

The easier and more strict way would be to change the behavior of DISABLE_AXIS_X(), DISABLE_AXIS_Y() and DISABLE_AXIS_Z() in indirection.h

  • If HOME_AFTER_DEACTIVATE is enabled the axis will be no more trusted if stepper has been disabled. set_axis_not_trusted(axis) instead of CBI(axis_known_position, axis).

Benefits

HOME_AFTER_DEACTIVATE works as intended, especially if NO_MOTION_BEFORE_HOMING is activated.
More security for users.

@thinkyhead
Copy link
Member

I don't think this can be applied without negative side-effects. We can't just throw away the differentiation between an axis being "homed" and an axis being "known" as there may be valid reasons to retain this distinction for some cases, even when using HOME_AFTER_DEACTIVATE.

@swissnorp
Copy link
Contributor Author

I have looked as far as i could to find parts of marlin, where this could have a negative side effect.. i could not find any.

If HOME_AFTER_DEACTIVATE is enabled the whole machine should be in a state as it was never homed before after stepper have ben released. Homing should be forced as described. thats my opinion/understanding as a cnc mechanic :)

@thinkyhead
Copy link
Member

Anything that calls axes_need_homing function will get the right answer based on HOME_AFTER_DEACTIVATE. If some feature is misbehaving —as you alluded to— then it must be accessing the flags directly and not calling this function. In each case that you have seen we will need to check whether there is a sound reason for that behavior.

@thinkyhead thinkyhead force-pushed the FIX-HOME_AFTER_DEACTIVATE-behavior-when-steppers-released branch from 2026800 to e3302af Compare August 27, 2020 20:58
@thinkyhead thinkyhead merged commit a12ac5e into MarlinFirmware:bugfix-2.0.x Aug 27, 2020
susisstrolch pushed a commit to susisstrolch/Marlin that referenced this pull request Aug 28, 2020
…K8800-2.0.x

* tag '2.0.6.1' of https://github.com/MarlinFirmware/Marlin: (195 commits)
  Version 2.0.6.1
  [cron] Bump distribution date (2020-08-28)
  Add set_all_homed
  Mark axes not-homed with HOME_AFTER_DEACTIVATE (MarlinFirmware#18907)
  set_axis_not_trusted => set_axis_never_homed
  Independent Neopixel option (MarlinFirmware#19115)
  Fix Creality V4 probe pin
  Fix small typø
  Allocate sufficient MSG_MOVE_Z_DIST buffer
  One MARLIN_DEV_MODE warning per rebuild (MarlinFirmware#19163)
  FYSETC S6 2.0 (MarlinFirmware#19140)
  [cron] Bump distribution date (2020-08-27)
  Fix SINGLENOZZLE fan speed bug (MarlinFirmware#19152)
  Fix NEOPIXEL_STARTUP_TEST last delay (MarlinFirmware#19156)
  TFT (plus Hardware SPI) for LPC (MarlinFirmware#19139)
  Prusa => Průša
  Direct Stepping update (MarlinFirmware#19135)
  Fixes to FTDI Touch UI (MarlinFirmware#19134)
  Add Einsy Rambo Filament Runout Pin (MarlinFirmware#19136)
  Fix SD pins for SKR Pro and GTR (MarlinFirmware#19047)
  ...
@swissnorp swissnorp deleted the FIX-HOME_AFTER_DEACTIVATE-behavior-when-steppers-released branch August 29, 2020 10:20
albertogg pushed a commit to albertogg/Marlin that referenced this pull request Aug 31, 2020
thinkyhead pushed a commit to thinkyhead/Marlin that referenced this pull request Sep 2, 2020
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants