Commit Graph

4607 Commits

Author SHA1 Message Date
Yuri D'Elia
1c76152e62 Implement separate travel acceleration (M204 T)
Allow to separate extrusion and travel acceleration settings using M204,
as Marlin 1.1.x and 2.x does using M204 T.

This allows to reduce the number of instructions required during
printing, since resetting the acceleration for travel moves is no longer
required and can be done a single time during the print.

Provision for this parameter was pre-existing, but not implemented.
M204 has two forms: the lagacy format (Marlin <1.1):

  M204 S[print-acc] T[retract-acc]

and the newer format:

  M204 P[print-acc] R[retract-acc] T[travel-acc]

The distinction in the MK3 FW is done based on the presence of the P
parameter. If P is seen, the new format is adoped. In the new format
however, M204 T was ignored until this change.

To keep backward compatibility, M204 S[acc] will set both print and
travel acceleration, which is identical in behavior to recent versions
of Marlin.
2021-02-03 11:20:28 +01:00
3d-gussner
2ba24fe0d4 Add pause/resume to USB/host prints via LCD menu
Depending if SD or USB/host print the firmware sends
- SD print: `// action:paused` or `// action:resumed` are send to inform USB/Host
- USB/host print: `// action:pause` or `// action:resume` are send to trigger the USB/host to handle it

- USB/host must handle `// action:pause` and `// action:resume` correctly to work
  - Tested with Octoprint
    - It handles every thing correctly
    - Any combination of Octoprint and/or LCD `pause` and `resume` working correctly
  - Tested with Pronterface
    - It pauses BUT doesn't send the printer in pause position, and so it is not possible to `resume` from LCD menu
    - I guess some Macros can fix that.
  - Repetier Host/Server documentation shows that it should work. Not tested.

Could save 56 bytes in first step and additional 38 bytes adding `MSG_PAUSE_PRINT` to messages.c/.h

Updated `lang_en*.txt`
@todo Polish translation is 19 characters long (it still fits) BUT should be corrected to 18 chars.
2021-02-03 11:00:26 +01:00
DRracer
0bda4504c1
Merge pull request #3013 from leptun/MK3_DIR_DEPTH
DIR depth adjustments
2021-02-02 20:20:25 +01:00
Alex Voinea
896f4e1dd1 Fix compile error 2021-02-02 19:14:05 +02:00
Alex Voinea
f6ae379077 Fix dir_names array definition. Prevents overrun 2021-02-02 19:08:44 +02:00
Alex Voinea
5c9d202871 Change MAX_DIR_DEPTH from 10 to 6
You can't run M23 with so many directories as the length of the command will exceed the maximum allowed by cmdqueue
2021-02-02 19:08:19 +02:00
DRracer
f7fd7a5331
Merge pull request #3012 from leptun/MK3_IP_support
M552 - Printer IP address
2021-02-02 15:42:04 +01:00
3d-gussner
57e730c80c Merge remote-tracking branch 'vojtech-pavlik/MK3' into MK3_Test_PRs
Fix merge issues PR1900
2021-02-02 13:49:34 +01:00
Alex Voinea
647cde0cae Add documentation 2021-02-02 13:38:20 +02:00
Alex Voinea
2f4119a6d7 M552 - Printer IP address 2021-02-02 13:21:16 +02:00
DRracer
2b81abb24c
Merge pull request #2814 from wavexx/MK3_PAT9125_I2C
Use hardware TWI for the PAT9125 (optical) filament sensor
2021-02-02 09:15:35 +01:00
D.R.racer
15d76a7501 Remove duplicit incrementation of consecutive comment lines
It was left in the code in one of the refactoring/optimization passes.
It really didn't do any harm, but was limiting the performance of the
skipping algorithm.

+ some verification code added - will be removed after successful tests
2021-02-02 07:57:06 +01:00
DRracer
40e45c5eaa
Merge pull request #3009 from leptun/PFW-1144-LongPathName
"M27 P" support. Get current file absolute filename (file path)
2021-02-01 14:41:15 +01:00
DRracer
58c217a340
Merge pull request #2988 from leptun/PFW-1171-EEPROM_SN
Cache SN to EEPROM on startup
2021-02-01 14:24:13 +01:00
Alex Voinea
7e09df6a34 Add documentation 2021-02-01 14:54:44 +02:00
Alex Voinea
b6d56bc0f4 Change M27 argument from L to P as that makes more sense (path vs LFN)) 2021-02-01 14:54:37 +02:00
Yuri D'Elia
ec4c1be058 Silence bUpdateEEPROM unused warning in MK3 variant 2021-02-01 07:09:44 +01:00
Voinea Dragos
30131c9ab5 Patch broken string PROGMEM transition with setTargetedHotend() error 2021-02-01 06:12:37 +01:00
Voinea Dragos
ea44d78d68 Merge branch 'MK3' into PFW-1171-EEPROM_SN 2021-01-31 17:19:00 +02:00
Voinea Dragos
698499f00d split timer0 and timer2 initialization. Move timer2 init early 2021-01-31 17:18:32 +02:00
Voinea Dragos
6b6205d2f6 M27 refactoring and M27 L initial implementation 2021-01-31 15:06:20 +02:00
Yuri D'Elia
b8b75186fe Remove the extra copy of CRITICAL_SECTION from fastio 2021-01-29 18:30:16 +01:00
Yuri D'Elia
31b3ad0613 Merge remote-tracking branch 'upstream/MK3' into MK3_PAT9125_I2C 2021-01-29 18:28:55 +01:00
Yuri D'Elia
2d71a071f0 Switch twi.c to fastio 2021-01-29 17:51:38 +01:00
Yuri D'Elia
1fa7b8cd8d Move SDA/SCL pins into pins.h for fastio compatibility
fastio relies on macros for pin definitions, so we cannot use the const
declaration in Sd2PinMap or the arduino's definition.

Declare SDA/SCL_PIN into pins.h based on the current MCU, which is
identical in all our variants.

Remove the conflicting/unused declaration in Sd2PinMap.
2021-01-29 17:48:59 +01:00
Yuri D'Elia
30262b0a6e Remove redundant definitions of CRITICAL_SECTION_*
Move CRITICAL_SECTION_START/END into fastio.h, where it's needed.
2021-01-29 17:30:04 +01:00
3d-gussner
d75a0fdcbd Merge remote-tracking branch 'upstream/MK3' into MK3_translation_0121 2021-01-29 15:38:48 +01:00
DRracer
42311db5f1
Merge pull request #2789 from wavexx/MK3_TMC2130_DEDGE
Use/enable TMC2130 DEDGE support in MK3/MK3S
2021-01-29 11:13:09 +01:00
D.R.racer
caf58b16b6 Fix handling EOF
+ save ~160B by using local variables
+ rename some of the vars to more descriptive names
+ remove consecutiveEmptyLines handling from cmdqueue
2021-01-29 08:29:51 +01:00
Yuri D'Elia
e9d5c44732 Also toggle pins efficiently in sm4.c
Use the same technique used in fastio to toggle pins efficiently in sm4
when DEDGE is used.
2021-01-29 00:13:49 +01:00
3d-gussner
fba83bd309 Add new flags -c -p -n 2021-01-28 09:48:05 +01:00
D.R.racer
6c9c1423c6 Remove temporary changes from SdBaseFile.h 2021-01-28 09:42:50 +01:00
D.R.racer
71d825d0f2 Return SdBaseFile into previous state
no changes necessary afterall
2021-01-28 09:41:30 +01:00
D.R.racer
7279de7403 Separate reading G-code files and writing to a file
- extract common strings
- cleanup openFileWrite and openFileReadFilteredGcode formatting a bit
Alltogether - code size 400B down
2021-01-28 09:37:58 +01:00
D.R.racer
c05b625b1c Fix occasionally skipped valid G-code lines
which also allowed for removal of the pre-increment -> post-increment
workaround
2021-01-28 08:13:16 +01:00
D.R.racer
d1fd5a555f Clean up gfReset() 2021-01-27 14:12:11 +01:00
D.R.racer
b2cf5b7b6c Fix seekSetFilteredGcode()
+some more debug code which will vanish after all is done and verified
2021-01-27 13:01:25 +01:00
D.R.racer
b6c59e08ac Workaround ++gfCacheP into postincrement ld r22, Z+
TODO: ideally improve the automaton to work with postincrement only, at
least in this case.
2021-01-27 09:52:20 +01:00
D.R.racer
d275fe0e83 Extract gcode filter from SdBaseFile into SdFile + optimization
- Start saving instructions as the whole PR was >1KB long.
- It turned out the compiler was unable to understand the core skipping
cycle and an ASM version had to be used.
- Add seekSet aware of the G-code filter
2021-01-27 09:33:28 +01:00
D.R.racer
c3758d350e Fast skipping of large comment blocks
This is an extension/optimization of PR #2956.
It uses the cached 512B block buffer to avoid heavy-weight read() in SdBaseFile.
Even though this principle allowed the AVR to skip ~600KB of data within ~5 seconds,
the impact on code base is huge, especially into well proven and long-term stable
parts like reading a file from the SD card.

The sole purpose of this PR is to show/verify the possibility of the AVR CPU
in relation to adding thumbnails into MK3 G-codes.
Moreover, this PR shall not be merged unless the missing/commented features
are restored - especially file seeking and M84 search.

PFW-1175
2021-01-27 07:03:51 +01:00
D.R.racer
dcc6605809 Workaround for skipping large comment blocks
If there are large blocks of comments in the G-code,
the printer may get shot down by its own watchdog.
Watchdog is generally set to 4s and updated only
in manage_heaters (and some other spots in some specific cases).

So far, the code reading the file and feeding it into Marlin
cycles indefinitely until it finds valid G-code lines and fills up the
command queue.

If the block is large enough, the printer cannot read it completely
within those 4s.

A simple workaround - bail out after some consecutive empty/comment
lines to enable other parts of code do their job (especially
manage_heaters).

Tested on MK404, previous FW fails with 600KB of comment lines at the
beginning, this patch survives. The printer even draws some update
on its status screen before starting a real print.
2021-01-27 07:03:51 +01:00
Yuri D'Elia
a9625747db Reinstate the nop instruction as delay in non-DEDGE
When TMC2130_MINIMUM_PULSE is 0 a minimum delay is implied.
In this case, use a single "nop" instruction.
2021-01-26 19:43:29 +01:00
Yuri D'Elia
d3734b02cc Also fix delay instances inside unused BACKLASH_[XY] 2021-01-26 16:18:23 +01:00
Yuri D'Elia
b17cdcd4d7 Ensure MINIMUM_PULSE is always 0 in DEDGE mode
This ensures delays are always properly elided without having to check
for DEDGE all over the place.
2021-01-26 16:12:59 +01:00
Yuri D'Elia
2a6989ecd5 Remove TMC2130 special-cases
With the new STEPPER_MINIMUM_DELAY being automatically removed for
TMC2130 we no longer need to add specialized #ifdefs for DEDGE in
babystep.
2021-01-26 16:09:23 +01:00
Yuri D'Elia
4fed728e08 Elide delayMicroseconds for TMC2130 in non-DEDGE mode
Introduce new macros TMC2130_MINIMUM_DELAY/STEPPER_MINIMUM_DELAY for
blocking pauses.

If MINIMUM_PULSE has defined to be zero, avoid the delay call entirely.
2021-01-26 16:02:53 +01:00
3d-gussner
f40c593d11 Fix few translations not being used due to spaces or upper case 2021-01-26 14:15:34 +01:00
D.R.racer
c28e5a9dbc Farmer's request 2
Farmers request having the Change filament menu item always visible in
the main menu and located after the Live Adjust Z (which disappears
after the first few printed layers).
2021-01-26 12:19:41 +01:00
DRracer
bfe93d3959
Merge pull request #2951 from DRracer/pvb-08
Add PVB preheat and 0.8mm nozzle presets
2021-01-26 12:09:41 +01:00
3d-gussner
ad5d068690 Update char lengths part 1
Fix some too long translations
2021-01-26 12:09:35 +01:00