Commit Graph

709 Commits (dc487c36b6443994cc0bd81cd8a9aad8c8ef04d8)

Author SHA1 Message Date
D.R.racer dc487c36b6 Remove Enable/Disable TMC when reiniting Movable axes
The previous commits by @leptun were correct but there has been one call to Disable axis (and TMC) hidden in `InitMovement`.
Therefore `InitMovement` has been split into 2 separate functions - one is there to allow the original full axis reinit, but the other `InitMovementNoReinitAxis` now only prepares a move without reiniting the TMC driver.

This approach seems to have the benefit of fixing the Idler creep over time.

The disadvantage is the fact, that setting StallGuard threshold is no longer called. We may need to add a special piece of code to handle/apply SGTHRS change at runtime like before.
2022-10-20 12:09:42 +02:00
Alex Voinea e2924c3506 Fix tests 2022-10-20 12:09:42 +02:00
Alex Voinea d7301b8d58 Adjust PWM_FREQ to allow lower current regulation
With PWM_FREQ=2 (fPWM = 2/512 fclk), the idler parked current was quite high since the setting was not actually respected (scientifically tested using hand). In order to allow lower current regulation in stealthchop, TBL and PWM_FREQ need to be adjusted. The lower both of these values, the better. Since TBL affects both stealthchop and spreadcycle, I chose to only modify PWM_FREQ.
This new PWM_FREQ results in half the previous stealthchop PWM frequency and also halves the low current limit (so if previously the minimum achievable current was 300mA, now it would be 150mA). I confirmed that this setting works correctly on a 24V supply. There is no audible noise from stealthChop PWM and the hold current is indeed reduced now (again, scientifically tested using my hand).
2022-10-20 12:09:42 +02:00
Alex Voinea 2d4aba2cde Reduce idler parked current (IHOLD) 2022-10-20 12:09:42 +02:00
Alex Voinea d77d31b883 Idler dynamic IHOLD adjustments 2022-10-20 12:09:42 +02:00
Guðni Már Gilbert bf89030423 user input test: Register enum with Catch
Now when REQUIRE ( a == b ) fails we see the values of a and b.
2022-10-17 17:27:47 +02:00
Yuri D'Elia a0c622ca99 cmake: Uniform Avr toolchain build with MK3
- Also set AR/RANLIB in the toolchain
- Fetch GCC version from bootstrap
2022-10-17 17:26:08 +02:00
Yuri D'Elia 9f39b373a9 build: Set -mrelax to remove trampolines while linking
Avr GCC automatically marks all indirect calls for trampoline generation
irregardless of the target.

This can be avoided by forcing -mshort-calls or using -mrelax that
removes the trampoline at link time (after the call location has been
proven to be reachable).

This saves 510 bytes on the current build (the trampolines section is
now empty as expected).
2022-10-17 17:22:21 +02:00
D.R.racer 08230b9d7a Increase version to 2.1.4 2022-10-12 07:45:21 +02:00
Guðni Már Gilbert 63404f7970 Format 2022-10-12 06:41:59 +02:00
Guðni Már Gilbert 01ef1191b0 Fix test_motion_ramp on Windows
* 'python3' is not valid on Windows

* call the .py file with 'python' command to prevent BAD_COMMAND error
2022-10-12 06:41:59 +02:00
D.R.racer 37f820e9a6 Prevent filament creep in activeSlot+1
This PR is just about tuning the intermediate Idler positions so that the filament gets relieved from the Pulley safely while the Extruder gears take over and the activeSlot+1 filament is not affected by its Idler bearing.
On a test bench filament was creeping about 0.5mm per Toolchange.
Changing the intermediate position from exact middle into 3/4 practically elliminated the creep. We can play with these constants more if necessary in the future.
2022-10-11 07:15:57 +02:00
DRracer 794b0d0a81
Fix unit tests on windows (#213)
* Fix unit tests on windows

Based on PR#210 from @gudnimg

Cherry picked just the necessary changes + reformatted the corresponding CMakeLists.txt

* Change cd -> WORKING_DIRECTORY even for test coverage report

* Update CMakeLists.txt

* Add `BYPRODUCTS` arguments

Co-authored-by: D.R.racer <drracer@drracer.eu>
Co-authored-by: vintagepc <53943260+vintagepc@users.noreply.github.com>
2022-10-11 07:15:01 +02:00
Alex Voinea 2ab3b96542 tests... 2022-10-11 07:13:42 +02:00
Alex Voinea e91e382c5c Fix tests
Pretty please 🥺
2022-10-11 07:13:42 +02:00
Alex Voinea 62a9abc235 Reformat modified files
rip history
maybe now?
2022-10-11 07:13:42 +02:00
Alex Voinea 55e8caa054 Always check for tmc errors 2022-10-11 07:13:42 +02:00
Alex Voinea ecb1696a12 Abort moves when tmc errors happen 2022-10-11 07:13:42 +02:00
Alex Voinea a71e8045b1 Clear tmc error flags on init 2022-10-11 07:13:42 +02:00
Alex Voinea abf25c2b3e Only check for errors if the driver is initialized 2022-10-11 07:13:42 +02:00
Alex Voinea 739f4cd2a3 Check for tmc2130 error flags 2022-10-11 07:13:42 +02:00
Alex Voinea 8b2de34e34 Make sure the error flags are turned into bools 2022-10-11 07:13:42 +02:00
Alex Voinea 31c4a26d82 Make gpio write atomic
Unfortunately, there is no way to differentiate between an optimized gpio write (safe always on the atmega32u4) and an unoptimized write (read-modify-write, dangerous if any other pin on that Port is used in an ISR).
While very quickly polling the tmc registers, I noticed that the moving stepper would do some random extra steps. That can only be explained by the following sequence of actions:
- the spi code reads the PORT register
- ISR toggles the step line, changing the value in the PORT register
- the spi code writes the upated PORT back, resetting the step line to the old state

After making the writes atomic, the stepping issue disappeared and the driver checks also worked correctly
2022-10-11 07:13:42 +02:00
Yuri D'Elia b4e95f0c49
Merge pull request #207 from wavexx/cmake_tweaks
cmake build tweaks
2022-10-10 19:35:57 +02:00
vintagepc c029ba48ec
Merge pull request #215 from prusa3d/vintagepc-restore-hwcheck-axis-bits
Restore Hardware Error check axis bits
2022-10-10 13:29:23 -04:00
VintagePC 33b9e74b72 Restore the Error check axis bits 2022-10-10 12:08:58 -04:00
Yuri D'Elia 03e1757b0f cmake: Reformat 2022-10-10 15:19:58 +02:00
Yuri D'Elia d287ab2357 cmake: Full reproducibility support 2022-10-10 15:19:58 +02:00
Yuri D'Elia ea38115152 cmake: Generate correct inline source listings in asm output
Manually provide a source path prefix to objdump
2022-10-10 15:19:58 +02:00
Yuri D'Elia 74dfb27c20 cmake: Improve AVR target flags
- Filter C++-only flags correctly
- Split sections correctly at link time with LTO
- Remove uneeded linker flags
2022-10-10 15:19:58 +02:00
Yuri D'Elia c6b600d623 cmake: Strip prefix from debug info
Paves the way for some extra reproducibility.
2022-10-10 15:19:58 +02:00
Yuri D'Elia 38657f5d77 cmake: Improved way to set default compiler flags 2022-10-10 15:19:58 +02:00
Yuri D'Elia f43884a0ca
Merge pull request #214 from wavexx/precommit_update
hooks: Update cmake-format to 0.6.13
2022-10-10 14:46:20 +02:00
Yuri D'Elia 5bacabe209 hooks: Update cmake-format to 0.6.13
Synchronize rules with Buddy
2022-10-10 11:50:05 +02:00
Guðni Már Gilbert a8df6732fe
Merge pull request #208 from prusa3d/fix-flash-failure
Don't detach USB before entering bootloader
2022-10-08 13:55:42 +00:00
Guðni Már Gilbert fd7e9c415c Don't detach USB before entering bootloader 2022-10-07 17:58:35 +00:00
vintagepc 9c7701c123
Merge pull request #203 from prusa3d/vintagepc-check-hardware
Add module to check for sketchy electronics
2022-09-22 12:17:04 -04:00
Yuri D'Elia 1007402b24 Change TIMSK1 atomically in mm::IsrSetEnabled 2022-09-22 17:05:11 +02:00
Alex Voinea dd7042e567 Fix typo 2022-09-22 12:16:41 +02:00
D.R.racer 4f1a301e0e Force fix formatting 2022-09-22 12:16:41 +02:00
D.R.racer 0fa8a3c278 Refactor original solution from @leptun
- rename stall*guard to StallGuard (match name with the vendor)
- separate TMC2130 module from EEPROM (they do not need to know about each other at all)
- separate SGTHRS settings from motion - moved to globals like all other "global" parameters
- improved EEPROM storage for SGTHRS
2022-09-22 12:16:41 +02:00
Alex Voinea d5249f99fd Configurable SGTHRS 2022-09-22 12:16:41 +02:00
VintagePC c5a5304775 Minor cleanup 2022-09-21 18:28:22 -04:00
VintagePC 8c6435d4e8 Change back a debug test 2022-09-16 19:46:48 -04:00
VintagePC 10fd23700b Improve implementation 2022-09-16 19:39:27 -04:00
VintagePC df86a6d472 Make test run by default, get fault display working 2022-09-13 21:43:51 -04:00
VintagePC 973db11bec First pass/WIP 2022-09-13 08:47:27 -04:00
3d-gussner 860b91e42b Add Write gcode M708
Fix doxygen format
2022-09-09 16:57:04 +02:00
3d-gussner 5accb05b2d Fix and add units 2022-09-09 16:57:04 +02:00
3d-gussner 9c751d592d Update register documentation 2022-09-09 16:57:04 +02:00