P1S-GCODE
P1S-GCODE copied to clipboard
Custom-Optimized G-Code for the Bambu Lab P1S Printer
Bambu Lab P1S – Enhanced Start & End G-code
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-07-18
Recommended slicer: OrcaSlicer
Full documentation: P1S-GCODE Wiki
Note that you may need to Enable "Advanced Mode" in your Slicer to change Start and End G-code.
📌 Stock (Default) Bambu Lab P1S G-code
- View stock Start G-code — RAW
- View stock End G-code — RAW
SOURCES — Click to expand
-
https://github.com/bambulab/BambuStudio/tree/master/resources/profiles/BBL/machine
-
https://github.com/bambulab/BambuStudio/blob/c49f7a49e8cda234185c387efca869892687105b/resources/profiles/BBL/machine/Bambu%20Lab%20P1S%200.4%20nozzle.json#L237
-
https://github.com/bambulab/BambuStudio/blob/c49f7a49e8cda234185c387efca869892687105b/resources/profiles/BBL/machine/Bambu%20Lab%20P1S%200.4%20nozzle.json#L238
Last checked — 2026-07-18
⭐ Enhanced Start & End Bambu Lab P1S G-code
- View Enhanced Start G-code
- View Enhanced End G-code
These custom G-codes use adaptive bed leveling to check and re-probe the mesh only when necessary.
[!WARNING] BED LEVELING needs to be turned ON before printing.
🎥 CLICK Here to preview the L Profile (VIDEO SHOWCASE).
🟩-🟦-🟧 Variant Overview
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.
⭐ Star Intensity Guide
Stars represent feature intensity, not quality:
- ★★★ — Highest / most thorough
- ★★ — Balanced / moderate
- ★ — Minimal / fastest
Numbers (e.g., 24 wipes) appear for measurable operations.
📌 START G-code
| 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.
📌 END G-code
| 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 |
🎥 Preview
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.
✅ Bed Mesh Valid — Fast Startup (Mesh is reused)
CLICK HERE TO EXPAND AND VIEW VIDEO
❌ Mesh Invalid — Slow Startup (Mesh is re-probed)
CLICK HERE TO EXPAND AND VIEW VIDEO
*IF "Playback failed due to network error" — Refresh the page.
📘 Feature Explanations
START G-code Feature Explanations
Expand START feature explanations
(1) Startup Speed
How quickly the printer reaches a print-ready state.
★ = Slowest, ★★ = Balanced, ★★★ = Fastest
(2) Startup Reliability
How thoroughly the printer validates AMS, temps, resets.
★★★ = Highest reliability
(3) Initialization Depth
Extent to which the printer resets its internal state (motors, offsets, flow control).
(4) AMS Verification
How strictly filament presence and loading are checked.
More stars = more consistent AMS behavior
(5) Purge Volume
Amount of material extruded to clear residual filament.
More stars = cleaner first layers
(6) Bed Mesh Validation
How rigorously the stored bed mesh is verified and applied.
(7) Thermal Stabilization
How evenly the nozzle temperature stabilizes before printing.
(8) Temperature Staging
Number of controlled temperature steps before printing starts.
(9) Wipe Count
Number of nozzle wipe passes for cleaning (XL ≈ 24 passes).
(10) Purge Line
Whether a purge line is printed before the first layer.
END G-code Feature Explanations
Expand END feature explanations
(11) Shutdown Speed
How quickly the printer completes post-print shutdown routines.
★ = Slowest, ★★★ = Fastest
(12) Unload Reliability
Thoroughness and safety of the AMS filament unload process.
★★★ = Most thorough
(13) Post-Print Purge
Amount of filament purged after the print to clear residue.
(14) Nozzle Wipe After Print
Intensity of wipe actions after the job finishes.
(15) Cooldown Staging
Whether cooling occurs gradually (XL) or rapidly (S).
(16) AMS Unload Confidence
Reliability of returning filament to AMS slots.
🛠 Installation (OrcaSlicer & Bambu Studio)
For OrcaSlicer
- 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.
For Bambu Studio
- 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.
♻️ How to Restore Stock G-code
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.
🧩 Optional Add-ons (G-codes)
CLICK Here to expand
🟨 L-Start-LITE G-code — Reduced Startup Purge
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)
Files
🔧 Device Compatibility
- P1S + AMS — Supported
- P1S without AMS — Supported, AMS commands are automatically ignored
- P1P + AMS — NOT tested
- P1P without AMS — NOT tested
- X1C + AMS — NOT Tested
- X1C without AMS — NOT Tested
⚙ Motion-Affecting Commands
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.
⚠️ These profiles may not be for you if:
- 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).
🤝 Contributing
- Submit "Issues" for Suggestions
OR
- Fork the repository
- Make improvements or variants
- Submit a PR
- Include reproduction steps if reporting bugs