Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

930 bug fixes for garter carriage alignment and lace carriage start selection #184

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ayab/encoders.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ constexpr uint8_t START_OFFSET[NUM_MACHINES][NUM_DIRECTIONS][NUM_CARRIAGES] = {
// KH930
{
// K, L, G
{40U, 40U, 8U}, // Left
{16U, 16U, 32U} // Right
{40U, 40U, 32U}, // Left
{16U, 16U, 56U} // Right
},
// KH270
{
Expand Down
12 changes: 11 additions & 1 deletion src/ayab/knitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,23 @@ void Knitter::reqLine(uint8_t lineNumber) {
*/
bool Knitter::calculatePixelAndSolenoid() {
uint8_t startOffset = 0;
uint8_t laceOffset = 0;

switch (m_direction) {
// calculate the solenoid and pixel to be set
// implemented according to machine manual
// magic numbers from machine manual
case Direction_t::Right:
startOffset = getStartOffset(Direction_t::Left);
if (m_position >= startOffset) {

// We have to start setting pixels earlier when the lace carriage is selected because we shift
// the lace pixel selection up HALF_SOLENOIDS_NUM in this direction. Doesn't matter going back
// the other way.
if (Carriage_t::Lace == m_carriage) {
laceOffset = HALF_SOLENOIDS_NUM[static_cast<uint8_t>(m_machineType)];
}

if (m_position >= startOffset - laceOffset) {
m_pixelToSet = m_position - startOffset;

if ((BeltShift::Regular == m_beltShift) || (m_machineType == Machine_t::Kh270)) {
Expand Down Expand Up @@ -432,6 +441,7 @@ bool Knitter::calculatePixelAndSolenoid() {
default:
return false;
}

// The 270 has 12 solenoids but they get shifted over 3 bits
if (m_machineType == Machine_t::Kh270) {
m_solenoidToSet = m_solenoidToSet + 3;
Expand Down
Loading