Commit Graph

681 Commits (85deacd809d746808d8dc2662646222f00425184)

Author SHA1 Message Date
DRracer 1d1e2ef108
Merge pull request #67 from DRracer/watchdog
Add watchdog implementation + use it in main()
2021-09-20 17:21:54 +02:00
D.R.racer b9811e3c21 Fix indentation 2021-09-20 17:18:46 +02:00
Alex Voinea fbe8d3d6cd Simplify logic 2021-09-20 17:10:10 +02:00
Alex Voinea 89a2bdc7e4 Fix configuration compute() math 2021-09-20 17:10:10 +02:00
Alex Voinea 0e9802c4cd watchdog configuration 2021-09-20 17:10:10 +02:00
Alex Voinea e86def99f9 Add Disable and use the avrlibc wdt functions 2021-09-20 17:09:54 +02:00
Alex Voinea 954ef2fb8d Reset the board using the cpu hal instead of the watchdog hal
Also some naming changes
2021-09-20 17:09:54 +02:00
D.R.racer 4ba6c6e679 Add handling of the X0 message (restart the MMU) via Watchdog 2021-09-20 17:09:09 +02:00
D.R.racer a23ed5e1bf Add watchdog implementation + use it in main() 2021-09-20 17:09:09 +02:00
Alex Voinea d1fd815e0c Quick and dirty workaround 2021-09-20 16:36:44 +02:00
Alex Voinea 7fe6f6c9eb Simplify logic 2021-09-20 16:28:53 +02:00
Alex Voinea cf636ec095 Fix configuration compute() math 2021-09-20 16:28:53 +02:00
Alex Voinea 06b959bb66 watchdog configuration 2021-09-20 16:28:53 +02:00
Alex Voinea a433db5648 Add Disable and use the avrlibc wdt functions 2021-09-20 16:28:42 +02:00
Alex Voinea 56eee8dcfb Reset the board using the cpu hal instead of the watchdog hal
Also some naming changes
2021-09-20 16:28:42 +02:00
D.R.racer 3b46c35595 Add handling of the X0 message (restart the MMU) via Watchdog 2021-09-20 16:28:17 +02:00
D.R.racer 324ced6807 Add watchdog implementation + use it in main() 2021-09-20 16:28:17 +02:00
Alex Voinea 82a9eaae43 Fix selector noise. IRUN=31(VS=1), MRES=x8 2021-09-16 10:30:27 +02:00
Alex Voinea bec3f73864 Fix typo
typo
2021-09-16 10:30:27 +02:00
Alex Voinea 91f622fcdc Tighter TPWMTHRS at standstill 2021-09-16 10:30:27 +02:00
Alex Voinea e0babfa4ba Updated motor currents and added freewheeling 2021-09-16 10:30:27 +02:00
Yuri D'Elia ad096c9d14 Motion: make Motion::Step finally inline 2021-09-07 15:09:49 +02:00
Yuri D'Elia b7fcfa5cb5 Add tests for single and multi-axis AbortPlannedMoves()
This introduces a new #define UNITTEST_MOTION which is used to control
the testing scenario:

- Normal tests, we allow the stub to override the built-in definition.
- For motion tests, we stub the lower-level classes and test the
  effective implementation

We also repeat the prototype of the function, which IMHO is more
readable and more flexible: we need to use inline for the real
definition, which would require even more macros otherwise.
2021-09-07 15:09:49 +02:00
D.R.racer 37ff9b8a8f Fix unit tests for AbortPlannedMoves(axis) 2021-09-07 15:03:36 +02:00
D.R.racer a6800d491d Leverage the capability of aborting a move on just one axis 2021-09-07 15:03:36 +02:00
D.R.racer b1b5b9db84 Set better planned moves for homing + abort moves at StallGuard 2021-09-07 15:03:36 +02:00
D.R.racer 52a6d57704 Remove Motion::Home completely 2021-09-07 15:03:36 +02:00
D.R.racer dea41738a5 Add homing capability to Idler and Selector
MMU-73
2021-09-07 15:03:36 +02:00
Yuri D'Elia d18032b729 Motion: allow to abort movement on a single axis
This can be useful for things like faster homing in the future and comes
at no expense.
2021-09-07 14:48:06 +02:00
D.R.racer a380a698d9 Remove unnecessary #include 2021-09-07 14:17:03 +02:00
D.R.racer 3646b8b1c0 Change M0/M1 into a command
That implies changing motor's mode from SpreadCycle into StealtMode (or vice versa)
requires a stand still MMU with no other command (i.e. motor moves) being performed.
This elegantly solves the synchronization problem of TMC2130 mode change, as it results
in severe jerking while a motor is moving.

The change in protocol is minimal - M0/M1 first return `M0 A` (accepted) and another `Q0` then
returns `M0 F` (finished). The MK4 counterpart may ignore the additional report if necessary
as the mode change is done immediately (shortly after responding with `M0 A`)
2021-09-07 14:17:03 +02:00
Alan Dragomirecký 641b91f0cb git subrepo clone --branch=LUFA-210130 git@github.com:abcminiuser/lufa.git lib/lufa
subrepo:
  subdir:   "lib/lufa"
  merged:   "fa2cc3e1c"
upstream:
  origin:   "git@github.com:abcminiuser/lufa.git"
  branch:   "LUFA-210130"
  commit:   "fa2cc3e1c"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2021-09-06 15:56:43 +02:00
Alan Dragomirecký b842f58bc8 Add lufa to pre-commit's exception list 2021-09-06 15:56:43 +02:00
D.R.racer 09f81f8b33 Leverage the ability of motion to SetMode to all know axes 2021-09-02 12:27:41 +02:00
D.R.racer 852ca37e8f Add stealtMode flag into the global storage hive
May be used elsewhere to return to the desired motors' mode e.g. after homing
(which requires switching to normal mode)
2021-09-02 12:27:41 +02:00
D.R.racer 1e6194a9b9 Add support for M0/M1 messages
... route the messages into modules::motion's SetMode of all axes.
2021-09-02 12:27:41 +02:00
D.R.racer 315530ec16 Rebase onto main, reflect FINDA change (ADC->digital pin) in unit tests 2021-09-02 12:15:55 +02:00
D.R.racer 5a53acd802 Force Tool Change to load the filament if same slot but not loaded
MMU-63
2021-09-02 12:15:55 +02:00
Yuri D'Elia 6f3540a14d Fix Motion::SetMode(axis, mode) and introduce SetMode(mode)
Motion::SetMode(axis, mode) was incorrectly looping through all axes,
setting the same axis three times.

Fix this and introduce Motion::SetMode(mode) which actually loops
through all axes (see PR #110)
2021-09-02 12:04:59 +02:00
Yuri D'Elia e7cba346da Use relative paths for panic.h
Avoids adding the main directory as an include path
2021-09-02 12:00:59 +02:00
Yuri D'Elia ee8c80e5c4 Motion: Panic if queue is full
If the queue is full and a new move is queued, panic!

Introduce a new error code QUEUE_FULL to help diagnose situations where
the queue is handled improperly: likely one of the state machines not
waiting for the previous actions to finish.

PulseGen::PlanMove returns a boolean if the queue cannot be moved.
We could extend this to Motion::PlanMove, however all moves would then
have to check for this. Having a global check such as this ensures
we never ignore such situation.
2021-09-02 12:00:59 +02:00
D.R.racer ac78619b5b Cache TMC error flags inside movable_base class 2021-09-02 08:35:56 +02:00
D.R.racer 309d4704b7 Fix return value of TMC2130::Init 2021-09-02 08:35:56 +02:00
D.R.racer b708e67a19 Verify repeated calls to Step do not change from ERRTMCFailed 2021-09-02 08:35:56 +02:00
D.R.racer 161e46b09a Add unit tests for failing TMC
more stuff will follow as these situations seem to cause various issues
2021-09-02 08:35:56 +02:00
D.R.racer 1d884d9099 Make motion::QueueEmpty inline for non-UNITTEST builds 2021-09-02 08:35:56 +02:00
D.R.racer 712b67beb4 Add checking of TMC2130 error states for Idler and Selector
we shall think about the Pulley as well, it looks like it should get its
own class just like Idler and Selector as it behaves very similarly in terms
of stepping and error checking
2021-09-02 08:35:56 +02:00
D.R.racer ffe5bc2807 Make Idler and Selector only wait for their own axis
... and fix the unit tests for this
2021-09-02 08:35:56 +02:00
D.R.racer 5571e77809 Improve/fix some comments 2021-09-02 08:35:56 +02:00
D.R.racer 74629f0103 Fix reporting progress of running commands
The problem was the error state while running a command - we never used the RUNNING error state.
2021-09-02 08:35:56 +02:00