Commit Graph

805 Commits (d20326c9d0bad9346afe44e72c9a6cd474ec0225)

Author SHA1 Message Date
Guðni Már Gilbert d20326c9d0 MMU-239 Add unit test for FINDA flickering when ejecting filament
The test case test the error recovery on all MMU slots.
2023-06-04 15:47:53 +00:00
Guðni Már Gilbert 0c8ba878f3 MMU-239 Add unit test for ejecting slots 0-4
This test ejects slots 0 to 4 and goes through the state machine
without creating any errors like FINDA_FLICKERS.

It also verifies the selector parking position is correct for each
ejected filament slot.
2023-06-04 15:46:30 +00:00
Guðni Már Gilbert f01928ebe2 Minor header cleanup 2023-06-04 15:45:08 +00:00
Guðni Már Gilbert 800497f5d2 Fix missing ErrorCode::RUNNING
This is needed in case we are recovering
from FINDA_FLICKERS
2023-06-04 15:45:08 +00:00
Guðni Már Gilbert 8c873c8a53 cleanup: unit tests: Remove unused Catch namespace 2023-06-04 14:06:03 +00:00
3d-gussner 6532a435d2 Update doxygen pulley values 2023-05-05 10:40:51 +02:00
3d-gussner 342b95bb18 Set pulley to 95mm/s for load and unload
Set pulley to 230mA current to prevent grinding
2023-05-04 11:01:11 +02:00
Guðni Már Gilbert 4a315c920a Remove redundant call to SetPairButOffOthers
retract.Reset takes care of setting the green LED to blink.
Might as well turn of the red LED during reset just in case.

Change in memory:
Flash: -30 bytes
SRAM: 0 bytes
2023-05-04 07:51:45 +02:00
Guðni Már Gilbert c096725674 modules: leds: Implement SetAllOff()
A helper function which turns of all LEDs
reduces code size :)

Change in memory:
Flash: -64 bytes
SRAM: 0 bytes
2023-05-02 07:32:27 +02:00
Guðni Már Gilbert c6c23e2c06 logic: eject_filament: reset LED state on OK event
Fix a minor issue where once the FILAMENT_EJECTED error screen
is shown on the MK3S+, the LEDs will stay blinking red even after
the user has removed the filament and clicked "Done".

My proposal is to turn the LED off.

Steps to reproduce:
1. Boot up printer and MMU in a clean state
2. MK3S+: on the LCD click "Load to Nozzle"
3. Once the loading is done, click "Unload filament"
4. Once unloading is done, click "Eject filament"
5. FILAMENT_EJECTED MMU error screen appears on the printer's UI
6. Remove the filament and select "Done".
* Expected behavior: Blinking red LED turns off (or goes green).
* Actual behavior: LED continous to blink red with no error screen.

Change in memory:
Flash: +16 bytes
SRAM: 0 bytes
2023-05-02 07:32:27 +02:00
Guðni Már Gilbert 605fa412ef Fix compiler error on GCC 12
static_assert(sizeof(ChopConfU::S) == 4) would return 5 == 4
static_assert(sizeof(ChopConfU) == 4); would return 8 == 4

using uint32_t on all types instead of uint8_t fixes the issue

No change in memory
2023-05-02 07:16:50 +02:00
D.R.racer 113f71330e Disable register 0x21 2023-03-14 18:14:26 +01:00
D.R.racer f07e206398 Hold/Resume Idler+Selector even after their homing errors
MMU-222
2023-03-14 18:14:02 +01:00
D.R.racer bafad408b7 Hold Idler and Selector even in logic::StartUp error handling
StartUp doesn't share the common ErrDisengageIdler code so the hold/resume must be used explicitly.
2023-03-14 18:08:10 +01:00
D.R.racer c4e23b687d Clean-up TMC SG trs setting in COOLCONF register 2023-03-14 17:58:11 +01:00
D.R.racer f0a633b4b6 Ignore Idler's SG signal from TMC when rolling over filaments 2023-03-14 17:58:11 +01:00
D.R.racer d9c4d61fec Optimize LED writes 2023-03-14 17:58:11 +01:00
D.R.racer b97b7561c6 Ignoring the diag pin (stallguard) completely in specified range
This seems to greatly improve overall homing reliability of Idler on MMUs which couldn't home with inserted filaments at all.
The only downside is the fact, that we may actually "home" a blocked Idler correctly.
2023-03-14 17:58:11 +01:00
D.R.racer 95915cb080 Prototype adaptive Idler homing sg_thrs
Needs to be tweaked further to make it a production code.
But my primary concern now is the fact that it doesn't seem to help too much while homing over the too-tightened Idler cover.
2023-03-14 17:58:11 +01:00
D.R.racer 59bbe0274a Reallocate MCU_UNDERVOLTAGE_VCC error code value 2023-03-08 15:14:36 +01:00
D.R.racer 98ef2368a0 Rename CurrentVCC->CurrentBandgapVoltage
and tune surrounding comments
2023-03-08 15:14:36 +01:00
D.R.racer 314233b37f Add runtime VCC measurement as register
- extract logic of undervoltage handling into main.cpp
- fix unit tests
- bump version to 2.1.9 (new register)
2023-03-08 15:14:36 +01:00
Alex Voinea 23a9978980 VCC undervoltage check module 2023-03-08 15:14:36 +01:00
Alex Voinea 372c65ef1d Fix ReadADC channel selection 2023-03-08 15:14:36 +01:00
D.R.racer 8b55b25028 Allow cutting current >31
Needs reinitialization of the axis (Selector) because the TMC driver needs to set another register to double the current level.
2023-03-07 21:07:52 +01:00
D.R.racer 9b43b61939 Idler+Selector homing speeds: writeable registers 2023-03-02 19:54:50 +01:00
D.R.racer b573fb1da3 Fix indentation 2023-03-02 12:20:06 +01:00
D.R.racer d2a2014b89 Cleanup HoldOn-Resume code in movables 2023-03-02 12:20:06 +01:00
D.R.racer e089a84f48 Turn off Idler and Selector motors before entering an error screen
That should prevent overheating and allow servicing during and error state.

MMU-216
2023-03-02 12:20:06 +01:00
D.R.racer ea41fd6b83 Update unit tests 2023-03-02 12:20:06 +01:00
D.R.racer d75119c8d6 Suspend all moves of Idler and Selector when entering an Error screen 2023-03-02 12:20:06 +01:00
D.R.racer 436ebcbeee Add HW EEPROM reset
Now the whole functionality takes +196B

As noted by @leptun, we cannot reliably check for >1 buttons pressed at once.
Since the left button is the least used, let's use it for invoking the HW EEPROM clear upon MMU start.
2023-02-25 17:59:35 +01:00
D.R.racer e2ee6f6ff1 Add X42 as EEPROM reset command + handling + visualization
MMU-193
2023-02-25 17:59:35 +01:00
D.R.racer 7e2375deee Introduce TMC2130 currents doxy group
and clean-up doxygen warnings a bit
2023-02-17 15:50:20 +01:00
Alex Voinea 9fce324bff Increase Idler SG_THRS to 7 2023-02-15 08:09:16 +01:00
D.R.racer ebdcc5a7e3 Increase version to 2.1.7
... due to removed left and right button handling in error states.
2023-02-10 14:39:45 +01:00
D.R.racer 009c692138 Remove related unit tests 2023-02-10 14:39:45 +01:00
D.R.racer 75a0ebaf0e Remove handling of left+right buttons in error states
Based on long-term test experience - saves some code + prevents the user from entering hard-to-understand states.
Only Retry remains as the one and only way of recovering from errors.
2023-02-10 14:39:45 +01:00
D.R.racer 2b5a129c7d Add new error codes 2022-12-30 14:44:12 +01:00
D.R.racer db2125e67a Bump version to 2.1.6
new features coming:
- Cut Filament
- Eject Filament
- probably also settable motor currents
2022-12-30 14:44:12 +01:00
D.R.racer 414ee1e0ca Finish EjectFilament operation 2022-12-30 14:44:12 +01:00
D.R.racer 88a489e3cb Add runtime iHold <= iRun check
+ refactor TMC register compilation (saves 26B)
+ update currents registers range documentation
+ update currents even in MovableBase::InitMovementNoReinitAxis
2022-12-29 11:27:34 +01:00
D.R.racer 425f89c862 Optimization - save 30B 2022-12-29 11:27:34 +01:00
D.R.racer 0bca66aeb5 Allow runtime config/register motor/axis iRun current
This commit introduces a new set of registers 0x1e, 0x1f and 0x20 which allow reading and writing iRun current values for each axis/motor.
Please note the register contains raw TMC2130 iRun value which needs to be translated into mA to be understandable by people.
Translation table of iRun -> mA is present in tmc2130.cpp for now.
2022-12-29 11:27:34 +01:00
D.R.racer 9c9322d02f Remove old commented code 2022-12-29 09:01:27 +01:00
D.R.racer b16ac63c5d Compute vSense dynamically from iRun/iHold 2022-12-29 09:01:27 +01:00
D.R.racer 7e8ad83e25 Distinguish iRun<32
as per suggestion from @leptun
2022-12-28 12:15:47 +01:00
D.R.racer e469929c1c Remove ErrEngagingIdler state 2022-12-28 12:15:47 +01:00
D.R.racer ada4ed3dda Workaround INVALID_TOOL error codes
May meed some more work to recover gracefully, not sure if it is just a unit test "issue" or a deeper problem in the state machines.
2022-12-28 12:15:47 +01:00
D.R.racer a52f833223 Fix and tune CutFilament + unit tests
Several issues addressed in this PR:
- CutFilament tuning + error recovery
- introduce register 0x1d (cut filament selector iRun current level)
- optimize setting iRun and iHold currents in the FW
- CutFilament unit test fixed
2022-12-28 12:15:47 +01:00