Hot answers tagged

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. ...
Lars Pötter's user avatar
  • 1,611
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 ...
tbm0115's user avatar
  • 6,284
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,...
Tormod Haugene's user avatar
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-...
Tom van der Zanden's user avatar
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 ...
Mick's user avatar
  • 3,092
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 ...
Trish's user avatar
  • 21.2k
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 ...
Tom van der Zanden's user avatar
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 ...
Tom van der Zanden's user avatar
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 ...
mac's user avatar
  • 4,677
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 ...
mac's user avatar
  • 4,677
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: ...
Trish's user avatar
  • 21.2k
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). ...
0scar's user avatar
  • 34.4k
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 ...
0scar's user avatar
  • 34.4k
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 ...
Trish's user avatar
  • 21.2k
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, ...
0scar's user avatar
  • 34.4k
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 ...
nanofarad's user avatar
  • 852
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 ...
0scar's user avatar
  • 34.4k
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 ...
0scar's user avatar
  • 34.4k
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 ...
0scar's user avatar
  • 34.4k
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 ...
KeithS's user avatar
  • 471
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: ...
Saran's user avatar
  • 171
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 ...
Ezra's user avatar
  • 236
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 ...
0scar's user avatar
  • 34.4k
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 ...
Trish's user avatar
  • 21.2k
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 ...
Tom van der Zanden's user avatar
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 ...
beeudoublez's user avatar
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 ...
R.. GitHub STOP HELPING ICE's user avatar
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: ...
Davo's user avatar
  • 2,390
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 ...
mac's user avatar
  • 4,677
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 ...
Tom van der Zanden's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible