From 121b50d896ef560b6dd8b3870287d881387c6698 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 3 Jul 2025 03:46:11 +0300 Subject: [PATCH] Increase motors pwm frequency to 78Khz 1000 Hz is too low frequency considering the update loop for motors signal is also 1000 Hz. Decrease resolution as it's required to set larger pwm frequencies. This change should vastly improve control jitter and remove audible motors noise. --- flix/motors.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flix/motors.ino b/flix/motors.ino index f15fd46..8574551 100644 --- a/flix/motors.ino +++ b/flix/motors.ino @@ -11,8 +11,8 @@ #define MOTOR_2_PIN 14 // front right #define MOTOR_3_PIN 15 // front left -#define PWM_FREQUENCY 1000 -#define PWM_RESOLUTION 12 +#define PWM_FREQUENCY 78000 +#define PWM_RESOLUTION 10 #define PWM_STOP 0 #define PWM_MIN 0 #define PWM_MAX 1000000 / PWM_FREQUENCY