MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.35k stars 19.26k forks source link

[FR] G33 with 3 significant figures and multiple iterations for delta calibration #26629

Closed rq3 closed 4 months ago

rq3 commented 11 months ago

Is your feature request related to a problem? Please describe.

No response

Are you looking for hardware support?

No response

Describe the feature you want

The latest bugfix only has two digits after the decimal for the standard deviation reported during G33 calibration. Also, there used to be settings that forced a certain number of calibration iterations, with an early abort if the standard deviation was as good or better than a set value.

If these still exist, I'm darned if I can find them!

Additional context

My delta printer has 5 micron (0.005 mm) resolution, so I really miss having better than 2 digit representation of standard deviation.

thisiskeithb commented 11 months ago

Can you post your current config?

This is what I see after an M48 on my Prusa Bear with REPRAP_DISCOUNT_SMART_CONTROLLER:

Send: M48
M48 Z-Probe Repeatability Test
//action:notification M48 Point: 1/10
//action:notification M48 Point: 2/10
//action:notification M48 Point: 3/10
//action:notification M48 Point: 4/10
//action:notification M48 Point: 5/10
//action:notification M48 Point: 6/10
//action:notification M48 Point: 7/10
//action:notification M48 Point: 8/10
//action:notification M48 Point: 9/10
//action:notification M48 Point: 10/10
Finished!
Mean: 0.206167 Min: 0.205 Max: 0.207 Range: 0.002
Standard Deviation: 0.000553
//action:notification Deviation: 0.000553

Deviation: 0.000553 is displayed on the screen in the status area.

I get similar results on my Biqu BX with BIQU_BX_TFT70 / TFT_COLOR_UI.

Code supports this as well with 6 places after the decimal:

https://github.com/MarlinFirmware/Marlin/blob/a5d097abe6e8cbad3dead9086439b3c0f44c7cb2/Marlin/src/gcode/calibrate/M48.cpp#L134-L137

and

https://github.com/MarlinFirmware/Marlin/blob/a5d097abe6e8cbad3dead9086439b3c0f44c7cb2/Marlin/src/gcode/calibrate/M48.cpp#L262-L266

rq3 commented 11 months ago

M48 probe repeatability is fine, but G33 calibration seems to have lost a displayed digit and the choice of iterations that used to be available.

The latest bugfix looks like this: Cal

configs.zip

thisiskeithb commented 11 months ago

G33 calibration seems to have lost a displayed digit

Which version of Marlin was this available?

thisiskeithb commented 11 months ago

Note: you can set the number of iterations with the G33 - Delta Auto Calibration's F parameter:

image
rq3 commented 11 months ago

G33 calibration seems to have lost a displayed digit

Which version of Marlin was this available?

There were 3 digits after the decimal in G33 calibration for 2.1.2.1 bugfixes in June 2023.

rq3 commented 11 months ago

Note: you can set the number of iterations with the G33 - Delta Auto Calibration's F parameter:

image

Yeah, but... I believe this function used to be available in the config files?

thisiskeithb commented 11 months ago

Yeah, but... I believe this function used to be available in the config files?

I spot checked releases all the way back to 1.1.9 and did not see a build time config option for G33 iterations.

Feel free to check https://github.com/MarlinFirmware/Configurations#branches to confirm.

thisiskeithb commented 11 months ago

I'm also digging through the G33.cpp history and I'm not seeing anything recent that shortened decimal values.

Perhaps you're thinking of M48 results?

rq3 commented 11 months ago

I'm also digging through the G33.cpp history and I'm not seeing anything recent that shortened decimal values.

Perhaps you're thinking of M48 results?

Here are a couple of screen shots of my delta running a 2.1.2.1 bugfix from May 17, 2023. It's counting iterations, and definitely has 3 digits after the decimal for the G33 standard deviation. Does it perhaps get these from the z leveling defines in configuration.h? I notice that header is included in G33.cpp.

IMG_1972 IMG_1974

rq3 commented 10 months ago

I've been assiduously snipe hunting, bu still holding the bag.

Running G33 from Repetier Host works fine, and reports in 3 digits after the decimal for all coefficients, inccluding standard deviation.

Running Delta Auto Calibration from the Color_UI configuration menu works fine, but only reports 2 digits after the decimal on the touch screen for standard deviation after every iteration.

Unless you run an older commit, where it reports 3 digits on the touch screen, which is what I was after.

Obviously the data hasn't changed, since G33 over serial always reports at least 3 digits, bu the "translation" between the data, and what the 480x320 graphic TFT shows has changed, and I cannot find it. Like my previous snipe hunt, the variable is not available in the configuration files.

Simply, I need the name and location of the file that determines the number of digits displayed on the 480x320 TFT for standard deviation during a delta calibration.

My work-around is to run G33 F10 V3 over serial from Repetier Host, pick the best result, enter those results into configuration.h (for storage) AND the delta configuration on the LCD screen, save, and load.

rq3 commented 10 months ago

Binary search: Commits up to 1fbeac7 on June 23, 2023 are OK, with standard deviations reporting as 0.000 and iterations as 01, 02, 03, etc., on the display.

Commits after that have no SD or Settings icons, until commit 574dd34 on June 27 when all hell breaks loose. During compile there is a warning about G33 truncation (!!!), but the firmware does compile. The installed firmware does load and actually gets to the info screen, and then re-boots repetitively. There are no SD or Settings Icons.

Commit 1792608 on July 4, 2023 will compile and run, but still has no SD or Settings icons. However, it does not bootloop, so running G33 from Repetier allowed me to observe that the standard deviation was reported as 0.00, rather than the required 0.000

I suspect commit 574dd34 on June 27 is the culprit, as it touched many things. In any case, I'm within a 4 day window (June 23 is good, June 27 is not), and many of the commits within that window are just chron bumps.

rq3 commented 10 months ago

I'm also digging through the G33.cpp history and I'm not seeing anything recent that shortened decimal values.

Perhaps you're thinking of M48 results?

Commits up to https://github.com/MarlinFirmware/Marlin/commit/1fbeac7b5255634bb5aca209a3d3dcb6b5e43193 on June 23, 2023 are OK, with standard deviations reporting as 0.000 and iterations as 01, 02, 03, etc., on the display.

Commits after that have no SD or Settings icons, until commit https://github.com/MarlinFirmware/Marlin/commit/574dd34c49fde76e1e736b8a7e1ea579d724ff22 on June 27 when all hell breaks loose. During compile there is a warning about G33 truncation (!!!), but the firmware does compile. The installed firmware does load and actually gets to the info screen, and then re-boots repetitively. There are no SD or Settings Icons.

rq3 commented 6 months ago

This has been repaired in patched Release 2.1.2.3, but not in bugfix 2.1.x as of June 1 2024.

thisiskeithb commented 5 months ago

This PR shortened the display string:

In G33.cpp, replace:

https://github.com/MarlinFirmware/Marlin/blob/a93acbd35c2ff6339a5070cb377618f73c35dc1f/Marlin/src/gcode/calibrate/G33.cpp#L637

with:

MString<21> msg(F("Calibration sd:"));:

Diff:

diff --git a/Marlin/src/gcode/calibrate/G33.cpp b/Marlin/src/gcode/calibrate/G33.cpp
index 59e0db1..12aed86 100644
--- a/Marlin/src/gcode/calibrate/G33.cpp
+++ b/Marlin/src/gcode/calibrate/G33.cpp
@@ -634,7 +634,7 @@ void GcodeSuite::G33() {
           }
         SERIAL_EOL();

-        MString<20> msg(F("Calibration sd:"));
+        MString<21> msg(F("Calibration sd:"));
         if (zero_std_dev_min < 1)
           msg.appendf(F("0.%03i"), (int)LROUND(zero_std_dev_min * 1000.0f));
         else

Tested in the Simulator with current bugfix-2.1.x (a93acbd):

Before After
Calibration sd:0.03 Calibration sd:0.014

PR with fix submitted:

github-actions[bot] commented 2 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.