30
votes
Accepted
Is there a G-code for waiting?
The G-code to delay is G4.
G4 P60000 will wait for one minute. The P is in milliseconds. ...
15
votes
Accepted
Why do some models appear broken in slicing software?
My understanding is that this occurs when the object is not a true solid. Since an STL holds the triangulation of each face and spline, the slicing engine is not "smart" enough to determine ...
14
votes
Is there a G-code for waiting?
An alternative solution to using a hard delay with the G4 dwell command, is to increase the time that the temperature set with M109 has to be held before it continues with the next command.
In Marlin,...
13
votes
Accepted
What is the purpose of asterix (*) in Gcode?
That is a checksum. It's added by the host software to the G-code, to allow some basic verification by the firmware that the G-code was transmitted unchanged. It doesn't change the meaning of the G-...
13
votes
Accepted
What is G92 used for in G-code
The G92 command is used to set the start position (origin) of one of more axes (including the current extruder) to any arbitrary value. The command ...
13
votes
Accepted
What is a printer console/terminal?
There are several programs that could serve as a console to connect to a printer, put let's start somewhere: the USB connection.
Step 1: Connection with USB
When connecting the printer via USB for the ...
12
votes
Accepted
Cura: set z-offset
You can trick the printer into applying an offset using the G92 command:
G0 Z0
G92 Z0.1
First, we move the nozzle to ...
12
votes
Are parentheses allowed within a G-code comment?
This is not universally valid G-code, and how it is handled depends on the implementation. You can use this style of comment on some machines, but not all.
The way parsing used to be implemented in ...
11
votes
Accepted
Music from the printer?
Yes, it has been done before, see here and here.
The README file of the first repository linked above contains a detailed explanation of the basic idea/calculations involved. A short excerpt:
As ...
10
votes
Accepted
E axis vs Z axis
G-CODE can be confusing as historically it was developed for machining tools rather than FDM printers, and thus:
not all available commands make sense for a 3D printer
some of the command do slightly ...
10
votes
Accepted
Writing G-code: Audible Alert at end of print
Let's put the parts one by one:
Wait for bed temperature being at 30 °C: M190 R30
Play Bleep for 1/5th of a second: ...
10
votes
Accepted
Simultaneous heating of extruder and bed at start of print
This can be achieved with start G-code adaptations, this requires no software changes. Cura, and most slicers, have the ability to use placeholders (basically variables or maybe better: constants). ...
10
votes
Accepted
Using auto-bed leveling, do I need to initiate G29 before every print?
No, it is not necessary to call G29 before every print to "auto level the bed" 1) provided that:
the bed surface has not changed (e.g. large load or ...
9
votes
Accepted
Writing G-code : swiping at start of print
The lazy way: Skirt/Brim
With my TronXY X1 I learned pretty fast, that this first bit of extrusion on an unheated bed can totally mess up the first layer by being just in the way, as explained in the ...
9
votes
Accepted
What is the difference between M420 S and M420 S1?
TL;DR
Short answer: "There is no difference!".
Long answer
G-code is parsed line by line. The parser in the firmware reads the command and the options (also called parameters) following it, ...
8
votes
Accepted
How do I set the G-code buffer size on Marlin?
Marlin does allow one to change the size of the buffers, in Configuration_adv.h. In the current version there's an ifdef that switches between two cases, one with ...
8
votes
Accepted
Is G-code read line by line?
Yes, G-code is read line by line. G-code is a numerical control programming language. It basically instructs the machine sequentially line by line to do a specific task. The printer than executes the ...
8
votes
Accepted
Move print bed to front at the end of a print rather than the back
Note that this reference states that:
Because the behavior of G28 is unspecified, it is recommended not to automatically include ...
8
votes
Accepted
G-Code for resetting to 100% speed
You can put the speed to 100 % by G-code command: M220 S100.
The M220command is described here.
Know that speed changes ...
8
votes
Accepted
Converting an undirected graph to optimal G-code paths
Quote of comment of R.. GitHub STOP HELPING ICE on question reads:
Pretty sure it is NP-complete (equivalent to travelling salesman problem), no? –
This is correct; this is route optimization ...
7
votes
Cura: set z-offset
For Cura 3.1(?)+:
Install the plugin: Menu / Plugins / Browse Plugins... / scroll to "Z Offset plugin" <-- Install
Configure the setting: ...
7
votes
Music from the printer?
I actually did this, on my Malyan M150.
After not that much experimentation at all it turned out that the frequency of the produced tone scales linearly with the speed of the motors. Due to the ...
7
votes
Accepted
Add a laser module to Reprap Guru Prusa i3
By connecting to the D9 output header (see RAMPS 1.4 shield schematic below) you only have 2 wires that represent a scheduled load and ground. You actually need to connect the positive (red) lead to ...
7
votes
Are there attempts to standardize G-code for FFF/FDM printers?
G-Code Is RS-274/NGC
There is no need to attempt to standardize G-Code, the G-code itself already is standardized: it is the NIST RS274/NGC, or often short AIN RS-274 and was not designed for just FDM ...
6
votes
Accepted
Printer randomly moves to home during printing, then resumes as normal
The issue was due to a corrupt SD-card, which was occasionally having some garbage read from it. It turns out that Marlin will try interpret a corrupt move command like ...
6
votes
Accepted
Turning off heatbed for the last few layers. Good idea or not?
It's not a bad idea, and you should try it. But only on prints with some height, because:
The goal of the heated bed is to ensure adhesion for the first few layers. Without the heat on the bottom ...
6
votes
Calculating the estimated print time of an already sliced file
First of all, there are some nice open source analyzers written in JavaScript that you can use online, or read the source to, at https://www.gcodeanalyser.com/ and http://gcode.ws/. Their predictions ...
6
votes
What is G92 used for in G-code
To supplement the accepted answer, and answer a question in the answer's comments (which should not be there), consider the E value as another axis - the axis of the filament.
If you executed:
...
6
votes
Accepted
Any code to move up Z axis after finishing the printing?
You can use:
G91
G1 Z10
G91 make the printer use ralative positioning, while G1 Z10 would ...
6
votes
Accepted
Apply X-offset to gcode (re-slicing not possible)
You can use G92 to change the coordinates the machine "thinks" it's at. If just after homing, you apply
G92 X-10
the machine ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
g-code × 237marlin × 48
ultimaker-cura × 46
creality-ender-3 × 17
slicing × 17
slic3r × 13
prusa-i3 × 11
bed-leveling × 11
bltouch × 10
diy-3d-printer × 8
troubleshooting × 7
extrusion × 7
octoprint × 7
serial-connection × 7
print-quality × 6
extruder × 6
firmware × 6
anet-a8 × 6
python × 6
heated-bed × 5
calibration × 5
software × 5
knowledgebase × 5
cnc × 5
scripts × 5