Skip to content

Commit

Permalink
Adjust carriage offsets to theoretically optimal values
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanperret committed Dec 1, 2024
1 parent 3e32811 commit fec4580
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/ayab/encoders.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fec4580

Please sign in to comment.