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

[FR] Auto or manual fan control during PID autotune #26602

Closed
Tannoo opened this issue Jan 1, 2024 · 20 comments
Closed

[FR] Auto or manual fan control during PID autotune #26602

Tannoo opened this issue Jan 1, 2024 · 20 comments
Labels
T: Feature Request Features requested by users.

Comments

@Tannoo
Copy link
Contributor

Tannoo commented Jan 1, 2024

Is your feature request related to a problem? Please describe.

Controller fan does not operate at all during it's PID autotune.

Are you looking for hardware support?

I don't believe so.

Describe the feature you want

I want the controller fan to run during PID autotune. It works in all other instances.

Additional context

If I start the fan before I start the autotune, it stays running.
If I do not start it before I start the autotune, it does not start until autotune is finished.

@Tannoo Tannoo added the T: Feature Request Features requested by users. label Jan 1, 2024
@classicrocker883
Copy link
Contributor

what UI are you using? printer information?

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 2, 2024

Usually Octoprint

BTT SKR 3 EZ stuffed into an Anycubic Kobra Max.
Configurations.zip

@classicrocker883
Copy link
Contributor

have you tried PID_FAN_SCALING? check out Configuration_adv.h

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 2, 2024

Yes. I have it enabled. I cannot find the relevance.

The controller fan works manually or by heating the bed.

It does not, however, turn on when the bed PID autotune is running. Only AFTER the PID autotune is finished the controller fan comes on.

@Tannoo Tannoo changed the title [FR] Auto or manual fan control during PID autotunes [FR] Auto or manual fan control during PID autotune Jan 2, 2024
@classicrocker883
Copy link
Contributor

classicrocker883 commented Jan 4, 2024

for MPC was MPC_INCLUDE_FAN or MPC_FAN_0_ACTIVE_HOTEND
enabled?

there may be a setting like that which needs enabling. otherwise I might be able to make it work as a workaround for now by putting in a function in temperature.cpp

edit:

in said file, under function void Temperature::PID_autotune

add
set_fan_speed(0, speedyouwant);
for "speedyouwant" replace it with 255 for full fan speed or anything under.

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 4, 2024

set_fan_speed(0, speedyouwant);

No, I have not enabled any MPC functions

Reminder.. there is no issue with my hotend fan now. That was an old issue if the fan being wired backwards and it not working.

This issue is the controller fan that works in all instances other than during PID AUTOTUNE.

I have tried making the fan work in temperature.cpp.

I will try this:

    #if ENABLED(PRINTER_EVENT_LEDS)
      const celsius_float_t start_temp = GHV(degChamber(), degBed(), degHotend(heater_id));
      LEDColor color = ONHEATINGSTART();
    #endif

    TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = false);

    **set_fan_speed(0,  255);**

    LCD_MESSAGE(MSG_HEATING);

    // PID Tuning loop
    wait_for_heatup = true;
    while (wait_for_heatup) { // Can be interrupted with M108

@EvilGremlin
Copy link
Contributor

This is not a feature request, this is a bug (incomplete implementation). Controller fan supposed to turn on any active heater or motor. Though this is hardly an issue at all, not much heat from MOSFET

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 4, 2024 via email

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 4, 2024

I was told that the controller fan code is fine.

SO

I made this a FR.

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 4, 2024

During any PID autotune... there are lots of things that are not updated.

The TFT stops getting any info about the printer... no temps, no fan speeds, the only thing is does get is the status messages.
The Octoprint terminal window gets reports on the temperature.... but no fan speeds.

The system also doesn't control my controller fan during this time.

The controller fan will come on as soon as the PID is done... but not during.

So..... if the code is fine. I am asking it as a feature request to make it work.

@thisiskeithb
Copy link
Member

The TFT stops getting any info about the printer... no temps, no fan speeds, the only thing is does get is the status messages.

That is basically expected with serial devices when you run blocking commands. Depending on the TFT firmware (like BigTreeTech's), it will parse & rewrite certain g-codes to be non-blocking, so testing should be done in "Marlin Mode" to bypass any TFT firmware funny business.

@EvilGremlin
Copy link
Contributor

EvilGremlin commented Jan 4, 2024

UI updates doesn't happen because autotune is executed outside regular temp control code. This is also inconsistent behavior which i'd condiser a bug too, but really unimportant one. Not enabling controller fan for PID tune is a bit more of a bug, but you're most likely first person to be bothered about it. Does MOSFET/TRIAC ever get above ~100C? If not - don't bother.

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 4, 2024

So.... why is the autotune SOO important that it has to block everything?

Printing anything does WAAY more than any PID autotune does.
It doesn't block the NEOPIXELS....
So.... why does it block the controller fan?

Screw the TFT, but spit the numbers out to Octoprint. lol ... nice.

I have no idea if the mosfet is getting to whever temp. I would need to run it on it's side. The controller box is like the Ender 3.

@classicrocker883
Copy link
Contributor

what about something like this?
External MOSFET Controlled Fans

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 9, 2024

The issue is not the mosfet. The one on the board works fine.

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 9, 2024

I have an external mosfet for the bed heater that is cooled by the controller fan.

@ellensp
Copy link
Contributor

ellensp commented Jan 9, 2024

educated guess, haven't tried it (my test systems are mostly bare boards. no heaters)

edit Marlin/src/module/temperature.cpp
find

    while (wait_for_heatup) { // Can be interrupted with M108

add this line under it

      TERN_(USE_CONTROLLER_FAN, controllerFan.update()); // Check if fan should be turned on to cool stepper drivers down

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 9, 2024

Thanx. I will try that in the AM.

@Tannoo
Copy link
Contributor Author

Tannoo commented Jan 9, 2024

educated guess, haven't tried it (my test systems are mostly bare boards. no heaters)

edit Marlin/src/module/temperature.cpp find

    while (wait_for_heatup) { // Can be interrupted with M108

add this line under it

      TERN_(USE_CONTROLLER_FAN, controllerFan.update()); // Check if fan should be turned on to cool stepper drivers down

That did it! Thank you!

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests

5 participants