Commit Graph

1619 Commits

Author SHA1 Message Date
D.R.racer 37b50477cd Fixup after rebase onto MK3 2022-09-16 10:23:47 +02:00
Guðni Már Gilbert 2616df66af PFW-1386 st_get_position_mm() is more accurate when using endstops (not homed printer)
If the endstops kick in, then st_get_position_mm shows the actual travel distance. current_position[Z-AXIS] does not get updated correctly thus we cannot use it when unhomed.

current_position[Z-AXIS] is later set to Z_MAX_POS,
we cannot use that either to calculate the travel distance
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert f409426bdc PFW-1386 Refactor raise_z
Removed the "plan" parameter.
We were incorrectly returning from the function if the printer was homed,
but plan = false. This would leave current_position with an incorrect value

If the printer is homed => finish the move and return the travel distance

If the printer is not homed => rely on end stop to prevent damage,
return travel distance even if the endstop stopped the move.
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 4a1479b5bc PFW-1386 Clamp Z-axis when homed 2022-09-16 10:22:39 +02:00
Guðni Már Gilbert fa6e30389a PFW-1386 Add a TODO
When recovering the Z-axis in M600, we'd like the Z move to
happen after the XY move.
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert ff91b4670d PFW-1386 Use same code for Z-lift in M600 as in M701/M702
This reduces flash usage by 128 bytes!
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 38952f1f33 PFW-1386 Optimisation: st_synchronize is not needed after raise_z_above
Saves 16 bytes of flash
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 214b6a9220 PFW-1386 M701, M702: Move Z-axis using relative position
* Created a new function raise_z() which will move the Z axis by some
X millimeters. If plan = false, the function will return the
actual travel distance since the move is blocking.
* raise_z_above() is refactored to call raise_z()

Now the M701 and M702 will move the Z-axis relatively, and also
when done, revert the Z axis position when done.
This is a similar behavior as in Marlin 2.
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 217b537961 PFW-1386 Remove old debug message to save space
Saves 34 bytes of flash
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert bb0bbfb45f PFW-1386 Minor correction to M707 and M708 useage example 2022-09-16 10:22:39 +02:00
Guðni Már Gilbert d78c575399 PFW-1386 Address should accept hexidecimal values
Now these are equal:
M707 A255 C1
M707 A0xFF C1

Both address inputs are interpreted as FF
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert ba7dae5c79 PFW-1386 I don't see a reason for these lines
So I'm removing them
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 3192a95e78 PFW-1386 Optimise default value assign z_target 2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 20c865c2d4 PFW-1386 Implement 'U' parameter for M702
Similar to 'L' in M701, this does not apply to the MMU
The U parameter controls how much mm the extruder will unload
Default value is 80mm
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 7e9166976f PFW-1386 Implement 'L' parameter for M701
It is only used when the MMU is disabled. With the MMU we use a defined ramming sequence.

When the MMU is disabled I borrowed the usages from Marlin 2.
The L parameter only defines the length for the "fast" load length.
Default value is 70mm, same as M600
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 94dd4aec73 PFW-1386 M701 now loads to nozzle with MMU 2022-09-16 10:22:39 +02:00
Guðni Már Gilbert 8462b38446 PFW-1386 Create a common function for M704 to M706
Saves 36 bytes of flash
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 32ec1587b9 PFW-1386 Implement changes to M702 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 9b0d89213b PFW-1386 Raising Z-axis during M701 is now done via Gcode
If the Z-parameter is not issued, then default behavior will raise
the Z-axis by MIN_Z_FOR_LOAD
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 5bb36546b4 PFW-1386 Implement changes to M701 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert fb087fc535 PFW-1386 Add M707 and M708
WriteRegister and ReadRegister function will create new compiler
warnings due to unused parameters, we can ignore it for now.
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 3664d29b21 PFW-1386 Add M709 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert de0539b630 PFW-1386 Implement M704, M705, and M706 2022-09-16 10:22:38 +02:00
D.R.racer 022aa53b2d Remove active_extruder completely
we only use 1 extruder + saves ~800B
2022-09-16 10:22:38 +02:00
Alex Voinea bc85a41059 Fix xflash flashing 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 5b184d885c Add LCD_BUTTON_TIMEOUT to enum 2022-09-16 10:22:38 +02:00
D.R.racer 09cb9c6ecd Fixup after rebase + discussion 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 6bf2aebf04 Fix typo 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 80c640deb9 PFW-1373
Fix the unload procedure when the user has paused a print
then stopped the print after the temperature has reached below 175°C
Now the E-motor will move as expected
2022-09-16 10:22:38 +02:00
VintagePC 8eb054e789 Fix trying to use serial before it's intiialized 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert ed04c24ba0 Implement 'Filament not loaded' option for M600 with MMU 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert caf98936e3 Minor cleanup 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert b9c23cd6b8 Add Unloading message to LCD
Also made mmu_M600_load_filament static to limit its scope
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert d5cdb412ba Introduce a way to read the previous tool used 2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 2d02877686 Disable automatic in M600 2022-09-16 10:22:38 +02:00
VintagePC 73c486cc2f - Fix DisableMMU button on FW incompat
5823c14
- Implement eeprom var, fix reset
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 204b43dce4 PFW-1336
The following situation is now fixed, steps:
1. Load filament through LCD
2. Load to nozzle through LCD
3. Before filament reaches Fsensor => turn off the printer
4. Wait a few seconds and then turn the printer on again
5. Start a print through the SD card
6. Printer will unload and then re-load the filament

Previously in step 6, the printer would start a print without any
filament loaded.
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 46184a9447 Update printer name if M862.3 is called but not M862.2 2022-09-16 10:22:38 +02:00
D.R.racer 0e75a03c8c Reuse FSensor runout blocking impl. throughout the whole FW 2022-09-16 10:22:38 +02:00
D.R.racer f04d83fc4c Update printer's type (MMU/non-MMU) at runtime
+ reformat utils.cpp
2022-09-16 10:22:38 +02:00
D.R.racer 5082da78d2 Convert button on LCD into button for MMU
- Dependent on current MMU error being processed
- Includes rename of LEFT_BUTTON_CHOICE -> LCD_LEFT_BUTTON_CHOICE (and right, middle as well) to avoid confusion with MMU buttons' ordering
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert f1803357b0 Fix default selection after changes in PFW-1312
The Yes and No are reverted. Before PFW-132 Yes is 1 and No is 0
Now they are Yes is 0, and No is 1
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 031c588802 Make all choice menus return consistent values
Such that left = 0, middle = 1, and right = 2
2022-09-16 10:22:37 +02:00
Guðni Már Gilbert 11290c1123 Add a read function for mmu_print_saved
and remove the old extern value which is not used anymore

I had to remove "MMU2::" from mmu2_protocol_logic.cpp, otherwise the build failed.
2022-09-16 10:22:37 +02:00
D.R.racer 22287fec5d Add original M600 MMU handling
seems to be almost unrelated to MMU function at all,
so returning it almost intact.
2022-09-16 10:21:53 +02:00
D.R.racer 4fa4b3b2fc Refactor Tx/Tc/T? commands 2022-09-16 10:21:53 +02:00
D.R.racer 2e293e90a0 MMU2 interface overhaul
First port of the new MMU2-printer interface into 8bit FW.
2022-09-16 10:21:53 +02:00
Alex Voinea c27e4623c5 Fix build (??) 2022-09-16 10:20:32 +02:00
Alex Voinea 329745368e Improve PAT9125 UI implementation 2022-09-16 10:20:32 +02:00
Alex Voinea 340bc87110 Checkpoint: jam detection 2022-09-16 10:20:32 +02:00