Added support for the upstream Marlin interpretation of the M204 code:

M204 S.. T..:
T is interpreted the old way (as acceleration when retracting)
only if an S code is found at the same line.
This allows PrusaResearch to interpret the legacy G-codes generated
by our older Slic3r with older Slic3r profiles.

M204 P.. R.. T..:
T is ignored, P is interpreted as acceleration when extruding,
R is interpreted as acceleration when retracting.
This will be the format the Slic3r 1.41.0 will produce from
the Machine Limits page.
In the future both MK3 firmware and Slic3r will likely be extended
to support the separate travel acceleration.

This change will help us to solve the following Slic3r issue:
https://github.com/prusa3d/Slic3r/issues/1089
This commit is contained in:
bubnikv 2018-08-03 15:33:41 +02:00
parent 90ee05a036
commit dd4c4b39b4

View file

@ -5932,10 +5932,31 @@ Sigma_Exit:
} }
} }
break; break;
case 204: // M204 acclereration S normal moves T filmanent only moves case 204:
// M204 acclereration settings.
// Supporting old format: M204 S[normal moves] T[filmanent only moves]
// and new format: M204 P[printing moves] R[filmanent only moves] T[travel moves] (as of now T is ignored)
{ {
if(code_seen('S')) acceleration = code_value() ; if(code_seen('S')) {
if(code_seen('T')) retract_acceleration = code_value() ; // Legacy acceleration format. This format is used by the legacy Marlin, MK2 or MK3 firmware,
// and it is also generated by Slic3r to control acceleration per extrusion type
// (there is a separate acceleration settings in Slicer for perimeter, first layer etc).
acceleration = code_value();
// Interpret the T value as retract acceleration in the old Marlin format.
if(code_seen('T'))
retract_acceleration = code_value();
} else {
// New acceleration format, compatible with the upstream Marlin.
if(code_seen('P'))
acceleration = code_value();
if(code_seen('R'))
retract_acceleration = code_value();
if(code_seen('T')) {
// Interpret the T value as the travel acceleration in the new Marlin format.
//FIXME Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value.
// travel_acceleration = code_value();
}
}
} }
break; break;
case 205: //M205 advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk case 205: //M205 advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X= maximum xy jerk, Z=maximum Z jerk