Compilation error with Scott-Russel (tuga) drive system January 11, 2014 02:36PM |
Registered: 10 years ago Posts: 150 |
Re: Compilation error with Scott-Russel (tuga) drive system January 12, 2014 03:46AM |
Registered: 12 years ago Posts: 2,705 |
#if FEATURE_Z_PROBE || MAX_HARDWARE_ENDSTOP_Z || NONLINEAR_SYSTEM static long stepsRemainingAtZHit; #endif
#if FEATURE_Z_PROBE || MAX_HARDWARE_ENDSTOP_Z || NONLINEAR_SYSTEM long Printer::stepsRemainingAtZHit; #endif
Re: Compilation error with Scott-Russel (tuga) drive system January 12, 2014 06:45AM |
Registered: 10 years ago Posts: 150 |
Re: Compilation error with Scott-Russel (tuga) drive system January 17, 2014 08:34AM |
Registered: 10 years ago Posts: 150 |
#if DRIVE_SYSTEM==4 // Scott-Russel XY mechanisms
/**
Calculate Scott-Russel carriages position from a cartesian position
@param cartesianPosSteps array containing cartesian coordinates in steps units.
@param srPosSteps result array with SR carriage coordinates in steps units.
@returns 1 if cartesian coordinates have a valid SR position counterpart, 0 if not.
+------------->| srPosSteps[1]
+---->| srPosSteps[0] ( same as cartesianPosSteps[0] )
| |
| X Y
----+- <-*-> <-*-> ----------------+-- Common Linear Guide = X axis
| \ / |
| \ / |
| \ / |
| \/ |
| / | y2 = cartesianPosSteps[1]
| / |
| / |
| / |
| *-----------------------------+--
| Nozzle
+---->| cartesianPosSteps[0]
|
V
Y axis
*/
uint8_t transformCartesianStepsToDeltaSteps(long cartesianPosSteps[], long srPosSteps[])
{
srPosSteps[0] = cartesianPosSteps[0]; //X as cartesianX
srPosSteps[2] = cartesianPosSteps[2]; //Z as CartesianZ
long y2 = cartesianPosSteps[1]; // was wrong : y2 = Printer::deltaBPosXSteps-cartesianPosSteps[1];
if(Printer::isLargeMachine())
{
float y2f = (float)y2*(float)y2;
float temp = Printer::deltaDiagonalStepsSquaredF - y2f;
if(temp<0) return 0;
srPosSteps[1] = srPosSteps[0] + sqrt(temp);
}
else
{
y2 = y2*y2;
long temp = Printer::deltaDiagonalStepsSquared - y2;
if(temp<0) return 0;
srPosSteps[1] = srPosSteps[0] + HAL::integerSqrt(temp); //Y carriage follows X, with the calculated nonlinear offset
}
return 1;
}
#endif
As you can see, I set the common linear guide as the X cartesian axis (more exacty, the cartesian X axis is parallel to the guide, through the articulations of the mechanism). The cartesian Y axis origin is set at the X carriage articulation, while at XMin endstop position). This could be not coherent with the rest of the firmware. What do you think about these settings ?#if DRIVE_SYSTEM==4 // Scott-Russel drive system homing void Printer::homeXAxis() // In S-R systems, X and Y are homed together { long steps; if ((MIN_HARDWARE_ENDSTOP_X && X_MIN_PIN > -1 && X_HOME_DIR==-1 && MIN_HARDWARE_ENDSTOP_Y && Y_MIN_PIN > -1 && Y_HOME_DIR==-1) || (MAX_HARDWARE_ENDSTOP_X && X_MAX_PIN > -1 && X_HOME_DIR==1 && MAX_HARDWARE_ENDSTOP_Y && Y_MAX_PIN > -1 && Y_HOME_DIR==1)) { long offX = 0,offY = 0; #if NUM_EXTRUDER>1 for(uint8_t i=0; i < NUM_EXTRUDER; i++) { #if X_HOME_DIR < 0 offX = RMath::max(offX,extruder.xOffset); offY = RMath::max(offY,extruder.yOffset); #else offX = RMath::min(offX,extruder.xOffset); offY = RMath::min(offY,extruder.yOffset); #endif } //Reposition extruder that way, that all extruders can be selected at home pos. #endif UI_STATUS_UPD(UI_TEXT_HOME_X); steps = (Printer::xMaxSteps-Printer::xMinSteps) * X_HOME_DIR; currentPositionSteps[X_AXIS] = steps; currentPositionSteps[Y_AXIS] = 0; // dummy : no Y movement while traveling, together with X, toward endstops //Is it really necessary to transform coordinates here, since we need a simple uniaxial X movement, for both carriages ? //Seems to induce strange side effects (wawing movements while traveling toward endstops) transformCartesianStepsToDeltaSteps(currentPositionSteps, currentDeltaPositionSteps); //The use of this high level function leads to many segments, queuing, etc, with possible side effects. //Will it something more direct and safe (but perhaps less concise), for this uniaxial move ? PrintLine::moveRelativeDistanceInSteps(2*steps,0,0,0,homingFeedrate[X_AXIS],true,true); // Both carriages are now at home position currentPositionSteps[X_AXIS] = (X_HOME_DIR == -1) ? xMinSteps-offX : xMaxSteps+offX; currentPositionSteps[Y_AXIS] = 0; // dummy for now // Re-test the endstops to improve precision of homing PrintLine::moveRelativeDistanceInSteps(axisStepsPerMM[X_AXIS]*-ENDSTOP_X_BACK_MOVE * X_HOME_DIR,0,0,0,homingFeedrate[X_AXIS]/ENDSTOP_X_RETEST_REDUCTION_FACTOR,true,false); PrintLine::moveRelativeDistanceInSteps(axisStepsPerMM[X_AXIS]*2*ENDSTOP_X_BACK_MOVE * X_HOME_DIR,0,0,0,homingFeedrate[X_AXIS]/ENDSTOP_X_RETEST_REDUCTION_FACTOR,true,true); #if defined(ENDSTOP_X_BACK_ON_HOME) if(ENDSTOP_X_BACK_ON_HOME > 0) PrintLine::moveRelativeDistanceInSteps(axisStepsPerMM[X_AXIS]*-ENDSTOP_X_BACK_ON_HOME * X_HOME_DIR,0,0,0,homingFeedrate[X_AXIS],true,false); #endif // Now the home position can be set, for X and Y currentPositionSteps[X_AXIS] = (X_HOME_DIR == -1) ? xMinSteps-offX : xMaxSteps+offX; currentPositionSteps[Y_AXIS] = SR_CARTESIAN_Y_HOME * axisStepsPerMM[X_AXIS]; // To be verified by Repetier coordinateOffset[Y_AXIS] = 0; transformCartesianStepsToDeltaSteps(currentPositionSteps, currentDeltaPositionSteps); // Z is not set yet #if NUM_EXTRUDER>1 PrintLine::moveRelativeDistanceInSteps((Extruder::current->xOffset-offX) * X_HOME_DIR,(Extruder::current->yOffset-offY) * Y_HOME_DIR,0,0,homingFeedrate[X_AXIS],true,false); #endif } } void Printer::homeYAxis() { // Dummy function x and y homing must occur together } #else
Re: Compilation error with Scott-Russel (tuga) drive system January 17, 2014 09:21AM |
Registered: 10 years ago Posts: 150 |
/**
Move printer the given number of steps. Puts the move into the queue. Used by e.g. homing commands.
*/
void PrintLine::moveRelativeDistanceInSteps(long x,long y,long z,long e,float feedrate,bool waitEnd,bool checkEndstop)
{
//Com::printF(Com::tJerkColon,x);
//Com::printF(Com::tComma,y);
//Com::printFLN(Com::tComma,z);
float savedFeedrate = Printer::feedrate;
Printer::destinationSteps[X_AXIS] = Printer::currentPositionSteps[X_AXIS] + x;
Printer::destinationSteps[Y_AXIS] = Printer::currentPositionSteps[Y_AXIS] + y;
Printer::destinationSteps[Z_AXIS] = Printer::currentPositionSteps[Z_AXIS] + z;
Printer::destinationSteps[E_AXIS] = Printer::currentPositionSteps[E_AXIS] + e;
Printer::feedrate = feedrate;
#if NONLINEAR_SYSTEM
queueDeltaMove(checkEndstop,false,false);
#else
queueCartesianMove(checkEndstop,false);
#endif
Printer::feedrate = savedFeedrate;
Printer::updateCurrentPosition();
if(waitEnd)
Commands::waitUntilEndOfAllMoves();
}
Re: Compilation error with Scott-Russel (tuga) drive system January 17, 2014 09:49AM |
Registered: 12 years ago Posts: 2,705 |
#if DRIVE_SYSTEM==3 || DRIVE_SYSTEM==4 || DRIVE_SYSTEM==5 || DRIVE_SYSTEM==6 #define NONLINEAR_SYSTEM true #else #define NONLINEAR_SYSTEM false #endif
Re: Compilation error with Scott-Russel (tuga) drive system January 17, 2014 11:06AM |
Registered: 10 years ago Posts: 150 |
#define DELTA_DIAGONAL_ROD 236 // SR Setting, added manually #define SR_XYHOMEDIST 92 // SR offset between X and Y carriages at homing #define SR_CARTESIAN_Y_HOME sqrt( (DELTA_DIAGONAL_ROD * DELTA_DIAGONAL_ROD) - (SR_XYHOMEDIST * SR_XYHOMEDIST) ) //217.32924We can see that, if SR_XYHOMEDIST = 0, then SR_CARTESIAN_Y_HOME = DELTA_DIAGONAL_ROD, OK for the Tuga.
Re: Compilation error with Scott-Russel (tuga) drive system January 18, 2014 03:36AM |
Registered: 12 years ago Posts: 2,705 |
Re: Compilation error with Scott-Russel (tuga) drive system January 18, 2014 05:59AM |
Registered: 10 years ago Posts: 150 |
Re: Compilation error with Scott-Russel (tuga) drive system January 18, 2014 08:14AM |
Registered: 12 years ago Posts: 2,705 |
Re: Compilation error with Scott-Russel (tuga) drive system June 07, 2015 01:55PM |
Registered: 8 years ago Posts: 1 |
This report would have more information with "Show verbose output during compilation" enabled in File > Preferences. Arduino: 1.0.6 (Windows 7), Board: "Arduino Mega 2560 or Mega ADK" motion.cpp: In function 'uint8_t transformCartesianStepsToDeltaSteps(long int*, long int*)': motion.cpp:973: error: 'deltaDiagonalStepsSquaredF' is not a member of 'Printer' motion.cpp:980: error: 'deltaDiagonalStepsSquared' is not a member of 'Printer'
Re: Compilation error with Scott-Russel (tuga) drive system June 08, 2015 04:55AM |
Registered: 12 years ago Posts: 2,705 |