What is the data format for gcode M106 Sxxx parameter?
 
Notifications
Clear all

What is the data format for gcode M106 Sxxx parameter?  

  RSS
wolfgang.k5
(@wolfgang-k5)
Active Member
What is the data format for gcode M106 Sxxx parameter?

Hello,

what is the data format for gcode M106 Sxxx parameter? Is it integer or floating point? From PrusaSlicer I get values like S84.15 or S170.85.

I know, that this is a calculation of the dynamic fan speed of the filament cooling settings, but does i3 MK3S firmeware interpret this value correct?

Regards Wolfgang

Posted : 29/05/2021 11:22 am
bobstro
(@bobstro)
Illustrious Member
RE: What is the data format for gcode M106 Sxxx parameter?

Per the Marlin docs, it's a value between 0 and 255. No idea what happens to non-integer values, but the fan speed does adjust. 

Are you having a problem or is this just an observation? You could try connecting with a terminal program and issuing a few such commands to test.

My notes and disclaimers on 3D printing and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan...
Posted : 29/05/2021 12:38 pm
wolfgang.k5
(@wolfgang-k5)
Active Member
Topic starter answered:
RE: What is the data format for gcode M106 Sxxx parameter?

@bobstro

Thank you for your fast reply. Yes, up to now it is more an observation but I'm not sure, if the fan spins correct. Hard to see it and there is no option (gcode) to read back the value. I will try to test it.

Maybe somebody from the Marlin developers also read my question and can answer.

Wolfgang

Posted : 29/05/2021 3:36 pm
bobstro
(@bobstro)
Illustrious Member
RE: What is the data format for gcode M106 Sxxx parameter?

When viewing the fan speed during a print it always displays as a percentage. I'm not aware of any other way to see what value is used internally. You could try setting it to a whole number at the terminal, viewing the resulting speed % in the menu, then setting the speed to a fractional number and view it again. If nothing else, you can verify that the speed stays within a percentage point of the value specified. Other than that, I wouldn't worry too much about it.

My notes and disclaimers on 3D printing and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan...
Posted : 30/05/2021 4:56 am
wolfgang.k5
(@wolfgang-k5)
Active Member
Topic starter answered:
RE: What is the data format for gcode M106 Sxxx parameter?

@bobstro

I did some tests and from my observation it doesn't matter if you use integer or floating point numbers. But during testing and verifying gcode for M106 commands, generated by PrusaSlicer 2.3.1, I observed the following behaviour:

My filament cooling settings(it's in German, I hope you can map it)

And in the generated gcode I find the following M106 commands

So from my understanding the fan should spin from layer 6 with 15% or in Gcode M106 S38.25 then adding some % up to layer 10 for 30% or in Gcode M106 S76.5. I do not understand the values in the screenshot above line 1 to 14 (the screenshot is the M106 extract out of the gcode).

Any idea?

Wolfgang

This post was modified 2 months ago by wolfgang.k5
Posted : 30/05/2021 3:52 pm
bobstro
(@bobstro)
Illustrious Member
RE: What is the data format for gcode M106 Sxxx parameter?

Back in the mid-1980s, I had some work translating X.25 technical documentation from German to English for a company that was working on products for ISDN networks. My German is definitely rusty, but I can still follow along some!

When you set Enable auto cooling (1), PrusaSlicer will use a speed between your minimum & maximum percentage settings (2) When layer speed is below the Enable fan if layer print time is below option (3). The exact speed will be proportional to the amount of time below that threshold (20 seconds in your example). The fan should be set to 15% (your min setting in 2) for layers > 20s.

In your extracted M106 lines, I see a lot of M106 S38.25 which is 15% of 255, so what I'd expect to see for layers that take more than 20s to print. The values greater than 38.25 make sense. The first values of 7.65, 15.3, and 22.95 likely correspond to the gradual ramping up (starting low and working up) towards 38.25 because of the Full fan speed at layer setting ("Volle Lueftergeschwindigkeit" - 10 in your example). If you hover the mouse over each setting, a (vague) pop up windows should give you some hints as to what's going on.

It's hard to say without seeing your actual print or gcode what's going on, but those settings don't strike me as unexpected. Save your current  3MF project file, zip it up, and attach it to a reply here so we can see your part & settings and give better suggestions.

 

My notes and disclaimers on 3D printing and miscellaneous other tech projects
He is intelligent, but not experienced. His pattern indicates two dimensional thinking. -- Spock in Star Trek: The Wrath of Khan...
Posted : 30/05/2021 7:25 pm
Share: