Monday, May 13, 2013

Conversion 75% complete, PyEphem=out Kstars=in

So after I looked at PyEphem a little harder I realized that it actually doesn't do what I wanted it to do. Because of this I have completely abandon using it. I did find some else that was very useful. Kstars is an open source program (sort of like stellerium) for linux. The reason it caught my attention is because of its astrocalc feature which allows you to convert horizontal coordinates to equatorial coordinates, and this is exactly what I am trying to do. The only thing stopping me from using it's source code directly is that it is written in C++. So I decided to just use it as a guide to write my own java code.

After a nightmare of conversion problems (degrees to radians and radians to degrees or hours) I have finally gotten my program to calculate declination correctly. I am very close to getting the right ascension too. I believe I have fixed all of the conversion issues, but I am getting a null pointer exception when I do local side reel time - local hour angle. Hopefully it is a simple mistake, but I haven't had much time to debug it yet. I should have it fixed by tonight. I will post all of my code under the code tab once I get it working.

Once that is fixed, on to the next step: testing the accuracy of the IMU. At the moment, I have no idea if the IMU is even giving me good horizontal coordinates. I have had to assume they are correct so that I can make sure the math for the conversion is correct. I'll be mounting the ArduIMU to the top of my raspberry pi tin for now. I've tried a temporary electrical tape mount already, but I'll have to figure a better way to do it for testing. Any suggestions on doing this would be very welcome. My ideas right now are hot glue, double sided tape (strongest possible), or maybe even something as simple as a zip tie. I'm hoping to start this testing this weekend, or the next. At some point this week I have to take the primary mirror out of my telescope for cleaning though. It should be fairly easy to do, but if anything goes wrong it could delay this project significantly.

After I confirm that the IMU is actually working correctly, I need to figure out a way to directly connect it to the Raspberry pi using the GPIO. I have to do this for both the ArduIMU because the RPI model A I will be using only has 1 USB port which I plan to use for the keyboard/mouse combo. If power is not as much as concern as I anticipated I might be able to get away with using the RPI model B that I have and just use the FTDI cable I'm currently using, but I would rather use the model A since I kind of bought it specifically for this project. Once I figure out all of that, then the next step will be to start working with the motors. I am thinking I might start by hooking the EasyDrivers up to my Arduino Uno just to figure out how they work a little bit. Then I think I will know what I need to do in order to hook them up to the RPI's GPIO pins. Worst case, I think I can easily figure out how to connect my Arduino Uno to my RPI so I could just use that to control the EasyDrivers, but that would cost a fair amount of power I'm guessing.
 

No comments:

Post a Comment