2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
10 #include "libs/Module.h"
11 #include "libs/Kernel.h"
15 #include "../communication/utils/Gcode.h"
20 double max_allowable_speed( double acceleration
, double target_velocity
, double distance
);
25 double compute_factor_for_safe_speed();
26 void calculate_trapezoid( double entry_factor
, double exit_factor
);
27 double estimate_acceleration_distance( double initial_rate
, double target_rate
, double acceleration
);
28 double intersection_distance(double initial_rate
, double final_rate
, double acceleration
, double distance
);
29 void reverse_pass(Block
* previous
, Block
* next
);
30 void forward_pass(Block
* previous
, Block
* next
);
31 void debug(Kernel
* kernel
);
32 void append_gcode(Gcode
* gcode
);
33 void pop_and_execute_gcode(Kernel
* &kernel
);
34 double get_duration_left(unsigned int already_taken_steps
);
35 vector
<std::string
> commands
;
37 unsigned short steps
[3]; // Number of steps for each axis for this block
38 //float speeds[3]; // Speeds for each axis, used in the planning process
39 unsigned short steps_event_count
; // Steps for the longest axis
40 unsigned int nominal_rate
; // Nominal rate in steps per minute
41 float nominal_speed
; // Nominal speed in mm per minute
42 float millimeters
; // Distance for this move
44 unsigned int rate_delta
; // Nomber of steps to add to the speed for each acceleration tick
45 unsigned int initial_rate
; // Initial speed in steps per minute
46 unsigned int final_rate
; // Final speed in steps per minute
47 unsigned short accelerate_until
; // Stop accelerating after this number of steps
48 unsigned short decelerate_after
; // Start decelerating after this number of steps
49 unsigned int direction_bits
; // Direction for each axis in bit form, relative to the direction port's mask
52 uint8_t recalculate_flag
; // Planner flag to recalculate trapezoids on entry junction
53 uint8_t nominal_length_flag
; // Planner flag for nominal speed always reached
55 double max_entry_speed
;