fluidd-core / fluidd

Fluidd, the klipper UI.
https://docs.fluidd.xyz
GNU General Public License v3.0
1.39k stars 424 forks source link

Live z offset not zeroed after save_config and restart #1314

Closed iwm911 closed 8 months ago

iwm911 commented 8 months ago

Fluidd Version

v1.27.1

Browser

Chrome, Firefox

Device

Desktop PC

Operating System

Windows

What happened

Could this pull request introduced a bug that keep the live Z offset after save_config and restart and by that doubles the z offset?

after doing save_config the live adjust z offset is not reset to 0 so we get twice the offset.

What did you expect to happen

once live z offset is saved to configuration and klipper restarts the live adjust z offset should be zeroed. in fact the live z offset should probably zeroed after every firmware restart.

How to reproduce

use live z offset to adjust the z offset, click on the save icon, do save_config in the console. Klipper will restart and will have the new z offset but the live adjusted z offset will still be present and will change the actual z offset in use for the print.

Additional information

No response

pedrolamas commented 8 months ago

Hi @iwm911 thank you for opening this ticket.

I have tried to reproduce the issue following the steps you mentioned in the ticket but have not been able to see any problem.

When I start Fluidd, the live Z-Offset value is 0mm:

image

I then changed the value to -0.100mm, clicked the save button (which runs Z_OFFSET_APPLY_ENDSTOP), and then performed SAVE_CONFIG

Once Klipper restarted, the live Z-Offset value went back to 0mm (matching the picture above) and I can see the change was performed in the configuration file as expected.

iwm911 commented 8 months ago

That's strange I attached a link to a video reproducing the issue https://clipchamp.com/watch/cqIQVrxNaJ5

pedrolamas commented 8 months ago

Thanks for the video @iwm911, that is very useful indeed and I can see clearly the problem.

I once again tried reproducing on my setup, here's the video:

Animation2

As you can see, the value clears correctly.

Only difference here is that you have a BLTouch device which I do not have here with me - but in the end, if there is an issue here, I believe it will be upstream, possibly in Klipper.

Can you confirm what version of Klipper and Moonraker you are using?

iwm911 commented 8 months ago

Hi,

i am using the latest everything right now image

pedrolamas commented 8 months ago

Can you try and access Fluidd from an "anonymous" browser window? Just trying to confirm if this behavior is caused by some file left over in the browser cache...

iwm911 commented 8 months ago

i tried from a different browser all together, it had the same value..

pedrolamas commented 8 months ago

Please upload your klippy.log

iwm911 commented 8 months ago

Hi,

attached the klippy logs.

klippy(12).log

thanks

pedrolamas commented 8 months ago

After looking at your config, I can see this is being caused by the macros you are using, specifically a Z-offset that is being set by the call chain INIT_GLOBALS -> _INIT_SURFACES -> _APPLY_BED_SURFACE_OFFSET -> SET_SURFACE_ACTIVE -> _km_set_gcode_offset_base.

You can confirm that this is indeed happening if you disable (comment out) the full INIT_GLOBALS macro, and then try to reproduce the issue.

iwm911 commented 8 months ago

My god, it seems you are absolutely right. disabling the macros fixed the issue.

i am sorry for the hassle and appreciate your assistance. Thank you 🙏