Coder Social home page Coder Social logo

bambu_customgcode's Introduction

Custom G-Code for Bambu Studio

Repository for custom g-code for Bambu Studio. It also contains original g-code for reference - in the case that the code needs to be reverted to the stock, check Bambu Studio's repository for the latest available g-code.

Use at your own risk!

See instructions here: https://www.reddit.com/r/BambuLab/comments/11gtlfp/change_filament_gcode_without_ams/

Copyright & License

Copyright (c) 2023 eukadesigns

gplv3-only gplv3-or-later

Donate

Donate

bambu_customgcode's People

Contributors

eukatree avatar ianvs avatar

Stargazers

 avatar George-YK avatar  avatar  avatar Emil Gil avatar  avatar Alex avatar Braden Mund avatar  avatar  avatar  avatar Pavel Zubenko avatar  avatar Dan Afonso avatar Cláudio Varandas avatar  avatar  avatar Alexander Aladov avatar maurok OG avatar Jerod avatar Benas Norgelas-Dzimidas avatar G Zingales avatar SolidSlime avatar Paul Ng avatar  avatar  avatar Dev By Ray avatar Elia Candida avatar Tshine avatar Sean Stevens avatar  avatar  avatar  avatar  avatar Sumit Tada avatar Gareth Watts avatar Travis Rennemann avatar  avatar YaoBoan avatar  avatar Jake Vis avatar Greg Lawrence avatar Jan Georgens avatar Erik Ylipää avatar  avatar  avatar Arvind avatar  avatar Ari Gnepp avatar  avatar  avatar Dennis Skærup Højlund Andersen avatar  avatar Alex Graham avatar Robyn avatar  avatar  avatar Fabian Kästner avatar Jørgen avatar  avatar Piotr avatar  avatar lavachemist avatar Ali Sanjabi avatar Pedro Casaubon avatar  avatar ChopperBTC avatar  avatar Martin Ždila avatar  avatar  avatar  avatar  avatar Madz avatar Devon 'fire' Adkisson avatar Vagelis Panos avatar Dmitry Komarov avatar Bogdan Kecman avatar  avatar Will Metz avatar Bryan avatar Andrew Peal avatar  avatar  avatar Ioannis Alimpertis avatar

Watchers

 avatar Frank Aurich avatar makrio avatar MartinNYHC avatar Dmitry Komarov avatar  avatar  avatar Elia Candida avatar  avatar

bambu_customgcode's Issues

Flush takes a long time when using a 0.2mm nozzle

Hello, and first off thanks so much for sharing this! I couldn't believe it wasn't the stock behavior.

I have to admit, I've changed two things simultaneously, so I can't be 100% certain of what is going on. I updated my firmware to the latest 01.05.02.00 (01.05.01.00 worked great for me), and I also installed a new 0.2mm nozzle.

Now, the flush takes several minutes to complete, and the extrusion is very slow. Performing a manual "Load" action is much faster. Combined with the door being open, it makes quite a stringy mess.

After I'm finished using the 0.2mm nozzle I'll swap back and check again with the 0.4 to confirm whether it was the firmware update that caused this, or the nozzle size (or both I suppose).

GCode throws error: toolchange_count is not a variable name

Bambu Studio Version 1.9.1.66 throws the following error:

filament_start_gcode Parsing error at line 11: Not a variable name {if toolchange_count > 1} ^

Printer: A1 Mini
I used this code:

  • Branch: A1_mini_0.4_mm_nozzle
  • Directory A1_Mini
  • File: change_filament_no_AMS_A1_mini_0.4nozzle.gcode

grafik

Filament change code for A1 mini uses wrong gcode

The gcode files @ https://github.com/eukatree/Bambu_CustomGCode/tree/A1_mini_0.4_mm_nozzle/A1_Mini
are actually for the Bambulab A1, not the A1 mini, it seems.

Specifically this line is likely wrong:

In the gcode for my A1 mini, this line reads:

G1 X180 F18000

The 180 may refer to the A1 mini's smaller bed size of 180mm³.

Here's the full original code from Bamb Studio:

;===== machine: A1 mini =========================
;===== date: 20231225 =======================
G392 S0
M1007 S0
M620 S[next_extruder]A
M204 S9000
{if toolchange_count > 1}
G17
G2 Z{max_layer_z + 0.4} I0.86 J0.86 P1 F10000 ; spiral lift a little from second lift
{endif}
G1 Z{max_layer_z + 3.0} F1200

M400
M106 P1 S0
M106 P2 S0
{if old_filament_temp > 142 && next_extruder < 255}
M104 S[old_filament_temp]
{endif}

G1 X180 F18000
M620.1 E F[old_filament_e_feedrate] T{nozzle_temperature_range_high[previous_extruder]}
M620.10 A0 F[old_filament_e_feedrate]
T[next_extruder]
M620.1 E F[new_filament_e_feedrate] T{nozzle_temperature_range_high[next_extruder]}
M620.10 A1 F[new_filament_e_feedrate] L[flush_length] H[nozzle_diameter] T[nozzle_temperature_range_high]

G1 Y90 F9000

{if next_extruder < 255}
M400

G92 E0
M628 S0

{if flush_length_1 > 1}
; FLUSH_START
; always use highest temperature to flush
M400
M1002 set_filament_type:UNKNOWN
M109 S[nozzle_temperature_range_high]
M106 P1 S60
{if flush_length_1 > 23.7}
G1 E23.7 F{old_filament_e_feedrate} ; do not need pulsatile flushing for start part
G1 E{(flush_length_1 - 23.7) * 0.02} F50
G1 E{(flush_length_1 - 23.7) * 0.23} F{old_filament_e_feedrate}
G1 E{(flush_length_1 - 23.7) * 0.02} F50
G1 E{(flush_length_1 - 23.7) * 0.23} F{new_filament_e_feedrate}
G1 E{(flush_length_1 - 23.7) * 0.02} F50
G1 E{(flush_length_1 - 23.7) * 0.23} F{new_filament_e_feedrate}
G1 E{(flush_length_1 - 23.7) * 0.02} F50
G1 E{(flush_length_1 - 23.7) * 0.23} F{new_filament_e_feedrate}
{else}
G1 E{flush_length_1} F{old_filament_e_feedrate}
{endif}
; FLUSH_END
G1 E-[old_retract_length_toolchange] F1800
G1 E[old_retract_length_toolchange] F300
M400
M1002 set_filament_type:{filament_type[next_extruder]}
{endif}

{if flush_length_1 > 45 && flush_length_2 > 1}
; WIPE
M400
M106 P1 S178
M400 S3
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
M400
M106 P1 S0
{endif}

{if flush_length_2 > 1}
M106 P1 S60
; FLUSH_START
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F50
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F50
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F50
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F50
G1 E{flush_length_2 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_2 * 0.02} F50
; FLUSH_END
G1 E-[new_retract_length_toolchange] F1800
G1 E[new_retract_length_toolchange] F300
{endif}

{if flush_length_2 > 45 && flush_length_3 > 1}
; WIPE
M400
M106 P1 S178
M400 S3
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
M400
M106 P1 S0
{endif}

{if flush_length_3 > 1}
M106 P1 S60
; FLUSH_START
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F50
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F50
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F50
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F50
G1 E{flush_length_3 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_3 * 0.02} F50
; FLUSH_END
G1 E-[new_retract_length_toolchange] F1800
G1 E[new_retract_length_toolchange] F300
{endif}

{if flush_length_3 > 45 && flush_length_4 > 1}
; WIPE
M400
M106 P1 S178
M400 S3
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
M400
M106 P1 S0
{endif}

{if flush_length_4 > 1}
M106 P1 S60
; FLUSH_START
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F50
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F50
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F50
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F50
G1 E{flush_length_4 * 0.18} F{new_filament_e_feedrate}
G1 E{flush_length_4 * 0.02} F50
; FLUSH_END
{endif}

M629

M400
M106 P1 S60
M109 S[new_filament_temp]
G1 E5 F{new_filament_e_feedrate} ;Compensate for filament spillage during waiting temperature
M400
G92 E0
G1 E-[new_retract_length_toolchange] F1800
M400
M106 P1 S178
M400 S3
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
G1 X-13.5 F3000
G1 X-3.5 F18000
M400
G1 Z{max_layer_z + 3.0} F3000
M106 P1 S0
{if layer_z <= (initial_layer_print_height + 0.001)}
M204 S[initial_layer_acceleration]
{else}
M204 S[default_acceleration]
{endif}
{else}
G1 X[x_after_toolchange] Y[y_after_toolchange] Z[z_after_toolchange] F12000
{endif}
M621 S[next_extruder]A
G392 S0
M1007 S1

Reverts to first layer print settings after filament change

"
I tried to use it and it worked but I have issues that I am not sure how to fix. When I changed the filament and it goes to print, it uses the first layer parameters which caused my print to fail because it was on a bridge portion. It turned off the fan and slowed down the print speed (because it thought it was printing the first layer). Any ideas how to fix that?
"

wrong positions for A1 mini

Found some issues on the A1 mini code and patched them as good as I could. Runs smooth for me now:

-flushing takes place on wrong side of the bed --> added the right x coordinate
-extruder doesn't move far enough to the right to succesfully cut the filament --> added a slow move to cut the filament

Instructions for changing the filament with this modified gcode:

;===== Instructions: =====
; when print has paused, go into control
; set the nozzel temp to the temp you were printing with
; unload the filament by pushing on the upper extruder-button
; load the new filament by pushing on the lower extruder-button
; resume the print (flushing will happen next, flushing volumes can be set in Bambu Studio as if using an AMS)

;===Bambu Lab A1 mini 0.4 GITHUB NO.txt

Chute open during purge, may lead to clog

From this comment: https://www.reddit.com/r/BambuLab/comments/11gtlfp/comment/jgz6br3/?utm_source=share&utm_medium=web2x&context=3

It was noted that the chute is open during purge, which means that the purged filament does not roll up. Because it does not roll up, it may get caught in the chute instead of falling all the way through. This could eventually lead to a clog, though the risk may be minimal as it may be noticed by an operator before it becomes a problem. So far this hasn't become an issue, so it will be added as an enhancement once there appears to be a stable P1P firmware.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.