I have issue with marlin 1.0.2 auto-leveling.

3d-faq
3d-qa
3d-help
gplus
(Mateusz Perlak) #1

I have issue with marlin 1.0.2 auto-leveling.
I level out the bed that when after command G28 I move hotend around it stays flat, however the measurements of inductive sensor on G29 are not level and that shifts my printing plane.

My printer build plate is steel and I got 4mm inductive sensor.
plate size 300x300mm with 9 points of measurement (extended from 4 because it was same issue)
Here is output of sensor readout from G29 command:
Bed x: 50.00 y: 50.00 z: 4.20
Bed x: 150.00 y: 50.00 z: 4.36
Bed x: 250.00 y: 50.00 z: 4.42
Bed x: 250.00 y: 150.00 z: 3.72
Bed x: 150.00 y: 150.00 z: 3.28
Bed x: 50.00 y: 150.00 z: 3.29
Bed x: 50.00 y: 250.00 z: 2.36
Bed x: 150.00 y: 250.00 z: 2.36
Bed x: 250.00 y: 250.00 z: 2.64
Eqn coefficients: a: 0.00 b: -0.01 d: 4.58
planeNormal x: -0.00 y: 0.01 z: 1.00
echo:endstops hit: Z:2.64

You can notice that measurements on Y=250 are over 1mm away.
Question:
I use some magnets to hold the steep plate bed, does that affect sensor readout? I moved most magnets away up to 50mm from sensor stops, to minimalize that effect (if any).

Does anyone had similar issue?

(Keith Applegarth) #2

What does your start code look like? You could be clearing out your leveling before printing.

(Mateusz Perlak) #3

Generated g-code is never hit, I run manually commands G28 and G29. Then I move around the bed with G1 commands

(Mateusz Perlak) #4

I found out that the normal calculated is reversed and when I have bed tilted in either X axis or Y axis, after running G29 command, moving hotend moved Z opposite to what it should to keep same Z level above the bed.

Does anyone had that issue? My printer is CoreXY (Smartcore).
here is part of Configration.h for its motor and directions setup:

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define E_ENABLE_ON 0 // For all extruders

// Disables axis when it’s not being used.
#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z true
#define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled

#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

#define min_software_endstops false // If true, axis won’t move to coordinates less than HOME_POS.
#define max_software_endstops true // If true, axis won’t move to coordinates greater than the defined lengths below.

// Travel limits after homing
#define X_MAX_POS 300
#define X_MIN_POS 0
#define Y_MAX_POS 300
#define Y_MIN_POS -13
#define Z_MAX_POS 250
#define Z_MIN_POS 0

(Mateusz Perlak) #5

I did change INVERT_X_DIR and INVERT_Y_DIR and rotated motor connectors with same effect - plane calculated is opposite to plane of bed.

Maybe it is something to do with reversed Z because top bottom is increasing… will do some additional checks

(Mateusz Perlak) #6

setting INVERT_Z_DIR to false and adjusting motors did nothing, now as I think of it shouldn’t - but I think keeping INVERT_Z_DIR and true and take that into calculation of normal for plane might fix the issue.

(Mateusz Perlak) #7

small hack into 3-point equation method in Marlin fixed the issue:
added negative readouts for z probe @Marlin_main.cpp line 1024-1026

vector_3 pt1 = vector_3(ABL_PROBE_PT_1_X, ABL_PROBE_PT_1_Y, -z_at_pt_1);
vector_3 pt2 = vector_3(ABL_PROBE_PT_2_X, ABL_PROBE_PT_2_Y, -z_at_pt_2);
vector_3 pt3 = vector_3(ABL_PROBE_PT_3_X, ABL_PROBE_PT_3_Y, -z_at_pt_3);