mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-12-02 08:09:36 +00:00
🎨 HAS_SHAPING => HAS_ZV_SHAPING
This commit is contained in:
parent
afb9ed73ac
commit
8cdf43f8fd
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "../../../inc/MarlinConfig.h"
|
#include "../../../inc/MarlinConfig.h"
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
|
|
||||||
#include "../../gcode.h"
|
#include "../../gcode.h"
|
||||||
#include "../../../module/stepper.h"
|
#include "../../../module/stepper.h"
|
||||||
|
@ -933,7 +933,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
|||||||
case 575: M575(); break; // M575: Set serial baudrate
|
case 575: M575(); break; // M575: Set serial baudrate
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
case 593: M593(); break; // M593: Set Input Shaping parameters
|
case 593: M593(); break; // M593: Set Input Shaping parameters
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1084,7 +1084,7 @@ private:
|
|||||||
static void M575();
|
static void M575();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
static void M593();
|
static void M593();
|
||||||
static void M593_report(const bool forReplay=true);
|
static void M593_report(const bool forReplay=true);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1248,7 +1248,7 @@
|
|||||||
|
|
||||||
// Input shaping
|
// Input shaping
|
||||||
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
|
#if EITHER(INPUT_SHAPING_X, INPUT_SHAPING_Y)
|
||||||
#define HAS_SHAPING 1
|
#define HAS_ZV_SHAPING 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Toolchange Event G-code
|
// Toolchange Event G-code
|
||||||
|
@ -4513,7 +4513,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
|||||||
/**
|
/**
|
||||||
* Input Shaping requirements
|
* Input Shaping requirements
|
||||||
*/
|
*/
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
#if ENABLED(DELTA)
|
#if ENABLED(DELTA)
|
||||||
#error "Input Shaping is not compatible with DELTA kinematics."
|
#error "Input Shaping is not compatible with DELTA kinematics."
|
||||||
#elif ENABLED(SCARA)
|
#elif ENABLED(SCARA)
|
||||||
|
@ -801,7 +801,7 @@
|
|||||||
/**
|
/**
|
||||||
* Input Shaping
|
* Input Shaping
|
||||||
*/
|
*/
|
||||||
#if HAS_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
#if HAS_ZV_SHAPING && ANY(CORE_IS_XY, MARKFORGED_XY, MARKFORGED_YX)
|
||||||
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
|
#warning "Input Shaping for CORE / MARKFORGED kinematic axes is still experimental."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1728,7 +1728,7 @@ float Planner::triggered_position_mm(const AxisEnum axis) {
|
|||||||
bool Planner::busy() {
|
bool Planner::busy() {
|
||||||
return (has_blocks_queued() || cleaning_buffer_counter
|
return (has_blocks_queued() || cleaning_buffer_counter
|
||||||
|| TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING())
|
|| TERN0(EXTERNAL_CLOSED_LOOP_CONTROLLER, CLOSED_LOOP_WAITING())
|
||||||
|| TERN0(HAS_SHAPING, stepper.input_shaping_busy())
|
|| TERN0(HAS_ZV_SHAPING, stepper.input_shaping_busy())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1638,7 +1638,7 @@ void MarlinSettings::postprocess() {
|
|||||||
//
|
//
|
||||||
// Input Shaping
|
// Input Shaping
|
||||||
///
|
///
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
#if ENABLED(INPUT_SHAPING_X)
|
#if ENABLED(INPUT_SHAPING_X)
|
||||||
EEPROM_WRITE(stepper.get_shaping_frequency(X_AXIS));
|
EEPROM_WRITE(stepper.get_shaping_frequency(X_AXIS));
|
||||||
EEPROM_WRITE(stepper.get_shaping_damping_ratio(X_AXIS));
|
EEPROM_WRITE(stepper.get_shaping_damping_ratio(X_AXIS));
|
||||||
@ -3429,7 +3429,7 @@ void MarlinSettings::reset() {
|
|||||||
//
|
//
|
||||||
// Input Shaping
|
// Input Shaping
|
||||||
//
|
//
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
#if ENABLED(INPUT_SHAPING_X)
|
#if ENABLED(INPUT_SHAPING_X)
|
||||||
stepper.set_shaping_frequency(X_AXIS, SHAPING_FREQ_X);
|
stepper.set_shaping_frequency(X_AXIS, SHAPING_FREQ_X);
|
||||||
stepper.set_shaping_damping_ratio(X_AXIS, SHAPING_ZETA_X);
|
stepper.set_shaping_damping_ratio(X_AXIS, SHAPING_ZETA_X);
|
||||||
@ -3690,7 +3690,7 @@ void MarlinSettings::reset() {
|
|||||||
//
|
//
|
||||||
// Input Shaping
|
// Input Shaping
|
||||||
//
|
//
|
||||||
TERN_(HAS_SHAPING, gcode.M593_report(forReplay));
|
TERN_(HAS_ZV_SHAPING, gcode.M593_report(forReplay));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Linear Advance
|
// Linear Advance
|
||||||
|
@ -240,7 +240,7 @@ uint32_t Stepper::advance_divisor = 0,
|
|||||||
bool Stepper::la_active = false;
|
bool Stepper::la_active = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
shaping_time_t ShapingQueue::now = 0;
|
shaping_time_t ShapingQueue::now = 0;
|
||||||
shaping_time_t ShapingQueue::times[shaping_echoes];
|
shaping_time_t ShapingQueue::times[shaping_echoes];
|
||||||
shaping_echo_axis_t ShapingQueue::echo_axes[shaping_echoes];
|
shaping_echo_axis_t ShapingQueue::echo_axes[shaping_echoes];
|
||||||
@ -1494,7 +1494,7 @@ void Stepper::isr() {
|
|||||||
// Enable ISRs to reduce USART processing latency
|
// Enable ISRs to reduce USART processing latency
|
||||||
hal.isr_on();
|
hal.isr_on();
|
||||||
|
|
||||||
TERN_(HAS_SHAPING, shaping_isr()); // Do Shaper stepping, if needed
|
TERN_(HAS_ZV_SHAPING, shaping_isr()); // Do Shaper stepping, if needed
|
||||||
|
|
||||||
if (!nextMainISR) pulse_phase_isr(); // 0 = Do coordinated axes Stepper pulses
|
if (!nextMainISR) pulse_phase_isr(); // 0 = Do coordinated axes Stepper pulses
|
||||||
|
|
||||||
@ -1542,7 +1542,7 @@ void Stepper::isr() {
|
|||||||
//
|
//
|
||||||
|
|
||||||
nextMainISR -= interval;
|
nextMainISR -= interval;
|
||||||
TERN_(HAS_SHAPING, ShapingQueue::decrement_delays(interval));
|
TERN_(HAS_ZV_SHAPING, ShapingQueue::decrement_delays(interval));
|
||||||
TERN_(LIN_ADVANCE, if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval);
|
TERN_(LIN_ADVANCE, if (nextAdvanceISR != LA_ADV_NEVER) nextAdvanceISR -= interval);
|
||||||
TERN_(INTEGRATED_BABYSTEPPING, if (nextBabystepISR != BABYSTEP_NEVER) nextBabystepISR -= interval);
|
TERN_(INTEGRATED_BABYSTEPPING, if (nextBabystepISR != BABYSTEP_NEVER) nextBabystepISR -= interval);
|
||||||
|
|
||||||
@ -1663,7 +1663,7 @@ void Stepper::pulse_phase_isr() {
|
|||||||
abort_current_block = false;
|
abort_current_block = false;
|
||||||
if (current_block) {
|
if (current_block) {
|
||||||
discard_current_block();
|
discard_current_block();
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
ShapingQueue::purge();
|
ShapingQueue::purge();
|
||||||
#if ENABLED(INPUT_SHAPING_X)
|
#if ENABLED(INPUT_SHAPING_X)
|
||||||
shaping_x.delta_error = 0;
|
shaping_x.delta_error = 0;
|
||||||
@ -1921,7 +1921,7 @@ void Stepper::pulse_phase_isr() {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
// record an echo if a step is needed in the primary bresenham
|
// record an echo if a step is needed in the primary bresenham
|
||||||
const bool x_step = TERN0(INPUT_SHAPING_X, step_needed.x && shaping_x.enabled),
|
const bool x_step = TERN0(INPUT_SHAPING_X, step_needed.x && shaping_x.enabled),
|
||||||
y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled);
|
y_step = TERN0(INPUT_SHAPING_Y, step_needed.y && shaping_y.enabled);
|
||||||
@ -2035,7 +2035,7 @@ void Stepper::pulse_phase_isr() {
|
|||||||
} while (--events_to_do);
|
} while (--events_to_do);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
|
|
||||||
void Stepper::shaping_isr() {
|
void Stepper::shaping_isr() {
|
||||||
AxisFlags step_needed{0};
|
AxisFlags step_needed{0};
|
||||||
@ -2087,7 +2087,7 @@ void Stepper::pulse_phase_isr() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_SHAPING
|
#endif // HAS_ZV_SHAPING
|
||||||
|
|
||||||
// Calculate timer interval, with all limits applied.
|
// Calculate timer interval, with all limits applied.
|
||||||
hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
|
hal_timer_t Stepper::calc_timer_interval(uint32_t step_rate) {
|
||||||
@ -3108,7 +3108,7 @@ void Stepper::init() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate a fixed point factor to apply to the signal and its echo
|
* Calculate a fixed point factor to apply to the signal and its echo
|
||||||
@ -3179,7 +3179,7 @@ void Stepper::init() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // HAS_SHAPING
|
#endif // HAS_ZV_SHAPING
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the stepper positions directly in steps
|
* Set the stepper positions directly in steps
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Input shaping base time
|
// Input shaping base time
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
#define ISR_SHAPING_BASE_CYCLES 180UL
|
#define ISR_SHAPING_BASE_CYCLES 180UL
|
||||||
#else
|
#else
|
||||||
#define ISR_SHAPING_BASE_CYCLES 0UL
|
#define ISR_SHAPING_BASE_CYCLES 0UL
|
||||||
@ -128,7 +128,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Input shaping base time
|
// Input shaping base time
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
#define ISR_SHAPING_BASE_CYCLES 290UL
|
#define ISR_SHAPING_BASE_CYCLES 290UL
|
||||||
#else
|
#else
|
||||||
#define ISR_SHAPING_BASE_CYCLES 0UL
|
#define ISR_SHAPING_BASE_CYCLES 0UL
|
||||||
@ -217,7 +217,7 @@
|
|||||||
#define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * ((1UL << R) - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES))
|
#define ISR_LOOP_CYCLES(R) ((ISR_LOOP_BASE_CYCLES + MIN_ISR_LOOP_CYCLES + MIN_STEPPER_PULSE_CYCLES) * ((1UL << R) - 1) + _MAX(MIN_ISR_LOOP_CYCLES, MIN_STEPPER_PULSE_CYCLES))
|
||||||
|
|
||||||
// Model input shaping as an extra loop call
|
// Model input shaping as an extra loop call
|
||||||
#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R))
|
#define ISR_SHAPING_LOOP_CYCLES(R) (TERN0(HAS_ZV_SHAPING, (ISR_LOOP_BASE_CYCLES + TERN0(INPUT_SHAPING_X, ISR_X_STEPPER_CYCLES) + TERN0(INPUT_SHAPING_Y, ISR_Y_STEPPER_CYCLES)) << R))
|
||||||
|
|
||||||
// If linear advance is enabled, then it is handled separately
|
// If linear advance is enabled, then it is handled separately
|
||||||
#if ENABLED(LIN_ADVANCE)
|
#if ENABLED(LIN_ADVANCE)
|
||||||
@ -315,7 +315,7 @@ constexpr ena_mask_t enable_overlap[] = {
|
|||||||
|
|
||||||
//static_assert(!any_enable_overlap(), "There is some overlap.");
|
//static_assert(!any_enable_overlap(), "There is some overlap.");
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
|
|
||||||
#ifdef SHAPING_MAX_STEPRATE
|
#ifdef SHAPING_MAX_STEPRATE
|
||||||
constexpr float max_step_rate = SHAPING_MAX_STEPRATE;
|
constexpr float max_step_rate = SHAPING_MAX_STEPRATE;
|
||||||
@ -463,7 +463,7 @@ constexpr ena_mask_t enable_overlap[] = {
|
|||||||
int32_t last_block_end_pos = 0;
|
int32_t last_block_end_pos = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HAS_SHAPING
|
#endif // HAS_ZV_SHAPING
|
||||||
|
|
||||||
//
|
//
|
||||||
// Stepper class definition
|
// Stepper class definition
|
||||||
@ -577,7 +577,7 @@ class Stepper {
|
|||||||
static bool bezier_2nd_half; // If Bézier curve has been initialized or not
|
static bool bezier_2nd_half; // If Bézier curve has been initialized or not
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
#if ENABLED(INPUT_SHAPING_X)
|
#if ENABLED(INPUT_SHAPING_X)
|
||||||
static ShapeParams shaping_x;
|
static ShapeParams shaping_x;
|
||||||
#endif
|
#endif
|
||||||
@ -646,7 +646,7 @@ class Stepper {
|
|||||||
// The stepper block processing ISR phase
|
// The stepper block processing ISR phase
|
||||||
static hal_timer_t block_phase_isr();
|
static hal_timer_t block_phase_isr();
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
static void shaping_isr();
|
static void shaping_isr();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -669,7 +669,7 @@ class Stepper {
|
|||||||
// Check if the given block is busy or not - Must not be called from ISR contexts
|
// Check if the given block is busy or not - Must not be called from ISR contexts
|
||||||
static bool is_block_busy(const block_t * const block);
|
static bool is_block_busy(const block_t * const block);
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
// Check whether the stepper is processing any input shaping echoes
|
// Check whether the stepper is processing any input shaping echoes
|
||||||
static bool input_shaping_busy() {
|
static bool input_shaping_busy() {
|
||||||
const bool was_on = hal.isr_state();
|
const bool was_on = hal.isr_state();
|
||||||
@ -817,7 +817,7 @@ class Stepper {
|
|||||||
set_directions();
|
set_directions();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_SHAPING
|
#if HAS_ZV_SHAPING
|
||||||
static void set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta);
|
static void set_shaping_damping_ratio(const AxisEnum axis, const_float_t zeta);
|
||||||
static float get_shaping_damping_ratio(const AxisEnum axis);
|
static float get_shaping_damping_ratio(const AxisEnum axis);
|
||||||
static void set_shaping_frequency(const AxisEnum axis, const_float_t freq);
|
static void set_shaping_frequency(const AxisEnum axis, const_float_t freq);
|
||||||
|
@ -189,7 +189,7 @@ HAS_DUPLICATION_MODE = src_filter=+<src/gcode/control/M605.cpp
|
|||||||
LIN_ADVANCE = src_filter=+<src/gcode/feature/advance>
|
LIN_ADVANCE = src_filter=+<src/gcode/feature/advance>
|
||||||
PHOTO_GCODE = src_filter=+<src/gcode/feature/camera>
|
PHOTO_GCODE = src_filter=+<src/gcode/feature/camera>
|
||||||
CONTROLLER_FAN_EDITABLE = src_filter=+<src/gcode/feature/controllerfan>
|
CONTROLLER_FAN_EDITABLE = src_filter=+<src/gcode/feature/controllerfan>
|
||||||
HAS_SHAPING = src_filter=+<src/gcode/feature/input_shaping>
|
HAS_ZV_SHAPING = src_filter=+<src/gcode/feature/input_shaping>
|
||||||
GCODE_MACROS = src_filter=+<src/gcode/feature/macro>
|
GCODE_MACROS = src_filter=+<src/gcode/feature/macro>
|
||||||
GRADIENT_MIX = src_filter=+<src/gcode/feature/mixing/M166.cpp>
|
GRADIENT_MIX = src_filter=+<src/gcode/feature/mixing/M166.cpp>
|
||||||
HAS_SAVED_POSITIONS = src_filter=+<src/gcode/feature/pause/G60.cpp> +<src/gcode/feature/pause/G61.cpp>
|
HAS_SAVED_POSITIONS = src_filter=+<src/gcode/feature/pause/G60.cpp> +<src/gcode/feature/pause/G61.cpp>
|
||||||
|
Loading…
Reference in New Issue
Block a user