SoftFever / OrcaSlicer

G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)
https://discord.gg/P4VE9UY9gJ
GNU Affero General Public License v3.0
5.86k stars 669 forks source link

Add chamber preheating for Bambu enclosed printers #5742

Open markaudacity opened 1 week ago

markaudacity commented 1 week ago

Is there an existing issue for this feature request?

Is your feature request related to a problem?

The Bambu printer firmware has no concept of chamber preheat, but moving the bed to just below the nozzle and heating it with the aux part fan on does a pretty good job of heating the chamber. Currently, the print will happily start with the chamber temperature far too low to prevent part warping for materials like ABS and Nylon.

Which printers will be beneficial to this feature?

Others

Describe the solution you'd like

It should be simple to add starting Gcode that heats the bed, moves it to position, turns on the aux fan, and runs it until chamber temp equals the chamber temp set in filament options. There is an existing request upstream in the Bambu Slicer forums, but Bambu seems to be rather slow to respond to such requests.

Describe alternatives you've considered

Manually executing the above

Additional context

No response

kylek29 commented 1 week ago

Can't you add this sequence to the Machine Start G-Code? If you use if statements on the filament type variable, you could even make it semi-automatic based on that.

Is this the sequence you're looking for?

  1. Post homing (to prevent Z-crash)
  2. Move bed up to just below the home position.
  3. Turn hotbed on ..
  4. Aux fan to 100%
  5. Chamber Exhaust fan to 0%
  6. Wait for chamber temp to be reached (using chamber temp filament setting).
  7. Proceed ....
markaudacity commented 1 week ago

That's a route I'm pursuing now, but it would be nice if just setting the temperature and clicking the box made it happen.

kylek29 commented 1 week ago

So I tested this at the very end of the Machine G-Code, seems the X1C (my printer) doesn't do anything with the chamber temperature it has access to.

;--- Chamber Heat ---

; Check if the activate_champer_temp_control flag is set in the Filament Settings

{if activate_chamber_temp_control[initial_no_support_extruder]}

    ; Chamber Temperature Control Activated 
    M106 P2 S255 ; turn Aux (Big) fan to 100%
    M106 P3 S0 ; reconfirm chamber fan is off
    M191 F S{chamber_temperature[initial_no_support_extruder]-0} ; Wait for the chamber heat to be reached
    M106 P2 S0 ; turn the Aux fan back off as the X1C's starting point

{endif}

;--- /Chamber Heat ---

Side note, the -0 at the end of this M109 F S{chamber_temperature[initial_no_support_extruder]-0} is an offset value for chamber temperature in the Filament Settings (e.g. if it's set to 80, it waits for 80-5 = 75), this is just so you can set a machine specific value in the Machine G-Code without changing the filament for each printer you may have. Leave at 0 to use the Filament Settings value.

EDIT

I used the wrong command for the chamber, fixed now. Testing something else .. ignore that for now. Be about 30min.

EDIT2

Alright, so I think the X1C firmware is missing these Marlin commands:

M191 -- https://marlinfw.org/docs/gcode/M191.html

Once they add that, it's possible the above example code will work properly. This isn't something that OrcaSlicer can fix, since it's firmware based. With that in mind you could do it with a timer or use the hotend as a remote air temperature sensor (although you'd have to wait for it to cool off to the ambient chamber temp).

This replaces the chamber temperature logic with a 5-minute timer.

;--- Chamber Heat ---

; Check if the activate_champer_temp_control flag is set in the Filament Settings

{if activate_chamber_temp_control[initial_no_support_extruder]}

    ; Chamber Temperature Control Activated 
    M106 P2 S255 ; turn Aux (Big) fan to 100%
    M106 P3 S0 ; reconfirm chamber fan is off
    ;M191 F S{chamber_temperature[initial_no_support_extruder]-0} ; Wait for the chamber heat to be reached
        M400 S300 ; Pause for 5 minutes (300 secs) to let the chamber heat.
    M106 P2 S0 ; turn the Aux fan back off as the X1C's starting point

{endif}

;--- /Chamber Heat ---
SoftFever commented 1 week ago

This requires the firmware to support M191 command: https://github.com/SoftFever/OrcaSlicer/wiki/Chamber-temperature

markaudacity commented 1 week ago

I know that M191 is necessary to send this as a self-contained command, but since the X1 has a chamber-temp sensor that Orca Slicer can read, can't that be used as a variable in a conditional in the startup Gcode?

markaudacity commented 22 hours ago

Based on @kylek29's code (needing to call the number of the extruder to make the chamber temp variable a scalar instead of a vector* is something I never would have figured out), I am using this code which positions the bed right below the aux fan nozzle for best effect, then puts everything back how it was:

{if activate_chamber_temp_control[initial_no_support_extruder]}
    M106 P3 S0              ;verify chamber fan off
    M106 P2 S255            ;turn aux fan on max
    G28 Z P0                ;home Z with low precision
    G90                     ;set absolute positioning
    G1 Z10 F1200            ;lower bed 10mm to place it in the path of aux fan flow
    M140 S120               ;set bed temp
    M190 S120               ;wait for bed temp
    M400 S300               ;wait 5 min for chamber heat
    M106 P2 S0              ;turn off aux fan
    ; restore bed temp for first layer
    M1002 gcode_claim_action : 2
    M140 S[bed_temperature_initial_layer_single] ;set bed temp
    M190 S[bed_temperature_initial_layer_single] ;wait for bed temp
{endif}

*why is it a vector?