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

Add Set parameter in M78 Statistics gcode #4809

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

3d-gussner
Copy link
Collaborator

@3d-gussner 3d-gussner commented Nov 7, 2024

Often a full factory reset is the best way to solve some issues. But that also means that the statistics are lost and often user complain why we can't keep them.

This is an attempt to give the user the option to get the statistics AND restore them if needed.

Added new parameters to M78 to be able to restore statistics after a factory reset.
Also added the output to M503

Tested on MK404:

  1. Connect via serial terminal
  2. Open LCD Statistic menu
  3. While printer is Idle send M78
    a. Example response when LCD Statistics menu shows 4.75m and 0d 2h 6m
Total filament:475 cm
Total print time:126 min
  1. Simulate a print by sending M75 to start the print timer
  2. On LCD it switches from Total filament and Total print time to Filament used and Print time
  3. Send M78 after waiting at least 1 minute
    a. Example response when LCD Statistics menu show 0.00m and 0h 02m 05s
Filament used:0 cm
Print time:2 min
  1. Send M77 to stop the print timer
  2. The Statistics menu switches back to Total and you see the additional print time being added.
  3. Send M503
    a. Example response in serial with total values being 4.75m and `0d 02h 08m
echo:Statistics:
echo:  M78 S475 T128
  1. Perform Factory reset -> Statistics
  2. Open again LCD -> Statistics menu
  3. Send again M78 and you see
Total filament:0 cm
Total print time:0 min
  1. Restore statistics using the output from M503
  2. Example values: Send M78 S475 T128
  3. On LCD you see the values being restored
  4. Send M78 and also in serial output you see the restored values.

Thanks to @crabbedh for the request #3448 sorry it took so long to be implemented.

@3d-gussner 3d-gussner requested a review from gudnimg November 7, 2024 14:41
Copy link

github-actions bot commented Nov 7, 2024

All values in bytes. Δ Delta to base

Target ΔFlash ΔSRAM Used Flash Used SRAM Free Flash Free SRAM
MK3S_MULTILANG 258 0 248302 5654 5650 2538
MK3_MULTILANG 252 0 247672 5663 6280 2529

Copy link
Collaborator

@gudnimg gudnimg left a comment

Choose a reason for hiding this comment

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

My only comment is there is some confusion between centimeter and meter.

Firmware/Marlin_main.cpp Show resolved Hide resolved
Firmware/Marlin_main.cpp Outdated Show resolved Hide resolved
Firmware/Marlin_main.cpp Outdated Show resolved Hide resolved
Firmware/Marlin_main.cpp Outdated Show resolved Hide resolved
@3d-gussner 3d-gussner requested a review from gudnimg November 11, 2024 14:50
Firmware/eeprom.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@gudnimg gudnimg left a comment

Choose a reason for hiding this comment

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

I reviewed the filament usage SI units, and it looks like the EEPROM documentation was wrong. @3d-gussner you were right, the EEPROM value is in centimeters. 👍

There is one minor typo I found, but not a blocker.

@3d-gussner 3d-gussner merged commit d8d058a into prusa3d:MK3 Nov 14, 2024
4 checks passed
@3d-gussner 3d-gussner deleted the MK3_Statistics branch November 14, 2024 07:22
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.

2 participants