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

Fan override and multiplier #27198

Open
wants to merge 9 commits into
base: bugfix-2.1.x
Choose a base branch
from

Conversation

dbuezas
Copy link
Contributor

@dbuezas dbuezas commented Jun 21, 2024

Description

I recently installed cpap style remote cooling, and found I often wished to reduce or force the fan speed mid print, independent of what gcode calls to M106 are done.

This PR adds:

  • Fan Lock: inhibits setting the fan speed via gcode. Useful to override the slicer fan settings, particularly when using different speeds for overhangs, layer times, bridges, etc.
  • Fan Multiplier: responds to gcode but multiplies by a factor (0 to 10) before applying. I find this very useful when trying new materials that require a lot more/less fan than my default preset, particularly tweaking it mid print.

Obviously the PR is still missing configuration.h options, but I'd like to get early feedback or save myself the hassle if the feature is not considered good to merge (I use it and find it useful myself)

Requirements

Part cooling fan.

Benefits

Avoid having to re-slice and restart a print when I find the current settings are not good mid-print.

Configurations

Related Issues

@dbuezas dbuezas marked this pull request as draft June 21, 2024 19:47
@thisiskeithb
Copy link
Member

This potentially adds another layer of complexity / possible points of confusion for users (bug reports and/or support requests) when a fan is "locked" since they won't know why standard fan commands aren't working.

@dbuezas
Copy link
Contributor Author

dbuezas commented Jun 21, 2024

Absolutely, this would definitely be behind a configuration_adv.h flag. done

@dbuezas
Copy link
Contributor Author

dbuezas commented Jun 23, 2024

Do you consider these features worthy?

If so I'll add configuration flags and maybe avoid the float operation in the multiplayer for slower boards.

@dbuezas
Copy link
Contributor Author

dbuezas commented Jun 24, 2024

Maybe setting them via gcode is a bad idea, i now use it exclusively from the UI (i only added them for completeness) behind a configuration_adv.h flag

@dbuezas dbuezas marked this pull request as ready for review July 6, 2024 08:14
@dbuezas
Copy link
Contributor Author

dbuezas commented Jul 6, 2024

This potentially adds another layer of complexity / possible points of confusion for users (bug reports and/or support requests) when a fan is "locked" since they won't know why standard fan commands aren't working.

They now have to first enable the option in configuration_adv.h and then explicitly lock it from either UI or gcode. It is not persisted to eeprom either so I don't think this would be a problem anymore.

# Conflicts:
#	Marlin/src/module/temperature.cpp
#	Marlin/src/module/temperature.h
@studiodyne
Copy link
Contributor

studiodyne commented Jul 17, 2024

Hi. I created a similar functionality. Perhaps joint work is possible.
#27280
Mine :

  • Use of percentage (simpler/intuitive)
  • Use of two thresholds to target “normal fan speed” in the case of 3D printing for example
  • Don't immediately update the current fan speed and wait for an M106, in "sleep temperature mode" the values ​​are stored and I didn't want to check if something was going to break somewhere.
  • Do not block the M106. Because only one M106 applies full power, rejecting an M106 without an 'S' is equal to disabling a marlin feature
  • Can also lock/unlock, applying a value of +-100%

I don't know if other uses of robotics (laser, cnc, or other), prefer percentage or decimal. That's why I will be really happy to have these two possibilities.
For my personal case, I wrote this just because sometimes I slice without checking and the printing cannot be stopped just for fan speed.
If you have the time to mix it all together and create one awesome feature I'm definitely all for having two in one.
I don't have time and my job will never be more than that

Very good work
Sincerely

Note: I made this thing without knowing that you had already done the same , I only found out afterwards, too bad because I would have adopted it (with a few modifications, of course :-))

@dbuezas
Copy link
Contributor Author

dbuezas commented Jul 18, 2024

Let's find the minimum options that get the job done :)

  • I definitely use the multiplier often (both to increase and reduce power).
  • I seldom use the fan lock, mostly for tests. Maybe this could be replaced with your offsets?

@dbuezas
Copy link
Contributor Author

dbuezas commented Jul 18, 2024

By the way, I didn't use percentage for the multiplier because the existing types use uint8_t so the max possible would be 255%. And they're most likely limited to 100% anyway

@studiodyne
Copy link
Contributor

studiodyne commented Jul 18, 2024

The project is for you, I don't have time. You have two blocks of 'work', you can feel free to make what seems the best for you and all.
I'm impatient to have this in my cfg advance ! 😃.
If you need french translation, I can help ! 🇫🇷
Cordially

@dbuezas
Copy link
Contributor Author

dbuezas commented Jul 18, 2024

This PR is ready for review then

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.

3 participants