diff --git a/config.h b/config.h index 2b22b77..7ee1d9d 100644 --- a/config.h +++ b/config.h @@ -23,17 +23,17 @@ #define VERSION "0.0" -#define X_STEPS_PER_MM 2.0 -#define Y_STEPS_PER_MM 2.0 -#define Z_STEPS_PER_MM 2.0 +#define X_STEPS_PER_MM 128.0 +#define Y_STEPS_PER_MM 128.0 +#define Z_STEPS_PER_MM 128.0 #define INCHES_PER_MM 25.4 #define X_STEPS_PER_INCH X_STEPS_PER_MM*INCHES_PER_MM #define Y_STEPS_PER_INCH Y_STEPS_PER_MM*INCHES_PER_MM #define Z_STEPS_PER_INCH Z_STEPS_PER_MM*INCHES_PER_MM -#define RAPID_FEEDRATE 200000.0 // in millimeters per minute -#define DEFAULT_FEEDRATE 200000.0 +#define RAPID_FEEDRATE 960.0 // in millimeters per minute +#define DEFAULT_FEEDRATE 960.0 #define STEPPERS_ENABLE_DDR DDRB #define STEPPERS_ENABLE_PORT PORTB diff --git a/motion_control.c b/motion_control.c index 70fe298..9d4c2dc 100644 --- a/motion_control.c +++ b/motion_control.c @@ -70,7 +70,8 @@ void compute_and_set_step_pace(double feed_rate, double millimeters_of_travel, u if (invert) { pace = round(ONE_MINUTE_OF_MICROSECONDS/feed_rate/steps); } else { - pace = round(((millimeters_of_travel * ONE_MINUTE_OF_MICROSECONDS) / feed_rate) / steps); + pace = round((ONE_MINUTE_OF_MICROSECONDS/X_STEPS_PER_MM)/feed_rate); + //pace = round(((millimeters_of_travel * ONE_MINUTE_OF_MICROSECONDS) / feed_rate) / steps); } st_buffer_pace(pace); }