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 uoxray.uoregon.edu/orangutan 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.