Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M308: Generic Heater Control #254

Closed
wants to merge 1 commit into from

Conversation

gtjoseph
Copy link
Contributor

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.

@gtjoseph
Copy link
Contributor Author

gtjoseph commented Jan 26, 2019

Found a bug where setting the temps on a heater assigned to a tool doesn't reflect in the status reports for the tool.

Don't merge yet.

@gtjoseph gtjoseph closed this Jan 26, 2019
@gtjoseph gtjoseph reopened this Jan 26, 2019
@gtjoseph
Copy link
Contributor Author

gtjoseph commented Jan 26, 2019

@dc42 Does the tool maintain its own array of active and standby temps for a reason? Any reason they shouldn't operate directly on the heater's active and standby temps?
Nevermind. I answered my own question. It's to allow 2 tools to share a heater but use different temps.

@gtjoseph
Copy link
Contributor Author

No code change. I update the commit message help/description as follows...

Special considerations when a heater is assigned to a tool:

Attempting to change the state of a heater that is assigned to
the current tool will result in an error.  This is to prevent an
accidental disruption of a print.

Changing the temperatures of a heater assigned to a tool WILL NOT
change the tool's defined active and standby temperatures.  When
that tool is activated (or reactivated), its defined temperatures
will take effect.

src/GCodes/GCodes2.cpp Outdated Show resolved Hide resolved
src/GCodes/GCodes2.cpp Outdated Show resolved Hide resolved
Parameters:

 * Pnnn Heater index
 * Snnn Target active temperature  (note 1)
 * Rnnn Target standby temperature  (note 1)
 * Tnnn Heater state: 0 = off, 1 = standby 2 = on. (notes 1,2)

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°,
Current 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): 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.

Special considerations when a heater is assigned to a tool:

Attempting to change the state of a heater that is assigned to
the current tool when the printer is in the Printing, Pausing,
Paused or Resuming state will result in an error.  This is to
prevent an accidental disruption of a print.

Changing the temperatures of a heater assigned to a tool will also
change the tool's defined active and standby temperatures.
@gtjoseph
Copy link
Contributor Author

@dc42 Any chance of these pull requests being merged soon?

@gtjoseph
Copy link
Contributor Author

@dc42 ping?

@gtjoseph gtjoseph closed this May 12, 2019
@gtjoseph gtjoseph deleted the dev-m308-for-david branch December 17, 2019 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants