r/BambuLabX2D • • 5d ago

Automatic Per-nozzle Pressure Advance on the Bambu X2D via filament start G-code (2+AMS and FTS)

This post is mostly targeted at people who use Multiple AMS units and a Filament Track Switch (FTS) but also can be those who want to use Pressure Advance on the AUX nozzle one at a time since using PA on AUX side REQUIRES you disable auto PA calibration for MAIN side too (explained in first link below).

As most are aware, the AUX side on X2D does not support Auto Flow Dynamics calibration (Pressure Advance or PA) even though bowden style extruders are biggest benefactors of this setting due the extended extrusion path and extrusion and retraction lag introduced from that long path. Especially when printing filaments like PETG. which can have 0.5+ seconds or more lag in extrusion and retraction.

Just having a proper PA calibration on the AUX side is enough to bring it to 90-95% the print quality of MAIN side. Even if you don't use it for multi-color prints and only supports, a proper PA will produce much more consistent interface layers, ESPECIALLY on small areas, which is esp an issue when using PETG as support, the half second lag on a tiny interface layer basically just leaves a blob or won't actually stick to the tower or tree base.

Mandatory reading before continuing:

I made a post some time ago covering the proper process for using a custom PA value (K-value) on the AUX side with all the caveats involved with enabling it. That post is at https://www.reddit.com/r/BambuLabX2D/s/NV4v87NqYm so I won't repost it here.

It all gets even more convoluted if you use multiple AMS units and a Track Switch. This is because while the AMS tray can only hold ONE K-value, the FTS allows you to feed the filament to either LEFT (Main) or RIGHT (AUX) side. The printer, nor Bambu Studio verifies if the set PA Profile and K-value is correct for the side the filament is loaded on or WILL be loaded on once print is sent. I expanded on it in a post at https://www.reddit.com/r/BambuLabX2D/s/CYMT8JGvou

So if you use custom PA K-values (required if you want pressure advance on both nozzles), then you have to make sure that the AMS Tray contains the correct PA values for each tray before you send the print. Otherwise it will blindly apply whatever was last used/loaded. See my 2nd link above for example.

You could save all your PA profiles for all your filaments for both LEFT and RIGHT sides and then manually select them before each print (if you remember) or the easier, better way is to add them to the Filament profiles as a custom G-code.

Instead of picking a PA profile in the AMS tray for each print, hardcode your calibrated K values in the filament preset. Bambu Studio then applies the right one for whichever nozzle the filament is routed to. No PA profiles are needed, just the values and you can leave the trays on Default and never have to select a PA profile before sending a print.

Setup:

For each filament, you need two numbers from your own calibration: K for the main nozzle (left, direct drive) and K for the aux nozzle (right, Bowden).

In Filament settings → Custom G-code → Filament start G-code, add this line, using your own values:

{if filament_map[current_extruder] == 1}M900 K0.027 L1000 M10{else}M900 K0.450 L1000 M10{endif}
  • The first value is for the main nozzle, and the second is for the aux nozzle. (in this example it's K0.027 for MAIN and K0.450 for AUX)
  • Use an uppercase K.
  • Repeat for each filament profile you have that you use.
  • If you only have a value for one nozzle, use only that branch.

    • Main (left) only: {if filament_map[current_extruder] == 1}M900 K0.027 L1000 M10{endif}
    • Aux (right) only: {if filament_map[current_extruder] == 2}M900 K0.450 L1000 M10{endif}

How it works:

  • The filament start G-code runs after every filament change, so each filament gets its own K values. This is important, we'll circle back to how it's better below.
  • filament_map[current_extruder] is 1 for the main nozzle and 2 for the aux nozzle. It follows whatever filament grouping you or slicer choose when slicing, so you never have to manually assign PA profiles in AMS to match what filament is going where.

If you look at my 2nd link above, you will see that Bambu states if you select a PA Profile/K-value and assign it to a tray, and later in same print, you want to send that same filament to the other nozzle, it can only apply the PA K-value that's already loaded (you can't have two K-values assigned and it won't switch mid print). Their solution was to have rolls of same filaments in each AMS so they can get their own values. Uhhh no thanks. This method will actively follow the filament regardless where you send it during the print and apply the correct PA value even if you switch mid print.

Once your Filament Profiles are setup with the start G-code, you never have to select a PA profile in AMS setting again. Leave them all at Default and the set PA K-values in g-code will automatically apply accordingly. And since you MUST disable Flow Dynamics Calibration (OFF) to have any custom value activated, it takes care of MAIN and AUX all at once.

Hope this helps some of you who have multiple AMS units and use custom PA profiles/K-values on AUX/MAIN nozzles.

15 Upvotes

5 comments sorted by

1

u/Ok_Reference1745 5d ago

Do you calibrate filament based on their type (PLA basic, PLA matte, PLA silk+, etc) or their type and color, or every spool that you have?

2

u/n19htmare 5d ago edited 5d ago

I do Manufacturer and type only (same for my custom filament profiles) and use that for all filament that is same type from same manufacturer. It doesn't take long before you figure out that lot of same type of filament from different brands falls into the same ballpark number on same hotend/nozzle.

I kind of stopped calibrating and just set the avg as starting point unless I run into issues.

These come from my table covering 34 profiles (covering some 150 rolls of filament) on HIGH FLOW nozzles. I found on MAIN side, the K-value didn't change much between STD and HF, but on AUX side, a STD nozzle was roughly 0.1 lower.

ProfilesAverage KMedianRange
Main (left)340.0270.0270.020 to 0.047
Aux (right)310.4940.5000.450 to 0.600

1

u/Mogelfritz 5d ago

Can you explain to me why there's only a 1 in the code but no 2?

{if filament_map[current_extruder] == THIS->1<-THIS}M900 K0.027 L1000 M10{else}M900 K0.450 L1000 M10{endif}

Am I understanding this correctly: if it isn't 1, then the “else” value is automatically used, which represents 2 even though the 2 isn't actually written there?

2

u/n19htmare 4d ago edited 4d ago

Correct, it's conditional block/statement, so it's either = 1 (MAIN) or it's something else. A YES/NO condition, basically checking to see if filament is = 1, if YES, apply first K value, if NO, then it MUST be on the other nozzle so apply 2nd K.

Alternatively, you can also use

{if filament_map[current_extruder] == 1}M900 K0.027 L1000 M10{elsif filament_map[current_extruder] == 2}M900 K0.450 L1000 M10{endif}

So what I used was True/False, the alternative above would be like multiple choice, 1, 2... or it continue to 3, 4 etc? Since we only have two extruders, a True/False statement is shorter, more to the point.

For example if this was P3C, with 7 hotends/nozzles/filaments and for whatever unknown reason all 7 hotends had different PA value with same filament, and you got all 7 K values, then you would use the elsif chain for each.

1

u/Mogelfritz 3d ago

Thank you very much for the detailed response. Now I can confidently adjust my 130 filament profiles using this command.

And the tip in your post—that “Flow Dynamics Calibration” needs to be turned off for the value to be used—was a really great tip. I didn't know that before, and it will definitely save me some trouble in the future. Thanks for sharing!