From 68c5489580b532b8206a84bbe131edcfcd5dce88 Mon Sep 17 00:00:00 2001 From: Carson Holgate Date: Tue, 13 Jun 2023 19:20:31 -0700 Subject: [PATCH] Update garter carriage values for 910 --- src/ayab/encoders.cpp | 6 +++++- src/ayab/encoders.h | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ayab/encoders.cpp b/src/ayab/encoders.cpp index ad7b1013e..8addc2d8d 100644 --- a/src/ayab/encoders.cpp +++ b/src/ayab/encoders.cpp @@ -213,7 +213,11 @@ void Encoders::encA_falling() { if (hallValueSmall || hallValue > FILTER_R_MAX[m_machineType]) { m_hallActive = Right; - if (hallValueSmall) { + + // The garter carriage has a second set of magnets that are going to + // pass the sensor and will reset state incorrectly if allowed to + // continue. + if (hallValueSmall && m_carriage != Garter) { m_carriage = Knit; } diff --git a/src/ayab/encoders.h b/src/ayab/encoders.h index 5c4bf0f39..9b48945e5 100644 --- a/src/ayab/encoders.h +++ b/src/ayab/encoders.h @@ -63,14 +63,14 @@ constexpr uint8_t END_LEFT[NUM_MACHINES] = {0U, 0U, 0U}; constexpr uint8_t END_RIGHT[NUM_MACHINES] = {255U, 255U, 140U}; constexpr uint8_t END_OFFSET[NUM_MACHINES] = {28U, 28U, 14U}; -constexpr uint8_t GARTER_SLOP = 14; +constexpr uint8_t GARTER_SLOP = 2; constexpr uint8_t START_OFFSET[NUM_MACHINES][NUM_DIRECTIONS][NUM_CARRIAGES] = { // KH910 { // K, L, G - {40, 40, 8}, // Left - {16, 16, 32} // Right + {40, 40, 32}, // Left + {16, 16, 56} // Right }, // KH930 {