tinymovr / Tinymovr

Compact brushless motor controller with FOC, integrated absolute encoder and CAN Bus.
https://tinymovr.com
GNU General Public License v3.0
245 stars 43 forks source link

CAN Timeout Watchdog #195

Closed eufrizz closed 2 years ago

eufrizz commented 2 years ago

The watchdog sets the control mode back to idle when no CAN messages are received for a configurable amount of time. Enabled/disabled and timeout set via a CAN endpoint on 0x2A with the set_watchdog command.

yconst commented 2 years ago

This looks good, thanks for contributing. However, the PAC55xx's have a Windowed Watchdog Timer (WWDT) peripheral, which I think we should use to trigger an interrupt, instead of incrementing in software, as an error in the control loop may block Watchdog checks.