From e94230275eae8865b0aea40bdf16347297f4552c Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 18 Mar 2019 21:09:46 -0700 Subject: [PATCH] add python side enum, fix instant timout on 1st iteration --- Firmware/MotorControl/axis.cpp | 3 +++ tools/odrive/enums.py | 1 + 2 files changed, 4 insertions(+) diff --git a/Firmware/MotorControl/axis.cpp b/Firmware/MotorControl/axis.cpp index d20f292a..80987c00 100644 --- a/Firmware/MotorControl/axis.cpp +++ b/Firmware/MotorControl/axis.cpp @@ -99,6 +99,9 @@ void Axis::update_watchdog_settings() { } else { watchdog_reset_value_ = static_cast(config_.watchdog_timeout * current_meas_hz); } + + // Do a feed to avoid instant timeout + watchdog_feed(); } // @brief (de)activates step/dir input diff --git a/tools/odrive/enums.py b/tools/odrive/enums.py index fc5439bd..d4425a21 100644 --- a/tools/odrive/enums.py +++ b/tools/odrive/enums.py @@ -27,6 +27,7 @@ class errors: ERROR_ENCODER_FAILED = 0x100 # Go to encoder.hpp for information, check odrvX.axisX.encoder.error for error value ERROR_CONTROLLER_FAILED = 0x200 ERROR_POS_CTRL_DURING_SENSORLESS = 0x400 + ERROR_WATCHDOG_TIMER_EXPIRED = 0x800 class motor: ERROR_NONE = 0