Small motors and PWM frequency

I recently attempted to use the Orangutan to control GM2 motors from Solarbotics, equipped with WheelWatchers from Nubotics for speed measurement.

However I was surprised by unexpectedly poor performance, especially at low speed. So, I decided to investigate PWM control in a bit more detail.

I’m using 8 bit fast PWM generated by Timer1 in “coast mode” to save power (see and other posts on this forum for a discussion). With these motors PWM frequency is unexpectedly important, and it needs to be surprisingly low (of the tests I did, 122 Hz gives the best performance).

As the frequency goes higher, the motors simply stop rotating at low duty cycles and at PWM cycle frequency of 3.9 kHz, you need about 50% duty cycle just to get any rotation at all. However, the motor speed is a more linear function of PWM duty cycle.

See the chart below for more details (RPM multiplied by 2 on the Y axis):

This behavior is contrary to much of the discussion on the web but I’m sure that it is motor specific! My theory is that at low PWM frequency, these motors are acting more like stepper motors and responding to the individual “per cycle” impulse rather than the average power.

So, it is worth checking your own motors to see how this behavior holds up. I plan to check out “brake mode” and “locked antiphase” and expect to see different behavior. I’ll post more info as it comes up.

BTW to get usable RPM measurements from the WheelWatchers, I ended up having to compute the period per stripe with a four-term moving average, rather than a low pass filter, as suggested by the Nubotics folks.

Cheers, Jim

This explains a lot. When I started working on PWM code, it was using two GM6 motors. I wound up dumping the frequency lower and lower and lower, and finally got down in the just over a hundred range.

Later on I switched to GM18 motors and was surprised at how responsive they were. Frequency mattered a lot less, and I’ve been able to run them 4x and 8x as high a frequency as the GM6 motors. (Which became important because my servo loop ran faster than 100Hz, so with the slower cycle rate I was running into update rate problems.)

Just looking at those two motors, my guess is the metal gear train vs. the plastic gear train has a lot to do with it. FWIW the GM18 motors will start spinning with barely any PWM duty cycle, whereas the GM6 motors needed way way more just to start ticking over.

From other reading I did, coreless motors place other requirements on the PWM frequency, and at some regimes they don’t move at all and just generate heat.

Good research! Thanks for posting your results.


Yes, the plastic gears are suspect. There is a lot of noise when the GM2 motors run, even after lubricating with silicone grease.

On the other hand, the GM2s are definitely superior to the motors and gear train used in the Tamiya double gearbox. I threw that set in the trash when I discovered the plastic motor pinion gear slipping on the shaft…you do get what you pay for.

I have a pair of metal geared GM12a and will try those next. Cute little devils!