Skip to content

Commit

Permalink
Merge pull request #4045 from thinkyhead/rc_max_feedrate_is_mm_s
Browse files Browse the repository at this point in the history
Fix feedrate in gcode_T (max_feedrate is mm/s)
  • Loading branch information
thinkyhead authored Jun 16, 2016
2 parents 9030cee + ef3bef6 commit c42b136
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6633,11 +6633,13 @@ inline void gcode_T(uint8_t tmp_extruder) {
if (next_feedrate > 0.0) stored_feedrate = feedrate = next_feedrate;
}
else {
#ifdef XY_TRAVEL_SPEED
feedrate = XY_TRAVEL_SPEED;
#else
feedrate = min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]);
#endif
feedrate =
#ifdef XY_TRAVEL_SPEED
XY_TRAVEL_SPEED
#else
min(planner.max_feedrate[X_AXIS], planner.max_feedrate[Y_AXIS]) * 60
#endif
;
}

if (tmp_extruder != active_extruder) {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ block_t Planner::block_buffer[BLOCK_BUFFER_SIZE];
volatile uint8_t Planner::block_buffer_head = 0; // Index of the next block to be pushed
volatile uint8_t Planner::block_buffer_tail = 0;

float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per second
float Planner::axis_steps_per_mm[NUM_AXIS];
unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS];
unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
Expand Down
2 changes: 1 addition & 1 deletion Marlin/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class Planner {
static volatile uint8_t block_buffer_head; // Index of the next block to be pushed
static volatile uint8_t block_buffer_tail;

static float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
static float max_feedrate[NUM_AXIS]; // Max speeds in mm per second
static float axis_steps_per_mm[NUM_AXIS];
static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
Expand Down

0 comments on commit c42b136

Please sign in to comment.