Fix chopping negative move values in PlanLongMove
+ use PlanLongMove in UnloadToFinda + fix comment in unit testpull/135/head
parent
c3aec0bf92
commit
fa4e687fdc
|
|
@ -36,7 +36,7 @@ bool UnloadToFinda::Step() {
|
|||
if (mi::idler.Engaged()) {
|
||||
state = WaitingForFINDA;
|
||||
mg::globals.SetFilamentLoaded(mg::globals.ActiveSlot(), mg::FilamentLoadState::InSelector);
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyFeedrate); // @@TODO constants
|
||||
mm::motion.PlanLongMove<mm::Pulley>(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyFeedrate);
|
||||
}
|
||||
return false;
|
||||
case WaitingForFINDA:
|
||||
|
|
|
|||
|
|
@ -170,12 +170,22 @@ public:
|
|||
constexpr void PlanLongMove(config::Unit<long double, B, Lenght> delta,
|
||||
config::Unit<long double, B, Speed> feed_rate, config::Unit<long double, B, Speed> end_rate = { 0 }) {
|
||||
auto steps = unitToAxisUnit<AxisUnit<pos_t, A, Lenght>>(delta);
|
||||
while (steps.v > 32767) {
|
||||
PlanMove<A>(
|
||||
{ 32767 },
|
||||
unitToAxisUnit<AxisUnit<steps_t, A, Speed>>(feed_rate),
|
||||
unitToAxisUnit<AxisUnit<steps_t, A, Speed>>(feed_rate)); // keep the end feedrate the same to continue with the next segment
|
||||
steps.v -= 32767;
|
||||
if (steps.v < 0) {
|
||||
while (steps.v > 32767) {
|
||||
PlanMove<A>(
|
||||
{ 32767 },
|
||||
unitToAxisUnit<AxisUnit<steps_t, A, Speed>>(feed_rate),
|
||||
unitToAxisUnit<AxisUnit<steps_t, A, Speed>>(feed_rate)); // keep the end feedrate the same to continue with the next segment
|
||||
steps.v -= 32767;
|
||||
}
|
||||
} else {
|
||||
while (steps.v < -32767) {
|
||||
PlanMove<A>(
|
||||
{ -32767 },
|
||||
unitToAxisUnit<AxisUnit<steps_t, A, Speed>>(feed_rate),
|
||||
unitToAxisUnit<AxisUnit<steps_t, A, Speed>>(feed_rate)); // keep the end feedrate the same to continue with the next segment
|
||||
steps.v += 32767;
|
||||
}
|
||||
}
|
||||
PlanMove<A>( // last segment
|
||||
steps,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ void FeedingToBondtech(logic::ToolChange &tc, uint8_t toSlot) {
|
|||
REQUIRE(WhileCondition(
|
||||
tc,
|
||||
[&](int step) -> bool {
|
||||
if(step == 2000){ // on 5000th step make filament sensor trigger
|
||||
if(step == 2000){ // on 2000th step make filament sensor trigger
|
||||
mfs::fsensor.ProcessMessage(true);
|
||||
}
|
||||
return tc.TopLevelState() == ProgressCode::FeedingToBondtech; },
|
||||
|
|
|
|||
Loading…
Reference in New Issue