3d-gussner
2ba863d8a5
Reuse MSG_IR_0x_OR_..
...
fix lowercase
remove todos
2022-09-16 17:23:38 +02:00
3d-gussner
edad625cf7
RIP Bondtech long live the Extruder
2022-09-16 16:31:27 +02:00
3d-gussner
37cde856e9
Rename Auto_deplete to Spool_join
...
Fix some missing MSG_ c= r=
2022-09-16 16:25:47 +02:00
D.R.racer
f18493f361
Save some space due to shorter MMU error texts
...
applies https://github.com/prusa3d/Prusa-Error-Codes/pull/62
2022-09-16 12:12:08 +02:00
D.R.racer
2d98cae8bd
Fixup MK3_MMU2 branch after rebase onto MK3
2022-09-16 11:08:03 +02:00
Guðni Már Gilbert
16713aa25a
Optimisation: scopeState is already set by SendReadRegister
...
Saves 2 bytes of flash
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
e9f5a95d4b
PFW-1362 Make sure FINDA runout is impossible with MMU disabled
...
Since mmu_loop() is called in the main loop() function
when the MMU is disabled, we need to utilise the
MMU protocol layer to prevent FINDA runout from happening
if MMU is disabled.
We also need to keep in mind we probably can't trigger
a FINDA runout in the middle of a Q0 query.
So my solution now is to wait for the "Finished" state
and check if the FINDA is off during printing.
When "Finished" state appears, the FINDA value should be up
to date.
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
94119744ad
PFW-1362 Change isSpoolJoinEnabled to return bool
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
65a0036dbe
PFW-1362 Optimise debug message
...
Saves 20 bytes of flash :)
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
998ed87f25
PFW-1362 Use PROGMEM messages
...
The main purpose of these two messages is just to see if SpoolJoin is enabled or not.
"On" and "Off" are descriptive enough.
Saves 16 bytes of flash
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
63b4abb66d
PFW-1362 SpoolJoin needs to known what the previous slot was
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
1010f23959
Fix an issue where findaPressed is never set
...
This caused instant FINDA runout when the print starts. Now fixed :)
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
b292a5bf4e
PFW-1362 temporarily don't use SpoolJoin in Tcodes
...
I think in the current implementation, this will cause more harm than good.
But we can improve SpoolJoin later
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
7dcfc1484e
PFW-1362 temporary debug messages
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
8610636906
PFW-1362 Add a log when FINDA filament runout is triggered
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
c5bb34f226
PFW-1362 Show if SpoolJoin is enabled or disabled at bootup
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
fb27a7d72b
PFW-1362 Remove "NA" EEPROM status
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
166ecbc7d8
PFW-1362 Fsensor is not required for Spooljoin
...
Since the Fsensor is not required to use SpoolJoin,
it makes little sense to me that we need the fsensor
to "enable" SpoolJoin
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
d51026d8f7
PFW-1362 Rename settings for consistency
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
7c95f87867
PFW-1362 Fsensor status is not required for SpoolJoin
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
715af8fcc2
Rename files to SpoolJoin
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
afc67332c7
PFW-1362 Initial commit
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
2276217cbb
Optimisation: Remove forceMenuExpire variable
...
During first layer calibration we have the live Z baby step menu
on the LCD and the user can tune their Z offset live.
Once the first layer calibration is done, we want to exit the menu
immediately. For this purpose it is much more efficient to
call lcd_return_to_status(). There is no visual difference
on the LCD for the user.
Change in memory footprint:
Flash: -34 bytes
SRAM: -1 byte
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
e39d1458a1
Fix lost changes during rebase
2022-09-16 10:23:47 +02:00
3d-gussner
fae420f1e2
Fix MMU_ALWAYS_CUT enabled in variants
2022-09-16 10:23:47 +02:00
3d-gussner
8e9a49082b
Set Cutter OFF if 0xff
2022-09-16 10:23:47 +02:00
3d-gussner
b3ec36228d
Update doxygen documentation for M704-M709
2022-09-16 10:23:47 +02:00
D.R.racer
2e7258d7a8
Include fix protocol from MMU PR#199
2022-09-16 10:23:47 +02:00
D.R.racer
4d3a5433ad
Implement read/write registers for M707/M708
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
04a1a67b05
PFW-1386 Address TODO
...
We want to move the Z-axis after the XY move is done.
raise_z cannot be used here because it relies
on current_position[] for all axis.
It is actually 10 bytes cheaper to use the previous method
because syncing current_position with lastpos is surprisingly expensive
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
27ff01cf91
Shorter code
...
Change in memory:
Flash: 0 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
db1b0ea9ac
Optimisation: Set lastpos using memcpy directly
...
Verified the change by running the M600 gcode. All axis move as expected.
Change in memory:
Flash: -64 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
f984072eab
Remove unused #define
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
f49b88c1a1
Optimisation: lcd_commands "M702 C" should be "M702"
...
Change in memory:
Flash: -2 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
0c1052b0da
Optimisation: mmu_M600_load_filament
...
Don't render full screen for Loading Filament X
this is already done in load_filament_to_nozzle
so no need to do it twice
Change in memory:
Flash: -54 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
bf9ba3c003
Optimisation: setTargetedHotend serial message
...
Change in memory:
Flash: -130 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
635ae2bf20
M600: Small optimisation in if statements
...
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
f297131792
M600: lcd_change_fil_state does not need to be global
...
Refactor lcd_alright() to save flash
Change in memory:
Flash: -98 bytes
SRAM: -1 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
2216ba9fbf
M600: Ask for which slot to use when loading
...
This fixes an issue where the assumed slot to use is unknown and
the printer will hang on loading filament 100.
Another good thing is this is an old user feature request which
we have in our 3.12 milestone.
Change in memory:
Flash: +14 bytes
SRAM: -1 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
3e86bbb93f
M600: Don't unload if filament is unknown
...
Change in memory:
Flash: +8 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
05bf5de518
Fix calibrate_z_auto crashing Z-axis
...
Steps to reproduce:
1. Run M45 Z after booting the printer up
Change in memory:
Flash: -4 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
03b8a6e464
Use raise_z in more places
...
Change in memory:
Flash: -474 bytes
SRAM: 0 bytes
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
4758ac3f1b
PFW-1399 Don't show cut filament menu if setting is not enabled
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
55d2eaf8c0
M706: Only cut filament if the setting is enabled
2022-09-16 10:23:47 +02:00
Guðni Már Gilbert
66994d010d
Fix a few cases where rebase overwrote stuff
2022-09-16 10:23:47 +02:00
D.R.racer
0537908d8c
Fixup 2
2022-09-16 10:23:47 +02:00
D.R.racer
37b50477cd
Fixup after rebase onto MK3
2022-09-16 10:23:47 +02:00
D.R.racer
18423685b6
Cleanup ExpectsResponse usage
2022-09-16 10:22:39 +02:00
D.R.racer
d5377c1781
Remove extra "scopeState = ScopeState::FINDAReqSent"
...
saves ~20B in total
2022-09-16 10:22:39 +02:00
D.R.racer
e205d0ee2f
Autoretry Idle scope: transf. into Finished, should stay in Processing
2022-09-16 10:22:39 +02:00
D.R.racer
78cbea08e6
Fix pgm_read* usage
2022-09-16 10:22:39 +02:00
D.R.racer
6c0d3b0b78
Optimize MMU protocol logic
2022-09-16 10:22:39 +02:00
D.R.racer
05ad1dc2f6
Refactoring of protocol logic to lower RAM consumption
...
Should also place the statistics request to the right spot in the state machine.
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert
dfddf3eaa5
Initial commit for MMU statistics
2022-09-16 10:22:39 +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
0a90c7ffda
PFW-1386 Use Marlin 2 unload sequence for single material
...
The current unload sequence does not give good results.
The Marlin 2 sequence looks good on my end. This can be later
used to improve M600
Added all the constants from Marlin 2
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
099c3a1f1f
PFW-1386 fixup
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
d6564d3617
PFW-1386 if automatic = false, raising Z-axis is done via gcode
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
70532333dc
Optimize filament sensor implementation
...
- remove virtual methods (we only have one fsensor implementation at a time)
- comment out some of the debugging texts
- remove volatile and replace them with proper synchronized access to relevant variables
2022-09-16 10:22:38 +02:00
D.R.racer
2662e09f1e
Another message remove from RAM
2022-09-16 10:22:38 +02:00
D.R.racer
0e036b9d8a
Save some more RAM in protocol_logic
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
Guðni Már Gilbert
0889109760
Fix corrupted chars in "Engaging Idler" message
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
bac3168ca4
Optimise power_on and power_off
...
eeprom_update_byte only updates the EEPROM if the value is different
Saves 40 bytes of flash memory
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
0d64cfa2e5
extruder variable should be one byte
...
Saves 1 byte of SRAM and 132 bytes of flash
2022-09-16 10:22:38 +02:00
D.R.racer
87a4f58e66
PFW-1363 Change MMU Error parking position
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
703c463a49
Optimize unload
...
Toolchange during print is now much quieter.
Excessive E-motor movement during print is now gone
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
47e57646ea
Optimize load
...
Don't start moving the E-motor immediately
Instead of starting the E-motor move when the load to extruder starts,
we can start when we are loading to the fsensor. At that stage
the MMU has changed from a fast load to a slow load.
2022-09-16 10:22:38 +02:00
D.R.racer
2f0ceabce5
Upgrade protocol to v2.1 - read/write registers + CRC
2022-09-16 10:22:38 +02:00
D.R.racer
f18721bee3
Fix unintentional typo
2022-09-16 10:22:38 +02:00
D.R.racer
6d6f9583ea
Initialize retryAttempts in constructor
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
485ed4a213
Fix issue where logs show two corrupted chars
...
Issue only appears when LANG_MODE = 1
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
938fac4058
Remove old comment, button is acknowledged now
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
f717aa161c
Remove TODO in ActivatePlannedRequest
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
b9d9308f9f
Support 3x Retry in Idle state machine
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
ab32769487
Send button from current state machine
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert
4f30cf0ba3
Add missing ProtocolError
2022-09-16 10:22:38 +02:00
Alex Voinea
bc85a41059
Fix xflash flashing
2022-09-16 10:22:38 +02:00
D.R.racer
53e2d68183
Retry up to 6x in case of incorrect MMU FW version
...
Because it looks like the communication drop outs are caused by some electrical issues and we can loose even a byte from the version response, which is deadly for future operation.
2022-09-16 10:22:38 +02:00