diff --git a/src/config/config.h b/src/config/config.h index d8c6c1c..39af18f 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -8,6 +8,7 @@ namespace config { static constexpr const uint8_t toolCount = 5U; ///< Max number of extruders/tools/slots // Idler's setup +/* static constexpr U_deg idlerSlotPositions[toolCount + 1] = { 1.0_deg, 2.0_deg, 3.0_deg, 4.0_deg, 5.0_deg, 0 }; ///< slots 0-4 are the real ones, the 5th is the idle position @@ -16,6 +17,33 @@ static constexpr U_deg idlerSlotPositions[toolCount + 1] = { static constexpr U_mm selectorSlotPositions[toolCount + 1] = { 1.0_mm, 2.0_mm, 3.0_mm, 4.0_mm, 5.0_mm, 6.0_mm }; ///< slots 0-4 are the real ones, the 5th is the farthest parking positions +*/ +/// Idler steps between neighbor positions: 2 msteps = 180 / 4 +static constexpr uint16_t idlerSteps = 1420 / 4; + +/// Absolute positions for Idler's slots: 0-4 are the real ones, the 5th index is the idle position +static constexpr uint16_t idlerSlotPositions[toolCount + 1] = { + idlerSteps, + idlerSteps * 2, + idlerSteps * 3, + idlerSteps * 4, + idlerSteps * 5, + 0 +}; + +// Selector's setup + +/// Selector steps between neighbor positions +static constexpr uint16_t selectorSteps = 2790 / 4; +/// slots 0-4 are the real ones, the 5th is the farthest parking positions +static constexpr uint16_t selectorSlotPositions[toolCount + 1] = { + selectorSteps, + selectorSteps * 2, + selectorSteps * 3, + selectorSteps * 4, + selectorSteps * 5, + selectorSteps * 6 +}; // Printer's filament sensor setup static constexpr const uint16_t fsensorDebounceMs = 10; diff --git a/tests/unit/logic/stubs/stub_motion.cpp b/tests/unit/logic/stubs/stub_motion.cpp index 7c89e57..8624714 100644 --- a/tests/unit/logic/stubs/stub_motion.cpp +++ b/tests/unit/logic/stubs/stub_motion.cpp @@ -1,6 +1,9 @@ #include "motion.h" +#include "idler.h" #include "stub_motion.h" +namespace mi = modules::idler; + namespace modules { namespace motion { @@ -75,8 +78,10 @@ void ReinitMotion() { // reset the simulation data to defaults axes[0] = AxisSim({ 0, 0, false, false, false }); // pulley - axes[1] = AxisSim({ selector_pos, selector_pos, false, false, false }); // selector //@@TODO proper selector positions once defined - axes[2] = AxisSim({ 0, 0, false, false, false }); // idler +// axes[1] = AxisSim({ selector_pos, selector_pos, false, false, false }); // selector //@@TODO proper selector positions once defined +// axes[2] = AxisSim({ 0, 0, false, false, false }); // idler + axes[1] = AxisSim({ config::selectorSlotPositions[0], config::selectorSlotPositions[0], false, false, false }); // selector + axes[2] = AxisSim({ config::idlerSlotPositions[mi::Idler::IdleSlotIndex()], config::idlerSlotPositions[mi::Idler::IdleSlotIndex()], false, false, false }); // idler } /// probably higher-level operations knowing the semantic meaning of axes