Skip to content
Open
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
4 changes: 3 additions & 1 deletion xs/src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ GCodeWriter::preamble()
std::ostringstream gcode;

if (FLAVOR_IS_NOT(gcfMakerWare)) {
gcode << "G21 ; set units to millimeters\n";
if (FLAVOR_IS_NOT(gcfM3dMicro)) {
gcode << "G21 ; set units to millimeters\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that printer firmware does something weird for g21?

But you need G90 in the defaults?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that printer does not accept G21. More specifically, it doesn't accept other combinations of specific printer profiles in the export code either. I went through them one by one, and each profile adds a g-code or syntax that this simple printer does not accept unfortunately.

A better, more generic, way would perhaps be to have a generic default, which would be similar to this new profile, and have a specific option for the G21.

While I was looking through the export code, I noticed that it bocomes more cluttered the more printers are added. For that reason I don't like my own change, but it gets the job done for me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through the Spooler logs from the M3D supplied spooler, and in there I can see that the printer identifies as a Repetier protocol 2 firmware. However, when looking at the generated G-code from the supplied Cura engine, it does not fully match what is generated with the Repetier setting in Slic3r. The printer returns an error code for G21, and other G-codes for mainly extrusion does not match the M3D generated G-code.

I'll make a test with the Repetier setting, and manually remove the G21 to see if that works. The G21 is still problematic though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested G-code generated by the Repetier export. With the G21 left in, the printer just stops at that command. Without G21 it stops after warming up. It is interesting though that when I run the exact same sequence of generated G-codes manually without G21 (i.e. with a lot of time in between each command) they work in the generated sequence. I suspect it is the M82 directly after G90 that causes the hickup. So the most reliable setting for this printer is with this small addition.

Of course, still up to you if this is something that should be included or not. At least now I have a setup that works for me for this printer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that the better long term solution is to have a "generic" flavor that lets the user provide a file that says "use X to do task Y".
Leaving an entry blank would be enough to say "my printer can't do this, so skip"

}
gcode << "G90 ; use absolute coordinates\n";
}
if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepetier) || FLAVOR_IS(gcfSmoothie)) {
Expand Down
2 changes: 2 additions & 0 deletions xs/src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ PrintConfigDef::PrintConfigDef()
def->enum_values.push_back("mach3");
def->enum_values.push_back("machinekit");
def->enum_values.push_back("smoothie");
def->enum_values.push_back("m3dmicro");
def->enum_values.push_back("no-extrusion");
def->enum_labels.push_back("RepRap (Marlin/Sprinter)");
def->enum_labels.push_back("Repetier");
Expand All @@ -675,6 +676,7 @@ PrintConfigDef::PrintConfigDef()
def->enum_labels.push_back("Mach3/LinuxCNC");
def->enum_labels.push_back("Machinekit");
def->enum_labels.push_back("Smoothieware");
def->enum_labels.push_back("M3D Micro");
def->enum_labels.push_back("No extrusion");
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);

Expand Down
5 changes: 3 additions & 2 deletions xs/src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace Slic3r {

enum GCodeFlavor {
gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion, gcfSmoothie, gcfRepetier,
gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion, gcfSmoothie, gcfRepetier, gcfM3dMicro
};

enum HostType {
Expand Down Expand Up @@ -58,7 +58,8 @@ template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_v
keys_map["mach3"] = gcfMach3;
keys_map["machinekit"] = gcfMachinekit;
keys_map["no-extrusion"] = gcfNoExtrusion;
keys_map["smoothie"] = gcfSmoothie;
keys_map["smoothie"] = gcfSmoothie;
keys_map["m3dmicro"] = gcfM3dMicro;
return keys_map;
}

Expand Down