Welcome! Log In Create A New Profile

Advanced

Start fan after reaching temperature

Posted by SaarNeu93 
Start fan after reaching temperature
December 22, 2020 11:20AM
Hi everyone
Im using an arduino mega + ramps 1.4.
I want to operate the extruder fan through Pin D9 of the ramps, for that to happened I changed in the configuration the Motherboard to be:

#ifndef MOTHERBOARD
  #define MOTHERBOARD 33
#endif

Now, im trying to set the fan to start working once the temperature reach its destination, regardless any gcode files or any other slicing settings. I would appreciate if someone will help me how to do that.
Thanks alot!

Edited 2 time(s). Last edit at 12/22/2020 12:32PM by SaarNeu93.
Re: Start fan after reaching temperature
December 22, 2020 07:48PM
Hi, If you are just looking to control the extruder fan and have it turn on at a specific temperature, the settings for that are in configuration.adv.h

you will see a section that looks like this:

#define E0_AUTO_FAN_PIN -1
#define E1_AUTO_FAN_PIN -1
#define E2_AUTO_FAN_PIN -1
#define E3_AUTO_FAN_PIN -1
#define E4_AUTO_FAN_PIN -1
#define E5_AUTO_FAN_PIN -1
#define E6_AUTO_FAN_PIN -1
#define E7_AUTO_FAN_PIN -1
#define CHAMBER_AUTO_FAN_PIN -1

#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed
#define CHAMBER_AUTO_FAN_TEMPERATURE 30
#define CHAMBER_AUTO_FAN_SPEED 255

All you have to do is change #define E0_AUTO_FAN_PIN -1. Change -1 to whatever your pin is for your fan (ie. D9). To set the temp you want to change #define EXTRUDER_AUTO_FAN_TEMPERATURE 50. Set 50 to whatever temp you want the fan to come on at

Hope that helps

Edited 1 time(s). Last edit at 12/22/2020 08:08PM by Reefsider.
Re: Start fan after reaching temperature
December 22, 2020 09:58PM
So.... I just tried to do this on my machine instead of figuring out how to run the fan output for part cooling. It pulled an error. I'm pretty new to this but this is what all the videos i watched said to do.

Sorry, maybe someone with more experience can help both of us out.
Re: Start fan after reaching temperature
December 23, 2020 01:06AM
you need to show error message
Re: Start fan after reaching temperature
December 23, 2020 03:47PM
Hi, here is the Error message I get:

In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\Servo.cpp:25:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\MarlinSerial.cpp:25:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\eeprom_flash.cpp:32:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
In file included from c:\marlin\dec 2020\final\marlin\src\inc\marlinconfig.h:49:0,
from Marlin\src\HAL\STM32F1\dogm\u8g_com_stm32duino_swspi.cpp:21:
c:\marlin\dec 2020\final\marlin\src\inc\SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\HAL.cpp:30:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\eeprom_bl24cxx.cpp:30:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\HAL_SPI.cpp:32:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\dogm\u8g_com_stm32duino_swspi.cpp.o] Error 1
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\Servo.cpp.o] Error 1
In file included from Marlin\src\HAL\STM32F1\../../inc/MarlinConfig.h:49:0,
from Marlin\src\HAL\STM32F1\SPI.cpp:43:
Marlin\src\HAL\STM32F1\../../inc/SanityCheck.h:1653:8: error: #error "You cannot set E0_AUTO_FAN_PIN equal to
FAN_PIN."
#error "You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN."
^~~~~
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\eeprom_bl24cxx.cpp.o] Error 1
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\eeprom_flash.cpp.o] Error 1
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\MarlinSerial.cpp.o] Error 1
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\HAL.cpp.o] Error 1
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\HAL_SPI.cpp.o] Error 1
*** [.pio\build\STM32F103RC_btt_USB\src\src\HAL\STM32F1\SPI.cpp.o] Error 1
======================================== [FAILED] Took 28.96 seconds ========================================

Environment Status Duration
------------------- -------- ------------
STM32F103RC_btt_USB FAILED 00:00:28.961
=================================== 1 failed, 0 succeeded in 00:00:28.961 ===================================
The terminal process "C:\Users\reefs\.platformio\penv\Scripts\pio.exe 'run', '--environment', 'STM32F103RC_btt_USB'" terminated with exit code: 1.
Re: Start fan after reaching temperature
December 23, 2020 05:33PM
"You cannot set E0_AUTO_FAN_PIN equal to FAN_PIN"

The error is very clear.

auto fans are are controlled by the controller on an event, such as being over a certain temperature.
FAN_PIN is the gcode controlled fan.
These to are mutually exclusive.
You cannot set them to the same pin.
Re: Start fan after reaching temperature
December 23, 2020 06:11PM
oh ok so the gcode will control the fan for the hot end then? I still can't get the fan to work on my TFT24 though. I have compiled it with the fan set to -1 again on the configuration.adv.h file.

There is a button that turns the fan on full (on the TFT24) and you can see it sets it to 255 but the fan doesn't come on. Also when I preheat the hot end the fan doesn't come on. I have tried both fan connectors on the board.

Is there something else I have to activate to make this work?

Edited 2 time(s). Last edit at 12/23/2020 06:13PM by Reefsider.
Re: Start fan after reaching temperature
December 23, 2020 07:40PM
no

there are commonly two fans

1) part cooling fan, this is gcode controlled.
2) extruder cooling fan. this is ether always on, or if you have available mosfets setup as an auto fan to turn on when warmer than 50c

Edited 1 time(s). Last edit at 12/23/2020 09:53PM by Dust.
Re: Start fan after reaching temperature
December 23, 2020 08:28PM
Ok I understand now, thank you very much. Given this information I have done more testing and found that my fan is faulty. There is voltage going out, turning off and on when I use the TFT fan control. There is also continuity in the wires to the fan. The other plug has constant voltage. I will change the fan when I get one.
Re: Start fan after reaching temperature
December 23, 2020 09:09PM
Here is an example I have a Arduino compatible Controller an has the ability to use dual extruder or "EFBE" or for dual fans "EFBF".

In order to set this up for My configuration using Marlin 2.0.6 see below with Hot-ends = 1

Configuation.h
#define MOTHERBOARD BOARD_MKS_BASE_14 // This sets the firmware to use dual extruder or dual fans
#define EXTRUDERS 1


pins_RAMPS.h
#ifndef MOSFET_D_PIN
  #define RAMPS_D7_PIN                         7               // changed from -1 to disable
  #define MOSFET_D_PIN                         RAMPS_D7_PIN
#endif
#ifndef RAMPS_D8_PIN
  #define RAMPS_D8_PIN                         8
#endif
#ifndef RAMPS_D9_PIN
  #define RAMPS_D9_PIN                         9
#endif
#ifndef RAMPS_D10_PIN
  #define RAMPS_D10_PIN                       10
#endif

#define HEATER_0_PIN               RAMPS_D10_PIN

#if ENABLED(IS_RAMPS_EFB )                         // Hotend, Fan, Bed
  #define HEATER_BED_PIN            RAMPS_D8_PIN
#elif ENABLED(IS_RAMPS_EEF )                       // Hotend, Hotend, Fan
  #define HEATER_1_PIN              RAMPS_D9_PIN
#elif ENABLED(IS_RAMPS_EEB )                       // Hotend, Hotend, Bed
  #define HEATER_1_PIN              RAMPS_D9_PIN
  #define HEATER_BED_PIN            RAMPS_D8_PIN
#elif ENABLED(IS_RAMPS_EFF )                       // Hotend, Fan, Fan
  #define FAN1_PIN                  RAMPS_D8_PIN
#elif DISABLED(IS_RAMPS_SF )                       // Not Spindle, Fan (i.e., "EFBF" or "EFBE")
  #define HEATER_BED_PIN            RAMPS_D8_PIN
  #if HOTENDS == 1
    #define FAN1_PIN                MOSFET_D_PIN
  #else
    #define HEATER_1_PIN            MOSFET_D_PIN
  #endif
#endif

#ifndef FAN_PIN
  #if EITHER(IS_RAMPS_EFB, IS_RAMPS_EFF )          // Hotend, Fan, Bed or Hotend, Fan, Fan
    #define FAN_PIN                 RAMPS_D9_PIN
  #elif EITHER(IS_RAMPS_EEF, IS_RAMPS_SF )         // Hotend, Hotend, Fan or Spindle, Fan
    #define FAN_PIN                 RAMPS_D8_PIN
  #elif ENABLED(IS_RAMPS_EEB )                     // Hotend, Hotend, Bed
    #define FAN_PIN                            4  // IO pin. Buffer needed
  #else                                           // Non-specific are "EFB" (i.e., "EFBF" or "EFBE")
    #define FAN_PIN                 RAMPS_D9_PIN
  #endif
#endif

You should now see dual fan controls on the LCD Display and allows you to control the fans using.
M106 P0 S128 ; P0 = 1st Fan 1/2 Speed
M106 P1 S192 ; P1 = 2nd Fan 3/4 Speed
It has been awhile so if something is missing Dust or someone else will fill in what is missing.

Edited 4 time(s). Last edit at 12/23/2020 09:16PM by Roberts_Clif.


Computer Programmer / Electronics Technician
Sorry, only registered users may post in this forum.

Click here to login