Prusaslicer flow test gcode?

I’m trying to figure out how I can use prusaslicer for prints without bambu or orca involved. I’ve got everything working except remaining times, progress percentages and flow calibration.

I’m really only concerned with the flow calibration as it’s one of the biggest advantages I have with this printer, esp considering I print everything with volumetric speed.

So does anyone have any ideas for how to make this work? I can just do the math and plug in the numbers if I have to, but I’d like to automate it if possible

You can check the starting g-code from Bambu Studio and copy the necessary sections to the Prusa slicer.
If you have any questions, post them here.

1 Like

I’ve already done that. the variables inside the fancy curly brackets don’t translate in prusaslicer, it won’t let you slice it without:

a variable that prusa knows
or
a normal integer

; Filament start G-code gcode

M900 K0.028 L1000 M10 ; Flow Dynamics or PA Test

  • Edit the K0.028 number with your setting

; Filament start G-code gcode

M900 K0.028 L1000 M10 ; Flow Dynamics or PA Test

  • Edit the K0.028 number with your setting

How do I determine that K number?

I have thus far tried to sub the {variables} with mixed success.

Here’s what I’ve got, it works to start and finish prints, just won’t perform the flow test at the start:

;===== machine: A1 mini =========================
;===== date: 20231201 =====================

;===== start to heat heatbead&hotend==========
M1002 gcode_claim_action : 2
M1002 set_filament_type:[filament_type]
M104 S170
M140 S[first_layer_bed_temperature]
G392 S0 ;turn off clog detect
;=====start printer sound ===================
M73 P84 R0
M1006 A25 B14 L17 C15 D14 M38 E0 F14
M1006 A24 B14 L21 C0 D15 E0 F15
M1006 A22 B14 L38 C0 D14 E0 F14
M1006 A20 B14 L56 C15 D14 M38 E0 F14
M1006 A19 B14 L57 C15 D15 M38 E0 F15
M1006 A34 B29 L45 C34 D29 M62 E0 F29
;Tick 3606, Time 36 sec
M73 P86 R0
M1006 A34 B43 L45 C0 D43 E0 F43
M1006 A34 B5 L45 C13 D5 M69 E0 F5
M1006 A34 B5 L45 C13 D5 M69 E0 F5
M1006 A34 B3 L45 C13 D3 M69 E0 F3
M1006 A34 B1 L45 C15 D1 M38 E0 F1
M1006 A34 B29 L45 C15 D29 M38 E0 F29
M1006 A22 B14 L38 C34 D15 M62 E0 F15
;Tick 3707, Time 37 sec
M73 P89 R0
M1006 A22 B14 L38 C34 D14 M62 E0 F14
M1006 A39 B7 L62 C0 D7 E0 F7
M1006 A40 B7 L59 C0 D8 E0 F8
M1006 A39 B28 L62 C0 D28 E0 F28
M1006 A22 B14 L38 C0 D15 E0 F15
M1006 A34 B7 L45 C0 D7 E0 F7
M1006 A35 B7 L42 C0 D7 E0 F7
M1006 A34 B29 L45 C0 D29 E0 F29
;Tick 3822, Time 38 sec
M73 P91 R0
M1006 A22 B14 L38 C0 D15 E0 F15
M1006 A30 B14 L17 C0 D14 E0 F14
M1006 A29 B14 L14 C0 D14 E0 F14
M1006 A32 B14 L35 C0 D15 E0 F15
M1006 A29 B14 L14 C0 D14 E0 F14
M1006 A37 B14 L53 C19 D14 M38 E0 F15
;Tick 3909, Time 39 sec
M73 P94 R0
M1006 A34 B14 L45 C15 D14 M38 E0 F14
M1006 A22 B14 L38 C19 D14 M38 E0 F14
M1006 A22 B14 L38 C19 D15 M38 E0 F15
M1006 A39 B7 L62 C0 D7 E0 F7
M1006 A40 B7 L59 C0 D7 E0 F7
M1006 A39 B29 L62 C0 D29 E0 F29
M1006 A22 B14 L38 C0 D15 E0 F15
;Tick 4010, Time 40 sec
M73 P96 R0
M1006 A34 B7 L45 C0 D7 E0 F7
M1006 A35 B7 L42 C0 D7 E0 F7
M1006 A34 B29 L45 C0 D29 E0 F29
M1006 A22 B14 L38 C0 D14 E0 F14
M1006 A30 B14 L17 C0 D15 E0 F15
M1006 A29 B14 L14 C0 D14 E0 F14
M1006 A32 B14 L35 C0 D15 E0 F15
;Tick 4111, Time 41 sec
M73 P99 R0
M1006 A29 B14 L14 C0 D14 E0 F14
M1006 A37 B14 L53 C19 D14 M38 E0 F14
M1006 A34 B14 L45 C13 D14 M69 E0 F15
M1006 W
M18
;=====avoid end stop =================
G91
G380 S2 Z30 F1200
G380 S2 Z-20 F1200
G1 Z5 F1200
G90

;===== reset machine status =================
M290 X39 Y39 Z8
M204 S6000

M630 S0 P0
G91
M17 Z0.3 ; lower the z-motor current

G90
M17 X0.7 Y0.9 Z0.5 ; reset motor current to default
M960 S5 P1 ; turn on logo lamp
G90
M83
M220 S100 ;Reset Feedrate
M221 S100 ;Reset Flowrate
M73.2 R1.0 ;Reset left time magnitude
;====== cog noise reduction=================
M982.2 S1 ; turn on cog noise reduction

;===== prepare print temperature and material ==========
M400
M18
M109 S100 H170
M104 S170
M400
M17
M400
G28 X

M211 X0 Y0 Z0 ;turn off soft endstop ; turn off soft endstop to prevent protential logic problem

M975 S1 ; turn on

G1 X0.0 F30000
G1 X-13.5 F3000

M620 M ;enable remap
M620 S[perimeter_extruder]A ; switch material if AMS exist
G392 S0 ;turn on clog detect
M1002 gcode_claim_action : 4
M400
M1002 set_filament_type:UNKNOWN
M109 S[first_layer_bed_temperature]
M104 S250
M400
G1 X-13.5 F3000
M400
M620.1 E F124.72456658213112709433334719162 T230
M109 S250 ;set nozzle to common flush temp
M106 P1 S0
G92 E0
G1 E50 F200
M400
M1002 set_filament_type:[filament_type]
M104 S[temperature]
G92 E0
G1 E50 F124.72456658213112709433334719162
M400
M106 P1 S178
G92 E0
G1 E5 F124.72456658213112709433334719162
M109 S190 ; drop nozzle temp, make filament shink a bit
M104 S195
G92 E0
G1 E-0.5 F300

G1 X0 F30000
G1 X-13.5 F3000
G1 X0 F30000 ;wipe and shake
G1 X-13.5 F3000
G1 X0 F12000 ;wipe and shake
G1 X0 F30000
G1 X-13.5 F3000
M109 S190
G392 S0 ;turn off clog detect

M621 S[perimeter_extruder]A

M400
M106 P1 S0

;===== prepare print temperature and material end =====

;===== mech mode fast check============================
M1002 gcode_claim_action : 3
G0 X25 Y175 F20000 ; find a soft place to home
;M104 S0
G28 Z P0 T300; home z with low precision,permit 300deg temperature
G29.2 S0 ; turn off ABL
M104 S170

; build plate detect
G39.4
M400

G1 Z5 F3000
G1 X90 Y-1 F30000
M400 P200
M970.3 Q1 A7 K0 O2
M974 Q1 S2 P0

G1 X90 Y0 Z5 F30000
M400 P200
M970 Q0 A10 B50 C90 H15 K0 M20 O3
M974 Q0 S2 P0

M975 S1
G1 F30000
G1 X-1 Y10
G28 X ; re-home XY

;===== wipe nozzle ===============================
M1002 gcode_claim_action : 14
M975 S1

M104 S170 ; set temp down to heatbed acceptable
M106 S255 ; turn on fan (G28 has turn off fan)
M211 S; push soft endstop status
M211 X0 Y0 Z0 ;turn off Z axis endstop

M83
G1 E-1 F500
G90
M83

M109 S220
M104 S220
G0 X90 Y-4 F30000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X91 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X92 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X93 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X94 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X95 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X96 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X97 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X98 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X99 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X99 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X99 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X99 F10000
G380 S3 Z-5 F1200
G1 Z2 F1200
G1 X99 F10000
G380 S3 Z-5 F1200

G1 Z5 F30000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;===== wait heatbed ====================
M1002 gcode_claim_action : 2
M104 S0
M190 S[first_layer_bed_temperature];set bed temp
M109 S220

G1 Z5 F3000
G29.2 S1
G1 X10 Y10 F20000

;===== bed leveling ==================================
;M1002 set_flag g29_before_print_flag=1
M1002 judge_flag g29_before_print_flag
M622 J1
M1002 gcode_claim_action : 1
G29 A T145;set high than the wipe temperature
M400
M500 ; save cali data
M623
;===== bed leveling end ================================

;===== home after wipe mouth============================
M1002 judge_flag g29_before_print_flag
M622 J0

M1002 gcode_claim_action : 13
G28 T145

M623

;===== home after wipe mouth end =======================

M975 S1 ; turn on vibration supression
;===== noozle load line ===============================
M975 S1
G90
M83
T1000

G1 X-13.5 Y0 Z10 F10000
G1 E1.2 F500
M400
M1002 set_filament_type:[filament_type]
M109 S[first_layer_temperature]
M400

M412 S1 ; ===turn on filament runout detection===
M400 P10

G392 S0 ;turn on clog detect

M620.3 W1; === turn on filament tangle detection===
M400 S2

M1002 set_filament_type:[filament_type]

;===== extrude cali test ===============================
M104 S[first_layer_temperature]
G90
M83
G0 X68 Y-2.5 F30000
G0 Z0.2 F18000 ;Move to start position
G0 X88 E10
G0 X93 E.3742
G0 X98 E.3742
G0 X103 E.3742
G0 X108 E.3742
G0 X113 E.3742
G0 X115 Z0 F20000
G0 Z5
M400

;========turn off light and wait extrude temperature =============
M1002 gcode_claim_action : 0

M400 ; wait all motion done before implement the emprical L parameters

M960 S1 P0 ; turn off laser
M960 S2 P0 ; turn off laser
M106 S0 ; turn off fan
M106 P2 S0 ; turn off big fan
M106 P3 S0 ; turn off chamber fan

M975 S1 ; turn on mech mode supression
G90
M83
T1000

M211 X0 Y0 Z0 ;turn off soft endstop
M1007 S1

I would just use the Orca slicer calibration PA test to get your number. That would be the easy way to do it.

.
cal

It might be a good idea to point out the risks of sending non-native Bambu G-Code directly to the printer. Nothing will stop you from doing it but if you do not pass the G-Code through Bambu Studio, it will also not scrub any out-of-bounds G-Code movements from the output.

So picture if you will, the G-Code coordinates point to a 3D space in Prusa that was NOT intended for a particular printer. Now what if that coordinate were situated below the build plate of your printer?

Now I am sure that there are safeties in place to prevent the printer from moving the printhead past a physical boundary but do you want to chance that? After all, we’ve seen documented photos here of people experiencing holes punched into a build plate for mysterious reasons, so we know it’s possible.

Just sayin… :face_with_raised_eyebrow:

I appreciate the concern genuinely, but this thing crashes itself all the time. I have better luck with prusaslicer and my own gcode modifiers. I get crashes during calibrations, on homing, it’s almost commonplace for me

I love the hardware (except the lack of physical endstops) and the capabilities of this printer, but the software makes me wanna jump out a window. Orca is maybe 30% better than bambustudio

This would be a great topic for a new post. I’d love to hear from you regarding your side-by-side experiences and I am certain others would too. :+1:

1 Like

Dang, I could probably go off on that one lol.

I have to leave for work momentarily, so I’ll have to write it all up on lunch or when I get home tonight.

I use three different slicers for the Bambu lab X1 printer

  • Orca Slicer
  • PrusaSlicer
  • ideaMaker

They all have benefits when you need other custom settings or fighting a slicer bug

1 Like

That’s a cumbersome setup, no? esp if one is trying to mass produce

It really depends on what parts you are doing or slicer setting you need for the part.

Sample ideamaker has way more group and layer custom settings you can do that the others slicers just don’t have yet but ideaMaker don’t have tree support at this time.

If you wish to use the automated calibration procedure from Bambu Studio in Prusa Slicer, and as you stated, it doesn’t work well with the Bambu Lab custom g-codes, you can use post-processing scripting.
This will edit your g-code file from the Prusa slicer, adding the missing commands.

As it is done outside the slicer, it will not result in errors. On the other hand, it may pose some challenges when uploading to the printer.

For safety reasons, I advise comparing the g-code files from Bambu Studio against the post-processing output from Prusa Slicer until you get it right.

I also agree that it is easier to calibrate filaments previously and use a specific k-value for each.

If my understanding is correct, those are two different values. K factor is a pressure advance setting, flow rate is an entirely different setting. Flow rate should be tuned correctly before attempting a PA test.

Yes two calibrations flow and pa

Filament flow setting is the extrusion multiplier
PFlow

PA setting can go in the filament settings custom g-code start g-code box
Ppa

I can only assume that bambu is telling the truth when they say the machine has “dynamic flow control”

The flow test at the start of a print from orca/bambu studio determines the flow rate (or extrusion multiplier if you prefer) of that filament and skips the step of tuning flow rate for each filament. Or it’s supposed to anyway.

The PA value/ k factor is a totally separate test that can only be undertaken if the flow rate is tuned and correct.

Bambu lab only calibrates the first roll of print filament now it can be off by 10% or not work and it will set a K value of 0.20 in the g-code also they have been adding some save options for filament calibration settings but it has had some problems keep the calibration settings stored in the printer but they might have fixed it in the newer firmware out but I run old firmware also I like all my settings in the slicer not in the printer.

Orca slicer you have pa / k calibration settings stored in the slicer for each roll of filament so if you have four rolls of filament in the ams they can all have their own K calibration settings.

Outstanding work so far on trying to get Prusa Slicer to work with Bambulabs printer. I am trying to do the same thing as I too dislike the software UI of Studio. I dont have your expertise but it sounds like you have already come a long way. I have Prusa Slicer and Im hoping that they will eventually create 3rd party support for the P1S. I hope you get it working.

Hello, tell me, did you manage to use prusa slicer on a Bambu Lab printer?