Upgrade old code
parent
3ffe188143
commit
aaa7701867
|
|
@ -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::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
|
||||
|
|
|
|||
|
|
@ -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 <typename U, typename AU>
|
||||
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 <typename AU, typename U>
|
||||
|
|
@ -155,13 +145,6 @@ static constexpr typename AU::type_t unitToSteps(U v) {
|
|||
return unitToAxisUnit<AU>(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 <typename U, typename AU>
|
||||
static constexpr typename U::type_t stepsToUnit(AU pos) {
|
||||
return axisUnitToUnit<U, AU>(pos);
|
||||
}
|
||||
|
||||
// Pulley
|
||||
typedef AxisUnit<pos_t, Pulley, Lenght> P_pos_t; ///< Pulley position type (steps)
|
||||
typedef AxisUnit<steps_t, Pulley, Speed> P_speed_t; ///< Pulley speed type (steps/s)
|
||||
|
|
|
|||
Loading…
Reference in New Issue