Homing modified to correspond with Ian's documentation...
This commit is contained in:
parent
e9539d97f0
commit
4feab9afce
6 changed files with 110 additions and 49 deletions
|
@ -24,8 +24,8 @@ Licence: GPL
|
||||||
#define CONFIGURATION_H
|
#define CONFIGURATION_H
|
||||||
|
|
||||||
#define NAME "RepRapFirmware"
|
#define NAME "RepRapFirmware"
|
||||||
#define VERSION "0.41"
|
#define VERSION "0.42"
|
||||||
#define DATE "2013-12-18"
|
#define DATE "2013-12-19"
|
||||||
#define LAST_AUTHOR "reprappro.com"
|
#define LAST_AUTHOR "reprappro.com"
|
||||||
|
|
||||||
// Other firmware that we might switch to be compatible with.
|
// Other firmware that we might switch to be compatible with.
|
||||||
|
|
143
GCodes.cpp
143
GCodes.cpp
|
@ -67,7 +67,7 @@ void GCodes::Init()
|
||||||
homeX = false;
|
homeX = false;
|
||||||
homeY = false;
|
homeY = false;
|
||||||
homeZ = false;
|
homeZ = false;
|
||||||
homeAxisFinalMove = false;
|
homeAxisMoveCount = 0;
|
||||||
offSetSet = false;
|
offSetSet = false;
|
||||||
dwellWaiting = false;
|
dwellWaiting = false;
|
||||||
stackPointer = 0;
|
stackPointer = 0;
|
||||||
|
@ -465,37 +465,70 @@ bool GCodes::DoHome()
|
||||||
|
|
||||||
if(homeX)
|
if(homeX)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// FIXME Need to reinstate this to deal with high endstop on X.
|
||||||
|
|
||||||
|
// activeDrive[X_AXIS] = true;
|
||||||
|
// moveToDo[DRIVES] = platform->HomeFeedRate(X_AXIS);
|
||||||
|
// if(platform->HighStopButNotLow(X_AXIS))
|
||||||
|
// {
|
||||||
|
// if(homeAxisFinalMove)
|
||||||
|
// {
|
||||||
|
// moveToDo[X_AXIS] = 0.0;
|
||||||
|
// if(DoCannedCycleMove(false))
|
||||||
|
// {
|
||||||
|
// homeAxisFinalMove = false;
|
||||||
|
// homeX = false;
|
||||||
|
// return NoHome();
|
||||||
|
// }
|
||||||
|
// }else
|
||||||
|
// {
|
||||||
|
// moveToDo[X_AXIS] = 2.0*platform->AxisLength(X_AXIS);
|
||||||
|
// if(DoCannedCycleMove(true))
|
||||||
|
// homeAxisFinalMove = true;
|
||||||
|
// }
|
||||||
|
// } else
|
||||||
|
// {
|
||||||
|
// moveToDo[X_AXIS] = -2.0*platform->AxisLength(X_AXIS);
|
||||||
|
// if(DoCannedCycleMove(true))
|
||||||
|
// {
|
||||||
|
// homeX = false;
|
||||||
|
// homeAxisFinalMove = false;
|
||||||
|
// return NoHome();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
|
||||||
|
switch(homeAxisMoveCount)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
if(!AllMovesAreFinishedAndMoveBufferIsLoaded())
|
||||||
|
return false;
|
||||||
|
activeDrive[Z_AXIS] = true;
|
||||||
|
moveToDo[DRIVES] = platform->HomeFeedRate(Z_AXIS);
|
||||||
|
moveToDo[Z_AXIS] = 5.0 + moveBuffer[Z_AXIS];
|
||||||
|
if(DoCannedCycleMove(false))
|
||||||
|
homeAxisMoveCount = 1;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 1:
|
||||||
activeDrive[X_AXIS] = true;
|
activeDrive[X_AXIS] = true;
|
||||||
moveToDo[DRIVES] = platform->HomeFeedRate(X_AXIS);
|
moveToDo[DRIVES] = platform->HomeFeedRate(X_AXIS);
|
||||||
if(platform->HighStopButNotLow(X_AXIS))
|
|
||||||
{
|
|
||||||
if(homeAxisFinalMove)
|
|
||||||
{
|
|
||||||
moveToDo[X_AXIS] = 0.0;
|
|
||||||
if(DoCannedCycleMove(false))
|
|
||||||
{
|
|
||||||
homeAxisFinalMove = false;
|
|
||||||
homeX = false;
|
|
||||||
return NoHome();
|
|
||||||
}
|
|
||||||
}else
|
|
||||||
{
|
|
||||||
moveToDo[X_AXIS] = 2.0*platform->AxisLength(X_AXIS);
|
|
||||||
if(DoCannedCycleMove(true))
|
|
||||||
homeAxisFinalMove = true;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
moveToDo[X_AXIS] = -2.0*platform->AxisLength(X_AXIS);
|
moveToDo[X_AXIS] = -2.0*platform->AxisLength(X_AXIS);
|
||||||
if(DoCannedCycleMove(true))
|
if(DoCannedCycleMove(true))
|
||||||
{
|
{
|
||||||
|
homeAxisMoveCount = 0;
|
||||||
homeX = false;
|
homeX = false;
|
||||||
homeAxisFinalMove = false;
|
|
||||||
return NoHome();
|
return NoHome();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
default:
|
||||||
|
platform->Message(HOST_MESSAGE, "DoHome(): illegal move count.\n");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(homeY)
|
if(homeY)
|
||||||
{
|
{
|
||||||
|
@ -503,20 +536,27 @@ bool GCodes::DoHome()
|
||||||
moveToDo[DRIVES] = platform->HomeFeedRate(Y_AXIS);
|
moveToDo[DRIVES] = platform->HomeFeedRate(Y_AXIS);
|
||||||
if(platform->HighStopButNotLow(Y_AXIS))
|
if(platform->HighStopButNotLow(Y_AXIS))
|
||||||
{
|
{
|
||||||
if(homeAxisFinalMove)
|
switch(homeAxisMoveCount)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
|
moveToDo[Y_AXIS] = 2.0*platform->AxisLength(Y_AXIS);
|
||||||
|
if(DoCannedCycleMove(true))
|
||||||
|
homeAxisMoveCount = 1;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 1:
|
||||||
moveToDo[Y_AXIS] = 0.0;
|
moveToDo[Y_AXIS] = 0.0;
|
||||||
if(DoCannedCycleMove(false))
|
if(DoCannedCycleMove(false))
|
||||||
{
|
{
|
||||||
homeAxisFinalMove = false;
|
homeAxisMoveCount = 0;
|
||||||
homeY = false;
|
homeY = false;
|
||||||
return NoHome();
|
return NoHome();
|
||||||
}
|
}
|
||||||
}else
|
return false;
|
||||||
{
|
|
||||||
moveToDo[Y_AXIS] = 2.0*platform->AxisLength(Y_AXIS);
|
default:
|
||||||
if(DoCannedCycleMove(true))
|
platform->Message(HOST_MESSAGE, "DoHome(): illegal move count.\n");
|
||||||
homeAxisFinalMove = true;
|
return true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@ -524,40 +564,61 @@ bool GCodes::DoHome()
|
||||||
if(DoCannedCycleMove(true))
|
if(DoCannedCycleMove(true))
|
||||||
{
|
{
|
||||||
homeY = false;
|
homeY = false;
|
||||||
homeAxisFinalMove = false;
|
homeAxisMoveCount = 0;
|
||||||
return NoHome();
|
return NoHome();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(homeZ)
|
if(homeZ)
|
||||||
{
|
{
|
||||||
|
switch(homeAxisMoveCount)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
if(!AllMovesAreFinishedAndMoveBufferIsLoaded())
|
||||||
|
return false;
|
||||||
|
activeDrive[X_AXIS] = true;
|
||||||
|
activeDrive[Y_AXIS] = true;
|
||||||
|
moveToDo[DRIVES] = platform->HomeFeedRate(X_AXIS);
|
||||||
|
moveToDo[X_AXIS] = reprap.GetMove()->xBedProbePoint(0);
|
||||||
|
moveToDo[Y_AXIS] = reprap.GetMove()->yBedProbePoint(0);
|
||||||
|
if(DoCannedCycleMove(false))
|
||||||
|
homeAxisMoveCount = 1;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
activeDrive[Z_AXIS] = true;
|
||||||
|
moveToDo[DRIVES] = platform->HomeFeedRate(Z_AXIS);
|
||||||
|
moveToDo[Z_AXIS] = -2.0*platform->AxisLength(Z_AXIS);
|
||||||
|
if(DoCannedCycleMove(true))
|
||||||
|
homeAxisMoveCount = 2;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case 2:
|
||||||
activeDrive[Z_AXIS] = true;
|
activeDrive[Z_AXIS] = true;
|
||||||
moveToDo[DRIVES] = platform->HomeFeedRate(Z_AXIS);
|
moveToDo[DRIVES] = platform->HomeFeedRate(Z_AXIS);
|
||||||
if(homeAxisFinalMove)
|
|
||||||
{
|
|
||||||
moveToDo[Z_AXIS] = 0.0;
|
moveToDo[Z_AXIS] = 0.0;
|
||||||
if(DoCannedCycleMove(false))
|
if(DoCannedCycleMove(false))
|
||||||
{
|
{
|
||||||
homeAxisFinalMove = false;
|
homeAxisMoveCount = 0;
|
||||||
homeZ = false;
|
homeZ = false;
|
||||||
return NoHome();
|
return NoHome();
|
||||||
}
|
}
|
||||||
}else
|
|
||||||
{
|
|
||||||
moveToDo[Z_AXIS] = -2.0*platform->AxisLength(Z_AXIS);
|
|
||||||
if(DoCannedCycleMove(true))
|
|
||||||
homeAxisFinalMove = true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
default:
|
||||||
|
platform->Message(HOST_MESSAGE, "DoHome(): illegal move count.\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should never get here
|
// Should never get here
|
||||||
|
|
||||||
checkEndStops = false;
|
checkEndStops = false;
|
||||||
moveAvailable = false;
|
moveAvailable = false;
|
||||||
homeAxisFinalMove = false;
|
homeAxisMoveCount = 0;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1165,7 +1226,7 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb)
|
||||||
case 28: // Home
|
case 28: // Home
|
||||||
if(NoHome())
|
if(NoHome())
|
||||||
{
|
{
|
||||||
homeAxisFinalMove = false;
|
homeAxisMoveCount = 0;
|
||||||
homeX = gb->Seen(gCodeLetters[X_AXIS]);
|
homeX = gb->Seen(gCodeLetters[X_AXIS]);
|
||||||
homeY = gb->Seen(gCodeLetters[Y_AXIS]);
|
homeY = gb->Seen(gCodeLetters[Y_AXIS]);
|
||||||
homeZ = gb->Seen(gCodeLetters[Z_AXIS]);
|
homeZ = gb->Seen(gCodeLetters[Z_AXIS]);
|
||||||
|
|
4
GCodes.h
4
GCodes.h
|
@ -142,7 +142,7 @@ class GCodes
|
||||||
bool homeX;
|
bool homeX;
|
||||||
bool homeY;
|
bool homeY;
|
||||||
bool homeZ;
|
bool homeZ;
|
||||||
bool homeAxisFinalMove;
|
int8_t homeAxisMoveCount;
|
||||||
float gFeedRate;
|
float gFeedRate;
|
||||||
int probeCount;
|
int probeCount;
|
||||||
int8_t cannedCycleMoveCount;
|
int8_t cannedCycleMoveCount;
|
||||||
|
@ -192,7 +192,7 @@ inline bool GCodes::PrintingAFile()
|
||||||
|
|
||||||
inline bool GCodes::NoHome()
|
inline bool GCodes::NoHome()
|
||||||
{
|
{
|
||||||
return !(homeX || homeY || homeZ || homeAxisFinalMove);
|
return !(homeX || homeY || homeZ || homeAxisMoveCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function takes care of the fact that the heater and head indices
|
// This function takes care of the fact that the heater and head indices
|
||||||
|
|
4
Move.cpp
4
Move.cpp
|
@ -115,8 +115,8 @@ void Move::Init()
|
||||||
|
|
||||||
for(uint8_t point = 0; point < NUMBER_OF_PROBE_POINTS; point++)
|
for(uint8_t point = 0; point < NUMBER_OF_PROBE_POINTS; point++)
|
||||||
{
|
{
|
||||||
xBedProbePoints[point] = (0.2 + 0.6*(float)(point%2))*platform->AxisLength(X_AXIS);
|
xBedProbePoints[point] = (0.3 + 0.6*(float)(point%2))*platform->AxisLength(X_AXIS);
|
||||||
yBedProbePoints[point] = (0.2 + 0.6*(float)(point/2))*platform->AxisLength(Y_AXIS);
|
yBedProbePoints[point] = (0.0 + 0.9*(float)(point/2))*platform->AxisLength(Y_AXIS);
|
||||||
zBedProbePoints[point] = 0.0;
|
zBedProbePoints[point] = 0.0;
|
||||||
probePointSet[point] = unset;
|
probePointSet[point] = unset;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Reference in a new issue