C programming

Discussion in 'The Projects Forum' started by mdsaad, Mar 8, 2006.

  1. mdsaad

    Thread Starter New Member

    Nov 2, 2005
    8
    0
    hi all..

    Here i've attached my project description. I don't know how to program 4051 using c.i need to calculate the speed of the rotary encoder to give the actual speed to the motor. Could anyone help me, please..the rotary encode gives a digital output. 101010....the time for each cycle depends on the speed of the encoder
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Hi,

    While you can measure the interval between the 1's and 0's, there is usually a spot on the encoder that will have a different output - the indexer, used to establish the shaft position at some absolute orientation.

    If that is the case, the interval between indexer codes is less work to measure.

    As a hint, count up and internal register at some rate. The number of counts in the register between encoder pulses will measure the rotational speed. The faster the counter increments, the finer the speed determination.
     
  3. chaisi

    New Member

    Mar 11, 2006
    1
    0
    tell me how plzzzzzzzz
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    We would like to respond but there simply is not enough information here. When will it sink in that, in order to construct a meaningful response there must be some minimal amount of information, and a little less whining.

    For Example:
    The maximum speed of the shaft is 5 revolutions per minute.
    There are 400 counts per revolution.
    There is an index pulse.
    There is no index pulse.
    The encoder outputs are CMOS compatible.
    There are quadrature outputs.
    There are sine/cosine outputs.
    The encoder requires +12VDC
     
Loading...