MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.18k stars 19.21k forks source link

Auto leveling does not work properly in 1.1.8 #11234

Closed StreakingJerry closed 6 years ago

StreakingJerry commented 6 years ago

I have tried all three auto leveling methods but none of them works correctly.

#define AUTO_BED_LEVELING_3POINT
#define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR

No matter the right side of bed is lower or higher than the left side initially. After auto leveling the right side will always about 1mm lower than the left side. I have tested a lot and I think there should be no problem with my configuration. I guess there should be some problem about compensation rate or something?

Configuration.h ```cpp //#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_LINEAR #define AUTO_BED_LEVELING_BILINEAR //#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING /** * Enable detailed logging of G28, G29, M48, etc. * Turn on with the command 'M111 S32'. * NOTE: Requires a lot of PROGMEM! */ #define DEBUG_LEVELING_FEATURE #if ENABLED(MESH_BED_LEVELING) || ENABLED(AUTO_BED_LEVELING_BILINEAR) || ENABLED(AUTO_BED_LEVELING_UBL) // Gradually reduce leveling correction until a set height is reached, // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z //#define ENABLE_LEVELING_FADE_HEIGHT // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the // contours of the bed more closely than edge-to-edge straight moves. #define SEGMENT_LEVELED_MOVES #define LEVELED_SEGMENT_LENGTH 1.0 // (mm) Length of all segments (except the last one) /** * Enable the G26 Mesh Validation Pattern tool. */ #define G26_MESH_VALIDATION // Enable G26 mesh validation #if ENABLED(G26_MESH_VALIDATION) #define MESH_TEST_NOZZLE_SIZE 0.2 // (mm) Diameter of primary nozzle. #define MESH_TEST_LAYER_HEIGHT 0.1 // (mm) Default layer height for the G26 Mesh Validation Tool. #define MESH_TEST_HOTEND_TEMP 200.0 // (°C) Default nozzle temperature for the G26 Mesh Validation Tool. #define MESH_TEST_BED_TEMP 65.0 // (°C) Default bed temperature for the G26 Mesh Validation Tool. #endif #endif #if ENABLED(AUTO_BED_LEVELING_LINEAR) || ENABLED(AUTO_BED_LEVELING_BILINEAR) // Set the number of grid points per dimension. #define GRID_MAX_POINTS_X 2 #define GRID_MAX_POINTS_Y GRID_MAX_POINTS_X // Set the boundaries for probing (where the probe can reach). #define LEFT_PROBE_BED_POSITION 10 #define RIGHT_PROBE_BED_POSITION 170 #define FRONT_PROBE_BED_POSITION 10 #define BACK_PROBE_BED_POSITION 170 // The Z probe minimum outer margin (to validate G29 parameters). #define MIN_PROBE_EDGE 10 // Probe along the Y axis, advancing X after each column //#define PROBE_Y_FIRST #if ENABLED(AUTO_BED_LEVELING_BILINEAR) // Beyond the probed grid, continue the implied tilt? // Default is to maintain the height of the nearest edge. #define EXTRAPOLATE_BEYOND_GRID // // Experimental Subdivision of the grid by Catmull-Rom method. // Synthesizes intermediate points to produce a more detailed mesh. // //#define ABL_BILINEAR_SUBDIVISION #if ENABLED(ABL_BILINEAR_SUBDIVISION) // Number of subdivisions between probe points #define BILINEAR_SUBDIVISIONS 3 #endif #endif #elif ENABLED(AUTO_BED_LEVELING_3POINT) // 3 arbitrary points to probe. // A simple cross-product is used to estimate the plane of the bed. #define ABL_PROBE_PT_1_X 90 #define ABL_PROBE_PT_1_Y 10 #define ABL_PROBE_PT_2_X 10 #define ABL_PROBE_PT_2_Y 170 #define ABL_PROBE_PT_3_X 170 #define ABL_PROBE_PT_3_Y 170 ``` ``` //=========================================================================== //============================= Z Probe Options ============================= //=========================================================================== // @section probes // // See http://marlinfw.org/docs/configuration/probes.html // /** * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN * * Enable this option for a probe connected to the Z Min endstop pin. */ #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN /** * Z_MIN_PROBE_ENDSTOP * * Enable this option for a probe connected to any pin except Z-Min. * (By default Marlin assumes the Z-Max endstop pin.) * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below. * * - The simplest option is to use a free endstop connector. * - Use 5V for powered (usually inductive) sensors. * * - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin: * - For simple switches connect... * - normally-closed switches to GND and D32. * - normally-open switches to 5V and D32. * * WARNING: Setting the wrong pin may have unexpected and potentially * disastrous consequences. Use with caution and do your homework. * */ //#define Z_MIN_PROBE_ENDSTOP /** * Probe Type * * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc. * Activate one of these to use Auto Bed Leveling below. */ /** * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe. * Use G29 repeatedly, adjusting the Z height at each point with movement commands * or (with LCD_BED_LEVELING) the LCD controller. */ //#define PROBE_MANUALLY /** * A Fix-Mounted Probe either doesn't deploy or needs manual deployment. * (e.g., an inductive probe or a nozzle-based probe-switch.) */ //#define FIX_MOUNTED_PROBE /** * Z Servo Probe, such as an endstop switch on a rotating arm. */ #define Z_ENDSTOP_SERVO_NR 0 // Defaults to SERVO 0 connector. #define Z_SERVO_ANGLES {119,60} // Z Servo Deploy and Stow angles /** * The BLTouch probe uses a Hall effect sensor and emulates a servo. */ //#define BLTOUCH #if ENABLED(BLTOUCH) //#define BLTOUCH_DELAY 375 // (ms) Enable and increase if needed #endif /** * Enable one or more of the following if probing seems unreliable. * Heaters and/or fans can be disabled during probing to minimize electrical * noise. A delay can also be added to allow noise and vibration to settle. * These options are most useful for the BLTouch probe, but may also improve * readings with inductive probes and piezo sensors. */ //#define PROBING_HEATERS_OFF // Turn heaters off when probing //#define PROBING_FANS_OFF // Turn fans off when probing //#define DELAY_BEFORE_PROBING 500 // (ms) To prevent vibrations from triggering piezo sensors // A probe that is deployed and stowed with a solenoid pin (SOL1_PIN) //#define SOLENOID_PROBE // A sled-mounted probe like those designed by Charles Bell. //#define Z_PROBE_SLED //#define SLED_DOCKING_OFFSET 5 // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like. // // For Z_PROBE_ALLEN_KEY see the Delta example configurations. // /** * Z Probe to nozzle (X,Y) offset, relative to (0, 0). * X and Y offsets must be integers. * * In the following example the X and Y offsets are both positive: * #define X_PROBE_OFFSET_FROM_EXTRUDER 10 * #define Y_PROBE_OFFSET_FROM_EXTRUDER 10 * * +-- BACK ---+ * | | * L | (+) P | R <-- probe (20,20) * E | | I * F | (-) N (+) | G <-- nozzle (10,10) * T | | H * | (-) | T * | | * O-- FRONT --+ * (0,0) */ #define X_PROBE_OFFSET_FROM_EXTRUDER -27 // X offset: -left +right [of the nozzle] #define Y_PROBE_OFFSET_FROM_EXTRUDER 63 // Y offset: -front +behind [the nozzle] #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.14 // Z offset: -below +above [the nozzle] // X and Y axis travel speed (mm/m) between probes #define XY_PROBE_SPEED 6000 // Speed for the first approach when double-probing (MULTIPLE_PROBING == 10) #define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z // Speed for the "accurate" probe of each point #define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 20) // The number of probes to perform at each point. // Set to 2 for a fast/slow probe, using the second probe result. // Set to 3 or more for slow probes, averaging the results. #define MULTIPLE_PROBING 2 /** * Z probes require clearance when deploying, stowing, and moving between * probe points to avoid hitting the bed and other hardware. * Servo-mounted probes require extra space for the arm to rotate. * Inductive probes need space to keep from triggering early. * * Use these settings to specify the distance (mm) to raise the probe (or * lower the bed). The values set here apply over and above any (negative) * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD. * Only integer values >= 1 are valid here. * * Example: `M851 Z-5` with a CLEARANCE of 4 => 9mm from bed to nozzle. * But: `M851 Z+1` with a CLEARANCE of 2 => 2mm from bed to nozzle. */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 #define Z_PROBE_OFFSET_RANGE_MAX 20 // Enable the M48 repeatability test to test probe accuracy #define Z_MIN_PROBE_REPEATABILITY_TEST // For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1 // :{ 0:'Low', 1:'High' } #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 stepper immediately when it's not being used. // WARNING: When motors turn off there is a chance of losing position accuracy! #define DISABLE_X false #define DISABLE_Y false #define DISABLE_Z false // Warn on display about possibly reduced accuracy #define DISABLE_REDUCED_ACCURACY_WARNING // @section extruder #define DISABLE_E false // For all extruders #define DISABLE_INACTIVE_EXTRUDER true // Keep only the active extruder enabled. // @section machine // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way. #define INVERT_X_DIR true #define INVERT_Y_DIR true #define INVERT_Z_DIR true // Enable this option for Toshiba stepper drivers //#define CONFIG_STEPPERS_TOSHIBA // @section extruder // For direct drive extruder v9 set to true, for geared extruder set to false. #define INVERT_E0_DIR false #define INVERT_E1_DIR false #define INVERT_E2_DIR false #define INVERT_E3_DIR false #define INVERT_E4_DIR false // @section homing //#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed //#define Z_HOMING_HEIGHT 10 // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ... // Be sure you have this distance over your Z_MAX_POS in case. // Direction of endstops when homing; 1=MAX, -1=MIN // :[-1,1] #define X_HOME_DIR -1 #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 // @section machine // The size of the print bed #define X_BED_SIZE 190 #define Y_BED_SIZE 190 // Travel limits (mm) after homing, corresponding to endstop positions. #define X_MIN_POS -62 #define Y_MIN_POS -66 #define Z_MIN_POS 0 //#define X_MAX_POS (X_BED_SIZE) //#define Y_MAX_POS (Y_BED_SIZE) #define X_MAX_POS (300 + X_MIN_POS) #define Y_MAX_POS (300 + Y_MIN_POS) #define Z_MAX_POS 320 ```
StreakingJerry commented 6 years ago

I tried M420 S1 but still the same. The method I test is bilinear.

This is the record of Repetier

21:53:07.174 : N23 G28*34
21:53:24.678 : X:122.00 Y:32.00 Z:8.14 E:0.00 Count A:30800 B:18000 Z:6512
21:53:30.350 : N24 M420 S1*81
21:53:30.350 : echo:Bed Leveling On
21:53:30.350 : X:122.00 Y:32.00 Z:8.40 E:0.00 Count A:30800 B:18000 Z:6512
21:53:36.416 : N25 G29*37
21:54:00.101 : Bilinear Leveling Grid:
21:54:00.101 : 0      1
21:54:00.101 : 0 +0.113 -0.467
21:54:00.101 : 1 +0.369 -0.278
21:54:00.117 : X:197.00 Y:107.00 Z:8.55 E:0.00 Count A:60800 B:18000 Z:6512

The right side still 1mm higher than the left.

BTW which bugfix version you mean? The current testing one 1.1.8 and I don't find any newer version.

StreakingJerry commented 6 years ago

I just test to run g29 first. The right is 1mm higher. Then I manually level it, and run G29 again. and now the bed is prefect level. But after I power off and power on again, run g29. the right is 1mm higher again.

gloomyandy commented 6 years ago

bugfix-1.1.x has the latest fixes.

You really need to fill in the issue template when reporting problems and also attach your configuration files as requested in the template. It will make it much easier for people to help you.

insanity67 commented 6 years ago

Please search the issues here, there are so many with the same problem. Some say it´s a mechanical issue, others dont believe that.

nightgryphon commented 6 years ago

Did you save final mesh with M500? May be it use the older mesh after load settings. Also you can try to check actual bed level before run G29 to check the mechanical issues. Home with G28 than G29 S5 to disable mesh than move head to control points with G1 commands to see the actual bed level by distance between bed and nozzle at same Z height value.

AnHardt commented 6 years ago

All kinds of bed levelings, using a probe, don't try to keep the nozzle at a constant distance to the bed. They keep the probes trigger point at a constant distance to the bed. This works well only, if the distance of the nozzle tip and the probes trigger point are the same all over the bed. If Z_PROBE_OFFSET_FROM_EXTRUDER isn't constant there is no chance to make bed levelling with auto probing work - you have a mechanical problem not covered by Marlin. A workaround is to use UBL and to dial in the mesh points manually, maybe with help of G26. An other one, for all kinds of leveling, is to use the nozzle as the probe (PROBE_MANUALLY, ...).

PS There is a theory one could use to compensate for varying Z_PROBE_OFFSET_FROM_EXTRUDER by using 3 not collinear probes distributed around the nozzle. This is expensive, difficult to set up and for sure has an other hole in the theory what would need the next level of compensation. At first we had mechanical bed levelling by adjusting some screws. To avoid mechanical adjusting a probe and 3-point levelling was added. To overcome not consistent probing multi point levelling, was invented. Because of non flat beds (and not linear movement of deltas) mesh leveling was invented, at first for delta printers, than for cartesians. Up to now with every new compensation we discovered new sources for mechanical errors. For now UBL is the latest step forward. It tries to unify all the earlier attempts and tries to add relative simple manual mesh point editing. With this you can bypass all theory and can just look at the print result (G26). The next step could be a compensation for thermal expansions of the system, or different Z_PROBE_OFFSET_FROM_EXTRUDER caused by different temperatures of the probe (Prusa already trys to do that). But this again needs more hardware and adjustment to make it work.

Today leveling works good enough to temptate manufacturers to reduce hardware quality, to make the printers cheaper.

In the end it may be cheaper and faster to invest in a flat bed, good mechanics, adjust the bed with 3 bolts and developing a personal fixed routine sequence in using the printer with z-babystepping during the first layer.

Adding more and more complexity can't be the way to make 3D-printing easier for a non expert user.

StreakingJerry commented 6 years ago

I have updated to the newest bugfix-1.1.x and then I have tried to level the bed manually first, then run the G28 and then G29. after that I test the leveling result by G1 and the right side is 1mm higher. After that I tried to lower the right side by 1mm and run g28,g29 and test with g1 again. The right side is still 1mm higher. I have done a couple of test with different bed leveling condition before G28. The result is no matter if bed is level or not before ABL. No matter the right side is higher or lower before ABL. after the ABL the right side will always 1mm higher than left side. Also the probe is fixed on the extruder. Therefore I am pretty sure Z_PROBE_OFFSET_FROM_EXTRUDER is constant. Due to this constant difference so I think this might not be a mechanical issue. The ABL methods I used are 3=point, bilinear and linear, They all give the same result.

config.zip

RudyBenner commented 6 years ago

Is this a core xy machine?

define COREXY

are you using bltouch?

StreakingJerry commented 6 years ago

Yes mine is corexy.

I just use a normal endstop without arm mounted on a servo

ManuelMcLure commented 6 years ago

Also the probe is fixed on the extruder. Therefore I am pretty sure Z_PROBE_OFFSET_FROM_EXTRUDER is constant.

If you have a twisted X axis this is not true. Because of the twist the Z_PROBE_OFFSET_FROM_EXTRUDER appears different from the right to the left of the bed. This is a common problem on i3-style machines.

Roxy-3D commented 6 years ago

I have tried all three auto leveling methods but none of them works correctly.

#define AUTO_BED_LEVELING_3POINT
#define AUTO_BED_LEVELING_LINEAR
#define AUTO_BED_LEVELING_BILINEAR

There are currently 5 different bed leveling systems in Marlin.

A workaround is to use UBL and to dial in the mesh points manually, maybe with help of G26. An other one, for all kinds of leveling, is to use the nozzle as the probe (PROBE_MANUALLY, ...).

Yes! Once again Anhardt is out in front. If you are having problems... Go to the basics. What ever the mesh looks like when you probed it... Now do a G26. (Even if you are using Bi-Linear or the original Mesh bed leveling) Print the G26 Mesh Validation Pattern.

Does it look right? If not... Start editing the mesh points up or down.... And re-print the G26 Mesh Validation Pattern. Probably the pattern will look better but not be perfect. Keep doing this 2 or 3 times. Pretty soon... Your mesh will accurately describe the bed (at least as far as the printer sees it).

If you are curious... Re-probe the bed and compare the 'working' mesh with the probed mesh. Probably, you will see a pattern. And that might give you some hints on where to look for the root cause of the problem. But even without doing that, if you have a working mesh, you can just use it and not go after the root cause of the problem. (Me??? I would go after the root cause and fix it!!!)

AnHardt commented 6 years ago

Therefore I am pretty sure Z_PROBE_OFFSET_FROM_EXTRUDER is constant.

Don't believe in that. Measure it. With 1mm difference from right to left. it should be pretty easy to see the error by naked eye. Just take a look on the nozzle-bed distance on both sides of the bed when the probe triggers and compare. Finding the reason could be a bit more difficult, because the huge (Y_PROBE_OFFSET_FROM_EXTRUDER 63) lever is amplifying the reason.

Due to this constant difference so I think this might not be a mechanical issue.

All this proves is, that it's a systematic error, independent from the kind of bed level compensation. So a error in measurement is as likely as before.

StreakingJerry commented 6 years ago

Thanks for your guys help. I have figured out the problem, @Roxy-3D and @AnHardt is right, My x-axis use two axis and I find they are not prefect parallel by a counter weight with a string. Thanks again for all your guys help.

BTW may I ask how can I edit the mesh generated by bilinear method and save the difference between the adjusted mesh and original measured mesh? Therefore I am able to load this bias every time after ABL.

megavolt0 commented 5 years ago

I have figured out the problem, @Roxy-3D and @AnHardt is right, My x-axis use two axis and I find they are not prefect parallel by a counter weight with a string. Thanks again for all your guys help.

Hi! I don't undersend... Have you solved the problem? I have the same problem on H-BOT with BLtouch... And I don`t know what to do....(( (MARLIN 1.1.9)

Bilinear Leveling Grid: 0 1 2 0 +0.265 -0.510 -1.128 1 +0.237 -0.502 -1.195 2 +0.331 -0.425 -1.152

AnHardt commented 5 years ago

Our "bed leveling"- algorithms try to keep the distance between bed and nozzle constant. For that we try to find the Z position of the bed at several places with a probe and
assume the distance between the probe and the nozzle is constant. Now we try to keep the distance probe to bed constant. If the distance probe nozzle changes, depending on where (XY) we are on the bed, we can keep the probes distance to the bed as exact as we want. The distance nozzle bed will vary. There are some mechanical problems a printer can have what can cause this error.

We can't find this problem for you because it's not in the software. It's up to you to find the mechanical problem.. One of the most common is a "twisted X-axis".

github-actions[bot] commented 4 years ago

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.