From 4c8c3f49dea1e8d717422c192ad790413f12d37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mih=C3=A1lek?= Date: Sat, 2 Feb 2019 13:07:44 +0100 Subject: [PATCH] Document Watchodg features and settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add docs for Watchdog configuration - add docs to README.md how to recover from errors - add Watchdog separate values for H-BRIDGE and RELAY builds Signed-off-by: Martin Mihálek --- skarsta/README.md | 10 ++++++++++ skarsta/lib/watchdog/Watchdog.h | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/skarsta/README.md b/skarsta/README.md index a950679..67665cd 100644 --- a/skarsta/README.md +++ b/skarsta/README.md @@ -192,6 +192,16 @@ After testing quite a few DC motors from Ebay, Aliexpress and Banggood, I stuck +### Error codes && handling + +- if any Error message bellow is showed on display it is needed to manually power down/up table to be able to operate once again, + after any of error pops out it is advised to closely inspect table if the problem reoccurs if so open an issue + + | _Error code_ | _Description_ | + | ------------ | :---------------------------: | + | Err 1 | Motor stuck and cannot rotate | + | Err 2 | Motor started unexpectedly | + ### Library Credentials [ENCODER](https://github.com/buxtronix/arduino/tree/master/libraries/Rotary) diff --git a/skarsta/lib/watchdog/Watchdog.h b/skarsta/lib/watchdog/Watchdog.h index 78936b7..cddd61d 100644 --- a/skarsta/lib/watchdog/Watchdog.h +++ b/skarsta/lib/watchdog/Watchdog.h @@ -5,10 +5,28 @@ #include #include +/** + * WATCHDOG_TIMEOUT represents timeout in millis for watchdog to perform its checks + * WATCHDOG_TOLERANCE represents number of failed check in row needed to trigger an error, + * so the reaction time will be (WATCHDOG_TIMEOUT * WATCHDOG_TOLERANCE) ms + * + * WATCHDOG_DEADLOCK_CHANGE represents rotation steps threshold for detecting if motor is stuck and cannot move + * so if rotation change is greater then WATCHDOG_DEADLOCK_CHANGE for WATCHDOG_TOLERANCE times Error 1 will be trigerred + * WATCHDOG_OTHER_CHANGE represents rotation steps threshold for detecting if motor was started mainly due to programing errors, + * so if rotation change is greater then WATCHDOG_OTHER_CHANGE for WATCHDOG_TOLERANCE times Error 2 will be trigerred + */ + +#ifndef __H_BRIDGE_MOTOR__ +#define WATCHDOG_TIMEOUT 10 +#define WATCHDOG_DEADLOCK_CHANGE 1 +#define WATCHDOG_OTHER_CHANGE 5 +#define WATCHDOG_TOLERANCE 5 +#else #define WATCHDOG_TIMEOUT 250 #define WATCHDOG_DEADLOCK_CHANGE 2 #define WATCHDOG_OTHER_CHANGE 10 #define WATCHDOG_TOLERANCE 2 +#endif class Watchdog : Service { private: