🚀 ZV Input Shaping (#24797)

This commit is contained in:
tombrazier
2022-10-21 22:34:22 +01:00
committed by Scott Lahteine
parent 5765449867
commit c1f0f26bff
15 changed files with 657 additions and 42 deletions

View File

@ -2483,6 +2483,14 @@ bool Planner::_populate_block(
#endif // XY_FREQUENCY_LIMIT
#if ENABLED(INPUT_SHAPING)
const float top_freq = _MIN(float(0x7FFFFFFFL)
OPTARG(HAS_SHAPING_X, stepper.get_shaping_frequency(X_AXIS))
OPTARG(HAS_SHAPING_Y, stepper.get_shaping_frequency(Y_AXIS))),
max_factor = (top_freq * float(shaping_dividends - 3) * 2.0f) / block->nominal_rate;
NOMORE(speed_factor, max_factor);
#endif
// Correct the speed
if (speed_factor < 1.0f) {
current_speed *= speed_factor;