|
@ -253,7 +253,6 @@ |
|
|
* M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) |
|
|
* M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration) |
|
|
* M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) |
|
|
* M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree) |
|
|
* M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) |
|
|
* M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position) |
|
|
* M365 - SCARA calibration: Scaling factor, X, Y, Z axis |
|
|
|
|
|
* ************* SCARA End *************** |
|
|
* ************* SCARA End *************** |
|
|
* |
|
|
* |
|
|
* ************ Custom codes - This can change to suit future G-code regulations |
|
|
* ************ Custom codes - This can change to suit future G-code regulations |
|
@ -505,8 +504,7 @@ static uint8_t target_extruder; |
|
|
L2_2 = sq(float(L2)); |
|
|
L2_2 = sq(float(L2)); |
|
|
|
|
|
|
|
|
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND, |
|
|
float delta_segments_per_second = SCARA_SEGMENTS_PER_SECOND, |
|
|
delta[ABC], |
|
|
delta[ABC]; |
|
|
axis_scaling[ABC] = { 1, 1, 1 }; // Build size scaling, default to 1
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
float cartes[XYZ] = { 0 }; |
|
|
float cartes[XYZ] = { 0 }; |
|
@ -5750,8 +5748,8 @@ inline void gcode_M303() { |
|
|
if (IsRunning()) { |
|
|
if (IsRunning()) { |
|
|
//gcode_get_destination(); // For X Y Z E F
|
|
|
//gcode_get_destination(); // For X Y Z E F
|
|
|
forward_kinematics_SCARA(delta_a, delta_b); |
|
|
forward_kinematics_SCARA(delta_a, delta_b); |
|
|
destination[X_AXIS] = cartes[X_AXIS] / axis_scaling[X_AXIS]; |
|
|
destination[X_AXIS] = cartes[X_AXIS]; |
|
|
destination[Y_AXIS] = cartes[Y_AXIS] / axis_scaling[Y_AXIS]; |
|
|
destination[Y_AXIS] = cartes[Y_AXIS]; |
|
|
destination[Z_AXIS] = current_position[Z_AXIS]; |
|
|
destination[Z_AXIS] = current_position[Z_AXIS]; |
|
|
prepare_move_to_destination(); |
|
|
prepare_move_to_destination(); |
|
|
//ok_to_send();
|
|
|
//ok_to_send();
|
|
@ -5800,15 +5798,6 @@ inline void gcode_M303() { |
|
|
return SCARA_move_to_cal(45, 135); |
|
|
return SCARA_move_to_cal(45, 135); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* M365: SCARA calibration: Scaling factor, X, Y, Z axis |
|
|
|
|
|
*/ |
|
|
|
|
|
inline void gcode_M365() { |
|
|
|
|
|
LOOP_XYZ(i) |
|
|
|
|
|
if (code_seen(axis_codes[i])) |
|
|
|
|
|
axis_scaling[i] = code_value_float(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // SCARA
|
|
|
#endif // SCARA
|
|
|
|
|
|
|
|
|
#if ENABLED(EXT_SOLENOID) |
|
|
#if ENABLED(EXT_SOLENOID) |
|
@ -7407,9 +7396,6 @@ void process_next_command() { |
|
|
case 364: // M364 SCARA Psi pos3 (90 deg to Theta)
|
|
|
case 364: // M364 SCARA Psi pos3 (90 deg to Theta)
|
|
|
if (gcode_M364()) return; |
|
|
if (gcode_M364()) return; |
|
|
break; |
|
|
break; |
|
|
case 365: // M365 Set SCARA scaling for X Y Z
|
|
|
|
|
|
gcode_M365(); |
|
|
|
|
|
break; |
|
|
|
|
|
#endif // SCARA
|
|
|
#endif // SCARA
|
|
|
|
|
|
|
|
|
case 400: // M400 finish all moves
|
|
|
case 400: // M400 finish all moves
|
|
@ -8359,8 +8345,8 @@ void prepare_move_to_destination() { |
|
|
|
|
|
|
|
|
static float C2, S2, SK1, SK2, THETA, PSI; |
|
|
static float C2, S2, SK1, SK2, THETA, PSI; |
|
|
|
|
|
|
|
|
float sx = RAW_X_POSITION(cartesian[X_AXIS]) * axis_scaling[X_AXIS] - SCARA_OFFSET_X, //Translate SCARA to standard X Y
|
|
|
float sx = RAW_X_POSITION(cartesian[X_AXIS]) - SCARA_OFFSET_X, //Translate SCARA to standard X Y
|
|
|
sy = RAW_Y_POSITION(cartesian[Y_AXIS]) * axis_scaling[Y_AXIS] - SCARA_OFFSET_Y; // With scaling factor.
|
|
|
sy = RAW_Y_POSITION(cartesian[Y_AXIS]) - SCARA_OFFSET_Y; // With scaling factor.
|
|
|
|
|
|
|
|
|
#if (L1 == L2) |
|
|
#if (L1 == L2) |
|
|
C2 = HYPOT2(sx, sy) / (2 * L1_2) - 1; |
|
|
C2 = HYPOT2(sx, sy) / (2 * L1_2) - 1; |
|
|