Skip to content

Commit

Permalink
Add MakerBot flavored GCode.
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed Oct 6, 2013
1 parent c338f4a commit 4f5b366
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
18 changes: 14 additions & 4 deletions gcodeExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,20 @@ class GCodeExport
{
if (currentFanSpeed == speed)
return;
if (speed > 0)
fprintf(f, "M106 S%d\n", speed * 255 / 100);
else
fprintf(f, "M107\n");
if (speed > 0)
{
if (flavor == GCODE_FLAVOR_MAKERBOT)
fprintf(f, "M126 T0 ; value = %d\n", speed * 255 / 100);
else
fprintf(f, "M106 S%d\n", speed * 255 / 100);
}
else
{
if (flavor == GCODE_FLAVOR_MAKERBOT)
fprintf(f, "M127 T0\n");
else
fprintf(f, "M107\n");
}
currentFanSpeed = speed;
}

Expand Down
10 changes: 10 additions & 0 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ class _ConfigSettingIndex
* M106 Sxxx and M107 are used to turn the fan on/off.
**/
#define GCODE_FLAVOR_ULTIGCODE 1
/**
* Makerbot flavored GCode.
* Looks a lot like RepRap GCode with a few changes. Requires MakerWare to convert to X3G files.
* Heating needs to be done with M104 Sxxx T0
* No G21 or G90
* Fan ON is M126 T0 (No fan strength control?)
* Fan OFF is M127 T0
* Homing is done with G162 X Y F2000
**/
#define GCODE_FLAVOR_MAKERBOT 2

class ConfigSettings
{
Expand Down

4 comments on commit 4f5b366

@CT4
Copy link

@CT4 CT4 commented on 4f5b366 Nov 15, 2013

Choose a reason for hiding this comment

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

I am a new user and do not understand all of this code. I would like to use Cura on my Makerbot Rep 2. Please can you help me as to how to do this. Do I just cut and past the start/End G code into a new profile, I have done that. Then how and where do I add your code to convert it to x3g. Thanks.

@daid
Copy link
Contributor Author

@daid daid commented on 4f5b366 Nov 18, 2013

Choose a reason for hiding this comment

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

You need to generate the GCode with Cura and then convert it to X3G with MakerWare. (I'm not 100% sure on how this works in detail, as I have no Replicator)

@CT4
Copy link

@CT4 CT4 commented on 4f5b366 Nov 18, 2013

Choose a reason for hiding this comment

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

Thanks for you answer but Makerware does not read gcode only STL and OBJ files

@daid
Copy link
Contributor Author

@daid daid commented on 4f5b366 Nov 18, 2013

Choose a reason for hiding this comment

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

Not sure how it's done. All the info I got came from https://github.com/tchapi/CuraForMakerbots

Please sign in to comment.