New Flight Computer

From AD7ZJ Wiki
Revision as of 23:42, 20 May 2012 by Elijah (talk | contribs)
Jump to navigation Jump to search

This is the new flight computer we are in the process of developing. This page serves to document the current progress.

High Level System Requirements

  • Documentation
    • Complete documentation including development tool requirements and installation process.
    • User’s manual showing how to utilize all hardware and software features of the system.
  • Single board for flight computer and beacon use
  • AX.25 packet capability for data transmission
  • On-board landing prediction based on wind data gathered during ascent
    • Auto flight start detection to begin logging for prediction
  • Logging
    • Mass storage support for easy access to flight data
    • Internal and external temp sensors
    • Ability to add additional sensors externally would be nice
    • Log battery voltage
  • At least one servo driver
  • Ability to receive DTMF/packet commands in flight
    • (clear logging, begin logging, beacon reset, GPS reset, frequency change)
  • Ability to configure volatile parameters via menu or file
    • Call Sign
    • Beacon time slotting
    • Customization of the status string

Hardware

The hardware is based around the NXP (formerly Phillips) LPC2148 - a microcontroller built on the ARMv7 architecture. Benefits are low cost, generous amounts of flash memory and RAM, and plenty of I/O. The chip is driven off a 12 MHz crystal which is multiplied up to 24 MHz by the onboard PLL. This particular processor can run at up to 60 MHz.

Peripherals

A CML Micro CMX678 bell 202 modem IC is used to generate the AFSK AX.25 packet that modulates the radio. This talks to the uC using one of the built-in SPI ports (SPI0). Setup of this IC is pretty simple, and the bitstream is simply shifted out to it via SPI commands.

An SD card is hooked up to the second built-in SPI port. The SD standard allows for a slower (but simpler) SPI interface to the cards. The trick to this is implementing the FAT filesystem in software, but thanks to the ChanFS FAT library this has been made pretty easy.

A Trimble Copernicus GPS engine is connected to one of the built-in UARTs. This outputs standard NMEA strings and is itself configured over the same serial port.


Software

The software is written primarily in C++, with the exception of the basic startup routines to initialize the hardware and setup the C++ runtime. I use a port of GCC for arm, put together by CodeSourcery (now MentorGraphics). The 'lite' version is fine, all you get by paying for the other versions is an IDE and the startup routines - we're going to do everything with a makefile anyways, which is really superior to a project file for an IDE anyways (at least in my opinion :). Eclipse can easily run make to begin the build process so it works out well.

Build Environment & Procedures

Since the software is built using a makefile, the build environment setup is very simple. I use Ubuntu Desktop as the host platform. The CodeSourcery compiler is available for windows as well however, so with a few tweaks to the makefile it should also build under Cygwin. I like to use the Eclipse editor since it has integrated in-circuit debugging capability with GDB and OpenOCD. Install the codesourcery version (??) lite package and ensure it gets added to your $PATH environment variable. Run 'make' in the directory to start the build.

The code can be fetched from github

You'll want to build the library first as the application needs it as a dependency. Run 'make' in the directory to start the build. Assuming it builds successfully, you should have a file called libarm7lib.a in the project directory.

Now the application software can be built. The makefile currently expects the libary in the relative directory ../arm/arm7lib however that is easy to change if necessary.

Software Documentation

Useful References

http://www.gnu.org/software/libc/manual/html_node/Rounding-Functions.html#Rounding-Functions

http://openocd.sourceforge.net/doc/html/General-Commands.html

http://openocd.sourceforge.net/doc/html/CPU-Configuration.html

http://openocd.sourceforge.net/doc/html/Flash-Commands.html

http://gitref.org/basic/