-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement M204 T (separate travel acceleration) #2838
Conversation
I'm thinking now that the current travel acceleration also needs to be saved in eeprom during a power-panic, something which is currently missing here. |
d362a18
to
3840fe3
Compare
PR should be complete now. Rebased on top of the current master in order to handle new EEPROM offsets without conflicts. In the last commit I handle all acceleration settings (not just travel acceleration) during UVLO, which were completely skipped before. Saving and restoring is not 100% correct with this PR, although is better than nothing. See comments on 3840fe3 for details. This needs to be handled correctly by saving/restore more limits in the future. |
Allow to separate extrusion and travel acceleration settings using M204, as Marlin 1.1.x and 2.x does using M204 T. This allows to reduce the number of instructions required during printing, since resetting the acceleration for travel moves is no longer required and can be done a single time during the print. Provision for this parameter was pre-existing, but not implemented. M204 has two forms: the lagacy format (Marlin <1.1): M204 S[print-acc] T[retract-acc] and the newer format: M204 P[print-acc] R[retract-acc] T[travel-acc] The distinction in the MK3 FW is done based on the presence of the P parameter. If P is seen, the new format is adoped. In the new format however, M204 T was ignored until this change. To keep backward compatibility, M204 S[acc] will set both print and travel acceleration, which is identical in behavior to recent versions of Marlin.
Use the same value as DEFAULT_ACCELERATION for compatibility.
When reading uninitialized memory, preset the travel acceleration to be the same as the default acceleration.
Save some space and perform some cleanup
Use the new M204 format consistently also in M503's output
Acceleration settings need to be saved in UVLO, since these are often changed/set during a print. This is especially important for travel and retract acceleration, which is usually set once per-print. Saving and restoring is not 100% correct. We save the current front-end value, which might ahead of the backend when UVLO is triggered. Print acceleration, likely the most significant, should be saved in the block buffer to be accurate. Acceleration needs to be restored after the UVLO Z repositioning is performed, using an M204 command. This is correct, however we don't save the _temporary_ max acceleration limits set via M201, which could be higher than the saved limits (via M500). This could result in lower clamped values compared to the original print. Maximum acceleration/jerk/feedrate limits should _all_ be saved in UVLO in the future.
3840fe3
to
186ce0f
Compare
Allow to separate extrusion and travel acceleration settings using M204, as Marlin 1.1.x and 2.x does using
M204 T
.This allows to reduce the number of instructions required during printing, since resetting the acceleration just for travel moves is no longer required and can be done a single time during the print.
Provision for this parameter was pre-existing, but not implemented.
M204 has two forms: the lagacy format (Marlin <1.1):
and the newer format:
The distinction in the MK3 FW is done based on the presence of the
P
parameter. IfP
is seen, the new format is already used.In the new format however,
M204 T
was ignored until this change.To keep backward compatibility,
M204 S[acc]
will set both print and travel acceleration, which is identical in behavior to recent versions of Marlin.M500 and M503 will report settings using the "new format". A new field in the EEPROM is stored for the travel acceleration, and is initialized with the same value as the print acceleration. The initial default from a fresh eeprom is defined in the variant file, and again it is set to the same value.