<p><strong>The actual problem you are facing is bed adhesion</strong>, the proposed solution (in your question) shouldn't be the preferred solution to get your parts to stick to the plate/glass as plastic shrinks as it cools down. Note that a 5&nbsp;&deg;C temperature drop after the first layer usually isn't a problem, but larger temperature differences or shutting off the heat completely will cause your parts to come off the glass.</p>

<p>Note that PLA requires a temperature of about 60&nbsp;&deg;C (for adhesion as this is close to the glass temperature where the plastic is soft; however, note that PLA can be printed on cold bed surfaces on suitable bed surfaces). The slate of glass is an insulator, so it is perfectly possible that you need to set the bed at a higher temperature to get 60&nbsp;&deg;C at the surface of the glass plate. When the lower layer deforms the bed temperature is too high.</p>

<p>As you are using Cura, there is a plugin available called TweakAtZ, nowadays this is a default plugin. How to use this is described in <a href="/a/7346/">this anser</a> (on question <a href="/q/7345">"How does one use a heat tower?"</a>); instead of changing the hotend temperature you will need to modify the bed temperature instead (using <code>M140</code>).</p>

<p><strong>To solve the actual problem</strong>, you need to prepare the glass by cleaning it properly, use a level bed with a correct initial nozzle to bed distance for <code>Z=0</code> (usually thickness of a plain paper sheet A4/Letter) and an adhesive like hairspray, glue stick or a dedicated adhesion spray like 3DLAC or Dimafix. I'm using 3DLAC for several years (for PLA and PETG; Dimafix is supposed to be more sticky at higher temperatures, so for ABS for instance) and never had any problems with adhesion on properly levelled beds. See <a href="/a/4045">this answer</a> for another user's experience.</p>

<p>An OctoPrint solution using event as you suggest is not recommended. This is the config.yaml, e.i. the configuration of the print server, not a print instance option file. Furthermore, there are yet no plugins that can handle additional code when the head reaches a certain (layer)height. This is pretty tricky if you use Z position detection when the head also can hop, such code should be inserted by the slicer instead.</p>

<hr>

<p><em>Related to your question are the answers on question: <a href="/q/10683">"Why keep the bed heated after initial layer(s) with PLA (or PETG)?"</a>.</em></p>

CC BY-SA 4.0
2020-01-07T07:45:45.603Z
2020-01-08T12:22:51.780Z
2020-01-08T12:22:51.780Z
0scar
<ul>
<li>You can manually edit the file. Look for the line that has the Z height of your choice, and insert the temp change g-code right above it.</li>
<li>Upgrade to a real slicer like Simplify3D with has an options to set a heater temp at different layers.</li>
<li>Preheat the bed before you print, then print with a bed temp set lower than the temp you preheated at. This will give the illusion of a temp change.</li>
</ul>

<p><em>(I for one turn off my bed after the first layer, when I'm printing PLA. I also don't have proper cooling (at this time), my environment is humid (59.9%) and the ambient air temp is 31C.) - just for context</em></p>

CC BY-SA 4.0
2020-01-09T17:53:50.910Z
2020-01-09T17:53:50.910Z
user77232
<p>I am using Cura for slicing, and OctoPrint for the actual printing.</p>

<p>On small pieces with roughly one square cm of surface area prints over about 6&nbsp;mm have a risk of coming off at 60&nbsp;&deg;C.</p>

<p>In fact, I have had to use 71&nbsp;&deg;C so it stick properly.  However, I don't want the print bed that hot all the time.  I would like to try a different number of layers at different bed temperatures till I get it right.</p>

<p>Gradually, over the course of 1-3&nbsp;mm, for the bed temperature to decrease back to 60&nbsp;&deg;C to save on electricity.  Possibly even 50&nbsp;&deg;C as the layers get higher.</p>

<p>Cura only support the initial layer having a different temperature and that isn't enough.</p>

<p>Apparently you can have custom user events with <a href="https://docs.octoprint.org/en/latest/events/index.html" rel="nofollow noreferrer">OctoPrint</a>, one of them being <strong>ZChange</strong> which is great.</p>

<pre><code>{__currentZ}: the current Z position of the head if known, -1 if not available
</code></pre>

<p>I need on the ZChange event to check the <code>__currentZ</code> and execute an<code>M140</code> with a temperature varying with layer height.  Normally I would use a simple <code>if</code> command or etc., but how do I implement this here.</p>

<p>However, its seems you can execute a command or a G-code.</p>

<p>I can't seem to find any examples where I can test the Z height in layers or mm and execute a different temperature for different layers.</p>

<p>An additional problem is the increased temps cause the model to melt so that the opening is smaller nearest to the glass than most of the rest of the model.</p>

<p>I am height of the raft, which helps, but I am hoping for a compromise.  </p>

<p>The print bed shouldn't need to be 70&nbsp;&deg;C for the whole vertical height of the model.</p>

<p>Any suggestions?</p>

CC BY-SA 4.0
2020-01-09T17:47:10.373Z
Did you try heating the bed to 70 then starting the print job with a file that has the heat bed at 50? By the time the first layer is done, the bed should have cooled back down to 50.
user77232
<heated-bed><glass-bed>
Altering the print bed temperature at different layers
cybernard
# Altering the print bed temperature at different layers

(Asked by: username_0 on 2020-01-07)

I am using Cura for slicing, and OctoPrint for the actual printing.
On small pieces with roughly one square cm of surface area prints over about 6 mm have a risk of coming off at 60 °C.
In fact, I have had to use 71 °C so it stick properly.  However, I don't want the print bed that hot all the time.  I would like to try a different number of layers at different bed temperatures till I get it right.
Gradually, over the course of 1-3 mm, for the bed temperature to decrease back to 60 °C to save on electricity.  Possibly even 50 °C as the layers get higher.
Cura only support the initial layer having a different temperature and that isn't enough.
Apparently you can have custom user events with OctoPrint, one of them being ZChange which is great.
{__currentZ}: the current Z position of the head if known, -1 if not available

I need on the ZChange event to check the __currentZ and execute anM140 with a temperature varying with layer height.  Normally I would use a simple if command or etc., but how do I implement this here.
However, its seems you can execute a command or a G-code.
I can't seem to find any examples where I can test the Z height in layers or mm and execute a different temperature for different layers.
An additional problem is the increased temps cause the model to melt so that the opening is smaller nearest to the glass than most of the rest of the model.
I am height of the raft, which helps, but I am hoping for a compromise.  
The print bed shouldn't need to be 70 °C for the whole vertical height of the model.
Any suggestions?

**Tags:** heated-bed, glass-bed
> **Comments:**
> **username_1**: Did you try heating the bed to 70 then starting the print job with a file that has the heat bed at 50? By the time the first layer is done, the bed should have cooled back down to 50.  

---

## 2 answers

### Answer by username_2 on 2020-01-07. Score: 3

**The actual problem you are facing is bed adhesion**, the proposed solution (in your question) shouldn't be the preferred solution to get your parts to stick to the plate/glass as plastic shrinks as it cools down. Note that a 5 °C temperature drop after the first layer usually isn't a problem, but larger temperature differences or shutting off the heat completely will cause your parts to come off the glass.

Note that PLA requires a temperature of about 60 °C (for adhesion as this is close to the glass temperature where the plastic is soft; however, note that PLA can be printed on cold bed surfaces on suitable bed surfaces). The slate of glass is an insulator, so it is perfectly possible that you need to set the bed at a higher temperature to get 60 °C at the surface of the glass plate. When the lower layer deforms the bed temperature is too high.

As you are using Cura, there is a plugin available called TweakAtZ, nowadays this is a default plugin. How to use this is described in [this anser](/a/7346/) (on question ["How does one use a heat tower?"](/q/7345)); instead of changing the hotend temperature you will need to modify the bed temperature instead (using `M140`).

**To solve the actual problem**, you need to prepare the glass by cleaning it properly, use a level bed with a correct initial nozzle to bed distance for `Z=0` (usually thickness of a plain paper sheet A4/Letter) and an adhesive like hairspray, glue stick or a dedicated adhesion spray like 3DLAC or Dimafix. I'm using 3DLAC for several years (for PLA and PETG; Dimafix is supposed to be more sticky at higher temperatures, so for ABS for instance) and never had any problems with adhesion on properly levelled beds. See [this answer](/a/4045) for another user's experience.

An OctoPrint solution using event as you suggest is not recommended. This is the config.yaml, e.i. the configuration of the print server, not a print instance option file. Furthermore, there are yet no plugins that can handle additional code when the head reaches a certain (layer)height. This is pretty tricky if you use Z position detection when the head also can hop, such code should be inserted by the slicer instead.

---

*Related to your question are the answers on question: ["Why keep the bed heated after initial layer(s) with PLA (or PETG)?"](/q/10683).*


---

### Answer by username_1 on 2020-01-09. Score: 0

* You can manually edit the file. Look for the line that has the Z height of your choice, and insert the temp change g-code right above it.
* Upgrade to a real slicer like Simplify3D with has an options to set a heater temp at different layers.
* Preheat the bed before you print, then print with a bed temp set lower than the temp you preheated at. This will give the illusion of a temp change.

*(I for one turn off my bed after the first layer, when I'm printing PLA. I also don't have proper cooling (at this time), my environment is humid (59.9%) and the ambient air temp is 31C.) - just for context*


---

