2 Attachment(s)
Resolution integer math assistance?
Hello guys,
Chris again...:confused:
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 :o.
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