Welcome! Log In Create A New Profile

Advanced

Z height wrong after z probing

Posted by music99 
Z height wrong after z probing
July 29, 2016 12:22PM
I ran G29 after G28 XY, which seems to work fine. However, when I try to print something, the printer starts 2ish cm above the platform. I tried to change "#define Z_PROBE_OFFSET_FROM_EXTRUDER", but that doesn't seem to have any affect. Here is my start code:

G21 (set units to mm)
G90 (set positioning to absolute)
M82 (set extruder to absolute)

(**** begin homing ****)
G28 X
G28 Y F4000 (home XY axes)
G29 (bed level)
(**** end homing ****)

M109 S208 (Heat extruder)
; -- end of START GCODE -

I should also mention that I am using the nozzle as a probe (similar to the lulzbot). Once I get this sorted out, I will add some gcode to run the nozzle across a toothbrush head after heating to clean it.

Edited 1 time(s). Last edit at 07/29/2016 12:26PM by music99.
Re: Z height wrong after z probing
July 29, 2016 02:08PM
If you start a print, and only do the G28 skipping the G29, does it still start too high off the bed?

I've had issues with the Marlin 1.1.0-RC6 and G29 to the point I stopped using it. For my case, if I did G28 and then G29 it would start like your 2cm above the bed, but if I skipped the G29 part it would start right on the bed like it was supposed to ofcourse this meant I had to make sure my bed was perfectly flat and level.
Re: Z height wrong after z probing
July 30, 2016 04:12PM
I have the same problem after switching form RC6 to RC7

I'm using the following setup for my printer:
-ZMAX hall endstop for homing
-servo deployable probe for bed leveling


After homing(G28) Z=0 is about 3mm over the print surface and then corrected by the bed leveling(G29).
This gives me the possibility to change the thickness of the build without adjusting the z-endstop.


Is there any solution for RC7?
Re: Z height wrong after z probing
July 30, 2016 04:52PM
Did you do a M502 and M500 pair of commands? It kind of sounds like you have a Z_Offset saved in your EEPROM.

The entire bed leveling system has been rewritten in www.github.com/MarlinFirmware/Marlin/devel_ubl. You can try that as a solution.
Re: Z height wrong after z probing
July 31, 2016 04:32AM
Quote
Roxy
Did you do a M502 and M500 pair of commands? It kind of sounds like you have a Z_Offset saved in your EEPROM.
EEPROM is disabled in my config, so it should not affect the leveling procedure.

Quote
Roxy
The entire bed leveling system has been rewritten in www.github.com/MarlinFirmware/Marlin/devel_ubl. You can try that as a solution.

I tried it, but it doesn't compile

sketch/Marlin_main.cpp: In function 'void gcode_T(uint8_t)':
Marlin_main.cpp:6223: error: 'class Planner' has no member named 'bed_level_matrix'
           offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix));
                                             ^
Marlin_main.cpp:6223: error: 'class Planner' has no member named 'bed_level_matrix'
           offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix));
                                                                                ^
exit status 1
'class Planner' has no member named 'bed_level_matrix'
Re: Z height wrong after z probing
July 31, 2016 09:42AM
I think I have the compile time issues cleaned up. Please give it another try. Is it correct that you have a multiple extruder machine? You are the first person to force the compiler down those paths.

Incidentally, you will need to have the EEPROM turned on for the Unified Bed Leveling System. The System needs storage space for the Mesh.
Re: Z height wrong after z probing
July 31, 2016 10:58AM
Yes i Have a dual extruder

I tested it again, but now i get another compile error

sketch/Marlin_main.cpp: In function 'void gcode_T(uint8_t)':
Marlin_main.cpp:6248: error: 'class bed_leveling' has no member named 'active'
             if (bed_leveling_mesh.active()) {
                                   ^
Marlin_main.cpp:6251: error: 'xydiff' was not declared in this scope
               current_position[Z_AXIS] += bed_leveling_mesh.get_z_correction(xpos + xydiff[X_AXIS], ypos + xydiff[Y_AXIS]) - bed_leveling_mesh.get_z_correction(xpos, ypos);
                                                                                     ^
Marlin_main.cpp:6259: error: 'xydiff' was not declared in this scope
         current_position[X_AXIS] += xydiff[X_AXIS];
                                     ^
exit status 1
'class bed_leveling' has no member named 'active'

So I switched to only one extruder and it compiled fine.
after a normal homing I executed "G29 P0 T" the printer then probes but after probing i can't recognize any compensation.

In RC6 with grid bed leveling every move along X and Y affects the Z-axis slightly
Re: Z height wrong after z probing
July 31, 2016 12:10PM
If you attach your Configuration.h file, I'll get the compiler errors cleaned up for you. G29 P0 T will create a mesh for a perfectly flat bed and depending upon what the probe values are, it will tilt it. You can confirm the calculated correction by doing G29 P0 T and then a G29 M You also have to activate the system with a G29 A. I would have to double check to be sure, but I think you can do all of that in one command and just say G29 P0 T M A And if you put the nozzle 3 or 4mm above the bed (below the Fade Height), you can move the nozzle around the bed and verify the Z-Axis is changing to compensate for bed tilt.
Re: Z height wrong after z probing
July 31, 2016 12:41PM
Thanks for your quick response
I attached my two extuder config.

I executed G29 P0 T M A and got that output:
M80
ok
G28
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
X:200.00 Y:190.00 Z:65.00 E:0.00 Count X: 16000 Y:15200 Z:166400
ok
G29 P0 T M A
Unified Bed Leveling System activated.

Mesh zeroed.

echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
d from first  point: -6.110357  c: -5.440312
d from second point: -6.110357  c: -5.339140
d from third  point: -6.110356  c: -0.987578

Bed Topography Report:

(0,9)                                                                                                                                                             (9,9)
(22,165)                                                                                                                                                         (199,165)
 -5.49565    -4.82179    -4.14793    -3.47406    -2.80020    -2.12633    -1.45247    -0.77861    -0.10474     0.56912   
 
 -5.48170    -4.80783    -4.13397    -3.46010    -2.78624    -2.11238    -1.43851    -0.76465    -0.09078     0.58308   
 
 -5.46774    -4.79387    -4.12001    -3.44615    -2.77228    -2.09842    -1.42455    -0.75069    -0.07683     0.59704   
 
 -5.45378    -4.77992    -4.10605    -3.43219    -2.75832    -2.08446    -1.41060    -0.73673    -0.06287     0.61100   
 
 -5.43982    -4.76596    -4.09209    -3.41823    -2.74437    -2.07050    -1.39664    -0.72277    -0.04891     0.62495   
 
 -5.42586    -4.75200    -4.07814    -3.40427    -2.73041    -2.05654    -1.38268    -0.70882    -0.03495     0.63891   
 
 -5.41191    -4.73804    -4.06418   [-3.39031]  -2.71645    -2.04259    -1.36872    -0.69486    -0.02099     0.65287   
 
 -5.39795    -4.72408    -4.05022    -3.37636    -2.70249    -2.02863    -1.35476    -0.68090    -0.00704     0.66683   
 
 -5.38399    -4.71013    -4.03626    -3.36240    -2.68853    -2.01467    -1.34081    -0.66694     0.00692     0.68079   
 
 -5.37003    -4.69617    -4.02230    -3.34844    -2.67458    -2.00071    -1.32685    -0.65298     0.02088     0.69474   
(22,16)                                                                                                                                                             (199,16)
(0,0)                                                                                                                                                                (9,0)
 
ok

To get really extreme corrections I tilted the bed by 6mm.
But a G0 move along the X-axis causes no reactions on the Z-axis
Attachments:
open | download - Configuration.h (48.4 KB)
Re: Z height wrong after z probing
July 31, 2016 12:53PM
But a G0 move along the X-axis causes no reactions on the Z-axis

Did you do a G29 A ? If so, please do a G29 W (What command) so we can see what the system thinks about things. Also, in the G29 W status report, it will tell you the 'Fade Height'. It defaults to 10mm. As the print gets taller and taller, the amount of correction needed (and applied) is less and less. Above the 'Fade Height' there is no correction. You can set the Fade Height higher if it makes it easier to see the correction. But really, the right thing to do (except for the fact you tilted the bed by 6.0mm!!!!!) is to move the nozzle closer to the bed.

You can also try saving the corrected Mesh with a G29 S 1 When you reset the system it should load automatically. It is possible the behavior is not quite the same without saving (and reloading) the Mesh.

Edited 3 time(s). Last edit at 07/31/2016 01:13PM by Roxy.
Re: Z height wrong after z probing
July 31, 2016 03:07PM
You should be able to compile with multiple extruders now. It was a simple #ifdef problem.
Re: Z height wrong after z probing
August 01, 2016 05:15PM
Thanks for the dual extruder fix, it compiles fine.
Now it works for printing.
But i found a Bug, the compensation does not work under several conditions with manual control by LCD
Steps to reproduce:
1. A Z-max endstop setup is used for homing
2. after homing Z=0 should be some mm over the bed.
3. autolevel via G29 P0 T M A
4. activate again with G29 A
5. lower z by the LCD to Z=0 on display
6. the nozzle is now some mm over the bed and the compensation feature does not work for moves along x or y axis using the LCD panel

to get it work:
7. Execute G0 Z1
8. the nozzle is going down, the display shows Z=1
9. Use the lcd to move along x or y axis . These moves are now compensated
Re: Z height wrong after z probing
August 01, 2016 05:25PM
Quote
VBen
But i found a Bug, the compensation does not work under several conditions with manual control by LCD
Steps to reproduce:
1. A Z-max endstop setup is used for homing
2. after homing Z=0 should be some mm over the bed.

Why do you say "after homing Z=0 should be some mm over the bed." ??? In my head it would make sense for Z=0.0 when the tip of then nozzle is just barely touching the glass.
Re: Z height wrong after z probing
August 01, 2016 05:34PM
I'm using different sheets of glass and aluminum as a print surface. They differ in thickness so i used the bed leveling feature to compensate the thickness.
but i think it does not matter where z=0 is after homing, it should be corrected by the bed leveling
Re: Z height wrong after z probing
August 01, 2016 07:03PM
OK. We are in agreement. If you get your Z-Probe working... We can bring up the UBL (Unified Bed Leveling) System.
Re: Z height wrong after z probing
August 02, 2016 04:39PM
My Z-Probe is working and the UBL system works for me too.
Just over the LCD control panel the UBL works not always

Quote
VBen
But i found a Bug, the compensation does not work under several conditions with manual control by LCD
Steps to reproduce:
1. A Z-max endstop setup is used for homing
2. after homing Z=0 should be some mm over the bed.
3. autolevel via G29 P0 T M A
4. activate again with G29 A
5. lower z by the LCD to Z=0 on display
6. the nozzle is now some mm over the bed and the compensation feature does not work for moves along x or y axis using the LCD panel

to get it work:
7. Execute G0 Z1
8. the nozzle is going down, the display shows Z=1
9. Use the lcd to move along x or y axis . These moves are now compensated
Re: Z height wrong after z probing
August 02, 2016 07:48PM
Quote
VBen
My Z-Probe is working and the UBL system works for me too.
Just over the LCD control panel the UBL works not always

Can you explain in more detail what you are seeing? Why do you say "Just over the LCD Control Panel the UBL works not always." ????
Re: Z height wrong after z probing
August 03, 2016 02:14PM
I tested it again but now with enabled debugging output
G29 P 0 T M A
Unified Bed Leveling System activated.

Mesh zeroed.

echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
echo:busy: processing
 raw get_z_correction(23.00,140.00)=0.000000 >>>---> 0.000000
 raw get_z_correction(23.00,20.00)=0.000000 >>>---> 0.000000
 raw get_z_correction(150.00,20.00)=0.000000 >>>---> 0.000000
echo:busy: processing
d from first  point: -5.514165  c: -5.274687
d from second point: -5.514165  c: -5.408281
d from third  point: -5.514165  c: -4.946562

Bed Topography Report:

(0,9)                                                                                                                                                             (9,9)
(22,165)                                                                                                                                                         (199,165)
 -5.25049    -5.17899    -5.10749    -5.03599    -4.96449    -4.89299    -4.82149    -4.74999    -4.67849    -4.60699   
 
 -5.26892    -5.19742    -5.12592    -5.05442    -4.98292    -4.91142    -4.83992    -4.76842    -4.69692    -4.62542   
 
 -5.28735    -5.21585    -5.14435    -5.07285    -5.00135    -4.92985    -4.85835    -4.78685    -4.71535    -4.64385   
 
 -5.30578    -5.23428    -5.16278    -5.09128    -5.01978    -4.94828    -4.87679    -4.80529    -4.73379    -4.66229   
 
 -5.32421    -5.25271    -5.18122    -5.10972    -5.03822    -4.96672    -4.89522    -4.82372    -4.75222    -4.68072   
 
 -5.34265    -5.27115    -5.19965    -5.12815    -5.05665    -4.98515    -4.91365    -4.84215    -4.77065    -4.69915   
 
 -5.36108    -5.28958    -5.21808   [-5.14658]  -5.07508    -5.00358    -4.93208    -4.86058    -4.78908    -4.71758   
 
 -5.37951    -5.30801    -5.23651    -5.16501    -5.09351    -5.02201    -4.95051    -4.87901    -4.80751    -4.73601   
 
 -5.39794    -5.32644    -5.25494    -5.18344    -5.11194    -5.04044    -4.96894    -4.89744    -4.82594    -4.75444   
 
 -5.41637    -5.34487    -5.27337    -5.20187    -5.13037    -5.05887    -4.98737    -4.91587    -4.84437    -4.77287   
(22,16)                                                                                                                                                             (199,16)
(0,0)                                                                                                                                                                (9,0)
 
ok
M111 S128
echogrinning smileyEBUG:ADJUSTMENTS
ok
M114
X:88.50 Y:74.50 Z:15.00 E:0.00 Count X: 7080 Y:5960 Z:38400

ok
G29 A
Unified Bed Leveling System activated.

ok
NOW Moving up and down with the encoder on LCD the nozzle is much higher then 3mm over the bed
 raw get_z_correction(88.50,74.50)=-5.109477 >>>---> 0.000000
buffer_line( 88.50, 74.50, 7.000000) >>>---> [0.000000] (88.50, 74.50, 7.000000)
 raw get_z_correction(88.50,74.50)=-5.109477 >>>---> 0.000000
buffer_line( 88.50, 74.50, 3.000000) >>>---> [0.000000] (88.50, 74.50, 3.000000)
M114
X:88.50 Y:74.50 Z:3.00 E:0.00 Count X: 7080 Y:5960 Z:7680
ok
G0 Z3
Mesh scaling factor set for Z-Height 3.00 to 0.70 [Fade=10.00]
 raw get_z_correction(88.50,74.50)=-5.109477 >>>---> -3.576633
buffer_line( 88.50, 74.50, 3.000000) >>>---> [-3.576633] (88.50, 74.50, -0.576633)
ok
M114
X:88.50 Y:74.50 Z:3.00 E:0.00 Count X: 7080 Y:5960 Z:-1476
ok
NOW after G0 move the height is correct and the level compensation works
for example a move along the X-Axis with the encoder 
 raw get_z_correction(22.00,74.50)=-5.351243 >>>---> -3.745870
buffer_line( 22.00, 74.50, 3.000000) >>>---> [-3.745870] (22.00, 74.50, -0.745870)
 raw get_z_correction(182.00,74.50)=-4.769549 >>>---> -3.338685
buffer_line( 182.00, 74.50, 3.000000) >>>---> [-3.338685] (182.00, 74.50, -0.338685)

Hopefully you can find the bug now
Re: Z height wrong after z probing
August 03, 2016 03:26PM
The Fade_Correction factor is done in the G0 & G1 handler for efficiency. The printer only changes layers occasionally. So it saves a lot of CPU cycles by only doing it there instead of on every move. But there are a few other places where it has to be done also. I must have missed one in the LCD movements.

If you do a G29 P 0 T M A and just use PronterFace to move the nozzle around on the bed, is everything OK? I'm hoping the answer is "Yes!" because it won't be difficult to find the LCD problem.

Edited 1 time(s). Last edit at 08/03/2016 03:27PM by Roxy.
Re: Z height wrong after z probing
August 03, 2016 04:56PM
Quote
Roxy
The Fade_Correction factor is done in the G0 & G1 handler for efficiency. The printer only changes layers occasionally. So it saves a lot of CPU cycles by only doing it there instead of on every move. But there are a few other places where it has to be done also. I must have missed one in the LCD movements.

If you do a G29 P 0 T M A and just use PronterFace to move the nozzle around on the bed, is everything OK? I'm hoping the answer is "Yes!" because it won't be difficult to find the LCD problem.

Sorry but i can't say yes
Pronterface uses the following code to change the position
SENT:  G91
SENT:  G1 Z1.0 F200
SENT:  G90

It seems that the G91 disables the leveling
A normal absolute G0 works fine in pronterface

And i found one line in the code that makes it unable to upload on a genuine Arduino, i already patched it:
--- a/Marlin/Bed_Leveling.h
+++ b/Marlin/Bed_Leveling.h
@@ -169,7 +169,7 @@ enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_AC
 
 #if ENABLED(DEBUG_LEVELING_FEATURE)
         if (DEBUGGING(MESH_ADJUST)) {
-          SERIAL_ECHO("??? Yikes!!!  NAN in get_z_correction( ");
+          SERIAL_ECHO("??? Yikes!!  NAN in get_z_correction( ");
           SERIAL_ECHO(x0);
           SERIAL_ECHO(", ");
           SERIAL_ECHO(y0);
@@ -185,4 +185,4 @@ enum MBLStatus { MBL_STATUS_NONE = 0, MBL_STATUS_HAS_MESH_BIT = 0, MBL_STATUS_AC
 
 #endif  // UNIFIED_BED_LEVELING_FEATURE
 #endif

due to the three "!" in the code they need to be sent to the controller. If the arduino ide send them it will break the communication with the updater.
Re: Z height wrong after z probing
August 03, 2016 08:31PM
OK... I didn't know about the 3 !'s I'll get rid of that. Thanks!

I don't believe a G90 should deactivate the UBL Bed Leveling. Did it come back on after a G91? I did a quick test and it seems to be active in both Absolute and Relative mode.

Try this: Do a G28 and move the nozzle 2 or 3 mm above the bed. (Because if the nozzle is above the Fade Height, you won't see any correction)

Tell PronterFace to move close to the edge of the bed on the X axis. And tell it to go about 1/2 on the Y axis.

Then give the system a G29 A Q 1 M That will insure UBL is turned on and it will load a test pattern for the Mesh. It will be a diagonal line 10mm high going across the bed. A map will print so you can see the pattern.

Tell PronterFace to go up 1mm. That will generate a new fade scaling factor.

Now move from one side of the X axis to the the other side of the bed. You should see the nozzle rise in the middle of the bed. It doesn't matter if you are in Absolute or Relative mode.
Sorry, only registered users may post in this forum.

Click here to login