Jump to content
Ultimaker Community of 3D Printing Experts

Add variable bed temperature in start gcode?


chickenboy115
 Share

Recommended Posts

Posted · Add variable bed temperature in start gcode?

So I have my start gcode set to warm my bed to a specific temperature before heating the hotend and bed to the final temperature.  I was wondering if there is a way to set this first temperature as a variable relating to the final temperature instead of only being able to set an exact number.  Eg, my current gcode is below:

 

M190 S55 ;Preheat bed to 55C
M104 S{material_print_temperature} ; begin heating nozzle to final target
M140 S{material_bed_temperature} ; begin heating bed to final target

G28 ;Home

M190 S{material_bed_temperature} ; Wait for final bed temp
M109 S{material_print_temperature} ; Wait for final nozzle temp

This works fine until I switch filaments that have different bed temps and forget to edit the start gcode.  I'd like to do something like this:

M190 S{material_bed_temperature}-10 ;Preheat bed to 10C below final target

Is it possible to do math in the start gcode?  I saw a couple older posts saying no, but not sure if that changed in recent updates.  If not, is there some way to do this with a post processing script?

  • Link to post
    Share on other sites

    • 1 year later...
    Posted · Add variable bed temperature in start gcode?

    sure, you just can use:

    M190 S{material_bed_temperature-10}

     

    if this is not working use M190 S{(material_bed_temperature-10)} at lease this was working

    just be aware: if you use M190 to heat to a lower temp first (f.e to prevent a hot nozzle waiting for a hot bed) it takes a bit longer in total because the last 3-4° don't get heaten on 100%..

  • Link to post
    Share on other sites

    Posted · Add variable bed temperature in start gcode?
    8 hours ago, herzla said:

     

    sure, you just can use:

     

    Sure, you can use it, but it won’t work. The pattern replacement code in Cura does not support math, like I said before.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 8 replies
    ×
    ×
    • Create New...