-
Notifications
You must be signed in to change notification settings - Fork 296
Marlin Compatibility
For 3D printing, there is a large number of utilities that are written to speak to Marlin or various other mostly-compatible variants. Even though there are several things that don't translate between Marlin and g2core, we can make an effort to at least accept gcode sliced for Marlin, and to be able to conditionally speak the Marlin protocol.
This gives the authors of those various utilities (assuming that they are still being maintained) some time to support the g2core protocol and gcode flavor.
This will support the most-used gcode and protocol of Marlin, and nothing more.
What we don't support as Marlin (you have to use the g2core protocol for these):
- Configuration of the machine and various parameters
- Setup of motors, heaters, etc.
- Tuning PID, limit switch polarity, etc.
Also, this marlin support is a temporary option to ease transition, and will be deprecated once it becomes too difficult to support. This depreciation, once it has been scheduled, will be announced in the g2core changelog and on social media.
Gcode on Marlin must be all uppercase. g2core accepts both upper- and lower-case mixed.
On Marlin, motion of the extruder is a mixture of E
and T
words, where on g2core A
, B
, and C
are currently used. (This is planned to change to using spindle-based controls.)
On g2core, G0
does not accept an F
word and G1
requires one (but it is 'sticky,' so it only be included once, and from then on when it needs changed).
There are a few other concepts that convert more-or-less from g2core and Marlin:
g2core | Marlin | Notes |
---|---|---|
{"r":...,"f":[...]} |
ok |
In response to every sent gcode, g2core will return a response JSON, and Marlin will return ok . <br> (Marlin has an "advanced ok " option as well.) |
{"he1st":210} |
M104 S201 T1 |
Set temperature of extruder 1 to 210 . |
{"he1st":n} |
M105 |
Request the set temperature of extruder 1 (g2core) or current extruder and bed (Marlin). |
Nxxx (gcode) |
Nxxx (gcode) * (checksum) |
Marlin supports a checksum, and has special requirements on line numbers, where g2core accepts arbitrary line numbers and doesn't support a non-standard checksum. |
{"out4":0.5} |
M106 S128 |
Set output on the fan (or generic PWM output 4 for g2core) to 50%. |
-
M104
,M109
,M140
,M190
,M108
- temperature control- On Marlin, you set the extruder temperature (and return immediately) with a
M104 Snnn Tnnn
-
Snnn
indicates the temperature in celsius -
Tnnn
(optional) indicates the tool, with the first being0
- If you wish to wait until the extruder is at temperature, change
M104
toM109
.- Cancel the wait with
M108
(with no further words). - With
Sxxx
it will only wait for heating. Change theSxxx
toRxxx
to wait for cooling or heating. - Both
M104
andM109
(with eitherS
orR
) will set the target temperature. - During heat-up, the temperature of the extruder and heat-bed will be automatically printed every second.
- Cancel the wait with
-
- On Marlin, the bed temperature is set with
M140 Snnn
, and it does NOT wait for the bed to heat up.-
Snnn
indicates the temperature in celsius - Wait for the heat bed with
M190 Sxxx
(for heating only) orM190 Rxxx
(for both heating and cooling)- Like
M109
,M190
will also set the target and print the temperature of the extruder and bed every second until while it's waiting. -
M190
is also cancelled withM108
.
- Like
-
- On Marlin, you set the extruder temperature (and return immediately) with a
-
M105
- temperature polling- Response is in the format:
ok T:18.2 /0.0 B:16.6 /0.0 @:0 B@:0
-
T:nnn
contains the temperature of the "current" extruder (in celsius). -
/nnn
contains the set temperature of the given extruder (in celsius). -
B:nnn
contains the bed temperature (in celsius). -
/nnn
after that is the set temperature of the bed (in celsius). -
@:nnn
is the power output level (0-PID_MAX, which appears to generally be 255). -
B@:nnn
is the bed power output level (0-MAX_BED_POWER, which appears to generally be 255).
-
- For Ultimaker Marlin, this differs from the response format of
M109
andM190
ofT:101.9 E:0 W:1
-
T:nnn
is the same -
E:nnn
is the extruder number -
W:nnn
is the seconds of wait time left (and may be?
) for the temperature to be considered "stable".
-
- For stock Marlin, the output format of
M109
andM190
is the same asM105
, except it adds theW:nnn
wait time.
- Response is in the format:
-
G28
homing- In marlin,
G28
(no decimal) is homing, and the values are possibly provided without numbers, and the number (if provided) are ignored:G28 X Y Z
- If no axes are provided, then it will home all axes.
- As a side-effect, it clears the auto bed-levelling rotation, and sets the "ative toolhead" to
T0
. - Will home Z first if Z homes up, then X, then Y. Otherwise it'll home X, then Y, then Z.
- In marlin,
-
G29
bed tramming- This will probe three (internally stored) points, then activate bed levelling
Getting Started Pages
- Home
- What is g2core?
- Who uses g2core?
- Jerk-Controlled Motion
- Getting Started with g2core
- Connecting to g2core
- Configuring g2core
- Flashing g2core
- Troubleshooting
Reference Pages
- Gcodes
- Mcodes
- Text Mode
- JSON Communications
- GPIO Digital IO
- Alarms & Exceptions
- Power Management
- Coordinate Systems
- Status Reports
- Status Codes
- G2 Communications
- Tool Offsets and Selection
- Probing
- Feedhold, Resume, Job Kill
- Marlin Compatibility
- 9 Axis UVW Operation
- gQuintic Specs
Discussion Topics
- Roadmap
- GPIO for 1.X Releases
- Toolheads
- Raster Streaming Prototol
- g2core REST Interface
- Gcode Parsing
- G2 3DP Dialect
- Consensus Gcode
- Digital DRO
- Overview of Motion Processing
Developer Pages
- Development & Contribution
- Branching and Release - DRAFT
- Getting Started with g2core Development
- Project Structure & Motate
- Compiling G2
- OSX w/Xcode
- OSX/Linux Command Line
- Windows10 w/AtmelStudio7
- Debugging G2 on OSX
- Board and Machine Profiles
- Arduino Due Pinout
- Arduino DUE External Interfaces
- Diagnostics
- Debugging w/Motate Pins
- Development Troubleshooting
- g2core Communications
- Git Procedures
- Windows 10 / VMware 8 Issues
- Dual Endpoint USB Internals
- G2core License
- VSCode Setup
- Compatibility Axioms
- Wiki History