Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit variable layer height displaying precision to 3 digits #5795

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

vovodroid
Copy link
Contributor

Currently in variable layer height slider heights are shown with six digits precision:

image

It has no meaning as Z height is rounded to three digits anyway (and to two digits in slider):

image

This PR rounds variable height calculation and displaying to three digits:

image

@igiannakas
Copy link
Contributor

igiannakas commented Jun 22, 2024

Personally, as you've already opened the code for this, I would think that rounding the variable layer height to 2 decimals may be preferred as most printers cannot output a 3 digit precision on the z (or any other axis for that matter) in a meaningful way.

For example a Voron 2.4 per full step of the z axis outputs 0.04mm in Z movement per full step, and, assuming a fully precise 16 micro steps, it would output 0.0025mm per micro step. So a 0.001 move is not possible with the standard voron setup for example.

Using 64 micro steps a voron may be able to output a resolution of 0.000625 per micro step so a layer height change of 0.001mm would be 1.6 micro steps to execute which is not really attainable due to micro step drift.

So I'd recommend a 0.01 precision which is achievable with 4 micro steps on the standard config which can be theoretically output with some level of accuracy.

@vovodroid
Copy link
Contributor Author

vovodroid commented Jun 22, 2024

I use three digits to make it consistent with Prusa (prusa3d/PrusaSlicer#10298). They took my implementation and limited it to three digits. I have nothing against 0.01.

@igiannakas
Copy link
Contributor

Yeap agreed - but I don’t think prusas is right either. The mechanical accuracy of our printers can’t reproduce 3 digits with any meaningful precision. Maybe @SoftFever could chime in here too as I may be wrong :)

@vovodroid
Copy link
Contributor Author

You are right, but for whatever reason g-code resolution is also rounded to 0.001, despite standard XY step is 0.0125

@igiannakas
Copy link
Contributor

I thought that XY is quantized by the slicing tolerance value, so if you set 0.0125 there it would create quanta with this irrespective of decimal places 🤔

@dewi-ny-je
Copy link
Contributor

dewi-ny-je commented Jul 22, 2024

Personally, as you've already opened the code for this, I would think that rounding the variable layer height to 2 decimals may be preferred as most printers cannot output a 3 digit precision on the z (or any other axis for that matter) in a meaningful way.

For example a Voron 2.4 per full step of the z axis outputs 0.04mm in Z movement per full step, and, assuming a fully precise 16 micro steps, it would output 0.0025mm per micro step. So a 0.001 move is not possible with the standard voron setup for example.

Using 64 micro steps a voron may be able to output a resolution of 0.000625 per micro step so a layer height change of 0.001mm would be 1.6 micro steps to execute which is not really attainable due to micro step drift.

So I'd recommend a 0.01 precision which is achievable with 4 micro steps on the standard config which can be theoretically output with some level of accuracy.

Even better, I would specify the rounding precision as general printer setting: I have a printer which uses T8 rods and 16 microsteps, so 8000/200/16=2.5 microns.

Sending Z heights with any other quantization will cause a difference between expected and actual layer height, therefore difference in flow rate and Z-related artefacts.

@vovodroid
Copy link
Contributor Author

@dewi-ny-je gcode command rounded to 0.001 anyway.

@dewi-ny-je
Copy link
Contributor

@dewi-ny-je gcode command rounded to 0.001 anyway.

It is also true that with a minimum height of 80 um, a quantization of 2.5 vs commands rounded to 1 results in at most 1.5/80 = ~2% error, hardly noticeable.

@vovodroid vovodroid changed the title Limit variable layer height calculation and displaying precision to t… Limit variable layer height displaying precision to 3 digits Jul 29, 2024
Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Thank you

@SoftFever SoftFever merged commit 2ee3800 into SoftFever:main Jul 29, 2024
15 of 16 checks passed
@vovodroid vovodroid deleted the limit-var-height-digits-pr branch July 29, 2024 11:18
Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chime in on the discussion.
I vaguely remember SuperSlicer has a setting to define the Z step. I didn't dig into how that parameter is used inside the code.
Adaptive layer height can potentially leverage such a value to limit the step when calculating layer height.
On the other hand, I'm thinking the minimum layer height defined in the extruder setting probably makes more sense as @igiannakas pointed out. One full Z step could be so small that no machine can actually do that consistently.
So, probably the minimum layer height is better.

@vovodroid
Copy link
Contributor Author

According to Chep's test "magic" Z step has no much meaning, unless you use microscope

https://www.youtube.com/watch?v=WIkT8asT90A

@SoftFever
Copy link
Owner

I would be shocked if it has any impact on any Creality v-wheel printer ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants