diff --git a/src/logic/feed_to_bondtech.cpp b/src/logic/feed_to_bondtech.cpp index 2959ff8..c6c1410 100644 --- a/src/logic/feed_to_bondtech.cpp +++ b/src/logic/feed_to_bondtech.cpp @@ -63,7 +63,10 @@ bool FeedToBondtech::Step() { state = PushingFilamentFast; mpu::pulley.InitAxis(); // plan a fast move while in the safe minimal length - mpu::pulley.PlanMove(config::minimumBowdenLength, + feedStart_mm = mm::stepsToUnit(mm::P_pos_t({ mm::motion.CurPosition(mm::Pulley) })); + // fast feed in millimeters - if the EEPROM value is incorrect, we'll get the default length + unit::U_mm fastFeedDistance = { (long double)mps::BowdenLength::Get(mg::globals.ActiveSlot()) }; + mpu::pulley.PlanMove(config::minimumBowdenLength, mg::globals.PulleyLoadFeedrate_mm_s(), mg::globals.PulleySlowFeedrate_mm_s()); // plan additional slow move while waiting for fsensor to trigger diff --git a/src/modules/axisunit.h b/src/modules/axisunit.h index 92d8482..ba57611 100644 --- a/src/modules/axisunit.h +++ b/src/modules/axisunit.h @@ -138,16 +138,6 @@ static constexpr T truncatedUnit(U v, long double mul = 1.) { return (T)(v.v * mul); } -/// Convert an AxisUnit to unit::Unit. -/// The scaling factor is stored with the pair config::AxisConfig::uSteps and -/// config::AxisConfig::stepsPerUnit (one per-axis). -template -static constexpr typename U::type_t axisUnitToUnit(AU v) { - static_assert(AU::unit == U::unit, "incorrect unit type conversion"); - //static_assert(U::base == axisScale[AU::axis].base, "incorrect unit base conversion"); - return { (typename U::type_t)(v.v / axisScale[AU::axis].stepsPerUnit) }; -} - /// Convert a unit::Unit to a steps type (pos_t or steps_t). /// Extract the raw step count from an AxisUnit with type checking. template @@ -155,13 +145,6 @@ static constexpr typename AU::type_t unitToSteps(U v) { return unitToAxisUnit(v).v; } -/// Convert a steps type (pos_t or steps_t) to a unit::Unit. -/// Extract the raw step count from an AxisUnit with type checking. -template -static constexpr typename U::type_t stepsToUnit(AU pos) { - return axisUnitToUnit(pos); -} - // Pulley typedef AxisUnit P_pos_t; ///< Pulley position type (steps) typedef AxisUnit P_speed_t; ///< Pulley speed type (steps/s)