From 0e9dbc36bcdf20b803957a752a14b1747e9bb5fd Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Fri, 9 Aug 2019 21:50:55 -0700 Subject: [PATCH] change ERROR_CPR_OUT_OF_RANGE to ERROR_CPR_POLEPAIRS_MISMATCH --- Firmware/MotorControl/encoder.cpp | 2 +- Firmware/MotorControl/encoder.hpp | 2 +- docs/troubleshooting.md | 2 +- tools/odrive/enums.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Firmware/MotorControl/encoder.cpp b/Firmware/MotorControl/encoder.cpp index 7dcdd57a..b2d72646 100644 --- a/Firmware/MotorControl/encoder.cpp +++ b/Firmware/MotorControl/encoder.cpp @@ -232,7 +232,7 @@ bool Encoder::run_offset_calibration() { calib_scan_response_ = fabsf(shadow_count_-init_enc_val); if(fabsf(calib_scan_response_ - expected_encoder_delta)/expected_encoder_delta > config_.calib_range) { - set_error(ERROR_CPR_OUT_OF_RANGE); + set_error(ERROR_CPR_POLEPAIRS_MISMATCH); return false; } diff --git a/Firmware/MotorControl/encoder.hpp b/Firmware/MotorControl/encoder.hpp index c2d32841..02e991bb 100644 --- a/Firmware/MotorControl/encoder.hpp +++ b/Firmware/MotorControl/encoder.hpp @@ -10,7 +10,7 @@ public: enum Error_t { ERROR_NONE = 0, ERROR_UNSTABLE_GAIN = 0x01, - ERROR_CPR_OUT_OF_RANGE = 0x02, + ERROR_CPR_POLEPAIRS_MISMATCH = 0x02, ERROR_NO_RESPONSE = 0x04, ERROR_UNSUPPORTED_ENCODER_MODE = 0x08, ERROR_ILLEGAL_HALL_STATE = 0x10, diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 5b2ff466..79c0eee8 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -84,7 +84,7 @@ For gimbal motors, it is recommended to set the `motor.config.calibration_curren ## Common Encoder Errors -* `ERROR_CPR_OUT_OF_RANGE = 0x02` +* `ERROR_CPR_POLEPAIRS_MISMATCH = 0x02` Confirm you have entered the correct count per rotation (CPR) for [your encoder](https://docs.odriverobotics.com/encoders). Note that the AMT encoders are configurable using the micro-switches on the encoder PCB and so you may need to check that these are in the right positions. If your encoder lists its pulse per rotation (PPR) multiply that number by four to get CPR. diff --git a/tools/odrive/enums.py b/tools/odrive/enums.py index 030ac154..be8061e6 100644 --- a/tools/odrive/enums.py +++ b/tools/odrive/enums.py @@ -47,7 +47,7 @@ class errors: class encoder: ERROR_NONE = 0 ERROR_UNSTABLE_GAIN = 0x01 - ERROR_CPR_OUT_OF_RANGE = 0x02 + ERROR_CPR_POLEPAIRS_MISMATCH = 0x02 ERROR_NO_RESPONSE = 0x04 ERROR_UNSUPPORTED_ENCODER_MODE = 0x08 ERROR_ILLEGAL_HALL_STATE = 0x10