Skip to content

Tc exit options - #51

Open
3DPrintDemon wants to merge 6 commits into
BondtechAB:mainfrom
3DPrintDemon:TC_Exit_Options
Open

Tc exit options#51
3DPrintDemon wants to merge 6 commits into
BondtechAB:mainfrom
3DPrintDemon:TC_Exit_Options

Conversation

@3DPrintDemon

@3DPrintDemon 3DPrintDemon commented Aug 26, 2026

Copy link
Copy Markdown

Add TC exit options for users.

  • Use default behaviour, by turning all new systems off, or..... - EDIT restore_pos is default on, current default operation is used when restore_pos & park on ooze pad are off.
  • Park on a gantry mounted purge/ooze pad after pickup to fully heat to catch any oozing
  • Choose pad location to park
  • Clean nozzle on a gantry mounted nozzle cleaner - REMOVED
  • Choose start & finish scrubbing locations & pass count - REMOVED
  • Or choose to restore the last XYZ position before the tool change was initiated. This works best if you select "change on wipe tower" in the slicer.

restore_pos operation....
This variable enables an active restore system that changes the default TC return behaviour. So instead of picking up a tool & immediately restoring the TC Z height at the clearance_y threshold & heating this variable enables the toolhead to pass the clearance-y location & returns it to the location where the TC was called. Preferably the purge/wipe tower (use slicer setting) once at the restored XY coordinates the toolhead then lowers back to the restored Z height & waits to fully heat.
This makes sure the toolhead passes cleanly above the top of any print on the bed & heats the nozzle into the purge tower catching any oozing filament as it dos so.

  • The system runs checks that will bypass functions with warnings if set variables encroach on docked tools clearance Y values & if restore_pos locations are in front of other tool's dock & match their exit positions.

  • The ooze_pad park & tc_scrub clean nozzle systems can be combined, however the restore pos & nozzle clean can not. - tc_scrub REMOVED

  • The ooze_pad variable overrides the restore_pos setting.

Added configuration options for tool change behavior, including parking location and nozzle cleaning settings.
Added variables for exit pickup and restore coordinates in the tool change macros. Enhanced G-code macros to handle tool change logic more robustly, including checks for valid restore positions and scrub functionality.

@charliemayall charliemayall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few comments.

Firstly, some of this is feeling a little out of scope. There are so many brush solutions out there, all of which will likely have their own macros, so I don't see the need for bringing that into this repo when it will be so variable between user specific setups.

Actual issues with the changes:

  1. restore_pos defaults to True despite claiming these features are off by default.
  2. restore_x / restore_y have no setter, so every mid-print toolchange would travel to X50 Y50.
  3. Gating of positions based on clearance_y and dock_dir is questionably necessary, and performed incorrectly.

Comment thread macros/indx.cfg
variable_park_on_ooze_pad: False
variable_pad_x: 10.00
variable_pad_y: 26.00
variable_restore_pos: True

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't agree with claim that these features are off by default

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

claim is not all features are off by default, but reverts to default exit behaviour when they are turned off.

Comment thread macros/indx-tc-macros.cfg
variable_rotation_dist_overridden: 0
variable_exit_pickup: False
variable_valid_restore: True
variable_restore_x: 50

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no setter exists for either of restore_x or restore_y

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

missed from original file, genuine mistake that has now been added. Thanks

Comment thread macros/indx-tc-macros.cfg Outdated
{% if tp.dock_dir == -1 and (tp.tcs_start_y|float < tp.clearance_y|float or tp.tcs_fin_y|float < tp.clearance_y|float) %}
RESPOND TYPE=error MSG="⚠️ TOOL CHANGE tc_scrub tcs_start_y or tcs_fin_y is set less than clearance_y please correct this to activate this feature!"

{% elif tp.dock_dir == 1 and (tp.tcs_start_y|float < tp.clearance_y|float or tp.tcs_fin_y|float > tp.clearance_y|float) %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you do decide to keep this check, correct the operator.

Suggested change
{% elif tp.dock_dir == 1 and (tp.tcs_start_y|float < tp.clearance_y|float or tp.tcs_fin_y|float > tp.clearance_y|float) %}
{% elif tp.dock_dir == 1 and (tp.tcs_start_y|float > tp.clearance_y|float or tp.tcs_fin_y|float > tp.clearance_y|float) %}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah you're quite correct again, missed that one too. Thats what writing at midnight after a full day's work & family time does for you! Thank you for the sanity check there!

Comment thread macros/indx-tc-macros.cfg Outdated
{% set v = printer["gcode_macro _TOOLCHANGE_VARS"] %}
{% set final_f = (printer.configfile.settings.printer.max_velocity * 60 * v.speed_mult) %}

{% if tp.dock_dir == -1 and (tp.tcs_start_y|float < tp.clearance_y|float or tp.tcs_fin_y|float < tp.clearance_y|float) %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider if these checks are needed. clearance_y is not reserved exclusively for tool change activities, I have my purge and brush setup within it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is true, it could well be a usable space with some users, I'm kinda thinking of maybe less advanced users that might not realise the potential pitfalls here & maybe trying to keep them out the realms of the complexities of moving into possible dock collisions. I appreciate the comments & thank you for the input. I will think it over for sure!

Comment thread macros/indx-tc-macros.cfg Outdated
M109 S{params.TARGET|default(0)|float}
{% endif %}

{% if printer.print_stats.state in ["printing", "paused"] and tp.tc_scrub == True and tp.restore_pos == False %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why does scrub have to require restore_pos==False as well?

Added _RESTORE_GRABBER macro to manage tool change positions.
@3DPrintDemon

Copy link
Copy Markdown
Author

A few comments.

Firstly, some of this is feeling a little out of scope. There are so many brush solutions out there, all of which will likely have their own macros, so I don't see the need for bringing that into this repo when it will be so variable between user specific setups.

Actual issues with the changes:

  1. restore_pos defaults to True despite claiming these features are off by default.
  2. restore_x / restore_y have no setter, so every mid-print toolchange would travel to X50 Y50.
  3. Gating of positions based on clearance_y and dock_dir is questionably necessary, and performed incorrectly.

The brush. Possibly a little far reaching I agree but not un-useful for it to be an integrated option for a simple system that users don't have change, modify, add or edit files to use. Print a simple brush/pad, fit it, turn on a variable & use it for each tool change, gives a quick simple clean job done. Do you think users would not want this? If some didn't & wanted something more complex couldn't those users just turn it off & do the modifications for whatever they did want?

  1. Please reread claim "Use default behaviour, by turning all new systems off, or....."
    Never claimed features were off by default, claim is you CAN use default behaviour by turning new systems off.

  2. Absolutely correct, after trying to extract all relevant parts for this PR from my main branch I missed this. It has now been updated to include that. Thanks for the nudge on that one, genuine mistake there.

  3. It could work without it I guess If you were inclined to remove it, the intent is to purposely give a message that the user provided a potentially risky position inside the clearance_y area, within a region any X axis moments could perhaps cause collisions with docked tools, so it doesn't move to that location, an attempt to stop users damaging their machines.

Refactor exit pickup logic and remove unused _TC_SCRUB macro.
Removed unused variables related to nozzle cleaning and pass count.
@3DPrintDemon

Copy link
Copy Markdown
Author

...Well after sleeping on it I decided to remove the built in nozzle clean stuff as I'm fairly sure of the outcome of this PR if left in. The restore_pos stuff is genuinely useful & people have said so, they're already using it & preferring it over the current default, & have even appropriated it into their own forks.

I left the park on ooze pad in as that could be useful too maybe, but again, happy to remove that if unwanted.

I'll leave the tc_scrub in my main fork along with a load of other stuff, if anyone is interested. Happy to add the tc_scrub back in here if requested, but I'll be assuming it won't be.

Right gotta run out the door to work now, so if there's any mistakes in the edits/deletions let me know & I'll fix them when I get home later.

@charliemayall charliemayall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes all look good except the one typo I've commented on.

Comment thread macros/indx-tc-macros.cfg Outdated
Co-authored-by: Charlie <81966433+charliemayall@users.noreply.github.com>
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