diff --git a/controller/controller.ino b/controller/controller.ino index 2526df3f198528f2e2eefb546087ed5c6efd2cbe..83808bacb3946d885cb18a071c3f984e2d8f46ab 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++) {