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

[BUG] SINGLENOZZLE M106 fan control without SINGLENOZZLE_STANDBY_FAN #18142

Closed
Brassn opened this issue May 28, 2020 · 10 comments
Closed

[BUG] SINGLENOZZLE M106 fan control without SINGLENOZZLE_STANDBY_FAN #18142

Brassn opened this issue May 28, 2020 · 10 comments

Comments

@Brassn
Copy link

Brassn commented May 28, 2020

Bug Description

When having SINGLENOZZLE enabled but leaving SINGLENOZZLE_STANDBY_FAN disabled the command M106 S255 does no longer change the cooling fan speed if another tool than T0 is active.
M106 defaults to the active tool if the P parameter is omitted, however in this scenario fan 0 must be used.

Previously this was fixed by this line

target = 0; // Always use fan index 0 with SINGLENOZZLE

but since the (otherwise much welcomed) changes from commit 89b17b5 it is no longer active in this scenario.

suggested fix

These changes to temperature.cpp should do the trick:

    #if ENABLED(SINGLENOZZLE)
      #if ENABLED(SINGLENOZZLE_STANDBY_FAN)
        if (target != active_extruder) {
          if (target < EXTRUDERS) singlenozzle_fan_speed[target] = speed;
          return;
        }
      #endif
      target = 0; // Always use fan index 0 with SINGLENOZZLE
    #endif
@boelle
Copy link
Contributor

boelle commented Jun 21, 2020

Configurations, please
Please ZIP up your Configuration.h and Configuration_adv.h files (as
requested in the Issue template) and drop them into your next reply.
We'll check them over and see if anything is amiss.

@Brassn
Copy link
Author

Brassn commented Jun 21, 2020

Configuration.zip
Sorry for deviating from the template

@boelle
Copy link
Contributor

boelle commented Jun 29, 2020

Please test the bugfix-2.0.x branch to see where it stands. If the problem has been resolved then we can close this issue. If the issue isn't resolved yet, then we should investigate further.

@Brassn
Copy link
Author

Brassn commented Jun 30, 2020

I updated to bugfix-2.0.x as of state 34b84d3 but unfortunately the issue remains.

Here is how I tested:
First I made sure my fix is no more in place

C:\Users\myself\Repositorys\Marlin>git diff --name-only upstream/bugfix-2.0.x..bugfix-2.0.x
Marlin/Configuration.h
Marlin/Configuration_adv.h
Marlin/src/pins/ramps/pins_MKS_GEN_13.h

Only minor and unrelated changes to the pin layout were performed aside the configuration. But you may also have a look at them in my fork if you prefer to.

Next connecting to Marlin via Pronterface:

Marlin bugfix-2.0.x
echo: Last Updated: 2020-06-30 | Author: (Brassn)
echo:Compiled: Jun 30 2020
echo: Free Memory: 1593  PlannerBufferBytes: 1216
echo:V81 stored settings retrieved (1058 bytes; crc 58438)
Testing X connection... OK
Testing Y connection... OK
Testing Z connection... OK
echo:SD card ok
Printer is now online.
>>> M106 S255
SENDING:M106 S255
M106 P0 S255

At this point the fan begins to spin, now switching to tool 1 to repeat the process.

>>> M106 S0
SENDING:M106 S0
M106 P0 S0
>>> T1
SENDING:T1
echo:Active Extruder: 1
>>> M106 S255
SENDING:M106 S255

Nothing happens at this point, neither a response nor the fan spinning.

After reapplying my changes as stated in the initial post (or alternatively here) the response is as follows:

>>> T1
SENDING:T1
echo:Active Extruder: 1
>>> M106 S255
SENDING:M106 S255
M106 P0 S255
>>> M106 S0
SENDING:M106 S0
M106 P0 S0

The fan begins and stops to spin accordingly.

@thinkyhead
Copy link
Member

Probably a simple bug. If it's obvious I'll patch it very soon. If I cannot find the bug then I may ask you for some additional testing and feedback.

@firepower9966
Copy link

firepower9966 commented Aug 6, 2020

I also seeing this, no fan when printing single nozzle with 3 extruders. even though my Gcode contains M106 S255 at layer 1
my configuration.h single nozzle is: and using latest bug fix 06/08/2020 (Cura 4.6.1 printer settings: "shared heater enabled", All extruders show "cooling fan number 0")

(also menu shows 3 fans when only have single fan because single nozzle)

// For Cyclops or any "multi-extruder" that shares a single nozzle.
#define SINGLENOZZLE

// Save and restore temperature and fan speed on tool-change.
// Set standby for the unselected tool with M104/106/109 T...
#if ENABLED(SINGLENOZZLE)
#define SINGLENOZZLE_STANDBY_TEMP
#define SINGLENOZZLE_STANDBY_FAN
#endif

update: T1 (E2) has fan but when it switches back to T0 (E1) it have no fan. (i have been manual turning on fan with tune menu to complete prints)

@thordarsen
Copy link
Contributor

I've had this same problem since I updated to after the mentioned PR
From My Octoprint terminal
Send: T0
Recv: echo:Active Extruder: 0
Recv: ok
Send: M106 S255
Recv: M106 P0 S255
Recv: ok
Fan turns on
Switch tool
Send: T1
Recv: echo:Active Extruder: 1
Recv: ok
Cut Fan Speed to 50%;
Send: M106 S127
Recv: M106 P1 S127
Recv: ok
Fan does not change, but in the lcd menu 'Fan Speed 2 is at 50%'
Note that the echo from Marlin specifies fan P1, which should not happen in a single nozzle setup, the expected behavior (I think) is that there is only one Part cooling fan in a single nozzle setup

Switch bact to Tool 0
Send: T0
Recv: echo:Active Extruder: 0
Recv: ok
Send: M106 S127
Recv: M106 P0 S127
Recv: ok
Now the fan is at 50%

Looking at PR [#17712] (url) 89b17b5
It seems like everywhere in the functional code where #if ENABLED(SINGLENOZZLE) existed, it got replaced by #if ENABLED(SINGLENOZZLE_STANDBY_TEMP) or #if ENABLED(SINGLENOZZLE_STANDBY_FAN)

except for this block (repeated in a few places)
#if ENABLED(SINGLENOZZLE)
#include "../../module/tool_change.h"
#endif

I think I know what the I know what the SINGLENOZZLE part of the the PR was doing but it seems to have been overaggressive in the replacements of the flags. Notably this section of Temperature.cpp which only sets the target fan to 0 if the SINGLENOZZLE_STANDBY_FAN flag is set instead of anytime the SINGLENOZZLE flag is set.

#if ENABLED(SINGLENOZZLE_STANDBY_FAN)
if (target != active_extruder) {
if (target < EXTRUDERS) singlenozzle_fan_speed[target] = speed;
return;
}
target = 0; // Always use fan index 0 with SINGLENOZZLE
#endif

Config
Configuration.zip

@thordarsen
Copy link
Contributor

I performed a quick test changing temperature.cpp to: (change in bold)
#if ENABLED(SINGLENOZZLE_STANDBY_FAN)
if (target != active_extruder) {
if (target < EXTRUDERS) singlenozzle_fan_speed[target] = speed;
return;
}
#endif
#if ENABLED(SINGLENOZZLE)

target = 0; // Always use fan index 0 with SINGLENOZZLE
#endif

This worked as expected.

Now to figure out a PR.

@boelle
Copy link
Contributor

boelle commented Sep 15, 2020

this one seems fixed with the pr

closing

we can reopen if not fixed

@boelle boelle closed this as completed Sep 15, 2020
@github-actions
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 Nov 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants