Commit Graph

1062 Commits

Author SHA1 Message Date
Yuri D'Elia
50a9fe003a Bump the unparking speed to 50mm/s (same as M600 recovery) 2020-01-27 11:08:28 +01:00
Yuri D'Elia
eb2ca78167 Rewrite uvlo handling for accurate Z re/positioning
- In both uvlo_ and uvlo_tiny, calculate Z usteps properly and adjust
  the Z position to a true fullstep before disabling the motor. This
  avoids shifs during recovery.
- In uvlo_tiny, instead of moving up indefinitely, adjust Z just
  once using the smallest move possible (new def UVLO_TINY_Z_AXIS_SHIFT)
- Perform all the uvlo/recovery processing in physical coordinates
  and MBL off: there should be no automatic Z movement!
- Disable heaters in both handlers to conserve more power.
- Add timing information to uvlo_tiny too.
- During recovery, to switch between physical and logical positioning
  introduce a new "PRUSA MBL" gcode as most of the procedure is
  enqueued, and no existing gcode was available.
2020-01-26 17:46:50 +01:00
Yuri D'Elia
11a0e95f60 Re-enable the code that moves the extruder during PP
There is frequently plenty of power left during a PP. Take advantage of
it by moving the extruder to either side of the axis to detach
completely the nozzle from the print.

Re-enable Z during this move to avoid losing the current step.
2020-01-26 17:46:50 +01:00
Yuri D'Elia
ec5cbf73b9 During PP keep the watchdog waiting for longer
When the printer is connected to a USB host during a PP (and the host
does not lose power), the rambo can linger for longer, sometimes for
long enough to recover the print state. Drain some more power.
2020-01-26 17:46:50 +01:00
Yuri D'Elia
ec8b5aaa34 Do not attempt to "zero-phase" the microstep counter
If the motors are off-phase, this is more likely to "bump" them to an
incorrect/reverse full-step, doing worse.

We need to ensure the motors are already positioned on a fullstep
during power panic instead.

Remove the PSU_DELTA exception: Z _always_ needs to be powered here.
2020-01-26 17:46:26 +01:00
Yuri D'Elia
5310181970 Cancel a recovering print when using the LCD "Stop"
Also clear the UVLO flag when using lcd_print_stop. This prevents an
aborted print which has been cancelled while unparking (just prior to
recover) to come back again at the next startup.
2020-01-26 17:45:47 +01:00
Yuri D'Elia
7f3d4a8491 Restore the last E axis position correctly after powerpanic
- Initially restore the last E position from the eeprom in any case, not
  just when using absolute mode (although unnecessary: since it will be
  reset later), fixing a possible unitialized position and crash during
  recovery (thanks to @leptun)
- Remove useless extra calls to put the extruder in relative mode:
  the extruder already starts in relative mode and is later switched to
  absolute.
- Replace incorrect calls to STRINGIFY with sprintf_P
- Retract after pressure has been restored in uvlo_tiny, to be
  consistent with a regular uvlo (remove the bogus double unretract
  as a result).
- Set the real E position prior to the panic *after* the retraction,
  using the now-fixed G92.
2020-01-21 17:41:43 +01:00
Yuri D'Elia
4c8f1e8b89 Use eeprom_update_word instead of EEPROM_save_B 2020-01-21 16:36:34 +01:00
Yuri D'Elia
9ac80f73f2 Remove an useless/duplicate Z move
Likely a result of a merge
2020-01-21 16:34:09 +01:00
Yuri D'Elia
8437630122 Inhibit serial processing in uvlo_
Do not process serial commands when re-enabling the global isr.
While printing via USB and a power panic is triggered, *any* extra
command should be ignored.

Abuse the "saved_printing" variable to inhibit serial processing.
2020-01-21 16:29:12 +01:00
Yuri D'Elia
e8f05d0668 Heat both nozzle/bed together while recovering a print 2020-01-21 16:26:16 +01:00
Yuri D'Elia
67decb466d Avoid another call to st_get_position_mm
current_position is already filled by planner_abort_hard.
2020-01-21 16:24:19 +01:00
Alex Voinea
1d17a37250
all axis -> all axes 2020-01-16 09:15:44 +02:00
leptun
ccd3885d84
rephrase G28 W 2020-01-15 23:01:09 +02:00
Alex Voinea
6a1eb63a52
Add @todo to M999 2020-01-15 22:41:02 +02:00
Alex Voinea
d676542229
Revert code changes 2020-01-15 22:38:00 +02:00
Alex Voinea
47ddc2e902
M204 - better old_new separation 2020-01-15 22:35:34 +02:00
Alex Voinea
622319f86c
Add missing LF 2020-01-15 22:30:53 +02:00
Alex Voinea
ea51696a68
Merge Special sections as requested 2020-01-15 22:30:43 +02:00
Alex Voinea
aac66d4a4b
Add missing quote 2020-01-15 22:21:23 +02:00
Alex Voinea
d95029bbc7
Merge remote-tracking branch '3d-gussner/MK3-Gcode_documentation' into MK3-Gcode_documentation 2020-01-15 20:17:51 +02:00
Alex Voinea
cabfc37f15
The other changes 2020-01-15 20:17:26 +02:00
3d-gussner
5ff6c1f22c Merge remote-tracking branch 'upstream/MK3' into MK3-Gcode_documentation 2020-01-15 16:36:08 +01:00
Alex Voinea
4cf4720a15
Even more formatting fixes 2020-01-15 17:27:54 +02:00
Alex Voinea
7118007efe
Adjustments 2020-01-15 15:52:56 +02:00
Alex Voinea
7ea00a7efd
Fix typo in page description 2020-01-15 15:31:28 +02:00
Alex Voinea
8449136520
Separate M117 from the TMC2130 commands 2020-01-15 15:31:14 +02:00
Alex Voinea
4a4d7976d1
Fix PRUSA typo 2020-01-15 15:30:48 +02:00
Alex Voinea
55f3e7acaf
Merge branch 'MK3' into MK3-Gcode_documentation 2020-01-15 15:12:18 +02:00
DRracer
27f6807bd5
Merge pull request #2416 from wavexx/fix_G92_e_reset
Fix incorrect usage of plan_set_e_position() in G92 E*
2020-01-15 12:52:13 +01:00
DRracer
7230b99448
Merge pull request #2393 from wavexx/sync_before_resume
Sync before resume
2020-01-15 12:49:56 +01:00
DRracer
43870c4028
Merge pull request #2368 from wavexx/unretract_after_lcd_pause
Unretract when resuming a paused print
2020-01-15 12:47:24 +01:00
Yuri D'Elia
bab756699f Fix incorrect usage of plan_set_e_position() in G92 E*
To maintain an accurate step count (which is required for correct
position recovery), any call to plan_set_position&co needs to be done
synchronously and from a halted state.

However, G92 E* is currently special-cased to skip the sync (likely to
avoid the associated performance cost), causing an incorrect E step
count and position to be set. This breaks absolute position recovery,
miscalculation of the LA factor and possibly other weird issues.

We rewrite the handling of G92 to always sync but still special-case the
frequent "G92 E0" for performance by using a free bit in the block flags.

To avoid a sync, we relay the request for reset first to the planner
which clears its internal state and then relays the request to the final
stepper isr.
2020-01-14 20:24:14 +01:00
Alex Voinea
32c9cd2307
Merge branch 'MK3' into fix_lcd_stop 2020-01-09 14:17:56 +02:00
DRracer
b088500eaf
Merge pull request #1909 from wavexx/MK3_LA15
Linear Advance 1.5 Returns
2020-01-09 11:22:06 +01:00
3d-gussner
f3668cab92 Merge remote-tracking branch 'upstream/MK3' into MK3-Gcode_documentation
Fix merge issues with G90 and G91
2020-01-08 15:47:38 +01:00
DRracer
2f2e415eae
Merge pull request #2382 from wavexx/fix_lcd_stop
Fix lcd "Stop" when used within a pause
2020-01-08 14:40:54 +01:00
DRracer
3ef1c52a0a
Merge pull request #2381 from wavexx/remove_relative_mode
Remove "relative_mode", only use "axis_relative_modes"
2020-01-08 14:39:43 +01:00
Alex Voinea
1996fc7940
Remove commented-out code 2020-01-07 20:43:56 +02:00
Alex Voinea
f8a0d5d773
Fix lcd_print_stop function 2020-01-07 19:54:06 +02:00
Alex Voinea
df0d781c20
Merge branch 'MK3' into fix_lcd_stop 2020-01-07 19:53:55 +02:00
Yuri D'Elia
853991865c Improve raise_z_above to always raise when at Z_MIN
When check_z_endstop is set, Z_MIN_PIN is checkend regardless of the
moving direction to support Z calibration. This prevents the ability
to use _just_ SG when moving upwards.

But since we know the extruder is at Z_MIN, it's always safe to raise
irregardless, so we can dodge the issue.
2020-01-02 18:07:30 +01:00
Yuri D'Elia
5660fcffb0 Do not enqueue a E/Z moves unless requested
Do not unconditionally enqueue a Z move if no move has been requested.
Since Z is calculated using the absolute current (saved) position and
scheduled for later execution, the queue order becomes relevant.
2019-12-30 14:49:07 +01:00
Yuri D'Elia
86696156af Improve K error checking, allow to manually reset the version
Properly check K independently for each version by delegating it to la10c_value()

Handle -1 as a special case to allow manual reset.
2019-12-30 14:31:39 +01:00
Yuri D'Elia
fd0ed1f0ea Move LA reset from G28 to G80, do not reset on 0
In preparation for #2161, use MBL (G80) as a "new print" boundary
instead of just re-homing to ensure the reset is issued only once for
each print.

Similarly, do not reset the autodetection when LA is disabled via M900
K0. This can/will be used during a print if different quality settings
are used for different filling roles.
2019-12-30 11:32:27 +01:00
Yuri D'Elia
d78636c308 Do not synchronize on M900
Since the advance factor is computed per-segment in LA15, there's no
need to stop the planner. Allow changing K freely at each segment.

This allows varying quality factors for different filling roles, see:
https://github.com/supermerill/Slic3r/issues/108

During pause/resume/crashdetect or powerpanic K might temporarily be out
of sync when used this way. If this becomes an issue, we might need to
store K for each block, as done for the feedrate.
2019-12-29 23:25:16 +01:00
Yuri D'Elia
f5d382f9f4 Remove useless st_synchronize calls when unparking 2019-12-29 22:20:24 +01:00
Yuri D'Elia
7b29ce29b4 Add a Linear Advance 1.0->1.5 compatibility layer
Allow existing gcode using LA10 to transparently take advantage of LA15
by using a simple linear conversion function based on experimental
results with the MK3 implementation of linear advance.

Autodetect LA10 values based on the first M900 instruction contained in
the print. In order to support printing mixed files without resetting
the printer we also reset the autodetection status when starting a new
SD print and/or when explicitly disabling LA.

Since we cannot reliably detect whether a new print is started when
printing via USB, also reset the detection status when homing in G28,
which is generally performed once at each print. Note that this doesn't
clear the previous K value, it only allows a subsequent M900 to provide
LA10 values when printed after a LA15 file.
2019-12-21 23:22:35 +01:00
Yuri D'Elia
c0ae92cd2a Remove "relative_mode", only use "axis_relative_modes"
axis_relative_modes can cleanly handle G90/G91 and M82/M83 without the
need of "relative_mode" entirely.

Change G90/G91 to simply reset all axes according to the requested
state, which avoids to check two variables in get_coordinates(),
fixing the following incorrect handling:

G91   ; all axis relative
M83   ; set extruder absolute
G1 E1 ; should be an absolute move, but still relative
2019-12-20 18:47:30 +01:00
Yuri D'Elia
8d60e4d6db Merge remote-tracking branch 'upstream/MK3' into MK3_LA15 2019-12-18 18:28:41 +01:00