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

[BUG] Head crashes after Home and Z-Align #21520

Closed
kpishere opened this issue Apr 2, 2021 · 7 comments
Closed

[BUG] Head crashes after Home and Z-Align #21520

kpishere opened this issue Apr 2, 2021 · 7 comments

Comments

@kpishere
Copy link
Contributor

kpishere commented Apr 2, 2021

Did you test the latest bugfix-2.0.x code?

Yes, and the problem still exists.

Bug Description

First homing operation works, second one does not. It crashes to the right in a second home operation.

Bug Timeline

Has been there since December that I've noticed.

Expected behavior

I'd expect the X-home operation to find home again by moving all the way to the left and use TMC2209 sensor-less homing feature.

Actual behavior

After first homing operation, it appears to take the centre of the bed as 0 in the X coordinate and then move from there in the next homing operation. NOTE: when one prints after only one home operation on boot, the coordinate system appears to be correct in that prints form in middle of bed as expected.

Steps to Reproduce

After boot 1) Select from menu Motion > Auto Home, then 2) Motion > Auto Z-Align. The head with crash in the far right. It looks like zero coordinate system is starting from head being in mid-point of bed rather than using TMC2209 sensor-less end-stop to fine home.

Version of Marlin Firmware

FIRMWARE_NAME:Marlin bugfix-2.0.x (Mar 31 2021 00:07:27) SOURCE_CODE_URL:github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Itopie 400+ EXTRUDER_COUNT:1 UUID:41B1EDA1-B268-466E-8B01-C6458C23FFF2

Printer model

iTopie400+

Electronics

SMART RAMPS with MEGA2560 and TMC2209 drivers

Add-ons

Fixed Induction probe

Your Slicer

Cura

Host Software

SD Card (headless)

Archive.zip

Source is in GIT under iTopie400+ branch : github

Youtube-recreate-problem

M115 Output
FIRMWARE_NAME:Marlin bugfix-2.0.x (Mar 31 2021 00:07:27) SOURCE_CODE_URL:github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Itopie 400+ EXTRUDER_COUNT:1 UUID:41B1EDA1-B268-466E-8B01-C6458C23FFF2
Cap:SERIAL_XON_XOFF:0
Cap:BINARY_FILE_TRANSFER:0
Cap:EEPROM:1
Cap:VOLUMETRIC:1
Cap:AUTOREPORT_TEMP:1
Cap:PROGRESS:0
Cap:PRINT_JOB:1
Cap:AUTOLEVEL:1
Cap:RUNOUT:0
Cap:Z_PROBE:1
Cap:LEVELING_DATA:1
Cap:BUILD_PERCENT:0
Cap:SOFTWARE_POWER:0
Cap:TOGGLE_LIGHTS:0
Cap:CASE_LIGHT_BRIGHTNESS:0
Cap:EMERGENCY_PARSER:1
Cap:PROMPT_SUPPORT:0
Cap:SDCARD:1
Cap:REPEAT:0
Cap:SD_WRITE:1
Cap:AUTOREPORT_SD_STATUS:0
Cap:LONG_FILENAME:0
Cap:THERMAL_PROTECTION:1
Cap:MOTION_MODES:0
Cap:ARCS:1
Cap:BABYSTEPPING:1
Cap:CHAMBER_TEMPERATURE:0
Cap:COOLER_TEMPERATURE:0
Cap:MEATPACK:0
@kpishere
Copy link
Contributor Author

kpishere commented Apr 6, 2021

`M111 S32` output from first `G28`
>>> G28  X0.00 Y0.00 Z0.25
Machine Type: Cartesian
Probe: FIX_MOUNTED_PROBE
Probe Offset X-44.00 Y2.00 Z-0.60 (Left-Back & Below Nozzle)
Auto Bed Leveling: LINEAR (disabled)
Raise Z (before homing) by 5.00
>>> do_blocking_move_to  X0.00 Y0.00 Z0.25
>  X0.00 Y0.00 Z5.00
<<< do_blocking_move_to  X0.00 Y0.00 Z5.00
>>> homeaxis(88)
Home Fast: -348.00mm
>>> do_homing_move  X0.00 Y0.00 Z5.00
...(X, -348.00, [50.00])
echo:busy: processing
echo:busy: processing
<<< do_homing_move  X0.00 Y0.00 Z5.00
Endstop 88 hit at Phase:88 Delta:216 Distance:0.16
>>> do_homing_move  X0.00 Y0.00 Z5.00
...(X, 0.16, 25.00)
<<< do_homing_move  X0.00 Y0.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 Y0.00 Z5.00 : 
<<< set_axis_is_at_home(88)
  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(88)
>>> homeaxis(89)
Home Fast: -348.00mm
>>> do_homing_move  X0.00 Y0.00 Z5.00
...(Y, -348.00, [50.00])
echo:busy: processing
<<< do_homing_move  X0.00 Y0.00 Z5.00
Endstop 89 hit at Phase:664 Delta:232 Distance:0.17
>>> do_homing_move  X0.00 Y0.00 Z5.00
...(Y, 0.17, 25.00)
echo:busy: processing
<<< do_homing_move  X0.00 Y0.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= X160.00 Y114.00 Z5.00 : home_z_safely
>>> do_blocking_move_to  X0.00 Y0.00 Z5.00
>  X160.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X160.00 Y114.00 Z5.00
>>> homeaxis(90)
  current_position= X160.00 Y114.00 Z5.00 : Probe::set_deployed
deploy: 1
Probe::do_z_raise(10.00)
>>> do_blocking_move_to  X160.00 Y114.00 Z5.00
>  X160.00 Y114.00 Z10.60
<<< do_blocking_move_to  X160.00 Y114.00 Z10.60
>>> do_blocking_move_to  X160.00 Y114.00 Z10.60
>  X160.00 Y114.00 Z10.60
<<< do_blocking_move_to  X160.00 Y114.00 Z10.60
Home Fast: -384.00mm
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, -384.00, [4.00])
echo:busy: processing
echo:busy: processing
<<< do_homing_move  X160.00 Y114.00 Z10.60
Move Away: 5.00mm
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, 5.00, 4.00)
echo:busy: processing
<<< do_homing_move  X160.00 Y114.00 Z10.60
Re-bump: -10.00mm
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, -10.00, 2.00)
echo:busy: processing
<<< do_homing_move  X160.00 Y114.00 Z10.60
Endstop 90 hit at Phase:248 Delta:376 Distance:0.06
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, 0.06, 2.00)
<<< do_homing_move  X160.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.25 position_shift = 0.00
> home_offset[Z] = 0.25
  current_position= X160.00 Y114.00 Z0.60 : 
<<< set_axis_is_at_home(90)
  current_position= X160.00 Y114.00 Z0.60 : sync_plan_position
  current_position= X160.00 Y114.00 Z0.60 : > AFTER set_axis_is_at_home
  current_position= X160.00 Y114.00 Z0.60 : Probe::set_deployed
deploy: 0
>>> do_blocking_move_to  X160.00 Y114.00 Z0.60
>  X160.00 Y114.00 Z0.60
<<< do_blocking_move_to  X160.00 Y114.00 Z0.60
<<< homeaxis(90)
<<< home_z_safely  X160.00 Y114.00 Z0.60
>>> do_blocking_move_to  X160.00 Y114.00 Z0.60
>  X160.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X160.00 Y114.00 Z5.00
  current_position= X160.00 Y114.00 Z5.00 : sync_plan_position
X:160.00 Y:114.00 Z:5.25 E:0.00 Count X:12800 Y:9120 Z:2000
<<< G28  X160.00 Y114.00 Z5.00
ok
Output from second G28 (crashes)
>>> G28  X160.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: LINEAR (disabled)

Raise Z (before homing) by 5.00
>>> do_blocking_move_to  X160.00 Y114.00 Z5.00
>  X160.00 Y114.00 Z5.00
<<< do_blocking_move_to  X160.00 Y114.00 Z5.00
>>> homeaxis(88)
Home Fast: -348.00mm
>>> do_homing_move  X160.00 Y114.00 Z5.00
...(X, -348.00, [50.00])
<<< do_homing_move  X160.00 Y114.00 Z5.00
Endstop 88 hit at Phase:8 Delta:136 Distance:0.10
>>> do_homing_move  X160.00 Y114.00 Z5.00
...(X, 0.10, 25.00)
<<< do_homing_move  X160.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:680 Delta:216 Distance:0.16
>>> do_homing_move  X0.00 Y114.00 Z5.00
...(Y, 0.16, 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= X160.00 Y114.00 Z5.00 : home_z_safely
>>> do_blocking_move_to  X0.00 Y0.00 Z5.00
>  X160.00 Y114.00 Z5.00
echo:busy: processing
<<< do_blocking_move_to  X160.00 Y114.00 Z5.00
>>> homeaxis(90)
  current_position= X160.00 Y114.00 Z5.00 : Probe::set_deployed
deploy: 1
Probe::do_z_raise(10.00)
>>> do_blocking_move_to  X160.00 Y114.00 Z5.00
>  X160.00 Y114.00 Z10.60
echo:busy: processing
<<< do_blocking_move_to  X160.00 Y114.00 Z10.60
>>> do_blocking_move_to  X160.00 Y114.00 Z10.60
>  X160.00 Y114.00 Z10.60
<<< do_blocking_move_to  X160.00 Y114.00 Z10.60
Home Fast: -384.00mm
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, -384.00, [4.00])
echo:busy: processing
<<< do_homing_move  X160.00 Y114.00 Z10.60
Move Away: 5.00mm
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, 5.00, 4.00)
echo:busy: processing
<<< do_homing_move  X160.00 Y114.00 Z10.60
Re-bump: -10.00mm
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, -10.00, 2.00)
echo:busy: processing
<<< do_homing_move  X160.00 Y114.00 Z10.60
Selected home phase 896 too close to endstop trigger phase 648. Pick a different phase for 90
Endstop 90 hit at Phase:648 Delta:776 Distance:0.12
>>> do_homing_move  X160.00 Y114.00 Z10.60
...(Z, 0.12, 2.00)
echo:busy: processing
<<< do_homing_move  X160.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.25 position_shift = 0.00
> home_offset[Z] = 0.25
  current_position= X160.00 Y114.00 Z0.60 : 
<<< set_axis_is_at_home(90)
  current_position= X160.00 Y114.00 Z0.60 : sync_plan_position
  current_position= X160.00 Y114.00 Z0.60 : > AFTER set_axis_is_at_home
  current_position= X160.00 Y114.00 Z0.60 : Probe::set_deployed
deploy: 0
>>> do_blocking_move_to  X160.00 Y114.00 Z0.60
>  X160.00 Y114.00 Z0.60
<<< do_blocking_move_to  X160.00 Y114.00 Z0.60
<<< homeaxis(90)
<<< home_z_safely  X160.00 Y114.00 Z0.60
>>> do_blocking_move_to  X160.00 Y114.00 Z0.60
>  X160.00 Y114.00 Z5.00
<<< do_blocking_move_to  X160.00 Y114.00 Z5.00
  current_position= X160.00 Y114.00 Z5.00 : sync_plan_position
X:160.00 Y:114.00 Z:5.25 E:0.00 Count X:12800 Y:9120 Z:2000
<<< G28  X160.00 Y114.00 Z5.00
ok

@thinkyhead
Copy link
Member

Once X and Y are homed they will retain their positions and won't get reset to their home positions unless homing moves are being attempted. It's possible that the X and Y sensorless states is getting triggered early when starting from certain positions, or the triggered state is somehow "stuck." See if it helps to lower your max acceleration for X and Y — starting with something very low like M201 X200 Y200 before attempting the second homing.

@kpishere
Copy link
Contributor Author

kpishere commented Apr 8, 2021

Have had issue of sensorless homing being too sensitive. I have reduced it a while ago. Also, I'd turned on monitoring of end stops to see if they were triggering -- they weren't. The associated PR (#21558) does fix the problem. earlier on in the execution of G28, there appears to be checks that will cause homing to be skipped -- something in that logic isn't right for this case? I think i did notice that Y axis hits twice now on first G28 call but I didn't notice that for X axis.

@thinkyhead
Copy link
Member

G28 will always re-home all the axes. There simply is no logic in Marlin that says "ignore G28" under any conditions.

@kpishere
Copy link
Contributor Author

kpishere commented Apr 13, 2021

Here is an image of the comparison, may be easier to spot.

home1 is output from first G28, home2 is output from second G28

Screen Shot 2021-04-13 at 12 30 59 PM

Note the issue is at difference 5. It thinks current home position X = 0 but it is not, it is more in the centre of the plate, like 160 (probe at centre here at 116).

Actually, up to the end if difference #4 from the image above, all looks good. It is after the call to set_axis_is_at_home() that things go wrong. The bug is likely in there. Looking at it but eesh, without in place debugger, takes effort to fix this.

kpishere added a commit to kpishere/Marlin that referenced this issue Apr 13, 2021
@thinkyhead
Copy link
Member

I see nothing unusual going on there. After a homing move where the endstop gets triggered, the axis is set to the home position. From the log it seems that Marlin tries to home X, immediately sees the endstop triggered, stops the homing move, and sets the position to 0. There is no reason why Marlin would skip trying to move X and Y towards their endstops, unless those endstops are already triggered, for some reason.

Please do a test where you turn off DISABLE_X, DISABLE_Y, and DISABLE_Z to see whether this has any effect. These flags will affect the behavior of homing. However, according to my reading they should not cause the problem you are seeing. Still, we need to eliminate the possibility of a logical error in some other region that we've not yet looked at.

@github-actions
Copy link

github-actions bot commented Aug 4, 2021

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 Aug 4, 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

3 participants