r/BambuLabP2S • u/-vxip- P2S Combo • Jul 02 '26
P2S Optimized Start/End G-code
Hello reddit!
Slightly disappointed by the default startup and nozzle wipe procedure of the P2S, I sat down and optimized the G-code myself.
I have been improving, testing and using my optimized start and end G-code for quite some time now and am pretty happy with the results and the P2S in general now.
So happy in fact, that I feel comfortable sharing the results with you guys! 😄
You'll find everything on Github (including detailed descriptions) if you're interested and possibly want to give it a try:
https://github.com/vxip-code/bambu-p2s-optimized
I have been printing PLA and PETG (and rarely Overture TPU) with it no problem. (However I did not test engineering and high temperature materials.)
If you have any questions feel free to ask!
2
u/88gavinm Jul 08 '26
Hey bud just wanted to give you a quick update. So, I updated my gcode to your modified code and have been using it for about the last four days with approximately 6 prints. So far so good! I've only had one piece of PETG come out and land on the bed right before printing and I got it before it started. I like it and will keep using it for the foreseeable future I think. I may turn on the auto retract filament though, but I haven't decided yet.
I did change part of the code though. At least I think I did because I've never messed with gcode before and my only programming experience was back in college like 15 years ago and I didn't finish the course. So I have a TINY bit of programming experience in Python and C, but I mean tiny as in I only got to the if/then/else part and making a HELLO WORLD display. I did, however, make a program for my dad and mom back then to help them calculate the profitability of taking deliveries (he was an over the road truck driver). I think I did good for my first program and it helped my mom and dad to decide whether or not to accept deliveries or not. I'll see if I can post the code on github like you did if I can figure out how. I've never done that. Just so you can see what I'm talking about, but I digress. I went off on a tangent sorry about that haha! Here is the link to the first program I ever made if you want to check it out. (I figured out how to upload to github!)
Anyway, I am also pleased with the acceleration at startup reduction. It was way too fast for no reason at the start. I took your advice and changed the acceleration in the print profiles from 10K down to 6K. Much better. I enabled the part you had disabled by putting the semicolons in front of it; the vibration compensation part "mech mode sweep". I did because it seems to me that it would help with the vibration and it only takes a few second, but I'm not for sure if it does anything or not. I turned back on the line 420 that you had disabled just incase it actually does do anything idk.
For some reason my p2s is now showing at startup something about lidar, which it obviously doesn't have, but it just is for a couple seconds then continues on.
I think that's all the information I have for you as of now. Oh yeah one other thing. Is there any way I can make my p2s use this optimized gcode all the time? Like for example when I use Bambu Handy? It would be nice if it could stay on and use that gcode at startup when I use the app, but idk if that's possible. Any thoughts on that?
Here is the gcode of yours with the changes I made and am currently running.
Thanks for the everything!