Merge branch 'Development' into delta_auto_bed_level
Conflicts: Marlin/Marlin_main.cpp
This commit is contained in:
@ -59,7 +59,7 @@
|
||||
#include "language.h"
|
||||
|
||||
//===========================================================================
|
||||
//=============================public variables ============================
|
||||
//============================= public variables ============================
|
||||
//===========================================================================
|
||||
|
||||
unsigned long minsegmenttime;
|
||||
@ -67,8 +67,9 @@ float max_feedrate[NUM_AXIS]; // set the max speeds
|
||||
float axis_steps_per_unit[NUM_AXIS];
|
||||
unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
|
||||
float minimumfeedrate;
|
||||
float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
|
||||
float acceleration; // Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all printing moves. M204 SXXXX
|
||||
float retract_acceleration; // mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
|
||||
float travel_acceleration; // Travel acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
|
||||
float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
|
||||
float max_z_jerk;
|
||||
float max_e_jerk;
|
||||
@ -622,37 +623,37 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
|
||||
#ifndef COREXY
|
||||
if (target[X_AXIS] < position[X_AXIS])
|
||||
{
|
||||
block->direction_bits |= (1<<X_AXIS);
|
||||
block->direction_bits |= BIT(X_AXIS);
|
||||
}
|
||||
if (target[Y_AXIS] < position[Y_AXIS])
|
||||
{
|
||||
block->direction_bits |= (1<<Y_AXIS);
|
||||
block->direction_bits |= BIT(Y_AXIS);
|
||||
}
|
||||
#else
|
||||
if (target[X_AXIS] < position[X_AXIS])
|
||||
{
|
||||
block->direction_bits |= (1<<X_HEAD); //AlexBorro: Save the real Extruder (head) direction in X Axis
|
||||
block->direction_bits |= BIT(X_HEAD); //AlexBorro: Save the real Extruder (head) direction in X Axis
|
||||
}
|
||||
if (target[Y_AXIS] < position[Y_AXIS])
|
||||
{
|
||||
block->direction_bits |= (1<<Y_HEAD); //AlexBorro: Save the real Extruder (head) direction in Y Axis
|
||||
block->direction_bits |= BIT(Y_HEAD); //AlexBorro: Save the real Extruder (head) direction in Y Axis
|
||||
}
|
||||
if ((target[X_AXIS]-position[X_AXIS]) + (target[Y_AXIS]-position[Y_AXIS]) < 0)
|
||||
{
|
||||
block->direction_bits |= (1<<X_AXIS); //AlexBorro: Motor A direction (Incorrectly implemented as X_AXIS)
|
||||
block->direction_bits |= BIT(X_AXIS); //AlexBorro: Motor A direction (Incorrectly implemented as X_AXIS)
|
||||
}
|
||||
if ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]) < 0)
|
||||
{
|
||||
block->direction_bits |= (1<<Y_AXIS); //AlexBorro: Motor B direction (Incorrectly implemented as Y_AXIS)
|
||||
block->direction_bits |= BIT(Y_AXIS); //AlexBorro: Motor B direction (Incorrectly implemented as Y_AXIS)
|
||||
}
|
||||
#endif
|
||||
if (target[Z_AXIS] < position[Z_AXIS])
|
||||
{
|
||||
block->direction_bits |= (1<<Z_AXIS);
|
||||
block->direction_bits |= BIT(Z_AXIS);
|
||||
}
|
||||
if (target[E_AXIS] < position[E_AXIS])
|
||||
{
|
||||
block->direction_bits |= (1<<E_AXIS);
|
||||
block->direction_bits |= BIT(E_AXIS);
|
||||
}
|
||||
|
||||
block->active_extruder = extruder;
|
||||
@ -863,7 +864,7 @@ Having the real displacement of the head, we can calculate the total movement le
|
||||
old_direction_bits = block->direction_bits;
|
||||
segment_time = lround((float)segment_time / speed_factor);
|
||||
|
||||
if((direction_change & (1<<X_AXIS)) == 0)
|
||||
if((direction_change & BIT(X_AXIS)) == 0)
|
||||
{
|
||||
x_segment_time[0] += segment_time;
|
||||
}
|
||||
@ -873,7 +874,7 @@ Having the real displacement of the head, we can calculate the total movement le
|
||||
x_segment_time[1] = x_segment_time[0];
|
||||
x_segment_time[0] = segment_time;
|
||||
}
|
||||
if((direction_change & (1<<Y_AXIS)) == 0)
|
||||
if((direction_change & BIT(Y_AXIS)) == 0)
|
||||
{
|
||||
y_segment_time[0] += segment_time;
|
||||
}
|
||||
@ -907,19 +908,24 @@ Having the real displacement of the head, we can calculate the total movement le
|
||||
{
|
||||
block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
||||
}
|
||||
else if(block->steps_e == 0)
|
||||
{
|
||||
block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
||||
}
|
||||
else
|
||||
{
|
||||
block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
|
||||
// Limit acceleration per axis
|
||||
if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
|
||||
if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS];
|
||||
if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
|
||||
if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
|
||||
}
|
||||
// Limit acceleration per axis
|
||||
if(((float)block->acceleration_st * (float)block->steps_x / (float)block->step_event_count) > axis_steps_per_sqr_second[X_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[X_AXIS];
|
||||
if(((float)block->acceleration_st * (float)block->steps_y / (float)block->step_event_count) > axis_steps_per_sqr_second[Y_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[Y_AXIS];
|
||||
if(((float)block->acceleration_st * (float)block->steps_e / (float)block->step_event_count) > axis_steps_per_sqr_second[E_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[E_AXIS];
|
||||
if(((float)block->acceleration_st * (float)block->steps_z / (float)block->step_event_count ) > axis_steps_per_sqr_second[Z_AXIS])
|
||||
block->acceleration_st = axis_steps_per_sqr_second[Z_AXIS];
|
||||
|
||||
block->acceleration = block->acceleration_st / steps_per_mm;
|
||||
block->acceleration_rate = (long)((float)block->acceleration_st * (16777216.0 / (F_CPU / 8.0)));
|
||||
|
||||
|
Reference in New Issue
Block a user