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 3, 2024
1 parent 3e32811 commit 300ad5d
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/ayab/encoders.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,32 @@ constexpr uint8_t ALL_MAGNETS_CLEARED_RIGHT[NUM_MACHINES] = {199U, 199U, 130U};
constexpr uint8_t GARTER_SLOP = 2U;

constexpr uint8_t START_OFFSET[NUM_MACHINES][NUM_DIRECTIONS][NUM_CARRIAGES] = {
// KH910
// KH910: 16 solenoids, half-cycle is 8 needles
// - K: selectors 24 needles away from center -> solenoid activation points 16 needles away from center
// - L: selectors 12 needles away from center -> solenoid activation points 4 needles away from center
// - G: selector at center -> solenoid activation points 8 needles away from center
// — add END_OFFSET (28)
// - for G add magnet distance from center (12)
{
// K, L, G
{42U, 32U, 32U}, // Left
{16U, 32U, 50U} // Right
{44U, 32U, 32U}, // Left
{12U, 24U, 48U} // Right
},
// KH930
// KH930: same as KH910
{
// K, L, G
{42U, 32U, 32U}, // Left
{16U, 32U, 50U} // Right
{44U, 32U, 32U}, // Left
{12U, 24U, 48U} // Right
},
// KH270
// KH270: 12 solenoids, half-cycle is 6 needles
// - K: selectors 15 needles away from center -> solenoid activation points 9 needles away
// - add END_OFFSET (5)
// - add MAGNET_DISTANCE_270 (12)
// - add actual magnet distance from center (3)
{
// K
{28U, 0U, 0U}, // Left
{16U, 0U, 0U} // Right
{29U, 0U, 0U}, // Left
{11U, 0U, 0U} // Right
}};

// Should be calibrated to each device
Expand Down

0 comments on commit 300ad5d

Please sign in to comment.