Bugfix: double lift at toolchange. #953

This commit is contained in:
Alessandro Ranellucci 2013-03-11 17:06:05 +01:00
parent 0326962d11
commit b73c301c55
2 changed files with 10 additions and 7 deletions

View File

@ -350,7 +350,7 @@ sub retract {
# prepare moves # prepare moves
$self->speed('retract'); $self->speed('retract');
my $retract = [undef, undef, -$length, $comment]; my $retract = [undef, undef, -$length, $comment];
my $lift = ($self->extruder->retract_lift == 0 || defined $params{move_z}) my $lift = ($self->extruder->retract_lift == 0 || defined $params{move_z}) && !$self->lifted
? undef ? undef
: [undef, $self->z + $self->extruder->retract_lift, 0, 'lift plate during travel']; : [undef, $self->z + $self->extruder->retract_lift, 0, 'lift plate during travel'];
@ -371,12 +371,14 @@ sub retract {
$gcode .= $self->G0(@$travel); $gcode .= $self->G0(@$travel);
} else { } else {
$gcode .= $self->G1(@$retract); $gcode .= $self->G1(@$retract);
if (defined $params{move_z} && $self->extruder->retract_lift > 0) { if (!$self->lifted) {
my $travel = [undef, $params{move_z} + $self->extruder->retract_lift, 0, 'move to next layer (' . $self->layer->id . ') and lift']; if (defined $params{move_z} && $self->extruder->retract_lift > 0) {
$gcode .= $self->G0(@$travel); my $travel = [undef, $params{move_z} + $self->extruder->retract_lift, 0, 'move to next layer (' . $self->layer->id . ') and lift'];
$self->lifted($self->extruder->retract_lift); $gcode .= $self->G0(@$travel);
} elsif ($lift) { $self->lifted($self->extruder->retract_lift);
$gcode .= $self->G1(@$lift); } elsif ($lift) {
$gcode .= $self->G1(@$lift);
}
} }
} }
$self->extruder->retracted($self->extruder->retracted + $length); $self->extruder->retracted($self->extruder->retracted + $length);

View File

@ -43,6 +43,7 @@ my $test = sub {
if (_eq($info->{dist_Z}, $print->extruders->[$tool]->retract_lift) if (_eq($info->{dist_Z}, $print->extruders->[$tool]->retract_lift)
|| (_eq($info->{dist_Z}, $conf->layer_height + $print->extruders->[$tool]->retract_lift) && $print->extruders->[$tool]->retract_lift > 0)) { || (_eq($info->{dist_Z}, $conf->layer_height + $print->extruders->[$tool]->retract_lift) && $print->extruders->[$tool]->retract_lift > 0)) {
fail 'only lifting while retracted' if !$retracted[$tool] && !($conf->g0 && $info->{retracting}); fail 'only lifting while retracted' if !$retracted[$tool] && !($conf->g0 && $info->{retracting});
fail 'double lift' if $lifted;
$lifted = 1; $lifted = 1;
} }
if ($info->{dist_Z} < 0) { if ($info->{dist_Z} < 0) {