Adding an extruder-motor cooling fan

Discussions related to the Rostock MAX v2
Post Reply
Solomon Short
Noob
Posts: 3
Joined: Wed Oct 29, 2014 2:37 pm

Adding an extruder-motor cooling fan

Post by Solomon Short »

All,

I have an old Max v2 that I recently upgraded with an E3D v6 Volcano hot-end, and I also added an extruder-motor cooling fan and a new EZR-Struder. In the past, my extruder motor got so hot it would melt PLA during longer prints, or when using larger nozzles, and with the Volcano and the finest nozzle I now own is .6mm (and I have up to 1.2mm), I fully expect that motor to need cooling. Hence the fan.

I wired the motor cooling fan to the Fan-1 slot in the RAMBo (v1.3), which per the wiring diagram codes to Pin 6. I want that fan to be on whenever the EXT0_EXTRUDER_COOLER is active. I changed the Configuration.h file to define

Code: Select all

#if MOTHERBOARD == 301
#define EXT0_EXTRUDER_COOLER_PIN 7
#define EXT0_EXTRUDER_COOLER1_PIN 6  //This is the extruder motor cooling fan
Where the new fan is mounted to the EXT0_EXTRUDER_COOLER1_PIN.

For simplicity, I could wire the fan to 12V and run a switch to it like I have for some LEDs. I'm trying to learn to code a little so I can eventually do some programming with my kiddo, which is why I'm taking the more complicated route.

What is the simplest way to made this second fan turn on and off with the extruder cooler in Repetier.ino file? I have started a C++ course online to try to help, but am an absolute beginner to programming and it's mostly still Greek to me.

Is there a way to go through the code and either define the EXT0_EXTRUDER_COOLER in a way that activates both pins PIN [6,7] as an array (??), or of adding a line somewhere where all the calls to turn on the Extruder Cooler activate both fans?

Any help is appreciated!

Solomon Short
Solomon Short
Noob
Posts: 3
Joined: Wed Oct 29, 2014 2:37 pm

Re: Adding an extruder-motor cooling fan

Post by Solomon Short »

Replying to myself. I have a friend who used to code for a living and loves Arudino, he helped.

I wanted the programming to be clean, and I wanted the extruder motor cooling fan to run when the extruder cooler was running, simply because if the hot-end is hot, the cold-end will usually be running soon anyway (except for calibration, of course). And fans are cheap. Here is the code we added.

Specs: Arduino version 1.6.0
Rostock Max v2
RAMBo V1.3
Firmware 0.92.2 dated 12/04/2017

Tabs Referenced:

Configuration.h - Search for 301 (rostock max v2) and you should find it. In my code it's around line 155

Code: Select all

// ### EXT0 Setup ###
...
#if MOTHERBOARD == 301 
#define EXT0_EXTRUDER_COOLER_PIN 7  
#define EXT0_EXTRUDER_COOLER1_PIN 6 // Defines the pin wired to the extruder motor cooler fan. On RAMBo v1.3 this MOSFET is marked FAN-1
...
#define EXTRUDER_FAN_COOL_TEMP 40 // I changed this to activate at a lower temperature threshold
#define EXT0_EXTRUDER_COOLER_SPEED 255
#define EXT0_EXTRUDER_COOLER1_SPEED 255 

HAL.cpp - (line ~775)

Code: Select all

if(pwm_count == 0 && !PDM_FOR_COOLER)

/*#if defined(EXT0_HEATER_PIN) && EXT0_HEATER_PIN > -1 && EXT0_EXTRUDER_COOLER_PIN > -1
        if((pwm_cooler_pos_set[0] = extruder[0].coolerPWM) > 0) WRITE(EXT0_EXTRUDER_COOLER_PIN, 1);
        #endif */    // Original code that we changed to the below:
        
#if defined(EXT0_HEATER_PIN) && EXT0_HEATER_PIN > -1 && EXT0_EXTRUDER_COOLER_PIN > -1 // New code added 8/2/2020
        if((pwm_cooler_pos_set[0] = extruder[0].coolerPWM) > 0) 
        {
          WRITE(EXT0_EXTRUDER_COOLER_PIN, 1);
          WRITE(EXT0_EXTRUDER_COOLER1_PIN, 1); // activates extruder motor cooler fan - 8/2/2020
        }
#endif 
HAL.cpp - (line ~825) - enabling PDM for the cooler fans (but, from what my friend could gather, it's not used on my printer. No clue, honestly)

Code: Select all

#if PDM_FOR_COOLER
    pulseDensityModulate(EXT0_EXTRUDER_COOLER_PIN, extruder[0].coolerPWM, pwm_cooler_pos_set[0], false);
    pulseDensityModulate(EXT0_EXTRUDER_COOLER1_PIN, extruder[0].coolerPWM, pwm_cooler_pos_set[0], false);
#else
    if(pwm_cooler_pos_set[0] == pwm_count && pwm_cooler_pos_set[0] != 255) 
    {
      WRITE(EXT0_EXTRUDER_COOLER_PIN,0);
      WRITE(EXT0_EXTRUDER_COOLER1_PIN,0); // added for the cold-end cooler fan
    }
#endif

Printer.cpp - (line 774) - sets the output for the cooler fans (I think)

Code: Select all

#if defined(EXT0_EXTRUDER_COOLER_PIN) && EXT0_EXTRUDER_COOLER_PIN>-1
    SET_OUTPUT(EXT0_EXTRUDER_COOLER_PIN);
    WRITE(EXT0_EXTRUDER_COOLER_PIN,LOW);
    SET_OUTPUT(EXT0_EXTRUDER_COOLER1_PIN); // added for the new fan.
    WRITE(EXT0_EXTRUDER_COOLER1_PIN,LOW); 
#endif
I hope it helps anyone printing one of the cooler fans off of Thinginverse (I used: https://www.thingiverse.com/thing:1705843), but of course anything that holds a fan will work. I used a 40mm fan from Radio Shack which I bought back when that was a place you could visit in most cities.

Thanks for reading. Best of luck and happy fabbing.

Solomon Short
Post Reply

Return to “Rostock MAX v2”