mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-03 03:13:25 +02:00
Fixed homing rate bug
This commit is contained in:
@@ -200,8 +200,8 @@ void limits_go_home(uint8_t cycle_mask, uint n_locate_cycles) {
|
|||||||
|
|
||||||
sys.homing_axis_lock = axislock;
|
sys.homing_axis_lock = axislock;
|
||||||
// Perform homing cycle. Planner buffer should be empty, as required to initiate the homing cycle.
|
// Perform homing cycle. Planner buffer should be empty, as required to initiate the homing cycle.
|
||||||
pl_data->feed_rate = // Set current homing rate.
|
pl_data->feed_rate = homing_rate;
|
||||||
plan_buffer_line(target, pl_data); // Bypass mc_line(). Directly plan homing motion.
|
plan_buffer_line(target, pl_data); // Bypass mc_line(). Directly plan homing motion.
|
||||||
sys.step_control = {};
|
sys.step_control = {};
|
||||||
sys.step_control.executeSysMotion = true; // Set to execute homing motion and clear existing flags.
|
sys.step_control.executeSysMotion = true; // Set to execute homing motion and clear existing flags.
|
||||||
st_prep_buffer(); // Prep and fill segment buffer from newly planned block.
|
st_prep_buffer(); // Prep and fill segment buffer from newly planned block.
|
||||||
|
@@ -298,7 +298,7 @@ void plan_update_velocity_profile_parameters() {
|
|||||||
pl.previous_nominal_speed = prev_nominal_speed; // Update prev nominal speed for next incoming block.
|
pl.previous_nominal_speed = prev_nominal_speed; // Update prev nominal speed for next incoming block.
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t plan_buffer_line(float* target, plan_line_data_t* pl_data) {
|
bool plan_buffer_line(float* target, plan_line_data_t* pl_data) {
|
||||||
// Prepare and initialize new block. Copy relevant pl_data for block execution.
|
// Prepare and initialize new block. Copy relevant pl_data for block execution.
|
||||||
plan_block_t* block = &block_buffer[block_buffer_head];
|
plan_block_t* block = &block_buffer[block_buffer_head];
|
||||||
memset(block, 0, sizeof(plan_block_t)); // Zero all block values.
|
memset(block, 0, sizeof(plan_block_t)); // Zero all block values.
|
||||||
@@ -336,7 +336,7 @@ uint8_t plan_buffer_line(float* target, plan_line_data_t* pl_data) {
|
|||||||
}
|
}
|
||||||
// Bail if this is a zero-length block. Highly unlikely to occur.
|
// Bail if this is a zero-length block. Highly unlikely to occur.
|
||||||
if (block->step_event_count == 0) {
|
if (block->step_event_count == 0) {
|
||||||
return PLAN_EMPTY_BLOCK;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate the unit vector of the line move and the block maximum feed rate and acceleration scaled
|
// Calculate the unit vector of the line move and the block maximum feed rate and acceleration scaled
|
||||||
@@ -421,7 +421,7 @@ uint8_t plan_buffer_line(float* target, plan_line_data_t* pl_data) {
|
|||||||
// Finish up by recalculating the plan with the new block.
|
// Finish up by recalculating the plan with the new block.
|
||||||
planner_recalculate();
|
planner_recalculate();
|
||||||
}
|
}
|
||||||
return PLAN_OK;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the planner position vectors. Called by the system abort/initialization routine.
|
// Reset the planner position vectors. Called by the system abort/initialization routine.
|
||||||
|
@@ -37,10 +37,6 @@
|
|||||||
// new incoming motions as they are executed.
|
// new incoming motions as they are executed.
|
||||||
const int BLOCK_BUFFER_SIZE = 16;
|
const int BLOCK_BUFFER_SIZE = 16;
|
||||||
|
|
||||||
// Returned status message from planner.
|
|
||||||
const int PLAN_OK = true;
|
|
||||||
const int PLAN_EMPTY_BLOCK = false;
|
|
||||||
|
|
||||||
// Define planner data condition flags. Used to denote running conditions of a block.
|
// Define planner data condition flags. Used to denote running conditions of a block.
|
||||||
struct PlMotion {
|
struct PlMotion {
|
||||||
uint8_t rapidMotion : 1;
|
uint8_t rapidMotion : 1;
|
||||||
@@ -100,7 +96,8 @@ void plan_reset_buffer(); // Reset buffer only.
|
|||||||
// Add a new linear movement to the buffer. target[MAX_N_AXIS] is the signed, absolute target position
|
// Add a new linear movement to the buffer. target[MAX_N_AXIS] is the signed, absolute target position
|
||||||
// in millimeters. Feed rate specifies the speed of the motion. If feed rate is inverted, the feed
|
// in millimeters. Feed rate specifies the speed of the motion. If feed rate is inverted, the feed
|
||||||
// rate is taken to mean "frequency" and would complete the operation in 1/feed_rate minutes.
|
// rate is taken to mean "frequency" and would complete the operation in 1/feed_rate minutes.
|
||||||
uint8_t plan_buffer_line(float* target, plan_line_data_t* pl_data);
|
// Returns true on success.
|
||||||
|
bool plan_buffer_line(float* target, plan_line_data_t* pl_data);
|
||||||
|
|
||||||
// Called when the current block is no longer needed. Discards the block and makes the memory
|
// Called when the current block is no longer needed. Discards the block and makes the memory
|
||||||
// availible for new blocks.
|
// availible for new blocks.
|
||||||
|
Reference in New Issue
Block a user