Skip to content

Justagwas/P1S-GCODE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Bambu Lab P1S – Enhanced Start & End G-code

Status: Active Printer AMS Supported Profiles

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.

πŸ“Œ Stock (Default) Bambu Lab P1S G-code

SOURCES β€” Click to expand

Last checked β€” 2026-02-06

⭐ Enhanced Start & End Bambu Lab P1S 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 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
  • β˜… β€” 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
L_PROFILE_BED_MESH_VALID.mp4

❌ Mesh Invalid β€” Slow Startup (Mesh is re-probed)

CLICK HERE TO EXPAND AND VIEW VIDEO
L_PROFILE_BED_MESH_INVALID.mp4

*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

  1. Select your P1S printer profile.
  2. Go to Machine G-code β†’ Start G-code / End G-code.
  3. Paste the desired XL / L / S variants.
  4. Save as a new printer preset (recommended).
  5. Test with a small print.

For Bambu Studio

  1. Open P1S printer profile.
  2. Go to Device β†’ Machine Settings β†’ Start / End G-code.
  3. Paste the chosen variants.
  4. Save.
  5. 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 β€”

  1. Open OrcaSlicer or Bambu Studio.
  2. Create a new P1S printer preset.
  3. Go to Machine G-code.
  4. Copy the stock Start / End G-code from there.
  5. Paste them into your preset.
  6. 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 β€” 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

βš™ 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

  1. Submit "Issues" for Suggestions

OR

  1. Fork the repository
  2. Make improvements or variants
  3. Submit a PR
  4. Include reproduction steps if reporting bugs

πŸ“¬ Contact

email@justagwas.com

About

Custom-Optimized G-Code for the Bambu Lab P1S Printer

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors