| ??? 02/03/04 13:12 Read: times |
#63928 - RE: Mouse encoders: PS/2 or directly? Responding to: ???'s previous message |
Michael Karas wrote:
------------------------------- Were the encoders you bought originally manufactured for this purpose or are they general purpose and you intend to adapt them to the setting circle equipment? General purpose, and they'll need gearing to the instruments. I see you mention PC. That would be a good prototyping and concept development platform. The maths is pretty evil. I may use the 8052 for angle measurements, and pass the data to the PC for analysis. HA and DEC to ALT and AZ Extracted from http://www.xylem.f2s.com/kepler/altaz.html#twig04 Now we have the RA, DEC and HA for the object, and the Latitude (LAT) of the observing site, the following formulas will give us the ALT and AZ of the object at the current LST. sin(ALT) = sin(DEC)*sin(LAT)+cos(DEC)*cos(LAT)*cos(HA) ALT = asin(ALT) sin(DEC) - sin(ALT)*sin(LAT) cos(A) = --------------------------------- cos(ALT)*cos(LAT) A = acos(A) If sin(HA) is negative, then AZ = A, otherwise AZ = 360 - A Note: Certain combinations of declination, latitude and altitude can give a value of cos(a) that is larger than 1.0, so acos(A) will give an error. Use the following formula in those cases (or perhaps instead of the one above). Y = -cos(dec) * cos(LAT) * sin(HA) X = sin(DEC) - sin(LAT) * SIN(ALT) Tan(A') = Y/X Take the arctan(A'). If X is negative , then A = A' + 180 If X is positive, but Y is negative, then A = A' + 360 Else A = A' ...and I need the inverse too. It would be nice to type IN RA and DEC, and get a display showing error ON THE INSTRUMENT to the right position. If anyone feels interested in joining in with this one they are more than welcome. It is a non-commercial project. Incidentally the FASTEST you can possible move this is about 0.25 revs /second. Steve |



