How can I add an extra fan, controlled by a microcontroller, to my board?

  • I recently discovered this kit after reading this Instructables, Adding More Extruders to Any 3d Printer:

    CNC Shield v3 engraving machine / 3D Printer / + 4pcs A4988/DRV8825/AT2100 Driver Expansion Board for Arduino

    I'm pretty sure I can use this kit with my board since it uses the same drivers as mine. But that's for motors, not fans. And while I know G-code pretty well, I'm not sure how I would use this to activate and deactivate a fan from G-code. There is probably a better way to do this.

    The board I am using is from an FLSUN Large Scale 3D printer. Here is a picture of the board:

    FLSUN printer board

    There appears to be only one labeled pin for the fan. BUT even if there are other pins that I don't recognize, they would have to be controlled by a micro controller (G-code commands). There appear to be a bunch of un-used pins in the bottom right of the board. But if this board just can't do it, there is a newer board here: [link removed].

    It does seem like it is using Arduino and the newer board might have extra pins for a fan. But at that point, would it be easier (cheaper) to just control the fan from the extruder extender kit? Would I just set it as an extruder with a really high filament extrusion speed and send appropriate G-code commands when needed to run it at max voltage?

    I know on my Lulzbot Mini there is a "parts cooling" fan which allows you to cool off the layers as your structure rises vertically. This is a fan I want. The parts cooling fan must be controlled by the micro controller. It only comes on when printing vertically.

    I would like to actually add two fans like this to my 3D printer. One of them is a >= 5 V cooling fan like above. Another is a regular 12 V cooling fan for an extra extruder that I am adding.

    Am I even able to use two motors at once? Assuming I was able to control a fan from the extruder extender... Would I be able to run the fan, and keep printing, then turn off the fan later?

    I could use the LCD pins somehow?

    I was wrong, you'll just need custom firmware. Your wiring diagram is wrong though.

    Adding fans has been discussed in other questions, why does it specifically need to be through an additional microcontroller as it can be done by your current board/microcontroller.

    @Oscar I can control it by the same microcontroller, there doesn't need to be an additional microcontroller. The problem with this question was that I didn't notice there was even a pin for a microcontrollable fan! It wasn't labeled in the assembly manual and was off in the distance.

    Ok, Steve, thanks for the update. I have added an image of the product rather than a link, as it is more appropriate. Now, regarding the second link, apparently it sets off virus warnings. @0scar noticed them this morning

    Note: With the firmware it is shipped, the FAN port is 100% all the time. you need to re-pin the software, but you have lots of other free pins that could be programmed for though

  • Trish

    Trish Correct answer

    3 years ago

    The MKS Gen L v1.0 Board you are using does support microcontroller controlled fans without doing some surface level modification to the board via the D9/FAN. The port you marked FAN is not a controllable port, it runs a direct 12/24 V all the time and should be used for the Hotend cooling solution. The ports D7/HE1 and D10/HE0 are for two hotendes, corresponding to E0 and E1.

    MKS Gen L port/pin layout

    Variant A: Swappy Fans

    This is the more tricky variant and does need both coding and wiring expertise.

    You'll have to run both hotend cooling fans via that one port in the top left corner. Make sure they are running fast enough to keep the heatsinks cool and prevent heat creep!

    Your custom Firmware will have to define D9 as a microcontroller controlled Fan instead of a 100 % running fan as the normal firmware is most likely.

    Without extra hardware, you can't get 2 individually controllable ports from D9, but you can use, the fact that you don't want part cooling for a hotends in 'resting' position. So a pair of couple Normally Closed switches cab achieve disabling of the resting hotend's part cooling fan:

    • make a wire splitter for D9, so that you have both + and both --wires connect to the one +/--pin on the board. You'll have the part cooling fans in parallel now.

      • Do the same for the Hotend Cooling Fans!

    • connect each +-line to a Normally Closed switch, which is installed on the hotend in a way so it triggers and opens the line if the hotend is in the resting (homing) position.

    • As the line connects when the hotend moves into the build volume, the part cooling fan on the currently active hotend starts to spin while the one of the non-active hotend is isolated.

    Variant B: MOSFETs and Safety

    An alternate source for the part cooling fan signals might be the SERVOS1/SERVOS2 group, where D4 to D6 and D11 are accessible. This leaves the FAN and top-left 12 V pinnings free for the hotend cooling. The downside is, that these pins don't likely provide 12 V but at best a 5 V digital output. However, a 0 to 5 V signal can be used to control a separate MOSFET which outputs 0 to 12 V, which then can power the part cooling fans. Due to the power draw of the Fans, a simple step-up converter is not a solution it needs a separate power supply.

    The Main benefit is, that this does draw less power from the board than Variant A and does not re-pin D9. The "Cooling Fan Board" could use a 6-line ribbon cable to connect to the SERVOS1 pins, using the 5V as reference for the MOSFETs, D4/D5 as the trigger signal and GND as return lines.

    A pre-assembled board that could serve in this position would be a L298N Driver. Due to how it is set up, one could run both part cooling fans, if their speed is set up to be always equal.

    WOW I missed that open one. Thank you!!! What circuit hardware would I need to extend this port into two controllable ports?

    For your information, the MKS GEN L is basically a RAMPS board as the pin layout of the RAMPS configuration is used in the firmware of the MKS GEN L (see e.g. the Marlin source code).

    @KMmmm I am far better on the hardware side... The Code snippet linked by 0scar uses the pins in `AUX1`. The 5V fans spin slowly because the board only provides a very low current of the right voltage but the fans need considerably more.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM

Tags used