diff --git a/config.default.h b/config.default.h index 9628e1c..4be4df2 100644 --- a/config.default.h +++ b/config.default.h @@ -64,11 +64,11 @@ valid range = 20 to 4'0960'000 (0.02 to 40960 steps/mm) */ #define STEPS_PER_M_X 320000 -#define STEPS_PER_MM_Y 320.000 -#define STEPS_PER_MM_Z 320.000 +#define STEPS_PER_M_Y 320000 +#define STEPS_PER_M_Z 320000 /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E 320.000 +#define STEPS_PER_M_E 320000 /* diff --git a/config.gen3.h b/config.gen3.h index 78b6e03..72a4b2e 100644 --- a/config.gen3.h +++ b/config.gen3.h @@ -61,11 +61,11 @@ valid range = 20 to 4'0960'000 (0.02 to 40960 steps/mm) */ #define STEPS_PER_M_X 320000 -#define STEPS_PER_MM_Y 320.000 -#define STEPS_PER_MM_Z 200.000 +#define STEPS_PER_M_Y 320000 +#define STEPS_PER_M_Z 200000 /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E 320.000 +#define STEPS_PER_M_E 320000 /* diff --git a/config.gen6.h b/config.gen6.h index 0f0f427..2ae4631 100644 --- a/config.gen6.h +++ b/config.gen6.h @@ -66,11 +66,11 @@ valid range = 20 to 4'0960'000 (0.02 to 40960 steps/mm) */ #define STEPS_PER_M_X (5000*8) -#define STEPS_PER_MM_Y (320.000*8) -#define STEPS_PER_MM_Z (200.000*8) +#define STEPS_PER_M_Y (5000*8) +#define STEPS_PER_M_Z (160000*8) /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E (320.000*8) +#define STEPS_PER_M_E (160000*8) /* diff --git a/config.gen7.h b/config.gen7.h index 0e71914..9ce617a 100644 --- a/config.gen7.h +++ b/config.gen7.h @@ -69,11 +69,11 @@ valid range = 20 to 4'0960'000 (0.02 to 40960 steps/mm) */ #define STEPS_PER_M_X 40000 -#define STEPS_PER_MM_Y 40.000 -#define STEPS_PER_MM_Z 320.000 +#define STEPS_PER_M_Y 40000 +#define STEPS_PER_M_Z 320000 /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E 96.271 +#define STEPS_PER_M_E 96271 /* diff --git a/config.ramps-v1.2.h b/config.ramps-v1.2.h index af3fc96..ce5b583 100644 --- a/config.ramps-v1.2.h +++ b/config.ramps-v1.2.h @@ -71,11 +71,11 @@ #define MICROSTEPPING_E 4.0 #define STEPS_PER_M_X (5023*MICROSTEPPING_X) -#define STEPS_PER_MM_Y (5.023*MICROSTEPPING_Y) -#define STEPS_PER_MM_Z (416.699*MICROSTEPPING_Z) +#define STEPS_PER_M_Y (5023*MICROSTEPPING_Y) +#define STEPS_PER_M_Z (416699*MICROSTEPPING_Z) /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E (2.759*MICROSTEPPING_E) +#define STEPS_PER_M_E (2759*MICROSTEPPING_E) /* diff --git a/config.ramps-v1.3.h b/config.ramps-v1.3.h index c0a9a96..ba79455 100644 --- a/config.ramps-v1.3.h +++ b/config.ramps-v1.3.h @@ -71,11 +71,11 @@ #define MICROSTEPPING_E 4.0 #define STEPS_PER_M_X (5023*MICROSTEPPING_X) -#define STEPS_PER_MM_Y (5.023*MICROSTEPPING_Y) -#define STEPS_PER_MM_Z (416.699*MICROSTEPPING_Z) +#define STEPS_PER_M_Y (5023*MICROSTEPPING_Y) +#define STEPS_PER_M_Z (416699*MICROSTEPPING_Z) /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E (2.759*MICROSTEPPING_E) +#define STEPS_PER_M_E (2759*MICROSTEPPING_E) /* diff --git a/config.sanguinololu-v1.1.h b/config.sanguinololu-v1.1.h index 6806c5b..227577c 100644 --- a/config.sanguinololu-v1.1.h +++ b/config.sanguinololu-v1.1.h @@ -70,11 +70,11 @@ #define MICROSTEPPING_E 4.0 #define STEPS_PER_M_X (5023*MICROSTEPPING_X) -#define STEPS_PER_MM_Y (5.023*MICROSTEPPING_Y) -#define STEPS_PER_MM_Z (416.699*MICROSTEPPING_Z) +#define STEPS_PER_M_Y (5023*MICROSTEPPING_Y) +#define STEPS_PER_M_Z (416699*MICROSTEPPING_Z) /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E (2.759*MICROSTEPPING_E) +#define STEPS_PER_M_E (2759*MICROSTEPPING_E) /* diff --git a/config.sanguinololu-v1.2.h b/config.sanguinololu-v1.2.h index 86e17ae..9b51e42 100644 --- a/config.sanguinololu-v1.2.h +++ b/config.sanguinololu-v1.2.h @@ -70,11 +70,11 @@ #define MICROSTEPPING_E 4.0 #define STEPS_PER_M_X (5023*MICROSTEPPING_X) -#define STEPS_PER_MM_Y (5.023*MICROSTEPPING_Y) -#define STEPS_PER_MM_Z (416.699*MICROSTEPPING_Z) +#define STEPS_PER_M_Y (5023*MICROSTEPPING_Y) +#define STEPS_PER_M_Z (416699*MICROSTEPPING_Z) /// http://blog.arcol.hu/?p=157 may help with this one -#define STEPS_PER_MM_E (2.759*MICROSTEPPING_E) +#define STEPS_PER_M_E (2759*MICROSTEPPING_E) /* diff --git a/dda.c b/dda.c index 9a70e89..292b439 100644 --- a/dda.c +++ b/dda.c @@ -24,8 +24,8 @@ #include "heater.h" #endif -#ifdef STEPS_PER_MM_X -#error STEPS_PER_MM_X is gone, review your config.h and use STEPS_PER_M_X +#ifdef STEPS_PER_MM_Y +#error STEPS_PER_MM_Y is gone, review your config.h and use STEPS_PER_M_Y #endif /// step timeout @@ -192,6 +192,9 @@ void dda_init(void) { */ void dda_new_startpoint(void) { um_to_steps_x(startpoint_steps.X, startpoint.X); + um_to_steps_y(startpoint_steps.Y, startpoint.Y); + um_to_steps_z(startpoint_steps.Z, startpoint.Z); + um_to_steps_e(startpoint_steps.E, startpoint.E); } /*! CREATE a dda given current_position and a target, save to passed location so we can write directly into the queue @@ -207,7 +210,7 @@ void dda_new_startpoint(void) { This algorithm is probably the main limiting factor to print speed in terms of firmware limitations */ void dda_create(DDA *dda, TARGET *target) { - uint32_t steps, x_delta_um /*, y_delta_um, z_delta_um, e_delta_um */; + uint32_t steps, x_delta_um, y_delta_um, z_delta_um, e_delta_um; uint32_t distance, c_limit, c_limit_calc; // initialise DDA to a known state @@ -220,14 +223,22 @@ void dda_create(DDA *dda, TARGET *target) { memcpy(&(dda->endpoint), target, sizeof(TARGET)); x_delta_um = (uint32_t)labs(target->X - startpoint.X); + y_delta_um = (uint32_t)labs(target->Y - startpoint.Y); + z_delta_um = (uint32_t)labs(target->Z - startpoint.Z); + e_delta_um = (uint32_t)labs(target->E - startpoint.E); um_to_steps_x(steps, target->X); dda->x_delta = labs(steps - startpoint_steps.X); startpoint_steps.X = steps; - - dda->y_delta = labs(target->Y - startpoint.Y); - dda->z_delta = labs(target->Z - startpoint.Z); - dda->e_delta = labs(target->E - startpoint.E); + um_to_steps_y(steps, target->Y); + dda->y_delta = labs(steps - startpoint_steps.Y); + startpoint_steps.Y = steps; + um_to_steps_z(steps, target->Z); + dda->z_delta = labs(steps - startpoint_steps.Z); + startpoint_steps.Z = steps; + um_to_steps_e(steps, target->E); + dda->e_delta = labs(steps - startpoint_steps.E); + startpoint_steps.E = steps; dda->x_direction = (target->X >= startpoint.X)?1:0; dda->y_direction = (target->Y >= startpoint.Y)?1:0; @@ -262,15 +273,15 @@ void dda_create(DDA *dda, TARGET *target) { e_enable(); // since it's unusual to combine X, Y and Z changes in a single move on reprap, check if we can use simpler approximations before trying the full 3d approximation. - if (dda->z_delta == 0) - distance = approx_distance(x_delta_um, dda->y_delta * UM_PER_STEP_Y); - else if (dda->x_delta == 0 && dda->y_delta == 0) - distance = dda->z_delta * UM_PER_STEP_Z; + if (z_delta_um == 0) + distance = approx_distance(x_delta_um, y_delta_um); + else if (x_delta_um == 0 && y_delta_um == 0) + distance = z_delta_um; else - distance = approx_distance_3(x_delta_um, dda->y_delta * UM_PER_STEP_Y, dda->z_delta * UM_PER_STEP_Z); + distance = approx_distance_3(x_delta_um, y_delta_um, z_delta_um); if (distance < 2) - distance = dda->e_delta * UM_PER_STEP_E; + distance = e_delta_um; if (DEBUG_DDA && (debug_flags & DEBUG_DDA)) sersendf_P(PSTR(",ds:%lu"), distance); @@ -305,15 +316,15 @@ void dda_create(DDA *dda, TARGET *target) { if (c_limit_calc > c_limit) c_limit = c_limit_calc; // check Y axis - c_limit_calc = ( (dda->y_delta * (UM_PER_STEP_Y * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Y) << 8; + c_limit_calc = ((y_delta_um * 2400L) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Y) << 8; if (c_limit_calc > c_limit) c_limit = c_limit_calc; // check Z axis - c_limit_calc = ( (dda->z_delta * (UM_PER_STEP_Z * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Z) << 8; + c_limit_calc = ((z_delta_um * 2400L) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Z) << 8; if (c_limit_calc > c_limit) c_limit = c_limit_calc; // check E axis - c_limit_calc = ( (dda->e_delta * (UM_PER_STEP_E * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_E) << 8; + c_limit_calc = ((e_delta_um * 2400L) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_E) << 8; if (c_limit_calc > c_limit) c_limit = c_limit_calc; @@ -735,22 +746,28 @@ void update_current_position() { move_state.x_steps * 1000 / ((STEPS_PER_M_X + 500) / 1000); if (dda->y_direction) - current_position.Y = dda->endpoint.Y - move_state.y_steps; + current_position.Y = dda->endpoint.Y - + move_state.y_steps * 1000 / ((STEPS_PER_M_Y + 500) / 1000); else - current_position.Y = dda->endpoint.Y + move_state.y_steps; + current_position.Y = dda->endpoint.Y + + move_state.y_steps * 1000 / ((STEPS_PER_M_Y + 500) / 1000); if (dda->z_direction) - current_position.Z = dda->endpoint.Z - move_state.z_steps; + current_position.Z = dda->endpoint.Z - + move_state.z_steps * 1000 / ((STEPS_PER_M_Z + 500) / 1000); else - current_position.Z = dda->endpoint.Z + move_state.z_steps; + current_position.Z = dda->endpoint.Z + + move_state.z_steps * 1000 / ((STEPS_PER_M_Z + 500) / 1000); #ifndef E_ABSOLUTE - current_position.E = move_state.e_steps; + current_position.E = move_state.e_steps * 1000 / ((STEPS_PER_M_E + 500) / 1000); #else - if (dda->e_direction) - current_position.E = dda->endpoint.E - move_state.e_steps; + if (dda->z_direction) + current_position.E = dda->endpoint.E - + move_state.e_steps * 1000 / ((STEPS_PER_M_E + 500) / 1000); else - current_position.E = dda->endpoint.E + move_state.e_steps; + current_position.E = dda->endpoint.E + + move_state.e_steps * 1000 / ((STEPS_PER_M_E + 500) / 1000); #endif // current_position.F is updated in dda_start() diff --git a/dda.h b/dda.h index 7a5f206..ef4bc0f 100644 --- a/dda.h +++ b/dda.h @@ -28,13 +28,57 @@ do { dest = (src * (STEPS_PER_M_X / 1L) + 500000L) / 1000000L; } while (0) #endif -// Used in distance calculation during DDA setup -/// micrometers per step Y -#define UM_PER_STEP_Y 1000L / ((uint32_t) STEPS_PER_MM_Y) -/// micrometers per step Z -#define UM_PER_STEP_Z 1000L / ((uint32_t) STEPS_PER_MM_Z) -/// micrometers per step E -#define UM_PER_STEP_E 1000L / ((uint32_t) STEPS_PER_MM_E) +#if STEPS_PER_M_Y >= 4096000 + #define um_to_steps_y(dest, src) \ + do { dest = (src * (STEPS_PER_M_Y / 10000L) + 50L) / 100L; } while (0) +#elif STEPS_PER_M_Y >= 409600 + #define um_to_steps_y(dest, src) \ + do { dest = (src * (STEPS_PER_M_Y / 1000L) + 500L) / 1000L; } while (0) +#elif STEPS_PER_M_Y >= 40960 + #define um_to_steps_y(dest, src) \ + do { dest = (src * (STEPS_PER_M_Y / 100L) + 5000L) / 10000L; } while (0) +#elif STEPS_PER_M_Y >= 4096 + #define um_to_steps_y(dest, src) \ + do { dest = (src * (STEPS_PER_M_Y / 10L) + 50000L) / 100000L; } while (0) +#else + #define um_to_steps_y(dest, src) \ + do { dest = (src * (STEPS_PER_M_Y / 1L) + 500000L) / 1000000L; } while (0) +#endif + +#if STEPS_PER_M_Z >= 4096000 + #define um_to_steps_z(dest, src) \ + do { dest = (src * (STEPS_PER_M_Z / 10000L) + 50L) / 100L; } while (0) +#elif STEPS_PER_M_Z >= 409600 + #define um_to_steps_z(dest, src) \ + do { dest = (src * (STEPS_PER_M_Z / 1000L) + 500L) / 1000L; } while (0) +#elif STEPS_PER_M_Z >= 40960 + #define um_to_steps_z(dest, src) \ + do { dest = (src * (STEPS_PER_M_Z / 100L) + 5000L) / 10000L; } while (0) +#elif STEPS_PER_M_Z >= 4096 + #define um_to_steps_z(dest, src) \ + do { dest = (src * (STEPS_PER_M_Z / 10L) + 50000L) / 100000L; } while (0) +#else + #define um_to_steps_z(dest, src) \ + do { dest = (src * (STEPS_PER_M_Z / 1L) + 500000L) / 1000000L; } while (0) +#endif + +#if STEPS_PER_M_E >= 4096000 + #define um_to_steps_e(dest, src) \ + do { dest = (src * (STEPS_PER_M_E / 10000L) + 50L) / 100L; } while (0) +#elif STEPS_PER_M_E >= 409600 + #define um_to_steps_e(dest, src) \ + do { dest = (src * (STEPS_PER_M_E / 1000L) + 500L) / 1000L; } while (0) +#elif STEPS_PER_M_E >= 40960 + #define um_to_steps_e(dest, src) \ + do { dest = (src * (STEPS_PER_M_E / 100L) + 5000L) / 10000L; } while (0) +#elif STEPS_PER_M_E >= 4096 + #define um_to_steps_e(dest, src) \ + do { dest = (src * (STEPS_PER_M_E / 10L) + 50000L) / 100000L; } while (0) +#else + #define um_to_steps_e(dest, src) \ + do { dest = (src * (STEPS_PER_M_E / 1L) + 500000L) / 1000000L; } while (0) +#endif + #ifdef ACCELERATION_REPRAP #ifdef ACCELERATION_RAMPING diff --git a/gcode_parse.c b/gcode_parse.c index 26d9ab1..43df42e 100644 --- a/gcode_parse.c +++ b/gcode_parse.c @@ -15,32 +15,6 @@ #include "gcode_process.h" -/* - Switch user friendly values to coding friendly values - - This also affects the possible build volume. We have +/- 2^31 numbers available and as we internally measure position in steps and use a precision factor of 1000, this translates into a possible range of - - 2^31 mm / STEPS_PER_MM_x / 1000 - - for each axis. For a M6 threaded rod driven machine and 1/16 microstepping this evaluates to - - 2^31 mm / 200 / 16 / 1000 = 671 mm, - - which is about the worst case we have. All other machines have a bigger build volume. -*/ - -#define STEPS_PER_M_Y ((uint32_t) ((STEPS_PER_MM_Y * 1000.0) + 0.5)) -#define STEPS_PER_M_Z ((uint32_t) ((STEPS_PER_MM_Z * 1000.0) + 0.5)) -#define STEPS_PER_M_E ((uint32_t) ((STEPS_PER_MM_E * 1000.0) + 0.5)) - -/* - mm -> inch conversion -*/ - -#define STEPS_PER_IN_Y ((uint32_t) ((25.4 * STEPS_PER_MM_Y) + 0.5)) -#define STEPS_PER_IN_Z ((uint32_t) ((25.4 * STEPS_PER_MM_Z) + 0.5)) -#define STEPS_PER_IN_E ((uint32_t) ((25.4 * STEPS_PER_MM_E) + 0.5)) - /// current or previous gcode word /// for working out what to do with data just received uint8_t last_field = 0; @@ -145,25 +119,25 @@ void gcode_parse_char(uint8_t c) { break; case 'Y': if (next_target.option_inches) - next_target.target.Y = decfloat_to_int(&read_digit, STEPS_PER_IN_Y, 0); + next_target.target.Y = decfloat_to_int(&read_digit, 25400, 1); else - next_target.target.Y = decfloat_to_int(&read_digit, STEPS_PER_M_Y, 1); + next_target.target.Y = decfloat_to_int(&read_digit, 1000, 0); if (DEBUG_ECHO && (debug_flags & DEBUG_ECHO)) serwrite_int32(next_target.target.Y); break; case 'Z': if (next_target.option_inches) - next_target.target.Z = decfloat_to_int(&read_digit, STEPS_PER_IN_Z, 0); + next_target.target.Z = decfloat_to_int(&read_digit, 25400, 1); else - next_target.target.Z = decfloat_to_int(&read_digit, STEPS_PER_M_Z, 1); + next_target.target.Z = decfloat_to_int(&read_digit, 1000, 0); if (DEBUG_ECHO && (debug_flags & DEBUG_ECHO)) serwrite_int32(next_target.target.Z); break; case 'E': if (next_target.option_inches) - next_target.target.E = decfloat_to_int(&read_digit, STEPS_PER_IN_E, 0); + next_target.target.E = decfloat_to_int(&read_digit, 25400, 1); else - next_target.target.E = decfloat_to_int(&read_digit, STEPS_PER_M_E, 1); + next_target.target.E = decfloat_to_int(&read_digit, 1000, 0); if (DEBUG_ECHO && (debug_flags & DEBUG_ECHO)) serwrite_uint32(next_target.target.E); break; diff --git a/gcode_process.c b/gcode_process.c index 546cf0c..aa674c3 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -82,24 +82,24 @@ void process_gcode_command() { next_target.target.X = X_MIN * 1000.; #endif #ifdef X_MAX - if (next_target.target.X > X_MAX * 1000.)) + if (next_target.target.X > X_MAX * 1000.) next_target.target.X = X_MAX * 1000.; #endif #ifdef Y_MIN - if (next_target.target.Y < (Y_MIN * STEPS_PER_MM_Y)) - next_target.target.Y = Y_MIN * STEPS_PER_MM_Y; + if (next_target.target.Y < Y_MIN * 1000.) + next_target.target.Y = Y_MIN * 1000.; #endif #ifdef Y_MAX - if (next_target.target.Y > (Y_MAX * STEPS_PER_MM_Y)) - next_target.target.Y = Y_MAX * STEPS_PER_MM_Y; + if (next_target.target.Y > Y_MAX * 1000.) + next_target.target.Y = Y_MAX * 1000.; #endif #ifdef Z_MIN - if (next_target.target.Z < (Z_MIN * STEPS_PER_MM_Z)) - next_target.target.Z = Z_MIN * STEPS_PER_MM_Z; + if (next_target.target.Z < Z_MIN * 1000.) + next_target.target.Z = Z_MIN * 1000.; #endif #ifdef Z_MAX - if (next_target.target.Z > (Z_MAX * STEPS_PER_MM_Z)) - next_target.target.Z = Z_MAX * STEPS_PER_MM_Z; + if (next_target.target.Z > Z_MAX * 1000.) + next_target.target.Z = Z_MAX * 1000.; #endif @@ -578,7 +578,7 @@ void process_gcode_command() { queue_wait(); #endif update_current_position(); - sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%ld"), current_position.X, current_position.Y * ((int32_t) UM_PER_STEP_Y), current_position.Z * ((int32_t) UM_PER_STEP_Z), current_position.E * ((int32_t) UM_PER_STEP_E), current_position.F); + sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%ld"), current_position.X, current_position.Y, current_position.Z, current_position.E, current_position.F); // newline is sent from gcode_parse after we return break; diff --git a/home.c b/home.c index bb9d6f1..684397b 100644 --- a/home.c +++ b/home.c @@ -92,7 +92,7 @@ void home_x_positive() { // set X home queue_wait(); // set position to MAX - startpoint.X = next_target.target.X = (int32_t)(X_MAX * 1000.0); + startpoint.X = next_target.target.X = (int32_t)(X_MAX * 1000.); dda_new_startpoint(); // go to zero t.X = 0; @@ -106,7 +106,7 @@ void home_y_negative() { #if defined Y_MIN_PIN TARGET t = startpoint; - t.Y = -1000*STEPS_PER_MM_Y; + t.Y = -1000000; #ifdef SLOW_HOMING // hit home soft t.F = SEARCH_FEEDRATE_Y; @@ -118,7 +118,7 @@ void home_y_negative() { #ifndef SLOW_HOMING // back off slowly - t.Y = +1000*STEPS_PER_MM_Y; + t.Y = +1000000; t.F = SEARCH_FEEDRATE_Y; enqueue_home(&t, 0x2, 0); #endif @@ -126,7 +126,7 @@ void home_y_negative() { // set Y home queue_wait(); #ifdef Y_MIN - startpoint.Y = next_target.target.Y = (int32_t)(Y_MIN * STEPS_PER_MM_Y); + startpoint.Y = next_target.target.Y = (int32_t)(Y_MIN * 1000.); #else startpoint.Y = next_target.target.Y = 0; #endif @@ -142,7 +142,7 @@ void home_y_positive() { #if defined Y_MAX_PIN && defined Y_MAX TARGET t = startpoint; - t.Y = +1000*STEPS_PER_MM_Y; + t.Y = +1000000; #ifdef SLOW_HOMING // hit home soft t.F = SEARCH_FEEDRATE_Y; @@ -154,7 +154,7 @@ void home_y_positive() { #ifndef SLOW_HOMING // back off slowly - t.X = -1000*STEPS_PER_MM_Y; + t.X = -1000000; t.F = SEARCH_FEEDRATE_Y; enqueue_home(&t, 0x2, 0); #endif @@ -162,7 +162,7 @@ void home_y_positive() { // set Y home queue_wait(); // set position to MAX - startpoint.Y = next_target.target.Y = (int32_t)(Y_MAX * STEPS_PER_MM_Y); + startpoint.Y = next_target.target.Y = (int32_t)(Y_MAX * 1000.); new_startpoint(); // go to zero t.Y = 0; @@ -176,7 +176,7 @@ void home_z_negative() { #if defined Z_MIN_PIN TARGET t = startpoint; - t.Z = -1000*STEPS_PER_MM_Z; + t.Z = -1000000; #ifdef SLOW_HOMING // hit home soft t.F = SEARCH_FEEDRATE_Z; @@ -188,7 +188,7 @@ void home_z_negative() { #ifndef SLOW_HOMING // back off slowly - t.Z = +1000*STEPS_PER_MM_Z; + t.Z = +1000000; t.F = SEARCH_FEEDRATE_Z; enqueue_home(&t, 0x4, 0); #endif @@ -196,7 +196,7 @@ void home_z_negative() { // set Z home queue_wait(); #ifdef Z_MIN - startpoint.Z = next_target.target.Z = (int32_t)(Z_MIN * STEPS_PER_MM_Z); + startpoint.Z = next_target.target.Z = (int32_t)(Z_MIN * 1000.); #else startpoint.Z = next_target.target.Z = 0; #endif @@ -213,7 +213,7 @@ void home_z_positive() { #if defined Z_MAX_PIN && defined Z_MAX TARGET t = startpoint; - t.Z = +1000*STEPS_PER_MM_Z; + t.Z = +1000000; #ifdef SLOW_HOMING // hit home soft t.F = SEARCH_FEEDRATE_Z; @@ -225,7 +225,7 @@ void home_z_positive() { #ifndef SLOW_HOMING // back off slowly - t.Z = -1000*STEPS_PER_MM_Z; + t.Z = -1000000; t.F = SEARCH_FEEDRATE_Z; enqueue_home(&t, 0x4, 0); #endif @@ -233,7 +233,7 @@ void home_z_positive() { // set Z home queue_wait(); // set position to MAX - startpoint.Z = next_target.target.Z = (int32_t)(Z_MAX * STEPS_PER_MM_Z); + startpoint.Z = next_target.target.Z = (int32_t)(Z_MAX * 1000.); dda_new_startpoint(); // go to zero t.Z = 0;