From 43e53f433babf0f5a1f5a9e25cc7a320e5a1dab0 Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Fri, 15 Nov 2024 22:56:59 +0100 Subject: [PATCH] Consider machine ready as soon as GC is seen The "pass turn mark" test is not appropriate for the Garter carriage. --- src/ayab/knitter.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ayab/knitter.cpp b/src/ayab/knitter.cpp index 98d55dd4..4e5d12b2 100644 --- a/src/ayab/knitter.cpp +++ b/src/ayab/knitter.cpp @@ -76,6 +76,7 @@ void Knitter::init() { m_workedOnLine = false; m_lastHall = Direction_t::NoDirection; m_position = 0U; + m_carriage = Carriage::NoCarriage; m_hallActive = Direction_t::NoDirection; m_pixelToSet = 0; #ifdef DBG_NOMACHINE @@ -216,10 +217,12 @@ bool Knitter::isReady() { (m_position > (END_LEFT_PLUS_OFFSET[static_cast(m_machineType)] + GARTER_SLOP)); bool passedRight = (Direction_t::Left == m_direction) && (Direction_t::Right == m_lastHall) && (m_position < (END_RIGHT_MINUS_OFFSET[static_cast(m_machineType)] - GARTER_SLOP)); - // Machine is initialized when left Hall sensor is passed in Right direction - // New feature (August 2020): the machine is also initialized - // when the right Hall sensor is passed in Left direction. - if (passedLeft || passedRight) { + // Machine is initialized when the left Hall sensor is passed in Right + // direction, or the right Hall sensor is passed in Left direction. Or, as + // soon as we have detected a Garter carriage, because in that case we may + // need to start setting solenoids before the carriage center has crossed the + // turn mark. + if (passedLeft || passedRight || m_carriage == Carriage::Garter) { #endif // DBG_NOMACHINE GlobalSolenoids::setSolenoids(SOLENOIDS_BITMASK);