Notifications
Clear all

Hyperfine bed leveling?  

Stránka 1 / 22
  RSS
christopher.d3
(@christopher-d3)
Estimable Member
Hyperfine bed leveling?

Is there any way to make very fine adjustments to the results of auto bed leveling? I keep winding up with a very slight downward tilt front to back along the Y axis. Mostly this shouldn't be a problem but it can effect how well the first layer sticks with the more finicky filament. Thanks.

Napsal : 07/05/2017 9:56 pm
murloc992
(@murloc992)
Estimable Member
Re: Hyperfine bed leveling?

You will find it under Calibration->Bed Level Correction.

Napsal : 07/05/2017 10:07 pm
christopher.d3
(@christopher-d3)
Estimable Member
Topic starter answered:
Re: Hyperfine bed leveling?

Thanks.

Napsal : 08/05/2017 3:20 am
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

Unfortunately, I recently found that Bed Level Correction (especially when applied using G80 L/R/F/B) does not only adjust the 3 points along the side.

It also adjusts the centre row/column by 50% of the value - each of the 4 corrections adjust 6 points.

This can make bed correction quite difficult - and confusing.

To counter this, I have amended the firmware such that I can adjust each point individually (using G80 A through H) and at last, I now have a bed that I can fully use with perfect first layers across the whole bed.

I now use Live Z Adjust to get the centre point correct and G80 for the 8 perimeter points.

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 08/05/2017 1:49 pm
JeffJordan
(@jeffjordan)
Member Moderator
Re: Hyperfine bed leveling?

...It also adjusts the centre row/column by 50% of the value - each of the 4 corrections adjust 6 points....
that's quite weird. why aren't there 8 "tuning values" that you can enter through a calibration menue (instead of messing around with a G80 gcode) ?

dem inscheniör is' nix zu schwör...

Napsal : 08/05/2017 1:58 pm
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

that's quite weird. why aren't there 8 "tuning values"...

Jeff

I would actually say it's a design fault and not just weird. I have previously suggested that there should be 8 points where calibration can be set; I don't care where they are (menu or G80 - makes little difference).

The big issue here is this scenario:

A user has a "hump" in the very centre of the bed. Live Z Adjust is perfect at the centre point.

Say that in order to remove that "hump" the F/B/L/R settings all have to be set to -100. Within firmware, all 9 points would be adjusted by -200.

If there was a "dip" in the bed - as we have seen many times - adjusting the front and rear by -100 would adjust all 9 points by -100!

In both cased, Live Z Adjust would need to be changed which would result in an identical "hump" or "dip".

Having altered the firmware, my G80 is new set to this:

G80 A-90 B50 C125 D75 E100 F40 G0 H-70

Where A is the home point and the letters run anti-clockwise. Yesterday, after amending the firmware, I printed a 150mm square which was even across the bed with near perfect perimeters and infill.

FWIW, the following code from marlin_main.cpp:

/* for (uint8_t i = 0; i < 4; ++i) {
unsigned char codes[4] = { 'L', 'R', 'F', 'B' };
long correction = 0;
if (code_seen(codes[i]))
correction = code_value_long();
else if (eeprom_bed_correction_valid) {
unsigned char *addr = (i < 2) ?
((i == 0) ? (unsigned char*)EEPROM_BED_CORRECTION_LEFT : (unsigned char*)EEPROM_BED_CORRECTION_RIGHT) :
((i == 2) ? (unsigned char*)EEPROM_BED_CORRECTION_FRONT : (unsigned char*)EEPROM_BED_CORRECTION_REAR);
correction = eeprom_read_int8(addr);
}
if (correction == 0)
continue;
float offset = float(correction) * 0.001f;
if (fabs(offset) > 0.201f) {
SERIAL_ERROR_START;
SERIAL_ECHOPGM("Excessive bed leveling correction: ");
SERIAL_ECHO(offset);
SERIAL_ECHOLNPGM(" microns");
}
else {
switch (i) {
case 0:
for (uint8_t row = 0; row < 3; ++row) {
mbl.z_values[row][1] += 0.5f * offset;
mbl.z_values[row][0] += offset;
}
break;
case 1:
for (uint8_t row = 0; row < 3; ++row) {
mbl.z_values[row][1] += 0.5f * offset;
mbl.z_values[row][2] += offset;
}
break;
case 2:
for (uint8_t col = 0; col < 3; ++col) {
mbl.z_values[1][col] += 0.5f * offset;
mbl.z_values[0][col] += offset;
}
break;
case 3:
for (uint8_t col = 0; col < 3; ++col) {
mbl.z_values[1][col] += 0.5f * offset;
mbl.z_values[2][col] += offset;
}
break;
}
}
}
*/

has been replaced with this:

NOTE: THIS CODE HAS NOW BEEN SUPERSEDED - please read this thread to the end for the latest information

for (uint8_t i = 0; i < 8; ++i) {
unsigned char codes[8] = { 'A', 'B', 'C', 'D' , 'E' , 'F', 'G', 'H'};
long correction = 0;
if (code_seen(codes[i]))
correction = code_value_long();
else
continue;
float offset = float(correction) * 0.001f;
if (fabs(offset) > 0.201f) {
SERIAL_ERROR_START;
SERIAL_ECHOPGM("Excessive bed leveling correction: ");
SERIAL_ECHO(offset);
SERIAL_ECHOLNPGM(" microns");
}
else {
switch (i) {
case 0:
mbl.z_values[0][0] += offset;
break;
case 1:
mbl.z_values[0][1] += offset;
break;
case 2:
mbl.z_values[0][2] += offset;
break;
case 3:
mbl.z_values[1][2] += offset;
break;
case 4:
mbl.z_values[2][2] += offset;
break;
case 5:
mbl.z_values[2][1] += offset;
break;
case 6:
mbl.z_values[2][0] += offset;
break;
case 7:
mbl.z_values[1][0] += offset;
break;
}
}
}

which now ignores the stored values from the menu.

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 08/05/2017 4:16 pm
JeffJordan
(@jeffjordan)
Member Moderator
Re: Hyperfine bed leveling?

wow, pretty cool.

so if you've set up your z-live adjustment level for the middle of the heatbed at - let's say - -325µm, the printer discards the front/left/right/rear settings and uses -415µm for calibration point#1 (=A), -275µm for calibration point#2 (=B) .... -325µm for the middle (calibration point#5), -225µm for calibration point#6 (=E) and so on ?

and if you change the z-live adjustment level to -400µm, will the value for point#1 (=A) be calculated as -310µm then ?
what i mean is: do i need to feed the printer with new A...H values through the G80 command when i change the overall z-live adjustment value ?

... I have previously suggested that there should be 8 points where calibration can be set; I don't care where they are (menu or G80 - makes little difference)....

Peter

do the values remain in the eeprom by default ? or do i have to run that g80 command each time i power up the printer ?

dem inscheniör is' nix zu schwör...

Napsal : 08/05/2017 4:34 pm
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

Jeff

I had a quick look at the G80 code section (Label: case_G80). From what I can tell, F/B/L/R values are cleared when a G80 is issued. Then if any of the F/B/L/R parameter are not present in the G80 line, the values from the menu (stored in E^2) are loaded in place of the omitted parameters:

if (code_seen(codes[i]))
correction = code_value_long();
else if (eeprom_bed_correction_valid) {
unsigned char *addr = (i < 2) ?
((i == 0) ? (unsigned char*)EEPROM_BED_CORRECTION_LEFT : (unsigned char*)EEPROM_BED_CORRECTION_RIGHT) :
((i == 2) ? (unsigned char*)EEPROM_BED_CORRECTION_FRONT : (unsigned char*)EEPROM_BED_CORRECTION_REAR);
[b]correction = eeprom_read_int8(addr);[/b]
}

So whenever a G80 is issued, all points are effectively set to the "Live Z Adjust" value and then further adjusted by G80 parameters or E^2.

Theoretically, once the 8 values have been calculated they should not change when Live Z is changed (when changing nozzle for example). However, printing my 9 calibration squares after a hot end rebuild does not do any harm...

My amendment does not store the 8 values - I would not wish to mess with other stored parameters - so I include it in start GCode; G80 should be run at the start of each print in any event.

The only very minor issue I found was that the interpolation between a couple points is not quite right, but it would be impossible (or extremely unreasonable) to expect that to be the case.

The other thing I changed in the firmware amendment was to increase the maximum correction to be 201 microns (it was 101 microns).

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 08/05/2017 7:10 pm
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

Just a couple of things I should clarify:

The "humps" and "dips" I mentioned in an earlier post are not physical imperfections in the surface of the bed; they are purely to do with the different probe responses at each point. On my printers I have found that the probe is generally less responsive on the same side of both beds.

I should also add that I believe that this "issue" is not a fault in the firmware and that the firmware in this area is operating as it has been designed to operate. The firmware works properly for the vast majority of users; it's just that it didn't with one of my printers so I went looking for a solution which works for me.

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 08/05/2017 7:35 pm
cory.w
(@cory-w)
Estimable Member
Re: Hyperfine bed leveling?

This looks amazing and will help me alot!!!

Can you post a picture of the bed with the labels of each point, just to be sure I know which is which?

Also, what does the G80 code look like that you run at the start of your print?

Would it be possible to change the menu settings to have this feature instead of putting the gcode in everytime? Luckily I have simplify3d to just add this for me, but would be easy to store and modify through the printers menu as needed.

Thanks for this post PJR!

Napsal : 08/05/2017 8:07 pm
JeffJordan
(@jeffjordan)
Member Moderator
Re: Hyperfine bed leveling?

...My amendment does not store the 8 values - I would not wish to mess with other stored parameters - so I include it in start GCode; G80 should be run at the start of each print in any event....
Peter

😕 so you'll always need to feed the printer with an exclusive gcode file, especially adjusted to that machine.

➡ that makes it difficult if you've got more than one printer. i would need to work with two start gcode scripts then (genuine kit & own clone) and can not swap *.gcode files anymore because they will be machine-specific with their G80 values.

🙄 by the way: is there somewhere a layout for the eeprom usage available ? is there still enough space for 8 values ?

dem inscheniör is' nix zu schwör...

Napsal : 08/05/2017 8:46 pm
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

so you'll always need to feed the printer with an exclusive gcode file, especially adjusted to that machine.

is there still enough space for 8 values ?

Jeff

You should have separate profiles in your slicer for each printer you own. There will always be some differences between printers.

Unfortunately, as the values can be both negative and positive and are limited to maximum values of 200, 8 signed short integers (2 bytes each) would be required. I would guess at the moment, the values are stored as 4 signed bytes. There should still be sufficient room within E^2, but personally I would prefer to put this kind of thing in GCode (as I do with PID settings, as that relates more to filament type/temp).

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 09/05/2017 12:02 am
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

Can you post a picture of the bed with the labels of each point, just to be sure I know which is which?

Front Left is A, Front Centre is B, Front Right is C, Middle Right is D, Rear Right is E, Rear Centre is F, Rear Left is G and Middle Left is H.

Also, what does the G80 code look like that you run at the start of your print?

Already posted:

G80 A-90 B50 C125 D75 E100 F40 G0 H-70

Would it be possible to change the menu settings to have this feature instead of putting the gcode in everytime? Luckily I have simplify3d to just add this for me, but would be easy to store and modify through the printers menu as needed.

I guess it would, but see my previous post regarding required storage. I haven't checked it out so only a guess.

There are a few other things I am looking to change in the firmware if they are not amended by the devs, so I may be digging deeper in the near future.

I have now received an Arduino Due, so I will be looking to port the firmware to that MCU in the near future - when time permits...

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 09/05/2017 12:08 am
cory.w
(@cory-w)
Estimable Member
Re: Hyperfine bed leveling?

Sorry I missed the part about the G80 code. Does this need to go before or after a specific point in the starting code?

I plan on flashing this firmware once my current print finishes. Last question though, Do I need to wipe out my current bed level correct settings or reset to zero? From what I understand, your revision overrides those settings whenever the G80 code is used. So in theory, if I forget to use the G80 for some reason, the old values would be in plan, and when I use G80, those values would be in play.

Thank you,
Cory

Napsal : 09/05/2017 12:14 am
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

Cory

You should always include a G80 command in the start GCode section. It is the code which initiates the 9-point calibration before the print.

My amendment totally ignores the mesh level correction values stored in E^2 (via the menu) so any settings there will not be used. There is no need to change those values.

FWIW, I have uploaded my set of 9 calibration squares.

And this is my start GCode:

; Prefix G-Code
T<EXT+0>
M201 X1500 Y1500 E900 ; set default acceleration
M301 P23.14 I1.78 D75.12 ; set PD for extruder heater
M304 P56.09 I2.39 D328.54 ; set PID for bed heater
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
M140 S<BED> ; Heat the bed + 5 degrees for Mk2
M104 S170
M190 S<BED> ; Heat the bed + 5 degrees for Mk2 and wait
M109 S170
G28 W
M104 S<TEMP>
G80 A-90 B50 C125 D75 E100 F40 G0 H-70
M109 S<TEMP>
G92 E0.0

The PID settings are unique to my printer; you possibly will not need the default acceleration line; the values in angle brackets are replaced by the correct values when the GCode is generated and I have omitted the initial purge line.

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 09/05/2017 9:56 am
JeffJordan
(@jeffjordan)
Member Moderator
Re: Hyperfine bed leveling?

Cory

You should always include a G80 command in the start GCode section. It is the code which initiates the 9-point calibration before the print.

My amendment totally ignores the mesh level correction values stored in E^2 (via the menu) so any settings there will not be used. There is no need to change those values.

FWIW, I have uploaded my set of 9 calibration squares.

And this is my start GCode:

; Prefix G-Code
T<EXT+0>
M201 X1500 Y1500 E900 ; set default acceleration
M301 P23.14 I1.78 D75.12 ; set PD for extruder heater
M304 P56.09 I2.39 D328.54 ; set PID for bed heater
G21 ; set units to millimeters
G90 ; use absolute coordinates
M83 ; use relative distances for extrusion
M140 S<BED> ; Heat the bed + 5 degrees for Mk2
M104 S170
M190 S<BED> ; Heat the bed + 5 degrees for Mk2 and wait
M109 S170
G28 W
M104 S<TEMP>
G80 A-90 B50 C125 D75 E100 F40 G0 H-70
M109 S<TEMP>
G92 E0.0

The PID settings are unique to my printer; you possibly will not need the default acceleration line; the values in angle brackets are replaced by the correct values when the GCode is generated and I have omitted the initial purge line.

Peter

correct me if i'm wrong:
so your G80 starts the 9 point calibration sequence, as at every other printer, and adds afterwards the 8 correction levels (given by the parameters A - H) to 8 of the 9 values "measured" during the calibration sequence.
and your meshbed correction values from the calibration menu (for F, R, L, B) are completely ignored.

so in fact the 8 values simply represent the deviation of the calibration point measurement accuracy at the printbed in relation to the fifth calibration point as reference (in the middle of the printbed). while these deviations/inaccuracies are related to imperfections in the properties of the calibration points of the pcb (due to tolerances in the thickness of the base material layers and the thickness and etching precision of the copper layers).

dem inscheniör is' nix zu schwör...

Napsal : 09/05/2017 11:53 am
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

so your G80 starts the 9 point calibration sequence, as at every other printer, and adds afterwards the 8 correction levels (given by the parameters A - H) to 8 of the 9 values "measured" during the calibration sequence.
and your meshbed correction values from the calibration menu (for F, R, L, B) are completely ignored.

The existing G80 command in standard firmware will accept F/B/R/L as parameters with values from -101 to 101 and those currently override the values from E^2 set in the Level Correction menu option (and which are limited to a range of -50 to 50). With my firmware amendment the values stored in E^2 are completely ignored.

so in fact the 8 values simply represent the deviation of the calibration point measurement accuracy at the printbed in relation to the fifth calibration point as reference (in the middle of the printbed). while these deviations/inaccuracies are related to imperfections in the properties of the calibration points of the pcb (due to tolerances in the thickness of the base material layers and the thickness and etching precision of the copper layers).

I print my calibration squares and set Live Z according to the centre point. I then adjust the remaining 8 points using my amended G80 command. Actually I don't quite do that, but it makes explanation simpler. What I actually do is to print the 9 calibration squares, approximate the differences between each outer square and the centre point and insert those approximations into the start GCode. I then make an adjustment to Live Z and adjust the approximations accordingly. Then print the squares again with the new values and repeat the process. The third print of hte sdquares was pretty much perfect.

The variations are as you mention plus any external influences, such as the frame/PSU on the right hand side and the 6 screws holding the bed to the chassis. It is interesting to note that when printing a first layer of 0.2mm at the rear right of the bed and with the extruder moving in the X axis onlyand towards the centre of the bed, the light on the probe is turned off around point 9 for a distance of about 70mm.

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 09/05/2017 3:58 pm
richard.l
(@richard-l)
Member Moderator
Re: Hyperfine bed leveling?

Peter

Which branch of the firmware are you using for your modifications?

Napsal : 09/05/2017 4:06 pm
Per-Anders Karlsson
(@per-anders-karlsson)
Active Member
Re: Hyperfine bed leveling?

This is awesome PJR! i think you're about to save my sanity.

so of to the questions then..
I'm using prusa' version of slic3r and haven't changed the startup gcode.

M115 U3.0.10 ; tell printer latest fw version
M83 ; extruder relative mode
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
G28 W ; home all without mesh bed level
G80 ; mesh bed leveling
G1 Y-3.0 F1000.0 ; go outside pritn area
G1 X60.0 E9.0 F1000.0 ; intro line
G1 X100.0 E12.5 F1000.0 ; intro line

and with your way it should be something like this instead? (A-H values set to zero)

M115 U3.0.10 ; tell printer latest fw version
M83 ; extruder relative mode
M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp
G28 W ; home all without mesh bed level
G80 A0 B0 C0 D0 E0 F0 G0 H0; mesh bed leveling all values set to zero
G1 Y-3.0 F1000.0 ; go outside pritn area
G1 X60.0 E9.0 F1000.0 ; intro line
G1 X100.0 E12.5 F1000.0 ; intro line

so basically I figure i get a propper firsta layger on a 20x20square at the center and then run your stl for all the 9 points. but how should i think while doing so?
and then set the A-H points with the difference between lets say center point 100 and A point 105 which would mean that A=5?

Napsal : 09/05/2017 4:29 pm
PJR
 PJR
(@pjr)
Antient Member Moderator
Re: Hyperfine bed leveling?

Peter

Which branch of the firmware are you using for your modifications?

3.0.11.RC1 (with the multi-filament define uncommented). It should be fine with most recent firmwares.

Peter

Please note: I do not have any affiliation with Prusa Research. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage…

Napsal : 09/05/2017 6:05 pm
Stránka 1 / 22
Share: