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 for [BUG] Head crashes after Home and Z-Align #21520 #21558

Closed

Conversation

kpishere
Copy link
Contributor

@kpishere kpishere commented Apr 7, 2021

Description

On any call to G28 a second time, the head crashes. home(x) home(y) needs to be unconditional.

Requirements

Tested on SMART RAMPS MEGA2560. By way of summary, this configuration has safe homing enabled with Z-induction probe and Z-min end stop with induction probe. So, after homing, the head is in the middle of the build plate, it isn't at position 0,0.

Benefits

No head crash

Configurations

In the referenced ticket #21520

Related Issues

#21520

@GMagician
Copy link
Contributor

What happens to you is really weird. I never noticed it and rehoming X and Y shouldn't be necessary once done the first time.
is 'Z align' you mention G34?

@thinkyhead
Copy link
Member

We obviously cannot accept this PR as it is. See if it helps to enable HOME_AFTER_DEACTIVATE for your situation.

@kpishere
Copy link
Contributor Author

kpishere commented Apr 8, 2021

@GMagician Yes, G34 is Z-align. I could remove G28 from my slicer start up script but I still have to be very mindful of not sending G28 more than once. That is stressful. Esp. since commands like G29 will issue G28 first. There are others that do that.

@kpishere
Copy link
Contributor Author

kpishere commented Apr 8, 2021

@thinkyhead I did try that switch but it does not pass sanity check.

#error "DISABLE_[XYZ] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."

Also, i hear what you are saying about not being able to pass this. The logic ahead of this change is the likely better place to update for only this style of configuration. I more wanted to share that hay, this change is fixing the problem and it isn't tmc drivers set too sensitive etc.

@thinkyhead
Copy link
Member

If you very much need DISABLE_X, DISABLE_Y, or DISABLE_Z, and you don't have the usual issues that come with those, I'd suggest commenting out that sanity-check, because it is only intended for common situations.

@kpishere
Copy link
Contributor Author

@thinkyhead In the attached ticket, I've added a link to a video that demonstrates the head crashing. This is easily done by calling G28 twice. In second G28, the head crashes. I think it is because in incorrectly sets X=0.0 in this case. For this configuration, the centre is home at X=116. In the output log, you'll see that Y is correctly homed at 117 but X is zero. I thing that is the bug. My hack in the related pull request is to explicitly call the homing function again on X and Y. I bet I don't need the Y though. The bug is with the X setting of home value.

@GMagician
Copy link
Contributor

GMagician commented Apr 13, 2021

The problem is for sure X=0 after home. It shouldn't have such value. Are you sure you don't have a bad configuration? I still use G28 and G34 with safe home, but at end of home X is not 0

@kpishere
Copy link
Contributor Author

kpishere commented Apr 13, 2021

@GMagician My configuration is in the linked ticket. Guys, notice I've made an update to the PR. After some thought, review, I think this is a more serious PR request. Notice the scope of this change is only for ENABLED(Z_SAFE_HOMING). I've also tested on my machine, of course. It works well now. That is, only does what is needed, there is no double homing (a double bump at endstop) of Y axis now.

@thinkyhead
Copy link
Member

Of course, home_z_safely is specifically designed to kick you out if X and Y are unhomed (or if they are unknown with HOME_AFTER_DEACTIVATE).

The problem I see in your log is that X and Y are indeed being homed by G28 on the second attempt, but according to your report the axes are not moving. That is why I think the endstops are getting triggered right away. G28 will only abandon a homing move when it sees that an endstop is triggered. And, it will only set an axis coordinate to the home position after doing a homing move. There is never one without the other.

See if it helps to enable IMPROVE_HOMING_RELIABILITY.

@kpishere
Copy link
Contributor Author

@thinkyhead Yep, I'd agree with that and that was the first thing I'd checked, but the pins aren't getting triggered -- I'd used software monitoring pin debug tool to verify that early on. If that were the case though, even with the explicit add to home(X) again, you'd expect it to do the same thing right? IE, not move. I'm thinking the flag that sets if home is required is wrong. So, my code fix is basically to not check that and home always.

I do have disable steppers off. I think by default that is on. I'm betting that is what is hiding this bug for most. Because if you have disable steppers enabled, then the flag that says home is required will be set when the steppers disable.

When the steppers don't disable, this X coordinate is improperly being set to zero when the head is in middle at home position. I'm thinking that is the true bug, what I have here is a work-around for that. Notice the Y isn't getting reset to zero. that should be another clue?

@GMagician
Copy link
Contributor

When you home first time, at end, what do you read on X position? is it 0 or is 0 after 2nd G28?

@kpishere
Copy link
Contributor Author

@GMagician After home first time, on the display, it is X:114, Y:116 or so, basically the middle of the plate.

After the second G28, on the display it will show same but the head is crashing to the right and is really byond 235.

@GMagician
Copy link
Contributor

@kpishere a test can be a G28 as first and then just a G28X to see what happens

@thinkyhead
Copy link
Member

After the second G28, on the display it will show same but

It seems clear that X/Y homing is being attempted and aborted because endstops are seen as triggered. (There is no other reason that Marlin will abandon a move.) Try sending these commands from your host and see if anything interesting happens:

G28
M120
G1 X0 F9999

…or…

G28
M120
G1 X0 Y0 F9999

@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 2 times, most recently from 83cc0bc to 73f6426 Compare April 16, 2021 10:14
@ryamoo
Copy link

ryamoo commented Apr 21, 2021

I found this thread (and a few others) because I've recently flashed to the latest bugfix (at the time, around the 1st April) and noticed that when cancelling a print and G28 XY is sent, the printer would attempt to "home" but X would move a few mm from it's current position and stop (usually somewhere near the middle of the bed), and Y would home correctly. I can immediately do another G28 (or just G28 X) and it homes as expected.

I've only just gotten chance to look into why - the thing that "fixed" it for me is "ENDSTOP_NOISE_THRESHOLD" and setting that to 2.
I had it set to 2 on the 2.0.7.2 release, and I'm not sure why I didn't enable it for my bugfix build - probably just overlooked it.
I can recall it being set on previous builds (created by others) that I've used too.

Enabling and setting that to 2, and the printer now homes correctly when doing G28 when cancelling a print.
Perhaps others with the issue of X homing in the centre could try that and see if it fixes it?
I'm guessing my X-endstop is quite noisy (inductive, on a Artillery Sidewinder X1) and so needs that setting, maybe they do too.

As far as I'm aware, the endstop sensors used for X and Y are the same, but the X endstop connects to a PCB/breakout board which also has the hotend, fans, thermistor and extruder motor connected. That PCB then then connects via ribbon cable to another board inside the case, which then connects to the mainboard, and I think the Y endstop is just connected via a simple extension cable to the mainboard. So it makes some sense to me that the X endstop would be "noisy".

@kpishere
Copy link
Contributor Author

@ryamoo Thanks for this info. However, this issue specifically relates to G28 home first time, good, then second time always wrong. Probably only applies for where z-safe-homing is used aka: z is homed by probe at centre of bed.

@ryamoo
Copy link

ryamoo commented Apr 21, 2021

@kpishere technically, that's what happens to me, just not with a G34. I do have safe homing enabled. My first home (before a print) is fine and "homes" on the far left, the second home (when I cancel the print) will "home" in the centre. Everything I do after that is then using that near-centre position as X0, and the head crashes to the right.
I'll flash my "bad" firmware tomorrow and see if G34 does it.

Have you tried changing your safe homing positions (Z_SAFE_HOMING_X_POINT and Z_SAFE_HOMING_Y_POINT) to somewhere near the front left, and see if that second home moves to that position, or if it stills homes X0 as the centre?
That's something I'm planning on testing myself tomorrow to see if the x-endstop is being trigger straight away, or if it's triggering near the safe-home X point.

@kpishere
Copy link
Contributor Author

kpishere commented Apr 24, 2021

@ryamoo So, I did as you suggested. Only, I put Z_SAFE_HOMING_X_POINT to 0.0 and Z_SAFE_HOMING_Y_POINT to YMAX as I'm expecting that Y-Axis is working fine. What I found was surprising. I'd expected that it would home OK, that is, always to zero and to y-max and it did, the first time. The second time however, the Y-Axis, still correct at YMAX but the X axis was offset by 44 mm. This is my X-Axis probe offset value. With each successive G28, the X origin moves in intervals of 44mm. So, 0, 44, 88, etc.

To me, this proves there are definitely some issues with X-Axis reset values in G28 operation.

Note: before doing the above change, I did revert my changes to fix this issue to what you see below which is the current branch version for bugfix-2.0.x last time I looked.

diff --git a/Marlin/src/gcode/calibrate/G28.cpp b/Marlin/src/gcode/calibrate/G28.cpp
index 6f2962fe4b..1d171884a9 100644
--- a/Marlin/src/gcode/calibrate/G28.cpp
+++ b/Marlin/src/gcode/calibrate/G28.cpp
@@ -121,12 +121,15 @@
   inline void home_z_safely() {
     DEBUG_SECTION(log_G28, "home_z_safely", DEBUGGING(LEVELING));
 
+    // Disallow Z homing if X or Y homing is needed
+    if (homing_needed_error(_BV(X_AXIS) | _BV(Y_AXIS))) return;
+
     // Ensure X and Y homed before Z homing
-    homeaxis(X_AXIS);
-    
-    if (homing_needed_error(_BV(Y_AXIS))) {
-      homeaxis(Y_AXIS);
-    }
+    //homeaxis(X_AXIS);
+
+    //if (homing_needed_error(_BV(Y_AXIS))) {
+    //  homeaxis(Y_AXIS);
+    //}
 
     sync_plan_position();

@thinkyhead
Copy link
Member

thinkyhead commented Apr 27, 2021

@kpishere — After each homing of X, we would expect the axis position to be set to its home position. So it would be good to see some logs during the period when you are seeing the constant 44mm offsets.

  • Enable DEBUG_LEVELING_FEATURE and M114_DETAIL and re-flash the firmware.
  • Issue the command M111 S247 to enable maximum logging.
  • Perform a G28 to do your standard homing procedure.
  • Do there homing moves that exhibit the problem. Repeat as necessary.
  • Copy the log output into a .TXT file and attach it to your next reply.

Repeat this procedure, if needed, to demonstrate inconsistencies. From these logs we should hopefully get a better idea of what's going on with your machine.

@kpishere
Copy link
Contributor Author

kpishere commented Apr 27, 2021

@thinkyhead Ok, I've set Z_SAFE_HOMING_X_POINT to zero, left Y at the centre. Firstly, here is setup, and then log of issuing G28 3 times.

What is physically happening:

  • After first G28 from reset, display shows X:44.0 Y:114.0 Z:5.0 (this agrees with physical position on plate)
  • second G28 shows: Same as above and the head is now at X:88 (approx. measure w. ruler)
  • third G28 shows: same as above but the head is now at X:132 (approx. measure w. ruler)
SETUP Log Output
echo:  G21    ; Units in mm (mm)
echo:  M149 C ; Units in Celsius

echo:; Filament settings: Disabled
echo:  M200 S0 D1.75
echo:; Steps per unit:
echo: M92 X80.00 Y80.00 Z400.00 E398.00
echo:; Maximum feedrates (units/s):
echo:  M203 X300.00 Y300.00 Z5.00 E25.00
echo:; Maximum Acceleration (units/s2):
echo:  M201 X3000.00 Y3000.00 Z100.00 E10000.00
echo:; Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>
echo:  M204 P3000.00 R3000.00 T3000.00
echo:; Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate> J<junc_dev>
echo:  M205 B20000.00 S0.00 T0.00 J0.01
echo:; Home offset:
echo:  M206 X0.00 Y0.00 Z0.00
echo:; Auto Bed Leveling:
echo:  M420 S0 Z10.00
echo:  G29 W I0 J0 Z0.01000
echo:  G29 W I1 J0 Z0.07500
echo:  G29 W I2 J0 Z-0.14750
echo:  G29 W I0 J1 Z0.15500
echo:  G29 W I1 J1 Z0.22750
echo:  G29 W I2 J1 Z0.04250
echo:  G29 W I0 J2 Z0.28000
echo:  G29 W I1 J2 Z0.28000
echo:  G29 W I2 J2 Z-0.00750
echo:; Material heatup parameters:
echo:  M145 S0 H180.00 B70.00 F0
echo:  M145 S1 H240.00 B110.00 F0
echo:; PID settings:
echo:  M301 P22.52 I1.91 D66.42
echo:  M304 P52.54 I9.72 D189.38
echo:; LCD Contrast:
echo:  M250 C190
echo:; Z-Probe Offset (mm):
echo:  M851 X-44.00 Y2.00 Z-0.60
echo:; Stepper driver current:
echo:  M906 X650 Y650 Z800
echo:  M906 T0 E550

echo:; StallGuard threshold:
echo:  M914 X70 Y70
echo:; Driver stepping mode:
echo:  M569 S1 X Y
echo:  M569 S1 T0 E
echo:; Filament load/unload lengths:
echo:  M603 L0.00 U100.00
ok
G28 Log Output
echo:DEBUG:ECHO,INFO,ERRORS,COMMUNICATION,LEVELING
ok
echo:G28
>>> G28  X44.00 Y114.00 Z5.00
Machine Type: Cartesian
Probe: FIX_MOUNTED_PROBE
Probe Offset X-44.00 Y2.00 Z-0.60 (Left-Back & Below Nozzle)
Auto Bed Leveling: BILINEAR (disabled)

Raise Z (before homing) by 5.00
>>> do_blocking_move_to  X44.00 Y114.00 Z5.00
>  X44.00 Y114.00 Z5.00
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
>>> homeaxis(88)
Home Fast: -348.00mm
>>> do_homing_move  X44.00 Y114.00 Z5.00
...(X, -348.00, [50.00])
<<< do_homing_move  X44.00 Y114.00 Z5.00
Endstop 88 hit at Phase:24 Delta:152 Distance:0.11
>>> do_homing_move  X44.00 Y114.00 Z5.00
...(X, 0.11, 25.00)
<<< do_homing_move  X44.00 Y114.00 Z5.00
>>> set_axis_is_at_home(X)
Axis 88 home_offset = 0.00 position_shift = 0.00
> home_offset[X] = 0.00
  current_position= X0.00 Y114.00 Z5.00 : 
<<< set_axis_is_at_home(88)
  current_position= X0.00 Y114.00 Z5.00 : sync_plan_position
  current_position= X0.00 Y114.00 Z5.00 : > AFTER set_axis_is_at_home
<<< homeaxis(88)
>>> homeaxis(89)
Home Fast: -348.00mm
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, -348.00, [50.00])
echo:busy: processing
<<< do_homing_move  X0.00 Y114.00 Z5.00
Endstop 89 hit at Phase:408 Delta:488 Distance:0.37
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, 0.37, 25.00)
<<< do_homing_move  X0.00 Y114.00 Z5.00
>>> set_axis_is_at_home(Y)
Axis 89 home_offset = 0.00 position_shift = 0.00
> home_offset[Y] = 0.00
  current_position= X0.00 Y0.00 Z5.00 : 
<<< set_axis_is_at_home(89)
  current_position= X0.00 Y0.00 Z5.00 : sync_plan_position
  current_position= X0.00 Y0.00 Z5.00 : > AFTER set_axis_is_at_home
<<< homeaxis(89)
>>> home_z_safely  X0.00 Y0.00 Z5.00
  current_position= X0.00 Y0.00 Z5.00 : sync_plan_position
  destination= X44.00 Y114.00 Z5.00 : home_z_safely
>>> do_blocking_move_to  X0.00 Y0.00 Z5.00
>  X44.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
>>> homeaxis(90)
  current_position= X44.00 Y114.00 Z5.00 : Probe::set_deployed
deploy: 1
Probe::do_z_raise(10.00)
>>> do_blocking_move_to  X44.00 Y114.00 Z5.00
>  X44.00 Y114.00 Z10.60
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z10.60
>>> do_blocking_move_to  X44.00 Y114.00 Z10.60
>  X44.00 Y114.00 Z10.60
<<< do_blocking_move_to  X44.00 Y114.00 Z10.60
Home Fast: -384.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, -384.00, [4.00])
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Move Away: 5.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, 5.00, 4.00)
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Re-bump: -10.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, -10.00, 2.00)
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Endstop 90 hit at Phase:312 Delta:440 Distance:0.07
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, 0.07, 2.00)
<<< do_homing_move  X44.00 Y114.00 Z10.60
>>> set_axis_is_at_home(Z)
*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***
> probe.offset.z = -0.60
Axis 90 home_offset = 0.00 position_shift = 0.00
> home_offset[Z] = 0.00
  current_position= X44.00 Y114.00 Z0.60 : 
<<< set_axis_is_at_home(90)
  current_position= X44.00 Y114.00 Z0.60 : sync_plan_position
  current_position= X44.00 Y114.00 Z0.60 : > AFTER set_axis_is_at_home
  current_position= X44.00 Y114.00 Z0.60 : Probe::set_deployed
deploy: 0
>>> do_blocking_move_to  X44.00 Y114.00 Z0.60
>  X44.00 Y114.00 Z0.60
<<< do_blocking_move_to  X44.00 Y114.00 Z0.60
<<< homeaxis(90)
<<< home_z_safely  X44.00 Y114.00 Z0.60
>>> do_blocking_move_to  X44.00 Y114.00 Z0.60
>  X44.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
  current_position= X44.00 Y114.00 Z5.00 : sync_plan_position
X:44.00 Y:114.00 Z:5.00 E:0.00 Count X:3520 Y:9120 Z:2000
<<< G28  X44.00 Y114.00 Z5.00
ok
echo:G28
>>> G28  X44.00 Y114.00 Z5.00
Machine Type: Cartesian
Probe: FIX_MOUNTED_PROBE
Probe Offset X-44.00 Y2.00 Z-0.60 (Left-Back & Below Nozzle)
Auto Bed Leveling: BILINEAR (disabled)

Raise Z (before homing) by 5.00
>>> do_blocking_move_to  X44.00 Y114.00 Z5.00
>  X44.00 Y114.00 Z5.00
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
>>> homeaxis(88)
Home Fast: -348.00mm
>>> do_homing_move  X44.00 Y114.00 Z5.00
...(X, -348.00, [50.00])
<<< do_homing_move  X44.00 Y114.00 Z5.00
Endstop 88 hit at Phase:8 Delta:136 Distance:0.10
>>> do_homing_move  X44.00 Y114.00 Z5.00
...(X, 0.10, 25.00)
<<< do_homing_move  X44.00 Y114.00 Z5.00
>>> set_axis_is_at_home(X)
Axis 88 home_offset = 0.00 position_shift = 0.00
> home_offset[X] = 0.00
  current_position= X0.00 Y114.00 Z5.00 : 
<<< set_axis_is_at_home(88)
  current_position= X0.00 Y114.00 Z5.00 : sync_plan_position
  current_position= X0.00 Y114.00 Z5.00 : > AFTER set_axis_is_at_home
<<< homeaxis(88)
>>> homeaxis(89)
Home Fast: -348.00mm
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, -348.00, [50.00])
echo:busy: processing
<<< do_homing_move  X0.00 Y114.00 Z5.00
Endstop 89 hit at Phase:392 Delta:504 Distance:0.39
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, 0.39, 25.00)
<<< do_homing_move  X0.00 Y114.00 Z5.00
>>> set_axis_is_at_home(Y)
Axis 89 home_offset = 0.00 position_shift = 0.00
> home_offset[Y] = 0.00
  current_position= X0.00 Y0.00 Z5.00 : 
<<< set_axis_is_at_home(89)
  current_position= X0.00 Y0.00 Z5.00 : sync_plan_position
  current_position= X0.00 Y0.00 Z5.00 : > AFTER set_axis_is_at_home
<<< homeaxis(89)
>>> home_z_safely  X0.00 Y0.00 Z5.00
  current_position= X0.00 Y0.00 Z5.00 : sync_plan_position
  destination= X44.00 Y114.00 Z5.00 : home_z_safely
>>> do_blocking_move_to  X0.00 Y0.00 Z5.00
>  X44.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
>>> homeaxis(90)
  current_position= X44.00 Y114.00 Z5.00 : Probe::set_deployed
deploy: 1
Probe::do_z_raise(10.00)
>>> do_blocking_move_to  X44.00 Y114.00 Z5.00
>  X44.00 Y114.00 Z10.60
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z10.60
>>> do_blocking_move_to  X44.00 Y114.00 Z10.60
>  X44.00 Y114.00 Z10.60
<<< do_blocking_move_to  X44.00 Y114.00 Z10.60
Home Fast: -384.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, -384.00, [4.00])
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Move Away: 5.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, 5.00, 4.00)
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Re-bump: -10.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, -10.00, 2.00)
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Selected home phase 896 too close to endstop trigger phase 712. Pick a different phase for 90
Endstop 90 hit at Phase:712 Delta:840 Distance:0.13
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, 0.13, 2.00)
<<< do_homing_move  X44.00 Y114.00 Z10.60
>>> set_axis_is_at_home(Z)
*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***
> probe.offset.z = -0.60
Axis 90 home_offset = 0.00 position_shift = 0.00
> home_offset[Z] = 0.00
  current_position= X44.00 Y114.00 Z0.60 : 
<<< set_axis_is_at_home(90)
  current_position= X44.00 Y114.00 Z0.60 : sync_plan_position
  current_position= X44.00 Y114.00 Z0.60 : > AFTER set_axis_is_at_home
  current_position= X44.00 Y114.00 Z0.60 : Probe::set_deployed
deploy: 0
>>> do_blocking_move_to  X44.00 Y114.00 Z0.60
>  X44.00 Y114.00 Z0.60
<<< do_blocking_move_to  X44.00 Y114.00 Z0.60
<<< homeaxis(90)
<<< home_z_safely  X44.00 Y114.00 Z0.60
>>> do_blocking_move_to  X44.00 Y114.00 Z0.60
>  X44.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
  current_position= X44.00 Y114.00 Z5.00 : sync_plan_position
X:44.00 Y:114.00 Z:5.00 E:0.00 Count X:3520 Y:9120 Z:2000
<<< G28  X44.00 Y114.00 Z5.00
ok
echo:G28
>>> G28  X44.00 Y114.00 Z5.00
Machine Type: Cartesian
Probe: FIX_MOUNTED_PROBE
Probe Offset X-44.00 Y2.00 Z-0.60 (Left-Back & Below Nozzle)
Auto Bed Leveling: BILINEAR (disabled)

Raise Z (before homing) by 5.00
>>> do_blocking_move_to  X44.00 Y114.00 Z5.00
>  X44.00 Y114.00 Z5.00
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
>>> homeaxis(88)
Home Fast: -348.00mm
>>> do_homing_move  X44.00 Y114.00 Z5.00
...(X, -348.00, [50.00])
<<< do_homing_move  X44.00 Y114.00 Z5.00
Endstop 88 hit at Phase:8 Delta:136 Distance:0.10
>>> do_homing_move  X44.00 Y114.00 Z5.00
...(X, 0.10, 25.00)
<<< do_homing_move  X44.00 Y114.00 Z5.00
>>> set_axis_is_at_home(X)
Axis 88 home_offset = 0.00 position_shift = 0.00
> home_offset[X] = 0.00
  current_position= X0.00 Y114.00 Z5.00 : 
<<< set_axis_is_at_home(88)
  current_position= X0.00 Y114.00 Z5.00 : sync_plan_position
  current_position= X0.00 Y114.00 Z5.00 : > AFTER set_axis_is_at_home
<<< homeaxis(88)
>>> homeaxis(89)
Home Fast: -348.00mm
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, -348.00, [50.00])
echo:busy: processing
<<< do_homing_move  X0.00 Y114.00 Z5.00
Endstop 89 hit at Phase:376 Delta:520 Distance:0.40
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, 0.40, 25.00)
<<< do_homing_move  X0.00 Y114.00 Z5.00
>>> set_axis_is_at_home(Y)
Axis 89 home_offset = 0.00 position_shift = 0.00
> home_offset[Y] = 0.00
  current_position= X0.00 Y0.00 Z5.00 : 
<<< set_axis_is_at_home(89)
  current_position= X0.00 Y0.00 Z5.00 : sync_plan_position
  current_position= X0.00 Y0.00 Z5.00 : > AFTER set_axis_is_at_home
<<< homeaxis(89)
>>> home_z_safely  X0.00 Y0.00 Z5.00
  current_position= X0.00 Y0.00 Z5.00 : sync_plan_position
  destination= X44.00 Y114.00 Z5.00 : home_z_safely
>>> do_blocking_move_to  X0.00 Y0.00 Z5.00
>  X44.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
>>> homeaxis(90)
  current_position= X44.00 Y114.00 Z5.00 : Probe::set_deployed
deploy: 1
Probe::do_z_raise(10.00)
>>> do_blocking_move_to  X44.00 Y114.00 Z5.00
>  X44.00 Y114.00 Z10.60
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z10.60
>>> do_blocking_move_to  X44.00 Y114.00 Z10.60
>  X44.00 Y114.00 Z10.60
<<< do_blocking_move_to  X44.00 Y114.00 Z10.60
Home Fast: -384.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, -384.00, [4.00])
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Move Away: 5.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, 5.00, 4.00)
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Re-bump: -10.00mm
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, -10.00, 2.00)
echo:busy: processing
<<< do_homing_move  X44.00 Y114.00 Z10.60
Selected home phase 896 too close to endstop trigger phase 760. Pick a different phase for 90
Endstop 90 hit at Phase:760 Delta:888 Distance:0.14
>>> do_homing_move  X44.00 Y114.00 Z10.60
...(Z, 0.14, 2.00)
<<< do_homing_move  X44.00 Y114.00 Z10.60
>>> set_axis_is_at_home(Z)
*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***
> probe.offset.z = -0.60
Axis 90 home_offset = 0.00 position_shift = 0.00
> home_offset[Z] = 0.00
  current_position= X44.00 Y114.00 Z0.60 : 
<<< set_axis_is_at_home(90)
  current_position= X44.00 Y114.00 Z0.60 : sync_plan_position
  current_position= X44.00 Y114.00 Z0.60 : > AFTER set_axis_is_at_home
  current_position= X44.00 Y114.00 Z0.60 : Probe::set_deployed
deploy: 0
>>> do_blocking_move_to  X44.00 Y114.00 Z0.60
>  X44.00 Y114.00 Z0.60
<<< do_blocking_move_to  X44.00 Y114.00 Z0.60
<<< homeaxis(90)
<<< home_z_safely  X44.00 Y114.00 Z0.60
>>> do_blocking_move_to  X44.00 Y114.00 Z0.60
>  X44.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X44.00 Y114.00 Z5.00
  current_position= X44.00 Y114.00 Z5.00 : sync_plan_position
X:44.00 Y:114.00 Z:5.00 E:0.00 Count X:3520 Y:9120 Z:2000
<<< G28  X44.00 Y114.00 Z5.00
ok

@thinkyhead
Copy link
Member

It looks like you're using some version of Marlin from before April 3 because of this:

Endstop 88 hit at Phase:24 Delta:152 Distance:0.11

After April 3 it will read:

Endstop X hit at Phase:24 Delta:152 Distance:0.11

It's important to reply to requests for tests using the most recent version available.

I will continue to review the log to see if it explains the problem….

@thinkyhead
Copy link
Member

Looking at the logs confirms my earlier conclusions. Your endstop is being triggered early. Then your Z_SAFE_HOMING settings move the X axis over by 44mm, and then your Z homing gives a weird complaint:

-Selected home phase 896 too close to endstop trigger phase 712. Pick a different phase for Z
-Selected home phase 896 too close to endstop trigger phase 760. Pick a different phase for Z

It looks like you may have sensorless homing enabled for your Z axis, even though it is homing with a probe. Some boards have jumpers to tie the DIAG pins to the endstop pins. Maybe your Z is tied when it shouldn't be, or perhaps Marlin is not ignoring / disabling the sensorless homing trigger for Z when a probe is being used.

After a quick glance at the code, it looks like the TMC_HOME_PHASE option might be biting you, since I don't think Marlin should be calling backout_to_tmc_homing_phase on the Z axis even with that option enabled. My guess is that if you disable that option you will get successful homing again. I'll see what I can do to make a patch.

@thinkyhead
Copy link
Member

This might be the answer:

#define TMC_HOME_PHASE { 896, 896, -1 }

@kpishere
Copy link
Contributor Author

@thinkyhead Yes, z-sensorless endstop is still defined even though using z-probe. But, this is desirable still for when doing z-alignment. As for those alignment messages, I don't understand them so I have left them as is. Is it something to do with TMC having 1024 steps step table but you want to use a number that aligns with 1/2,1/4,1/8, or 1/16 step? In any case, thank you for your time! I'll rebase again, just to keep up to date for testing.

@thinkyhead
Copy link
Member

Yes, I think it's ultimately a bug that sensorless homing is getting activated for Z probing, so that will still have to be patched. Then, presumably it will still be usable for features like axis alignment.

@thinkyhead
Copy link
Member

As the error message also implies, "selected home phase 896 too close to endstop trigger phase 712. Pick a different phase for Z" — So you might be able to use a larger or smaller number. The formula to check for a too-close value is:

ABS(phaseDelta) * planner.steps_to_mm[axis] / phasePerUStep < 0.05f

@thinkyhead thinkyhead closed this May 11, 2021
@kpishere kpishere deleted the fix-Head-21520 branch May 11, 2021 23:46
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.

None yet

5 participants