Skip to content

shrx/bambu-p2s-gcode-annotated

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Annotated Bambu Lab P2S Machine Start G-code

Original and annotated versions of the default machine start (pre-print) G-code for the Bambu Lab P2S 3D printer, as shipped with Bambu Studio 2.5.0.66 (G-code version 2026/02/26).

Files

  • machine_start.gcode — Original start G-code
  • machine_start_annotated.gcode — Annotated copy with documentation comments

Annotation approach

  • Every line is documented with a comment explaining what it does
  • Only confirmed information is included, unknowns are marked with TODO
  • Bambu's own inline comments are preserved as-is
  • Slicer template syntax ({if}, {else}, {endif}, [variable]) is explained in context

What's covered

  • Standard Marlin G-codes (G0/G1, G28, G90/G91, M104/M109, M140/M190, M106, etc.)
  • Bambu-proprietary commands (M1002, M620/M621, M960, M970/M974/M975, G150.x, G380, etc.)
  • Slicer conditional logic and template variables
  • LCD/app status messages (M1002 gcode_claim_action) with display strings from BambuStudio source
  • AMS filament handling, flow dynamics calibration, vibration compensation, build plate detection
  • P2S-specific commands not present on older models (G150.x wiper system, G130 purge line, M1010 load cell, G3811 obstacle detection)

Known issues in stock G-code

As of G-code version 2026/02/26 there are two issues present in stock G-code, as documented by community members:

  • Redundant homing: An unconditional G28 after the bed leveling block re-homes every print even when ABL already homed (source)
  • Noise reduction ordering: M982.2 S1 (cog noise reduction) is called before M975 S1 (input shaping), but depends on it. Therefore it has no effect during the noisiest startup phases (source)

Disclaimer

The G-code itself is authored by Bambu Lab and ships as part of Bambu Studio (AGPL-3.0), in resources/profiles/BBL/machine/. This repository only adds documentation comments and does not modify the original G-code. Bambu Lab is not affiliated with this project.

References

Community G-code documentation

P2S-specific

Official Bambu Lab sources

Other

About

Annotated Bambu Lab P2S Machine Start G-code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages