Sunday, March 25, 2012

Motor Testing: PWM vs RPM

Today I was able to test the response of the motors to pwm inputs. I tested the Turnigy 2217 860Kv brushless outrunner (link) Note that the motor is black on the product page, but ours is red.

To test, I hooked the motor up to it's ESC and a Parallax Propeller development board. Motor power is provided at 12v from a computer power supply*, and the code slowly ramps the motor up in 10uS increments. The rpm is read at the end of each step to allow the motor one second to settle in to it's new speed.

The up loop code:
repeat
 repeat i from 0 to 1000 step 10
  pwmoutput := i + 1000
  debug.str(string("PWM= "))
  debug.dec(pwmoutput)
  pwm.servo(ESC_PIN, pwmoutput)
  waitcnt(clkfreq + cnt)
  debug.str(string(9,9,"RPM= "))
  debug.dec(rpm.getrpm(0))
  DebugNewline

A couple of comments on the data:

  • Minimum power up was with a pulse of 1120 uS (microseconds), and resulted in 1800 rpm.
  • Maximum rpm was approximately 12000rpm.
  • The graph is definitely not linear, so coming up with a function that maps pwm to rpm would be difficult

* I found that, with these motors in particular, that if the throttle is suddenly reduced to off (1000uS) the motor creates a surge on it's power lines, which then causes the computer power supply to automatically turn off. But it works fine if the speed is gradually reduced.