Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CURA-12362] Cheetah flavor #2198

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
30 changes: 23 additions & 7 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,12 +1740,23 @@ 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;
}
current_jerk_ = jerk;
estimate_calculator_.setMaxXyJerk(jerk);

if (getFlavor() == EGCodeFlavor::CHEETAH)
{
estimate_calculator_.setMaxXyJerk(jerk / 200);
}
else
{
estimate_calculator_.setMaxXyJerk(jerk);
}
}
}

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
Loading