Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Satellite location software
Author | Message | ||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6098 |
One of the first tasks when I pull up at a new campsite is to set up the satellite TV. There are lots of sources of pointing data available but some need Internet access, some don’t take into account the 45 degree tilt of the Optus satellites and at least one printed table from a major supplier has incorrect data. As I was installing a Maximite in the caravan to monitor various systems, the Maximite was an obvious choice for a satellite aiming program. To run the program, you will need the attached data file in the current working directory. The program is set up for Australia but it would not be too difficult to adapt for anywhere. The biggest task would be getting the magnetic variation table. ' geostationary satellite pointing
' by TassyJim 27 Nov 2012 ' based on Nomads Alamnac www.c-com.com.au/nomad.htm ' formula from an old edition of the ARRL Handbook satC1Long=156 ' position of the satellite of interest fromFront=1 ' for skew, we are looking at the front of the dish dim magdev$(36) ' magnetic variation table storage ' 46 degrees of longitude at 5 bytes each gives a string 230 bytes long. ' one string for each of 36 degrees of latitude open "magdev.txt" for input as #1 for n = 1 to 36 input #1,magdev$(n) next n input "Latitude ";lat1 input "Longitude ";lon1 if lat1=0 then lat1= -41.1258 ' default location if lon1=0 then lon1= 145.9078 ' we could be getting this from a GPS cls if mm.device$ <> "" then font 2,1 ' don't try to set the font for DOS MMBasic print " Optus C1 bearing from " print " ";lat1;" ";lon1 magDev=deviation(lat1,lon1) print " Magnetic Variation:";format$(magDev,"% 5.1f") dishAZ= azimuth(satC1Long,lat1,lon1) print " Azimuth (True): ";format$(dishAZ,"% 5.1f") dishAZmag=dishAZ-magDev if dishAZmag < 0 then dishAZmag=dishAZmag+360 print " Azimuth (Magnetic):"format$(dishAZmag,"% 5.1f") dishEL= elevation(satC1Long,lat1,lon1) print " Dish Elevation: ";format$(dishEL,"% 5.1f") dishSK= tilt(satC1Long,lat1,lon1) dishSK=dishSK-45 ' Optus satellite skew if fromFront=0 then print " LNB Skew: ";format$(dishSK,"% 5.1f") print " Skew is clockwise looking at Sat." else print " LNB Skew: ";format$(dishSK* -1,"% 5.1f") print " Skew is clockwise looking at dish" endif end function azimuth(satlong,eslat,eslong) longdiffr=(eslong-satlong)/57.29578 esazimuth=180+57.29578*atn(tan(longdiffr)/sin((eslat/57.2957 8))) if eslat<0 then esazimuth=esazimuth-180 if esazimuth<0 then esazimuth=esazimuth+360.0 azimuth = esazimuth end function function elevation(satlong,eslat,eslong) longdiffr=(eslong-satlong)/57.29578 eslatr=eslat/57.29578 r1=1+35786/6378.16 v1=r1*cos(eslatr)*cos(longdiffr)-1 v2=r1*sqr(1 - cos(eslatr)*cos(eslatr)*cos(longdiffr)*cos(longdiffr)) eselevation=57.29578*atn(v1/v2) if eselevation < 30 then eselrefracted=(eselevation+sqr(eselevation*eselevation+4.132 ))/2 else eselrefracted=eselevation endif if eselrefracted < 1 then eselrefracted=0 elevation= eselrefracted end function function tilt(satlong,eslat,eslong) longdiffr=(satlong-eslong)/57.29578 eslatr=eslat/57.29578 poltilt=-57.29578*atn(sin(longdiffr)/tan(eslatr)) tilt= poltilt end function function deviation(lat,long) ' magnetic variation for Australia latmin=abs(lat) -9 ' our table starts at 10 deg South longmin= long-109 ' and 110 deg East if latmin < 1 or longmin < 1 then ' check that we are in range of the table deviation = 0 ' we could use a better number to indicate goto _exitfunc ' out of range. eg 99 endif if latmin > 36 or longmin > 46 then deviation = 0 goto _exitfunc endif latI=int(latmin) longI=int(longmin) dev1=val(mid$(magdev$(latI),longI*5-4,5)) ' data is stored in a string dev2=val(mid$(magdev$(latI),longI*5+1,5)) ' for each degree of latitude dev3=val(mid$(magdev$(latI+1),longI*5-4,5)) ' we extract the 4 points bounding dev4=val(mid$(magdev$(latI+1),longI*5+1,5)) ' our position inclong=dev2-dev1:inclat=dev3-dev1 ' and interpolate for our position deviation=dev1+inclong*(longmin-longI)+inclat*(latmin-latI) _exitfunc: end function The program and the mag dev data are in the zip file. 2012-11-27_020126_nomad.zip Jim. VK7JH MMedit  MMBasic Help |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
Wow, that is neat. Send me an email if ever you get near Perth. Geoff Geoff Graham - http://geoffg.net |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Jim, What's a good text/source you'd recommend for learning something about setting up satellite TV. I've got a mate who's setting off next year for some SKI'ing round the country and I wouldn't mind building a little Maximite system with something like this for him - maybe with the GPS too. It might even bring back some of the terrestrial navigation course I did about 40 years ago for offshore sailing. That was a waste - the following year they installed radio beacons around Bass Strait. I filed away my Norrie's tables never did a sight or calculation again. Greg |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6098 |
Not what I would call a GOOD source but have a look at Nomad's Almanac. I wrote it a few years ago when I started doing the grey nomad thing. http://www.c-com.com.au/nomad.htm The help file has bit of useful information in it. The new VAST TV system is a huge improvement over the previous setups. I can watch ABC TV and Radio from all States wherever we are. Very good for seeing what the local Pollies have been getting up to while we are away. Geoff, we were in WA a few years ago and are not sure when we will be heading back. This year's winter trip was interrupted with a family matter and it might be a while before we can get away for a long trip again. Jim VK7JH MMedit  MMBasic Help |
||||
paceman Guru Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
Thanks Jim - I had trouble running it though. I downloaded the setup file, ran it and it installed OK (looked like it did anyway - displayed the icon OK). But when I tried to run it, it threw a "Warning - maximum number of fonts exceeded" and it wouldn't clear. I had to stop it with the Task Mgr - any ideas? I'm running an older XP SP2 notebook. Greg |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6098 |
I LOVE a new challenge. Have sent you a PM Jim VK7JH MMedit  MMBasic Help |
||||
isochronic Guru Joined: 21/01/2012 Location: AustraliaPosts: 689 |
Speaking of satellites - nov 29th is the anniversary of WRESAT...a small satellite launched by Aus back in 1967 (with generous help from the 'States). The blurb says it made Aus the fouth country to launch a satellite from its own land, after USA, USSR, France. Nice !! |
||||
Print this page |