Carefully tuned, optimized, and documented G-code for Bambu Lab P1S printers, with full AMS support.
Made to give you a more controlled printing workflow tailored to your priorities: reliability, balance, or speed.
Last validated on P1S + AMS β 2026-03-04
Recommended slicer: OrcaSlicer
Note that you may need to Enable "Advanced Mode" in your Slicer to change Start and End G-code.
- View stock Start G-code β RAW
- View stock End G-code β RAW
SOURCES β Click to expand
Last checked β 2026-02-06
These custom G-codes use adaptive bed leveling to check and re-probe the mesh only when necessary.
Warning
BED LEVELING needs to be ON before printing.
π₯ CLICK Here to preview the L Profile (VIDEO SHOWCASE).
Choose the G-code variant that aligns with your workflow:
- π© XL β Reliability & Cleanliness First
- π¦ L β Balanced for Everyday Printing (Creator Used) (Recommended)
- π§ S β Performance / Speed-Oriented
Note
Want more options? Check out Optional Add-ons.
Stars represent feature intensity, not quality:
- β β β β Highest / most thorough
- β β β Balanced
- β β Minimal / fastest
Numbers (e.g., 24 wipes) appear for measurable operations.
| Feature | π© XL-Start G-code π© | π¦ L-Start G-code π¦ | π§ S-Start G-code π§ |
|---|---|---|---|
| Click to View File β or View RAW Text β |
|||
| Runtime Please note that runtimes can be as short as ~2 minutes (L-profile) if your bed mesh is valid. |
~5 minutes | ~4 minutes | ~2 minutes |
| Startup Speed (1) | β | β β | β β β |
| Startup Reliability (2) | β β β | β β β | β |
| Initialization Depth (3) | β β β | β β | β |
| AMS Verification (4) | β β β | β β β | β β |
| Purge Volume (5) | β β β High | β β Medium | β Low |
| Bed Mesh Strictness (6) | β β β High | β β β High | β Low |
| Thermal Stabilization (7) | β β β Strict | β β Light | β Minimal |
| Temperature Staging (8) | β β β Multi-stage | β β Optimized | β Minimal |
| Wipe Count (9) | β β β 24 wipes | β β 16 wipes | β 8 wipes |
| Purge Line (10) | Yes | Yes | No |
| Best For | Infrequent printing | Regular daily printing | Fast, high-turnover printing |
Note
If your print is not sticking to the bed or you want to enable Z-offset control, delete the leading ";" (uncomment) the Z-offset line β most often line 28:
; G29.1 Z{-0.02} ; Z-offset -0.02mm (negative = closer to bed, positive = farther)
Adjust the value as needed to fine-tune bed adhesion/Z-offset.
| Feature | π© XL-End G-code π© | π¦ L-End G-code π¦ | π§ S-End G-code π§ |
|---|---|---|---|
| Click to View File β or View RAW Text β |
|||
| Runtime | TBA | TBA | TBA |
| Shutdown Speed (11) | β | β β | β β β |
| Unload Reliability (12) | β β β High | β β β High | β β Medium |
| Post-Print Purge (13) | β β β High | β Low | β Low |
| Nozzle Wipe After Print (14) | Extended | Moderate | Minimal |
| Cooldown Staging (15) | Multi-stage | Balanced | None |
| AMS Unload Confidence (16) | High | High | Medium |
| Best For | Long idle periods | Balanced routine use | Rapid printing |
The following previews show the L Profile in action and the difference in printing when:
- a stored bed mesh is still valid
- a stored bed mesh is invalid and requires re-probing
Both instances used the same L Profile (L-Start & L-End) G-code and printer state, with only the mesh condition changed.
Bed mesh validation starts at 2:16.
CLICK HERE TO EXPAND AND VIEW VIDEO
L_PROFILE_BED_MESH_VALID.mp4
CLICK HERE TO EXPAND AND VIEW VIDEO
L_PROFILE_BED_MESH_INVALID.mp4
*IF "Playback failed due to network error" β Refresh the page.
Expand START feature explanations
How quickly the printer reaches a print-ready state.
β
= Slowest, β
β
= Balanced, β
β
β
= Fastest
How thoroughly the printer validates AMS, temps, resets.
β
β
β
= Highest reliability
Extent to which the printer resets its internal state (motors, offsets, flow control).
How strictly filament presence and loading are checked.
More stars = more consistent AMS behavior
Amount of material extruded to clear residual filament.
More stars = cleaner first layers
How rigorously the stored bed mesh is verified and applied.
How evenly the nozzle temperature stabilizes before printing.
Number of controlled temperature steps before printing starts.
Number of nozzle wipe passes for cleaning (XL β 24 passes).
Whether a purge line is printed before the first layer.
Expand END feature explanations
How quickly the printer completes post-print shutdown routines.
β
= Slowest, β
β
β
= Fastest
Thoroughness and safety of the AMS filament unload process.
β
β
β
= Most thorough
Amount of filament purged after the print to clear residue.
Intensity of wipe actions after the job finishes.
Whether cooling occurs gradually (XL) or rapidly (S).
Reliability of returning filament to AMS slots.
- Select your P1S printer profile.
- Go to Machine G-code β Start G-code / End G-code.
- Paste the desired XL / L / S variants.
- Save as a new printer preset (recommended).
- Test with a small print.
- Open P1S printer profile.
- Go to Device β Machine Settings β Start / End G-code.
- Paste the chosen variants.
- Save.
- Test with a small print.
Tip
Begin with L if you want the safest, cleanest, most balanced behavior.
Stock (default) P1S Start and End G-code are provided at the top of this README for convenience.
To restore defaults:
Copy them from this README at the top, OR β
- Open OrcaSlicer or Bambu Studio.
- Create a new P1S printer preset.
- Go to Machine G-code.
- Copy the stock Start / End G-code from there.
- Paste them into your preset.
- Save.
CLICK Here to expand
This optional Start G-code is based on the L (Balanced) variant, but with reduced startup purge/prime.
- Saves: ~0.2g purge compared to standard L-START and has a smaller purge line.
- Trade-off: higher chance of first-line/first-layer filament/color "bleed" after AMS swaps (e.g. dark β light)
- P1S + AMS β fully supported
- P1S without AMS β AMS commands are automatically ignored
- P1P + AMS β NOT tested
- P1P without AMS β NOT tested
- X1C + AMS β NOT Tested
- X1C without AMS β NOT Tested
These scripts use commands such as M17, M220, and M221 to manage motor currents and flow.
Incorrect changes can cause:
- Lost steps
- Rough extrusion
- Clogging
- Overheating
The included scripts use firmware-aligned conservative defaults.
Modify only incrementally and test carefully.
- You prefer the default Bambu workflow and do not want to alter machine behavior.
- You want the absolute fastest startup and shutdown sequences without additional safeguards (S profile includes safeguards).
- Submit "Issues" for Suggestions
OR
- Fork the repository
- Make improvements or variants
- Submit a PR
- Include reproduction steps if reporting bugs