Help in C programming

Discussion in 'Programmer's Corner' started by Johnyc, Mar 26, 2008.

  1. Johnyc

    Thread Starter New Member

    Mar 26, 2008
    2
    0
    Hi all,

    Im facing a problem in developing a algorithm for a sensor absolute encoder that need to count the number of rotation for example 5 rotation or 4.5 rotation (1 full rotation = 360degree)
    The characteristic of the absolute encoder is, the change of degree in rotation will also changing the duty cycle width of the PWM ( eg. large angle of rotation will gives larger duty cycle width) which is output by the sensor.

    This sensor is use for detecting the number of rotation of the motor that need to be turned to the desired position. the mircocontroller for this system is PIC 16F876. my application is that the motor will need to turn more than 1 full rotation sometimes to achieve the desired position.

    Im using CCS C compiler to write program in PIC,
    so what is the algorithm that can be write in C to detect such an application?
    can anyone give me an idea and solution?

    thanks

    ~Johnyc
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    I would get the data sheet for the encoder and figure out how to make use of it. One nice feature of absolute shaft encoders is that they have a indexer output that lets you know when they pass a reference angle.
     
  3. Johnyc

    Thread Starter New Member

    Mar 26, 2008
    2
    0
    Thank you very much. i would like to share with you that the absolute encoder that im using is MA3 from USdigital. Here is the website address for this absolute encoder, http://www.usdigital.com/products/ma3/

    thanks
    ~Johnyc
     
Loading...