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: