diff --git a/resources/profiles/Prusa.json b/resources/profiles/Prusa.json index 5eda29198c..41d5be7b4e 100644 --- a/resources/profiles/Prusa.json +++ b/resources/profiles/Prusa.json @@ -1,9 +1,13 @@ { "name": "Prusa", - "version": "01.06.04.00", + "version": "01.06.06.00", "force_update": "0", "description": "Prusa configurations", "machine_model_list": [ + { + "name": "Prusa MK4", + "sub_path": "machine/Prusa MK4.json" + }, { "name": "Prusa MK3S", "sub_path": "machine/Prusa MK3S.json" @@ -22,6 +26,10 @@ "name": "0.20mm Standard @MK3S", "sub_path": "process/0.20mm Standard @MK3S.json" }, + { + "name": "0.20mm Standard @MK4", + "sub_path": "process/0.20mm Standard @MK4.json" + }, { "name": "0.20mm Standard @MINI", "sub_path": "process/0.20mm Standard @MINI.json" @@ -114,6 +122,10 @@ "name": "Prusa MK3S 0.4 nozzle", "sub_path": "machine/Prusa MK3S 0.4 nozzle.json" }, + { + "name": "Prusa MK4 0.4 nozzle", + "sub_path": "machine/Prusa MK4 0.4 nozzle.json" + }, { "name": "Prusa MINI 0.4 nozzle", "sub_path": "machine/Prusa MINI 0.4 nozzle.json" diff --git a/resources/profiles/Prusa/Prusa MK4_cover.png b/resources/profiles/Prusa/Prusa MK4_cover.png new file mode 100644 index 0000000000..ccdbceb909 Binary files /dev/null and b/resources/profiles/Prusa/Prusa MK4_cover.png differ diff --git a/resources/profiles/Prusa/filament/Prusa Generic ABS.json b/resources/profiles/Prusa/filament/Prusa Generic ABS.json index 3953a58e9c..466fbcce29 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic ABS.json +++ b/resources/profiles/Prusa/filament/Prusa Generic ABS.json @@ -14,6 +14,7 @@ ], "compatible_printers": [ "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } diff --git a/resources/profiles/Prusa/filament/Prusa Generic ASA.json b/resources/profiles/Prusa/filament/Prusa Generic ASA.json index ff83c0ec4e..7f68596fe1 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic ASA.json +++ b/resources/profiles/Prusa/filament/Prusa Generic ASA.json @@ -14,6 +14,7 @@ ], "compatible_printers": [ "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } diff --git a/resources/profiles/Prusa/filament/Prusa Generic PA-CF.json b/resources/profiles/Prusa/filament/Prusa Generic PA-CF.json index 2eaa2bf34d..3ace579a36 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PA-CF.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PA-CF.json @@ -19,7 +19,8 @@ "8" ], "compatible_printers": [ - "Prusa MK3S 0.4 nozzle", + "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } \ No newline at end of file diff --git a/resources/profiles/Prusa/filament/Prusa Generic PA.json b/resources/profiles/Prusa/filament/Prusa Generic PA.json index 13991aad2c..dfefb4bbbf 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PA.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PA.json @@ -16,7 +16,8 @@ "12" ], "compatible_printers": [ - "Prusa MK3S 0.4 nozzle", + "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } \ No newline at end of file diff --git a/resources/profiles/Prusa/filament/Prusa Generic PC.json b/resources/profiles/Prusa/filament/Prusa Generic PC.json index aa8556bcca..edae14c5a7 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PC.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PC.json @@ -13,7 +13,8 @@ "0.94" ], "compatible_printers": [ - "Prusa MK3S 0.4 nozzle", + "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } \ No newline at end of file diff --git a/resources/profiles/Prusa/filament/Prusa Generic PETG.json b/resources/profiles/Prusa/filament/Prusa Generic PETG.json index a338b24f23..6a68e00329 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PETG.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PETG.json @@ -44,6 +44,7 @@ ], "compatible_printers": [ "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } diff --git a/resources/profiles/Prusa/filament/Prusa Generic PLA-CF.json b/resources/profiles/Prusa/filament/Prusa Generic PLA-CF.json index 7651c3afc5..8252c86fc6 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PLA-CF.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PLA-CF.json @@ -19,7 +19,8 @@ "7" ], "compatible_printers": [ - "Prusa MK3S 0.4 nozzle", + "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } \ No newline at end of file diff --git a/resources/profiles/Prusa/filament/Prusa Generic PLA.json b/resources/profiles/Prusa/filament/Prusa Generic PLA.json index bf58f0271a..d074f3f71a 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PLA.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PLA.json @@ -17,6 +17,7 @@ ], "compatible_printers": [ "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } diff --git a/resources/profiles/Prusa/filament/Prusa Generic PVA.json b/resources/profiles/Prusa/filament/Prusa Generic PVA.json index b38afd0291..86db19e8ed 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic PVA.json +++ b/resources/profiles/Prusa/filament/Prusa Generic PVA.json @@ -20,6 +20,7 @@ ], "compatible_printers": [ "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } diff --git a/resources/profiles/Prusa/filament/Prusa Generic TPU.json b/resources/profiles/Prusa/filament/Prusa Generic TPU.json index f92b633cc2..96e1382478 100644 --- a/resources/profiles/Prusa/filament/Prusa Generic TPU.json +++ b/resources/profiles/Prusa/filament/Prusa Generic TPU.json @@ -11,6 +11,7 @@ ], "compatible_printers": [ "Prusa MK3S 0.4 nozzle", + "Prusa MK4 0.4 nozzle", "Prusa MINI 0.4 nozzle" ] } diff --git a/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json b/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json new file mode 100644 index 0000000000..d623cb2c4e --- /dev/null +++ b/resources/profiles/Prusa/machine/Prusa MK4 0.4 nozzle.json @@ -0,0 +1,35 @@ +{ + "type": "machine", + "setting_id": "GM003", + "name": "Prusa MK4 0.4 nozzle", + "from": "system", + "instantiation": "true", + "inherits": "fdm_machine_common", + "printer_model": "Prusa MK4", + "default_filament_profile": [ + "Prusa Generic PLA" + ], + "default_print_profile": "0.20mm Standard @MK4", + "nozzle_diameter": [ + "0.4" + ], + "bed_exclude_area": [ + "0x0" + ], + "printable_area": [ + "0x0", + "250x0", + "250x210", + "0x210" + ], + "printable_height": "220", + "machine_start_gcode": "G90 ; use absolute coordinates\nM83 ; extruder relative mode\nM104 S170 ; set extruder temp for bed leveling\nM140 S[bed_temperature_initial_layer_single] ; set bed temp\nM109 R170 ; wait for bed leveling temp\nM190 S[bed_temperature_initial_layer_single] ; wait for bed temp\nM204 T1250 ; set travel acceleration\nG28 ; home all without mesh bed level\nG29 ; mesh bed leveling \nM204 T[machine_max_acceleration_travel] ; restore travel acceleration\nM104 S[nozzle_temperature_initial_layer] ; set extruder temp\nG92 E0\nG1 Y-2 X179 F2400\nG1 Z3 F720\nM109 S[nozzle_temperature_initial_layer] ; wait for extruder temp\n\n; intro line\nG1 X170 F1000\nG1 Z0.2 F720\nG1 X110 E8 F900\nG1 X40 E10 F700\nG92 E0\n\nM221 S95 ; set flow", + "machine_end_gcode": "G1 E-1 F2100 ; retract\n{if max_layer_z < 210}G1 Z{min(max_layer_z+2, 210)} F720 ; Move print head up{endif}\nG1 X178 Y178 F4200 ; park print head\n{if max_layer_z < 210}G1 Z{min(max_layer_z+30, 210)} F720 ; Move print head further up{endif}\nG4 ; wait\nM104 S0 ; turn off temperature\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nM221 S100 ; reset flow\nM900 K0 ; reset LA\nM84 ; disable motors", + "layer_change_gcode": ";AFTER_LAYER_CHANGE\n;[layer_z]", + "before_layer_change_gcode": ";BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n", + "scan_first_layer": "0", + "machine_load_filament_time": "17", + "machine_unload_filament_time": "16", + "nozzle_type": "hardened_steel", + "auxiliary_fan": "0" +} diff --git a/resources/profiles/Prusa/machine/Prusa MK4.json b/resources/profiles/Prusa/machine/Prusa MK4.json new file mode 100644 index 0000000000..5b5392a879 --- /dev/null +++ b/resources/profiles/Prusa/machine/Prusa MK4.json @@ -0,0 +1,12 @@ +{ + "type": "machine_model", + "name": "Prusa MK4", + "model_id": "MK4", + "nozzle_diameter": "0.4", + "machine_tech": "FFF", + "family": "Prusa", + "bed_model": "mk4_bed.stl", + "bed_texture": "mk4.svg", + "hotend_model": "", + "default_materials": "Prusa Generic ABS;Prusa Generic PLA;Prusa Generic PLA-CF;Prusa Generic PETG;Prusa Generic TPU;Prusa Generic ASA;Prusa Generic PC;Prusa Generic PVA;Prusa Generic PA;Prusa Generic PA-CF" +} diff --git a/resources/profiles/Prusa/mk4.svg b/resources/profiles/Prusa/mk4.svg new file mode 100644 index 0000000000..76d2cb069a --- /dev/null +++ b/resources/profiles/Prusa/mk4.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/profiles/Prusa/mk4_bed.stl b/resources/profiles/Prusa/mk4_bed.stl new file mode 100644 index 0000000000..6aff36f0bc Binary files /dev/null and b/resources/profiles/Prusa/mk4_bed.stl differ diff --git a/resources/profiles/Prusa/process/0.20mm Standard @MK4.json b/resources/profiles/Prusa/process/0.20mm Standard @MK4.json new file mode 100644 index 0000000000..1cd5ed3ca5 --- /dev/null +++ b/resources/profiles/Prusa/process/0.20mm Standard @MK4.json @@ -0,0 +1,26 @@ +{ + "type": "process", + "setting_id": "GP004", + "name": "0.20mm Standard @MK4", + "from": "system", + "instantiation": "true", + "inherits": "fdm_process_common", + "initial_layer_speed": "45", + "initial_layer_infill_speed": "80", + "outer_wall_speed": "170", + "inner_wall_speed": "170", + "sparse_infill_speed": "200", + "internal_solid_infill_speed": "200", + "top_surface_speed": "100", + "gap_infill_speed": "120", + "travel_speed": "300", + "default_acceleration": "4000", + "initial_layer_acceleration": "700", + "top_surface_acceleration": "1000", + "travel_acceleration": "4000", + "inner_wall_acceleration": "4000", + "outer_wall_acceleration": "3000", + "compatible_printers": [ + "Prusa MK4 0.4 nozzle" + ] +} \ No newline at end of file diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 9a11200346..c4119bd5aa 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2488,6 +2488,12 @@ void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print) file.write_format("M204 P%d T%d ; sets acceleration (P, T), mm/sec^2\n", int(print.config().machine_max_acceleration_extruding.values.front() + 0.5), travel_acc); + else if (flavor == gcfMarlinFirmware) + // New Marlin uses M204 P[print] R[retract] T[travel] + file.write_format("M204 P%d R%d T%d ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2\n", + int(print.config().machine_max_acceleration_extruding.values.front() + 0.5), + int(print.config().machine_max_acceleration_retracting.values.front() + 0.5), + int(print.config().machine_max_acceleration_travel.values.front() + 0.5)); else file.write_format("M204 P%d R%d T%d\n", int(print.config().machine_max_acceleration_extruding.values.front() + 0.5), diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index e28e142d05..4d9dd3fefb 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -18,16 +18,20 @@ namespace Slic3r { bool GCodeWriter::full_gcode_comment = true; const double GCodeWriter::slope_threshold = 3 * PI / 180; +bool supports_separate_travel_acceleration(GCodeFlavor flavor) +{ + return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware); +} + void GCodeWriter::apply_print_config(const PrintConfig &print_config) { this->config.apply(print_config, true); m_single_extruder_multi_material = print_config.single_extruder_multi_material.value; - bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy || - print_config.gcode_flavor.value == gcfMarlinFirmware || - print_config.gcode_flavor.value == gcfKlipper || - print_config.gcode_flavor.value == gcfRepRapFirmware; + bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware || + print_config.gcode_flavor.value == gcfKlipper || print_config.gcode_flavor.value == gcfRepRapFirmware; m_max_acceleration = std::lrint(use_mach_limits ? print_config.machine_max_acceleration_extruding.values.front() : 0); - m_max_jerk = std::lrint(use_mach_limits ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0); + m_max_jerk = std::lrint( + use_mach_limits ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0); m_max_jerk_z = print_config.machine_max_jerk_z.values.front(); m_max_jerk_e = print_config.machine_max_jerk_e.values.front(); } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index e2074bd217..76b8fcfd0b 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1972,7 +1972,7 @@ void PrintConfigDef::init_fff_params() //def->enum_values.push_back("repetier"); //def->enum_values.push_back("teacup"); //def->enum_values.push_back("makerware"); - //def->enum_values.push_back("marlin2"); + def->enum_values.push_back("marlin2"); //def->enum_values.push_back("sailfish"); //def->enum_values.push_back("mach3"); //def->enum_values.push_back("machinekit"); @@ -1985,7 +1985,7 @@ void PrintConfigDef::init_fff_params() //def->enum_labels.push_back("Repetier"); //def->enum_labels.push_back("Teacup"); //def->enum_labels.push_back("MakerWare (MakerBot)"); - //def->enum_labels.push_back("Marlin 2"); + def->enum_labels.push_back("Marlin 2"); //def->enum_labels.push_back("Sailfish (MakerBot)"); //def->enum_labels.push_back("Mach3/LinuxCNC"); //def->enum_labels.push_back("Machinekit");