Controlling this 12v DC motor at varying voltages between 4 and 12 with 3.5 peak Amps:
The motor/driver/Arduino combination is all working as expected, but the noise generated in the motor by the PWM frequency is piercing. If I wasn't using the Pololu driver, I would simply put a capacitor in line with the motor, but I can't do that here. When I tried, there is some kind of short that on small capacitors doesn't seem to have any effect but sparking, but larger ones cause noise in the Arduino. Neither have any affect on the motor noise. What I think the motor driver is doing is alternating the positive/negative output to create an average PWM flow in either of two directions. Any ideas of how I can loose the noise? I've been scouring the net for hours and can't seem to find a solution.
The Pololu motor driver can handle a PWM frequency up to 40kHz (that is very high).
The Arduino analogWrite() uses about 450Hz (that is a low frequency).
The best PWM frequency does depend to some extent on the motor - larger motors like lower
frequencies (less iron losses). Too low a PWM frequency causes mechanical resonances which
are annoying, but can loosen the windings too which is not desirable! Typical frequencies used
are 4, 8, 16kHz.
The standard Arduino configuration has about 1kHz on pins 5 and 6
and about 500Hz on the other PWM pins. The clock prescaler for each of the timers can be
changed to control the PWM speed of the the relevant pins - but timer0 is used for millis() and
delay() and so you would normally not change that (it drives pins 5 and 6).
The Pololu driver seems to have sluggish switching/dead time of several us, so that could mean
high switching losses at 16kHz and above - you may want to experiment a bit.