Using axis constants

This commit is contained in:
Scott Lahteine
2014-12-18 08:13:08 -08:00
parent 39b47ef5b0
commit 07c6b5ab71
8 changed files with 71 additions and 78 deletions

View File

@ -1537,7 +1537,7 @@ void process_commands()
#ifdef SCARA
current_position[X_AXIS]=code_value();
#else
current_position[X_AXIS]=code_value()+add_homing[0];
current_position[X_AXIS]=code_value()+add_homing[X_AXIS];
#endif
}
}
@ -1547,7 +1547,7 @@ void process_commands()
#ifdef SCARA
current_position[Y_AXIS]=code_value();
#else
current_position[Y_AXIS]=code_value()+add_homing[1];
current_position[Y_AXIS]=code_value()+add_homing[Y_AXIS];
#endif
}
}
@ -1612,7 +1612,7 @@ void process_commands()
if(code_seen(axis_codes[Z_AXIS])) {
if(code_value_long() != 0) {
current_position[Z_AXIS]=code_value()+add_homing[2];
current_position[Z_AXIS]=code_value()+add_homing[Z_AXIS];
}
}
#ifdef ENABLE_AUTO_BED_LEVELING
@ -2745,9 +2745,9 @@ Sigma_Exit:
SERIAL_PROTOCOLLN("");
SERIAL_PROTOCOLPGM("SCARA Cal - Theta:");
SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[0]);
SERIAL_PROTOCOL(delta[X_AXIS]+add_homing[X_AXIS]);
SERIAL_PROTOCOLPGM(" Psi+Theta (90):");
SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[1]);
SERIAL_PROTOCOL(delta[Y_AXIS]-delta[X_AXIS]-90+add_homing[Y_AXIS]);
SERIAL_PROTOCOLLN("");
SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
@ -2883,11 +2883,11 @@ Sigma_Exit:
#ifdef SCARA
if(code_seen('T')) // Theta
{
add_homing[0] = code_value() ;
add_homing[X_AXIS] = code_value() ;
}
if(code_seen('P')) // Psi
{
add_homing[1] = code_value() ;
add_homing[Y_AXIS] = code_value() ;
}
#endif
break;
@ -3275,11 +3275,11 @@ Sigma_Exit:
//SERIAL_ECHOLN(" Soft endstops disabled ");
if(Stopped == false) {
//get_coordinates(); // For X Y Z E F
delta[0] = 0;
delta[1] = 120;
delta[X_AXIS] = 0;
delta[Y_AXIS] = 120;
calculate_SCARA_forward_Transform(delta);
destination[0] = delta[0]/axis_scaling[X_AXIS];
destination[1] = delta[1]/axis_scaling[Y_AXIS];
destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
prepare_move();
//ClearToSend();
@ -3293,11 +3293,11 @@ Sigma_Exit:
//SERIAL_ECHOLN(" Soft endstops disabled ");
if(Stopped == false) {
//get_coordinates(); // For X Y Z E F
delta[0] = 90;
delta[1] = 130;
delta[X_AXIS] = 90;
delta[Y_AXIS] = 130;
calculate_SCARA_forward_Transform(delta);
destination[0] = delta[0]/axis_scaling[X_AXIS];
destination[1] = delta[1]/axis_scaling[Y_AXIS];
destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
prepare_move();
//ClearToSend();
@ -3310,11 +3310,11 @@ Sigma_Exit:
//SERIAL_ECHOLN(" Soft endstops disabled ");
if(Stopped == false) {
//get_coordinates(); // For X Y Z E F
delta[0] = 60;
delta[1] = 180;
delta[X_AXIS] = 60;
delta[Y_AXIS] = 180;
calculate_SCARA_forward_Transform(delta);
destination[0] = delta[0]/axis_scaling[X_AXIS];
destination[1] = delta[1]/axis_scaling[Y_AXIS];
destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
prepare_move();
//ClearToSend();
@ -3327,11 +3327,11 @@ Sigma_Exit:
//SERIAL_ECHOLN(" Soft endstops disabled ");
if(Stopped == false) {
//get_coordinates(); // For X Y Z E F
delta[0] = 50;
delta[1] = 90;
delta[X_AXIS] = 50;
delta[Y_AXIS] = 90;
calculate_SCARA_forward_Transform(delta);
destination[0] = delta[0]/axis_scaling[X_AXIS];
destination[1] = delta[1]/axis_scaling[Y_AXIS];
destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
prepare_move();
//ClearToSend();
@ -3344,11 +3344,11 @@ Sigma_Exit:
//SERIAL_ECHOLN(" Soft endstops disabled ");
if(Stopped == false) {
//get_coordinates(); // For X Y Z E F
delta[0] = 45;
delta[1] = 135;
delta[X_AXIS] = 45;
delta[Y_AXIS] = 135;
calculate_SCARA_forward_Transform(delta);
destination[0] = delta[0]/axis_scaling[X_AXIS];
destination[1] = delta[1]/axis_scaling[Y_AXIS];
destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
prepare_move();
//ClearToSend();
@ -4020,9 +4020,9 @@ for (int s = 1; s <= steps; s++) {
calculate_delta(destination);
//SERIAL_ECHOPGM("destination[0]="); SERIAL_ECHOLN(destination[0]);
//SERIAL_ECHOPGM("destination[1]="); SERIAL_ECHOLN(destination[1]);
//SERIAL_ECHOPGM("destination[2]="); SERIAL_ECHOLN(destination[2]);
//SERIAL_ECHOPGM("destination[X_AXIS]="); SERIAL_ECHOLN(destination[X_AXIS]);
//SERIAL_ECHOPGM("destination[Y_AXIS]="); SERIAL_ECHOLN(destination[Y_AXIS]);
//SERIAL_ECHOPGM("destination[Z_AXIS]="); SERIAL_ECHOLN(destination[Z_AXIS]);
//SERIAL_ECHOPGM("delta[X_AXIS]="); SERIAL_ECHOLN(delta[X_AXIS]);
//SERIAL_ECHOPGM("delta[Y_AXIS]="); SERIAL_ECHOLN(delta[Y_AXIS]);
//SERIAL_ECHOPGM("delta[Z_AXIS]="); SERIAL_ECHOLN(delta[Z_AXIS]);