Подписаться на 3Dtoday
Gleaned
Идет загрузка
Loading
12.11.18
182
4
Technical guide
6
Today I’d like to talk about G-Code. There are a number of simple commands to help a user with 3D printer calibration and operation. The commands below are meant for Marlin, but may work with other firmware as well.
PREVIEW
Warning! These are just generic examples. Actual values may vary depending on the size of the build area, personal preferences and so on.

1. Leveling program for a 200 х200 mm print bed

The nozzle will travel to five points, waiting for 15 seconds at each stop, so you can adjust the bed.

G28 X0 Y0 Z0
G90
G1 X10 Y10 F1000
G4 S15
G1 X10 Y190
G4 S15
G1 X190 Y190
G4 S15
G1 X190 Y10
G4 S15
G1 X100 Y100
G4 S15
M300 S5000 P280
----------
G28 X0 Y0 Z0 – go to origin on all three axes
G1 – move command
XY – coordinates
F – movement rate
G4 S15 – pause for 15 seconds
M300 S5000 P280 – play a tone (S – duration, P – tone frequency)

2. End print parking

These commands park the nozzle and lower the bed (or move it forward) at the end of a print job, so that the print can be examined. There are two different sets of instructions – for XY-Z printers (where the bed moves up and down) and XZ-Y printers (where the bed moves back and forth).

XY-Z (Ultimaker, H-Bot, CoreXY):
G91
G1 Z10 F1000
G28 Y0 X0
G90
G1 Z200 F3000
----------
G91 – set relative position mode
Z10 – lower the bed by 10 mm
G28 Y0 X0 – park the nozzle (go to origin)
G90 – set absolute position mode
Z200 – lower the bed all the way down
F3000 – movement rate

XZ-Y (Prusa i2 or i3):
G91
G1 Z10 F1000
G28 X0
G90
G1 Y200 F1000
----------
G91 – set relative position mode
Z10 – raise the nozzle by 10 mm
G28 X0 – park the nozzle (go to origin)
G90 – set absolute position mode
Y200 – move the bed all the way out
F1000 – movement rate

3. Cleaning the nozzle before printing or during filament change


For XZ-Y (Prusa i2 or i3):

G28 Y0 X0 Z0
G1 Z5 F1000
G90
G1 Y200
G1 Z3
G1 X40
G1 X20
G1 X40
G1 X20
G1 Z5
----------
G28 X0 Y0 Z0 – park the nozzle (go to origin)
G90 – set absolute position mode
Z5 – raise the nozzle by 5 mm
Y200 – move the bed all the way out
X40 и X20 – clean the nozzle by moving back and forth
Z3 – lower the nozzle to 3 mm

4. Pause to change filament

Use this if you wish to switch filaments when printing with one nozzle.
First, note the thickness of the layer to be printed with another filament.
Multiply layer thickness by layer number to get the height in mm.
Example: layer number 50 multiplied by layer thickness of 0.2 mm gives positioning height of 10 mm (50х0.2)
Search the G-CODE for the line with Z10 (for the example above).
Ins ert following commands:

G91
G1 Z5
G90
G1 Y10 X10 F1000
G4 S60
G91
G1 E100 F100
G92 E0
G90
----------
G1 Z5 – raise the nozzle by 5 mm
G4 S60 – pause for 60 seconds
G90 – set absolute position mode
G91 – set relative position mode
G92 E0 – set the current filament position to E=0
G1 E100 F100 – extrude 100 mm of plastic for a complete color/material change
Change filament manually. After the 60 second pause printing will resume from the same point wh ere it was paused.

5. Signal tones

The Smart Controller has a built-in buzzer, which can be used to generate simple audio tones.

Begin print (one tone)
M300 S5000 P280

End print (several beeps, a different frequency tone or some other setup can be used)
M300 S5000 P280
G4 S1
M300 S5000 P280
G4 S1
M300 S5000 P280
----------
М300 – play tone
S – frequency
P – duration
G4 S1 – pause for one second

6. Purge nozzle before printing

Extrudes 10 mm of plastic to prime the nozzle.
G91
G1 E10 F300
G90
G92 E0
----------
G90 – set absolute position mode
G91 – set relative position mode
G92 E0 – set the current filament position to E=0
G1 E10 F300 – extrude 10 mm of filament at 300 mm/min

7. Retract

Sucks (retracts) plastic back into the nozzle after a print job is finished.
G91
G1 E-10 F300
G90
----------
G90 – set absolute position mode
G91 – set relative position mode
G1 E-10 – retract 10 mm of plastic at 300 mm/min.

8. Se t pin state

This can be used to control devices through Arduino Mega 2560, such as cooling fans or LED indicators.
M42 P4 S0 – switch on
M42 P4 S255 – switch off
P – pin number
S – state (on/off)

9. Pause print

G4 S15
----------
G4 S15 – pauses for 15 seconds.

10. Set LCD Message

Displays a message on the LCD controller.
M117 Hello World
----------
M117 – display message (in this case “Hello World”)
Подписаться на 3Dtoday
6
Comments

Comments

12.11.18 в 14:01
0
Thank. Very informative
12.11.18 в 14:02
1
You're welcome.
12.11.18 в 14:15
0
very interesting. Write more

Please log in to leave a comment.

More in blogs

ISS crew carried out first 3D bioprinting experiments in space

Nanoscribe presents successor model Photonic Professional GT2 for high-resolution 3D microfabrication

Russian scientists designed and tested 3D printed bionic aircraft parts

Skilled surgeons and 3D printing helped a Siberian man to keep his head

SHINING 3D releases EinScan Pro 2X & 2X Plus multifunctional handheld 3D scanners

A few useful G-Code commands