Welcome! Log In Create A New Profile

Advanced

Auto bed leveling/trimming z-offset

Posted by zuru1 
Auto bed leveling/trimming z-offset
November 04, 2016 08:37PM
Hello fellow DIY,

After a couple of weeks with my prusa i3 rework, I decided to add auto bed leveling/trimming on my printer using a PNP inductive proximity sensor switch (LJ12A3-4-Z/BY).
At the moment I have managed to get the initial set up, were to probe, how far and replaced my normal z endstop switch. The problem is now fixing the z-offset which I have been unable solve for the last few days.

Things I have tried:
- Toms guide on youtube, no change the issue still resides
- Setting the Z_MIN_POS to -3mm in order to give the printer/nozzle more headroom when trying to adjust the z-offset, same here no change
- And a lot of google searching for a solution with no success

According to the firmware or LCD, the nozzle is at 1mm above when all four corners are have been probed but in reality it's more than 1mm above the bed, more like 1.5-3mm, see attachments.

Hardware/Firmware
- Merlin 1.1.0-RC7
- RAMPS 1.4

Any help or idea to solve my issue is greatly appreciated.

Thanks in advance and have a great weekend.

Edit:

Does the bed need to have equal height from the y carriage in the initial setup?
Also does the z axis need to be leveled?

Just checking to see if my starting point isn't off.

Edited 1 time(s). Last edit at 11/05/2016 10:23AM by zuru1.
Attachments:
open | download - sensor_1.jpg (465 KB)
open | download - sensor_2.jpg (611.8 KB)
open | download - Configuration.h (53.6 KB)
Re: Auto bed leveling/trimming z-offset
November 05, 2016 05:22PM
Any suggestion?
Re: Auto bed leveling/trimming z-offset
November 05, 2016 06:36PM
Not 100% sure , but looking at your config, this jumps out at me

#define Z_PROBE_OFFSET_FROM_EXTRUDER 0 // Z offset: -below +above [the nozzle]

looks like you have no z offset
measure distance from bed to nozzle and replace the 0 in above line.


ps. i am just in the process of setting up my z probe so i may be wrong about this.
Re: Auto bed leveling/trimming z-offset
November 05, 2016 07:29PM
Hi,

I'm unable to measure the distance between the nozzle and bed due since I can't bring the nozzle close to the bed.
I did even manually bring the nozzle close to be and measured the distance until the probe went off and set that value as the z-offset, that didn't either fix the issue.
After G29 and printer is ready to start the z-axis motors just shake and aren't lowered, they simply stay at the same point.
Re: Auto bed leveling/trimming z-offset
November 06, 2016 10:00PM
Quote
zuru1
Hi,

I'm unable to measure the distance between the nozzle and bed due since I can't bring the nozzle close to the bed.
I did even manually bring the nozzle close to be and measured the distance until the probe went off and set that value as the z-offset, that didn't either fix the issue.
After G29 and printer is ready to start the z-axis motors just shake and aren't lowered, they simply stay at the same point.

This is from SkyNet firmware for Anet A8:

we will now set up the offset because once the printer homes to z - the nozzle wont be close enough to the bed! 
i use cura 15.06.4 for this.

1.so install that. go to preferences and set print window to pronterface ui
	set up your machine settings and make sure the com port and baudrate match your printer
2.load up any stl model and hit print... we wont actually be printing right now so dont worry too much here about the settings
3.manually control with the buttons in the print window so that the nozzle is just touching the build plate
4. adjust your sensor so that it is about 1mm above the build surface when the nozzle just touches
5. raise z by 10 (tool up button) 
6.press the white 'home' button
7. slide a piece of paper underneath you nozzle
8. type G92 Z10 and hit enter- to check this command has worked type M114 and you should get a line similar to  this with Z:10.000

 	(X:131.00 Y:153.00 Z:10.00 E:0.00 Count X: 131.00 Y:153.00 Z:10.00)

9. lower the nozzle using the 0.1down button until theres a little bit of friction on the paper (like you would if your were leveling normally)
10. type M114 and you should get a line like this where z is lower than 10.000

	(X:131.00 Y:153.00 Z:8.90 E:0.00 Count X: 131.00 Y:153.00 Z:8.90)
	
you see mine is  "Z:8.90"

11. get your scientific calculator out and punch in the numbers 10-Z (z being the number you just got from lowering the nozzle) 
12. that is your offset... or damn near close.. you can adjust it finer by playing about .. but thats pretty much it...

mine was 1.1.. add a minus and a couple of m's and you get -1.1mm << that is your offset for the next part
-------------------------------------------------------------------------------------------------------------------------------------------------------------
now we will reconfigure the firmware to have the correct offset value

1. open arduino
2. click File -Open - and navigate to the SkyNet3D_V1.1alfa folder and open SkyNet3D_V1.1alfa.ino
3. go to the 'configuration.h' tab 
4. hit ctrl+f and copy this line below into find

#define Z_PROBE_OFFSET_FROM_EXTRUDER 		0//-12.35

5.change the 'zero' so it reads your offset figure (-1.1mm)

#define Z_PROBE_OFFSET_FROM_EXTRUDER 		-1.1//-12.35
	
6.click upload and wait..
7. when your printer reads SkyNet3D on the screen your done and it is installed...again.. only with the offset being correct this time smiling smiley

-------------------------------------------------------------------------------------------------------------------------------------------------------------

now just add a G29 after the G28 in your start g-code and fannys your aunt..

take a break .. roll a phat one--oops  make a cup of tea and pat yourself on the back..

enjoy 9 point autoleveling and marlin on the anet a8 
Re: Auto bed leveling/trimming z-offset
November 07, 2016 04:27PM
Hi,

I tried out you solution which gave me the same results I got after upgrading the firmware from 1.1.0-RC7 to 1.0.2-2.
I'm able to lower the nozzle so that I can calculate the z offset from the bed to the nozzle and so far so good.
But a new problem arose, when I do G29 I get the following result from the probing operation

Bed x: 0.00 y: 0.00 z: 2.51
Bed x: 155.00 y: 0.00 z: 1.81
Bed x: 155.00 y: 180.00 z: 2.10
Bed x: 0.00 y: 180.00 z: 2.28
Eqn coefficients: a: -0.00 b: 0.00 d: 2.38
planeNormal x: 0.00 y: -0.00 z: 1.00
echo:endstops hit:  Z:2.28

and now the printer knows where to make adjustments one would think. But this isn't applied since my test prints don't have straight lines
and the first layer is an even. Its like in some areas of the layer to print is being printed in mid air. The funny part is that I can see the z-motors moving with small steps while X/Y is moving but the printed object tells another story.

Any idea why the G29 data isn't used?
Re: Auto bed leveling/trimming z-offset
November 08, 2016 04:35AM
You can edit Z offset on the fly with M851 command, in the format M851 Z-0.1 for example to make nozzle go 0.1mm BELOW z probe endstop. Then after M851 you have to do M500 to save to eeprom, if you use eeprom.
Z offset you can get by homing Z, and then G92 Z10 (make Z think its at Z10), then slowly move down 0.1mm and use paper or something to measure Z offset. You can read Z value with M114. So 10-X+0.1 is your new Z offset.
I recommend doing it with bed and nozzle heated since distance can change when its cold and hot..
Re: Auto bed leveling/trimming z-offset
November 08, 2016 03:54PM
Quote
poco3dprinting
You can edit Z offset on the fly with M851 command, in the format M851 Z-0.1 for example to make nozzle go 0.1mm BELOW z probe endstop. Then after M851 you have to do M500 to save to eeprom, if you use eeprom.
Z offset you can get by homing Z, and then G92 Z10 (make Z think its at Z10), then slowly move down 0.1mm and use paper or something to measure Z offset. You can read Z value with M114. So 10-X+0.1 is your new Z offset.
I recommend doing it with bed and nozzle heated since distance can change when its cold and hot..

Hi,

Thank you for the tips, will try them out as soon as I can and let you know.

Edited 1 time(s). Last edit at 11/08/2016 04:04PM by zuru1.
Re: Auto bed leveling/trimming z-offset
November 13, 2016 04:28PM
Hi,

Been at it and now able to obtain the z probe offset but unable to complete my tests since I'm waiting for some replacement parts.
My nozzle snapped into half while remounting it into the heater block and haven't received my replacement heater block.

What I have done is that I now have a fixed heat bed which was the biggest contributor to be able to get the z-offset value.
After that and recalibrating the z-axis I could start testing the auto bed level feature.
Other than that I haven't done anything more than what is suggested or listed in the thread.

Will post an update as soon as the printer is up and running.

Q: Is there a simple way to verify that the auto bed leveling feature is functioning as intended other than doing some random prints?
Re: Auto bed leveling/trimming z-offset
November 20, 2016 07:58PM
Update:

Got my replacement parts and assembled my extruder so that I could continue with the testing process.
I decided to use this as test print in order to verify bed level feature.
So far I haven't succeeded in making this work, get a levelled bed. Part of the bed is ok but not the other part.
I have tried to use two different points in order to get the z probe offset, the bed centre and the start of the bed (0,0) which differ 0.1mm.
Both yield same result.

Here are G29 data results run after each other with a -1mm z prob offset from the nozzle
SENDING:G29
Bed x: 0.00 y: 0.00 z: -0.96
Bed x: 155.00 y: 0.00 z: -0.83
Bed x: 155.00 y: 180.00 z: -0.60
Bed x: 0.00 y: 180.00 z: -0.89
Eqn coefficients: a: 0.00 b: 0.00 d: -1.00
planeNormal x: -0.00 y: -0.00 z: 1.00
echo:endstops hit: X:0.01 Y:179.99 Z:-0.89
SENDING:G29
Bed x: 0.00 y: 0.00 z: 1.00
Bed x: 155.00 y: 0.00 z: 1.16
Bed x: 155.00 y: 180.00 z: 1.38
Bed x: 0.00 y: 180.00 z: 1.09
Eqn coefficients: a: 0.00 b: 0.00 d: 0.97
planeNormal x: -0.00 y: -0.00 z: 1.00
echo:endstops hit: X:0.01 Y:179.96 Z:1.09
SENDING:G29
Bed x: 0.00 y: 0.00 z: 1.08
Bed x: 155.00 y: 0.00 z: 1.22
Bed x: 155.00 y: 180.00 z: 1.45
Bed x: 0.00 y: 180.00 z: 1.16
Eqn coefficients: a: 0.00 b: 0.00 d: 1.05
planeNormal x: -0.00 y: -0.00 z: 1.00
echo:endstops hit: Y:179.99 Z:1.16

Any ideas on how to solve this?
Seems like the data obtained by G29 isn't used at all even if I can clearly see the Z axis move while printing.

Edited 1 time(s). Last edit at 11/20/2016 08:09PM by zuru1.
Re: Auto bed leveling/trimming z-offset
November 21, 2016 09:08AM
can you post the 1st 20 lines or so of your gcode that your trying to print
Re: Auto bed leveling/trimming z-offset
November 21, 2016 12:04PM
Here they are:

M107
M190 S60 ; set bed temperature
M104 S215 ; set temperature
G28                   ;Home all axises
M117 Homing all axises
G29                   ;Level bed
M117 Auto bed leveling
G1 Z5 F5000    ;Lift nozzle
G92 E0             ;zero the extruded length
G1 F200 E3      ;extrude 3mm of feed stock
G92 E0             ;zero the extruded length again
G1 F9000
M117 Printing...
M109 S215 ; wait for temperature to be reached
G21 ; set units to millimeters
G90 ; use absolute coordinates
M82 ; use absolute distances for extrusion
G92 E0
G1 E-1.00000 F2400.00000
G92 E0
G1 Z0.250 F7800.000

Edited 1 time(s). Last edit at 11/21/2016 03:49PM by zuru1.
Re: Auto bed leveling/trimming z-offset
November 27, 2016 06:55AM
How i calibrated my offset was, in repetier host
send G28 ; to home all axis
send G29 ; bed levelling
send G1 Z0 ;bring nozzle down to 0

measure (guess) distance from bed to nozzle
in repetier host/config/firmware eeprom config enter the above Z offset distance ( or you could use M851 Z0.8 (my offset is +0.8 which gives paper thickness from bed))
Re: Auto bed leveling/trimming z-offset
November 27, 2016 07:22AM
Quote
obewan
How i calibrated my offset was, in repetier host
send G28 ; to home all axis
send G29 ; bed levelling
send G1 Z0 ;bring nozzle down to 0

measure (guess) distance from bed to nozzle
in repetier host/config/firmware eeprom config enter the above Z offset distance ( or you could use M851 Z0.8 (my offset is +0.8 which gives paper thickness from bed))

Hi,

I use marlin firmware.
So getting the offset was setting z to 10mm using G92 and gradually decreasing it with 0.1mm until the nozzle meets the paper in order to obtain the offset.
The problem I have is that the adjustment data from G29 isn't used while printing.

I suspect you are on repetier firmware. Is it easy to configure compared to marlin?
I could give it a try and see if that solves my issue.
How does one configure auto bed leveling with an inductive sensor in repetier before z offset is to be calculated?

Edited 1 time(s). Last edit at 11/27/2016 07:23AM by zuru1.
Re: Auto bed leveling/trimming z-offset
November 27, 2016 10:41AM
I use marlin firmware but i use repetier host to slice and control my prints.
If you are entering the offset into your configuration.h file and you have eeprom enabled, you will need to update the eeprom data or it will override
what you have set in the config.h
You can either clear the eeprom via arduino befor you upload the new marlin, or as i do, edit the eeprom direct from repetier host progra
Re: Auto bed leveling/trimming z-offset
November 27, 2016 12:33PM
Quote
obewan
I use marlin firmware but i use repetier host to slice and control my prints.
If you are entering the offset into your configuration.h file and you have eeprom enabled, you will need to update the eeprom data or it will override
what you have set in the config.h
You can either clear the eeprom via arduino befor you upload the new marlin, or as i do, edit the eeprom direct from repetier host progra

I didn't know that you could use repetition to edit the eeprom.
I managed to get the z offset, the problem I have is that the G29 data isn't use while printing an object.

Q: if your grid/rectangle used to calculate the correction matrix is less than the actual print area
(my x axis on the grid is 21mm shorter than the x max length),
does this mean that the correction matrix will be only applied on the grid area and not hole print area?
Sorry, only registered users may post in this forum.

Click here to login