UM_PER_STEP stayed floating a bit too long
This commit is contained in:
parent
18565b776f
commit
dd8a5cd377
16
dda.c
16
dda.c
|
|
@ -70,10 +70,10 @@
|
|||
/*
|
||||
Used in distance calculation during DDA setup
|
||||
*/
|
||||
#define UM_PER_STEP_X 1000.0 / STEPS_PER_MM_X
|
||||
#define UM_PER_STEP_Y 1000.0 / STEPS_PER_MM_Y
|
||||
#define UM_PER_STEP_Z 1000.0 / STEPS_PER_MM_Z
|
||||
#define UM_PER_STEP_E 1000.0 / STEPS_PER_MM_E
|
||||
#define UM_PER_STEP_X 1000L / ((uint32_t) STEPS_PER_MM_X)
|
||||
#define UM_PER_STEP_Y 1000L / ((uint32_t) STEPS_PER_MM_Y)
|
||||
#define UM_PER_STEP_Z 1000L / ((uint32_t) STEPS_PER_MM_Z)
|
||||
#define UM_PER_STEP_E 1000L / ((uint32_t) STEPS_PER_MM_E)
|
||||
|
||||
/*
|
||||
Maths
|
||||
|
|
@ -271,16 +271,16 @@ void dda_create(DDA *dda, TARGET *target) {
|
|||
// similarly, find out how fast we can run our axes.
|
||||
// do this for each axis individually, as the combined speed of two or more axes can be higher than the capabilities of a single one.
|
||||
c_limit = 0;
|
||||
c_limit_calc = ((uint32_t) ((dda->x_delta * UM_PER_STEP_X * 2400) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_X)) << 8;
|
||||
c_limit_calc = ( (dda->x_delta * (UM_PER_STEP_X * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_X) << 8;
|
||||
if (c_limit_calc > c_limit)
|
||||
c_limit = c_limit_calc;
|
||||
c_limit_calc = ((uint32_t) ((dda->y_delta * UM_PER_STEP_Y * 2400) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Y)) << 8;
|
||||
c_limit_calc = ( (dda->y_delta * (UM_PER_STEP_Y * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Y) << 8;
|
||||
if (c_limit_calc > c_limit)
|
||||
c_limit = c_limit_calc;
|
||||
c_limit_calc = ((uint32_t) ((dda->z_delta * UM_PER_STEP_Z * 2400) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Z)) << 8;
|
||||
c_limit_calc = ( (dda->z_delta * (UM_PER_STEP_Z * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_Z) << 8;
|
||||
if (c_limit_calc > c_limit)
|
||||
c_limit = c_limit_calc;
|
||||
c_limit_calc = ((uint32_t) ((dda->e_delta * UM_PER_STEP_E * 2400) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_E)) << 8;
|
||||
c_limit_calc = ( (dda->e_delta * (UM_PER_STEP_E * 2400L)) / dda->total_steps * (F_CPU / 40000) / MAXIMUM_FEEDRATE_E) << 8;
|
||||
if (c_limit_calc > c_limit)
|
||||
c_limit = c_limit_calc;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue