Resolution integer math assistance?


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108

    Question Resolution integer math assistance?

    Hello guys,

    Chris again...
    I've shelved my encoder digitizing arm project at the moment, in favor of another encoder project that is viable now...and it only involves 1 encoder.

    Here's what I've got:

    This project is intended to measure the angle of a die in an air-over-hydraulic tubing bender.
    Maximum angle measurement of bend will be 190 degrees.

    Encoder specs:
    500 CPR
    2000 in quad

    Belt drive reduction:
    Encoder: 10 Tooth 3mm HTD
    Die: 44 Tooth 3mm HTD
    Ratio: 4.4:1

    Therefore:
    4.4 * 2000 = 8800 Counts per 360 Degrees
    Count resolution = 360 / 8800 = .040909

    Electronics:
    PIC16F688
    20Mhz
    16 x 2 LCD

    The question:
    I'm WAY foggy on the math to harvest the angle from the encoder counts...
    Easy with floating point... "current count * .040909 = angle".
    I would like to have the resolution to be "###.##' on the lcd display.
    For ex: 1400 counts would display "057.27".
    I've read a ton of info on the forum in regards to floating point math, I just can't get my noodle around it .
    Could one of you fine folks point me in the right direction?
    I would post my code here, but all it is, is redundant encoder code so far...missing the holy grail math .
    The couple of pics are for reference.

    Thanks to all of you!
    Chris
    Attached Images Attached Images   

Similar Threads

  1. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  2. Replies: 5
    Last Post: - 28th May 2008, 10:20
  3. PBPL Math...new math takes more cycles...Always?
    By skimask in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2008, 10:22
  4. Help!! Integer Math?
    By scottl in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd July 2006, 14:49
  5. Help!! Integer Math?
    By scottl in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th June 2006, 13:47

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts