Fixes for Multi Material ramming, increased separation of wipe lines.

This commit is contained in:
bubnikv 2017-05-20 18:59:05 +02:00
parent a99b006b98
commit dfc4717308
3 changed files with 26 additions and 24 deletions

View file

@ -173,6 +173,7 @@ std::string WipeTowerIntegration::tool_change(GCode &gcodegen, int extruder_id,
// Move over the wipe tower. // Move over the wipe tower.
gcode += this->travel_to(gcodegen, m_impl->tool_change(extruder_id, WipeTower::PURPOSE_MOVE_TO_TOWER).second); gcode += this->travel_to(gcodegen, m_impl->tool_change(extruder_id, WipeTower::PURPOSE_MOVE_TO_TOWER).second);
// Let the tool change be executed by the wipe tower class. // Let the tool change be executed by the wipe tower class.
//FIXME calculate time at the wipe tower and add it to m_elapsed_time
std::pair<std::string, WipeTower::xy> code_and_pos = m_impl->tool_change(extruder_id, WipeTower::PURPOSE_EXTRUDE); std::pair<std::string, WipeTower::xy> code_and_pos = m_impl->tool_change(extruder_id, WipeTower::PURPOSE_EXTRUDE);
// Inform the G-code writer about the changes done behind its back. // Inform the G-code writer about the changes done behind its back.
gcode += code_and_pos.first; gcode += code_and_pos.first;
@ -192,6 +193,7 @@ std::string WipeTowerIntegration::tool_change(GCode &gcodegen, int extruder_id,
if (! over_wipe_tower) if (! over_wipe_tower)
gcode += this->travel_to(gcodegen, m_impl->finish_layer(WipeTower::PURPOSE_MOVE_TO_TOWER).second); gcode += this->travel_to(gcodegen, m_impl->finish_layer(WipeTower::PURPOSE_MOVE_TO_TOWER).second);
// Let the tool change be executed by the wipe tower class. // Let the tool change be executed by the wipe tower class.
//FIXME calculate time at the wipe tower and add it to m_elapsed_time
std::pair<std::string, WipeTower::xy> code_and_pos = m_impl->finish_layer(WipeTower::PURPOSE_EXTRUDE); std::pair<std::string, WipeTower::xy> code_and_pos = m_impl->finish_layer(WipeTower::PURPOSE_EXTRUDE);
// Inform the G-code writer about the changes done behind its back. // Inform the G-code writer about the changes done behind its back.
gcode += code_and_pos.first; gcode += code_and_pos.first;

View file

@ -124,9 +124,9 @@ public:
// Move to x1, +y_increment, // Move to x1, +y_increment,
// extrude quickly amount e to x2 with feed f. // extrude quickly amount e to x2 with feed f.
Writer& ram(float x1, float x2, float dy, float e, float f) Writer& ram(float x1, float x2, float dy, float e0, float e, float f)
{ {
return travel(x1, m_current_pos.y + dy, f) return extrude_explicit(x1, m_current_pos.y + dy, e0, f)
.extrude_explicit(x2, m_current_pos.y, e); .extrude_explicit(x2, m_current_pos.y, e);
} }
@ -469,33 +469,32 @@ void WipeTowerPrusaMM::toolchange_Unload(
// Ram the hot material out of the extruder melt zone. // Ram the hot material out of the extruder melt zone.
// Current extruder position is on the left, one perimeter inside the cleaning box in both X and Y. // Current extruder position is on the left, one perimeter inside the cleaning box in both X and Y.
float e0 = m_perimeter_width * m_extrusion_flow;
float e = (xr - xl) * m_extrusion_flow;
switch (current_material) switch (current_material)
{ {
case ABS: case ABS:
// ramming start end y increment amount feedrate // ramming start end y increment amount feedrate
writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 0.2f, 1.2f, 4000) writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 0.2f, 0, 1.2f * e, 4000)
.ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.2f, 1.6f, 4600) .ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.2f, e0, 1.6f * e, 4600)
.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 1.2f, 1.8f, 5000) .ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 1.2f, e0, 1.8f * e, 5000)
.ram(xr - m_perimeter_width * 2, xl + m_perimeter_width * 2, y_step * 1.2f, 1.8f, 5000); .ram(xr - m_perimeter_width * 2, xl + m_perimeter_width * 2, y_step * 1.2f, e0, 1.8f * e, 5000);
break; break;
case PVA: case PVA:
writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 0.2f, 3, 4000) writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 0.2f, 0, 3, 4000)
.ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.5f, 3, 4500) .ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.5f, 0, 3, 4500)
.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 1.5f, 3, 4800) .ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 1.5f, 0, 3, 4800)
.ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.5f, 3, 5000); .ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.5f, 0, 3, 5000);
break; break;
case SCAFF: case SCAFF:
writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 2.f, 3, 4000) writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 2.f, 0, 3, 4000)
.ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 3.f, 4, 4600) .ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 3.f, 0, 4, 4600)
.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 3.f, 4.5, 5200); .ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 3.f, 0, 4.5, 5200);
break; break;
default: default:
{ writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 0.2f, 0, 1.6f * e, 4000)
float e = (xr - xl) * m_extrusion_flow; .ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.2f, e0, 1.65f * e, 4600)
writer.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width, y_step * 0.2f, 1.6f * e, 4000) .ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 1.2f, e0, 1.74f * e, 5200);
.ram(xr - m_perimeter_width, xl + m_perimeter_width, y_step * 1.2f, 1.65f * e, 4600)
.ram(xl + m_perimeter_width * 2, xr - m_perimeter_width * 2, y_step * 1.2f, 1.74f * e, 5200);
}
} }
// Pull the filament end into a cooling tube. // Pull the filament end into a cooling tube.
@ -610,7 +609,7 @@ void WipeTowerPrusaMM::toolchange_Wipe(
float wipe_speed_inc = 50.f; float wipe_speed_inc = 50.f;
float wipe_speed_max = 4800.f; float wipe_speed_max = 4800.f;
// Y increment per wipe line. // Y increment per wipe line.
float dy = ((m_current_shape == SHAPE_NORMAL) ? 1.f : -1.f) * m_perimeter_width * 0.7f; float dy = ((m_current_shape == SHAPE_NORMAL) ? 1.f : -1.f) * m_perimeter_width * 0.8f;
for (bool p = true; ; p = ! p) { for (bool p = true; ; p = ! p) {
wipe_speed = std::min(wipe_speed_max, wipe_speed + wipe_speed_inc); wipe_speed = std::min(wipe_speed_max, wipe_speed + wipe_speed_inc);
if (p) { if (p) {

View file

@ -90,14 +90,15 @@ public:
m_current_shape = (! is_first_layer && m_current_shape == SHAPE_NORMAL) ? SHAPE_REVERSED : SHAPE_NORMAL; m_current_shape = (! is_first_layer && m_current_shape == SHAPE_NORMAL) ? SHAPE_REVERSED : SHAPE_NORMAL;
++ m_num_layer_changes; ++ m_num_layer_changes;
int layer_idx = int(std::floor(layer_height * 100) + 0.5f); int layer_idx = int(std::floor(layer_height * 1000) + 0.5f);
switch (layer_idx) switch (layer_idx)
{ {
case 15: case 150:
m_extrusion_flow = (float)0.024; m_extrusion_flow = (float)0.0218;
break; break;
case 20: case 200:
default: default:
// Extrusion rate for an extrusion aka perimeter width 0.35mm.
m_extrusion_flow = (float)0.029; m_extrusion_flow = (float)0.029;
break; break;
} }