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

Z-Axis Homing: Z_Homing_Height not working #19428

Closed
ghost opened this issue Sep 17, 2020 · 40 comments
Closed

Z-Axis Homing: Z_Homing_Height not working #19428

ghost opened this issue Sep 17, 2020 · 40 comments

Comments

@ghost
Copy link

ghost commented Sep 17, 2020

First Post:

When my printer is first turned on using 2.0.6.1 and set to begin homing, the Z_HOMING_HEIGHT option ensures that the z-axis raises 4mm to ensure it doesn't scratch bed surface. However, when stepper motors timeout and power down, the z axis falls. Homing after it falls no longer raises z axis, presumably because it assumes z axis doesn't fall when powered off. This then leads to scratch on bed surface. A further refinement would be that the Z-axis always raises 4mm when it detects that the z-limit switch is activated to ensure it doesn't scratch bed. This also ensure that if at max height it doesn't raise beyond max limits as well because switch won't be active. Thus 3 zones of behavior: when z_min limit switch active: raise 4 mm before homing; when z unknown and min limit switch not active: don't raise; when z is known, below z_max, and limit switch not active: raise or don't raise depending on user preference. I should mention that the UNKNOWN_Z_NO_RAISE doesn't prevent bed scratch.

Additional Information

I am using creality ender 3 with the new mainboard 4.2.2 .
Config Files for 2.0.6.1
Configuration.txt
Configuration_adv.txt

Second Post:

Okay so with some further experimenting, I have discovered the following:
If I manually disable the steppers from the LCD menu and then rehome:
The z axis falls after disabling and then it raises 10mm before homing,
but if the stepper times out and the z axis falls, then it won't raise 10mm.

Why is this? what is the difference between a manual disable versus a timeout disable of stepper motors?

Updates

printer is now using 2.0.7/bugfix. Same problem though. Attached are the updated config files in zip form:
Configuration.zip

@ghost ghost added the T: Feature Request Features requested by users. label Sep 17, 2020
@qwewer0
Copy link
Contributor

qwewer0 commented Sep 17, 2020

Does HOME_AFTER_DEACTIVATE helps?

@ghost
Copy link
Author

ghost commented Sep 17, 2020

Well, the problem is that even when homing it won't raise for clearance. it only appears to do that for the first home after powering on. So, when steppers deactivate, z axis falls, and homing is called on again, the extruder will scratch the surface and not raise 4mm. Which is why I was saying it should just always raise if limit switch is active.

@qwewer0
Copy link
Contributor

qwewer0 commented Sep 18, 2020

You are right, HOME_AFTER_DEACTIVATE does not rises the Z axis after the steppers have timed out.

@sjasonsmith sjasonsmith added Needs: More Data We need more data in order to proceed and removed T: Feature Request Features requested by users. labels Sep 20, 2020
@sjasonsmith
Copy link
Contributor

Please attach your Marlin configuration files, as requested by the issue template. Marlin behavior is extremely configurable, and it is very difficult to debug any issue without knowing how the firmware is configured.

@ghost
Copy link
Author

ghost commented Sep 20, 2020

Sorry for the late response, it was a busy week. But I edited the question to include config files with .h replaced with .txt so github won't complain.

@sjasonsmith sjasonsmith removed the Needs: More Data We need more data in order to proceed label Sep 20, 2020
@ghost
Copy link
Author

ghost commented Sep 30, 2020

Okay so with some further experimenting, I have discovered the following:
If I manually disable the steppers from the LCD menu and then rehome:
The z axis falls after disabling and then it raises 10mm before homing,
but if the stepper times out and the z axis falls, then it won't raise 10mm.

Why is this? what is the difference between a manual disable versus a timeout disable of stepper motors?

@ghost
Copy link
Author

ghost commented Oct 6, 2020

:-(

@boelle
Copy link
Contributor

boelle commented Oct 6, 2020

as @sjasonsmith said

Configurations, please
Please ZIP up your Configuration.h and Configuration_adv.h files (as
requested in the Issue template) and drop them into your next reply.
We'll check them over and see if anything is amiss.

@sjasonsmith
Copy link
Contributor

@boelle they already attached them to the issue description.

@boelle
Copy link
Contributor

boelle commented Oct 6, 2020

must have been blind again... at least i did not see it attach 4 hours ago

@qwewer0
Copy link
Contributor

qwewer0 commented Oct 6, 2020

For me, after I homed the printer, then disabled the steppers via either M18, M84, LCD or timed out, the printer doesn't raise the Z axis for the next homing.

Step by step:

  1. Turn on printer
  2. Select Auto Home (first time)
  3. Z axis rises by Z_CLEARANCE_BETWEEN_PROBES (I believe)
  4. X and Y homed
  5. X and Y moves to Z_SAFE_HOMING
  6. Z axis rises by (Z_CLEARANCE_DEPLOY_PROBE - Z_CLEARANCE_BETWEEN_PROBES - Z probe offset) (I believe)
  7. Z probed/homed
  8. Z rises to Z_CLEARANCE_DEPLOY_PROBE (I believe)
  9. Disable Steppers
  10. Select Auto Home (second time)
  11. X and Y homed
  12. X and Y moves to Z_SAFE_HOMING
  13. Z probed/homed
  14. Z rises to Z_CLEARANCE_DEPLOY_PROBE (I believe)

I think this wasn't always the case, and the second homing should act just as the first one.

Edit: Latest Bugfix-2.0.x
Configuration.zip

@ghost
Copy link
Author

ghost commented Oct 7, 2020

thanks guys :-) . Also yes I can second qwewer0's post. Mine follows that same sequence of events as well.

@ghost ghost changed the title Refinement for Z_HOMING_HEIGHT Z-Axis Homing Scratches Bed Oct 7, 2020
@ghost ghost changed the title Z-Axis Homing Scratches Bed Z-Axis Homing: Z_Homing_Height not working Oct 11, 2020
@ghost
Copy link
Author

ghost commented Oct 19, 2020

So I managed to fix my printer up so that it won't fall anymore, but I still think this is abnormal behavior.

@ghost ghost closed this as completed Oct 19, 2020
@qwewer0
Copy link
Contributor

qwewer0 commented Oct 19, 2020

@yysh12 Could you please reopen this issue? There is clearly something off with the homing height, so this is still relevant, even if not for a bug, but for a feature request.

@ghost
Copy link
Author

ghost commented Oct 19, 2020

Oh sure no problem. I reopened it.

@github-actions
Copy link

This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days.

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 28, 2020

Still a problem.

@ellensp
Copy link
Contributor

ellensp commented Nov 28, 2020

@qwewer0 with current bugfix or some older version?

@ghost
Copy link
Author

ghost commented Nov 28, 2020

Haven't tried it with latest bugfix,
But appears to still be present with 2.7.2

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 28, 2020

@ellensp Yes, with the latest bugfix-2.0.x

The same thing happens as in #19428 (comment)

Configuration.zip

@thinkyhead
Copy link
Member

If UNKNOWN_Z_NO_RAISE is enabled there will be no raise at the start of G28 unless the Z axis has been homed and the Z steppers have remained powered all the time since the last G28. Please disable UNKNOWN_Z_NO_RAISE if you have a bed or Z gantry that stays in place when powered off, and you don't care about Z being raised after the steppers have turned off.

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 28, 2020

@thinkyhead I don't have UNKNOWN_Z_NO_RAISE enabled. And neither @yysh12 have it enabled in the provided config zip.
I think my z axis stays in place fairly good, but I wouldn't trust it, so a raise would be nice after the steppers have been turned off.

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 28, 2020

Okay so with some further experimenting, I have discovered the following:
If I manually disable the steppers from the LCD menu and then rehome:
The z axis falls after disabling and then it raises 10mm before homing,
but if the stepper times out and the z axis falls, then it won't raise 10mm.

@yysh12 When I disable the steppers from the LCD, the rehoming does not raises the z axis.

Things that differ from my config to the main post, and might have some effect on the problem, (but I have no idea):

  • //#define Z_HOMING_HEIGHT 4 (disabled - enabled)
  • //#define Z_AFTER_HOMING 10 (disabled - enabled)
  • #define DISABLE_INACTIVE_Z true (true - false)

@ghost
Copy link
Author

ghost commented Nov 28, 2020

Oh interesting. Yours won't raise at all. Yeah mine does raise on manual disable just not auto disable. Disabling inactive z didn't seem to help either.

@ghost
Copy link
Author

ghost commented Nov 28, 2020

Oh wait. I didn't read it correct. You have the z homing height disabled. You have to have that enabled for it to raise.

@ghost
Copy link
Author

ghost commented Nov 28, 2020

For me the problem is that for some reason auto timeout of steppers behaves differently than manual disable or steppers, such that z homing height is ignored on auto timeout.

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 28, 2020

Oh wait. I didn't read it correct. You have the z homing height disabled. You have to have that enabled for it to raise.

I think after M84 or stepper timeout the next homing should behave as it behaves when first homed, because after the printer can no longer know where each axis is, then it should act as on the first homing.

New information: If I move the Z axis from the LCD or serial then after I disable the steppers, the next (first) homing acts as the problematic homing, so without any z axis rise, as if it still knows the Z axis position, despite the fact that the Z axis could have sunk.
So it seems, that M84 or stepper timeout doesn't erases the last Z position.

@thinkyhead
Copy link
Member

You can try reverting this change from 73ce80a, which was done to address some other issue…

- do_z_clearance(z_homing_height, TEST(axis_known_position, Z_AXIS), DISABLED(UNKNOWN_Z_NO_RAISE));
+ do_z_clearance(z_homing_height, true, DISABLED(UNKNOWN_Z_NO_RAISE));

@qwewer0
Copy link
Contributor

qwewer0 commented Nov 30, 2020

On the latest bugfix-2.0.x (presumably because of #20323)
This is what happens compared to #19428 (comment):
Now between the 9th and 10th point:

  • Z axis rises by Z_CLEARANCE_BETWEEN_PROBES (I believe)

Which is a big leap in the positive direction, as a z axis drop after stepper deactivation is no longer a problem (unless I'm missing something), because the Z axis rises on the next homing, but still, after the 10th point it is not rises the Z axis by (Z_CLEARANCE_DEPLOY_PROBE - Z_CLEARANCE_BETWEEN_PROBES - Z probe offset) (I believe)

@thinkyhead Could you confirm one thing for me or point my to a code?
After the XY axis is homed and moved to Z_SAFE_HOMING position, where or how much the Z axis will rise? (5th point on #19428 (comment)) By my crude measurements, it will rise an additional (Z_CLEARANCE_DEPLOY_PROBE - Z_CLEARANCE_BETWEEN_PROBES - Z probe offset), but I'm just assuming this.

Thank you for #20323, and in general.

@swissnorp
Copy link
Contributor

swissnorp commented Nov 30, 2020

Sorry guys but i dont think this is a bug... try to enable the following in configuration_adv.h:

// If the Nozzle or Bed falls when the Z stepper is disabled, set its resting position here.
#define Z_AFTER_DEACTIVATE Z_HOME_POS

Mentioning the following pull request / commit:
#18906

We may should consider to move this setting to configuration.h as we did with following pull request for HOME_AFTER_DEACTIVATE:
#20283

EDIT1:

Without Z_AFTER_DEACTIVATE the Z-axis will only rise if you moved it below Z_HOMING_HEIGHT before releasing the stepper and it will only rise by the difference between z.current_position and Z_HOMING_HEIGHT

EDIT2:

@yysh12, @qwewer0 can you test this please?

@ghost
Copy link
Author

ghost commented Dec 1, 2020

Hello, so I actually am away from my printer until March 10th so I will be unable to test anything out until then. That being said, I will definitely try out your recommendations once I get back home. But I should also note that I actually already tried utilizing that option to no avail. The main problem I am trying to understand is why my automatic stepper timeout is behaving differently than my manual stepper timeout. Basically if I manually disable the steppers, Z_homing_height works as expected and provides clearance from the build plate, but if the steppers auto-timeout they refuse to provide the clearance. And both tests were done at the same height. But I will definitely take a closer look at the Z_after_deactivate next time I with my printer and Ill have to let you know then.

@swissnorp
Copy link
Contributor

@yysh12 Ok, thank you for your reply.

@qwewer0 What about you? Could you test this?

@qwewer0
Copy link
Contributor

qwewer0 commented Dec 11, 2020

@swissnorp Sorry, didn't saw your edit.

First of all, this is the first homing sequence on my printer:
(which I believe should be the homing sequence after a stepper deactivation)

  1. Z axis rises by Z_CLEARANCE_BETWEEN_PROBES (I think)
  2. X and Y homed
  3. X and Y moves to Z_SAFE_HOMING
  4. Z axis rises by (Z_CLEARANCE_DEPLOY_PROBE - Z_CLEARANCE_BETWEEN_PROBES - Z probe offset) (I think)
  5. Z probed/homed
  6. Z rises to Z_CLEARANCE_DEPLOY_PROBE (I think)

Now on to the testing:

  • Without any extra feature enabled:
    If the next homing after a stepper deactivation (from LCD) is called when the z position is lower than Z_HOMING_HEIGHT (maybe?), then it behaves just like the first homing, otherwise if the z position isn't lowered, then it homes without the 4th point (above), which is now my main concern.
  • With Z_AFTER_DEACTIVATE (and therefore Z_HOMING_HEIGHT = Z_CLEARANCE_BETWEEN_PROBES):
    After a stepper deactivation (from LCD), if the next homing is done from lower, higher or from the same z position as the previous homing ended, it behaves just like the fist homing without any extra movement anywhere.

@swissnorp
Copy link
Contributor

@qwewer0
So you can confiirm it's not a bug, right?
It behafes as it should as mentioned?

Without Z_AFTER_DEACTIVATE the Z-axis will only rise if you moved it below Z_HOMING_HEIGHT before releasing the stepper and it will only rise by the difference between z.current_position and Z_HOMING_HEIGHT

I will open a pull request to move Z_AFTER_DEACTIVATE to configuration.h.

@qwewer0
Copy link
Contributor

qwewer0 commented Dec 11, 2020

@qwewer0
So you can confiirm it's not a bug, right?
It behafes as it should as mentioned?

As I mentioned it, I think the next homing after a stepper deactivation should behave the same as the first homing, but it doesn't! And I don't think it should need a z axis is lowering to do so.

So, I still think that there is a bug as it does not behave as it should.

@swissnorp
Copy link
Contributor

swissnorp commented Dec 12, 2020

  • Without any extra feature enabled:
    If the next homing after a stepper deactivation (from LCD) is called when the z position is lower than Z_HOMING_HEIGHT (maybe?), then it behaves just like the first homing, otherwise if the z position isn't lowered, then it homes without the 4th point (above), which is now my main concern.

  • With Z_AFTER_DEACTIVATE (and therefore Z_HOMING_HEIGHT = Z_CLEARANCE_BETWEEN_PROBES):
    After a stepper deactivation (from LCD), if the next homing is done from lower, higher or from the same z position as the previous homing ended, it behaves just like the fist homing without any extra movement anywhere.

Thats exactly how it should behave!
do_z_clearance is not intended to raise everytime you call it!

#18576
#18906

As I mentioned it, I think the next homing after a stepper deactivation should behave the same as the first homing, but it doesn't! And I don't think it should need a z axis is lowering to do so.

So, I still think that there is a bug as it does not behave as it should.

If you want this to happen you must enable Z_AFTER_DEACTIVATE. Otherwise marlin assumes that z is hight enough and clearance is available.

@qwewer0
Copy link
Contributor

qwewer0 commented Dec 12, 2020

Otherwise marlin assumes that z is hight enough and clearance is available.

That is (one of?) the main problem. On a freshly bought printer, Z_AFTER_DEACTIVATE most likely isn't enabled, as the manufacturer doesn't think that their Z axis would fall, as on their testing it did not, but if with time the Z-rod runs smoother and/or it is greased, then the Z axis might fall at some point without the user knowledge, and not everyone able or willing to thinker with marlin, and that is why marlin should always assume that after a Z stepper deactivation the Z height isn't useable/trustable, and so it should always raise it on the next homing.
With corexy, and falling bed, that is the other side of this problem, that a rise could cause stepper grind, but that isn't destructive compared to the nozzle grinding the bed surface.
At the moment on the latest bugfix-2.0.x, the homing after Z stepper deactivation is almost perfect, to the point that I would almost say that there is no problem anymore, but that isn't the truth. (#19428 (comment))

@github-actions
Copy link

This issue has had no activity in the last 30 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 7 days.

neilvangeffen added a commit to neilvangeffen/MarlinBuilder that referenced this issue May 14, 2021
@neilvangeffen
Copy link
Contributor

Im having a similar issue, but i get absolutely no z raise, regardless of what i try, and im stumped....
Even when i turn the machine on first time, connect to simplify3d and press home all, or send G28, it just homes X, they Y and then Z, with no Z Raise anywhere... It's been driving me bananas for the last 4 hours, and i cant find the problem

Was using 2.0.7.2 and that didnt work, so then moved to latest bugfix 2.0 and also no dice

Cant get Z to Raize.zip

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants