Protected buffer works! Vast improvements to planner efficiency. Many things still broken with overhaul.

Development push. Lots still broken.

- Protected planner concept works! This is a critical precursor to
enabling feedrate overrides in allowing the planner buffer and the
stepper execution operate atomically. This is done through a
intermediary segment buffer.

- Still lots of work to be done, as this was a complete overhaul of the
planner and stepper subsystems. The code can be cleaned up quite a bit,
re-enabling some of the broken features like feed holds, and finishing
up some of the concepts

- Pushed some of the fixes from the master and edge branch to here, as
this will likely replace the edge branch when done.
This commit is contained in:
Sonny Jeon
2013-10-09 09:33:22 -06:00
parent 7a175bd2db
commit 805f0f219c
10 changed files with 793 additions and 301 deletions

View File

@ -33,20 +33,20 @@
typedef struct {
// Fields used by the bresenham algorithm for tracing the line
// NOTE: Do not change any of these values once set. The stepper algorithm uses them to execute the block correctly.
uint8_t direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
int32_t steps[N_AXIS]; // Step count along each axis
int32_t step_event_count; // The number of step events required to complete this block
int32_t step_event_count; // The maximum step axis count and number of steps required to complete this block.
// Fields used by the motion planner to manage acceleration
float entry_speed_sqr; // The current planned entry speed at block junction in (mm/min)^2
float max_entry_speed_sqr; // Maximum allowable entry speed based on the minimum of junction limit and
// neighboring nominal speeds with overrides in (mm/min)^2
float max_junction_speed_sqr; // Junction entry speed limit based on direction vectors in (mm/min)^2
float nominal_speed_sqr; // Axis-limit adjusted nominal speed for this block in (mm/min)^2
float entry_speed_sqr; // Entry speed at previous-current block junction in (mm/min)^2
float max_entry_speed_sqr; // Maximum allowable junction entry speed in (mm/min)^2
float acceleration; // Axes-limit adjusted line acceleration in mm/min^2
float millimeters; // The total travel for this block to be executed in mm
float acceleration; // Axis-limit adjusted line acceleration in mm/min^2
float millimeters; // The remaining distance for this block to be executed in mm
// Settings for the trapezoid generator
// int32_t decelerate_after; // The index of the step event on which to start decelerating
} plan_block_t;
// Initialize the motion plan subsystem
@ -66,7 +66,9 @@ plan_block_t *plan_get_current_block();
plan_block_t *plan_get_block_by_index(uint8_t block_index);
int32_t calculate_trapezoid_for_block(uint8_t block_index);
float plan_calculate_velocity_profile(uint8_t block_index);
// void plan_update_partial_block(uint8_t block_index, float millimeters_remaining, uint8_t is_decelerating);
// Reset the planner position vector (in steps)
void plan_sync_position();