Skip to content

Commit

Permalink
Introduce Cheetah flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic98 committed Dec 18, 2024
1 parent d4853d4 commit 24b6372
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
6 changes: 6 additions & 0 deletions include/settings/EnumSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
20 changes: 14 additions & 6 deletions src/gcodeExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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:
Expand All @@ -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_;
Expand Down Expand Up @@ -687,7 +690,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons
writeCode(mesh_group_settings.get<std::string>("machine_start_gcode").c_str());
}

if (getFlavor() == EGCodeFlavor::GRIFFIN)
if (getFlavor() == EGCodeFlavor::GRIFFIN || getFlavor() == EGCodeFlavor::CHEETAH)
{
std::ostringstream tmp;
tmp << "T" << start_extruder_nr;
Expand Down Expand Up @@ -728,7 +731,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons
tmp << "M227 S" << (mesh_group_settings.get<coord_t>("retraction_amount") * 2560 / 1000) << " P" << (mesh_group_settings.get<coord_t>("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);
Expand All @@ -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<bool>("retraction_enable"))
{
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/settings/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ EGCodeFlavor Settings::get<EGCodeFlavor>(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:
Expand Down

0 comments on commit 24b6372

Please sign in to comment.