網頁

3D列印完畢後自動關閉加熱床


話說這個悲劇應該是裝上熱床後發生的,在這之前我的3D印表機並沒有安裝熱床(因為還要多配好多線),但是因為前一陣子實在是太冷了,怎麼印怎麼翹曲所以才決定裝上熱床。

我前天剛裝好熱床並且接電腦測試能夠加熱之後,我就把它搬到工作室並採用離線列印。
接著當我印PLA料架的時候,回來才發現印完熱床沒關阿!!

這時我檢查了一下程式碼

G1 X65.564 Y91.538 E2.65031 F747.404
G1 F1800.000 E1.65031
G92 E0
M107
M104 S0 ; turn off temperature //關閉擠出頭加熱(設定為0度)
G28 X0 ; home X axis //X軸回歸原點
M84 ; disable motors //關閉馬達

我的天,結尾的程式碼裡面只關了擠出頭卻沒關閉加熱床,雖然沒有危險之虞,但沒事在那邊加熱耗電實在是沒必要。

因此我們可以在End G-code裡面加入一行M140 S0,意味著關閉加熱床溫度。

【列印完畢關閉加熱床指令】

RepRapWiki的G-code說明頁中,我們可以找到兩組有關加熱床溫度的指令。

M140: Bed Temperature (Fast)
Example: M140 S55
Set the temperature of the build bed to 55oC and return control to the host immediately (i.e. before that temperature has been reached by the bed). There is an optional R field that sets the bed standby temperature: M140 S65 R40.

M190: Wait for bed temperature to reach target temp
Example: M190 S60
This will wait until the bed temperature reaches 60 degrees, printing out the temperature of the hot end and the bed every second.

為了比較兩組程式碼的不同我擷取了我列印的G-code開頭給大家看:

G21 ; set units to millimeters //設定單位是公制
M107 //關閉風扇
[b]M190 S50 ; wait for bed temperature to be reached //等熱床溫度到50度
M104 S180 ; set temperature //設定擠出頭溫度
G28 ; home all axes //移動到原點
G1 Z5 F5000 ; lift nozzle //提高擠出頭

大家可以發現列印前使用的是M190 S50,這個與M140的差異在哪呢?
這兩段程式的差別在於,M190是等待加熱床溫度達到50度之後,才會執行下一段指令,而M140是馬上執行下一段程式碼(立即進行下一步控制)。因為我們是要結束列印,所以直接關閉就好因此使用M140 S0,並且讓他執行下一段程式碼M84; disable motors。如此一來就可以順利地關閉加熱床了。