The extension board is a development board designed to add advanced and customized functions for Bambu Lab. It is primarily compatible with the P1P series and all product updates and iterations prioritize compatibility with the P1P series. Below you can see a few examples of adding functions, which can serve as a reference for other models.
A few lines of G-code may be required to implement functions. Follow the instructions below and copy the example code or refer to our WIKI page for advanced programming.
The photo shows Bambu Lab Extension Board Pinout Diagram:
The board presets some configurations as below:
; M1004 is commanding the Extension board. Configure #0 switch(I=0) to control LED(F=1) of #0(D=0)
M1004 S7 I0 F1 D0
; Configure #0 Slide(I=0) to control LED(F=0) of #0(D=0)
M1004 S6 I0 F0 D0
M1004 S7 I0 F3 D0
at the end of the machine start G-code. I0
represents switch #0,F3
controls the relay,D0
represents relay #0(D0
can be omitted). Additionally, if you'd like to save the configuration after powering off, insert M1004 S0 P1
。
M1004 S7 I0 F3 D0
M1004 S0 P1
If you want to complete a perfect timelapse with your own camera, you need to take one photo after the tool head finishes printing on each layer.
Before shooting, you need to set the shutter to manual mode and not let your camera automatically fall asleep.
Please note that there may be a conflict between the camera shooting command and the logic of timelapse codes using the built-in camera. Select the position to insert the code according to the following conditions.
Build-in commands for timelapse are as follows. The if-else statement will be executed every time a layer is changed. If the timelapse mode is 0(traditional mode), the built-in camera will take a photo immediately (M971 commands the built-in camera). If the mode is 1(smooth mode), the toolhead will be moved to a specific position and the built-in camera will take a photo.
M622.1 S1 ; for prev firmware, default turned on
M1002 judge_flag timelapse_record_flag
M622 J1
{if timelapse_type == 0} ; timelapse without wipe tower
M971 S11 C10 O0
{elsif timelapse_type == 1} ; timelapse with wipe tower
G92 E0
G1 E-[retraction_length] F1800
G17
G2 Z{layer_z + 0.4} I0.86 J0.86 P1 F10000 ; spiral lift a little
G1 X65 Y245 F12000 ; move to safe pos
G17
G2 Z{layer_z} I0.86 J0.86 P1 F10000
G1 Y265 F3000
M400 P100
M971 S11 C10 O0
G92 E0
G1 E[retraction_length] F300
G1 X100 F5000
G1 Y255
{endif}
M623
If you don't use the built-in camera (P1P timelapse smooth mode has not yet been released), you can insert the following code at the beginning of the layer change code:
Random taking a photo
; take a photo
M1004 S5 P1
Timelapse while tool head is at the wipe tower
; timelapse with wipe tower
G92 E0
G1 E-[retraction_length] F1800
G17
G2 Z{layer_z + 0.4} I0.86 J0.86 P1 F10000 ; spiral lift a little
G1 X65 Y245 F12000 ; move to safe pos
G17
G2 Z{layer_z} I0.86 J0.86 P1 F10000
G1 Y265 F3000
M400 P100 ; wait for 100 ms
M1004 S5 P1 ; take a photo
G92 E0
G1 E[retraction_length] F300
G1 X100 F5000
G1 Y255
If you want to use the built-in camera along with your camera at the same time, you can insert the code (highlighted in Green) into the existing if-else statements based on actual conditions. In this case, the function of timelapse needs to be enabled in Bambu Studio.
M622.1 S1 ; for prev firmware, default turned on
M1002 judge_flag timelapse_record_flag
M622 J1
{if timelapse_type == 0} ; timelapse without wipe tower
M971 S11 C10 O0
{elsif timelapse_type == 1} ; timelapse with wipe tower
G92 E0
G1 E-[retraction_length] F1800
G17
G2 Z{layer_z + 0.4} I0.86 J0.86 P1 F10000 ; spiral lift a little
G1 X65 Y245 F12000 ; move to safe pos
G17
G2 Z{layer_z} I0.86 J0.86 P1 F10000
G1 Y265 F3000
M400 P100
M971 S11 C10 O0
M1004 S5 P1; only executed when smooth timelapse is on and take a photo while toolhead is at wipe tower
G92 E0
G1 E[retraction_length] F300
G1 X100 F5000
G1 Y255
{endif}
M623
LED lights will change their colors at each layer gradually.
; change the led color slightly with the number of layers
M1004 S1 L0 M0 B{30 + layer_num * 200 / total_layer_count} ; set red between 30-200
M1004 S1 L1 M0 B{255 - layer_num * 200 / total_layer_count} ; set green between 255 and 55
M1004 S1 L2 M0 B{55 + layer_num * 100 / total_layer_count} ; set blue between 55 and 155