-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add advanced misc fans menu (DWIN) + G-Codes #125
base: 2024-December
Are you sure you want to change the base?
Conversation
Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/src/lcd/e3v2/proui/dwin.cpp
…settings - Added FAN_KICKSTART_EDITABLE (Enable M711 configurable settings (320 bytes of flash)) - Added FAN_KICKSTART_MENU (Enable the Fan Kickstart submenu (384 bytes of flash)) - Improved Controller fan scaling - Dynamic menu update at auto or enable parameter changed - Kickstart saves parameters to EEPROM - M711: Set Fan Kickstart settings: -- R : Reset to defaults -- S[0-255] : Fan speed when fans first start -- D : Set Kickstart duration (ms) -- E[0|1] : Turn Kickstart feature on or off -- Examples: -- M711 ; Report current Settings -- M711 R ; Reset SDE to defaults -- M711 S255 ; Set Kickstart fan speed to 100% -- M711 E0 ; Set Kickstart to OFF -- M711 E1 S180 D100 ; Set Kickstart to ON, Kickstart fan speed 70%, duration to 100 milliseconds Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/src/lcd/e3v2/proui/dwin.cpp
Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/Configuration_adv.h
Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/Configuration_adv.h
- Added AUTO_FAN_EDITABLE (Enable M712 configurable settings (320 bytes of flash)) - Added AUTO_FAN_MENU (Enable the Extruder Auto Fans submenu (104 bytes of flash)) - Auto Fans saves parameters to EEPROM - M712: Set Extruder Auto Fans settings: -- R : Reset to defaults -- E : Set Extruder fans temperature threshold -- H : Set Chamber fan temperature threshold -- C : Set Cooler fan temperature threshold -- Examples: -- M712 ; Report current Settings -- M712 R ; Reset EHC to defaults -- M712 E60 ; Set Extruder temp to 60 -- M712 E50 H30 C18 ; Set Extruder temp to 50, Chamber temp to 30, Cooler temp to 18 Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/src/lcd/e3v2/proui/dwin.cpp
Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/Configuration_adv.h
Signed-off-by: wlkmanist <[email protected]>
Signed-off-by: wlkmanist <[email protected]> Conflicts: Marlin/src/lcd/e3v2/proui/dwin.cpp
Signed-off-by: wlkmanist <[email protected]>
Signed-off-by: wlkmanist <[email protected]>
Signed-off-by: wlkmanist <[email protected]>
Signed-off-by: wlkmanist <[email protected]>
this is a very thought out PR, have you also made one over @ MarlinFirmware? so a few things if you can help me understand... and how does this work? im not familiar with it. so the fan speed changes based on temperature? I'd like to make a few suggestions, like instead of adding seperate files under src/feature, merge them into controllerfan.cpp/.h. same for under src/gcode/feature/controllerfan, to group M711/M712.cpp with M710.cpp. this way, settings.cpp doesnt have to be changed and it will fall under what do you think? |
Signed-off-by: wlkmanist <[email protected]>
No. I need to check if it uses any ProUI functions.
Any available pins can be used if the board have not controllable fan ports without modification (boards like a creality 4.2.2 just have extruder fan connected to 24v and controller fan in parallel with nozzle fan. BTT SKR boards, as I know, have controllable fan ports). BL-Touch can be used (I just made a modular solution for that connector). You can set pins in config or xxx_pins.h. I was not changed any Marlin pins code, it is work as before.
I am added ~3 independed features:
Maybe, but that features are really independend, doing different things and can work without each other and with different hw build. G-code cpp files may be combined, I think, but not the others as it will be more difficult to understand the code. But may be I am wrong. I will look at the code later.
Overall, that code works for me around three weeks and made my printer really comfortable without any disadvantages. Also code may be near to complete disabled via config. I will continue adding more functionals as this, but now it is usable and stable as I can test. |
No, I can't. There is some different code (at least in dwin.cpp), and I can't test it after merging this. But it can be ported someway.
This PR is ready to merge if we don't need even more controllable Auto Fans now, that will require more memory if that features is enabled (I will do that later with more free time). I am thinking about nozzle fan cooldown speed + temp threshold feature (will be useful when used 3d printed cooling shroud near nozzle, prevents melting it) that will override minimum (if min = 0) speed while hotend above temp threshold but heater is disabled. I can also add Auto Fans speed variables that will work instead of EXTRUDER_AUTO_FAN_SPEED, CHAMBER_AUTO_FAN_SPEED and COOLER_AUTO_FAN_SPEED if AUTO_FAN_EDITABLE is enabled. What do you think about this?
Is it necessary to leave settings.cpp as is? Or you mean that it is better to store settings just in one struct someway? |
this would be good, while temp is still hot fans still on. void update_variable() {
const celsius_t bc = thermalManager.wholeDegBed(),
bt = thermalManager.degTargetBed();
// if bed is near target, heating, or if degrees > 44, ICON indicates hot
if (thermalManager.degBedNear(bt) || thermalManager.isHeatingBed() || (bc > 44)) {
DWIN_Draw_Box(1, HMI_data.Background_Color, 9, 416, 20, 20);
DWINUI::Draw_Icon(ICON_BedTemp, 9, 416);
} you can use this as an example, basically, if hotend/bed is heating, or above a certain temp, the ICON changes. you may have noticed this when printing. the ICON's change when hot/cool. you can use similar code for controlling fan speeds if that helps you out.
so instead of making it one fan speed, it can vary depending on the temperature? here is what I do not understand, the hotend fan is on all the time, so the board would use PWM to adjust the speed? or how would it work using a PIN? so this works the same way for the nozzle/part cooling fan when printing? |
No, it is 2 states for that fans: on and off. That variables sets speeds for "on" state. Fans enabed after reaching its temperature threshold. This is Marlin behavour, I am not going to change that because variable Auto Fans speeds having only downsides. We always need maximum possible cooling for the extruder radiator fan and probably for laser too. But in some rare hardware build scenarios changing maximum speed may be useful, or maybe for chamber fan (espesially with g-code). But it would be possible to change semi-dynamically that speeds using any slicer software that would support this gcodes (that feaure is not implemented yet).
Hotend fan is on only after hotend thermistor temp is above specified fan threshold, speeds are on and off, non adjustable automatically. PWM works, under the hood for speeds that non 0 and non 255.
It can be connected with the same hardware schematic like a nozzle/part cooling fan. PIN allows that fan to be controllable, it controls the mosfet of connected fan circuit, like a nozzle fan. You specify the pins corresponding your connection/board in config like it was before this PR and magic works. |
Signed-off-by: wlkmanist <[email protected]>
Signed-off-by: wlkmanist <[email protected]>
I have yet to fully look through this PR. I would like to make a couple changes. the thing is this is not for the average user because of the hardware modifications needed, right? I see you have a jumper wire connected to the driver for E stepper motor and DIO pin. is that so you can enable UART? or is that also needed for the fans |
What kind of changes? |
the changes I'd make is to combine the features, like autofans.cpp, M711.cpp with controllerfan. so instead of having its own file and folder. I would leave the Gcode files, but put them in the same folder as M710.cpp |
This pull request has had no activity in the last 60 days. Please update your branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been adjusting this PR to merge with the more current branch, one question is this:
void ResetMenu(MenuClass* &menu) {
if (menu) {
menu->topline = 0;
menu->selected = 0;
}
}
void InvalidateMenu() {
ResetMenu(CurrentMenu);
CurrentMenu = nullptr;
}
void PrepareRefreshMenu() {
if (CurrentMenu) CurrentMenu->topline = 0;
CurrentMenu = nullptr;
}
PrepareRefreshMenu()
is new/added. would it work the same to just use InvalidateMenu()
in place??
I don't remember right now, but probably no, if I added a new function here. This function should be for refreshing menu after a boolean/checkbox menu variable changed to hide "disabled" functionals. So, current menu index will be the same after that value changed. |
81ec1c0
to
5fcc049
Compare
Description
I added features that I can test someway, we can add more variables.
Tested (except RU locale), works fine. Voxelab Aquila GD32F103.
Requirements
DWIN LCD Display. Controllable fans hw configuration (2-pin fans connected someway to the microcontroller, optional).
Benefits
More controls. Totally silent 3d printer with controllable parameters via display and g-code. We can change any misc cooling parts and really fine tune them without recompilation.
Configuration
See the code.
What added, in short (all of that optional):
Also affects:
G-Code
M712: Set Extruder Auto Fans settings:
-- R : Reset to defaults
-- E : Set Extruder fans temperature threshold
-- H : Set Chamber fan temperature threshold
-- C : Set Cooler fan temperature threshold
-- Examples:
-- M712 ; Report current Settings
-- M712 R ; Reset EHC to defaults
-- M712 E60 ; Set Extruder temp to 60
-- M712 E50 H30 C18 ; Set Extruder temp to 50, Chamber temp to 30, Cooler temp to 18
M711: Set Fan Kickstart settings:
-- R : Reset to defaults
-- S[0-255] : Fan speed when fans first start
-- D : Set Kickstart duration (ms)
-- E[0|1] : Turn Kickstart feature on or off
-- Examples:
-- M711 ; Report current Settings
-- M711 R ; Reset SDE to defaults
-- M711 S255 ; Set Kickstart fan speed to 100%
-- M711 E0 ; Set Kickstart to OFF
-- M711 E1 S180 D100 ; Set Kickstart to ON, Kickstart fan speed 70%, duration to 100 milliseconds
Issues
Controller fan works for me strange way. Works only 0-127 range (remap to 0-255 is existing in code). >127 it is full speed (with soft pwm value 2) or decreasing to zero (128-255) actual speed (with soft pwm 7 + dither). Added another config parameter to fix that (max pwm). Idk is that a base marlin code or just my specific hardware issue. It is 0-255 range for user in the interface anyway (mapping value to the real pwm value).
We need to test this with another pins (I used BLTouch pins) and with soft pwm = 0, disabled dither. But again, issue can be fixed by user using config or just via display settings or G-code.
Photos
I made it that way on my stock Voxelab Aquila board:
(Custom adapter with just 2x ao3400 smd N-channel mosfets connected to BLTouch pins with some resistors (200ohm gate->pins, 100k gate->gnd) and 24v hook (to stock fan connectors on board). Gave me 2 controllable fans. Code should work with any other solutions.)