Welcome! Log In Create A New Profile

Advanced

Auto bed leveling marlin - Z probe offset does nothing?

Posted by McSquid 
Auto bed leveling marlin - Z probe offset does nothing?
September 23, 2015 03:04PM
Hi all,

I have recently setup my Z probe and got G29 working correctly, It compensates for an unlevel bed (I can see Z changing) however, I cannot seem to get the Z probe offset set correctly. I measured the offset to .5mm by placing the nozzle on the bed and going up in .1mm increments until my sensor turned off,

I then set:
#define Z_PROBE_OFFSET_FROM_EXTRUDER -.5

This had my printer printing slightly too high, so I started changing this. first I tried nudging it .1 in each direction, then I tried everything from 1 to -1 and it seems no matter what this is set to it prints at the same height. It is as if this setting is being ignored completely.

I attempted to check with M501

SENDING:M501
echo:Hardcoded Default Settings Loaded
echoconfused smileyteps per unit:
echo: M92 X80.00 Y80.00 Z400.00 E96.28
echo:Maximum feedrates (mm/s):
echo: M203 X500.00 Y500.00 Z10.00 E25.00
echo:Maximum Acceleration (mm/s2):
echo: M201 X9000 Y9000 Z100 E10000
echo:Acceleration: S=acceleration, T=retract acceleration
echo: M204 S1500.00 T3000.00
echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)
echo: M205 S0.00 T0.00 B20000 X20.00 Z0.40 E5.00
echo:Home offset (mm):
echo: M206 X0.00 Y0.00 Z0.00
echotongue sticking out smileyID settings:
echo: M301 P22.20 I1.08 D114.00

It makes no mention of z offset or zprobe which googling this problem leads me to believe should be there. I have run M502 followed by M500 in hopes of pulling this from firmware to eeprom and nothing changes.

I'm running out of ideas, figured Id post here before wiping my firmware and starting from scratch.

Thanks in advance
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 23, 2015 06:53PM
Check if you've got the eeprom enabled in configuration.h. if so you must use gcode or lcd to change z offset.

Also note that the sensor may have a hysteresis, the trigger depth may be different from the release point, set the z offset with a sheet of normal printer paper after g29.
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 24, 2015 04:08AM
If you´ve used "M851 Z-xx.x" to set the probe offset, you have to send M500 afterwards.
Sending M502 & M500 erases all the settings you´ve done before.
-Olaf
PS I agree with imgqur, it seems you haven´t enabled the eeprom so you´d have to put the M851 line after the G29 line in start code

Edited 1 time(s). Last edit at 09/24/2015 04:10AM by o_lampe.
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 24, 2015 05:34AM
which marlin are you using? i my eeprom was stuck as well in 1.1dev but without it the offset works
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 24, 2015 10:21AM
OK, It is likely that my EEPROM is not enabled as I have never used it for anything before. I had been making all these offset changes in firmware and uploading it each time. I had not even heard of M851 before in all my searches about this topic. Ill enable the EEPROM and try this after work today. Forgive the newbish question, but where in marlin can I find the version number?
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 24, 2015 10:21AM
Always flash "eeprom clear" from arduinoIDE /samples/eeprom folder before flashing firmware with new options.
-Olaf
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 24, 2015 01:01PM
in config.h someone where the top. it also says it in the welcome message
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 27, 2015 01:48AM
You were correct in that the eeprom was not enabled. I have now enabled it. However the z offset is still not present on m501 and setting it with M851 then m500 still does not seem to do anything. if you store a value with m500 will it survive a power cycle? or does that need to be put in gcode after m29 like o lampe said? My LCD says my firmware is 1.0.0 which Is a bit dated I think. Upon looking at the marlin site it seems a release candidate is in testing so Id rather wait to update firmware until that is ready. If I have to disable it until I can update firmware I suppose that would be ok.
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 27, 2015 02:35AM
Eeprom is like flash memory, it indeed does survive a power cycle, if you use the store command. I usually use the lcd menu: control, motion, z offset. It should be there. It will take effect the next time you do g28/g29. Remember to store the settings in the control menu.
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 28, 2015 01:57PM
Thanks so much for the location in the LCD menu. In there I can verify that my Z offset is set. However, when I try to change it It won't go below 0.5. I had recently been trying to make .3 work and now I know why I couldn't get it closer. When I set it with M851 it echoed that the min was -5 and the max was 15, This may have actually said or meant -.5 which is why going lower wasn't working. I'm going to adjust the probe to trigger around .6 or .7 if possible and use the LCD to adjust. I will report back. Thanks for all the help!
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 29, 2015 03:22AM
From what I´ve experienced, the z-probe has to be lower than the nozzle. Mine is -6.5mm , so the M851 echo of "-5 to 15 " is puzzling me...

I had to increase the value to lower the nozzle. Weird reverse logic...

Are you sure, you´ve allowed the nozzle to go below Z=0?
define min_software_endstops  false
-Olaf

Edited 3 time(s). Last edit at 09/29/2015 03:34AM by o_lampe.
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 29, 2015 10:04AM
Hmmmm This may be a good catch. I home Z up and to max and until I got the probe I used software min endstops, I kept this enabled in hopes that if for some reason a print or movement was triggered without M29 or if the probe failed that the software endstop would stop a major crash. My max is set to 3mm more than its actual height in order to allow movement lower than the bed. and the bed is on 5mm springs so it can absorb a 3mm crash. Since this is enabled and when I run G29 it sets the height to 0, my extra 3mm is being thrown out and its not allowed to go below 0. I'm going to disable the software endstop especially since it doesn't seem to work as I intended anyway (if the probe doesn't trigger it still crashes. Probably ignoring the software endstop since auto leveling is probably treated as a form of homing.)
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 29, 2015 03:31PM
SUCCESS! My solutions archived below in 1 post to help others with future troubleshooting
--------------------
Using a combination of the above advice from these great reprappers I now have the Z probe respecting the Z offset value. Here is what I ended up doing:

I left define min_software_endstops on but changed the way I compensated (realizing my previous method was stupid. changes below)
I changed my Z max height to the proper height (Bed = 0)
I changed my Z min height to -3 to allow the printer to go up to 3mm below 0. In theory software endstops + my 5mm bed springs should still prevent a (major) crash from LCD or pronterface controls
I printed a new mount for my sensor that was 1mm closer (so my target offsets were in the 1.2 - 1.7mm range instead of 0.2 - 0.7mm
I enabled the EEPROM as discussed earlier (still necessary to post for archiving solutions)
I used my LCD to set the offset instead of firmware : [control> motion> z offset] followed by [control> Store settings] (though I will still change firmware in future in case EEPROM defaults get loaded for any reason)

For additional clarification since this can be confusing: on the LCD menu a positive number is used for your probe offset. Mine is now 1.2mm. My probe activates 1.2mm before my nozzle hits the bed. Raising this number to 1.5mm will put my nozzle .3mm CLOSER to the bed. [0mm-----------<-Farther away-<--------1mm------------>-Closer-> ----------2mm] (nozzle in relation to bed)

Thanks everyone!

Edited 1 time(s). Last edit at 09/29/2015 03:32PM by McSquid.
Re: Auto bed leveling marlin - Z probe offset does nothing?
September 30, 2015 08:10AM
Thanks for reporting back, having a safety catch is a good thing. I'm glad tohear it works!
Re: Auto bed leveling marlin - Z probe offset does nothing?
February 13, 2016 10:54AM
This thread helped me a lot. Thanks to all involved
Cheers
Re: Auto bed leveling marlin - Z probe offset does nothing?
August 27, 2016 07:05AM
I am having a similar problem with auto bed leveling:

    I measure the Z_PROBE_OFFSET_FROM_EXTRUDER by checking the Z difference between the nozzle touching the bed and probe activation. I move the nozzle and probe to the same position for measuring.
    I enter the offset using M851 Z-3.47 and store it with M500.
    I send command G28.
    After homing I move the nozzle to Z0 and the distance is correct (slight resistance when moving a piece of paper under the nozzle).
    I issue command G29.
    After auto bed leveling when moving the nozzle to Z0 I have an extra gap of 0.7 mm (measured at different locations).

The Z_MIN_POS is -3 so the nozzle can move below Z0.

I checked if the probe activates at the same level by moving it up and down 10 times: it always comes on at exactly the same height.

I am using Marlin 1.1.0-RC7.

Are there other settings than Z_PROBE_OFFSET_FROM_EXTRUDER that affect bed leveling? Or am I doing something wrong?
Re: Auto bed leveling marlin - Z probe offset does nothing?
August 31, 2016 11:38PM
I was and still am confused aswell about this.

I just changed the offset untill it was at the good height
Re: Auto bed leveling marlin - Z probe offset does nothing?
October 28, 2016 06:57AM
I am so stuck on this exact same problem.
For days now I try to fix it. Please tell everyone how you resolved this.
For example, even without using G29, I setup my BLTouch probe perfectly:
G28
G28 Z
G1 Z0
Then I nudge it down until it touches the paper and put the value of the nudges into M851
then G28 Z and it is out by approx 0.3mm again
Repeat the process and often the difference then goes the other way !
And again and again - it almost never comes back to touch the paper. And if it does, then as soon as I reset, there is an error again.
I thnought my probe was loose but I am sure its okay.
And right now, running an M48 STDDEV test on the probe is showing it thinks its 10.000 mm from the bed. Unlikely!
Re: Auto bed leveling marlin - Z probe offset does nothing?
October 28, 2016 07:28AM
ABL does seem to be a bit of a dark art subject
All i can tell you is what works for me
When you issue a G28 command it eradicates any bed level data the system has gained from a G29 bed level command so dont do it !
By all means home X and Y with G28 X0 Y0
but don't home Z AFTER you have done G29

So heres how i do set up
in a terminal ( in pronterface or whatever you are using to control your machine)
Issue G28 command ( this homes everything)
when thats done issue a G92 Z10 ( this fools the system into thinking your Z axis is 10 mm above Z actual home) ( you do this to allow you to move down !!!!)
then issue a M114 which will come back with the current positions of all 3 axis >> Z should now read Z:10.00
then move the Z down by 0.1 increments till the nozzle lightly grips a piece of paper.
With the nozzle lightly gripping the paper issue a M114 command again. This will tell you where the Z is now
For example it may read Z: 9.2
subtract 9.2 from the 10 and you have 0.8 << this is your offset that needs to be stored in firmware ( either reflashed or input with LCD )
In effect you are telling the machine that the printing height is 0.8 mm below the home position

SO in my gcode for every print i have
G28 to home all axis
then G29 to probe the bed
then print

Hope this helps
PS ive never actually used a BL touch but cant see how that would mess things up as ive heard pretty much only good things about them ...Good luck

Edited 2 time(s). Last edit at 10/28/2016 07:31AM by bigfilsing.
Re: Auto bed leveling marlin - Z probe offset does nothing?
October 28, 2016 06:17PM
Thanks bigfilsing for your answer. That all makes perfect sense.I will try your method.
The big 'however' though is that after using a similar method, the results change.
- in theory we are supposed to set the offset using M851 - I assure you I do this correctly, and it will then move to G1 Z0 and the nozzle will touch the bed perfectly.
But then moments later, like after issuing a G28 and starting a print, the nozzle no longer touches the bed, and needs a new offset !
This is all done without issuing G29 - not even trying auto bed levelling.
The BLTouch probe is just being used to determine the height of the bed, and physically the offset to nozzle is not changing.
In the discussion above morningwalk is seeing the same issue as I. Actually he explains it better.
In short the correctly set offset changes as htought the probe is loose, which it is not !
Re: Auto bed leveling marlin - Z probe offset does nothing?
October 28, 2016 09:05PM
Hi bigfilsing
I tried your method - unfortunately the probe 'deploys' so it lifts back up from the bed after it does a Z probe. The usual method is to then send it to G1 Z0, and nudge it until it touches, then read off the offset and set that using M851 Z or using the LCD screen.
Effectively the same thing right? This should be possible independently of what X&Y are doing right? Assuming a G28 removes any offsets applied by auto bed levelling.

Here's what I do step by step:
Setup:
Remove any offsets stored in M206 and M851
G28
G28 Z
G1 Z0
M114
RECEIVED: X:187.00 Y:125.00 Z:0.00 E:0.00
Nudge it down until paper is pressed
M114 shows Z-2.10
Type that in as an offset
M851 Z-2.10
M500
( If I issue a G1 Z0 now, it will move up by 2.1mm, so I assume it needs Z calibration again)
G28 Z ; calibrate the nozzle
G1 Z0 - paper is pressed perfectly !
NOW the problem:
Sometimes if I then issue a G28 followed by G1 Z0 it will be miles off the bed or below it !
EDIT 30 minutes later:
So sure enough, I did one quick test print - it levelled okay, then another.
The second print came down 0.2 mm too low.
M501 reports the offsets are the same as set, (M206 Z is zero, M851 Z is -2.10 )
The probe is still tight and therefore unmoved
There are no global G-code offsets set.
If I am doing this correctly and there are no unknown offsets somewhere, then I can only suspect the BLTouch itself - which is brand new ! (Ive run the M48 routine, all good there )

EDIT2:
I hear you thinking, it must be in his startup scripts - well here they are:
;
M280 P0 S160 ; stops the BLTouch being confused
; start warming bed and nozzle while we do calibration - hopefully so it wont ooze everywhere - implies wait is off elsewhere
G21 ;metric values
G90 ;absolute positioning
M82 ;set extruder to absolute mode
G28; Home Axis
G92 E0 ;zero the extruded length
M117 Cleaning...;Put Cleaning message on screen
G1 Z2 X300 Y10.0 F6000.0 ; go outside print area to wipe and zig zag and prime the nozzle
G1 Z0.2 X300 Y10.0 F6000.0 ; go outside print area
G1 Z0.1 X300 Y5.0 F3000.0 ; go outside print area
G1 Z0.2 X200 Y10.0 F1000.0 ; go outside print area
G1 X150 E15 F500.0 ; intro line - clear the nozzle of air due to ooze
G1 X145 Y5 E11 F500.0 ; zig
G1 X140 Y10 E12 F500.0 ; zag
G1 X135 Y5 E13 F500.0 ; zig
G1 X130 Y10 F500 ; end of zig
G92 E0 ;zero the extruded length
G1 E-2 F500 ; neg extrude to stop ooze
G1 X130 Y10 Z3 F500 ; raise nozzle
G1 X130 Y30 Z10 F4000 ; move away from the mess quickly

M117 Printing...;Put printing message on LCD screen

And My end script:
G1 E-2 ; pull off some of the pressure so it doesnt ooze
M104 S0 ;extruder heater off
M140 S0 ;bed heater off
G91 ;relative positioning
M106 S255 ;fan at 100% to cool nozzle
G90 ;absolute positioning
G28 X0 Y250 ;home X and Y
G1 Y200 ;move bed forward
G4 P12000 ;wait 2 minutes (120 seconds) -sd 12 secs
M106 S0 ;fan off
M84 ;steppers off
;M140 S90 ; only for TPEheat the bed up to release

Edited 2 time(s). Last edit at 10/28/2016 09:34PM by SimonSolar2C.
Re: Auto bed leveling marlin - Z probe offset does nothing?
October 29, 2016 01:33AM
Those are some quite elaborate start and ends scripts
That shouldn't make any difference However in your start script you have a G28 !!!! and this in effect throws any bed leveling data out of the window and just uses the X Y Z home positions and whatever offsets you have programmed.

Like i mentioned i don't have any experience with the BL touch but what you are saying does seem to indicate its not giving reliable repeatable position info

My simple start scripts ( on both my Ramps (Prusa Air2 w/ capacitive sensor) and Duet wifi (i3 steel w mini IR sensor ) ) read
G28
G29

I use a simple offset skirt to prime the nozzle

I am a bit confused by you issuing G1 Z0 commands and you being surprised by it going up 2.1 . Z home ( when your probe triggers) is Z0 Your printing height is Z0 and whatever offset you have programmed. When you calibrated you found that the printing height was 2.1 mm ( BTW thats quite a lot) below where the probe triggered. So if your nozzle is at printing height and you issue G1 Z0 it should go up by 2.1mm

I think the next step would be somehow to figure out if indeed your probe is faulty !!! If it is all the calibration in the world wont help im afraid.
Good luck

Edited 1 time(s). Last edit at 10/29/2016 01:34AM by bigfilsing.
Re: Auto bed leveling marlin - Z probe offset does nothing?
November 05, 2016 05:53PM
Quote
McSquid
SUCCESS! My solutions archived below in 1 post to help others with future troubleshooting
--------------------
Using a combination of the above advice from these great reprappers I now have the Z probe respecting the Z offset value. Here is what I ended up doing:

I left define min_software_endstops on but changed the way I compensated (realizing my previous method was stupid. changes below)
I changed my Z max height to the proper height (Bed = 0)
I changed my Z min height to -3 to allow the printer to go up to 3mm below 0. In theory software endstops + my 5mm bed springs should still prevent a (major) crash from LCD or pronterface controls
I printed a new mount for my sensor that was 1mm closer (so my target offsets were in the 1.2 - 1.7mm range instead of 0.2 - 0.7mm
I enabled the EEPROM as discussed earlier (still necessary to post for archiving solutions)
I used my LCD to set the offset instead of firmware : [control> motion> z offset] followed by [control> Store settings] (though I will still change firmware in future in case EEPROM defaults get loaded for any reason)

For additional clarification since this can be confusing: on the LCD menu a positive number is used for your probe offset. Mine is now 1.2mm. My probe activates 1.2mm before my nozzle hits the bed. Raising this number to 1.5mm will put my nozzle .3mm CLOSER to the bed. [0mm-----------<-Farther away-<--------1mm------------>-Closer-> ----------2mm] (nozzle in relation to bed)

Thanks everyone!

Hi,
I hive tried your solution in order to solve my issue with the z-offset height without any success.
What sensor are you using and could please share ur configuration other than the z_min_pos?
Re: Auto bed leveling marlin - Z probe offset does nothing?
November 08, 2016 01:34PM
Hi Zuru
what sensor do you have ??
if you are using a capacitive or inductive sensor you need to install a voltage divider.
If you hold a metal object close to your sensor does it trigger ???

IF you tell your machine to home Z what does it do ??
Re: Auto bed leveling marlin - Z probe offset does nothing?
November 08, 2016 03:53PM
Hi,

I use a PNP inductive proximity sensor switch (LJ12A3-4-Z/BY) with a voltage divider.
So far I have managed to to obtain the Z-probe offset from the extruder and new problem I have is that the correction matrix data isn't used to correct the bed while printing.

Edited 1 time(s). Last edit at 11/08/2016 04:04PM by zuru1.
Re: Auto bed leveling marlin - Z probe offset does nothing?
November 27, 2016 01:30PM
I have the same problem with a bltouch, Z offset is not working, changing from the lcd or in the firmware does nothing.
ABL is working as i can see z moving when moving x/y . Its just initial printing height is not affected by zoffset.
Re: Auto bed leveling marlin - Z probe offset does nothing?
November 27, 2016 04:04PM
So digging in the code ( I'm using Marlin RC7 ) trying to find the root of the problem, I found this line in marlin_main.cpp:


planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder);


I changed it to :

planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS] - zprobe_zoffset, destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder);


And now the z offset is respected...



A bug in Marlin? Misconfiguration in my config? Dont know.
Anyway this "bruteforce" resolves it.
Re: Auto bed leveling marlin - Z probe offset does nothing?
November 28, 2016 02:17PM
Quote
cederron
So digging in the code ( I'm using Marlin RC7 ) trying to find the root of the problem, I found this line in marlin_main.cpp:


planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder);


I changed it to :

planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS] - zprobe_zoffset, destination[E_AXIS], MMM_TO_MMS(fr_mm_m), active_extruder);


And now the z offset is respected...



A bug in Marlin? Misconfiguration in my config? Dont know.
Anyway this "bruteforce" resolves it.


Hi
Great info find.

Have you tried RCBugFix version?
I could not find the exact line but something similar will try it out.
Did you disable the #define min_software_endstops ?

Edited 2 time(s). Last edit at 11/28/2016 04:50PM by zuru1.
Sorry, only registered users may post in this forum.

Click here to login