MKS-base 1.4 and PWM Support for Layer Fan

The programming behind the Tarantula
Post Reply
User avatar
royg
Posts: 116
Joined: Tue Mar 28, 2017 10:56 pm
Location: Australia
Has thanked: 38 times
Been thanked: 31 times

MKS-base 1.4 and PWM Support for Layer Fan

Post by royg » Sat Jul 01, 2017 1:00 am

Does anyone know if the MKS-base 1.4 board supports PWM control of the Layer Fan Speed ?

The Marlin documentation at marlinfw.org in the configuration.h section, indicates that PWM control of the Layer Fan is a feature of the current version of Marlin. And the Marlin documentation for the M106 gcode command indicates that you can provide a number between 0 and 254 as the fan speed (M106 [P<index>] [S<speed>]). According to the RepRap printer's web site, those printers also accept an alternative speed value in the range of 0.0 up to 1.0.

But neither of those options work for me. All I can get for the layer fan speed is M106 being Layer Fan ON at full speed, and M107 being Layer Fan OFF.

Anyone got any ideas ?

Regards,

RoyG
Tevo Tornado (MKS Gen L version) - Genuine E3dV6 - BLTouch
Tevo Tarantula with a Laser Cutter/Engraver Add-on.
OctoPi (on an Odroid XU4)
Fusion 360, Cura, Slic3r, Ideamaker

JaY_III
Posts: 61
Joined: Sun Apr 09, 2017 9:08 pm
Location: Ontario Canada
Has thanked: 5 times
Been thanked: 5 times

Re: MKS-base 1.4 and PWM Support for Layer Fan

Post by JaY_III » Sat Jul 01, 2017 3:23 am

no PWM with MKS boards as they are all 2 pin fans.
You need at least 3 pins.
Ground
12V(or 24V)
PWM

If you are using a standard PC Fan it will need 4 wires,
black = ground
red = 12V
Yellow = tach
Blue = PWM

Tach is not needed for PWM, you just will not be able to monitor the RPM without it.

User avatar
royg
Posts: 116
Joined: Tue Mar 28, 2017 10:56 pm
Location: Australia
Has thanked: 38 times
Been thanked: 31 times

Re: MKS-base 1.4 and PWM Support for Layer Fan

Post by royg » Mon Jul 03, 2017 2:00 am

Well - after some detailed research over the weekend, I've been able to resolve this question myself.

The Marlin Firmware supports both Hardware PWM, and Software PWM, control of the Layer Fan Speed.

Hardware PWM requires four wire type computer fans. But, the MKSBase 1.4 boards only have 2 pin connectors for the Layer Fan. So, on the MKSBase 1.4 board, we can only use Software PWM to control the speed of the Layer Fan (unless we muck around reassigning pins in the firmware).

Software PWM is what we already use to control the heating of the Hotend and the heated bed.

In Jim Brown's Marlin Configuration for the Tevo tarantula, Software PWM is disabled by default. To enable Software PMN for the Layer Fan, only one change is required in the "Extra Features" section of Configuration.h:

// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
// is too low, you should also increment SOFT_PWM_SCALE.
#define FAN_SOFT_PWM


The only change required in configuration.h is to uncomment the "#define FAN_SOFT_PWM" line.

To set the fan speed manually with a Gcode, use M106 to start the fan, and M107 to stop the fan.

The Gcode syntax for changing the layer fan speed is; M106 S###

where ### is a number between 1 and 128. 1 is slowest speed and 128 is full speed.

I tried three different types of fans that I had on hand for testing; a 4010 Axial fan, a 5020 Centrifugal Fan, and a 9540 Centrifugal Fan. They were all 12 volt fans, and were all driven directly from the Fan port on the MKSBase 1.4.

In all three cases, the fans would not start-up from stationary if the speed command was less than around M106 S40. For instance, if I sent M106 S20, the fan would remain stationary. You would need to test your own fan to find out what it's minimum start-up speed is, and then ensure that the Layer Fan settings in your Slicer software never calls for less than that speed.

So, there it is - Software PWM control of the speed of the Layer Fan on a Tevo Tarantula works, and works well, and it a standard feature in Marlin and in the MKSBase 1.4.

I hope that information is useful, or at least interesting.

Regards,

Roy Gilby
Tevo Tornado (MKS Gen L version) - Genuine E3dV6 - BLTouch
Tevo Tarantula with a Laser Cutter/Engraver Add-on.
OctoPi (on an Odroid XU4)
Fusion 360, Cura, Slic3r, Ideamaker

User avatar
Charles
Posts: 96
Joined: Thu Mar 23, 2017 5:02 pm
Has thanked: 5 times
Been thanked: 33 times

Re: MKS-base 1.4 and PWM Support for Layer Fan

Post by Charles » Mon Jul 03, 2017 5:57 am

Software PWM for the layer fan has always worked for me. I did not need to change any Marlin settings in the firmware. You do have to watch the min value though. The fan stalls below a certain value.


Charles

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest