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
UBL in combination with fwretract zhop loses Z position #10200
Comments
Sorry about that! We've had some questionable patches to |
Can I assume you're using genuine |
I see there's already some debugging code in the // debugging
SERIAL_ECHOLNPAIR("retracting ", retracting);
SERIAL_ECHOLNPAIR("swapping ", swapping);
SERIAL_ECHOLNPAIR("active extruder ", active_extruder);
for (uint8_t i = 0; i < EXTRUDERS; ++i) {
SERIAL_ECHOPAIR("retracted[", i);
SERIAL_ECHOLNPAIR("] ", retracted[i]);
SERIAL_ECHOPAIR("retracted_swap[", i);
SERIAL_ECHOLNPAIR("] ", retracted_swap[i]);
}
SERIAL_ECHOLNPAIR("current_position[z] ", current_position[Z_AXIS]);
SERIAL_ECHOLNPAIR("hop_amount ", hop_amount);
//*/ |
Due to the way that Z hop is implemented, it might simply be incompatible with bed leveling. (Because it "spoofs" the current Z position.) Hopefully there's some way to guarantee that it doesn't screw up the planner, but for the moment it may just have to be avoided. |
@thinkyhead Yes, using I commented out Here is the log: serial.log |
The log looks okay, so the logic is sound. I'll continue to delve.
|
Did some more tests ... Error does not occur with ABL, only with UBL. Size of the error seems to be proportional to the bed level correction to be applied. So the error does not occur: |
Does the same discrepancy appear if Z Fade is set to 0? |
I've posted a potential fix at https://github.com/thinkyhead/Marlin/archive/bf1_tool_change_debug.zip. This approach does the Z hop in a symmetrical manner which should result in a proportional move both up and down regardless of the Z height and fade. Give that a test, and if it still doesn't fix the issue then give it one extra test with Z fade disabled to see if that is the primary contributor. |
@joris57 — I've patched the Z hop issue (again) in the |
@thinkyhead Back in the country... I tested this on yesterday's (10apr2018) bugfix-1.1.x and the issue still exists. |
Hmm, well then I just don't know. I'll have to do more testing. Does the same discrepancy appear if Z Fade is set to 0? |
Yes, it also occurs after M420 Z0 |
Hmm. Well all I know is that UBL follows a somewhat different methodology in its application of bed leveling correction to individual moves. It is possible that the Z lift on retract is being "eaten" by something in UBL so it doesn't restore on recover. Above you mentioned that the error is proportional to the Z correction being applied. Does that error become less as the Z fade height is approached, or is it consistently the same amount of error until it gets past that height? While I await your response I'll delve into the UBL movement code to see if anything obvious jumps out. |
Not seriously different. The only thing different is the correction is just applied to the destination coordinate in a move. If a move is split because it crosses mesh lines, the end of the first segment of the move becomes the 'destination'. And a Z-Height correction is done on that. Stated differently... The starting Z-Height is assumed to be correct. Even if it is not correct, by the end of the first segment of the move... The Z-Height is correct.
Yes... But if it is getting ate, my guess is there is some non-symmetrical correction or retraction happening. |
I wouldn't think so, especially since the move being affected is in Z-only.
That was my thought, but I've made doubly sure that it's symmetrical so that the same fade factor should apply to the start and end heights. And So far I can't find any reasonable cause why a Z-only move up should be asymmetrical to the down move, as if (according to the description) leveling is applied to one, but not the other. |
Yeah... But you know... Those retractions should never recurse. It might make sense to add some
sanity checks to the low level code. I bet we find exactly why there is a problem. And once you find it, it is easy to fix. |
If two |
@thinkyhead It looks like, contrary to what I claimed before, that even past the z-fade height the issue still occurs. However, what I observed today, is the following: I loaded the UBL grid with a highly exagerated value (to clearly notice the impact) with G29 P3 C5 R999 On bugfix-1.1.x of 20180320, the UBL grid value was applied to both G10 and G11 (with the same sign!), implying the bed dropped 10mm per G10/G11 instruction pair. Since there is no x/y movement, there should be no (additional) z correction at all. However, on bugfix-1.1.x of 20180410, the UBL grid value was only applied to G11 (meaning the bed did not drop (other that the Zhop value) at G10 and dropped 5mm (minus he Z-hop value) at G11). |
I spent a while looking at the relationship between |
Still the same : G10 seems to 'hop' normal, G11 seems to add the UBL grid value. I also noticed that after the G10 hop the Z value, as reported by M114 is not adapted. |
After Now that I've dealt with the planner issue I will get back to deep debugging on |
… loses Z position
@joris57 still having issues with latest bugfix 2.0? |
@boelle No opportunity to test at the moment, so I'll close the issue. |
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. |
I recently switched on fwretract on a corexy printer with UBL enabled (bugfix 1.1.X of March 20) and noticed that a calibration object, I developed to tune retraction settings, came out higher and more flimsy that usual.
It turned out that the final actual Z position after the print was higher than the expected value, while the display still showed the expected value. G0 Z0 left the nozzle considerably higher than the printbed.
When either UBL was disabled (G29 D) or fwretract zhop set to 0 (via the LCD, from 0.2) he issue disappeared.
Configuration_adv.h.txt
Configuration.h.txt
The text was updated successfully, but these errors were encountered: