M106 Maximum Fan Speed Setting

  • Request

    I would love to see the possibility to configure a maximum speed for a non-temperature-controlled fan. Basically an upper bound to the already existing Lnnn parameter for the minimum speed.


    I want to move temperature and fan control away from the slicer to be able to print the same part with another material without reslicing it. I will therefore create settings-macros for the different filament types I have and call them in my start-codes. I will move heating-related commands in there. Temperatures in Cura will simply be set to 0 and it will not write any Gcodes that control temperature.

    My problem for now is, that the fan is only turned on at second layer and therefore it is not doable to also control the fan speed in my start-code if I do not want it turned on from the beginning so the slicer still has to insert the command at the start of second layer. If I could specify a maximum speed for the fan I would set fan speed in Cura simply to 100% always and add a setting that limits speed according to material type into my macros.

  • @wilriker

    Not sure that I fully understand what it is you want to do but doesn't the "S" parameter do what you want?

  • @deckingman No, the Snnn parameter will set the requested speed. In case e.g. M106 ... L0.2 is defined then any value S <= 0.2 will result in the fan spinning at 20%. What I ask for is something like M106 ... M0.5 so that any value for S >= 0.5 will make the fan spin at only 50%.

    The S parameter is used by the slicer to request the user-defined speed. To make the Gcode material-agnostic I need a way to have the fan spin at 100% for PLA und e.g. 30% for (my current) PET-G. If I keep the speed setting in Cura at 100% it will always put a M106 S255 (equiv. to M106 S1) into the Gcode and with e.g. M106 ... M0.3 I could limit this to 30% if I am printing PET-G but if I print the same part in PLA this limit would be M106 ... M1 and the fan would actually spin at 100%.

    I need this mainly due to the fact that I will turn the fan on only at layer 2 or later and I have no means of injecting any code at this point in time.

  • @gen2eng You are right. I was searching beforehand but I missed it.

  • @wilriker

    OK fair enough. You could look at Slic3R which, from what you say seems to be a little more sophisticated than Cura in this respect as it allows much more control over the fan on a per filament basis. http://manual.slic3r.org/expert-mode/cooling

    Edit. What I mean is that you can define cooling profiles in Slic3R on a per filament basis, including the min and max speeds as well disabling it for the first "n" layers (bit surprised that Cura doesn't allow you to do that).

  • @deckingman said in M106 Maximum Fan Speed Setting:

    Edit. What I mean is that you can define cooling profiles in Slic3R on a per filament basis, including the min and max speeds as well disabling it for the first "n" layers (bit surprised that Cura doesn't allow you to do that).

    Cura does allow for the exact same thing. You can define materials and set temperatures, retraction settings and fan speed to them (actually fan speed does not work - that reminds me that I wanted to file a bug report 😉 ). And when you select your material in Cura it will set these settings accordingly in the generated Gcode. But that is exactly what I want to circumvent.

    Let's make an example: suppose I print a motor mount in PLA because I expect this specific motor not to get even close to warm, so PLA would be fine. I now slice this with 100% fan speed and Cura puts M106 S255 into the Gcode file at layer 2 (that's where Cura starts the fan by default but that is configurable). Also suppose I have implemented my solution that Cura does no longer handle temperatures but my start-code does (as described briefly in first post).

    Now I find out that the motor gets warmer than expected and warm enough to deform the PLA so I decide to reprint the mount in PET-G. Though I control temperatures separately from Gcode I would still have to re-slice the part because Cura put M106 S255 where layer 2 starts but for PET-G I would need to reduce this to 30%, i.e. M106 S82.

    Of course I could download the file and do a search an replace. But with what I intend with this request I would simply limit the maximum fan speed in my start-code (which will have a material-specific part) to 30% and then the M106 S255 that would otherwise let fan spin at 100% would be capped at 30% speed. Et voila, I have material-independent Gcode. 🙂

  • As this is an easy change, I just created https://github.com/dc42/RepRapFirmware/pull/179 for it.

  • @wilriker Ah OK. Sorry, I didn't quite understand what it was you were trying to do. Now I understand.
    I'm actually working on a little Python script that will generate start and end gcodes that I can paste into what the slicer generates. In my case, I often use the same basic gcode file but with different tools and mixing ratios, as well as different materials.

  • @deckingman I changed my start- and end-code inserted to the slicer to be only

    M98 P/sys/print_start.g


    M98 P/sys/print_end.g


    That already reduced a lot of times where I would otherwise have needed to re-slice something. I can even edit these files while the printer is still heating. 😁

    I just want to push this some steps further. 🙂

Log in to reply