| How to build a lightweight rocketry GPS data logger |
|
|
|
| Tech Tips Series by Karl Upton | |
| Friday, March 27, 2009 | |
|
Overview My finished GPSDL weighs 62 grams with the power supply and has a 1.5”L x 3”W x 1”D footprint. The weight of the data logger can be further reduced by ¼ to ½ oz. by using a simpler GPS antennae than the one I used. Cost can run from $100 to $200 depending on how careful a shopper you are. My cost was $200 for the parts used in this article. The design is simple consisting of three major parts: a 5.5g accelerometer switch, a BS2p microcontoller and a GPS receiver. A parts list, pictures, source code and a schematic are included in this article. The GPSDL records the date, time, latitude, longitude, altitude, speed, heading in degrees and number of satellites that are in communication with the receiver every second for a total of 5 minutes. The source code provided will record two 5 minute flights before you have to download the data. This is completely customizable for any number of flights or a single 12 minute flight. The comments in the source code explain not only how to make this flight time change, but also what the program is doing throughout its runtime. The source code was split into two programs to maximize the amount of data that could be stored, negating the need for a separate EEPROM. The first program parses the GPRMC and GPGGA GPS sentences for the data points and writes them to memory. Post flight, the second program is downloaded to read the data points stored in memory and prints them to your PC screen. The data points are finally copied/pasted into a spreadsheet for conversions and graphing. Step 1 Step 2 Step 3 Operation Data Recording Source Code: ' {$STAMP BS2p} 'Variables 'Initialize slotNumControl: SELECT slotNum 'each slot holds approx. 1.5 minutes of END CASE > 6 'slot7 not used END CASE = 1 STORE slotNum CASE = 2 STORE slotNum CASE = 3 STORE slotNum CASE = 4 STORE slotNum CASE = 5 STORE slotNum CASE = 6 waitForAccel: 'waits for accelerometer switch to trip GOTO collectData CASE ELSE GOTO waitForAccel collectData: WRITE address, dayMonth.HIGHBYTE WRITE address, year DO WHILE address < MEMORYSIZE 'writes to current slot 'Parse GPRMC sentence by counting bytes & commas WRITE address, hrs WRITE address, mins WRITE address, latLeft.HIGHBYTE WRITE address, latRight.HIGHBYTE WRITE address, longLeft.HIGHBYTE WRITE address, longRight.HIGHBYTE WRITE address, speed1.HIGHBYTE WRITE address, speed2 WRITE address, course1.HIGHBYTE WRITE address, course2 'Parse GPGGA sentence for altitude & number of satellites (0-12) by counting commas WRITE address, numSats Data Recording Source Code (cont.): LOOP 'Parse GPRMC sentence by counting commas WRITE address, dayMonth.HIGHBYTE 'start 3 byte footer for slotX datablock WRITE address, year GOTO slotNumControl STORE 6 'must manually change to read each slot: Flight1 = slots 1 thru 3, flight2 = 'Pins/Constants 'Variables 'Initialize main: READ address, dayMonth.HIGHBYTE READ address, year DO READ address, hrs READ address, mins Data Reader Source Code (cont.): READ address, latLeft.HIGHBYTE READ address, latRight.HIGHBYTE READ address, longLeft.HIGHBYTE READ address, longRight.HIGHBYTE READ address, speed1.HIGHBYTE READ address, speed2 READ address, course1.HIGHBYTE READ address, course2 READ address, numSats Data Reader Source Code (cont.): READ address, alt1.LOWBYTE LOOP WHILE address < MEMORYSIZE READ address, dayMonth.HIGHBYTE 'start 3 byte footer for slotX dataBlock READ address, year Unfortunately, I have not been able to test the GPSDL with an actual rocket launch. That will happen in the weeks to come. To run the GPSDL I shake it by hand to trip the accelerometer switch and take data from my dashboard as I drive. The GPSDL works flawlessly at this point. I will post not only real flight data but a video of its maiden flight to my website soon. I would appreciate any feedback on improvements to my source code or circuit, particularly in reducing its size or weight. Parts List: Online Resources: |
| << Previous Article | Next Article >> |
|---|
My secondary question is, "Can position and 3D acceleration accuracy be augmented by MEMS gyros after liftoff?"
Just tech Jerry
My secondary question is, "Can position and 3D acceleration accuracy be augmented by MEMS gyros after liftoff?"
Just tech Jerry
That's going to be an "it depends" - if you loose lock or exceed the GPS civilian limits and switch over to dead rekoning using such sensors during the outage, then yes, but while you have good GPS data from a modern GPS receiver locked to multiple satellites, the only thing that might beat it in accuracy is a laser gyro, except in the Z (altitude) which can be augmented with a high-precission altimeter, until your in the neighborhood of 50k feet more or less- but this may not be true in the case of a fast moving rocket due to pressure lag in the electronics bay. Radar is another approach that may soon become a lot easier (though still quite technical) thanks to some new RF chips about to hit the market.
I started with the BS2. I interfaced this with an accelrometer, RTC and external eeprom and flew it in the nosecone of an Aerotech Strong Arm. I then added a baro and with this I am at the limit for variable space. I did have enough room for a launch wait routine along with some "filtering" for the analog inputs. To download data I modified a palm cable for a DB9 connector. This downloads the data and saves it for later cut and paste. I should have a writeup on this somewhere, if I can find it I will post it.
With the limited variable space of the Stamp I switched to the Atom from Basic Micro. With this microcontroller I am reading a 2 axis accel with a Lassen IQ GPS and storing the info to SD. The gps data is also being TX with a 9xtend module. I am pretty close to having this done and I hope to be ordering PCBs in the next few weeks and hope to have flight data come late spring.
Schematic posted is outdated but gives a general overveiw.
What happens if you comment out where you set your variables to 0 in the intilization starting with daymonth?
address = address + 1
WRITE address, latLeft.LOWBYTE
address = address + 1
My sytax may be a little off but this should work:
WRITE address, Word latLeft
address = address + 2
Likewise you should be able to combine more of these to the same command
WRITE address, Word latLeft, Word latRight, Word longLeft, Word longRight
address = address + 8
The address var needs to be incremented by two for each word variable being used. In this case 4 word variables = 8 bytes
That may be the case but it is a FREE download http://www.parallax.com/tabid/441/Default.aspx
and it saves around 60+ lines of code at rough guess.
You should submit your new or old design to Rocketryplanet.com for others to read. I am not the only one interested in instrumenting rockets, but hands-on, first-hand information and not just "ideas" people have are hard to come by.
I have gotten so much information and answers from a few posts it was worth the time.
I plan on "upgrading" to a Propellor chip for my next generation flight computer. the Propellor is a multi-core microcontroller. If you are familiar with the BS2p, the Propellor is akin to controlling 8 BS2ps simultaneously.
Ironically it is also 25% the cost of a BS2p.
You are absolutely right. I am a little embarrassed I didnt pick that up myself. I guess I was so focused on managing/cycling through memory and making it stable I forgot about the read/write basics. ??
Your idea makes the program quicker and saves memory.
I will not implement it as you wrote it but, I will make the change you pointed out.
Thank you
The only thing that controls the sampling rate is the GPS antennae/receiver. Any microcontroller on the market has a quicker speed than any GPS antennae, so you are stuck with the sampling rate of the antennae/receiver.
My particular antennaes datasheet lists only 4800 Baud capabilities (every 2 secs), but I have it set up for 9600 Baud (every sec) and it works just fine. ?? 9600 Baud is the MINIMUM resolution for rocket work.
I will be looking into the antennaes ACME suggests. I am already working on a new design utilising a more powerful microcontroller and a I am looking for a simpler, lighter and possibly quicker GPS antennae. A higher resolution would be nice but, 9600 Baud GPS data is OK w/ me.
You are correct in your understanding. They are discussing a microcontroller that will log data. As it has a serial port, it could be linked to a transmitter and programmed for telemetry, but that hasn't been discussed as far as I can tell.