Welcome! Log In Create A New Profile

Advanced

AutoLevel was working, now Z axis raises too much before probing/printing

Posted by usslindstrom 
AutoLevel was working, now Z axis raises too much before probing/printing
June 28, 2015 06:54PM
All, thanks for whatever help you can provide.

I've got a Prusa i3, which had everything working great in regards to auto-leveling. On a latest tweak upload, to set numbers for calibration, it appears that I've woken the beast. Now, just before the unit starts to auto-level, or even right before a print - The Z axis actually raises by about 30mm, and in the case of printing it starts to push plastic mid-air as it thinks it's on the surface still.

I have no idea what I bumped, and after hours of searching the forum here, I've come up empty handed. I apologize in being a bother, but honestly have no idea why the printer started acting this way.

I've attached my configuration.h in hopes that somebody may be able to see why it all the sudden started doing this...

I suspect it's the raise before homing, but that setting has been the same since the beginning of time - from a state where all this was working perfect.

//======================================================================

// Offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER -41 // Probe on: -left +right
#define Y_PROBE_OFFSET_FROM_EXTRUDER 56 // Probe on: -front +behind
#define Z_PROBE_OFFSET_FROM_EXTRUDER -22.60 // -below (always!)

#define Z_RAISE_BEFORE_HOMING 30 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case

#define XY_TRAVEL_SPEED 4000 // X and Y axis travel speed between probes, in mm/min

#define Z_RAISE_BEFORE_PROBING 5 //How much the extruder will be raised before traveling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
#define Z_RAISE_AFTER_PROBING 5 //How much the extruder will be raised after the last probing point.
Attachments:
open | download - Configuration.h (38.2 KB)
Re: AutoLevel was working, now Z axis raises too much before probing/printing
June 30, 2015 12:16AM
@usslindstrom

I managed to find the bug and posted the bug fix on github for the Marlin firmware.
If you don't want to wait for the new release of Marlin you can do this fix which works for me:
In Marlin_main.cpp:

// The following code correct the Z height difference from z-probe position and hotend tip position.
// The Z height on homing is measured by Z-Probe, but the probe is quite far from the hotend.
// When the bed is uneven, this height must be corrected.
real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane)
x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
z_tmp = current_position[Z_AXIS] ;

apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset
// current_position[Z_AXIS] = z_tmp - real_z - current_position[Z_AXIS]; ****Logic error is here***
current_position[Z_AXIS] = z_tmp - real_z - Z_PROBE_OFFSET_FROM_EXTRUDER; //bug fix or use zprobe_zoffset instead if you want to use M851 to adjust the offset on the fly after g29

Good luck and let me know if it fixed your issue.
Wow, Thanks for this. Outstanding.

I apologize though, trying to depict what you're showing me... Just dropping that block of code into the .cpp causes compiling errors, solely due to the variables not being defined I'd imagine.

//=================================
Marlin_main.cpp:6351:1: error: 'real_z' does not name a type
real_z = float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane)
^
Marlin_main.cpp:6352:1: error: 'x_tmp' does not name a type
x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER;
^
Marlin_main.cpp:6353:1: error: 'y_tmp' does not name a type
y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
^
Marlin_main.cpp:6354:1: error: 'z_tmp' does not name a type
z_tmp = current_position[Z_AXIS] ;
^
Marlin_main.cpp:6356:19: error: expected constructor, destructor, or type conversion before '(' token
apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset
^
Marlin_main.cpp:6358:1: error: 'current_position' does not name a type
current_position[Z_AXIS] = z_tmp - real_z - Z_PROBE_OFFSET_FROM_EXTRUDER; //bug fix or use zprobe_zoffset instead if you want to use M851 to adjust the offset on the fly after g29
^
Error compiling.
//===========================================

It's most likely an easy fix for me, but please bear with me as I'm a novice in most of this stuff *outside of configuration.h.
My issue here appears to have been corrected. I updated to build c6f8673690, and the issue no longer appears.

It does look like it was some sort of bug. Thanks.
Re: AutoLevel was working, now Z axis raises too much before probing/printing
July 06, 2015 02:21AM
Well done! There you see it is not that complicated. Enjoy the ABL feature, hopefully other people get their ABL working now.
Sorry, only registered users may post in this forum.

Click here to login