Curaには生成されたG-codeの前後に自分で書いたG-Codeを挿入できる機能がある。Snapmakerで印刷指示から実際に動き出すまでの待ち時間を減らすことを狙って、Starting G-Codeを書いてみた。Snapmaker2で動作確認。その他プリンタでも使えるとは思うが未検証。(Enclosureまわりは使えないと思う)
- 時間がかかるextruderとbedの昇温を最初に同時に開始する
- 変数を使い、印刷設定で指定した温度を参照している
- EnclosureのLED照明とFANを自動的にON-OFF制御する
- 基本的に最初にON,最後にOFFだが、処理の途中でLEDの明るさやFanの速度を変更している
- 印刷開始前にフィラメントを少量捨てる処理をゆっくり動くように調整
- 垂れたフィラメントがベッドサイドでちぎれずに中央まで引きずられてくることが多かったので、確実にちぎれるように工夫しています
Start G-Code
;==== Starting g-code ====
;---- Pre heating ----
M104 S{material_print_temperature_layer_0} ; Set extruder temperature without waiting
M140 S{material_bed_temperature_layer_0} ; Set bed temperature without waiting
;
M117 Hello!
;---- Initialize --------
M1010 S3 P50 ; Enclosure LED 50%
M1010 S4 P25 ; Enclosure Fan 25%
G90 ; use absolute coordinates
M82 ; use absolute distances for extrusion
G28 ; home
;
;---- Move to the position to discard the tip of the filament --------
G1 X15 Y-7 F3000 ; Move X,Y with 3000mm/min(=50mm/sec)
G1 Z20 F1800 ; Move Z with 1800mm/min(=30mm/sec)
;
;---- Wait for temperature to be reached --------
M109 S{material_print_temperature_layer_0} ; Wait for extruder's temperature to be reached
M190 S{material_bed_temperature_layer_0} ; Wait for bed's temperature to be reached
;
;---- Enclosure --------
M1010 S3 P100 ; Enclosure LED 100%
;
;---- Discard the tip of the filament --------
G1 Z0.5 F1800 ; Move Z with 1800mm/min(=30mm/sec)
G92 E0 ; Reset extruder 0
G1 E10 F200 ; Feed fillament 10mm with 200mm/min(=3.33mm/sec)
G1 X-12 Y-12 F300 E6; Move X,Y with 300mm/min(=5mm/sec)
G92 E0 ; Reset extruder 0
G1 E5 F200 ; Feed fillament 5mm with 200mm/min(=3.33mm/sec)
G4 S3 ; wait for 3 sec
G92 E0 ; Reset extruder 0
G1 X5 Y5 F300 E3; Move X,Y with 300mm/min(=5mm/sec)
G4 S1 ; wait for 1 sec
G1 Z2 F1800 ; Move Z with 1800mm/min(=30mm/sec)
G92 E0 ; Reset extruder 0
;
;---- Enclosure --------
M1010 S3 P100 ; Enclosure LED 100%
M1010 S4 P50 ; Enclosure Fan 50%
End G-Code
;==== Ending g-code ====
;---- Lead finalize process --------
M1010 S3 P50 ; Enclosure LED 50%
M1010 S4 P25 ; Enclosure Fan 25%
;
;---- Heater control --------
M104 S0 ; Set extruder temperature OFF
M140 S0 ; Set heated bed temperature OFF
;
;---- Retract extruder --------
G90 ; use absolute coordinates
G92 E0 ; Reset extruder 0
G1 E-2 F300 ; Retract the filament to release some of the pressure
G1 Z{machine_height} F3000 ; Move Z up with 3000mm/min(=50mm/sec)
G1 X0 F3000 ; Move X to min endstops with 3000mm/min(=50mm/sec)
G1 Y{machine_depth} F3000 ; Plate is moved forward
;
;---- Enclosure OFF --------
M1010 S3 P0 ; Enclosure LED OFF
M1010 S4 P0 ; Enclosure Fan OFF
