Skip to content

Commit

Permalink
Updating documentation for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolla committed May 28, 2022
1 parent 86c6128 commit ca4464c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
16 changes: 8 additions & 8 deletions G-Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The jinschoi/SphereBot fork (https://github.com/jinschoi/SphereBot) of the Spher

M301 - Set the minimum pen position.
M302 - Set the maximum pen position.
M303 - Sset the pen up position have been added.
M303 - Set the pen up position.
M500 - Save the pen settings to the Arduino EEPROM.
M501 - Load the pen settings from the Arduino EEPROM.
M501 - Reset the pen settings to the firmware defaults.
Expand All @@ -23,9 +23,9 @@ The tgolla/SphereBot fork (https://github.com/tgolla/SphereBot) adds the followi

M304 - Sets the pen down position needed for new MZ mode.
M305 - Sets the G-Code responsible for operating the pen servo.
P0 - M300 sets the pen height. P1 - G0, G1, G2 & G3 Z parameter
is responsible for setting the pen height. P2 - Automatically
detects which code is responsible for setting the pen height.
P0 - M300 commands set the pen height.
P1 - G0, G1, G2 & G3 the Z parameter is responsible for setting the pen height.
P2 - Automatically detects which code is responsible for setting the pen height.
M306 - Sets the M300 height adjustment. P0 - Off, P1 - Preset, P2 - Calculated
M307 - Sets the Z height adjustment. P0 - Off, P1 - Preset, P2 - Calculated
M308 - Sets the M300 pen up preset value. S values less than the value
Expand All @@ -45,15 +45,15 @@ The tgolla/SphereBot fork (https://github.com/tgolla/SphereBot) adds the followi
In an Arduino Uno configuration do not add unless necessary as the code
consumes a large portion of dynamic memory.

As stated, these commands have been added to eliminate the need to modify G-Code files for a specific SphereBot by allowing you to preconfigure the software such that it can automatically adjust the pen up/down defined in the G-Code file.
As stated, these commands have been added to eliminate the need to modify G-Code files for a specific SphereBot by allowing you to preconfigure the software such that it can automatically adjust the pen up/down movement defined in the G-Code file.

### M304
The M304 command sets the pen down position. This command is used in conjunction with the M303 command that sets the pen up position. These commands allow you to adjust the pen to up/down positions specific to your SphereBot. The commands work in conjunction with the MZ mode command (M305) and the M330 and Z height adjustment commands (M306, M307).
The M304 command sets the pen down position. This command is used in conjunction with the M303 command that sets the pen up position. These commands allow you to adjust the pen to up/down positions specific to your SphereBot. The commands work in conjunction with the MZ mode command (M305) and the M300 and Z height adjustment commands (M306, M307).

### M305
The M305 command sets the MZ mode. The MZ mode setting determines how the software interprets the G-Code file. The mode can be set to one of three settings. When set to M mode (P0) the M300 command is responsible for setting the height of the pen. This is the same behavior found in past versions of the software code. When using this mode it may be necessary for you to manually modify a G-Code file to set the S word value.
The M305 command sets the MZ mode. The MZ mode setting determines how the software interprets the G-Code file. The mode can be set to one of three settings. When set to M mode (P0) the M300 command is responsible for setting the height of the pen. This is the same behavior found in past versions of the software code. When using this mode it may be necessary for you to manually modify a G-Code file to set the S word value to you SphereBot's specific up/down pen heights.

When set to Z mode the Z parameter in the G0, G1, G2 or G3 command is responsible for setting for setting the height of the pen.
When set to Z mode (P1) the Z parameter in the G0, G1, G2 or G3 commands is responsible for setting for setting the height of the pen.

When set to Auto mode (P2) the mode is set to the appropriate M or Z mode based on which command is first detected in the G-Code file. For example, if a G0, G1, G2 or G3 command with a Z parameter is read first the mode is set to Z. But if an M300 command is read first the mode is set to M.

Expand Down
2 changes: 2 additions & 0 deletions Inkscape.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Creating G-Code Files with Inkscape
The following is a tutorial outlining the steps of converting a SphereBot SVG template (3200x800) into gcode. The tutorial also discusses some of the challenges and solutions provided with some of the newer Mxxx commands of moving gcode between different SphereBots.
15 changes: 9 additions & 6 deletions SphereBot.ino
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ void processCommand()
if (gCodeNumber >= 0 && gCodeNumber <= 3) // G0, G1, G2, G3
{
// If MZ active mode equals auto and a Z coordinate exist
// set the MZ active mode to Z.
// (is found first) set the MZ active mode to Z.
if (mzActiveMode == Auto && GCode.HasWord('Z'))
mzActiveMode = Z;

Expand Down Expand Up @@ -1086,7 +1086,7 @@ void processCommand()

case 300: // M300 - Set pen (servo) position.
// If MZ active mode equals auto and a M300 command exist
// set the MZ active mode to M.
// (is found first) set the MZ active mode to M.
if (mzActiveMode == Auto)
mzActiveMode = M;

Expand Down Expand Up @@ -1152,15 +1152,18 @@ void processCommand()
break;

// M305 - Sets the G-Code responsible for operating the pen servo.
// P0 - M300 sets the pen height. P1 - G0, G1, G2 & G3 Z parameter is
// responsible for setting the pen height. P2 - Automatically detects
// which code is responsible for setting the pen height.
// P0 - M300 commands set the pen height.
// P1 - G0, G1, G2 & G3 the Z parameter is responsible for setting
// the pen height.
// P2 - Automatically detects which code is responsible for setting
// the pen height.
case 305:
if (GCode.HasWord('P'))
{
mzMode = GCode.GetWordValue('P');

if (mzMode > Auto)
// Protection from the value of P being anything other than 0, 1, or 2.
if (mzMode > Auto)
mzMode = M;

mzActiveMode = mzMode;
Expand Down

0 comments on commit ca4464c

Please sign in to comment.