6

I´m currently writing my own firmware for a custom Delta printer. Therefore I also need to read G-code from programs like Slic3r. Even with a small example like a cube, I´m struggling to find out where the Z-coordinate is hidden in the code. Here is a small example of the code.

; generated by Slic3r 1.2.9 on 2017-02-13 at 15:08:01

; external perimeters extrusion width = 0.50mm ; perimeters extrusion width = 0.58mm ; infill extrusion width = 0.58mm ; solid infill extrusion width = 0.58mm ; top infill extrusion width = 0.58mm

M107 M104 S205 ; set temperature G28 ; home all axes G1 Z5 F5000 ; lift nozzle

M109 S205 ; wait for temperature to be reached G21 ; set units to millimeters G90 ; use absolute coordinates M82 ; use absolute distances for extrusion G92 E0 G1 Z0.500 F7800.000 G1 E-2.00000 F2400.00000 G92 E0 G1 X-31.893 Y0.000 F7800.000 G1 E2.00000 F2400.00000 G1 X-31.893 Y-25.001 E3.57871 F1800.000 G1 X-31.496 Y-27.307 E3.72646 G1 X-30.350 Y-29.347 E3.87420 G1 X-28.588 Y-30.886 E4.02194 G1 X-26.413 Y-31.748 E4.16968 G1 X-25.000 Y-31.894 E4.25936 G1 X25.000 Y-31.894 E7.41663 G1 X27.306 Y-31.497 E7.56437 G1 X29.346 Y-30.351 E7.71211 F1800.000 G1 X30.885 Y-28.589 E7.85985 G1 X31.746 Y-26.414 E8.00759 G1 X31.893 Y-25.001 E8.09727 G1 X31.893 Y25.001 E11.25470 G1 X31.496 Y27.307 E11.40244 G1 X30.350 Y29.347 E11.55019 G1 X28.588 Y30.886 E11.69793 G1 X26.413 Y31.748 E11.84567 G1 X25.000 Y31.894 E11.93535 G1 X-25.000 Y31.894 E15.09262 G1 X-27.306 Y31.497 E15.24036 G1 X-29.346 Y30.351 E15.38810 G1 X-30.885 Y28.589 E15.53584 G1 X-31.746 Y26.414 E15.68358 G1 X-31.893 Y25.001 E15.77326 G1 X-31.893 Y0.075 E17.34724 G1 E15.34724 F2400.00000 G92 E0 G1 X-22.715 Y-22.716 F7800.000 G1 E2.00000 F2400.00000 G1 X22.715 Y-22.716 E4.86865 F1800.000 G1 X22.715 Y22.716 E7.73745 G1 X-22.715 Y22.716 E10.60609 G1 X-22.715 Y-22.641 E13.47016 G1 X-23.607 Y-23.609 F7800.000 G1 X23.607 Y-23.609 E16.45155 F1800.000 G1 X23.607 Y23.608 E19.43309 G1 X-23.607 Y23.608 E22.41447 G1 X-23.607 Y-23.534 E25.39128 G1 X-24.500 Y-24.501 F7800.000 G1 X24.500 Y-24.501 E28.48541 F1800.000 G1 X24.500 Y24.501 E31.57969 G1 X-24.500 Y24.501 E34.67382 G1 X-24.500 Y-24.426 E37.76336

Here are some configuration details:

  • G-code flavor: RepRap

  • Nozzle diameter: 0,5 mm

  • Filament diameter: 3 mm

  • Layer height: 0,4 mm

  • Perimeters: 3

  • Solid layers top: 3

  • Solid layers bottom: 3

I will also provide the full G-code.

agarza
  • 1,734
  • 2
  • 16
  • 33
JohnDizzle
  • 203
  • 2
  • 6

2 Answers2

4

It isn't hidden at all. It's just that the Z-axis position only changes with each layer change, so the Z coordinate is only passed at layer change. On line 19 of your example G-code, it starts the first layer at Z=0.5mm:

G1 Z0.500 F7800.000

The next time you should expect Z to appear is on the next layer.

Trish
  • 22,760
  • 13
  • 53
  • 106
Tom van der Zanden
  • 15,057
  • 2
  • 37
  • 65
3

Your included code has a line which reads:

G1 Z0.500

I checked a couple of my G-code files for some of the past prints and I was able to identify the bed movement relative to the layer being printed. My slicer (Simplify3D) provides for the bed to drop during certain movements. I found G1 Z0.600 followed by G1 Z0.850 for one of the layers. When that layer was finished the 0.600 changed to 0.900 and the 0.850 changed to 1.150.

This fit in with the model's layer height of 0.300 mm for that job.

I did not find more G1 Zx.xxx codes in your sample, but a larger file would contain those lines.

Greenonline
  • 6,748
  • 8
  • 40
  • 68
fred_dot_u
  • 12,140
  • 1
  • 13
  • 26