Commit Graph

1112 Commits

Author SHA1 Message Date
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
Alex Voinea
2e50954710
Merge branch 'MK3' into MK3_fix_selftest_Z_crash2 2020-01-22 14:56:54 +02: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
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
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
Yuri D'Elia
0cc68228f8 Unretract when resuming a paused print 2019-12-16 16:33:11 +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
Alex Voinea
a8e6020238
Fix VERBOSITY 2019-12-16 15:21:55 +02: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
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
30cee7afca
Merge pull request #2353 from wavexx/lcd_pause_fixes
Fix the LCD pause (regression)
2019-12-13 13:53:29 +01:00
Yuri D'Elia
5122f79a39 Merge remote-tracking branch 'upstream/MK3' into MK3_LA15 2019-12-04 17:27:23 +01:00
3d-gussner
17e23693eb Fixed stuipid copy paste error 2019-12-04 14:21:43 +01:00
3d-gussner
0cafd10378 minor fix 2019-12-04 13:43:19 +01:00
3d-gussner
f7bfca3061 Fix merge issues 2019-12-04 13:39:56 +01:00
3d-gussner
7da1db2f25 Merge remote-tracking branch 'upstream/MK3' into MK3-Gcode_documentation 2019-12-04 13:35:09 +01:00
3d-gussner
fb3c65b3dc fixed links to RR Wiki 2019-12-04 12:38:43 +01:00
3d-gussner
cdc6beaf6f Added M910 -> M918 2019-12-04 12:25:33 +01:00
3d-gussner
a5f3027ee1 D2130 updated
Needs review
2019-12-04 11:38:29 +01:00
Yuri D'Elia
8448b8d413 Keep destination updated in an aborted plan as well
When aborting the plan destination is updated anyway to reflect the latest
position. There's no use in this additional check.
2019-12-03 20:37:13 +01:00
Yuri D'Elia
d60230e494 Add some documentation 2019-12-03 20:37:13 +01:00
Yuri D'Elia
792d7ca6dc Turn off heaters just prior to retraction to limit oozing 2019-12-03 20:37:13 +01:00
Yuri D'Elia
4fce74140a Also abort planning in stop_and_save_print_to_ram
Similarly to resume_print_from_ram_and_continue, abort any
planning in mesh_plan_buffer_line already in stop_and_save_print_to_ram
in case it is called for pausing only.
2019-12-03 20:37:09 +01:00
3d-gussner
0ce7c51c1d Added more D-codes to RR Wiki and doxygen
D-1, D80, D81, D106
2019-12-03 20:02:58 +01:00
Yuri D'Elia
454e99dbb5 Use lcd_print_stop() in M603, fix octoprint regression
M603 shouldn't report a fatal error state.
Use lcd_print_stop().

Regression introduced in PR #2274
2019-12-03 16:51:59 +01:00
Alex Voinea
e7f2577233
Fix kill messages 2019-11-29 22:49:22 +02:00
Alex Voinea
a413cfbb9a
Merge branch 'MK3' into MK3-PFW-1024 2019-11-29 13:07:45 +02:00
Yuri D'Elia
dbe2ed4150 Fix pause/resume when using M25/M601
Remove the conflicting and mostly useless card.paused flag (the printing
is either paused, or not) and switch to isPrintPaused only which
accounts for both cases (SD/USB) correctly.

Fix M27/getStatus to show the current real status of the SD print.

Synchronize the queue on M601, as required to precisely pause the print
at the correct instruction.

Alias M25 to M601, which when combined with PR #1899 fixes issue #1614.

Guard against incorrect usage in M601, M602 and M603.
2019-11-28 17:37:58 +01:00
Yuri D'Elia
18eaf21baf Halve memory usage of saved feedrate
Truncate the saved feedrate to an uint16_t.
This is more than sufficient for recovery.
2019-11-28 17:16:37 +01:00
Yuri D'Elia
17176c1df2 Save/restore the default feedrate correctly
Since the global feedrate can be similarly modified for moves ahead of
time, save the original feedrate in the planner as we do for
gcode_target.

This avoids having to undo feedmultiply (and machine limits!) from
"nominal_speed" as previously done.

Thanks @leptun
2019-11-28 17:16:37 +01:00
Yuri D'Elia
4f0af648fb Save/restore feedmultiply independently of the feedrate 2019-11-28 17:16:36 +01:00
Yuri D'Elia
6ecff003b7 Fix M600 insertion by the filament sensor
Remove incorrect usage of stop_and_save_print combined with the
fsensor_recovert internal instruction which would result in a
broken sequence of events and/or broken stack.

Re-use the now safe stop/recover functions in the same spot
(fsensor_checkpoint_stream) to effectively cut a hole in the current
gcode stream to insert an M600 instruction, which removes all
recursive behavior without the need of extra state variables.
2019-11-28 17:13:37 +01:00
Yuri D'Elia
4268c2fdae Fix recovery from relative/chunked moves
When starting to replay existing USB/SD commands from a recovery state,
an immediate relative move needs to compensate for a previously
interrupted move. This is almost the norm for the E axis.

Instead of saving the relative status of the move (which needs to
account for the world2machine conversion and is not always available on
a chunked move split by MBL) save directly the calculated target
position for the move in the original plan, which is easy to replay.
2019-11-28 16:42:35 +01:00
Yuri D'Elia
faa9e925fe Replace a few loops with set_current_to_destination() 2019-11-28 15:57:21 +01:00
Yuri D'Elia
5fa7c178b5 Do not set current_position in mesh_plan_buffer_line
This is a task which _has_ to be performed by the caller,
such as prepare_move().
2019-11-28 15:57:21 +01:00
Yuri D'Elia
0f6b9b4051 Unroll the stack in restore_print_from_ram_and_continue
While handling moves in a recursive plan, such a filament check,
ensure restore_print_from_ram_and_continue unwinds the stack by
aborting early from any call that waits on the planner.

This currently only handles G1 moves, but hard-coded behavior that can
trigger recursive behavior (such as filament change) will probably have
to be checked too.
2019-11-28 15:57:20 +01:00
3d-gussner
660b646b57 RR Wiki for Dcodes
open D-1, D80, D81, D106, D2130
2019-11-27 11:29:55 +01:00
3d-gussner
475551431c How does M862.5 P works??? 2019-11-26 20:21:05 +01:00
3d-gussner
84cb373905 More G codes documented in RR wiki
M44, M45, M47, M403, M509, M851, M601, M602, M603, M862
2019-11-26 20:11:55 +01:00
3d-gussner
5eaf6f0133 Merge branch 'MK3' into MK3-Gcode_documentation
Merge with MK3 branch
2019-11-26 12:48:21 +01:00
DRracer
abb220ff69
Merge pull request #2323 from Panayiotis-git/MK3_Fix_M603
Add oversighted ‘break’ statement at the M603 command's source
2019-11-25 06:04:41 +01:00
Alex Voinea
07b6173aaa Merge branch 'MK3' into MK3-PFW-1024 2019-11-16 11:28:29 +02:00
DRracer
86ea24c364
Merge pull request #2273 from wavexx/do_not_wait_for_disabled_heater
Do not wait forever if the heater on the extruder is disabled
2019-11-15 17:19:11 +01:00
Panayiotis-git
23cf076242 Add oversighted ‘break’ statement at the M603 command's source 2019-11-12 21:32:39 +02:00
3d-gussner
422e7fde4a Merge branch 'MK3' into MK3-Gcode_documentation 2019-11-08 18:16:56 +01:00
DRracer
4cf2f05d1d
Merge pull request #2057 from leptun/MK3_fix_M350
M350 for all axis - MK3
2019-11-08 16:15:15 +01:00
DRracer
a14d7545a5
Update Marlin_main.cpp 2019-11-08 16:06:42 +01:00
DRracer
b33c79e6c7
Merge pull request #1899 from wavexx/fix_lcd_pause_function
Fix the LCD pause function
2019-11-08 14:55:13 +01:00
3d-gussner
5bd995b21b Added more info to doxygen G-Codes 2019-11-06 11:14:06 +01:00
3d-gussner
e6eeafd20c More M-Commands ... 2019-11-05 15:47:04 +01:00
3d-gussner
ca234a11ed M-Commands to M240 2019-11-05 12:40:51 +01:00
3d-gussner
8114bd5b1c Merge with MK3 and few spaces 2019-11-05 09:05:05 +01:00
leptun
cd5ff783cf General fixes and improvements to code 2019-10-31 19:07:20 +02:00
3d-gussner
4501f9d760 M commands documentation #2 2019-10-31 15:46:23 +01:00
3d-gussner
c899320590 Fix M81 Turn off Power Supply...
... as it should be active if PS_ON_PIN is defined and assinged to an actual pin.
2019-10-31 15:08:07 +01:00
3d-gussner
ce8dbb5013 M commands documentation #1 2019-10-30 18:52:25 +01:00
3d-gussner
b9dca5f895 other doxygen format changes 2019-10-30 15:52:27 +01:00