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

M300 set 3.5s duration limit #4846

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

3d-gussner
Copy link
Collaborator

@3d-gussner 3d-gussner commented Feb 11, 2025

Solves #2045

Post release tasks

  • Update doxygen documentation
  • Update RepRap Gcode wiki

@3d-gussner 3d-gussner requested a review from leptun February 11, 2025 15:45
@3d-gussner 3d-gussner force-pushed the MK3_M300_duration_set_4s_limit branch from 9267193 to b89c4dd Compare February 11, 2025 16:04
Copy link
Collaborator

@leptun leptun left a comment

Choose a reason for hiding this comment

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

Choosing 4000ms might be a bit risky given that it exactly matches what the watchdog timer is specified to be running at. However, this may still be fine given the following:

  • According to avrlibc, we set a timeout of 4 seconds, but that is not entirely correct. The datasheet specifies the watchdog crystal at 128KHz (that is 128000Hz) and the prescaler that we use to get 4s of timeout is /512K (that is 524288, not 512000!!), so the timeout is in fact set to 4.096s which is slightly bigger than the max beep time chosen. Still cutting it close at only ~96ms to spare. This obviously assumes the timer is running at the nominal speed, but that is never the case, which brings us to the next note I have.
  • The watchdog timer speed is not only influenced by VCC voltage, but also by temperature. Here are the speeds of the timer under various conditions from the datasheet:
    image
    As can be seen there, the speed is always less than 128KHz, so we have a bit of extra margin at all times, so this may be good enough as a solution.

@3d-gussner
Copy link
Collaborator Author

@leptun I tested on MK404 and at M300 P4505 S0 it resets the printer P4504 survives. That is why I have chosen 4000 instead of 4500

@3d-gussner
Copy link
Collaborator Author

@leptun Which value would you prefer? 3500 3750?

@3d-gussner 3d-gussner force-pushed the MK3_M300_duration_set_4s_limit branch from b89c4dd to c40af0c Compare February 11, 2025 17:00
Copy link

All values in bytes. Δ Delta to base

Target ΔFlash ΔSRAM Used Flash Used SRAM Free Flash Free SRAM
MK3S_MULTILANG 24 0 247692 5654 6260 2538
MK3_MULTILANG 24 0 247062 5663 6890 2529

@3d-gussner 3d-gussner changed the title M300 set 4s duration limit M300 set 3.5s duration limit Feb 11, 2025
@leptun
Copy link
Collaborator

leptun commented Feb 11, 2025

3500 sounds good 👍

@3d-gussner 3d-gussner requested a review from leptun February 11, 2025 17:50
@3d-gussner 3d-gussner added the Post release tasks open Tasks after release label Feb 12, 2025
kimtwio

This comment was marked as off-topic.

Copy link
Collaborator

@sarusani sarusani left a comment

Choose a reason for hiding this comment

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

Tested on MK3S

@3d-gussner 3d-gussner merged commit a29c246 into prusa3d:MK3 Feb 13, 2025
4 checks passed
@3d-gussner 3d-gussner deleted the MK3_M300_duration_set_4s_limit branch February 13, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Post release tasks open Tasks after release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants