From fec45802ee9e3269ce8d91834768df6f8e073416 Mon Sep 17 00:00:00 2001 From: Jonathan Perret Date: Sun, 1 Dec 2024 21:12:01 +0100 Subject: [PATCH] Adjust carriage offsets to theoretically optimal values --- src/ayab/encoders.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ayab/encoders.h b/src/ayab/encoders.h index 28c7256d..327989fe 100644 --- a/src/ayab/encoders.h +++ b/src/ayab/encoders.h @@ -82,24 +82,32 @@ constexpr uint8_t ALL_MAGNETS_CLEARED_RIGHT[NUM_MACHINES] = {199U, 199U, 130U}; // For the garter carriage we need to see both magnets. constexpr uint8_t GARTER_SLOP = 2U; +// KH9xx: +// - K=±16, L=±4, G=±8 +// — add END_OFFSET (28) +// - for G add magnet distance (12) +// KH270: +// - K=±9 +// - add END_OFFSET (5) +// - add MAGNET_DISTANCE_270 (12) constexpr uint8_t START_OFFSET[NUM_MACHINES][NUM_DIRECTIONS][NUM_CARRIAGES] = { // KH910 { // K, L, G - {42U, 32U, 32U}, // Left - {16U, 32U, 50U} // Right + {44U, 32U, 32U}, // Left + {12U, 24U, 48U} // Right }, // KH930 { // K, L, G - {42U, 32U, 32U}, // Left - {16U, 32U, 50U} // Right + {44U, 32U, 32U}, // Left + {12U, 24U, 48U} // Right }, // KH270 { // K - {28U, 0U, 0U}, // Left - {16U, 0U, 0U} // Right + {26U, 0U, 0U}, // Left + {8U, 0U, 0U} // Right }}; // Should be calibrated to each device