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.27k stars 19.23k forks source link

[bugfix-2.0.x] UBL/Z-Offset seems to be completely ignored with BLTouch #11572

Closed ikarisan closed 5 years ago

ikarisan commented 6 years ago

Hi!

I am using am MKS Gen1.4, BLTouch and the latest marlin bugfix-2.0.x version and it seems tha the UBL and/or homing data is completely ignored.

I heated up the bed to 75°C and the nozzle to 220°C. After that (waited for 5 minutes) I did a "G29 P1" and stored it to the mesh. After that I tried to print the generated "Linear Advance" pattern but the filament did not stick to the bed. Than I printed the G26 mesh... I tried. But the mesh is printed much to high! I modified Z offset from -1.797 (with this value and G1 Z0 I can hardly put a piece of paper under the nozzle!) to -1.862 but it made things worse. NONE of the printed lines sticked to the bed!

I I home Z with the offset of -1.862, on "G1 Z0" it rams the nozzle into the bed. So the value of -1.797 seems to be the right one. But not for prints. O.o

And it seems that the Z offest is implemented the wrong way. The higher I set this value to a negative value (nearer to bed) the worst the print will get! :(

See the photos for both Z offsets. The upper one uses Z-1.797 and the second one Z-1.862 !

z-1 797 z-1 862

ManuelMcLure commented 6 years ago

What does your mesh look like (output of G29 T)? If you disable UBL (G29 D) and try to print the G26 pattern, does it work better?

If you disable UBL, home, and move Z to 0 (G1 Z0) and check the distance with a piece of paper, does it still seem like changing the offset from -1.797 to -1.862 makes the nozzle appear further from the bed?

ikarisan commented 6 years ago

I did two "G29 P1" directly one after the other and these are the (machine usable, G29 T1) results:

23:29

-0.206 -0.169 -0.139 -0.123 -0.034 -0.036 -0.090 -0.071 -0.082 -0.086 -0.210 -0.160 -0.153 -0.129 -0.099 -0.095 -0.097 -0.094 -0.075 -0.081 -0.235 -0.192 -0.172 -0.127 -0.115 -0.100 -0.101 -0.096 -0.070 -0.057 -0.228 -0.212 -0.169 -0.127 -0.106 -0.087 -0.073 -0.065 -0.070 -0.066 -0.231 -0.193 -0.152 -0.123 -0.101 -0.083 -0.090 -0.061 -0.050 -0.029 -0.245 -0.207 -0.158 -0.134 -0.114 -0.090 -0.074 -0.069 -0.056 -0.033 -0.234 -0.205 -0.163 -0.140 -0.110 -0.096 -0.074 -0.061 -0.062 -0.017 -0.226 -0.219 -0.163 -0.139 -0.127 -0.125 -0.088 -0.067 -0.047 -0.010 -0.218 -0.219 -0.163 -0.138 -0.127 -0.125 -0.088 -0.067 -0.032 -0.003 -0.210 -0.219 -0.163 -0.137 -0.127 -0.125 -0.088 -0.067 -0.017 0.004

23:40

-0.199 -0.156 -0.125 -0.110 -0.095 -0.078 -0.072 -0.063 -0.072 -0.088 -0.193 -0.182 -0.139 -0.114 -0.103 -0.091 -0.083 -0.079 -0.065 -0.065 -0.220 -0.181 -0.142 -0.120 -0.100 -0.098 -0.095 -0.084 -0.075 -0.065 -0.210 -0.184 -0.153 -0.109 -0.090 -0.071 -0.066 -0.060 -0.066 -0.049 -0.220 -0.175 -0.141 -0.110 -0.084 -0.067 -0.073 -0.052 -0.057 -0.025 -0.222 -0.178 -0.144 -0.116 -0.100 -0.073 -0.062 -0.058 -0.043 -0.022 -0.207 -0.182 -0.153 -0.129 -0.103 -0.091 -0.072 -0.058 -0.041 -0.014 -0.215 -0.190 -0.153 -0.127 -0.114 -0.105 -0.077 -0.067 -0.041 -0.000 -0.215 -0.190 -0.153 -0.125 -0.114 -0.105 -0.077 -0.067 -0.041 0.014 -0.215 -0.190 -0.153 -0.123 -0.114 -0.105 -0.077 -0.067 -0.041 0.028

I will test the "G29 D" in a few minutes...

ManuelMcLure commented 6 years ago

Hmmm... it looks like the left side of your bed is lower than the right side. Did you manually adjust the bed screws to make all corners even before running the G29 P1? If you did, it looks like you might have a twisted X-axis which is making one side of the bed read consistently higher than the other side.

ikarisan commented 6 years ago

Okay... disabling UBL and printing a G26 results in printing into the air. Aber disabling UBL, G28 and G1 Z0 there is a large gap between nozzle and bed. :(

I measured the distance (to my frame/Y axis) of the left and the right side of my X axis and it is within the tollerance of the values I am able to measure by hand (+/- 0.2mm).

Never had these kind of problems a few month ago... :(

ManuelMcLure commented 6 years ago

Although a tilted X axis (what you measured) would result in one side of the bed appearing higher than the other, what I meant was a twisted X axis - i.e. the printhead rotates around the X axis as it moves from side to side as if it were on a screw (albeit one with an extremely steep pitch). Unless the sensor is at the same Y offset as the nozzle this can cause the G29 P1 measurements to appear as if the X axis was tilted.

In any case, it's always a good idea to get the bed as close to level as possible using paper at all four corners before trying to use automatic bed leveling. The less the correction needed the better.

ManuelMcLure commented 6 years ago

Also, do you have commit db306507311862946a966e006a626dfc28f69ad6 in your bugfix-2.0.x?

ikarisan commented 6 years ago

Hi!

I still don't fully understand what you mean by a twisted axis. :D

Both X axis have been replaced by some high precision ones a few weeks ago. Also all Chinese bearings were replaced by MISUMI bearings.

I releveled the bed at all four corners and executed "G29 P1". And this is the result (see picture). Will try a G26 later.

newplot

ikarisan commented 6 years ago

Okay. Does not make any difference! I have noticed the following:

Before I print I set my Z offset to -1.6xx. Than I print witg G26 and it fails. If I now call "G28 Z; G1 Z0" the nozzle is far too way from the bed. So I need to set the Z offset to -1.7x. Next try with G26 results in the same desaster. But now, after a "G28 Z" I need to set the offset to -1.8x... respectively I try. But now Marlin is no longer reacting on M851 commands. I have to call G28 to reanimate the printer.

ManuelMcLure commented 6 years ago

I posted the following in an earlier issue:

Imagine the following with the standard 2-rod X axis (this is what my AM8 has):

On the left side of the bed the lower rod is slightly more towards the back of the printer than the upper rod (in my case this is about 0.5mm) On the right side of the bed, the upper and lower rods are exactly aligned (as they should be). The rods are around 38mm apart - this makes the amount of twist asin(0.5 / 38) = 0.75 degrees. This results in a twisted X axis. The nozzle on most i3-style machines is a few cm in front of the plane of the rods - in my case around 30mm. This means that the nozzle will be around sin(0.75) * 30mm = 0.4mm closer to the bed on the left side than on the right, assuming the bed is actually perfectly flat.

Now in my case my sensor has a Y_PROBE_OFFSET_FROM_EXTRUDER of -40. So the probe is 40mm in front of the nozzle, or 70mm in front of the plane of the rods. Let's pretend my X_PROBE_OFFSET_FROM_EXTRUDER is 0. Then on the left side of the bed the sensor will be sin(0.75) * 70mm = 0.91mm closer to the bed - a difference of 0.5mm between the amount the nozzle changed vs the amount the sensor changed. So the bed leveling system thinks the bed is 0.5mm higher on the left side than the right side.

ikarisan commented 6 years ago

Hmmmm... that sounds logical. I may be experiencing this problem more often now because I converted to E3D bowden a week ago. Now the x carriage is much lighter than with the direct drive. :/

But how can the problem be solved? You would need some kind of "x twist" parameter.

ManuelMcLure commented 6 years ago

What I did was manually level the bed as well as I could using the corner screws, then did a G29 P0 to zero out the mesh, and just used G26 and M421 to manually edit the mesh until G26 gave a good result. Then I saved the mesh with G29 S0 and just load it with G29 L0 before printing. I also printed out Anet A8/Prusa i3 - Z-Axis Alignment Tool which I use any time I might have put strain on the X axis with the motors turned off (like when changing filament) and only use the sensor for homing.

The whole idea of UBL is that you only need to generate the mesh once.

ManuelMcLure commented 6 years ago

One solution is to find a sensor mount that puts the sensor directly in line with the nozzle - i.e. neither in front or in back of it. Although this doesn't eliminate the error entirely, it reduces it by at least an order of magnitude. A sensor that uses the actual nozzle (a piezo or electrical contact sensor) totally eliminates the error caused by the X axis twist.

AnHardt commented 6 years ago

You would need some kind of "x twist" parameter.

Better find and fix the mechanical problem.

Roxy-3D commented 6 years ago

Agreed... It is going to be a long time until we have an X-Twist configuration parameter. It is best to fix your hardware!!!

But if you really don't want to fix your hardware... Do a G26 and edit your mesh so that it prints level.

ikarisan commented 6 years ago

@ManuelMcLure I measured the distances to the aluminium frame of both rods. Top right: 21.47mm Bottom right: 20.95mm Top left: 21.23mm Bottom left: 20.64mm

Left: arcsin(0.59mm / 38mm) = 0.888° Right: arcsin(0,52mm / 38mm) = 0.785°

This is a difference of only 0.103° ==> sin(0.103) * 53mm (Y offset) = 0.095mm Can't believe that such a low error effects the leveling results in that way. I've been using the rear sensor for almost six months with "G29 P1" UBL and never had these problems before. :(

Roxy-3D commented 6 years ago

Yeah... But because of the Y offset... the twist gets amplified. (As your math shows!)

ManuelMcLure commented 6 years ago

Your measurements also assume that both sides of the aluminum frame are exactly parallel. That's why when I measured my rods I used a right angle square against the table on which the printer sits. That way I'm sure I'm measuring both sides of the axis against the same reference. In that case it's easy to see that while both rods are flush against the square on the right side, on the left side there's a visible gap to the bottom rod.

Roxy-3D commented 6 years ago

@AnHardt has a good graphic from OpenScad that shows the twist problem. Maybe he will see this message and post it?

lrpirlet commented 6 years ago

Have a look at #9529 entry Feb 13th by @AnHardt... Then read the whole topic… A possible solution is given (Y belt tension must be enough but not too much)...

ikarisan commented 6 years ago

@lrpirlet Thank you

I bought a big right angle square and checked the distances. If it touches the lower rod the distance to the upper is the same on both sides. Can't measure more than 0,1mm in difference.

So I did a "G29 P1" again and after that I edited the mesh by hand, using a 0.1mm thickness gauge made of metal and the LCD to adjust the values.

I have noticed the following: Sometimes the nozzle lowers down to the bed and then makes a quick jump down. You can see and hear this in this video: https://www.youtube.com/watch?v=mNHPVbU8vRU (starts at 00:06). Look at the nozzle and hear the sound.

And if I repeatly calibrate the same point over and over again, every time the values do not fit! I Sometimes I have to lower them by 0,05 - 0,1 mm and sometime I have to lift them up. In the second pass the set values of the first are no longer correct.

ikarisan commented 6 years ago

The next thing I will do, just to be sure, is to flash an older bugfix-1.1.x version (around July) and test the UBL. You say that it is an hardware issue but as said, the UBL worked with the direct extruder and an old version.

And why can I set the Z offset at X110/Y110 to a value that a sheet of paper fits only very tight beneath the nozzle and the bed and if I print with this offset, the nozzle seems to print into the air?

I.e. at 110/110 I measured an Z offset of -1.750mm but even if I set the Z offset to -1.850 for the print the nozzel is far away from the bed.

gloomyandy commented 6 years ago

Are you sure your homing is producing consistent results? The mesh that you posted earlier is odd in that it seems to contain nearly all negative values, this would imply that you are homing on a spot on the bed that is the high/low point which is pretty unlucky. Where on the bed do you home to? It is probably best to home to the centre of the bed (assuming that is the area you normally use for printing). If you home say six times and after each home perform the paper test do you get the same Z reading each time? If not then something may be wrong with your homing (are you using the same probe for homing and bed levelling?).

ikarisan commented 6 years ago

I am homing at "bedsize/2" (center of the bed). Just printed a 40x40x10 cube and it was okay - not good for the first layer, I had to lower Z offset during the print. After that i thought I could print another model. But only the prime line was "okay". The object, printed at the center of the bed, did not stick to it because the gap was to large... again :(

And yes, I am using a BLTouch Smart for leveling and homing. And the repeatability test gives variations around 0.01mm for the same point. After I reset my printer the offset is okay.. somehow... I had to lower the Z offset again.

ikarisan commented 6 years ago

I took your clues seriously and modified my X carriage (https://www.thingiverse.com/thing:3030241) to hold the BLTouch 35mm right of the nozzle (Y=0) instead of 55mm behinde the nozzle. :)

The UBL mesh results seem to be in place now.

The screenshot looks weired, because the corners of the bed must be leveled again. :) But in X-direction the deviations are now very small.

newplot

ManuelMcLure commented 6 years ago

I'm glad my comments helped!

boelle commented 5 years ago

@ikarisan problem still there?

boelle commented 5 years ago

@thinkyhead i think we can close this one

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.