Welcome! Log In Create A New Profile


Correct way to set up the FAN1_PIN?

Posted by TunaGuy 
Correct way to set up the FAN1_PIN?
August 17, 2019 09:27AM

I would like to use a laser with my printer and according this page [marlinfw.org] I should use the fan pin constant to set it up.

So, as the page says, I added #define FAN1_PIN 4 to configuration.h and flashed it to my printer (with BOARD_MKS_BASE board).
However, it does not work, if i do M106 P1 S255, the laser won't turn on at all.
I know the hardware side of it is correct, because I can control the laser without any problems with M42 P4 S255 (but I can't use the M42 in actual printing because it is async and using with M400 causes stops in movement, so I need to get the M106 to work)
Controlling the actual parts cooling fan (FAN_PIN) with M106 P0 Sxxx also works fine

What am I missing here?

Also here is an exert from M43
PIN:   7   Port: H4        E0_AUTO_FAN_PIN             protected 
.                          FAN1_PIN                    protected 
.                          MOSFET_D_PIN                protected 
PIN:   8   Port: H5        HEATER_BED_PIN              protected 
.                          RAMPS_D8_PIN                protected 
PIN:   9   Port: H6        FAN_PIN                     protected

Edited 2 time(s). Last edit at 08/17/2019 09:37AM by TunaGuy.
Re: Correct way to set up the FAN1_PIN?
August 17, 2019 09:42AM
FAN1 is on pin 7 according to the debug.

in pins_MKS_BASE.h is

#define MOSFET_D_PIN 7

in pins_RAMPS.h is (incuded from pins_MKS_BASE.h
#if HOTENDS == 1

so try setting #define MOSFET_D_PIN 4 in configuration.h

But I suspect you going to have to edit pins_MKS_BASE.h and change #define MOSFET_D_PIN 7
to #define MOSFET_D_PIN 4

Edited 4 time(s). Last edit at 08/17/2019 09:50AM by Dust.
Sorry, only registered users may post in this forum.

Click here to login