// Reset the planner position vector and planner speed inline void planner_set_position(double x, double y, double z) { position[X_AXIS] = lround(x*CONFIG_X_STEPS_PER_MM); position[Y_AXIS] = lround(y*CONFIG_Y_STEPS_PER_MM); position[Z_AXIS] = lround(z*CONFIG_Z_STEPS_PER_MM); previous_nominal_speed = 0.0; // resets planner junction speeds clear_vector_double(previous_unit_vec); }
// TODO: Update limits and homing cycle subprograms for better integration with new features. void mc_go_home() { limits_go_home(); // Upon completion, reset all internal position vectors (g-code parser, planner, system) gc_clear_position(); plan_clear_position(); clear_vector_double(sys.position); }
void plan_init() { block_buffer_head = 0; block_buffer_tail = 0; plan_set_acceleration_manager_enabled(true); clear_vector(position); clear_vector_double(previous_unit_vec); previous_nominal_speed = 0.0; memset (&startpoint, 0, sizeof(startpoint)); }
void plan_set_current_position(tTarget *new_position) { startpoint = *new_position; position[X_AXIS] = lround(new_position->x*(double)config.steps_per_mm_x); position[Y_AXIS] = lround(new_position->y*(double)config.steps_per_mm_y); position[Z_AXIS] = lround(new_position->z*(double)config.steps_per_mm_z); position[E_AXIS] = lround(new_position->e*(double)config.steps_per_mm_e); previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. clear_vector_double(previous_unit_vec); }
void planner_init() { block_buffer_head = 0; block_buffer_tail = 0; block_buffer_tail_write = 0; raster_buffer_next = 0; raster_buffer_count = 0; clear_vector(position); planner_set_position( CONFIG_X_ORIGIN_OFFSET, CONFIG_Y_ORIGIN_OFFSET, CONFIG_Z_ORIGIN_OFFSET ); position_update_requested = false; clear_vector_double(previous_unit_vec); previous_nominal_speed = 0.0; }