#include "grbl.h"
Go to the source code of this file.
Data Structures | |
struct | planner_t |
Define planner variables. More... | |
Functions | |
uint8_t | plan_next_block_index (uint8_t block_index) |
Returns the index of the next block in the ring buffer. Also called by stepper segment buffer. More... | |
void | plan_reset () |
Initialize and reset the motion plan subsystem. More... | |
void | plan_reset_buffer () |
Reset buffer only. More... | |
void | plan_discard_current_block () |
Called when the current block is no longer needed. Discards the block and makes the memory. More... | |
plan_block_t * | plan_get_system_motion_block () |
Returns address of planner buffer block used by system motions. Called by segment generator. More... | |
plan_block_t * | plan_get_current_block () |
Returns address of first planner block, if available. Called by various main program functions. More... | |
float | plan_get_exec_block_exit_speed_sqr () |
Called by step segment buffer when computing executing block velocity profile. More... | |
uint8_t | plan_check_full_buffer () |
Returns the availability status of the block ring buffer. True, if full. More... | |
float | plan_compute_profile_nominal_speed (plan_block_t *block) |
Computes and returns block nominal speed based on running condition and override values. More... | |
void | plan_update_velocity_profile_parameters () |
Re-calculates buffered motions profile parameters upon a motion-based override change. More... | |
uint8_t | plan_buffer_line (float *target, plan_line_data_t *pl_data) |
Add a new linear movement to the buffer. target[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 rate is taken to mean "frequency" and would complete the operation in 1/feed_rate minutes. All position data passed to the planner must be in terms of machine position to keep the planner independent of any coordinate system changes and offsets, which are handled by the g-code parser. More... | |
void | plan_sync_position () |
Reset the planner position vectors. Called by the system abort/initialization routine. More... | |
uint8_t | plan_get_block_buffer_available () |
Returns the number of available blocks are in the planner buffer. More... | |
uint8_t | plan_get_block_buffer_count () |
Returns the number of active blocks are in the planner buffer. More... | |
void | plan_cycle_reinitialize () |
Re-initialize buffer plan with a partially completed block, assumed to exist at the buffer tail. More... | |
struct planner_t |
uint8_t plan_buffer_line | ( | float * | target, |
plan_line_data_t * | pl_data | ||
) |
Add a new linear movement to the buffer. target[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 rate is taken to mean "frequency" and would complete the operation in 1/feed_rate minutes. All position data passed to the planner must be in terms of machine position to keep the planner independent of any coordinate system changes and offsets, which are handled by the g-code parser.
Add a new linear movement to the buffer. target[N_AXIS] is the signed, absolute target position.
/ NOTE: Assumes buffer is available. Buffer checks are handled at a higher level by motion_control. In other words, the buffer head is never equal to the buffer tail. Also the feed rate input value is used in three ways: as a normal feed rate if invert_feed_rate is false, as inverse time if invert_feed_rate is true, or as seek/rapids rate if the feed_rate value is negative (and invert_feed_rate always false). The system motion condition tells the planner to plan a motion in the always unused block buffer head. It avoids changing the planner state and preserves the buffer to ensure subsequent gcode motions are still planned correctly, while the stepper module only points to the block buffer head to execute the special system motion.
< Zero all block values.
NOTE: Computes true distance from converted step values.
< Store unit vector numerator
NOTE: This calculation assumes all axes are orthogonal (Cartesian) and works with ABC-axes,
< Starting from rest. Enforce start from zero velocity.
NOTE: If the junction deviation value is finite, Grbl executes the motions in an exact path
NOTE: The max junction speed is a fixed value, since machine acceleration limits cannot be
NOTE: Computed without any expensive trig, sin() or acos(), by trig half angle identity of cos(theta).
< Trig half angle identity. Always positive.
< pl.previous_unit_vec[] = unit_vec[]
< pl.position[] = target_steps[]
uint8_t plan_check_full_buffer | ( | ) |
float plan_compute_profile_nominal_speed | ( | plan_block_t * | block | ) |
Computes and returns block nominal speed based on running condition and override values.
Called by main program during planner calculations and step segment buffer during initialization.
NOTE: All system motion commands, such as homing/parking, are not subject to overrides.
void plan_cycle_reinitialize | ( | ) |
void plan_discard_current_block | ( | ) |
uint8_t plan_get_block_buffer_available | ( | ) |
uint8_t plan_get_block_buffer_count | ( | ) |
plan_block_t* plan_get_current_block | ( | ) |
float plan_get_exec_block_exit_speed_sqr | ( | ) |
plan_block_t* plan_get_system_motion_block | ( | ) |
uint8_t plan_next_block_index | ( | uint8_t | block_index | ) |
void plan_reset | ( | ) |
void plan_reset_buffer | ( | ) |
void plan_sync_position | ( | ) |