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

Printer fails to home after done printing #11676

Closed
maviles798 opened this issue Aug 30, 2018 · 129 comments
Closed

Printer fails to home after done printing #11676

maviles798 opened this issue Aug 30, 2018 · 129 comments
Labels
T: Question Questions, generally redirected to other groups.

Comments

@maviles798
Copy link

maviles798 commented Aug 30, 2018

Description

My printer homing fails after printing it is a delta printer (Anycubic Kossel linear plus) it was printing fine and out of nowhere it started with this problem.
The printer homes fine if i autohome it. but i cant do anything when its done printing and it autohomes.

In the video i have to push the endstop in order to stop it from crashing with the x pillar.

PLEASE HELP.

Steps to Reproduce

  1. I send something to print
  2. Prints the part fine and with no mistakes
  3. When it starts homing right after finishing the print the it starts going up for a small distance then the y and z motors stop and and only the x motor keeps going up until it crashes with the frame then the printer screen shows [homing failed printer halted] and i have to restart the printer.

Additional Information

@thinkyhead thinkyhead added the T: Question Questions, generally redirected to other groups. label Aug 30, 2018
@thinkyhead
Copy link
Member

  • Please ZIP the G-code you are using and attach it to your next reply.
  • Also ZIP and include your Configuration.h and Configuration_adv.h files.

@maviles798
Copy link
Author

here are the files that you need, thank you. its a strange error because some times works good and sometimes crashes even with the same gcode file.
config.h and adv.h + g code.zip

@thinkyhead
Copy link
Member

Marlin now checks to see that after a homing move an endstop is actually triggered. If it doesn't see a triggered endstop it assumes that homing failed, and locks up the machine.

Make sure your endstops are reliable by testing with M119 under various conditions. You might try turning on ENDSTOP_NOISE_FILTER to see if it helps.

@F0x06
Copy link
Contributor

F0x06 commented Sep 5, 2018

Marlin version: bugfix-1.1.x (2018-07-31), also tested with 1.1.9

Hi, i have the exact same problem with my Anycubic Kossel when my print finishes, in my case X Y towers are stuck and Z crashes and force until "homing failed printer halted" message appears. This happens not every times, seems a bit random can't figure out what is the problem. Tested all my endstops with M119, no problems detected. Attached my configs and my last gcode when the bug occured.

PS: Never seen this bug on older Marlin shipped with my printer.

Any solution except the ENDSTOP_NOISE_FILTER one ?

bugreport_files.zip

@maviles798
Copy link
Author

I manage to fix it in my printer one screw was loose and also the endstops were giving fake signals due to having them near power supply wires yo can fix that by adding a 100 nf capasitor connected parallel to the endstops
Or using the endstop_noise_ filter

@F0x06
Copy link
Contributor

F0x06 commented Sep 6, 2018

@maviles798 Thank you for the solution, i will try the capacitor one, because endstop_noise_ filter impact homing precision.

@bigbaldbob1
Copy link

I have also started having this problem since I switched to 1.1.9, and I am using an AnyCubic Kossel Linear Plus as well. Mine seems to crash into the X tower when returning home after a print on about 1 out of 4 prints. The gcode file in the attached zip file was for my last print when it did crash. I have tested my endstops using M119, and they appear to be working correctly. The attached zip file also includes my config files in case they are useful.
tower_crash_files.zip

@bigbaldbob1
Copy link

bigbaldbob1 commented Sep 9, 2018

I wanted to add a little more information after I closely watched the end of a print as the home command failed. When the print was finished, it executed a 5mm upward movement that I have in my "end of print" code. Then it looked like the printer was going to home, but instead of all 3 steppers driving toward the endstops, only the X stepper was driving. This caused the head to move quickly toward the X tower. I manually tripped the X endstop limit switch, and the Y stepper started driving. I tried to trip the Y endstop limit switch, but was too slow; and the head crashed into the Y tower. This doesn't look like an endstop problem to me. It looks like the Auto Home 'G28' command is having a problem and not driving all steppers, very important for a delta printer. Here is the very end of the print commands copied from Octoprint terminal:

Send: N162374 G0 X101.86 Y18.785*16
Recv: ok
Send: N162375 G0 X101.5 Y18.425*35
Recv: ok
Send: N162376 G1 F1500 E4195.90047*5
Recv: ok
Send: N162377 M107*19
Recv: ok
Send: N162378 M104 S0*92
Recv: ok
Send: N162379 M140 S0*93
Recv: ok
Send: N162380 G91*47
Recv: ok
Send: N162381 G1 E-1 F300*59
Recv: ok
Send: N162382 G1 Z+5.0 E-5 F3000*118
Recv: ok
Send: N162383 G90*45
Recv: ok
Send: N162384 G28*41
[...]
Recv: Error:Printer halted. kill() called!
Changing monitoring state from "Printing" to "Cancelling"

@thinkyhead
Copy link
Member

thinkyhead commented Sep 9, 2018

It sounds like old endstop states are hanging around, so when the machine starts to home it thinks one or more of the endstops has already been triggered, so it's going straight to the "homing re-bump" moves. There were changes to the endstops code by @ejtagle and myself, and perhaps we broke something in the process.

If enabling ENDSTOP_NOISE_FILTER doesn't help, then we need to gather more information:

Try a very small G-code that does a few moves and then has a G28 at the end to see if it has the same issue. Also enable DEBUG_LEVELING_FEATURE and re-flash. Then put M111 S248 in front of that G28 command. You'll get extra log output indicating what happens during the G28 to confuse the firmware.

@maviles798
Copy link
Author

maviles798 commented Sep 9, 2018

Enabling endstop_noise_filter fixed the problem in my case. I bought the capacitor but I haven't tried them to see if that fixes the problem.

Today I will make some test to see if with the capacitors my printer works fine. If it does I will let you know.

@maviles798
Copy link
Author

maviles798 commented Sep 10, 2018

I install the capacitors and the printer keeps going to the x tower when its done printing some times.
this is the code of a normal g28 comand.

Log Output
>>> G28
Machine Type: Delta
Probe: FIX_MOUNTED_PROBE
Probe Offset X:0 Y:0 Z:-9.15 (Aligned With & Below Nozzle)
Auto Bed Leveling: BILINEAR (disabled)
  current_position=(0.00, 0.00, 0.28) : setup_for_endstop_or_probe_move
> endstops.enable(true)
  current_position=(0.00, 0.00, 0.28) : >>> home_delta
  current_position=(0.00, 0.00, 0.00) : sync_plan_position
>>> homeaxis(X)
Home 1 Fast:
>>> do_homing_move(X, 330.00, [60.00])
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
Move Away:
>>> do_homing_move(X, -5.00, [60.00])
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
Home 2 Slow:
>>> do_homing_move(X, 10.00, 30.00)
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
delta_endstop_adj:
>>> do_homing_move(X, -0.30, [60.00])
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
<<< homeaxis(X)
>>> homeaxis(Y)
Home 1 Fast:
>>> do_homing_move(Y, 330.00, [60.00])
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
Move Away:
>>> do_homing_move(Y, -5.00, [60.00])
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
Home 2 Slow:
>>> do_homing_move(Y, 10.00, 30.00)
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
delta_endstop_adj:
>>> do_homing_move(Y, -0.09, [60.00])
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
<<< homeaxis(Y)
>>> homeaxis(Z)
Home 1 Fast:
>>> do_homing_move(Z, 454.72, [60.00])
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
Move Away:
>>> do_homing_move(Z, -5.00, [60.00])
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
Home 2 Slow:
>>> do_homing_move(Z, 10.00, 15.00)
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
delta_endstop_adj:
>>> do_homing_move(Z, -1.45, [60.00])
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
<<< homeaxis(Z)
>>> set_axis_is_at_home(X)
For X
 position_shift = 0.00
 soft_endstop_min = -110.00
 soft_endstop_max = 110.00
  current_position=(0.00, -0.09, -1.45) :
<<< set_axis_is_at_home(X)
>>> set_axis_is_at_home(Y)
For Y
 position_shift = 0.00
 soft_endstop_min = -110.00
 soft_endstop_max = 110.00
  current_position=(0.00, 0.00, -1.45) :
<<< set_axis_is_at_home(Y)
>>> set_axis_is_at_home(Z)
For Z
 position_shift = 0.00
 soft_endstop_min = 0.00
 soft_endstop_max = 302.55
  current_position=(0.00, 0.00, 302.55) :
<<< set_axis_is_at_home(Z)
  current_position=(0.00, 0.00, 302.55) : sync_plan_position_kinematic
  current_position=(0.00, 0.00, 302.55) : <<< home_delta
>>> do_blocking_move_to(0.00, 0.00, 237.28)
  destination=(0.00, 0.00, 302.55) : set_destination_from_current
  destination=(0.00, 0.00, 237.28) : prepare_uninterpolated_move_to_destination
  current_position=(0.00, 0.00, 237.28) : zone border move
  current_position=(0.00, 0.00, 237.28) : xy move
<<< do_blocking_move_to
  current_position=(0.00, 0.00, 237.28) : clean_up_after_endstop_or_probe_move
<<< G28
>>> g28
SENDING:G28
>>> G28
Machine Type: Delta
Probe: FIX_MOUNTED_PROBE
Probe Offset X:0 Y:0 Z:-9.15 (Aligned With & Below Nozzle)
Auto Bed Leveling: BILINEAR (disabled)
  current_position=(0.00, 0.00, 237.28) : setup_for_endstop_or_probe_move
> endstops.enable(true)
  current_position=(0.00, 0.00, 237.28) : >>> home_delta
  current_position=(0.00, 0.00, 0.00) : sync_plan_position
>>> homeaxis(X)
Home 1 Fast:
>>> do_homing_move(X, 330.00, [60.00])
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
Move Away:
>>> do_homing_move(X, -5.00, [60.00])
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
Home 2 Slow:
>>> do_homing_move(X, 10.00, 30.00)
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
delta_endstop_adj:
>>> do_homing_move(X, -0.30, [60.00])
  current_position=(0.00, 312.55, 312.55) : sync_plan_position
<<< do_homing_move(X)
<<< homeaxis(X)
>>> homeaxis(Y)
Home 1 Fast:
>>> do_homing_move(Y, 330.00, [60.00])
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
Move Away:
>>> do_homing_move(Y, -5.00, [60.00])
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
Home 2 Slow:
>>> do_homing_move(Y, 10.00, 30.00)
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
delta_endstop_adj:
>>> do_homing_move(Y, -0.09, [60.00])
  current_position=(-0.30, 0.00, 312.55) : sync_plan_position
<<< do_homing_move(Y)
<<< homeaxis(Y)
>>> homeaxis(Z)
Home 1 Fast:
>>> do_homing_move(Z, 454.72, [60.00])
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
Move Away:
>>> do_homing_move(Z, -5.00, [60.00])
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
Home 2 Slow:
>>> do_homing_move(Z, 10.00, 15.00)
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
delta_endstop_adj:
>>> do_homing_move(Z, -1.45, [60.00])
  current_position=(-0.30, -0.09, 0.00) : sync_plan_position
<<< do_homing_move(Z)
<<< homeaxis(Z)
>>> set_axis_is_at_home(X)
For X
 position_shift = 0.00
 soft_endstop_min = -110.00
 soft_endstop_max = 110.00
  current_position=(0.00, -0.09, -1.45) :
<<< set_axis_is_at_home(X)
>>> set_axis_is_at_home(Y)
For Y
 position_shift = 0.00
 soft_endstop_min = -110.00
 soft_endstop_max = 110.00
  current_position=(0.00, 0.00, -1.45) :
<<< set_axis_is_at_home(Y)
>>> set_axis_is_at_home(Z)
For Z
 position_shift = 0.00
 soft_endstop_min = 0.00
 soft_endstop_max = 302.55
  current_position=(0.00, 0.00, 302.55) :
<<< set_axis_is_at_home(Z)
  current_position=(0.00, 0.00, 302.55) : sync_plan_position_kinematic
  current_position=(0.00, 0.00, 302.55) : <<< home_delta
>>> do_blocking_move_to(0.00, 0.00, 237.28)
  destination=(0.00, 0.00, 302.55) : set_destination_from_current
  destination=(0.00, 0.00, 237.28) : prepare_uninterpolated_move_to_destination
  current_position=(0.00, 0.00, 237.28) : zone border move
  current_position=(0.00, 0.00, 237.28) : xy move
<<< do_blocking_move_to
  current_position=(0.00, 0.00, 237.28) : clean_up_after_endstop_or_probe_move
<<< G28

i will try to get one when it fails.

@maviles798
Copy link
Author

this is the code that gives me after a fail homing
Print started at: 14:55:08
echo:Unknown command: "G21"
Error:Printer halted. kill() called!
[ERROR] Error:Printer halted. kill() called!

@F0x06
Copy link
Contributor

F0x06 commented Sep 11, 2018

@maviles798
Already seen the Unknown G21 command message, I will try to enable debug and also give more informations, I can confirm that on older versions of Marlin I never had this issue.

@ejtagle
Copy link
Contributor

ejtagle commented Sep 11, 2018

G21: Enable inch support and you will get rid of it (even if you are not using inches in your gcode)

@F0x06
Copy link
Contributor

F0x06 commented Sep 11, 2018

Thanks for the tip @ejtagle in Configuration.h this can be enabled with #define INCH_MODE_SUPPORT
I finished the capacitors installation, I will come back for the results.

@cheerynik
Copy link

Опис

Мій принтер не налаштовується після друку, це дельта-принтер (лінійний плюс Anycubic Kossel), він добре друкувався, і з нізвідки він почав цю проблему.
Принтер відмінно працює, якщо я його автономно. але я не можу робити що-небудь, коли його зроблено друк, і він autohomes.

У відео я повинен натиснути endstop, щоб зупинити його з краху зі стовпом x.

БУДЬ ЛАСКА, ДОПОМОЖІТЬ.

Кроки до відтворення

  1. Я щось надсилаю для друку
  2. Друкує частину добре, без помилок
  3. Коли він починає самонаведення після закінчення друку, він починає підніматися на невелику відстань, після чого двигуни y та z зупиняються і тільки двигун х продовжує зростати до тих пір, поки не зникне кадр, тоді на екрані принтера з'явиться ], і мені доведеться перезапустити принтер.

Додаткова інформація

I have a similar problem anycubic kossel pulley. marlin 1.1.9
This is not the case in the previous version.

@cheerynik
Copy link

cheerynik commented Sep 19, 2018


I solved this problem in the following way:
commented at the end of the team: program Cura-15.04 > end.gcode > G28 X0 Y0
my version of this team: > end.gcode > G28
and no more error, everything works fine.
screenshot > https://drive.google.com/file/d/19aQ8OVihISKA1N04M9E9zveIABI-vbvU/view?usp=sharing

;X0 Y0не має сенсу, якщо ";" інтерпретується як початок коментаря або нічого не робить в Марліні,

yes, everything was right to delete those values. I wanted to see what caused this error.

@AnHardt
Copy link
Contributor

AnHardt commented Sep 19, 2018

And why G28 at all?
If you want to go to [0,0,] use G1 X0 Y0. The numbers behind the axis qualifiers are NOT evaluated in Marlin at all. G28 is not a go to. It only determines where the print head is. It does it's job and leaves the printhead (more or less) where it is. The end position is not fixed. If you switch from min- to max- homing switches, the printhead will end up at the other end.
I'm not familiar with Curas end-code syntax or your notation, But homing in 3 axis instead of 2 befor is asking for trouble with a nozzle deep in your new printed part - if you home to z-min. ;X0 Y0 is either meaningless if the ';' is interpreted as begin of a comment, or does nothing in Marlin because our G0, G1 is not modal. You can't send an endless sequence of lines with coordinates. In Marlin (unlike a normal CNC machine) you have to repeat the command (G0, G1) in every line.

Ah. The screenshot clearifies. ; starts acomment. You could have just deleted that.

@thinkyhead
Copy link
Member

thinkyhead commented Sep 19, 2018

In Marlin (unlike a normal CNC machine) you have to repeat the command (G0, G1) in every line.

Interesting point. Perhaps we should treat command lines that start with X, Y, Z, or F as a G0, G1, G2, G3, or G5 depending on the last one used…. as an option.

@AnHardt
Copy link
Contributor

AnHardt commented Sep 19, 2018

@thinkyhead
Have a look into the grbl parser or the NIST documents.
But it looks as if our interpretation is not a problem. At least the 3D-printer slicers and hosts do know about our interpretation.

On a DELTA everyting behind the G28 is meaningless anyway.

@cheerynik
Copy link

І чому G28 взагалі?

I'm an inexperienced user. my suggestion concerns only the error that occurs when finished printing in version 1.1.9. this error is on the video. At the end of the game, the G28 team solved this problem. it may be necessary to make corrections to the firmware, but I do not know where it can be changed in the firmware.
"end.gcode" there is a default snooze in the cura slicer program, I changed the command and there are no more errors. Here is a video of successful print ending after changing the command.
[] (https://drive.google.com/file/d/1y7LkegDCL7MQ6iTP5wf3wfTSGPazA90k/view?usp=sharing)

@pablopeu
Copy link

pablopeu commented Sep 23, 2018

Just came here to comment that I also have this crashing on an anycubic delta plus, perfect print and then crash into the X column, will try to replace the endcode G28 by G0 X0 Y0 Z300 in CURA (3.41) and post results after some more prints.

@AnHardt
Copy link
Contributor

AnHardt commented Sep 23, 2018

Z0 is not a good choice! How about near Zmax?

@pablopeu
Copy link

I think you are commenting on my erroneous post, after posting it I noticed my error and changed it to z300, otherwise it would crash into the just finished print 😳

@AnHardt
Copy link
Contributor

AnHardt commented Sep 23, 2018

Emm - yes. Usually i scan the messages in my Thunderbird. I don't see any other way to handle more than 2500 messages a month alone for Marlin. Thunderbirds filters do help me a lot. But i don't get messages about edits.

@cheerynik
Copy link

you need to pay attention to when this error occurs. It seems to me that this happens after the printing is canceled. when the print is canceled and then we are passing a new task. After you cancel the print, you must restart the printer and re-connect with the print program. This option also helps to avoid printing errors. please try this option to solve this error. I will be grateful for the test.

@pablopeu
Copy link

pablopeu commented Sep 23, 2018

I was next to the machine, I received it yesterday and it was build time 😀 I'm paying more attention to it than the sunday football,..
I was next to it when it finished the piece with surface ironing, saw after the print incremental moves and then to my horror go straight to the column and crashing into it (Im used to have a big red button on my CNC machine)
The print finished as it should, its the homing that failed.

What I can tell you is that I properly cancelled a previous job via the front panel (stop job) and after small correction in cura and without restarting the machine I proceeded to print as I described above.

@pablopeu
Copy link

Got it on video: https://www.youtube.com/watch?v=bwFKKYPyYho
Here is the STL and gcode: https://www.dropbox.com/s/442x65exgd6z5xf/20mm_stl%26gcode.rar?dl=0

Not sure what would be my action after the crash I turned off the machine in panic...

@AnHardt
Copy link
Contributor

AnHardt commented Sep 24, 2018

Where is your [0,0,0] located? For a DELTA BED_CENTER_AT_0_0 is absolutely required.
Is DELTA_PRINTABLE_RADIUS < DELTA_RADIUS * 2 ?
Are the ???_SOFTWARE_ENDSTOPS_? all on?

Diagonal rods can't be more than vertical or horizontal - else sign gets lost in sqrt(), other values go to infinity.

Do your slicer and your host both produce end-g-code? (protocol instead of source g-code)
Did you already post your configs?

@engelbja
Copy link

Sorry edited my last comment, there are only a m84 before and after the G28

@AnHardt
Copy link
Contributor

AnHardt commented Feb 22, 2019

@engelbja
If M84 helps with homing your DELTA, then its likely your extruder stepper causing the noise on the endstop lined causing your trouble. Shielding the extruder stepper cable, separating extruder and endstop cables, denoise capacitors at the endstop connectors, software denoising will probably also have the same effect.

@engelbja
Copy link

I must also mention that I replaced the a4988 xyz with tmc2208. But had the same problem until I use the m84 before homing. But Yes I think you are correct. M84 was luckily just a easier fix in my case.

@hellochenwang
Copy link

For those who would like to know more about why adding the 100nF capacitor:

There are two sorts of crosstalk you can get between electrical wires:

  1. Magnetic induction. A cable carrying a current that varies rapidly (even if only occasionally) generates a magnetic field, which can be coupled to another cable. For example, a stepper motor or bed heater cable could induce a voltage in an endstop switch cable. Minimise this be making sure that the outgoing and return conductors carrying the current are as close together as possible (i.e. in the same multicore cable), and preferably twisting them together. Similarly for the signal and ground connections of the endstop switch circuit.
  2. Capacitive coupling. A cable carrying a varying voltage runs close to a signal cable with a high impedance input, and the capacitance between the cables gives rise to a voltage on the signal cable. Minimise this by shielding one or both cables (independently), or keeping them away from each other, or avoiding high impedance signal inputs.

source: https://reprap.org/forum/read.php?1,584390

@hapklaar
Copy link

I have this issue in latest Marlin 2 bugfix release on my AnyCubic Delta. Is the 100nF capacitor on endstops near mainboard still the best fix for this?

Can someone explain why this only happens on the X axis for everyone?

@TeodikD
Copy link

TeodikD commented Aug 9, 2019

I have this issue in latest Marlin 2 bugfix release on my AnyCubic Delta. Is the 100nF capacitor on endstops near mainboard still the best fix for this?

Can someone explain why this only happens on the X axis for everyone?

No man don`t do that , you can easily fix it in your gcode building software

@TeodikD
Copy link

TeodikD commented Aug 9, 2019


i really dont know what are you guyz talking abut.
are you crazy or something.
dont do that capacitor bull@#$% , maybe that works for some of you some times but it brings new problem with it and will damage your printer.
kossel after print homing fail is a simple bug by G.code building software`s like CURA.
all you have to do is change your homing style in your G.Code building software from "Cartesian" to "Delta".
Maybe in new Marlin update we get little fix that transform Cartesian_Homing_Code to Delta_Homing_Code by it self but until that Marlin Fix you can Fix it very easily.


  1. open your Cura.
  2. go to "Preferences" in top then "Configure Cura..."
  3. go to "Printers" Tab // select your printer // click "Machine Settings"

((( now you can see "Start G-code" and "End G-code" )))

  1. in End G-code side delete line "G28 X0 Y0"
  2. under "M84" add "G28 ;Home"
  3. Save and Done

your code will be like this in End G-code side.


M104 S0
M140 S0
;Retract the filament
G92 E1
G1 E-1 F300
M84
G28 ;Home


from now all G.codes that be made by your cura will be home 100% perfectly.

@ushering-it
Copy link

i really dont know what are you guyz talking abut.
are you crazy or something.
dont do that capacitor bull@#$% , maybe that works for some of you some times but it brings new problem with it and will damage your printer.
kossel after print homing fail is a simple bug by G.code building software`s like CURA.
all you have to do is change your homing style in your G.Code building software from "Cartesian" to "Delta".
Maybe in new Marlin update we get little fix that transform Cartesian_Homing_Code to Delta_Homing_Code by it self but until that Marlin Fix you can Fix it very easily.

  1. open your Cura.
  2. go to "Preferences" in top then "Configure Cura..."
  3. go to "Printers" Tab // select your printer // click "Machine Settings"

((( now you can see "Start G-code" and "End G-code" )))

  1. in End G-code side delete line "G28 X0 Y0"
  2. under "M84" add "G28 ;Home"
  3. Save and Done

your code will be like this in End G-code side.

M104 S0
M140 S0
;Retract the filament
G92 E1
G1 E-1 F300
M84
G28 ;Home

from now all G.codes that be made by your cura will be home 100% perfectly.

Nice try, yet not works for me :(

It looks like only X-axis motor works on G28 command. So, if the model is not high, then X-endstop will not be reached and head will bump the X-axis stand.

Could someone help me to locate the code that is responsible for such behaviour?

@wyattearp
Copy link

FYI - with a 2.0.5.3 build of Marlin - this still sporadically happens with my AnyCubic. I assume no one here found a solution?

@henridbr
Copy link

henridbr commented Apr 7, 2020

I get the same trouble with my AnyCubic Kossel Linear +.
I change from Anycubic firmware to Marlin 2.0 which works fine except this one.
It occurs sporadically.
I'll check the M84 before G28 trick.
I am using Simplify3D : FFF settings -> Scripts -> Ending Scripts -> add M84 before G28.
One can also modify directly the Gcode file using Notepad.
Seems to work fine.

@wyattearp
Copy link

@henridbr it's probably pretty common - but this was the code that seemed to cause the issue, maybe one in 10 times:

M140 S0
M107
M104 S0
M140 S0
;Retract the filament
G92 E1
G1 E-1 F300
G28 X0 Y0
M84
M82 ;absolute extrusion mode
M104 S0
;End of Gcode

I read through the G28 code and didn't see an obvious flaw, but I'm wondering if I need to look through the M84 to see if it would have set something else (also - i think it's odd that my Delta printer came with instructions to give G28 X0 Y0 when it should just be G28 I think).

@wyattearp
Copy link

Actually, I think this is an error in G28.cpp:234 - planner.sychronize(); isn't called before the checking of homing_needed() and this function depends on externs in motion.cpp which could possibly be modified by one of the other G# up there - still reading though but it seems odd to me to not wait for the planner to finish before checking to see if you should do something.

@henridbr
Copy link

henridbr commented Apr 8, 2020

You are probably right.
It seems also correct to stop all items at the job's end and then park.
Perhaps looking at M84 to see how it works.

@thinkyhead
Copy link
Member

Put M400 before M84 to add extra insurance that the planner will be empty before the steppers are disabled. Note that M84 by itself calls planner.finish_and_disable while M84 with one or more axes will call planner.synchronize before disabling any steppers.

Be cautious in using M84 in G-code because some pre-configured machines or hosts may want to do something "when the print completes" that expects the motors to be enabled.

It may be cleaner for some to set a motor inactivity timeout that always applies, such as 5 minutes, and then let the machine time out the steppers after they've stopped moving instead of putting M84 into the ending G-code in the slicer.

@wyattearp
Copy link

wyattearp commented Apr 11, 2020

It still feels like the issue is either with G28 or the command before it based on the logs:

end: N2078 G92 E1*123
Recv: X:3.53 Y:-2.83 Z:9.90 E:1.00 Count A:19248 B:19470 C:19160
Recv: ok
Send: N2079 G1 E-1 F300*56
Recv: ok
Send: N2080 G28 X0 Y0*40
Recv:  T:199.44 /0.00 B:44.95 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:199.67 /0.00 B:44.92 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:200.31 /0.00 B:44.81 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:200.49 /0.00 B:44.75 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:199.93 /0.00 B:44.75 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:199.14 /0.00 B:44.66 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:197.80 /0.00 B:44.61 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:195.92 /0.00 B:44.50 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:194.08 /0.00 B:44.45 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv:  T:192.01 /0.00 B:44.31 /0.00 @:0 B@:0
Recv: echo:busy: processing
Recv: Error:Printer halted. kill() called!

Looking through the G1_G0.cpp now to see if I can understand why it might cause the next G28 to suck at life since there isn't a technically a real error in G28.cpp as best as I can tell (unless somehow bedlevel.cpp::set_bed_leveling_enabled() skips doing any of its planner actions.

@wyattearp
Copy link

FYI I have recreated this issue successful on the 2.0.5.3 release at least 5 times. Every time it is the same tower, tower A that the print head crashes into. I believe this is because of the delta.cpp:home_delta() function cleaning out the current position when it doesn't need to but I've not been able to snag the debug logs during a crash to prove it. If someone can explain to me why you would want to throw away the current position when you know it (as opposed to only setting it all to 0,0,0 when you don't know it), that would be extremely helpful for me to be able to commit a fix.

@cheerynik
Copy link

I read through the G28 code and didn't see an obvious flaw, but I'm wondering if I need to look through the M84 to see if it would have set something else (also - i think it's odd that my Delta printer came with instructions to give G28 X0 Y0 when it should just be G28 I think).

in my case it solved the problem of returning the extruder to its home position.

@wyattearp
Copy link

@cheerynik do you have a test gcode that causes the issue? I just generated one and will be testing again tonight and should hopefully have a patch tomorrow if it's fails the way I think it should with debug flags on

@cheerynik
Copy link

slice cura fix startup gcod remove x0 y0 leave g28. after that, there are no more errors in returning home.

@mberntsen
Copy link

mberntsen commented Apr 30, 2020

I've been having the same problem, and I narrowed it down a bit with some additional logging and found the following:
homing a delta is composed of moving up to at least 1 stop, then move the X, Y and Z axis, because of this sequence, it always crashes into axis X.
I've made a program to repeatedly do G28 and G0 Z10, that's how I caught it
In my case an endstop is triggered (different ones each time), based on the interrupt data, which I find odd, but that's what it sais, so I'll be debugging my electronics a bit more.
I had a theory at one point that the probe (being connected to the Y_MIN pin) was triggered and that that made the vertical movement stop (it checks for 'an' andstop, not a specific one, but this does not seem to be the case with me.

@wyattearp
Copy link

@mberntsen yep - same thing. The endstop gets a false trigger. When it does, it believes that it's already at the top and thus crashes the into the X tower because the lines in the code individually home in the order of X, Y, Z.

@mberntsen
Copy link

mberntsen commented Apr 30, 2020

I found out that my heavy powersupply (standard in my Anycubic predator) introduces so much noise, that it creates false triggers, must admit, my experimental electronics (esp32 on breadboard with i2c display and U8g2 lib) isn't the most emc compatible design :)

@thinkyhead
Copy link
Member

We can't work around bad endstop signals, but smarter Delta homing might do this:

  • Move all carriages up until some tower endstop is hit.
  • Move all down a little and re-bump until the same stop is hit again.
    • If the endstop is not near where expected then throw an error
  • Hold the tower carriage that hit the first endstop in place and...
  • Move the other two up until some tower endstop is hit.
  • Move both down a little and re-bump until the same stop is hit again.
    • If the endstop is not near where expected then throw an error
  • Hold the tower carriage that hit the first endstop in place and...
  • Move the remaining carriage up until its endstop is hit.
  • Move it down a little and re-bump until the same stop is hit again.
    • If the endstop is not near where expected then throw an error

@jshutrump
Copy link

FYI - with a 2.0.5.3 build of Marlin - this still sporadically happens with my AnyCubic. I assume no one here found a solution?

Having same problem after I updated my board to a 32bit and new marlin. Any fix?

@wyattearp
Copy link

@jshutrump the current "fix" is to add caps to your end stop sensors, implementation of a software fix like @thinkyhead has discussed will require someone to write that type of routine in the delta.cpp:home_delta() code. The specific issue that around this chunk of code:

  //.....
  line_to_current_position(homing_feedrate(Z_AXIS));
  planner.synchronize();

  // Re-enable stealthChop if used. Disable diag1 pin on driver.
  #if ENABLED(SENSORLESS_HOMING)
    tmc_disable_stallguard(stepperX, stealth_states.x);
    tmc_disable_stallguard(stepperY, stealth_states.y);
    tmc_disable_stallguard(stepperZ, stealth_states.z);
  #endif

  endstops.validate_homing_move(); // <--- life goes bad here for false triggering

  // At least one carriage has reached the top.
  // Now re-home each carriage separately.
  homeaxis(A_AXIS);  // <---  A/X is the first one hit because going up slowly should trigger it, but it's too low and thus keeps going until it crashes the head into the tower.
  homeaxis(B_AXIS);
  homeaxis(C_AXIS);

  // Set all carriages to their home positions
  // Do this here all at once for Delta, because
  // XYZ isn't ABC. Applying this per-tower would
  // give the impression that they are the same.
  LOOP_XYZ(i) set_axis_is_at_home((AxisEnum)i);

As discussed above, if you want to fix this in software, the homeaxis() shouldn't be immediately called but should instead be re-validated by moving down a small percentage of the original distance traveled and then moving back up the same distance to verify that all endstops were hit, otherwise, declare a false, clear the endstops, ... etc.

@wyattearp
Copy link

Additionally if you're looking for a "quicker fix" you can try adjusting this in Configuration.h - but it didn't seem to help me:

/**
 * Endstop Noise Threshold
 *
 * Enable if your probe or endstops falsely trigger due to noise.
 *
 * - Higher values may affect repeatability or accuracy of some bed probes.
 * - To fix noise install a 100nF ceramic capacitor inline with the switch.
 * - This feature is not required for common micro-switches mounted on PCBs
 *   based on the Makerbot design, which already have the 100nF capacitor.
 *
 * :[2,3,4,5,6,7]
 */
#define ENDSTOP_NOISE_THRESHOLD 2

wyattearp added a commit to wyattearp/Marlin that referenced this issue May 12, 2020
* merged in changes in bug fixes since they all make sense
* merged in head since fixing types makes sense as well
* still looking into how to address MarlinFirmware#11676 -
confirmed code location of errors with homing
@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 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Question Questions, generally redirected to other groups.
Projects
None yet
Development

No branches or pull requests