G Code For Fans

I was wondering if someone could tell me what the G-code command(s) is/are for the three cnc-fan ports on the SKR pro 1.2?

I’ve got a small 12V fan that I am going to position to blow over the heat sinks on my drivers, and I’d like to turn it on when the g-code starts and back off when it ends.

Thanks in advance.

1 Like

M106 sets the fan speed. M107 turn the fan off. The ‘P’ parameter indicates which fan. M106 without a speed parameter, turns the fan on full.

M106 P2   ; Turn on fan 2
M107 P2   ; Turn off fan 2
1 Like

Do you know if all 3 fans are accessible on the SKR 1.2 and the current firmware?

I assume from the ‘1.2’ you are asking about the SKR Pro 1.2. I don’t own an SKR board, but looking in the pins file for the Pro 1.2, there are pins defined for all three fan outputs:

#define FAN_PIN                             PC8   // Fan0
#define FAN1_PIN                            PE5   // Fan1
#define FAN2_PIN                            PE6
3 Likes

I am running RAMPS 1.4 and about to install a 5010 12V fan to keep the driver heat sinks cool.

Now I realise this is not completely necessary but I suspect I am talking amongst like minded genetically predisposed tinkerers!

There are spare unused temperature inputs available on our boards as well as a PWM outputs… which took me wondering down the rabbit hole of:
a.) attaching a spare thermistor to a driver heat sink to keep an eye on driver temperature on the LCD
b.) driving the fan to maintain a max temperature of say 60degC

I am sure it is possible without too much problem although I have fallen at the first hurdle of a.) ! I have connected a thermistor to the temperature input of Ramps 1.4, changed firmware to probe type 30 and the LCD display still displays zero.

Have you noticed there is an inbuilt function within Marlin to automatically turn on the fan when any of the Stepper Drivers are enabled?

It is within Configuration_adv.h

//#define USE_CONTROLLER_FAN