Fine grained heater control



  • I've been thinking about how to update the PanelDue firmware for better heater control and realized that even with G10, M104, M140, M141, M144, M190 M191 M562 and T, there's no universal way to set a heater's active and standby temps and no way to simply set the heater to active, standby or off (without disturbing the active and standby temps). I'm not sure adding another set of M gcode commands is the best way to go but I'm thinking something like...

    Mnnn Hn[:n...] N"name" L"label" Rnnn Snnn where Hn[:n...] are the heater number(s), N"name" is a long-ish name, L"label" is a short label say for the PanelDue, Rnnn is the standby temp and Snnn is the active temp for ANY heater whether it's an extruder hotend, bed, chamber or seat warmer.

    Mnnn Hn[:n...] Sn where Hn[:n...] are the heater number(s), Sn is 0 for off, 1 for standby and 2 for active.

    Thoughts?



  • Maybe we can co-opt M305 or M307 for the temp and label settings. M305 already does the "long-ish" name.


  • administrators

    What is your reason for wanting to switch a heater to active or standby temperature independently of selecting/deselecting a tool?



  • @dc42 said in Fine grained heater control:

    What is your reason for wanting to switch a heater to active or standby temperature independently of selecting/deselecting a tool?

    Specifically thinking of non-tool heaters like beds, chambers, etc but also could be for offline tools. Having 1 set of commands for all heaters would make things a little less "inferred" about how to control a heater and its state.


  • administrators

    There is already M144 to set the bed heater to active or standby, but I agree that Off would be a useful option too. Currently there is no similar option for chamber heaters.



  • @dc42 would you be open to a pull request for a new M code?

    M308 Generic Heater Control
    Pnnn Heater number
    Snnn Active Temp
    Rnnn Standby Temp
    Tnnn State: 0 = off, 1 = standby 2 = on.


  • administrators

    @gtj0 said in Fine grained heater control:

    @dc42 would you be open to a pull request for a new M code?

    M308 Generic Heater Control
    Pnnn Heater number
    Snnn Active Temp
    Rnnn Standby Temp
    Tnnn State: 0 = off, 1 = standby 2 = on.

    You will need to specify how it is supposed to interact with other M-codes, e.g.:

    • If the heater is used as a tool heater, what happens when that tool is made active, or made inactive?
    • If that heater is assigned as a bed or chamber heater, what happens when a normal bed or chamber heater command is received (e.g. M140, M141, M190, M191)?


  • @gtj0 I use macros to set the chamber heater temperature to 50C for ABS printing, 35C for PLA, and 0 to turn it off. I also have preheating macros for ABS, PLA, and TPU that set all the heaters to appropriate temperatures. It will be nice when the PanelDue firmware eventually includes the chamber heater on the graphical controls, but until then, macros work fine.



  • @dc42 said in Fine grained heater control:

    @gtj0 said in Fine grained heater control:

    @dc42 would you be open to a pull request for a new M code?

    M308 Generic Heater Control
    Pnnn Heater number
    Snnn Active Temp
    Rnnn Standby Temp
    Tnnn State: 0 = off, 1 = standby 2 = on.

    You will need to specify how it is supposed to interact with other M-codes, e.g.:

    • If the heater is used as a tool heater, what happens when that tool is made active, or made inactive?
    • If that heater is assigned as a bed or chamber heater, what happens when a normal bed or chamber heater command is received (e.g. M140, M141, M190, M191)?

    No change to either behavior. The M308 commands would be an additional way to control the heater. The only interaction between the old and new would be that you couldn't turn off or set a heater to standby if it were associated to a tool and that tool were active. I don't think there are any other conflicts.

    @mrehorstdmd said in Fine grained heater control:

    @gtj0 I use macros to set the chamber heater temperature to 50C for ABS printing, 35C for PLA, and 0 to turn it off. I also have preheating macros for ABS, PLA, and TPU that set all the heaters to appropriate temperatures. It will be nice when the PanelDue firmware eventually includes the chamber heater on the graphical controls, but until then, macros work fine.

    The new command should facilitate better heater support in PanelDue firmware, DWC and something else I'm working on. It allows heaters to be controlled without having to know whether it's a bed, chamber, hot end, seat warmer, etc.



  • There's a pull request up for the new M308 command. Here's the help/description.
    Feedback welcomed.

        M308: Generic Heater Control
    
        Parameters:
    
         * Pnnn Heater index
         * Snnn Target active temperature  (note 1,3)
         * Rnnn Target standby temperature  (note 1,3)
         * Tnnn Heater state: 0 = off, 1 = standby 2 = on. (note 2,3)
        
        This command allows direct control of heaters without having
        to know whether a heater is a bed, chamber, tool or some other
        type of heater.  It does not replace any existing G or M code
        commands and is meant more for use from the command line and
        by user interfaces.  Although nothing prevents it, this command
        should not be used by slicers. They should continue to use the
        standard control commands.
        
        The P parameter is required and selects the heater.  There is no
        default so the minimum command is M308 Pnnn which prints the
        heater's current state, target active temperature, target standby
        temperature and the current temperature as follows:
            
        Heater 1 State: 'Off', Active temp: 225.0°, Standby temp: 190.0°,
        Surrent temp: 23.2°"
            
        The S and R parameters are optional and set the target active and
        standby temperatures.
        
        The T parameter is also optional and if supplied, sets the heater's
        current state where 0 = off, 1 = standby 2 = on.
        
        Examples:
         * M308 P0 S70 R50
           Set heater 0 (usually but not necessarily the bed) target
           active temperature to 70 and the target standby temperature
           to 50.  Since the T parameter is not supplied, the heater's
           current state is not altered.
        
         * M308 P0 T1
           Set heater 0 to standby.  Any previously set standby temperature
           is preserved, even if set by another command such as M140, M141,
           G10, etc.
        
         * M308 P1 S225
           Set heater 1 (an extruder maybe) target active temperature to
           225 leaving its target standby temperature and state alone.
        
        Notes:
        (1): Since the T parameter explicitly controls the state of the
             heater, no special importance is placed on temperatures less
             than -273.  They will NOT turn the heater off as they may in
             other commands.
        
        (2): To prevent accidental disruption of a print, you can change
             the target temperatures of a heater assigned to the active
             tool but you cannot change its state.
        
        (3): This command will return an error if an attempt is made
             to set the temperatures or state of a heater in "fault"
             or "tuning" state.  Use the appropriate commands to return
             the heater to a working state before re-issuing this command.
    

 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.