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

allow more configuration for bucket selections #1057

Merged
merged 3 commits into from
Oct 6, 2024

Conversation

schiele
Copy link
Contributor

@schiele schiele commented Oct 3, 2024

Which mods are added by this PR?

This allows more control over which bucket is selected for purging and for parking the nozzle after cleaning in the Decontaminator Purge Bucket & Nozzle Scrubber mod,

How was it tested?

I tested this modification on my Voron v2.4 350 build with all the combinations of new configuration options. The final implementation behaves with all combinations as expected.

Any background context you want to provide?

This includes the following three modifications:

  1. use native Jinja variable _bucket_pos

    The previous implementation of dynamically changing bucket_pos on each
    run had an extremely confusing semantic of changing the variable early
    in the execution of the macro but see the effect only on the next run of
    the macro. This led to the situation that the first bucket position
    after the machine started was never selected randomly, only all later
    ones. While this for sure is not a major problem of the implementation
    it is extremely confusing and makes extending the macro unnecessarily
    complicated.

    See the confusion this created on my side at
    https://klipper.discourse.group/t/conditional-changing-of-a-variable-inside-a-macro/19161

    By using the native Jinja variable _bucket_pos instead, we can make the
    change effective immediately, making the macro behave how you would
    intuitively expect.

  2. variable_bucket_park: select bucket to park nozzle after cleaning

    The previous implementation always parked the nozzle over the left
    bucket after cleaning. While this makes sense in most cases it is
    problematic when you happen to have something installed over the left
    bucket, like the Klicky Probe. If parking the nozzle over the Klicky
    Probe there is a certain risk to pull it out of the docking station by
    accident with the move command following the cleaning procedure. When
    we park the nozzle over the right bucket we can mitigate that risk.

    The default value for variable_bucket_park is still to park over the
    left bucket as in the original implementation.

  3. variable_bucket_purge: select bucket for purging

    In the original implementation, the bucket for purging was selected
    randomly. Since I wanted to park the nozzle always over the right
    bucket to avoid conflicts with the Klicky Probe and as such always
    oozing into that (on my 350 build) smaller right bucket I thought that
    it might be useful to compensate for this by always purging to the
    larger left bucket.

    Now you can select the bucket you want to do the purging. With the
    default setting of -1 it will still randomly choose the bucket as
    before.

⚠️⚠️PLEASE READ AND COMPLETE THE CHECKLIST BELOW⚠️⚠️

  • I have read the rules available here and
    my mod adheres to these rules.
  • This mod was created by myself and I agree to publish it under the repository
    license

The previous implementation of dynamically changing bucket_pos on each
run had an extremely confusing semantic of changing the variable early
in the execution of the macro but see the effect only on the next run of
the macro.  This led to the situation that the first bucket position
after the machine started was never selected randomly, only all later
ones.  While this for sure is not a major problem of the implementation
it is extremely confusing and makes extending the macro unnecessarily
complicated.

See the confusion this created on my side at
https://klipper.discourse.group/t/conditional-changing-of-a-variable-inside-a-macro/19161

By using the native Jinja variable _bucket_pos instead, we can make the
change effective immediately, making the macro behave how you would
intuitively expect.
The previous implementation always parked the nozzle over the left
bucket after cleaning.  While this makes sense in most cases it is
problematic when you happen to have something installed over the left
bucket, like the Klicky Probe.  If parking the nozzle over the Klicky
Probe there is a certain risk to pull it out of the docking station by
accident with the move command following the cleaning procedure.  When
we park the nozzle over the right bucket we can mitigate that risk.

The default value for variable_bucket_park is still to park over the
left bucket as in the original implementation.
In the original implementation, the bucket for purging was selected
randomly.  Since I wanted to park the nozzle always over the right
bucket to avoid conflicts with the Klicky Probe and as such always
oozing into that (on my 350 build) smaller right bucket I thought that
it might be useful to compensate for this by always purging to the
larger left bucket.

Now you can select the bucket you want to do the purging.  With the
default setting of -1 it will still randomly choose the bucket as
before.
@jontek2 jontek2 self-requested a review October 5, 2024 15:16
Copy link
Collaborator

@jontek2 jontek2 left a comment

Choose a reason for hiding this comment

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

LGTM

@newphreak newphreak merged commit d12de43 into VoronDesign:main Oct 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants