# justagwas/p1s-gcode architecture

> Architecture diagram of the GitHub repository justagwas/p1s-gcode, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/justagwas/p1s-gcode
- Repository: https://github.com/justagwas/p1s-gcode

## Overview

This repository is a collection of Bambu Lab P1S start/end G-code templates, not an application with an internal runtime. A user selects start and end templates in a slicer; the printer executes them around a print. The documented XL, L, and S profiles trade startup/shutdown time against reliability, purge, wiping, and thermal or mesh checks; the tree also includes a Lite start template and stock defaults. Relationships are limited to the README’s documented workflow: no G-code excerpts were provided to verify command-level behavior.

Main entry points: [`G-code/XL-START G-code`](https://github.com/justagwas/p1s-gcode/blob/main/G-code/XL-START%20G-code) (XL start: reliability), [`G-code/L-START G-code`](https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-START%20G-code) (L start: balanced), [`G-code/S-START G-code`](https://github.com/justagwas/p1s-gcode/blob/main/G-code/S-START%20G-code) (S start: speed), [`G-code/L-START-LITE G-code`](https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-START-LITE%20G-code) (L Lite start)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_start["Start G-code"]
  node_xlstart["XL start: reliability"]
  node_lstart["L start: balanced"]
  node_slstart["S start: speed"]
  node_llite["L Lite start"]
end

subgraph group_end["End G-code"]
  node_xlend["XL end: thorough"]
  node_lend["L end: balanced"]
  node_send["S end: rapid"]
end

subgraph group_stock["Stock defaults"]
  node_stockstart["Stock start"]
  node_stockend["Stock end"]
end

node_user(("Printer operator"))
node_slicer["Slicer"]
node_printer["Bambu Lab P1S"]

node_user -->|"configures"| node_slicer
node_slicer -->|"selects start"| node_xlstart
node_slicer -->|"selects start"| node_lstart
node_slicer -->|"selects start"| node_slstart
node_slicer -.->|"selects start"| node_llite
node_slicer -->|"selects end"| node_xlend
node_slicer -->|"selects end"| node_lend
node_slicer -->|"selects end"| node_send
node_slicer -->|"selects start"| node_stockstart
node_slicer -->|"selects end"| node_stockend
node_xlstart -->|"executes at startup"| node_printer
node_lstart -->|"executes at startup"| node_printer
node_slstart -->|"executes at startup"| node_printer
node_llite -.->|"executes at startup"| node_printer
node_xlend -->|"executes at end"| node_printer
node_lend -->|"executes at end"| node_printer
node_send -->|"executes at end"| node_printer
node_stockstart -->|"executes at startup"| node_printer
node_stockend -->|"executes at end"| node_printer

click node_xlstart "https://github.com/justagwas/p1s-gcode/blob/main/G-code/XL-START%20G-code"
click node_lstart "https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-START%20G-code"
click node_slstart "https://github.com/justagwas/p1s-gcode/blob/main/G-code/S-START%20G-code"
click node_llite "https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-START-LITE%20G-code"
click node_xlend "https://github.com/justagwas/p1s-gcode/blob/main/G-code/XL-END%20G-code"
click node_lend "https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-END%20G-code"
click node_send "https://github.com/justagwas/p1s-gcode/blob/main/G-code/S-END%20G-code"
click node_stockstart "https://github.com/justagwas/p1s-gcode/blob/main/G-code/STOCK-START%20G-code"
click node_stockend "https://github.com/justagwas/p1s-gcode/blob/main/G-code/STOCK-END%20G-code"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_xlstart,node_lstart,node_slstart,node_llite toneBlue
class node_xlend,node_lend,node_send toneAmber
class node_stockstart,node_stockend toneMint
class node_user,node_slicer,node_printer toneIndigo
```

## Components

### Start G-code

- [XL start: reliability](https://github.com/justagwas/p1s-gcode/blob/main/G-code/XL-START%20G-code): `G-code/XL-START G-code`
- [L start: balanced](https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-START%20G-code): `G-code/L-START G-code`
- [S start: speed](https://github.com/justagwas/p1s-gcode/blob/main/G-code/S-START%20G-code): `G-code/S-START G-code`
- [L Lite start](https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-START-LITE%20G-code): `G-code/L-START-LITE G-code`

### End G-code

- [XL end: thorough](https://github.com/justagwas/p1s-gcode/blob/main/G-code/XL-END%20G-code): `G-code/XL-END G-code`
- [L end: balanced](https://github.com/justagwas/p1s-gcode/blob/main/G-code/L-END%20G-code): `G-code/L-END G-code`
- [S end: rapid](https://github.com/justagwas/p1s-gcode/blob/main/G-code/S-END%20G-code): `G-code/S-END G-code`

### Stock defaults

- [Stock start](https://github.com/justagwas/p1s-gcode/blob/main/G-code/STOCK-START%20G-code): `G-code/STOCK-START G-code`
- [Stock end](https://github.com/justagwas/p1s-gcode/blob/main/G-code/STOCK-END%20G-code): `G-code/STOCK-END G-code`

### Other components

- **Printer operator**
- **Slicer**
- **Bambu Lab P1S**

## Connections

- Printer operator → Slicer: configures (evidence: `README.md`)
- Slicer → XL start: reliability: selects start (evidence: `README.md`)
- Slicer → L start: balanced: selects start (evidence: `README.md`)
- Slicer → S start: speed: selects start (evidence: `README.md`)
- Slicer → L Lite start: selects start
- Slicer → XL end: thorough: selects end (evidence: `README.md`)
- Slicer → L end: balanced: selects end (evidence: `README.md`)
- Slicer → S end: rapid: selects end (evidence: `README.md`)
- Slicer → Stock start: selects start (evidence: `README.md`)
- Slicer → Stock end: selects end (evidence: `README.md`)
- XL start: reliability → Bambu Lab P1S: executes at startup (evidence: `README.md`)
- L start: balanced → Bambu Lab P1S: executes at startup (evidence: `README.md`)
- S start: speed → Bambu Lab P1S: executes at startup (evidence: `README.md`)
- L Lite start → Bambu Lab P1S: executes at startup
- XL end: thorough → Bambu Lab P1S: executes at end (evidence: `README.md`)
- L end: balanced → Bambu Lab P1S: executes at end (evidence: `README.md`)
- S end: rapid → Bambu Lab P1S: executes at end (evidence: `README.md`)
- Stock start → Bambu Lab P1S: executes at startup (evidence: `README.md`)
- Stock end → Bambu Lab P1S: executes at end (evidence: `README.md`)
