slot cars PWM frequency


I am using PWM to control a scalextric slot cars and I was wondering if the Arduino default value frequency was the best one for this type of slot cars. I already broke a motor on one of the slot cars after 2-3 hours use so, I was wondering if the PWM frequency value could be the problem.

I read that 20KHz is the best frequency for slot cars, is that correct? And if so how could I set a new PWM frequency value?

thanks s

I dunno about slot cars, but Timer1 is the library you want to change the frequency on pins 9 and 10 (all the way up to 1MHz if you want, altho I suspect the poor Arduino is rather busy in that case... 20kHz should be a synch just set the period to 50uS) and to have 10 bits of resolution on the duty cycle (0-1023 instead of the default 0-255 with analogWrite()).

You can find it here.

altho I suspect the poor Arduino is rather busy in that case

Actually it makes no difference to the processor, it's all done by hardware so its sort of free as regard processor cycles.

Duh... of course. I stand corrected, and feeling much better about what I've been asking my poor Arduino to do lately. :-)