Low speed ventilation override gcode during print?

Hello!

New to Bambu and any variation of this slicer studio, been printing for years, and am looking to hook up this H2S vent this weekend.

I am wondering if there’s some gcode I can use to trigger the ventilation fan at it’s minimum possible speed to draw just the smallest amount of negative pressure on the enclosure.

Specifically looking to do this when printing anything containing styrenes. I do understand this will impact chamber heating, hence minimal speed. I intend to start doing a decent amount of ASA and after my own prior experience with the toxicity of this stuff (I’ve been developing injection molding processes for the last 15 years) I have no desire to repeat that at home.

While we are at it, is there a way I can push gcode to the printer directly to test such functions?

You can’t inject G-code directly into a Bambu printer mid-print like you could with other machines.

Instead, you can set up a printer profile that will contain G-code to command the printer to run the fan at a low speed.

Go into the printer’s settings, there is a tab called “Gcode”, you can add in M106 P3 S10 somewhere appropriate - maybe in the layer change section, that will overcome any other functions trying to turn it off. Hopefully.

You’ll need to save that profile with a unique name, and make sure it’s the selected machine when slicing a file.

(I believe P3 is the code for the chamber fan, but it may vary depending on your model of printer)

You may also want to vary the S10 value, it can be anything from 0-255.

Neat. Thanks. I see that if statements and some kind of feedback from the machine seems to exist to make decisions within the gcode, such as:

{if curr_bed_type==“Textured PEI Plate”}

Is there a repository of the various things I may be able to use here to trigger the fan only for specific filament types?

I found this after a quick search so I will start educating myself, but a quick search of “IF” there returns like 100 articles. Unsure if Bambu is using all of this or not. https://marlinfw.org/meta/gcode/

Somewhat unrelated, I would also be interested to know if the H2S has an available output, or if not, some community developed workaround technique that I can trigger for doing external stuff, as yet undetermined.

Not that I’m aware of. The only two IF statements I’ve seen are looking at build plate and filament type.

This is a really good list of G-code commands that Bambu uses.

I think, the if statement is not evaluated by the printer but by the slicer.
If you know C-coding, it’s more like a preprocessor directive that will not appear in the object code.

The list above are the gcode commands that the printer understands. The slicer has quite a few additional capabilities like the if-statement, evaluating formulas and it also has all those variables at hand, that mostly reflect the settings that you can set in all the different dialogues. Curr_bed_type is one of them, reflecting the build plate you selected in bambu studio.

I have no idea if there is a complete list of all available variables. In orca slicer, you can hover over any setting and in the tooltip it will show you the name of the attached variable.

If so, that would be perfectly fine here I think. I will experiment with this a bit and see if I can get the fan to trigger for specific filaments and at various speeds.