Welcome! Log In Create A New Profile

Advanced

Marlin and auto bed leveling

Posted by antoinev 
Marlin and auto bed leveling
November 25, 2014 12:22PM
Hello All,
I have been running a mendelmax for nearly 2 years. It works quite well but I decided to add the bed auto level capability from marlin firmware.
I am facing a little issue, the print start at the Z height that was probe by the probe without taking into account the offset

Probing take place in 9 points
Bed x: 50.00 y: 40.00 z: 0.01
Bed x: 75.00 y: 40.00 z: 0.10
Bed x: 100.00 y: 40.00 z: 0.11
Bed x: 100.00 y: 95.00 z: 0.11
Bed x: 75.00 y: 95.00 z: 0.06
Bed x: 50.00 y: 95.00 z: -0.04
Bed x: 50.00 y: 150.00 z: -0.03
Bed x: 75.00 y: 150.00 z: 0.02
Bed x: 100.00 y: 150.00 z: 0.04
Eqn coefficients: a: 0.00 b: -0.00 d: -0.06
planeNormal x: -0.00 y: 0.00 z: 1.00

Great it is not perfectly level, so I will benefit from this capability!
MY settings
// these are the offsets to the probe relative to the extrudertip (Hotend - Probe)
#define X_PROBE_OFFSET_FROM_EXTRUDER -9
#define Y_PROBE_OFFSET_FROM_EXTRUDER -40
#define Z_PROBE_OFFSET_FROM_EXTRUDER -7.40

#define Z_RAISE_BEFORE_HOMING 8 // (in mm) Raise Z before
homing (G28) for Probe Clearance.
// Be sure you have this
distance over your Z_MAX_POS in case

#define XY_TRAVEL_SPEED 3000 // X and Y axis travel
speed between probes, in mm/min

#define Z_RAISE_BEFORE_PROBING 8 //How much the extruder will
be raised before traveling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 2 //How much the extruder will
be raised when traveling from between next probing points


//If defined, the Probe servo will be turned on only during
movement and then turned off to avoid jerk
//The value is the delay to turn the servo off after powered on
- depends on the servo speed; 300ms is good value, but you can try
lower it.
// You MUST HAVE the SERVO_ENDSTOPS defined to use here a value
higher than zero otherwise your code will not compile.

#define PROBE_SERVO_DEACTIVATION_DELAY 500

My startup GCODE looks as follow
M190 S;
G21 ; set units to millimeters
M107;
G28 X0 Y0 ;home X and Y
G29 ;probe bed
G90; set absolute coordinates
G92 E0; reset extruder distance
G1 X0 Y0 F3000 ; move to back right corner
M82 ; use absolute distances for extrusion
M109 S;
G92 E0 ;reset extruder
G1 E0.5 ;Prime extruder 5mm
G92 E0 ;reset extruder



I uploaded the firmware on my existing ramps, did I miss doing anything?

Please note I plan to redesign the probe as I would like to have a smaller offset in Y and Z. But I need a printer that work for this :-)

Antoine
Re: Marlin and auto bed leveling
November 25, 2014 01:34PM
Looks ok for me. What is your question?

Additional: I saw your numbers. Do you have 4 screws for your bed? The problem with autobed-tramming, z-probing, autobedleveling, is, that it can handle inclined planes, but not twisted planes. Reduce your bed to 3 screws. This could help.

Edited 1 time(s). Last edit at 11/25/2014 01:34PM by Wurstnase.


Triffid Hunter's Calibration Guide --> X <-- Drill for new Monitor Most important Gcode.
Re: Marlin and auto bed leveling
November 25, 2014 02:02PM
Hello,
MY question
My print starts without taking into account the Z offset. So it doesn't work. I can't find why.
This means that it prints at 7.40 from the bed, so this doesn't work.

Changing it to 3 points will require a complete bed redesign as it is attached in all 4 corners.

Antoine

Edited 1 time(s). Last edit at 11/25/2014 02:09PM by antoinev.
Re: Marlin and auto bed leveling
November 25, 2014 03:37PM
When I'm correct you need first a G28 Z0 before a G29.
I make the G28 Z0 in the middle of the bed.
When you can't get one screw away you should try to reduce the bending.

What I've done:

Go to one edge or close to one. Make a G30.
Do this with all 4 corners.
Then try to level your bed, so all corners are close the same AND the middle of your bed should close to that also.
Then your bed is perfectly leveled and you reduce also the bending, which can't compensate by autobedleveling.

Edited 1 time(s). Last edit at 11/25/2014 03:38PM by Wurstnase.


Triffid Hunter's Calibration Guide --> X <-- Drill for new Monitor Most important Gcode.
Re: Marlin and auto bed leveling
November 26, 2014 03:48AM
Hello,
That works!
The issue was related to the fact the Z_PROBE_OFFSET_FROM_EXTRUDER is stored in the EEPROM. I kept uploading the firmware but totally missed reloading the data from firmware in EEPROM.
that works very well.
I'll work on probe precision and bed setup next.

Antoine
Re: Marlin and auto bed leveling
November 26, 2014 12:08PM
Oh yes. I forgot that the eeprom is always a bi$ winking smiley
I had the same 'issue'.


Triffid Hunter's Calibration Guide --> X <-- Drill for new Monitor Most important Gcode.
Re: Marlin and auto bed leveling
November 26, 2014 02:18PM
So it works, it is nice, but I am not super convinced. It is working a tad better, I love it but I could have live without it.

I made 4 probing (with G29) and this is inconsistent.
Can this be related to the microswitch endstop I use?


18:39:05.979 : Bed x: 50.00 y: 40.00 z: -0.18
18:39:10.005 : Bed x: 75.00 y: 40.00 z: -0.13
18:39:14.007 : Bed x: 100.00 y: 40.00 z: -0.07
18:39:18.636 : Bed x: 100.00 y: 95.00 z: -0.11
18:39:22.675 : Bed x: 75.00 y: 95.00 z: -0.14
18:39:26.726 : Bed x: 50.00 y: 95.00 z: -0.22
18:39:31.354 : Bed x: 50.00 y: 150.00 z: -0.26
18:39:35.406 : Bed x: 75.00 y: 150.00 z: -0.25
18:39:39.433 : Bed x: 100.00 y: 150.00 z: -0.20
18:39:39.445 : Eqn coefficients: a: 0.00 b: -0.00 d: -0.21
18:39:39.445 : planeNormal x: -0.00 y: 0.00 z: 1.00

18:39:54.314 : Bed x: 50.00 y: 40.00 z: 0.04
18:39:58.300 : Bed x: 75.00 y: 40.00 z: 0.12
18:40:02.314 : Bed x: 100.00 y: 40.00 z: 0.14
18:40:06.950 : Bed x: 100.00 y: 95.00 z: 0.09
18:40:11.010 : Bed x: 75.00 y: 95.00 z: 0.02
18:40:15.049 : Bed x: 50.00 y: 95.00 z: 0.00
18:40:19.694 : Bed x: 50.00 y: 150.00 z: -0.06
18:40:23.638 : Bed x: 75.00 y: 150.00 z: 0.03
18:40:27.686 : Bed x: 100.00 y: 150.00 z: 0.02
18:40:27.694 : Eqn coefficients: a: 0.00 b: -0.00 d: 0.01
18:40:27.698 : planeNormal x: -0.00 y: 0.00 z: 1.00

18:40:42.611 : Bed x: 50.00 y: 40.00 z: 0.04
18:40:46.590 : Bed x: 75.00 y: 40.00 z: 0.12
18:40:50.591 : Bed x: 100.00 y: 40.00 z: 0.15
18:40:55.216 : Bed x: 100.00 y: 95.00 z: 0.10
18:40:59.242 : Bed x: 75.00 y: 95.00 z: 0.06
18:41:03.282 : Bed x: 50.00 y: 95.00 z: 0.01
18:41:07.902 : Bed x: 50.00 y: 150.00 z: -0.03
18:41:11.912 : Bed x: 75.00 y: 150.00 z: 0.02
18:41:15.852 : Bed x: 100.00 y: 150.00 z: 0.05
18:41:15.865 : Eqn coefficients: a: 0.00 b: -0.00 d: 0.00
18:41:15.865 : planeNormal x: -0.00 y: 0.00 z: 1.00

18:41:30.762 : Bed x: 50.00 y: 40.00 z: 0.01
18:41:34.744 : Bed x: 75.00 y: 40.00 z: 0.10
18:41:38.759 : Bed x: 100.00 y: 40.00 z: 0.12
18:41:43.424 : Bed x: 100.00 y: 95.00 z: 0.05
18:41:47.479 : Bed x: 75.00 y: 95.00 z: 0.03
18:41:51.501 : Bed x: 50.00 y: 95.00 z: -0.01
18:41:56.127 : Bed x: 50.00 y: 150.00 z: -0.06
18:42:00.128 : Bed x: 75.00 y: 150.00 z: -0.00
18:42:04.139 : Bed x: 100.00 y: 150.00 z: 0.02
18:42:04.151 : Eqn coefficients: a: 0.00 b: -0.00 d: -0.02
18:42:04.151 : planeNormal x: -0.00 y: 0.00 z: 1.00
Re: Marlin and auto bed leveling
November 26, 2014 02:43PM
Just reading that again, I thought I was crazy.
I took excel and put all measure in a table, and I am fairly surprised.
You can see the standard deviation on 4 measure is roughly of 0.016mm. Looking at microswitch characteristic, I can't find any with such a precision in data sheet with a price below 1$ (I bought 10 for 5$).....
The bed is showing to be aligned with a standard deviation of 0.06mm. If I plot those, I can see the calculation are all in the same 0.005mm. I simply don't own a caliper that can be so precise....


X Y measure 1 measure 2 measure 3 measure 4 stdev without first
50 40 -0,18 0,04 0,04 0,01 0,017320508
75 40 -0,13 0,12 0,12 0,1 0,011547005
100 40 -0,07 0,14 0,15 0,12 0,015275252
100 95 -0,11 0,09 0,1 0,05 0,026457513
75 95 -0,22 0,02 0,06 0,03 0,02081666
50 95 -0,26 0 0,01 -0,01 0,01
50 150 -0,25 -0,06 -0,03 -0,06 0,017320508
75 150 -0,25 0,03 0,02 0 0,015275252
100 150 -0,2 0,02 0,05 0,02 0,017320508
stdev 0,068394282 0,062472216 0,056960025 0,055327309
Sorry, only registered users may post in this forum.

Click here to login