Tc exit options - #51
Conversation
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
left a comment
There was a problem hiding this comment.
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:
- restore_pos defaults to True despite claiming these features are off by default.
- restore_x / restore_y have no setter, so every mid-print toolchange would travel to X50 Y50.
- Gating of positions based on clearance_y and dock_dir is questionably necessary, and performed incorrectly.
| variable_park_on_ooze_pad: False | ||
| variable_pad_x: 10.00 | ||
| variable_pad_y: 26.00 | ||
| variable_restore_pos: True |
There was a problem hiding this comment.
Doesn't agree with claim that these features are off by default
There was a problem hiding this comment.
claim is not all features are off by default, but reverts to default exit behaviour when they are turned off.
| variable_rotation_dist_overridden: 0 | ||
| variable_exit_pickup: False | ||
| variable_valid_restore: True | ||
| variable_restore_x: 50 |
There was a problem hiding this comment.
no setter exists for either of restore_x or restore_y
There was a problem hiding this comment.
missed from original file, genuine mistake that has now been added. Thanks
| {% 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) %} |
There was a problem hiding this comment.
If you do decide to keep this check, correct the operator.
| {% 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) %} |
There was a problem hiding this comment.
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!
| {% 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) %} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
| 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 %} |
There was a problem hiding this comment.
Why does scrub have to require restore_pos==False as well?
Added _RESTORE_GRABBER macro to manage tool change positions.
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?
|
Refactor exit pickup logic and remove unused _TC_SCRUB macro.
Removed unused variables related to nozzle cleaning and pass count.
|
...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
left a comment
There was a problem hiding this comment.
Changes all look good except the one typo I've commented on.
Co-authored-by: Charlie <81966433+charliemayall@users.noreply.github.com>
Add TC exit options for users.
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.