Keep constants start with lowercase letter
and remove a few warnings from the buildpull/126/head
parent
ac1f13672a
commit
53b329941f
|
|
@ -54,22 +54,22 @@ static constexpr uint16_t stepTimerQuantum = 256; // 256 = 128us
|
|||
static constexpr uint8_t feedToBondtechMaxRetries = 2;
|
||||
|
||||
/// Distances
|
||||
static constexpr U_mm PulleyToCuttingEdge = 33.0_mm; /// 33.0_mm /// Pulley to cutting edge.
|
||||
static constexpr U_mm pulleyToCuttingEdge = 33.0_mm; /// 33.0_mm /// Pulley to cutting edge.
|
||||
/// Case 1: FINDA working: This should be the max retraction after FINDA un-triggers.
|
||||
/// Case 2: FINDA not working: calculate retraction from printer to this point.
|
||||
static constexpr U_mm FilamentMinLoadedToMMU = 20.0_mm; /// 20.0_mm ??? /// Limit of retraction. @TODO find correct distance.
|
||||
static constexpr U_mm EjectFromCuttingEdge = 40.0_mm; /// Eject should ignore FilamentMinLoadedToMMU and retract
|
||||
static constexpr U_mm CuttingEdgeRetract = 3.0_mm; /// 3.0_mm /// Cutting retraction distance (filament should be flush with outlet) @TODO find correct distance.
|
||||
static constexpr U_mm CuttingEdgeToFINDA = 18.5_mm; /// 18.5_mm -1.0_mm /// Cutting edge to FINDA MMU2 side -1mm tolerance should be ~18.5. FINDA shouldn't trigger here.
|
||||
static constexpr U_mm FINDAtriggerDistance = 4.5_mm; /// 9.0_mm /// FINDA trigger distance +1.0_mm tolerance.
|
||||
static constexpr U_mm CuttingEdgeToFINDAmidpoint = 22.85_mm; /// Cutting edge to Midpoint of FINDA should be 22.85_mm.
|
||||
static constexpr U_mm FINDAtoCoupler = 12.0_mm; /// 12.0_mm /// FINDA Coupler side to coupler screw.
|
||||
static constexpr U_mm CouplerToBowden = 3.5_mm; /// 3.5_mm /// FINDA Coupler screw to bowden mmu2s side (in coupling).
|
||||
static constexpr U_mm DefaultBowdenLength = 427.0_mm; /// ~427.0_mm /// Default Bowden length. @TODO Should be stored in EEPROM.
|
||||
static constexpr U_mm MinimumBowdenLength = 341.0_mm; /// ~341.0_mm /// Minimum bowden length. @TODO Should be stored in EEPROM.
|
||||
static constexpr U_mm MaximumBowdenLength = 792.0_mm; /// ~792.0_mm /// Maximum bowden length. @TODO Should be stored in EEPROM.
|
||||
static constexpr U_mm FeedToFINDA = CuttingEdgeToFINDAmidpoint + FilamentMinLoadedToMMU;
|
||||
static constexpr U_mm CutLength = 8.0_mm;
|
||||
static constexpr U_mm filamentMinLoadedToMMU = 20.0_mm; /// 20.0_mm ??? /// Limit of retraction. @TODO find correct distance.
|
||||
static constexpr U_mm ejectFromCuttingEdge = 40.0_mm; /// Eject should ignore FilamentMinLoadedToMMU and retract
|
||||
static constexpr U_mm cuttingEdgeRetract = 3.0_mm; /// 3.0_mm /// Cutting retraction distance (filament should be flush with outlet) @TODO find correct distance.
|
||||
static constexpr U_mm cuttingEdgeToFinda = 18.5_mm; /// 18.5_mm -1.0_mm /// Cutting edge to FINDA MMU2 side -1mm tolerance should be ~18.5. FINDA shouldn't trigger here.
|
||||
static constexpr U_mm findaTriggerDistance = 4.5_mm; /// 9.0_mm /// FINDA trigger distance +1.0_mm tolerance.
|
||||
static constexpr U_mm cuttingEdgeToFindaMidpoint = 22.85_mm; /// Cutting edge to Midpoint of FINDA should be 22.85_mm.
|
||||
static constexpr U_mm findaToCoupler = 12.0_mm; /// 12.0_mm /// FINDA Coupler side to coupler screw.
|
||||
static constexpr U_mm couplerToBowden = 3.5_mm; /// 3.5_mm /// FINDA Coupler screw to bowden mmu2s side (in coupling).
|
||||
static constexpr U_mm defaultBowdenLength = 427.0_mm; /// ~427.0_mm /// Default Bowden length. @TODO Should be stored in EEPROM.
|
||||
static constexpr U_mm minimumBowdenLength = 341.0_mm; /// ~341.0_mm /// Minimum bowden length. @TODO Should be stored in EEPROM.
|
||||
static constexpr U_mm maximumBowdenLength = 792.0_mm; /// ~792.0_mm /// Maximum bowden length. @TODO Should be stored in EEPROM.
|
||||
static constexpr U_mm feedToFinda = cuttingEdgeToFindaMidpoint + filamentMinLoadedToMMU;
|
||||
static constexpr U_mm cutLength = 8.0_mm;
|
||||
|
||||
/// Begin: Pulley axis configuration
|
||||
static constexpr AxisConfig pulley = {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ bool CutFilament::StepInner() {
|
|||
} else {
|
||||
// unload back to the pulley
|
||||
state = ProgressCode::UnloadingToPulley;
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::CutLength, config::pulleyFeedrate);
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::cutLength, config::pulleyFeedrate);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -72,7 +72,7 @@ bool CutFilament::StepInner() {
|
|||
case ProgressCode::PreparingBlade:
|
||||
if (ms::selector.Slot() == cutSlot + 1) {
|
||||
state = ProgressCode::PushingFilament;
|
||||
mm::motion.PlanMove<mm::Pulley>(config::CutLength, config::pulleyFeedrate); //
|
||||
mm::motion.PlanMove<mm::Pulley>(config::cutLength, config::pulleyFeedrate); //
|
||||
}
|
||||
break;
|
||||
case ProgressCode::PushingFilament:
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ bool EjectFilament::StepInner() {
|
|||
if (mm::motion.QueueEmpty()) { // selector parked aside
|
||||
state = ProgressCode::EjectingFilament;
|
||||
mm::motion.InitAxis(mm::Pulley);
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::FilamentMinLoadedToMMU, config::pulleyFeedrate);
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::filamentMinLoadedToMMU, config::pulleyFeedrate);
|
||||
}
|
||||
break;
|
||||
case ProgressCode::EjectingFilament:
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ void FeedToBondtech::Reset(uint8_t maxRetries) {
|
|||
}
|
||||
|
||||
bool FeedToBondtech::Step() {
|
||||
const uint16_t steps = mps::BowdenLength::get();
|
||||
|
||||
switch (state) {
|
||||
case EngagingIdler:
|
||||
if (mi::idler.Engaged()) {
|
||||
|
|
@ -37,7 +35,7 @@ bool FeedToBondtech::Step() {
|
|||
hu::usart1.puts(str);
|
||||
#endif //DEBUG_LOGIC
|
||||
state = PushingFilament;
|
||||
mm::motion.PlanMove<mm::Pulley>(config::DefaultBowdenLength, config::pulleyFeedrate); //@@TODO constants - there was some strange acceleration sequence in the original FW,
|
||||
mm::motion.PlanMove<mm::Pulley>(config::defaultBowdenLength, config::pulleyFeedrate); //@@TODO constants - there was some strange acceleration sequence in the original FW,
|
||||
// we can probably hand over some array of constants for hand-tuned acceleration + leverage some smoothing in the stepper as well
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ bool FeedToFinda::Step() {
|
|||
case EngagingIdler:
|
||||
if (mi::idler.Engaged() && ms::selector.Slot() == mg::globals.ActiveSlot()) {
|
||||
state = PushingFilament;
|
||||
mm::motion.PlanMove<mm::Pulley>(config::FeedToFINDA, config::pulleyFeedrate);
|
||||
mm::motion.PlanMove<mm::Pulley>(config::feedToFinda, config::pulleyFeedrate);
|
||||
mui::userInput.Clear(); // remove all buffered events if any just before we wait for some input
|
||||
}
|
||||
return false;
|
||||
|
|
@ -33,7 +33,7 @@ bool FeedToFinda::Step() {
|
|||
mm::motion.AbortPlannedMoves(); // stop pushing filament
|
||||
// FINDA triggered - that means it works and detected the filament tip
|
||||
state = UnloadBackToPTFE;
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::CuttingEdgeToFINDAmidpoint, config::pulleyFeedrate);
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::cuttingEdgeToFindaMidpoint, config::pulleyFeedrate);
|
||||
} else if (mm::motion.QueueEmpty()) { // all moves have been finished and FINDA didn't switch on
|
||||
state = Failed;
|
||||
// @@TODO - shall we disengage the idler?
|
||||
|
|
|
|||
|
|
@ -33,9 +33,7 @@ bool UnloadToFinda::Step() {
|
|||
case UnloadingToFinda:
|
||||
if (mi::idler.Engaged()) {
|
||||
state = WaitingForFINDA;
|
||||
int unloadSteps = mps::BowdenLength::get() + 1100;
|
||||
const int second_point = unloadSteps - 1300;
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::DefaultBowdenLength - config::FeedToFINDA - config::FilamentMinLoadedToMMU, config::pulleyFeedrate); // @@TODO constants
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::defaultBowdenLength - config::feedToFinda - config::filamentMinLoadedToMMU, config::pulleyFeedrate); // @@TODO constants
|
||||
}
|
||||
return false;
|
||||
case WaitingForFINDA:
|
||||
|
|
|
|||
Loading…
Reference in New Issue