[amsat-bb] Re: use of PI in amsat development practice

Bruce Robertson ve9qrp at gmail.com
Mon Mar 15 09:20:08 PDT 2010

On Mon, Mar 15, 2010 at 12:30 PM, Howard Long <howard at howardlong.com> wrote:
> Bruce
>> What an interesting question! As many of you know, I'm having fun
>> porting the G3RUH's Plan13 algorithm to the Atmel platform. One of the
>> first things you want to be able to do in programs like this is to
>> convert degrees to radians; and that means pi.
> FWIW I used 32 bit accuracy (equivalent to IEEE754 single precision) in my
> PIC LVB Tracker 2 code (based on G3RUH Plan13 too) without any significant
> difference in results over 64 bit. Although the accuracy did cause some
> anomalies, they were small and inconsequential for amateur purposes,
> typically a second or two in predictions. I tested this by running the same
> code on a PC and carefully coding constants, stored values and datatypes
> with #defines so I could recompile on demand and see the differences in the
> results.

That's reassuring, and helpful (as was all your Plan13 LVB code!)

In October, I did something similar. In real-time, I compared a day's
results tracking a cubesat with Predict and my (32-bit) code compiled
on a PC, spitting SSP latitude and longitude into a spreadsheet. The
blog post (with spreadsheet) on the experiment is here:

The upshot was that they never differed in SSP by more than 35 km, and
I'm pretty sure some of the larger excursions were due to the computer
flipping over a second between doing the Predict calculation and the
P13 one.

More pragmatically, for the last two weeks I've had my latest project
revision hooked up to a FT-817 in the basement under our dining room
with the volume cranked up. Having 10 CW beacons programmed into it,
there are lots of opportunities to listen for tone shifts through a
pass, but I haven't noticed anything more than 100 Hz or so.

> I was lucky, ISTR I had 3.5KB, but even that was a struggle, although I did
> have the additional dimension of having to deal with manual bank switching
> too of the PIC18 - you might not have this on your device. And the compiler
> I used, although generating very compact code, wouldn't compile anything
> slightly complex, so I had to manually split the statements into simpler
> steps.
> If I did it again, I'd head for at least a 16 bit and probably a 32 bit
> device, and a different compiler. But five plus years ago we didn't have
> such devices or capabilities!
> 73, Howard G6LVB

You're absolutely right that these devices keep getting more capable.

I started with the Atmeg328, since its the basis of the Arduino
platform, in the hopes of making this a useful library for students
and so forth. Programming it feels less like a micro-controller, and
more like a microcomputer of my school days (Commodore 64  era)!

 My final target may be a Atmega644p, which has a 4kB SRAM, 2kB of
EEPROM (good for about 20 satellites and their modes) and a luxurious
64kB of program space. That's an additional 32kB to doddle around in.
I'm wondering if Predict's algorithm can't be ported.

73, Bruce VE9QRP


More information about the AMSAT-BB mailing list