Skip to content

Comments

Auto-Vacuum on CA1 via "Ext. Control"#320

Draft
SergeBakharev wants to merge 1 commit intoCarvera-Community:developfrom
timbot:develop
Draft

Auto-Vacuum on CA1 via "Ext. Control"#320
SergeBakharev wants to merge 1 commit intoCarvera-Community:developfrom
timbot:develop

Conversation

@SergeBakharev
Copy link
Contributor

This PR adds a new configuration setting to enable the "Ext. Control" switch to function as vacuum control for the CA1 model. enabling auto-vacuum functionality. As discussed in #286

This commit adds a new configuration setting to enable the "Ext. Control"
switch to function as vacuum control for the CA1 model. enabling auto-vacuum
functionality.

This commit is still a WIP, as currently the external control switch is
activated as soon as the "Auto Vacuum" switch is toggled, and does not
deactivate when the job has finished.
Comment on lines +2282 to +2293
def reload_device_specific_ui(self):
""" Reloads the device-specific UI elements."""
# Initialize device-specific settings
app = App.get_running_app()
if app.model == 'CA1':
self.ca1_ext_control_as_vacuum = self.config.getboolean(
'Advanced', 'ca1_ext_control_as_vacuum', fallback=False)

self.spindle_drop_down = SpindleDropDown()
self.coord_popup = CoordPopup(self.coord_config)


Copy link
Contributor Author

@SergeBakharev SergeBakharev Aug 7, 2025

Choose a reason for hiding this comment

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

This duplicates the existing Makera.setUIForModel() code. Better to extend the functionality there.

Comment on lines +3919 to +3923
logging.info("Setting vacuum mode to: {}".format(self.control_list['vacuum_mode'][1]))
if self.ca1_ext_control_as_vacuum:
self.controller.setExternalControl(100 if self.control_list['vacuum_mode'][1] else 0)
else:
self.controller.setVacuumMode(self.control_list['vacuum_mode'][1])
Copy link
Contributor Author

@SergeBakharev SergeBakharev Aug 7, 2025

Choose a reason for hiding this comment

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

I see what you mean. Yes, this has the effect of turning on the vacuum whenever the ca1_ext_control_as_vacuum setting is enabled, not based on the job start/stop.

While tempting it's not possible to send M851 / M852 while the machine is playing a gcode file. So doing a conditional on the machine status to send the command isn't the way.

As for

manually interject the external control m-codes (M851 / M852) before/after the job

This is what I would be tempted to do. It's easy to add before the playback of a file via the buffer command ( see how this is used in Makera.play() and Makera.apply()), and running the command immediate after play should queue it to stop after file play back finishes.

However there is potential for edge case issues, for example what happens if you pause gcode playback?

For this reason actually it is probably safest to implement the functionality in the firmware. Basically extend M331 and M332 to read a machine config to see if it should use the Ext Control output to perform the vacuum function.

@SergeBakharev
Copy link
Contributor Author

I suggest also writing some code around Makera.apply_setting_changes() to apply your config without needing to restart the controller app (since Makera.setUIForModel()) is only run once the app.model attribute is set and not multiple times.

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