PWM and speed

Discussion in 'Embedded Systems and Microcontrollers' started by braddy, Oct 17, 2008.

  1. braddy

    Thread Starter Well-Known Member

    Dec 29, 2004
    I cannot figure out how to compute the speed of my robot knowing the pulse width modulation (PWM)? what other addition information do I need to have?
    motor characteristics??

    I am asking because I want to measure the width of a black line with a sensor(photo transistor) but I need to have a precise value of the speed.
    The motor speed is controlled by the PWM.

    thank you
  2. mik3

    Senior Member

    Feb 4, 2008
    What type of motor is it? Stepper or servo?
  3. beenthere

    Retired Moderator

    Apr 20, 2004
    There are other variables involved. What rotational speed does the motor have at every percentage of PWM? What is the ratio of motor rotation to spacial displacement does you device have? what is the limit of accurate measurement your sensor has?
  4. braddy

    Thread Starter Well-Known Member

    Dec 29, 2004
    It is a DC motor, frankly beenthere, I cannot answer your questions about rotational speed or displacement. I dont have the specs with me I will check at school today.

    The sensor is a photo transistor (GBR1134). I am using the freescale MC9S12c32 as MCU and I plan to use the input capture to determine the time the sensor is on( white surface) and off (black surface) or vice versa...So it is quite precise (nano second).
    This time multiplied by the spped will give me the width of a line.

    Thank you.