Fix of a loss in precission when the extruder multiplier is set

with M221. For 50um layers, the precision loss leads to holes
in the print.
This commit is contained in:
bubnikv 2018-02-20 15:30:18 +01:00 committed by PavelSindler
parent 03a1bef4ee
commit 4e3ea41ba4
2 changed files with 6 additions and 6 deletions

View File

@ -6527,7 +6527,11 @@ void get_coordinates()
for(int8_t i=0; i < NUM_AXIS; i++) {
if(code_seen(axis_codes[i]))
{
destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
destination[i] = (float)code_value();
if (i == E_AXIS && extrudemultiply != 100)
destination[i] *= (extrudemultiply * 0.01f);
if (axis_relative_modes[i] || relative_mode)
destination[i] += current_position[i];
seen[i]=true;
}
else destination[i] = current_position[i]; //Are these else lines really needed?

View File

@ -784,10 +784,6 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
block->steps_e = labs(target[E_AXIS]-position[E_AXIS]);
if (volumetric_multiplier[active_extruder] != 1.f)
block->steps_e *= volumetric_multiplier[active_extruder];
if (extrudemultiply != 100) {
block->steps_e *= extrudemultiply;
block->steps_e /= 100;
}
block->step_event_count = max(block->steps_x, max(block->steps_y, max(block->steps_z, block->steps_e)));
// Bail if this is a zero-length block
@ -919,7 +915,7 @@ Having the real displacement of the head, we can calculate the total movement le
delta_mm[Y_AXIS] = ((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-position[Y_AXIS]))/axis_steps_per_unit[Y_AXIS];
#endif
delta_mm[Z_AXIS] = (target[Z_AXIS]-position[Z_AXIS])/axis_steps_per_unit[Z_AXIS];
delta_mm[E_AXIS] = ((target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[E_AXIS])*volumetric_multiplier[active_extruder]*extrudemultiply/100.0;
delta_mm[E_AXIS] = ((target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[E_AXIS])*volumetric_multiplier[active_extruder];
if ( block->steps_x <=dropsegments && block->steps_y <=dropsegments && block->steps_z <=dropsegments )
{
block->millimeters = fabs(delta_mm[E_AXIS]);