Support M191 G-Code Command (Wait for Chamber Temperature)

And w/ MQTT, you can turn on the bed, the aux fan, and check the chamber temp. Can’t do it in gcode, but a fairly simple python script can do it. i have a script for this. But I been thinking….I bet you could even have the python script masquerade as a post-processing script in OrcaSlicer… It would output the gcode completely untouched, But would run the chamber heating routine.

Can you post you python script please?

1 Like

I’ll dig it out and post it. Maybe I’ll put it on GitHub.

1 Like

Thanks for the input. I took it and refined it a little bit like that:

M1002 gcode_claim_action : 2
{if (activate_chamber_temp_control[initial_no_support_extruder])}
  ;===== HEAT SOAK ====================
  G0 X135 F12000  ; move to exposed steel surface edge
  G0 Y253 F12000
  M400
  G28 Z P0 ; home z with low precision
  G1 Z5 ; Give us 5mm of clearance
  M400
  G1 X60 Y215 ; Move in front of poop chute.
  G1 Y265 F3000 ; Move to the poop chute.
  M400  
  G1 Z0 ; Move the bed up so the cool air from the AUX fan blows across it.
  M106 P2 S255 ; turn ON aux fan at full speed
  M106 P3 S0 ; turn OFF chamber fan
  M140 S110 ; Set bed temperature
  M190 S110 ; Wait for bed temperature
  ; Wait for bed to reach temperature.
  ; Since we're blowing cool air across it, it will take a long time
  ; and will allow for the chamber to heat up.
  M400 S600 ; Wait for at least 10 minutes ; This may not even be needed with the bed temperature high enough.
  
  M106 P2 S0 ; turn OFF aux fan
  G1 Z15 ; Move the bed down for some clearance.
  M400
  G1 Y128 F12000 ; Move toolhead to middle of the bed
  G1 X128  
{endif}

;===== heatbed preheat/cooldown ============
M140 S[bed_temperature_initial_layer_single] ;set bed temp
M190 S[bed_temperature_initial_layer_single] ;wait for bed temp

This way you can tick the box ‘Chamber Temperature Control’ in the filament settings and the heat soaking will automatically happen whenever you print a material that needs it. Works for me but it would be nicer to have M191 available to wait for a specific chamber temp even without an active heater…

Correct. I’m working on a better version that hopefully has some actual feedback, but it’s pretty hard to do since Gcode doesn’t have looping and I can’t find any documentation of the Prusa/Bambu/Orca Slicer placeholder for current chamber temp.

I have implemented that functionality here → G-code for X1C chamber heating and heat soak by Kehali Woldemichael - MakerWorld.

Essentially, the first section has the printer wait until target chamber temperature is reached. This is conditional on target chamber temperature being set above 30ºC and but less than bed temperature.

Then a second section adds a heat soak of fixed length. By default 15 min. Conditional on target chamber temperature being set above 30ºC.

;===== chamber heating - start =======================
{if (chamber_temperature[0] < bed_temperature[current_extruder])||(chamber_temperature[0] > 30)}

G1 X70 F21000 G1 Y245 G1 Y265 F3000 M400; move to poop chute
M106 P2 S255; Switch auxiliary fan on at 100%
M106 P3 S0; Turn off exhaust fan just in case
M1002 gcode_claim_action : 16; LCD Message = “Paused by the user”

M191 S{chamber_temperature[0]}; Wait for target chamber temperature of first filament

{endif}
;===== end - chamber heating =======================

;===== heat soak - start ======================
{if chamber_temperature[0] > 30}

M1002 gcode_claim_action : 5; LCD Message = “M400 Pause”
M400 S900; pause for 900sec/15min
M1002 gcode_claim_action : 7; "Heating hotend " … to differentiate with next step

{endif}
;===== end - heat soak =======================

2 Likes