Skip to content

Commit

Permalink
Consider machine ready as soon as GC is seen
Browse files Browse the repository at this point in the history
The "pass turn mark" test is not appropriate for the Garter
carriage.
  • Loading branch information
jonathanperret committed Nov 15, 2024
1 parent 53a0846 commit 43e53f4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ayab/knitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -216,10 +217,12 @@ bool Knitter::isReady() {
(m_position > (END_LEFT_PLUS_OFFSET[static_cast<uint8_t>(m_machineType)] + GARTER_SLOP));
bool passedRight = (Direction_t::Left == m_direction) && (Direction_t::Right == m_lastHall) &&
(m_position < (END_RIGHT_MINUS_OFFSET[static_cast<uint8_t>(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);
Expand Down

0 comments on commit 43e53f4

Please sign in to comment.