New --first-layer-acceleration option

This commit is contained in:
Alessandro Ranellucci 2013-08-09 14:30:43 +02:00
parent cde662cb51
commit 99816e07a6
5 changed files with 31 additions and 8 deletions

View File

@ -172,6 +172,9 @@ The author of the Silk icon set is Mark James.
--bridge-acceleration --bridge-acceleration
Overrides firmware's default acceleration for bridges. (mm/s^2, set zero Overrides firmware's default acceleration for bridges. (mm/s^2, set zero
to disable; default: 0) to disable; default: 0)
--first-layer-acceleration
Overrides firmware's default acceleration for first layer. (mm/s^2, set zero
to disable; default: 0)
--default-acceleration --default-acceleration
Acceleration will be reset to this value after the specific settings above Acceleration will be reset to this value after the specific settings above
have been applied. (mm/s^2, set zero to disable; default: 130) have been applied. (mm/s^2, set zero to disable; default: 130)

View File

@ -369,6 +369,14 @@ our $Options = {
type => 'f', type => 'f',
default => 0, default => 0,
}, },
'first_layer_acceleration' => {
label => 'First layer',
tooltip => 'This is the acceleration your printer will use for first layer. Set zero to disable acceleration control for first layer.',
sidetext => 'mm/s²',
cli => 'first-layer-acceleration=f',
type => 'f',
default => 0,
},
# accuracy options # accuracy options
'layer_height' => { 'layer_height' => {

View File

@ -116,6 +116,13 @@ sub change_layer {
int(99 * ($layer->id / ($self->layer_count - 1))), int(99 * ($layer->id / ($self->layer_count - 1))),
($self->config->gcode_comments ? ' ; update progress' : ''); ($self->config->gcode_comments ? ' ; update progress' : '');
} }
if ($self->config->first_layer_acceleration) {
if ($layer->id == 0) {
$gcode .= $self->set_acceleration($self->config->first_layer_acceleration);
} elsif ($layer->id == 1) {
$gcode .= $self->set_acceleration($self->config->default_acceleration);
}
}
return $gcode; return $gcode;
} }
@ -289,6 +296,7 @@ sub extrude_path {
# adjust acceleration # adjust acceleration
my $acceleration; my $acceleration;
if (!$self->config->first_layer_acceleration || $self->layer->id != 0) {
if ($self->config->perimeter_acceleration && $path->is_perimeter) { if ($self->config->perimeter_acceleration && $path->is_perimeter) {
$acceleration = $self->config->perimeter_acceleration; $acceleration = $self->config->perimeter_acceleration;
} elsif ($self->config->infill_acceleration && $path->is_fill) { } elsif ($self->config->infill_acceleration && $path->is_fill) {
@ -297,6 +305,7 @@ sub extrude_path {
$acceleration = $self->config->bridge_acceleration; $acceleration = $self->config->bridge_acceleration;
} }
$gcode .= $self->set_acceleration($acceleration) if $acceleration; $gcode .= $self->set_acceleration($acceleration) if $acceleration;
}
my $area; # mm^3 of extrudate per mm of tool movement my $area; # mm^3 of extrudate per mm of tool movement
if ($path->is_bridge) { if ($path->is_bridge) {

View File

@ -461,7 +461,7 @@ sub build {
}, },
{ {
title => 'Acceleration control (advanced)', title => 'Acceleration control (advanced)',
options => [qw(perimeter_acceleration infill_acceleration bridge_acceleration default_acceleration)], options => [qw(perimeter_acceleration infill_acceleration bridge_acceleration first_layer_acceleration default_acceleration)],
}, },
]); ]);

View File

@ -255,6 +255,9 @@ $j
--bridge-acceleration --bridge-acceleration
Overrides firmware's default acceleration for bridges. (mm/s^2, set zero Overrides firmware's default acceleration for bridges. (mm/s^2, set zero
to disable; default: $config->{bridge_acceleration}) to disable; default: $config->{bridge_acceleration})
--first-layer-acceleration
Overrides firmware's default acceleration for first layer. (mm/s^2, set zero
to disable; default: $config->{first_layer_acceleration})
--default-acceleration --default-acceleration
Acceleration will be reset to this value after the specific settings above Acceleration will be reset to this value after the specific settings above
have been applied. (mm/s^2, set zero to disable; default: $config->{travel_speed}) have been applied. (mm/s^2, set zero to disable; default: $config->{travel_speed})