From 8d284d563d70aedbc12b90b4aa976c19dc86fd5b Mon Sep 17 00:00:00 2001 From: Thomas Lambert <t.lambert@uliege.be> Date: Tue, 29 Nov 2022 09:35:41 +0100 Subject: [PATCH] fix(esc): add offset between two ESC --- controller/controller.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/controller.ino b/controller/controller.ino index 2526df3..83808ba 100644 --- a/controller/controller.ino +++ b/controller/controller.ino @@ -75,6 +75,7 @@ const uint16_t gMAX_RPM = 3000; // Motor maximum RPM (set in ESC) const uint16_t gMIN_RPM = 750; // Motor minimum RPM (set in ESC) const uint8_t gMAX_ESC_VAL = 160; // Value at which motor is at max RPM const uint8_t gMIN_ESC_VAL = 40; // Min value for ESC to start motor (trial-error) +const uint8_t gESC_OFFSET = 4; // Offset to add to ESC 2 to sync them const uint8_t gCSN_PINS[] = CSN_PINS; // Encoder Chip Select pins const int8_t gENC_ORIENT[] = ENC_ORIENT; // Encoder orientation @@ -172,7 +173,7 @@ void loop() { // Write value to ESCs gEsc1.write(gEsc_val); - gEsc2.write(gEsc_val); + gEsc2.write(gEsc_val + gESC_OFFSET); // Read value from rotary encoders for (int i = 0; i < sizeof(gCSN_PINS); i++) { -- GitLab