From 915c47ad913a5c247994495ee68a18d301ae9e4c Mon Sep 17 00:00:00 2001 From: Martin Acosta Date: Wed, 18 Sep 2024 18:25:25 +0200 Subject: [PATCH] INGM-518 Fix symmetry check calculation --- CHANGELOG.md | 4 ++++ ingeniamotion/wizard_tests/feedbacks_tests/feedback_test.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa508153..f295e90b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased] +### Fixed +- Feedback symmetry check calculation. + ## [0.8.5] - 2024-08-27 ### Fixed - Remove SBC registers that have been removed on FW diff --git a/ingeniamotion/wizard_tests/feedbacks_tests/feedback_test.py b/ingeniamotion/wizard_tests/feedbacks_tests/feedback_test.py index afde4183..b64fe9b3 100644 --- a/ingeniamotion/wizard_tests/feedbacks_tests/feedback_test.py +++ b/ingeniamotion/wizard_tests/feedbacks_tests/feedback_test.py @@ -127,7 +127,9 @@ def check_symmetry(self, positive: float, negative: float) -> ResultType: self.logger.info("SYMMETRY CHECK") if not isinstance(self.feedback_resolution, int): raise TypeError("Feedbacks has to be set before symetry checking.") - error = 100 * abs(positive + negative) / self.feedback_resolution + if not isinstance(self.pair_poles, int): + raise TypeError("Pole pairs has to be set before symetry checking.") + error = (positive + negative) / (self.feedback_resolution / self.pair_poles) * 100 self.logger.info("Detected symmetry mismatch of: %.3f%%", error) error_msg = ( "ERROR: A mismatch in resolution has been "