Enforce sensor range for temperature target (#18465)

* Mitigate stepper timeout

* Add CHAMBER PWM code

* Structured thermistor tables

* Fix reversed sensor ranges

* Prevent temps outside sensor range
This commit is contained in:
Scott Lahteine
2020-07-01 16:27:28 -05:00
committed by GitHub
parent 70fa4c9323
commit c43bbcce15
56 changed files with 295 additions and 167 deletions

View File

@ -164,6 +164,8 @@
*/
G29_TYPE GcodeSuite::G29() {
reset_stepper_timeout();
const bool seenQ = EITHER(DEBUG_LEVELING_FEATURE, PROBE_MANUALLY) && parser.seen('Q');
// G29 Q is also available if debugging
@ -675,7 +677,7 @@ G29_TYPE GcodeSuite::G29() {
#endif
abl_should_enable = false;
idle();
idle_no_sleep();
} // inner
} // outer

View File

@ -203,15 +203,15 @@
*/
void GcodeSuite::G28() {
#if ENABLED(LASER_MOVE_G28_OFF)
cutter.set_inline_enabled(false); // turn off laser
#endif
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM(">>> G28");
log_machine_info();
}
#if ENABLED(LASER_MOVE_G28_OFF)
cutter.set_inline_enabled(false); // turn off laser
#endif
TERN_(DWIN_CREALITY_LCD, HMI_flag.home_flag = true);
#if ENABLED(DUAL_X_CARRIAGE)
@ -251,6 +251,9 @@ void GcodeSuite::G28() {
TERN_(CNC_WORKSPACE_PLANES, workspace_plane = PLANE_XY);
// Count this command as movement / activity
reset_stepper_timeout();
#define HAS_CURRENT_HOME(N) (defined(N##_CURRENT_HOME) && N##_CURRENT_HOME != N##_CURRENT)
#if HAS_CURRENT_HOME(X) || HAS_CURRENT_HOME(X2) || HAS_CURRENT_HOME(Y) || HAS_CURRENT_HOME(Y2)
#define HAS_HOMING_CURRENT 1

View File

@ -50,6 +50,7 @@ void GcodeSuite::M17() {
*/
void GcodeSuite::M18_M84() {
if (parser.seenval('S')) {
reset_stepper_timeout();
stepper_inactive_time = parser.value_millis_from_seconds();
}
else {

View File

@ -21,7 +21,6 @@
*/
#include "../gcode.h"
#include "../../MarlinCore.h" // for max_inactive_time
/**
* M85: Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)

View File

@ -53,6 +53,9 @@ void GcodeSuite::T(const uint8_t tool_index) {
DEBUG_POS("BEFORE", current_position);
}
// Count this command as movement / activity
reset_stepper_timeout();
#if ENABLED(PRUSA_MMU2)
if (parser.string_arg) {
mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc

View File

@ -59,7 +59,10 @@ GcodeSuite gcode;
#include "../MarlinCore.h" // for idle()
millis_t GcodeSuite::previous_move_ms;
// Inactivity shutdown
millis_t GcodeSuite::previous_move_ms = 0,
GcodeSuite::max_inactive_time = 0,
GcodeSuite::stepper_inactive_time = SEC_TO_MS(DEFAULT_STEPPER_DEACTIVE_TIME);
// Relative motion mode for each logical axis
static constexpr xyze_bool_t ar_init = AXIS_RELATIVE_MODES;

View File

@ -334,8 +334,14 @@ public:
static bool select_coordinate_system(const int8_t _new);
#endif
static millis_t previous_move_ms;
FORCE_INLINE static void reset_stepper_timeout() { previous_move_ms = millis(); }
static millis_t previous_move_ms, max_inactive_time, stepper_inactive_time;
FORCE_INLINE static void reset_stepper_timeout(const millis_t ms=millis()) { previous_move_ms = ms; }
FORCE_INLINE static bool stepper_max_timed_out(const millis_t ms=millis()) {
return max_inactive_time && ELAPSED(ms, previous_move_ms + max_inactive_time);
}
FORCE_INLINE static bool stepper_inactive_timeout(const millis_t ms=millis()) {
return ELAPSED(ms, previous_move_ms + stepper_inactive_time);
}
static int8_t get_target_extruder_from_command();
static int8_t get_target_e_stepper_from_command();