yarf 0.1
Yet Another RepRap Firmware
|
The planner component translates movement g-code commands into blocks that represent a linear movement and places these blocks into a queue of blocks to be executed by the block handler component. More...
Go to the source code of this file.
Functions | |
void | plan_init (void) |
Initializes the planner component. | |
steps_t | plan_get_virtual_position (unsigned char axis) |
Returns the virtual position in number of steps from the origin for the specified axis. | |
void | plan_set_virtual_position_rel (steps_t x, steps_t y, steps_t z, steps_t e) |
Sets the virtual position of all axes. | |
void | plan_set_virtual_position_abs (steps_t x, steps_t y, steps_t z, steps_t e) |
Sets the virtual position of all axes. | |
void | plan_calculate_trapezoid (block_t *b, speed_t entry_speed, speed_t exit_speed) |
Sets a number of block parameters in order to have the block accelerate from a given entry speed at the start of the block and to have it decelerate to a given exit speed at the end of it. | |
void | plan_linear_movement_rel (steps_t steps_x, steps_t steps_y, steps_t steps_z, steps_t steps_e, speed_t plateau_speed) |
Adds a movement from the current virtual position to the specified position at the specified feed rate to the end of the planning queue. | |
void | plan_linear_movement_abs (steps_t dest_x, steps_t dest_y, steps_t dest_z, steps_t dest_e, speed_t plateau_speed) |
Adds a movement from the current virtual position to the specified position at the specified feed rate to the end of the planning queue. | |
void | plan_home_axes (bool x, bool y, bool z) |
Homes the specified axes. |
The planner component translates movement g-code commands into blocks that represent a linear movement and places these blocks into a queue of blocks to be executed by the block handler component.
Definition in file planner.h.
Sets a number of block parameters in order to have the block accelerate from a given entry speed at the start of the block and to have it decelerate to a given exit speed at the end of it.
These parameters are used by the block handler during execution of the block.
b | a pointer to the block for which to calculate the parameters |
entry_speed | the entry speed of the block in mm/min |
exit_speed | the exit speed of the block in mm/min |
steps_t plan_get_virtual_position | ( | unsigned char | axis | ) |
Returns the virtual position in number of steps from the origin for the specified axis.
The virtual position is the position the printer will be at when all pending blocks in the planning queue have been executed.
axis | the axis for which to get the virtual position. Valid values are X_AXIS, Y_AXIS, Z_AXIS and E_AXIS. |
void plan_home_axes | ( | bool | x, |
bool | y, | ||
bool | z | ||
) |
Homes the specified axes.
Homing an axis means moving it in the negative direction until it reaches its min endstop.
x | boolean indicating whether or not to home the x axis |
y | boolean indicating whether or not to home the y axis |
z | boolean indicating whether or not to home the z axis |
void plan_linear_movement_abs | ( | steps_t | dest_x, |
steps_t | dest_y, | ||
steps_t | dest_z, | ||
steps_t | dest_e, | ||
speed_t | plateau_speed | ||
) |
Adds a movement from the current virtual position to the specified position at the specified feed rate to the end of the planning queue.
The position arguments are interpreted as absolute positions in numbers of steps from the origin.
dest_x | the destination position of the x axis, in steps from the origin, must be within the bounds of the axis |
dest_y | the destination position of the y axis, in steps from the origin, must be within the bounds of the axis |
dest_z | the destination position of the z axis, in steps from the origin, must be within the bounds of the axis |
dest_e | the destination position of the e axis, in steps from the origin |
plateau_speed | maximum speed of the block in mm/min |
If any of the X, Y or Z axes is not homed when calling this movement, that axis is homed before making the movement.
If any of the destination parameters is out of bounds, the movement is not added to the planning queue (it is silently dropped).
If the lookahead component is enabled, it is called immediately after adding the new block to the queue, in order to optimize the block's entry speed and to reduce the jerkiness of the transitions between blocks. The machine's virtual position is updated to the position it will be in after this movement has been executed.
void plan_linear_movement_rel | ( | steps_t | steps_x, |
steps_t | steps_y, | ||
steps_t | steps_z, | ||
steps_t | steps_e, | ||
speed_t | plateau_speed | ||
) |
Adds a movement from the current virtual position to the specified position at the specified feed rate to the end of the planning queue.
The position arguments are interpreted as offsets in numbers of steps from the current virtual position.
steps_x | the number of steps to take in the x direction (can be negative), must not make the machine go out of bounds |
steps_y | the number of steps to take in the y direction (can be negative), must not make the machine go out of bounds |
steps_z | the number of steps to take in the z direction (can be negative), must not make the machine go out of bounds |
steps_e | the number of steps to take in the e direction (can be negative) |
plateau_speed | maximum speed of the block in mm/min |
If any of the X, Y or Z axes is not homed when calling this movement, that axis is homed before making the movement.
If any of the destination parameters would cause the machine to go out of bounds, the movement is not added to the planning queue (it is silently dropped).
If the lookahead component is enabled, it is called immediately after adding the new block to the queue, in order to optimize the block's entry speed and to reduce the jerkiness of the transitions between blocks. The machine's virtual position is updated to the position it will be in after this movement has been executed.
Sets the virtual position of all axes.
The arguments are interpreted as absolute positions in numbers of steps from the origin.
x | the new virtual x position in number of steps |
y | the new virtual x position in number of steps |
z | the new virtual x position in number of steps |
e | the new virtual x position in number of steps |
Sets the virtual position of all axes.
The arguments are interpreted as offsets in numbers of steps relative to the current virtual position.
x | the number of steps to add to the virtual x position |
y | the number of steps to add to the virtual y position |
z | the number of steps to add to the virtual z position |
e | the number of steps to add to the virtual e position |