Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1209623
Fixes issue where the Y axis is at the extreme and the G162 homing co…
jetty840 Dec 19, 2011
d845f7b
Added BlinkM Mood Light GCode Support (M210, M211, M212).
jetty840 Jan 3, 2012
a76b483
Implements Buzzer functionality on V2.4 Motherboard. Buzzer required…
jetty840 Jan 18, 2012
b48792d
Added acceleration MCode support to go with https://github.com/jetty8…
jetty840 Feb 20, 2012
8b9a61a
Added accelerated ToMs to machines.xml
jetty840 Feb 26, 2012
46c9a4b
Added K parameter to M207 for Minimum Segment Time
jetty840 Feb 27, 2012
e3170ea
Updated M206 command to change Filament Diameter to Noodle Diameter a…
jetty840 Mar 17, 2012
3bcdf57
Updated thingomatic.xml for a faster Z on accelerated machines. Also…
jetty840 Mar 17, 2012
740cb7a
Merging with master, updating to ReplicatorG 0034
jetty840 Mar 18, 2012
8935b92
Adding changes back in for Jetty Firmware that weere removed when GCo…
jetty840 Mar 18, 2012
60f53d6
New command format adds ,"". Added for Jetty firmware commands.
jetty840 Mar 18, 2012
3e09b62
Removed min junction speed from M205 and added M216 with X/Y/Z/A min …
jetty840 Mar 31, 2012
a6f16d1
Part of last commit
jetty840 Mar 31, 2012
396e2da
Renamed Minimum Junction Speed to Maximum Speed Change
jetty840 Mar 31, 2012
29e55ed
Moved acceleration MCodes from Markerbot4GDriver to Sanguino3GDriver
jetty840 Mar 31, 2012
970b689
Fixing M205 / M206 commands.
jetty840 Mar 31, 2012
385bcd3
Changed Advance to JKN Advance and added JKN Advance K2
jetty840 Apr 15, 2012
a958f2b
Deleting accelerated machines from thingomatic.xml and they are now s…
jetty840 Apr 26, 2012
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
19 changes: 10 additions & 9 deletions machines/thingomatic.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.1" encoding="utf-8"?>

<machines>
<machine>
<name>Thingomatic w/ ABP and Extruder MK5</name>
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
</geometry>
<tools>
Expand All @@ -28,7 +29,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
</geometry>
<tools>
Expand All @@ -52,7 +53,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
<axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
</geometry>
Expand All @@ -77,7 +78,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
<axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
</geometry>
Expand All @@ -101,7 +102,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
<axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
</geometry>
Expand All @@ -125,7 +126,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
<axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
</geometry>
Expand All @@ -149,7 +150,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="80" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="80" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="80" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
<axis id="a" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
<axis id="b" length="100000" maxfeedrate="1600" stepspermm="50.235478806907409" endstops="none"/> <!-- stepspermm is incoming filament length, 127 is ca. 4 RPM, 1600 ca. 50 RPM -->
Expand Down Expand Up @@ -184,7 +185,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
</geometry>
<tools>
Expand All @@ -210,7 +211,7 @@ M18 (Turn off steppers after a build.)
<geometry type="cartesian">
<!-- different pulleys on X and Y axii -->
<axis id="x" length="106" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="y" length="120" maxfeedrate="4000" homingfeedrate="500" timeout="30" stepspermm="47.069852" endstops="min"/> <!-- Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) -->
<axis id="z" length="106" maxfeedrate="1000" homingfeedrate="500" stepspermm="200" endstops="max"/> <!-- TR-8x8 Z axis = 1/(8/1600) -->
<axis id="a" length="100" maxfeedrate="200" stepspermm="200" endstops="none"/>
</geometry>
Expand Down
15 changes: 15 additions & 0 deletions src/replicatorg/app/gcode/GCodeEnumeration.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ public enum GCodeEnumeration {
M141("M", 141, "Set Chamber Temperature (Ignored)"),
M142("M", 142, "Set Chamber Holding Pressure (Ignored)"),
M200("M", 200, "Reset driver"),
M201("M", 201, "Set max acceleration"),
M203("M", 203, "Set max feedrate"),
M204("M", 204, "Set default acceleration"),
M205("M", 205, "Set Advanced Settings"),
M206("M", 206, "Set Advanced Settings 2"),
M207("M", 207, "Set JKN Advance K/K2 and Seg Min Time"),
M208("M", 208, "Set Extruder Steps:mm"),
M209("M", 209, "Set Acceleration Control"),
M210("M", 210, "Mood Light Set RGB Color"),
M211("M", 211, "Mood Light Set HSB Color"),
M212("M", 212, "Mood Light Play Script"),
M213("M", 213, "Set Buzzer Repetitions"),
M214("M", 214, "Buzz"),
M215("M", 215, "Set Axis Steps Per:mm"),
M216("M", 216, "Set Maximum Speed Change"),
M300("M", 300, "Set Servo 1 Position"),
M301("M", 301, "Set Servo 2 Position"),
M310("M", 310, "Start data capture"),
Expand Down
169 changes: 169 additions & 0 deletions src/replicatorg/app/gcode/GCodeParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,175 @@ else if (gcode.hasCode('R'))
commands.add(new replicatorg.drivers.commands.WaitUntilBufferEmpty());
commands.add(new replicatorg.drivers.commands.DataCaptureNote(gcode.getComment()));
break;

case M201: //Set max acceleration
{
double x = gcode.getCodeValue('X');
double y = gcode.getCodeValue('Y');
double z = gcode.getCodeValue('Z');
double a = gcode.getCodeValue('A');
commands.add(new replicatorg.drivers.commands.SetMaxAcceleration(x,y,z,a));
}
break;

case M203: //Set max feedrate
{
double x = gcode.getCodeValue('X');
double y = gcode.getCodeValue('Y');
double z = gcode.getCodeValue('Z');
double a = gcode.getCodeValue('A');
commands.add(new replicatorg.drivers.commands.SetMaxFeedRate(x,y,z,a));
}
break;

case M204: //Set default acceleration
{
double s = gcode.getCodeValue('S');
double t = gcode.getCodeValue('K');
commands.add(new replicatorg.drivers.commands.SetDefaultAcceleration(s,t));
}
break;

case M205: //Set Advanced Settings
{
double s = (double)gcode.getCodeValue('S') / 10.0;
double t = (double)gcode.getCodeValue('K') / 10.0;
double z = (double)gcode.getCodeValue('Z') / 10.0;
commands.add(new replicatorg.drivers.commands.SetAdvancedSettings(s,t,z));
}
break;

case M206: //Set Advanced Settings 2
{
double s = (double)gcode.getCodeValue('S') / 100.0;
double a = (double)gcode.getCodeValue('A');
double k = (double)gcode.getCodeValue('K') / 10.0;
double x = (double)gcode.getCodeValue('X');
double y = (double)gcode.getCodeValue('Y');
commands.add(new replicatorg.drivers.commands.SetAdvancedSettings2(s,a,k,x,y));
}
break;

case M207: //Set JKN Advance K/K2 and Minimum Segment Time
{
double s = (double)gcode.getCodeValue('S') / 100000.0;
double a = (double)gcode.getCodeValue('A') / 100000.0;
double k = (double)gcode.getCodeValue('K') / 10000.0;
commands.add(new replicatorg.drivers.commands.SetAdvanceK(s,a,k));
}
break;

case M208: //Set Extruder Steps:mm
{
double a = gcode.getCodeValue('A') / 10.0;
commands.add(new replicatorg.drivers.commands.SetExtruderStepsPerMM(a));
}
break;

case M209: //Set Acceleration Control
{
double s = gcode.getCodeValue('S');
commands.add(new replicatorg.drivers.commands.SetAccelerationControl(s));
}
break;

case M210: // Mood Light Set RGB Color
double fadeSpeed = (int)gcode.getCodeValue('S');
if ( fadeSpeed == -1 ) fadeSpeed = 8; //The default

double writeToEeprom = (int)gcode.getCodeValue('E');
if ( writeToEeprom == -1 ) writeToEeprom = 0; //The default

if (( fadeSpeed < 0 ) || ( fadeSpeed > 255 )) {
throw new GCodeException("The S parameter must, range from 0-255. (M210)");
}

double red = gcode.getCodeValue('I');
double green = gcode.getCodeValue('J');
double blue = gcode.getCodeValue('K');

if (( red >= 0.0 ) && ( red<=255.0) && ( green >= 0.0 ) && ( green<=255.0) && ( blue >= 0.0 ) && ( blue<=255.0)) {
commands.add(new replicatorg.drivers.commands.MoodLightSetRGB((int)red, (int)green, (int)blue, (int)fadeSpeed, (int)writeToEeprom));
} else {
throw new GCodeException("The IJK parameters are required for mood light changes, ranging from 0-255. (M210)");
}
break;

case M211: // Mood Light Set HSB Color
fadeSpeed = (int)gcode.getCodeValue('S');
if ( fadeSpeed == -1 ) fadeSpeed = 8; //The default

if (( fadeSpeed < 0 ) || ( fadeSpeed > 255 )) {
throw new GCodeException("The S parameter must, range from 0-255. (M211)");
}

double hue = gcode.getCodeValue('I');
double saturation = gcode.getCodeValue('J');
double brightness = gcode.getCodeValue('K');

if (( hue >= 0.0 ) && ( hue<=255.0) && ( saturation >= 0.0 ) && ( saturation<=255.0) && ( brightness >= 0.0 ) && ( brightness<=255.0)) {
commands.add(new replicatorg.drivers.commands.MoodLightSetHSB((int)hue, (int)saturation, (int)brightness, (int)fadeSpeed));
} else {
throw new GCodeException("The IJK parameters are required for mood light changes, ranging from 0-255. (M211)");
}
break;

case M212: // Mood Light Play Script
double scriptId = (int)gcode.getCodeValue('S');

writeToEeprom = (int)gcode.getCodeValue('E');
if ( writeToEeprom == -1 ) writeToEeprom = 0; //The default

if (( scriptId >= 0 ) && ( scriptId <= 255 )) {
commands.add(new replicatorg.drivers.commands.MoodLightPlayScript((int)scriptId, (int)writeToEeprom));
} else {
throw new GCodeException("The S parameter is required and must, range from 0-255. (M212)");
}
break;
case M213: // Set Buzzer Repetitions
int repeats = (int)gcode.getCodeValue('K');

if (( repeats >= 0 ) && ( repeats <= 254 )) {
commands.add(new replicatorg.drivers.commands.SetBuzzerRepetitions(repeats));
} else {
throw new GCodeException("The K parameter is required and must, range from 0-254. (M213)");
}
break;

case M214: // Buzz
int buzzes = (int)gcode.getCodeValue('I');
int duration = (int)gcode.getCodeValue('J');
repeats = (int)gcode.getCodeValue('K');

if ((buzzes < 0) || ( buzzes > 255 ))
throw new GCodeException("The I parameter is required and must, range from 0-255. (M214)");
else if (( duration < 1 ) || ( duration > 255))
throw new GCodeException("The J parameter is required and must, range from 1 - 255. (M214)");
else if (( repeats < 1 ) || ( repeats > 255))
throw new GCodeException("The K parameter is required and must, range from 1 - 255. (M214)");
else commands.add(new replicatorg.drivers.commands.Buzz(buzzes, duration, repeats));
break;

case M215: //Set Axis Steps Per:mm
{
double x = (double)gcode.getCodeValue('X') / 10000.0;
double y = (double)gcode.getCodeValue('Y') / 10000.0;
double z = (double)gcode.getCodeValue('Z') / 10000.0;
double a = (double)gcode.getCodeValue('A') / 10000.0;
commands.add(new replicatorg.drivers.commands.SetAxisStepsPerMM(x,y,z,a));
}
break;

case M216: //Set Maximum Speed Change
{
double x = (double)gcode.getCodeValue('X') / 10.0;
double y = (double)gcode.getCodeValue('Y') / 10.0;
double z = (double)gcode.getCodeValue('Z') / 10.0;
double a = (double)gcode.getCodeValue('A') / 10.0;
commands.add(new replicatorg.drivers.commands.SetMaxSpeedChange(x,y,z,a));
}
break;

default:
throw new GCodeException("Unknown M code: M" + (int) gcode.getCodeValue('M'));
}
Expand Down
39 changes: 39 additions & 0 deletions src/replicatorg/drivers/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,45 @@ public interface Driver {
*/
public double getCurrentFeedrate();

/**
* Moodlight Methods
*/
public void moodLightSetRGB(int red, int green, int blue, int fadeSpeed, int writeToEeprom) throws RetryException;

public void moodLightSetHSB(int hue, int saturation, int brightness, int fadeSpeed) throws RetryException;

public void moodLightPlayScript(int scriptId, int writeToEeprom) throws RetryException;

/**
* Buzzer Methods
*/
public void setBuzzerRepetitions(int repeats) throws RetryException;

public void buzz(int buzzes, int duration, int repeats) throws RetryException;

/**
* Acceleration Methods
*/
public void setMaxAcceleration(double x, double y, double z, double a) throws RetryException;

public void setMaxFeedRate(double x, double y, double z, double a) throws RetryException;

public void setDefaultAcceleration(double s, double t) throws RetryException;

public void setAdvancedSettings(double s, double t, double z) throws RetryException;

public void setAdvancedSettings2(double s, double a, double k, double x, double y) throws RetryException;

public void setAdvanceK(double s, double a, double k) throws RetryException;

public void setExtruderStepsPerMM(double a) throws RetryException;

public void setAccelerationControl(double s) throws RetryException;

public void setAxisStepsPerMM(double x, double y, double z, double a) throws RetryException;

public void setMaxSpeedChange(double x, double y, double z, double a) throws RetryException;

/**
* Home the given set of axes at the given feedrate. If the feedrate is <=0, run at
* maximum feedrate for the appropriate axes.
Expand Down
Loading