VoronDesign / VoronUsers

Voron Community mods
https://mods.vorondesign.com
GNU General Public License v3.0
3k stars 1.86k forks source link

allow more configuration for bucket selections #1057

Closed schiele closed 3 weeks ago

schiele commented 3 weeks ago

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⚠️⚠️