Commit Graph

2952 Commits

Author SHA1 Message Date
Alex Voinea
b86aafb56e
Documentation 2020-01-29 23:07:24 +02:00
Alex Voinea
755230e2e7
fix small mistake 2020-01-29 23:07:24 +02:00
Alex Voinea
a5198e32a3
Just keep the current state. ON or OFF. No switching allowed 2020-01-29 23:07:24 +02:00
Yuri D'Elia
02d1525445 Display "POWER PANIC DETECTED" when possible
Both during early init and in uvlo_tiny, display "POWER PANIC DETECTED"
if enough charge is left.

This is not worth doing in regular uvlo_, as we want to give full
priority to the X motor
2020-01-29 21:08:56 +01:00
Yuri D'Elia
2b46fdac2d Only trigger a quick reset if there's a pending saved state
Thanks to @leptun
2020-01-29 17:56:26 +01:00
Alex Voinea
99e81812ce
Merge branch 'MK3' into MK3_BED_LEVELING_PWM 2020-01-29 17:56:10 +02:00
Alex Voinea
4fd913ddf3
Remove commented out code 2020-01-29 17:45:47 +02:00
Yuri D'Elia
b46dc59fad Refuse to start a print if power is lost before arming uvlo
If power has been lost during startup already a falling edge would be
skipped, causing the print to continue and lose its state without
being able to save again.

Check for a low line after arming the interrupt and simply wait
for reset.
2020-01-29 16:06:54 +01:00
Yuri D'Elia
200cdde1af Setup the UVLO interrupt later during initialization
Do not allow uvlo_tiny() to trigger before the previous print has
already been recovered.

A quick repeated power failure could cause uvlo_tiny to overwrite
the Z position before it has been correctly recovered.
2020-01-28 21:50:12 +01:00
Yuri D'Elia
3da20db024 Really poweroff Z motors when PSU_Delta is defined
enable/disable_z behave differently when PSU_Delta is defined.

During powerpanic and kill however we do *really* need to save energy
and poweroff the motors.

Rename enable/disable_z as poweron/poweroff_z and define some aliases so
that we can use the low-level function where needed.
2020-01-27 18:50:17 +01:00
Yuri D'Elia
5d88573711 Save/restore hotend temperatures above 255C in PowerPanic
Use 2 bytes to store extruder temperature during UVLO.

Re-use the storage of EEPROM_UVLO_TINY_Z_MICROSTEPS which has been freed
by previous changes.

Fixes #2303
2020-01-27 14:59:18 +01:00
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
0702e0de6e Use world2machine instead of repeating code 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
Alex Voinea
4055977a95
Do not clear axis known position when Z is set to silent
Also removed unused (forgotten) variable.
2020-01-25 11:41:27 +02:00
MRprusa3d
73527d6069 selfTest workflow optimalization 2020-01-22 04:45:13 +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
e6ba9e633c
Adjusted hotend, bed and Ambient mintemp values 2020-01-21 14:50:53 +02:00
DRracer
95a2ad533d Version changed (3.9.0 build 3175) 2020-01-16 16:03:34 +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
1a8420f3f9
Merge pull request #2383 from wavexx/fix_usb_resume_check
Fix fan_check_error check in usb print resume
2020-01-15 12:48:48 +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
DRracer
4c74866864
Merge pull request #1933 from prusa3d/enable_cutter
Enable MMU cutter.
2020-01-09 13:47:44 +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
df300a2488
Merge pull request #2403 from leptun/MK3_unknown_Z_mark
Show ? near Z value if the position is unknown
2020-01-08 14:55:37 +01:00
DRracer
e15d5e21f5
Merge pull request #2402 from leptun/MK3_sheet_on_status_screen
Do not show sheet on status screen if less than 2 are initialized
2020-01-08 14:42:29 +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
8b0f0695a8
Merge branch 'MK3_fix_shorter_sheet_name_on_status_screen' into MK3_sheet_on_status_screen 2020-01-08 15:31:33 +02:00
Alex Voinea
9abdf4e535
Show ? near Z value if the position is unknown 2020-01-08 13:46:51 +02:00
Alex Voinea
c5324291ad
Do not show sheet on status screen if less than 2 are initialized 2020-01-08 12:48:41 +02:00
Alex Voinea
d9e5283526
Fix pause->stop->PrintFromSD scenario 2020-01-07 21:02:13 +02:00
Alex Voinea
1996fc7940
Remove commented-out code 2020-01-07 20:43:56 +02:00
Alex Voinea
4422fc29f8
Set XYZ to absolute and E to relative 2020-01-07 20:42:21 +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
Alex Voinea
b05ee33fc9
Merge branch 'MK3' into MK3_BED_LEVELING_PWM 2020-01-07 07:58:32 +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
57be14fca6 Complete all pending moves before restoring a saved print 2019-12-30 13:30:06 +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
186f881600 Avoid calling fsensor_update() one level earlier
Move the common checks between filament sensors out of fsensor_update().

Disable the runout check if a saved state is already present (this check
was missing in the PAT9125 variant) as this is currently not supported.

Note that the CHECK_FSENSOR looks completely redundant besides
e_active().
2019-12-29 22:08:44 +01:00
Yuri D'Elia
bd80ee88a0 Set the IN_HANDLER busy state while checking the filament 2019-12-29 21:27:42 +01:00
Yuri D'Elia
97170ed68d Do not call process_commands() within fsensor_update()
Plan moves directly to reduce the required stack size.
2019-12-27 19:37:20 +01:00
Yuri D'Elia
fe4c00fb8a Lift the extruder when checking for the filament
This avoids leaving marks on the print
2019-12-27 19:35:08 +01:00
Yuri D'Elia
301d64042b Set fsensor_watch_runout earlier to prevent re-entry
Do not set/clear fsensor_watch_runout within fsensor_oq_meassure_start
which is used outside of fsensor_update where it could have a different
starting value.

Set it within fsensor_stop_and_save_print to immediately prevent
re-entry.
2019-12-27 19:34:36 +01:00
Yuri D'Elia
a31319888c Fix fan_check_error check in usb print resume
Also check for fan_check_error == EFCE_OK in addition to EFCE_FIXED.

Reorganize the check in order to fix both #if[n]def FANCHECK cases,
as similarly done in the SDSUPPORT case a few lines below.
2019-12-23 19:12:46 +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
Alex Voinea
f071aec747
Fix sheet minimum width on the status screen 2019-12-18 08:52:25 +03:00
Yuri D'Elia
8d490f941a Make use of the CRITICAL_SECTION macros in lcd_print_stop 2019-12-16 16:39:20 +01:00
Yuri D'Elia
0cc68228f8 Unretract when resuming a paused print 2019-12-16 16:33:11 +01:00
DRracer
955c88cf68
Merge pull request #2370 from wavexx/no_resume_while_resuming
Do not allow to resume a print twice while waiting for the hotend
2019-12-16 16:26:02 +01:00
Yuri D'Elia
faa76df2fe Fix the "Stop print" behavior from the LCD
Correctly cleanup the printer state when stopping the current print:

- Disable interrupts while aborting the planner/queue to ensure
  new serial commands are not inserted while aborting
- _Always_ call planner_abort_hard() to interrupt any pending move!
- Clear the saved_target, which might be set when calling stop
  from within a paused state. Create a new function to clear the
  paused state for future use.
- Do not disable/reset the MBL: doing so will destroy the ability to
  restart correctly using M999.
2019-12-16 15:52:37 +01:00
Yuri D'Elia
348bbbffb0 Do not allow to resume a print twice while waiting for the hotend
Clear isPrintPaused just prior to restore_print_from_ram_and_continue.
2019-12-15 22:22:44 +01:00
DRracer
d4fab1a713
Merge pull request #2304 from 3d-gussner/MK3-Fix_M81
Fix M81 Turn off Power Supply...
2019-12-15 11:52:56 +01:00
DRracer
c45d4f4bba
Merge pull request #2088 from rhounsell/MK3
Fix for Toshiba FlashAir (or other) SD card initialization
2019-12-15 11:46:56 +01:00
DRracer
44288bfe90
Merge pull request #2309 from leptun/MK3_fix_MMU_pause_time
Fix MMU needs user attention Statistics error
2019-12-15 11:04:57 +01:00
DRracer
d6ac9e4638
Merge pull request #2342 from vintagepc/2306-hard-reset-homing-fails
Fix #2306 hard reset homing fails
2019-12-15 10:51:52 +01:00
DRracer
c122399020
Merge pull request #2270 from leptun/MK3-PFW-1024
PFW-1024
2019-12-15 10:25:37 +01:00
DRracer
d68d9c7fef
Merge pull request #2058 from leptun/MK3_fix_warnings
Fix "LANG_MODE 0" warnings
2019-12-15 09:29:27 +01:00
Alex Voinea
770fcd7c42
Merge branch 'MK3' into MK3-PFW-1024 2019-12-14 10:08:52 +02:00
DRracer
6ab3b20ce1
Merge pull request #2348 from leptun/MK3_fix_kill
Fix kill messages
2019-12-13 18:30:27 +01:00
DRracer
1423de10a9
Merge pull request #2362 from leptun/MK3_Fix_Lang_64K_limit
Fix optiboot erase function after address 0xFFFF. Allows language files greater than 64K
2019-12-13 13:59:23 +01:00
DRracer
30cee7afca
Merge pull request #2353 from wavexx/lcd_pause_fixes
Fix the LCD pause (regression)
2019-12-13 13:53:29 +01:00
DRracer
838cec75ec
Merge pull request #2352 from wavexx/fix_m603_regression
Use lcd_print_stop() in M603, fix octoprint regression
2019-12-13 13:52:40 +01:00