tools:wdt
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tools:wdt [2024/06/10 15:01] – created ursgraf | tools:wdt [2024/06/10 17:24] (current) – [Using an Watchdog through the HAL] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using a Watchdog ====== | ====== Using a Watchdog ====== | ||
+ | A watchdog device can greatly improve the overall safety of a system. We recommend to periodically reset such a watchdog from within the main time domain of the control system, e.g. the time domain which runs your actuators. Set the watchdog time to a reasonable multiple of the period of the time domain. Now, if your system gets stuck and your time domain does not run within its desired limit, the watchdog will timeout and switch off your drives. | ||
+ | ===== Using an Watchdog ===== | ||
+ | An external watchdog can be implemented with an external timer or with a simple retriggerable one shot timer. Implement a block in your control system which uses a digital peripheral output. Make sure to toggle the output state every time the block runs. This toggling output periodically reloads the timer. If your time domain blocks for a certain period the timer will run out. \\ | ||
+ | Define a digital peripheral input which is connected to your watchdog timer output. Add this peripheral input to the critical inputs of your safety system, see [[eeros_architecture: | ||
+ | <code cpp> | ||
+ | slMoving.setInputActions({check(wdt, | ||
+ | </ | ||
+ | |||
+ | ===== Using an Watchdog through the HAL ===== | ||
+ | Some HAL libraries implement a watchdog device, e.g. [[getting_started: | ||
+ | < | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | Here, the watchdog timeout is set to 50ms. You have to start the timer, which is called '' | ||
+ | < | ||
+ | wdt.arm(); | ||
+ | </ | ||
+ | The watchdog block in your control system defines a peripheral input. Check for the state of this input with a critical input in your safety system, see [[getting_started: |
tools/wdt.1718024484.txt.gz · Last modified: 2024/06/10 15:01 by ursgraf