Commit Graph

1302 Commits

Author SHA1 Message Date
Yuri D'Elia a5e4df390d Sync before/after setting mesh_bed_leveling_flag/homing_flag
mesh_bed_leveling_flag and homing_flag should be set only when the
planner is empty as a consequence of #3100, since any operation executed
*while* the mbl/homing flag is set is considered part of the compound
instruction that generated it (G80, G28, G30, G76).

Failure in doing so can result in instructions just prior being lost,
since they're incorrectly discarded (assumed to be redone).

G1  ; lost ..
G80 ; .. if PP happens here
2021-04-19 06:31:57 +02:00
DRracer f9f6284c50
Merge pull request #3100 from wavexx/powerpanic_state_fixes
Fix PowerPanic and Crash Detection during homing and bed leveling
2021-04-07 18:19:50 +02:00
Yuri D'Elia 61faa49cbb Fix buffer overflow in buf
Fix cmd overflow introduced in 186ce0f.

With a precision of %f being .6 and assuming a maximum (theoretical)
acceleration of 99999 we need 47 bytes including terminating byte.

Round it to 48
2021-04-07 15:57:50 +02:00
Alex Voinea 9454f9d8ec Rename w25x20cl to xflash 2021-04-06 10:16:47 +02:00
Yuri D'Elia 449d181971 G80: handle power panic
This is handled in the same way crash detection is handled: homing/mbl
invalidates saved_target _and_ current position.

Fixes PP recovery during MBL and homing.
2021-04-06 02:20:00 +02:00
Yuri D'Elia b46a52ffa8 G80: Handle crash detection
At a higher level, crash detection will repeat the last gcode command.

Some commands such as G28 or G80 need to be repeated in full and require
special handling.

In such cases, do not store the saved target coordinate (which is fake
in such cases) and invalidate the saved position.

This fixes the last coordinate of the first G1 move after recovery.

We also avoid moving from the origin when the saved position is
invalidated, which is not strictly necessary, but saves some time.
2021-04-06 02:00:47 +02:00
Yuri D'Elia a5530593fa G80: preserve lcd status and message when aborting
Restore the old status just before returning, so that the subsequent G80
can restore the first (initial) message correctly.
2021-04-06 00:31:56 +02:00
Yuri D'Elia 5923276a86 G80: correctly abort during crash detection
Crash detection is handled at a higher level (which automatically
repeats the current command), however we still need to abort the current
command correctly.

Handle XY crashes by checking the planner status after st_synchronize().
2021-04-06 00:31:29 +02:00
Yuri D'Elia 5da39df968 G80: Use consistent XY axis feedrate 2021-04-06 00:10:33 +02:00
Yuri D'Elia ce2e35d14d Move G80 into it's own function
No actual changes done in the function in this, besides break->return.

In G28, simply call the new function instead of using goto, making the
code more readable.

Also remove the senseless comments in G28 about command queuing (dating
back to when G80 was queued instead of being executed).
2021-04-05 23:35:17 +02:00
Yuri D'Elia d2be40491b PP recovery: clamp initial position to software endstops
As done when initializing the printer from a cold start, we need to
clamp the starting position to software endstops before setting the
planner position since 0,0 is frequently out-of-bounds.

This avoids an useless move during recovery that can cause a crash:

- Initial X is set to be 0
- G1 performed by homing will clamp X>=0, resulting in a positive shift
- If X is already at max X (extruder being parked due to PP), this will
  slam at X+, causing an immediate crash.
2021-04-05 22:11:06 +02:00
Yuri D'Elia 6a61c26955 Removed unused crashdet_stop_and_save_print2 2021-04-05 20:04:50 +02:00
DRracer a251dcc14e
Merge pull request #3064 from 3d-gussner/PFW-1222
PFW-1222: Disable M120 M121
2021-03-30 10:09:47 +02:00
DRracer 8ac1d5b95e
Attempt to workaround the M73 C0|D0 visual issue (#3067)
Attempt to workaround the M73 C0|D0 visual issue

This is an attempt to enable alternation of time to print finish and time
to color change even in the last minute of time to color change, i.e. be
able to print "0:00C".

The proposed solution leverages the capability of the current FW to read
float values from the C|D parameter. This could have the raw benefit of
being able still to alternate this time on the LCD as "0:00C" (or
"<1min") if the slicer sends a non-zero but <1 time right before the
color change.

Co-authored-by: D.R.racer <drracer@drracer.eu>
Co-authored-by: 3d-gussner <3d.gussner@gmail.com>
2021-03-19 10:18:28 +01:00
3d-gussner 6355458052 Add def `M120_M121_ENABLED` to `Configuration_adv.h` 2021-03-11 15:00:49 +01:00
3d-gussner 832e881955 Disable M120 M121 2021-03-10 17:46:19 +01:00
DRracer c1849f5cc2
Merge pull request #2405 from leptun/MK3_NEW_SD_COMPILATION
️New SD menu
2021-03-03 11:45:04 +01:00
DRracer e9c3becb2c
Merge pull request #2572 from wavexx/fwretract_plan_sync
Always sync before manipulating the planner position in FWRETRACT
2021-03-01 08:26:57 +01:00
Alex Voinea 6e0ecf5cd2
Remove redundant click sound in factory reset (MK3 merge issue) 2021-02-26 18:22:32 +02:00
Alex Voinea 194438c130
Fix formatting 2021-02-26 09:54:57 +02:00
Alex Voinea 7faffa539a
Merge branch 'MK3' into MK3_NEW_SD_COMPILATION 2021-02-26 09:48:46 +02:00
Alex Voinea 204da1cc3f
Factory reset and check_file progress bar 2021-02-25 21:04:05 +02:00
Yuri D'Elia ff4e53d2d1 Prevent babysteps in more unsafe situations through homing_flag
Further restrict babystep insertion when the lcd_update is enabled by
toggling homing_flag when probing Z (where Z shouldn't be touched
anyway as it would disrupt the measurement)

Also reset the encoder value during mesh leveling.
2021-02-25 16:44:16 +01:00
Yuri D'Elia c241adec5f Ensure babystep_apply|undo always uses the planner
The code around these calls _requires_ that the steps are immediately
processed and/or added to the subsequent planner moves.

The only part that doesn't care about immediate insertion is the
direct user-insertion though the lcd encoder.
2021-02-25 16:44:16 +01:00
DRracer 7b22895f23
Merge pull request #3032 from DRracer/service-prep2
Make a special welcome message for Shipping/Service prep.
2021-02-25 08:51:47 +01:00
DRracer 9ed713ab13
Merge pull request #3015 from 3d-gussner/PFW-1174
PFW-1174: Add pause/resume for USB/host prints via LCD menu
2021-02-25 08:50:41 +01:00
3d-gussner 08a6a4b25e Enable Filament sensor action during print even if in Support::Sensor info 2021-02-23 15:19:03 +01:00
3d-gussner 9110ffd4ae Revert `M602` 2021-02-22 16:36:21 +01:00
3d-gussner a109d20506 Merge remote-tracking branch 'upstream/MK3' into PFW-1174
Fix merge issues
2021-02-18 11:05:31 +01:00
3d-gussner c1d8e6660b Indentations 2021-02-18 10:07:40 +01:00
DRracer adf347fdf1
Merge pull request #3034 from 3d-gussner/MK3_PFW-960
PFW-960 Improve M0/M1/M117
2021-02-18 09:59:01 +01:00
3d-gussner 291ee8e46d Indentations 2021-02-18 09:53:14 +01:00
3d-gussner 75a385d614 Indentations 2021-02-18 09:10:28 +01:00
3d-gussner 2b4cf8d56e Fix FANCHECK build error 2021-02-17 13:52:31 +01:00
D.R.racer c3bea4d71c Make a special welcome message for shipping/service prep
Another request from our Service dept. - the user shall be prevented
from skipping the intro wizard, because otherwise some preset/calibrated
features will look like not done - especially live-z calibration.

And since there are users, who send a machine to service to perform 1st
layer calibration only, they must not omit the Z-calibration at the
start after shipping.
2021-02-17 12:53:56 +01:00
DRracer 7a84ad71dc
Merge pull request #3023 from DRracer/service-prep
Add Service prep. item into Factory reset
2021-02-17 10:43:08 +01:00
D.R.racer dbb0269bd4 Make indentation consistent with surrounding code in factory_reset() 2021-02-17 08:27:49 +01:00
3d-gussner afc15b42bb Indentations 2021-02-17 08:13:32 +01:00
3d-gussner 59c2b7e795 Fix Fan error issues. 2021-02-17 07:42:12 +01:00
3d-gussner 66ea1bdfba Indentations 2021-02-16 12:31:23 +01:00
3d-gussner 583993b7e2 Back to "Status" after gcode `M0/M1` 2021-02-15 15:25:04 +01:00
3d-gussner 25928232e4 Merge remote-tracking branch 'upstream/MK3' into MK3_PFW-960 2021-02-15 13:06:47 +01:00
3d-gussner 9071a9f8fd Gcode `M1` must have a string while `M0` it is optional
As the `M0/M1` moved to the beginning of the parser
- parser would not be able to "find" `M1nn` command if the query was `M1` instead of `M1 `
- to be able to "stop/halt" without sending a string and display default message use gcode `M0`
- as there are no `M0nn` gcodes the parser can query `M0` without additional space needed as in `M1 `
2021-02-15 12:51:12 +01:00
3d-gussner c95a8e13d7 Fix indentations to 4 spaces per tab 2021-02-12 11:47:02 +01:00
3d-gussner b13d4b71d4 Add Change time behind existing message 2021-02-11 07:47:44 +01:00
3d-gussner d063ffb141 Add parameter `D` to gcode `M73` for silent/stealth mode 2021-02-11 07:47:43 +01:00
3d-gussner 91c767b0f2 Reduce code size 2021-02-11 07:47:43 +01:00
3d-gussner ae48e7c3ce indentation 2021-02-11 07:47:43 +01:00
3d-gussner f4ca6ee59d Fix typo 2021-02-11 07:47:43 +01:00
3d-gussner cca90da64b Include silent mode on time change
- depends on difference between print time remaining NORMAL vs SILENT mode
2021-02-11 07:47:43 +01:00