#8 Use PWM for motors


The motor output is currently 0-255 two ms pulses
evenly spaced over a period of 510 ms but this doesn't
deliver enough power to turn motors at low speed
(delta) settings.

Bunching the two millisecond pulses into groups
increases the pulse period which gives the motors
more torque. True PWM isn't desirable - an overall
pulse period of (2*255=510 ms) would give jerky
motion. This patch groups the number of pulses into
16 evenly spaced groups. Thus, a speed (delta)
setting of 32 gives 16 four ms pulses over a 510 ms
period, a setting of 45 gives 13 six ms pulses and 3
four ms pulses over the 510 ms period.

The algorithm works for 1-255 groups. They do not
need to be powers of two.



  • Frans Gifford

    Frans Gifford - 2003-06-05

    unified diff to patch kernel/dmotor.c

  • Stephen M. Moraco

    • status: open --> closed-accepted
  • Stephen M. Moraco

    Logged In: YES

    Looking at this patch now for inclusion before v1.0.0
    release -Stephen

  • Stephen M. Moraco

    • assigned_to: nobody --> stephmo

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks