Auto Bed vs. Mesh Grid Compensation
-
@martincho said in Auto Bed vs. Mesh Grid Compensation:
It probes the bed at 3 or more pre-defined points (see M557) and updates transformation matrix for bed levelling compensation.
This is the old, deprecated form of leveling. It has been superceded by G29, which is far more flexible. The old way of using G32 as described in your quote was limited in the points it could use and how it could compensate. G29 can use very few or very many points and can interpolate between them.
So for all intents and purposes, G32 is now just a shortcut to run bed.g which is just a macro that can contain whatever you want rather than the fixed function that G32 used to use.
So really the best way to look at it going forward is that G32 calls bed.g and bed.g can contain the procedure you want to use to execute a G29, including automating all the preheating, etc that you do manually.
G29 S1 at the start of a print is the correct place for it at any rate. It would also belong at the end of homeall.g after the Z0 point has been determined by a G30. That's the important thing; the heightmap should only be created or loaded after the Z0 point has been determined with G30, otherwise you can get inconsistent first layer positioning as you found.
See my previous reply to your other thread for other details.
-
@Phaedrux I saw your other response and dug into it, thanks.
I guess I am now wondering if my firmware is out of date? The "Auto Bed Compensation" button --which I thought would probe and then enable compensation-- only seemed to do the first half of that. The only evidence I have in support of this is that it wasn't until I added probing code to the start of every part that my first layer became predictable and reliable.
My problem is solved now. I am only continuing to dig in this discussion for the potential benefit of others who might run into this. This issue cost me weeks of pulling my hair trying to figure out what I was doing wrong.
It would be nice if someone from Duet could answer and explain what the various buttons do in that menu.
-
-
Ah, OK, thanks for that. The button isn't labeled correctly then. Even then, the whole thing is really confusing because it runs "bed.g", which has G29 in it.
Per the documentation on "Auto Bed Compensation" button:
The "Auto Bed Compensation" button on a Cartesian or "Auto Delta Calibration" button runs G32. This has different functions . On a Cartesian/CoreXY/SCARA machine it is used for Bed levelling using multiple independent Z motors.
Yet, if you look at documentation for G32:
The firmware executes macro file bed.g if present instead of using the M557 coordinates.
What does "bed.g" contain?
bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool v2 on Wed Aug 14 2019 16:30:15 GMT-0700 (Pacific Daylight Time) M561 ; clear any bed transform G28 ; home all axes G29 ; probe the bed and enable compensation
So...G32 really runs G29 but it seems it doesn't enable mesh compensation, for that you would need:
G29 S1
I don't know, the feeling I am getting is that the documentation isn't correct somewhere, the "Auto Bed Leveling" button isn't labeled correctly and the documentation sends in into a circular trip devoid of clarity. The fact that I was able to fix a bunch of problems by effectively adding just the "S1" portion to the G29 command tells me this might warrant a look by the Duet guys.
This has caused weeks of consternation on my part. I am sure I'm not the only one who read "Auto Bed Compensation" and thought, well, that's what the button was for. Then, after using it, when the printer has problems, the last thing you think about is bed leveling...because you've already done it, including seeing the nice pop-up graphic showing you the measurements. You look at the documentation and it goes in circles, pretty much confirming that, again, you did the right thing. Until you notice "S1", try it, and all problems go away instantly.
@dc42 a bit of wisdom on this might help. Thanks.
-
Hi,
I am using the most recent Duet WiFi firmware.
For me G29 probes AND enables mesh compensation.
As to the "Auto Bed Compensation" button: Yes it invokes the bed.g file (if it exists) but the contents of that file is up to you. The contents you have listed will do mesh compensation but it can be created using other commands to do other things - like auto bed leveling using multiple Z-axis steppers.
Frederick
-
This confused me at first until I realised there was a difference between "Bed Levelling" and "Mesh Compensation".
Bed Levelling (G32) is to do with physically levelling the bed via the motion of the z-axis steppers. For instance on my D-Bot I have 3 z-axis leadscrews controlled by 3 independent motors (see Bed_levelling_using_multiple_independent_Z_motors).In my bed.g I have:
G28 ; home G30 P0 X10 Y60 Z-99999 ; probe near a leadscrew G30 P1 X290 Y60 Z-99999 ; probe near a leadscrew G30 P2 X150 Y290 Z-99999 S3 ; probe near a leadscrew and calibrate 3 motors ; re-home z axis in case it has shifted G28 Z
When this runs it probes the bed adjacent to each screw and then moves 1 or more z motors to physically level the bed.
There is no reason to use G32 on a Cartesian or core-xy printer unless you have multiple z-axis motors that can physically adjust the bed levelling.
Then there is Mesh Compensation (G29). This is to do with ironing out the imperfections in your (already levelled) bed.
The Z motors will move the bed up & down as the head moves in x & y to simulate a perfectly flat, level bed.I run everything from a single macro rather than call G32 from the drop-down in DWC. It levels the bed using G32 then does a G29 probe in a 3x3 grid.
Calibrate.g
; Warm Hotend and Bed T0 ; Select Tool 0 M104 S130 ; Set Tool 0 temperature to 130 - no wait M190 S60 ; Set Bed temperature to 60 - wait ; Clear Values G29 S2 ; Clear Mesh Compensation Values M290 R0 S0 ; Clear Baby-stepping ; Home all Axes G28 ; Bed levelling (G32) G30 P0 X10 Y50 Z-99999 ; probe near a leadscrew G30 P1 X290 Y48 Z-99999 ; probe near a leadscrew G30 P2 X148 Y284 Z-99999 S3 ; probe near a leadscrew and calibrate 3 motors ; Re-home z axis in case it has shifted G28 Z M557 X25:275 Y25:275 S125:125 ; Define mesh grid (3x3) ; Mesh Compensation (G29) G29 S2 ; Clear Mesh Compensation Values G29 ; Run Mesh Compensation G1 Z30 F310 ; Move bed down G1 X150 Y145 F15600 ; Move to centre
In my slicer startup gcode I have
G29 S1 ; Load Mesh Compensation Settings from file
amongst other things, to reload the Mesh Compensation Height Map created by the G29 in Calibration.g.
This way I only need to run the calibration once at power-on then simply re-home between prints. -
Thanks for the input.
I should clarify that my bed.g file is what was created by configtool.reprapfirmware.org. In other words, it's precisely what someone who goes to use a Duet for the first time on a custom build or retrofit is likely to end-up with.
Now I know better, of course. However, the default bed.g created by this config tool seems to be, if I may be so bold to say, wrong.
I'll bet if you polled 100 people as to what "Auto Bed Leveling" does or means they are likely to describe mesh leveling. I'll also bet that not one of them would conclude that the button does NOT load and activate the mesh leveling function.
Anyhow, I figured this out after weeks of hair pulling. I am only posting this for the benefit of others who might be confused by first layer and other problems thinking they are doing everything correctly when, in reality, that button and the configuration file associated with it are part of the problem.
-
My initial bed.g as downloaded from the configurator contained:
; bed.g ; called to perform automatic bed compensation via G32 ; ; generated by RepRapFirmware Configuration Tool on Thu Dec 28 2017 14:34:20 GMT+0000 (GMT) M561 ; clear any bed transform G28 ; home all axes ; Probe the bed at 4 points G30 P0 X60 Y60 H0 Z-99999 G30 P1 X60 Y220 H0 Z-99999 G30 P2 X240 Y220 H0 Z-99999 G30 P3 X240 Y60 H0 Z-99999 S
At the time I had no idea what it was meant to do.
-
@martincho said in Auto Bed vs. Mesh Grid Compensation:
However, the default bed.g created by this config tool seems to be, if I may be so bold to say, wrong.
While it may be a bit confusing It's not wrong. The bed.g file is used for different things depending on your printer type and hardware.
For a simple Cartesian the created bed.g simply gives you the ability to click the "Auto Bed Compensation" button to do mesh compensation. Mesh compensation is a more advanced approach replacing the older method.
The configurator generates different bed.g depending on settings you enter.
Select a delta printer and it will generate a bed.g file appropriate for a delta printer. Specify a CoreXY printer and you will get yet a different bed.g file - one that is out of date, I think.
I went back and ran the tool again for a Cartesian printer and got that same bed.g - a different one from the first run.
I suspect the tool needs some work.
I never used the configurator tool. The Duet WiFi comes with example config files. I studied those to get an idea of what my config file needed to contain and I created my own. There is knowledge to be gained doing that way.
Glad to hear you finally got it sorted out.
Frederick
-
The default bed.g I got for the cartesian configuration does not enable mesh compensation. It runs everything but the map is never loaded. It's all the theatrics without the final functionality being enabled.
This requires G29 S01, which is not included in the default bed.g.
That was the root of the problem. G29 vs. G29 S01.
BTW, I am not blaming anyone. This is just part of learning. My only input is that someone needs to consider that this might have become quite confusing and convoluted over time.
As an aerospace engineer I don't think I am a dummy, and this had me going around in circles for quite some time because things would look like they worked better at times and then they would inexplicably break. Adding "S01" made the difference between an inconsistent printer and one I don't have to worry about any more. Surely I am not the only one who has fallen into this trap.
-
@martincho said in Auto Bed vs. Mesh Grid Compensation:
The default bed.g I got for the cartesian configuration does not enable mesh compensation. It runs everything but the map is never loaded. It's all the theatrics without the final functionality being enabled.
This requires G29 S01, which is not included in the default bed.g.
That was the root of the problem. G29 vs. G29 S01.
Then how do you explain that on my printer I don't need G29 S1 (I assume you mean S1) to enable mesh compensation.
I can run the mesh bed probing and check if mesh compensation is enable and it is.
Are you using the most recent firmware?
Frederick
-
@fcwilt said in Auto Bed vs. Mesh Grid Compensation:
Then how do you explain that on my printer I don't need G29 S1 (I assume you mean S1) to enable mesh compensation.
I can run the mesh bed probing and check if mesh compensation is enable and it is.
Are you using the most recent firmware?
I can't explain it. That's why I asked @dc42 to chip in if possible. I'll check my firmware tomorrow, long day.
Thanks.
-
@martincho Hello,
Please share your firmware if possible. I am stuck with the same problem. Appreciated in advance.
-
@ex3dp please open a new thread, don't resurrect an old one