-1

I want to write a couple of very simple G-code test cases in Marlin-Style to make sure my printer works properly. The idea is to test the movement system, then the end-stops, then the heating and ability to hold temperature. But Marlin already runs large, so I can't spare too many lines in the basic setup, if I want to integrate it into the firmware.

The test I have in mind is this order of operations, covering the basis of each axis and the thermal control:

  • The printhead shall move up 20 mm, then right and forward the same.
  • the printhead shall home.
  • the printhead shall rise again by 20 mm.
  • The preheating shall be done (50°C bed, 180°C head).
  • The printer shall do nothing for 2 minutes.
  • The printer shall cool down.
  • Beep twice to signal that the test is concluded.

What is the best way to set up such a test code in the least amount of lines? Did I forget a crucial test command?

Trish
  • 22,760
  • 13
  • 53
  • 106

1 Answers1

2

I can get down to 13(14) lines using 6 commands, one of which is optional: G1 movements, G28 homing, M140 setting the bed temperature without pause, M109 to set the hotend temperature, G4 dwell to pause, and M300 to beep.

The line in [] is optional, but the nozzle isn't safe to touch right away - waiting for the cooldown ensures touch safety.

G1 Z20 F1000 ; Movement Test Z
G1 X20       ; Movement Test X
G1 Y20       ; Movement Test Y
G28          ; Homing Test
G1 Z20       ; Movement up (safety measure)
M140 S50     ; Set Bed temperature to 50, directly goto next line
M109 R180    ; Set Nozzle temperature to 180, wait for achieving
G4 S60       ; Wait a minute (to see if nozzle temperature is held)
M140 S0      ; "turn off" bed
[ M109 R25     ; set nozzle temperature to 25C, wait for achieving ]
M109 S0      ; actually turn off nozzle!
M300 S440 P200 ; Beep
G4 P200      ; short pause
M300 S660 P200 ; Beep
Trish
  • 22,760
  • 13
  • 53
  • 106