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.28k stars 19.24k forks source link

[BUG] Home Offset Z is not saved #26498

Closed enesdogan00 closed 7 months ago

enesdogan00 commented 11 months ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

When I set the Home Offset Z from the prepare menu and restart the printer z offset is back to 0.00.

Bug Timeline

September 2023

Expected behavior

I expect the printer to save the home offset z to eeprom so I can use it after restarting the printer. This worked on older versions but now it doesn't.

Actual behavior

I set the Home Offset Z from the prepare menu and it says Settings Stored. After that I can print with the set offset but if I restart the printer the offset is set back to 0.00.

Steps to Reproduce

  1. Compile the Marlin firmware with the config below at commit b17d3d3e9c6
  2. Flash the firmware to the printer.
  3. Go to the Prepare menu and set the Home Offset Z.
  4. Restart the printer and check if the offset is still the same.

Version of Marlin Firmware

02010300

Printer model

Ender3V2

Electronics

Skr Mini E3 V3

LCD/Controller

Ender3V2 Display

Other add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

Additional information & file uploads

Marlin.zip

classicrocker883 commented 11 months ago

if you havent fixed this yet, try this:
in proui/dwin.h in the hmi_data_t struct

  #endif
+ #if DISABLED(HAS_BED_PROBE)
+   float manualZOffset = 0.0f;
+ #endif
} hmi_data_t;

in proui/dwin.cpp near the top, change...

-#if HAS_MESH && HAS_BED_PROBE
-  #define BABY_Z_VAR probe.offset.z
-#else
-  float z_offset = 0;
-  #define BABY_Z_VAR z_offset
-#endif

+#define BABY_Z_VAR TERN_(HAS_BED_PROBE, probe.offset.z, hmiData.manualZOffset)

in the same dwin.cpp, look for void dwinSetDataDefaults() { and add...

    hmiData.zAfterHoming = DEF_Z_AFTER_HOMING;
  #endif
+ #if DISABLED(HAS_BED_PROBE)
+   hmiData.manualZOffset = 0;
+ #endif

remove any red with (-) and add the green code after (+)

github-actions[bot] commented 8 months ago

Greetings from the Marlin AutoBot! This issue has had no activity for the last 90 days. Do you still see this issue with the latest bugfix-2.1.x code? Please add a reply within 14 days or this issue will be automatically closed. To keep a confirmed issue open we can also add a "Bug: Confirmed" tag.

Disclaimer: This is an open community project with lots of activity and limited resources. The main project contributors will do a bug sweep ahead of the next release, but any skilled member of the community may jump in at any time to fix this issue. That can take a while depending on our busy lives so please be patient, and take advantage of other resources such as the MarlinFirmware Discord to help solve the issue.

github-actions[bot] commented 5 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.