Team Liwet
Inspirations:
Liwet, The Angel of Invention
Samandriel, The Angel of Creativity
Sponsors:
McKinley THS Robotics Group, #1915
Capital PC, www.cpcug.org

PWM Notes


[mths_robo_2007

Arrow to Bottom Bottom
    Overview
  • The Robot Drive Motors are controlled by Victor 884 Controllers. The 884s receive a signal from the Robot Controller(RC) board on the Robot.
  • The signal format is PWM, Pulse Width Modulation. A pulse ranging from one to two milliseconds(ms) in length is sent from the RC board to an 884 controller. Actual width represents a value from 0 to 255. A value of zero is sent from the RC to an 884 as a 1 ms pulse, and a two ms pulse represents a value of 255. The pulse width is linear over its 0-255 range.
  • The Victor draws 80ma of control signal current during a "1", and no current during a "0."
  • The RC sends out 60 updates per second, which is 1 pulse about every 17 ms. For example, a pulse width of 1.4 ms means the RC Board sends a logic "1" for 1.4 ms, and a logic "0" for (17 - 1.4) or 15.6 ms. This is compatible with the 884 device, which requires a "0" time of at least eight ms.
    A bit of algebra shows that a 1.4 ms pulse width means 40% of the way from 0 to 255, a value of 102.
    Values
  • A motor can run forward, backwards, or be off. Forward and reverse are arbitrary. Here, the motor drives the wheels with a chain, so they rotate in the same direction. Thus, a practical convention is that the left side wheels turn forward with a signal value of at least 138.
  • The motor is off for values of 117-137. Motor on has 2 ranges, each with 94 steps. Reverse is 116-23, with 116 the slowest and 23 the fastest. Forward is 138-231, with 138 the slowest and 231 the fastest. One notes slow speeds are near the center or off position on a joystick.
          All 256 values from 0-255 are valid here. Thus, values below 23 are treated the same as 23, and values above 231 are treated the same way as a 231. One detail is that the values here are not fully symmetrical.
    The following item is from an FAQ about motors on the FIRST website. It shows a real world example of motor operation. One notes it doesn't quite follow the math rules above.
  The method here uses an analog signal, pulse width, to simulate a
digital value.
  There will be a tolerance of several steps due to variations with
oscillators. You can use the DTT to measure these values. The steps for
forward and reverse are not symmetrical. Doing a test gave these results:

  VALUE      STATE       LED STATUS       Pulse Width
  0- 41    Full Reverse    RED          0.856-1.06 ms
 42-125    Reverse         OFF          1.07 -1.48 ms
126-139    Neutral         YELLOW       1.49 -1.55 ms
140-230    Forward         OFF          1.56 -2.00 ms
231-254    Full Forward    GREEN        2.01 -2.12 ms
From http://www.ifirobotics.com/forum/viewtopic.php?t=317
  Arrow to Top Top

Send comments or suggestions to:
Return to previously viewed page