|
@@ -72,7 +72,7 @@
|
72
|
72
|
unsigned long minsegmenttime;
|
73
|
73
|
float max_feedrate[4]; // set the max speeds
|
74
|
74
|
float axis_steps_per_unit[4];
|
75
|
|
-long max_acceleration_units_per_sq_second[4]; // Use M201 to override by software
|
|
75
|
+unsigned long max_acceleration_units_per_sq_second[4]; // Use M201 to override by software
|
76
|
76
|
float minimumfeedrate;
|
77
|
77
|
float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
|
78
|
78
|
float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
|
|
@@ -153,8 +153,8 @@ inline float intersection_distance(float initial_rate, float final_rate, float a
|
153
|
153
|
// Calculates trapezoid parameters so that the entry- and exit-speed is compensated by the provided factors.
|
154
|
154
|
|
155
|
155
|
void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exit_factor) {
|
156
|
|
- long initial_rate = ceil(block->nominal_rate*entry_factor); // (step/min)
|
157
|
|
- long final_rate = ceil(block->nominal_rate*exit_factor); // (step/min)
|
|
156
|
+ unsigned long initial_rate = ceil(block->nominal_rate*entry_factor); // (step/min)
|
|
157
|
+ unsigned long final_rate = ceil(block->nominal_rate*exit_factor); // (step/min)
|
158
|
158
|
|
159
|
159
|
// Limit minimal step rate (Otherwise the timer will overflow.)
|
160
|
160
|
if(initial_rate <120) {initial_rate=120; }
|
|
@@ -570,7 +570,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
|
570
|
570
|
long max_x_segment_time = max(x_segment_time[0], max(x_segment_time[1], x_segment_time[2]));
|
571
|
571
|
long max_y_segment_time = max(y_segment_time[0], max(y_segment_time[1], y_segment_time[2]));
|
572
|
572
|
long min_xy_segment_time =min(max_x_segment_time, max_y_segment_time);
|
573
|
|
- if(min_xy_segment_time < MAX_FREQ_TIME) speed_factor = min(speed_factor, (float)min_xy_segment_time / (float)MAX_FREQ_TIME);
|
|
573
|
+ if(min_xy_segment_time < MAX_FREQ_TIME) speed_factor = min(speed_factor, speed_factor * (float)min_xy_segment_time / (float)MAX_FREQ_TIME);
|
574
|
574
|
#endif
|
575
|
575
|
|
576
|
576
|
// Correct the speed
|
|
@@ -579,7 +579,12 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
|
579
|
579
|
for(int i=0; i < 4; i++) {
|
580
|
580
|
if(abs(current_speed[i]) > max_feedrate[i])
|
581
|
581
|
speed_factor = min(speed_factor, max_feedrate[i] / abs(current_speed[i]));
|
582
|
|
-// Serial.print("current_speed"); Serial.print(i); Serial.print(" : "); Serial.println(current_speed[i]);
|
|
582
|
+ /*
|
|
583
|
+ if(speed_factor < 0.1) {
|
|
584
|
+ Serial.print("speed factor : "); Serial.println(speed_factor);
|
|
585
|
+ Serial.print("current_speed"); Serial.print(i); Serial.print(" : "); Serial.println(current_speed[i]);
|
|
586
|
+ }
|
|
587
|
+ */
|
583
|
588
|
}
|
584
|
589
|
for(unsigned char i=0; i < 4; i++) {
|
585
|
590
|
current_speed[i] *= speed_factor;
|