Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#8 Use PWM for motors

closed-accepted
None
5
2005-01-18
2003-06-05
Frans Gifford
No

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.

-fgiff

Discussion

  • Frans Gifford
    Frans Gifford
    2003-06-05

    unified diff to patch kernel/dmotor.c

     
    Attachments
    • status: open --> closed-accepted
     
  • Logged In: YES
    user_id=15923

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

     
    • assigned_to: nobody --> stephmo