When does "off and on" become useful PWM?

If I apply max volts to a motor for a week, and then 0v for a week, the motor will run at full speed for a week (less maybe a second or two) then sit still for a week.

So how does one know at what frequency a 50-50 duty cycle PWM will actually run the motor at half speed. I suppose it's a matter of the inertia of the machine so that it can't get beyond the required speed in the short time the power is on?

Short answer: You want it fast enough that the reaction time of your motor won't see it as anything different than a DC signal. So you need to go fast enough that the E-Fields in the motor don't dissipate before you pulse it again. Go too fast, and the motor won't turn though (the E-field never forms properly). Its system dependent. The easiest way is to just fiddle with it and try different frequencies. It is unlikely to harm the motor. You should be using protective diodes/etc to protect the rest of your equipment anyways.

Long Answer: There is a nice long complicated answer using transfer functions and bandwidths, but I don't have the time.

JimboZA:
So how does one know at what frequency a 50-50 duty cycle PWM will actually run the motor at half speed. I suppose it’s a matter of the inertia of the machine so that it can’t get beyond the required speed in the short time the power is on?

That will totally depend on the motor, the load applied to it, etc. Every case will be different.

Thanks to both of you. So then how did the Arduino guys arrive at the PWM frequency they implemented? Is that just a sort of "generic", "one-size-"might"-fit-all" kind of thing?

. So then how did the Arduino guys arrive at the PWM frequency they implemented

Based on the way the internal timers work and what division ratios available are. Also timer 0 has to support the millis timer and so needs to go faster than you would normally have to. PWM was not implemented for just motors. Anyway PWM works best on motors under load. If there are too few frictional losses it won't have time to slow enough to notice a speed change.

You really don't want to rely on the physical inertia of the motor to average the speed, because that means the current in the windings could have a massive AC component at the "PWM" frequency, and large copper and iron losses result from this.

You want the PWM frequency to be high enough that the inductance of the windings is limiting the current variation substantially (an order of magnitude less than the full load current would be good). In this situation the iron and copper losses are greatly reduced from the AC component (which is now a relatively small ripple current).

Another factor affecting the PWM frequency is resonance and audible sound from the windings - taking the PWM frequency up into the ultrasonic range will reduce both problems.

Really high PWM frequencies give larger switching losses and EMI issues, so there is a balance to be found.

I've no idea why they chose the PWM frequencies they did, seems low for small motors and for LED dimming. Common motor PWM frequencies are 4kHz, 8kHz, 16kHz etc. Note that timer0 serves both to maintain the millis() and micros() time on the Arduino as well as provide PWM for pins 5 and 6.

Week under power = motor speed 100% Week without power = motor speed 0% Average speed over 2 weeks = (100% + 0%) / 2 = 50%

To get a "true" 50% instantaneous speed you need to PWM the motor at a frequency whereby the rotor inertia is sufficient to avoid noticeable change of speed between the full-on and full-off stages. However, as previously stated if the frequency is too high, the inductance of the motor coils will inhibit current flow and hence reduce motor power. For a reasonable mass anything in excess of 25Hz would probably avoid inductance problems,but the motor might produce an unacceptable audible "growl". Raising the frequency to several hundred Hz will probably silence any growl and still be low enough to avoid motor inductance effect.