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.
This commit is contained in:
Oleg Kalachev 2025-07-03 03:46:11 +03:00
parent 443e5213f0
commit cf3d4d7ced

View File

@ -10,8 +10,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
// Motors array indexes:
const int MOTOR_REAR_LEFT = 0;