Skip to content

Commit 0dc57c4

Browse files
authored
Merge branch 'main' into CURA-11966_reduce-speed-on-overhang
2 parents fb54c92 + 35a8c58 commit 0dc57c4

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

include/settings/EnumSettings.h

+6
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ enum class EGCodeFlavor
225225
* M227 is used to initialize a single extrusion train.
226226
**/
227227
GRIFFIN = 6,
228+
/**
229+
* Cheetah flavored is Griffin based, but with the Cheetah planner.
230+
* This means it has a jerk-limited motion profile based on real jerk (instead of Marlin's jump).
231+
* The jerk value is set using M215 in m/s^3
232+
**/
233+
CHEETAH = 61,
228234

229235
REPETIER = 7,
230236

src/gcodeExport.cpp

+23-7
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void GCodeExport::setInitialAndBuildVolumeTemps(const unsigned int start_extrude
167167
void GCodeExport::setInitialTemp(int extruder_nr, double temp)
168168
{
169169
extruder_attr_[extruder_nr].initial_temp_ = temp;
170-
if (flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::ULTIGCODE)
170+
if (flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::CHEETAH || flavor_ == EGCodeFlavor::ULTIGCODE)
171171
{
172172
extruder_attr_[extruder_nr].current_temperature_ = temp;
173173
}
@@ -189,6 +189,8 @@ std::string GCodeExport::flavorToString(const EGCodeFlavor& flavor)
189189
return "Marlin(Volumetric)";
190190
case EGCodeFlavor::GRIFFIN:
191191
return "Griffin";
192+
case EGCodeFlavor::CHEETAH:
193+
return "Cheetah";
192194
case EGCodeFlavor::REPETIER:
193195
return "Repetier";
194196
case EGCodeFlavor::REPRAP:
@@ -211,6 +213,7 @@ std::string GCodeExport::getFileHeader(
211213
switch (flavor_)
212214
{
213215
case EGCodeFlavor::GRIFFIN:
216+
case EGCodeFlavor::CHEETAH:
214217
prefix << ";START_OF_HEADER" << new_line_;
215218
prefix << ";HEADER_VERSION:0.1" << new_line_;
216219
prefix << ";FLAVOR:" << flavorToString(flavor_) << new_line_;
@@ -687,7 +690,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons
687690
writeCode(mesh_group_settings.get<std::string>("machine_start_gcode").c_str());
688691
}
689692

690-
if (getFlavor() == EGCodeFlavor::GRIFFIN)
693+
if (getFlavor() == EGCodeFlavor::GRIFFIN || getFlavor() == EGCodeFlavor::CHEETAH)
691694
{
692695
std::ostringstream tmp;
693696
tmp << "T" << start_extruder_nr;
@@ -728,7 +731,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons
728731
tmp << "M227 S" << (mesh_group_settings.get<coord_t>("retraction_amount") * 2560 / 1000) << " P" << (mesh_group_settings.get<coord_t>("retraction_amount") * 2560 / 1000);
729732
writeLine(tmp.str().c_str());
730733
}
731-
else if (getFlavor() == EGCodeFlavor::GRIFFIN)
734+
else if (getFlavor() == EGCodeFlavor::GRIFFIN || getFlavor() == EGCodeFlavor::CHEETAH)
732735
{ // initialize extruder trains
733736
ExtruderTrain& train = Application::getInstance().current_slice_->scene.extruders[start_extruder_nr];
734737
processInitialLayerTemperature(storage, start_extruder_nr);
@@ -742,7 +745,7 @@ bool GCodeExport::initializeExtruderTrains(const SliceDataStorage& storage, cons
742745
{
743746
writeExtrusionMode(true);
744747
}
745-
if (getFlavor() != EGCodeFlavor::GRIFFIN)
748+
if (getFlavor() != EGCodeFlavor::GRIFFIN && getFlavor() != EGCodeFlavor::CHEETAH)
746749
{
747750
if (mesh_group_settings.get<bool>("retraction_enable"))
748751
{
@@ -836,6 +839,7 @@ void GCodeExport::processInitialLayerTemperature(const SliceDataStorage& storage
836839
case EGCodeFlavor::ULTIGCODE:
837840
return;
838841
case EGCodeFlavor::GRIFFIN:
842+
case EGCodeFlavor::CHEETAH:
839843
wait_start_extruder = true;
840844
break;
841845
default:
@@ -857,6 +861,7 @@ bool GCodeExport::needPrimeBlob() const
857861
switch (getFlavor())
858862
{
859863
case EGCodeFlavor::GRIFFIN:
864+
case EGCodeFlavor::CHEETAH:
860865
return true;
861866
default:
862867
// TODO: change this once priming for other firmware types is implemented
@@ -1435,7 +1440,7 @@ void GCodeExport::writePrimeTrain(const Velocity& travel_speed)
14351440
writeTravel(prime_pos, travel_speed);
14361441
}
14371442

1438-
if (flavor_ == EGCodeFlavor::GRIFFIN)
1443+
if (flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::CHEETAH)
14391444
{
14401445
bool should_correct_z = false;
14411446

@@ -1654,7 +1659,7 @@ void GCodeExport::writeBedTemperatureCommand(const Temperature& temperature, con
16541659

16551660
void GCodeExport::writeBuildVolumeTemperatureCommand(const Temperature& temperature, const bool wait)
16561661
{
1657-
if (flavor_ == EGCodeFlavor::ULTIGCODE || flavor_ == EGCodeFlavor::GRIFFIN)
1662+
if (flavor_ == EGCodeFlavor::ULTIGCODE || flavor_ == EGCodeFlavor::GRIFFIN || flavor_ == EGCodeFlavor::CHEETAH)
16581663
{
16591664
// Ultimaker printers don't support build volume temperature commands.
16601665
return;
@@ -1735,12 +1740,23 @@ void GCodeExport::writeJerk(const Velocity& jerk)
17351740
case EGCodeFlavor::REPRAP:
17361741
*output_stream_ << "M566 X" << PrecisionedDouble{ 2, jerk * 60 } << " Y" << PrecisionedDouble{ 2, jerk * 60 } << new_line_;
17371742
break;
1743+
case EGCodeFlavor::CHEETAH:
1744+
*output_stream_ << "M215 X" << PrecisionedDouble{ 2, jerk * 1000 } << " Y" << PrecisionedDouble{ 2, jerk * 1000 } << new_line_;
1745+
break;
17381746
default:
17391747
*output_stream_ << "M205 X" << PrecisionedDouble{ 2, jerk } << " Y" << PrecisionedDouble{ 2, jerk } << new_line_;
17401748
break;
17411749
}
17421750
current_jerk_ = jerk;
1743-
estimate_calculator_.setMaxXyJerk(jerk);
1751+
1752+
if (getFlavor() == EGCodeFlavor::CHEETAH)
1753+
{
1754+
estimate_calculator_.setMaxXyJerk(jerk / 200);
1755+
}
1756+
else
1757+
{
1758+
estimate_calculator_.setMaxXyJerk(jerk);
1759+
}
17441760
}
17451761
}
17461762

src/settings/Settings.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ EGCodeFlavor Settings::get<EGCodeFlavor>(const std::string& key) const
371371
return EGCodeFlavor::MARLIN;
372372
case "Griffin"_sw:
373373
return EGCodeFlavor::GRIFFIN;
374+
case "Cheetah"_sw:
375+
return EGCodeFlavor::CHEETAH;
374376
case "UltiGCode"_sw:
375377
return EGCodeFlavor::ULTIGCODE;
376378
case "Makerbot"_sw:

0 commit comments

Comments
 (0)