Skip to content

Instantly share code, notes, and snippets.

@davidhbrown
Last active October 29, 2024 18:50
Show Gist options
  • Save davidhbrown/26187a630ce6544dc1c737b55eb671ff to your computer and use it in GitHub Desktop.
Save davidhbrown/26187a630ce6544dc1c737b55eb671ff to your computer and use it in GitHub Desktop.
Prusa MK4 "Start G-code" to use with Carbon Fiber "Twill" build plate from Wham Bam
The gcode shown in the other section worked fine with my first (and so far only) print with this build plate.
Assuming the start code continues to change in the future, the only two lines to change
are the ones that include the comment "; set extruder temp for bed leveling".
These are farily close the the beginning of the file. One is a M104 to set the desired temperature;
this is followed by M109 to wait for the temperature.
After the opening curly brace, insert:
min(140,
... and just before the closing curly brace, close the parentheses:
)
As 140C is probably more than 25 degrees below the (first_layer_temperature[0] - 25)
for any filament, you could probably also get by with just:
M104 T0 S140
M109 T0 R140
...but I didn't try that.
M17 ; enable steppers
M862.3 P "[printer_model]" ; printer model check
M862.1 P[nozzle_diameter] A{(filament_abrasive[0] ? 1 : 0)} F{(nozzle_high_flow[0] ? 1 : 0)} ; nozzle check
M115 U6.1.3+7898
M555 X{(min(print_bed_max[0], first_layer_print_min[0] + 32) - 32)} Y{(max(0, first_layer_print_min[1]) - 4)} W{((min(print_bed_max[0], max(first_layer_print_min[0] + 32, first_layer_print_max[0])))) - ((min(print_bed_max[0], first_layer_print_min[0] + 32) - 32))} H{((first_layer_print_max[1])) - ((max(0, first_layer_print_min[1]) - 4))}
G90 ; use absolute coordinates
M83 ; extruder relative mode
M140 S[first_layer_bed_temperature] ; set bed temp
M104 T0 S{min(140,((filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_type[0]=~/.*PET.*/) ? 175 : 170))} ; set extruder temp for bed leveling
; ^^^ min(140...) limits to 140C for Wham Bam carbon fiber build plate
M109 T0 R{min(140,((filament_notes[0]=~/.*HT_MBL10.*/) ? (first_layer_temperature[0] - 10) : (filament_type[0] == "PC" or filament_type[0] == "PA") ? (first_layer_temperature[0] - 25) : (filament_type[0] == "FLEX") ? 210 : (filament_type[0]=~/.*PET.*/) ? 175 : 170))} ; wait for temp
; ^^^ min(140...) limits to 140C for Wham Bam carbon fiber build plate
M84 E ; turn off E motor
G28 ; home all without mesh bed level
G1 X42 Y-4 Z5 F4800
M302 S160 ; lower cold extrusion limit to 160C
{if filament_type[initial_tool]=="FLEX"}
G1 E-4 F2400 ; retraction
{else}
G1 E-2 F2400 ; retraction
{endif}
M84 E ; turn off E motor
G29 P9 X10 Y-4 W32 H4
{if first_layer_bed_temperature[initial_tool]<=60}M106 S100{endif}
G0 Z40 F10000
M190 S[first_layer_bed_temperature] ; wait for bed temp
M107
;
; MBL
;
M84 E ; turn off E motor
G29 P1 ; invalidate mbl & probe print area
G29 P1 X0 Y0 W50 H20 C ; probe near purge place
G29 P3.2 ; interpolate mbl probes
G29 P3.13 ; extrapolate mbl outside probe area
G29 A ; activate mbl
; prepare for purge
M104 S{first_layer_temperature[0]}
G0 X0 Y-4 Z15 F4800 ; move away and ready for the purge
M109 S{first_layer_temperature[0]}
G92 E0
M569 S0 E ; set spreadcycle mode for extruder
;
; Extrude purge line
;
G92 E0 ; reset extruder position
G1 E{(filament_type[0] == "FLEX" ? 4 : 2)} F2400 ; deretraction after the initial one before nozzle cleaning
G0 E7 X15 Z0.2 F500 ; purge
G0 X25 E4 F500 ; purge
G0 X35 E4 F650 ; purge
G0 X45 E4 F800 ; purge
G0 X48 Z0.05 F8000 ; wipe, move close to the bed
G0 X51 Z0.2 F8000 ; wipe, move quickly away from the bed
G92 E0
M221 S100 ; set flow to 100%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment