diff --git a/include/settings/EnumSettings.h b/include/settings/EnumSettings.h index aa16eab795..25f2a157fd 100644 --- a/include/settings/EnumSettings.h +++ b/include/settings/EnumSettings.h @@ -225,6 +225,12 @@ enum class EGCodeFlavor * M227 is used to initialize a single extrusion train. **/ GRIFFIN = 6, + /** + * Cheetah flavored is Griffin based, but with the Cheetah planner. + * This means it has a jerk-limited motion profile based on real jerk (instead of Marlin's jump). + * The jerk value is set using M215 in m/s^3 + **/ + CHEETAH = 61, REPETIER = 7, diff --git a/src/gcodeExport.cpp b/src/gcodeExport.cpp index 7dafd74087..89ac368a58 100644 --- a/src/gcodeExport.cpp +++ b/src/gcodeExport.cpp @@ -167,7 +167,7 @@ void GCodeExport::setInitialAndBuildVolumeTemps(const unsigned int start_extrude void GCodeExport::setInitialTemp(int extruder_nr, double temp) { extruder_attr_[extruder_nr].initial_temp_ = temp; - if (flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::ULTIGCODE) + if (flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::CHEETAH || flavor_ == EGCodeFlavor::ULTIGCODE) { extruder_attr_[extruder_nr].current_temperature_ = temp; } @@ -189,6 +189,8 @@ std::string GCodeExport::flavorToString(const EGCodeFlavor& flavor) return "Marlin(Volumetric)"; case EGCodeFlavor::GRIFFIN: return "Griffin"; + case EGCodeFlavor::CHEETAH: + return "Cheetah"; case EGCodeFlavor::REPETIER: return "Repetier"; case EGCodeFlavor::REPRAP: @@ -211,6 +213,7 @@ std::string GCodeExport::getFileHeader( switch (flavor_) { case EGCodeFlavor::GRIFFIN: + case EGCodeFlavor::CHEETAH: prefix << ";START_OF_HEADER" << new_line_; prefix << ";HEADER_VERSION:0.1" << new_line_; prefix << ";FLAVOR:" << flavorToString(flavor_) << new_line_; @@ -687,7 +690,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons writeCode(mesh_group_settings.get("machine_start_gcode").c_str()); } - if (getFlavor() == EGCodeFlavor::GRIFFIN) + if (getFlavor() == EGCodeFlavor::GRIFFIN || getFlavor() == EGCodeFlavor::CHEETAH) { std::ostringstream tmp; tmp << "T" << start_extruder_nr; @@ -728,7 +731,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons tmp << "M227 S" << (mesh_group_settings.get("retraction_amount") * 2560 / 1000) << " P" << (mesh_group_settings.get("retraction_amount") * 2560 / 1000); writeLine(tmp.str().c_str()); } - else if (getFlavor() == EGCodeFlavor::GRIFFIN) + else if (getFlavor() == EGCodeFlavor::GRIFFIN || getFlavor() == EGCodeFlavor::CHEETAH) { // initialize extruder trains ExtruderTrain& train = Application::getInstance().current_slice_->scene.extruders[start_extruder_nr]; processInitialLayerTemperature(storage, start_extruder_nr); @@ -742,7 +745,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons { writeExtrusionMode(true); } - if (getFlavor() != EGCodeFlavor::GRIFFIN) + if (getFlavor() != EGCodeFlavor::GRIFFIN && getFlavor() != EGCodeFlavor::CHEETAH) { if (mesh_group_settings.get("retraction_enable")) { @@ -836,6 +839,7 @@ void GCodeExport::processInitialLayerTemperature(const SliceDataStorage& storage case EGCodeFlavor::ULTIGCODE: return; case EGCodeFlavor::GRIFFIN: + case EGCodeFlavor::CHEETAH: wait_start_extruder = true; break; default: @@ -857,6 +861,7 @@ bool GCodeExport::needPrimeBlob() const switch (getFlavor()) { case EGCodeFlavor::GRIFFIN: + case EGCodeFlavor::CHEETAH: return true; default: // TODO: change this once priming for other firmware types is implemented @@ -1435,7 +1440,7 @@ void GCodeExport::writePrimeTrain(const Velocity& travel_speed) writeTravel(prime_pos, travel_speed); } - if (flavor_ == EGCodeFlavor::GRIFFIN) + if (flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::CHEETAH) { bool should_correct_z = false; @@ -1654,7 +1659,7 @@ void GCodeExport::writeBedTemperatureCommand(const Temperature& temperature, con void GCodeExport::writeBuildVolumeTemperatureCommand(const Temperature& temperature, const bool wait) { - if (flavor_ == EGCodeFlavor::ULTIGCODE || flavor_ == EGCodeFlavor::GRIFFIN) + if (flavor_ == EGCodeFlavor::ULTIGCODE || flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::CHEETAH) { // Ultimaker printers don't support build volume temperature commands. return; @@ -1735,6 +1740,9 @@ void GCodeExport::writeJerk(const Velocity& jerk) case EGCodeFlavor::REPRAP: *output_stream_ << "M566 X" << PrecisionedDouble{ 2, jerk * 60 } << " Y" << PrecisionedDouble{ 2, jerk * 60 } << new_line_; break; + case EGCodeFlavor::CHEETAH: + *output_stream_ << "M215 X" << PrecisionedDouble{ 2, jerk * 1000 } << " Y" << PrecisionedDouble{ 2, jerk * 1000 } << new_line_; + break; default: *output_stream_ << "M205 X" << PrecisionedDouble{ 2, jerk } << " Y" << PrecisionedDouble{ 2, jerk } << new_line_; break; diff --git a/src/settings/Settings.cpp b/src/settings/Settings.cpp index 4e39ef8555..cdec09e07e 100644 --- a/src/settings/Settings.cpp +++ b/src/settings/Settings.cpp @@ -371,6 +371,8 @@ EGCodeFlavor Settings::get(const std::string& key) const return EGCodeFlavor::MARLIN; case "Griffin"_sw: return EGCodeFlavor::GRIFFIN; + case "Cheetah"_sw: + return EGCodeFlavor::CHEETAH; case "UltiGCode"_sw: return EGCodeFlavor::ULTIGCODE; case "Makerbot"_sw: