Keith Packard [Fri, 29 May 2009 06:17:33 +0000 (23:17 -0700)]
Eliminate RDF tone generation.
Now that we have a viable telemetry-signal based RDF device via TeleDongle,
there's no reason to continue to waste power and bandwidth with a NFM tone.
Keith Packard [Sun, 24 May 2009 04:16:22 +0000 (21:16 -0700)]
Avoid 16-bit overflow in velocity computation.
Adding two 16 bit integers together can wrap around to negative numbers,
this resulted in velocity values which never decreased, making the switch
from coast to apogee state not occur.
Keith Packard [Mon, 18 May 2009 06:36:21 +0000 (23:36 -0700)]
Transmit computed ground pressure and acceleration values
These are the last two values relevant to figuring out the state of the
flight computer, and as they are computed by averaging 10 seconds of 100Hz
sample data, they're a lot more accurate than anything the receiver could do
on its own.
Keith Packard [Mon, 18 May 2009 05:29:54 +0000 (22:29 -0700)]
Send computed accel/vel/pres values over the radio
These computed values reflect what the flight computer is actually refering
to for state changes, and will be useful in debugging the flight software as
well as provide a filtered view of the data.
Keith Packard [Mon, 18 May 2009 05:24:53 +0000 (22:24 -0700)]
While on the pad, zero out velocity every second
We integrate acceleration to get velocity, but that means sitting on the pad
for a long time can add substantial error to the velocity value. Each
second, take the velocity value from a full second ago and subtract that out
of the current velocity. Once we detect boost, this will stop, which means
that as long as we detect boost within a second, we won't have subtracted
out any "real" velocity.
This keeps the pad velocity hovering around zero, which is pretty useful.
Keith Packard [Sun, 17 May 2009 03:04:31 +0000 (20:04 -0700)]
Abandon use of accelerometer for apogee detect.
Integrating the accelerometer data to compute velocity worked for one rocket
flight, but additional testing shows that it doesn't work in other
airframes. Until we figure out how this should work, we'll rely on the
altimeter to detect apogee.
Keith Packard [Sat, 16 May 2009 09:25:04 +0000 (02:25 -0700)]
Add preliminary aoview code
AoView connects with TeleDongle to present telemetry information in a
reasonable form. Right now, it just displays information to stdout, but it
does have fancy dialogs for finding the USB devices.
Keith Packard [Thu, 14 May 2009 03:41:54 +0000 (20:41 -0700)]
Discard usb output before connection. Handle USB reset.
Discarding output before USB is plugged in allows threads that send output
and do other things to work without a USB connection. Unfortuantely, there
doesn't appear to be any way to detect when the USB link is disconnected,
which means that once USB is enabled, future writes will continue to block.
USB reset causes the USB interrupts to all be reconfigured back to power-on
state.
Keith Packard [Wed, 13 May 2009 18:00:43 +0000 (11:00 -0700)]
Accelerometer-based velocity values are invalid after apogee
Because the orientation of the flight computer relative to the ground is
unknown after apogee, the accelerometer data cannot be integrated to compute
velocity. Main deploy is now based purely on barometric altitude and landing
detection no longer checks for a low velocity value.
Keith Packard [Wed, 13 May 2009 17:59:04 +0000 (10:59 -0700)]
Add velocity check for boost detect via accelerometer
Bumping the rocket can cause a brief period of high acceleration, which may
cause a mistaken boost detection. Require both a high acceleration and
reasonable velocity to trigger boost phase.
Keith Packard [Mon, 11 May 2009 06:11:06 +0000 (23:11 -0700)]
Use recorded accelerometer baseline data in ao_flight_test
With the flight computer recording a long-term average value for the
accelerometer in the flight record, use that to prime the flight test code
when running a log file through the simulator.
Keith Packard [Mon, 11 May 2009 06:00:06 +0000 (23:00 -0700)]
Initialize ao_min_vel with |ao_flight_vel|
As ao_min_vel is stored as an absolute value, it's important to preserve
that invariant, even though we don't expect ao_flight_vel to be negative at
coast.
Keith Packard [Mon, 11 May 2009 05:58:31 +0000 (22:58 -0700)]
Decrease telemetry rate on the pad to 1/sec instead of 20/sec
Transmitting telemetry through the radio consumes a significant amount of
battery; reducing the rate to 1/sec will reduce power usage while waiting
for launch.
Keith Packard [Mon, 11 May 2009 05:54:14 +0000 (22:54 -0700)]
Record average accelerometer value in flight start log record
The average accelerometer value cannot be extracted from the log as the
record starts after that is computed. As that drives much of the
accelerometer-based state transition logic, it is an important value to
have, so we log it as part of the flight start record now.
Keith Packard [Thu, 30 Apr 2009 00:46:36 +0000 (17:46 -0700)]
Eliminate incorrect cast in printf string argument
char * is a pointer to a string in the default address space, not a generic pointer
to a string. As such, the compiler (at least 2.9.0) mis-compiles this if the
cast is included.
Keith Packard [Thu, 30 Apr 2009 00:42:26 +0000 (17:42 -0700)]
Reset landing interval tests at apogee
This moves all of the interval management into the landing test code and
out of the main loop. The interval is reset at apogee to make sure the
sensors produce a stable reading for at least 20 seconds
Keith Packard [Sun, 26 Apr 2009 08:37:02 +0000 (01:37 -0700)]
Make sure full log is written and flushed on landing.
The final state change to landing is recorded in the logging thread, so have
that turn off logging once it has recorded that state. Then make it go to
sleep.
Keith Packard [Sun, 26 Apr 2009 07:11:32 +0000 (00:11 -0700)]
Add configuration support
Current config variables:
Main deploy altitude above launch (in meters)
Acceleration zero g calibration (manual or automatic)
Radio channel (freq = 435.550MHz + channel * 100kHz)
Callsign (max 8 characters)
Supporting this involved shuffling code around so that the
non-telemetrum builds could include only the stuff they needed.
Keith Packard [Sat, 25 Apr 2009 21:44:33 +0000 (14:44 -0700)]
Allow for slower ADC operation. Add power saving code.
This tries to make the flight computer use less power by disabling USB in
flight mode, lowering the telemetry rate after ascent. It also disables the
RDF beacon during ascent and re-enables it once descent has started.
This change ensures that we actually got going fairly fast, and then slowed
down a bunch before enabling apogee detect. Otherwise, we'll detect apogee
right off the pad as we're not going very fast at that point...
This also adds the 'f' command to show the current flight status on the USB
port.
Keith Packard [Tue, 21 Apr 2009 06:33:41 +0000 (23:33 -0700)]
Add radio support. Build separate executables for TeleMetrum and the TI dongle
Ok, way too big a patch, but things were in rough shape.
This patch adds support for the radio, both transmit and receive.
Then, because I could no longer run the TeleMetrum code on the TI
dongle, I ended up building a separate image for the TI board, which
involved creating a mechanism for having multiple command sets and splitting
code for different functions into different files.