Keith Packard [Wed, 23 Mar 2011 01:33:38 +0000 (10:33 +0900)]
altos: Ignore alt error for fast->coast. Allow larger error for baro apogee.
With the fixed kalman filter, transitions across mach don't cause
bumps in the merged filter.
And, with working kalman bits, the signal for broken baro detection is
stronger and so we can allow for baro apogee detection in cases where
noise occurs close to apogee.
Bump the kalman filter to trust the baro less so that the model tracks
across mach.
Keith Packard [Tue, 22 Mar 2011 07:51:04 +0000 (16:51 +0900)]
altos/kalman: Kalman terms can be > 1, use 32-bit fixed point
Because speed and acceleration are scaled by 16, it's fairly common
for the kalman terms to end up larger than 1. Instead of trying to
fuss with 16-bit values and shifts, just use 32-bit values.
Keith Packard [Mon, 21 Mar 2011 23:51:23 +0000 (08:51 +0900)]
altos: Compute a 'trust' value for the barometer
Instead of making the baro use/don't-use decision binary, use a 'trust
value' which slowly migrates from baro+accel to accel-only mode. This
eliminates bumps in the data from a rapid shift.
Keith Packard [Mon, 21 Mar 2011 20:42:51 +0000 (05:42 +0900)]
altos: Switch telemetrum over to kalman filter
This changes the full telemetry stream to include kalman data instead
of the old ad-hoc flight data. It's compatible in that the packet
sizes are the same so teledongle can receive either and figure out
which it has received.
A few plotting and testing tools are added to make validating the new
code easier.
Keith Packard [Sun, 20 Mar 2011 06:53:08 +0000 (23:53 -0700)]
altos: New telemetry report format (version 4). Supports tiny telemetry.
This completely replaces the version 3 format with a much simpler and
easier to parse scheme. It's described in detail in ao_telem.h, but
the basic idea is that the whole line is split into name/value pairs,
separated by whitespace. Every name is unique, and the values are
either strings or integers. No extraneous formatting or units are
provided.
Keith Packard [Sun, 20 Mar 2011 06:51:02 +0000 (23:51 -0700)]
altos: The kalman code requires a constant sample rate
The kalman function can't handle a variable sample rate, so keep the
ADC running at full speed for the whole flight instead of slowing it
down after apogee.
Keith Packard [Sun, 20 Mar 2011 06:46:18 +0000 (23:46 -0700)]
altos: Split out tiny telemetry from full telemetry
The TeleMini and TeleNano boards do not have either GPS or
accelermeters, and they also run the kalman filter which produces
standard unit measurements for the flight height/speed/accel
values. This makes the telemetry significantly
different. ao_telemetry_tiny.c sends the required data.
Note that TeleNano sends the same telemetry as telemini at this point;
there are a couple of values which are not useful, but the overhead of
sending them is small enough that the hassle of having three telemetry
formats seemed excessive.
Keith Packard [Sun, 20 Mar 2011 06:41:44 +0000 (23:41 -0700)]
altos: Make telemetry interval more consistent
Instead of using a delay between telemetry packets, use a telemetry
period and compute an appropriate delay each time. This requires
changing the ascent telemetry from a 50ms delay to a 100ms interval,
to provide a regular 10 packets-per-second rate. Before, we counted on
the telemetry packet taking about 50ms to send so that we would
receive about 10 per second.
This also eliminates delays during descent for RDF tones -- those will
get transmitted in the interval between telemetry packets without
interrupting the spacing of those packets.
Keith Packard [Sun, 20 Mar 2011 06:31:20 +0000 (23:31 -0700)]
altos: Configure packet size from send/recv parameters.
Instead of setting the packet size at configuration time, use the
provided packet size to the send/recv functions to configure the
radio. This eliminates many configuration calls, leaving us with 'RDF'
mode and 'packet' mode, the latter working for telemetry and the
bi-directional link.
Keith Packard [Sun, 20 Mar 2011 06:27:15 +0000 (23:27 -0700)]
altos: Don't init packet slave on TD. Make slave start optional
Oops. TeleDongle was starting the packet slave code, which kinda
wrecked its ability to receive telemetry packets. This patch simply
removes the packet slave code from teledongle as it cannot be used
(yet), it also makes the packet slave code initialization take a
parameter which controls whether to start that by default; in the
future, perhaps TeleDongle will gain a command to start packet slave mode.
Keith Packard [Fri, 18 Mar 2011 23:53:11 +0000 (16:53 -0700)]
altos: Add kalman filters for baro-only boards
This adds a baro-only kalman filter to track the state of the rocket,
and then uses it to control flight events instead of the existing
ad-hoc mechanisms.
Keith Packard [Thu, 17 Mar 2011 23:00:10 +0000 (16:00 -0700)]
altos: Add tiny logging for TeleMini/TeleNano
This splits the logging code into management of the log space within
storage and separate code to actually write suitable log entries. A
new log writing module, ao_log_tiny, is added which writes only
altimeter data at a fairly low data rate for devices using on-chip
storage.
Keith Packard [Thu, 17 Mar 2011 03:36:50 +0000 (20:36 -0700)]
altos: Internal flash ops block when running from flash
The docs say that if you are executing from flash, then the CPU will
stall after a flash write or erase command is started until the
operation is complete. Take advantage of that to simplify the flash
code.
Anthony Towns [Sat, 26 Feb 2011 06:06:48 +0000 (16:06 +1000)]
ao_intflash: Avoid overwriting code
Require firmware to specify the end of its codespace in its Makefile,
and use this to determine where the start of available flash is. Should
give compile time errors if either there's no room left for storage, or
if there's not enough room for code.
Keith Packard [Mon, 7 Mar 2011 05:00:52 +0000 (21:00 -0800)]
altos: Start with packet slave running. Turn off in pad mode.
Instead of turning slave mode on in idle mode, start with it running
and disable it in pad mode instead. This means packet mode is
available in startup mode too.
Anthony Towns [Sun, 27 Feb 2011 01:11:12 +0000 (11:11 +1000)]
src/ao_cmd: Shave off bytes from doc strings
Switch to using { func, "X args\0Desc" } to specify command, saving
a char field by looking at help[0] instead, and reduce help length by
doing alignment with printf instead of hardcoded spaces.
Keith Packard [Sat, 19 Feb 2011 09:06:01 +0000 (01:06 -0800)]
altosui: Display eeprom parsing errors to user
When reading the eeprom, any parsing errors (most likely bad
checksums) indicate some kind of problem with either the hardware or
the flight software. Display these to the user and do not erase the
flight.
Keith Packard [Sat, 19 Feb 2011 09:04:19 +0000 (01:04 -0800)]
altosui: Always read whole eeprom block, even at end of flight
Instead of stopping early, continue reading the whole eeprom block so
that the extra serial data doesn't end up confusing the next user of
the serial line, which may well be reading the next flight.
Keith Packard [Fri, 18 Feb 2011 18:02:46 +0000 (10:02 -0800)]
altos/test: auto-configure acceleration parameters from the log file
The flight test code had static accelerometer configuration values,
making it impossible to use data from different boards without
recompiling. As the eeprom and telem log files both contain the
necessary data, parse that instead.
Keith Packard [Wed, 19 Jan 2011 19:21:52 +0000 (11:21 -0800)]
altos: Program default flight log max value for new boards
New boards have no config space values at all, and so they need each
value to be set. Yes, this should be fixed so that there aren't two
copies of these assignments.
Keith Packard [Sat, 15 Jan 2011 20:26:53 +0000 (12:26 -0800)]
altos: Use 5V reference data to correct accelerometer measurements.
When the 3.3V and 5V values shift relative to each other (usually due
to changes in power consumption), the measured acceleration will
appear to shift. This patch converts the 3.3V referenced acceleration
value into a 5V referenced acceleration, eliminating this error.
Keith Packard [Sat, 15 Jan 2011 20:12:02 +0000 (12:12 -0800)]
altos: Ensure flight code gets first crack at new ADC data
Instead of having everyone wait on the raw ADC ring, have the flight
code wait on that and have everyone else wait for the flight code to
finish looking at the data and move its pointer forwards.
Use the provided ground acceleration average to set the two
accelerometer calibration values so that the flight code will
detect pad/idle mode correctly.
Keith Packard [Sun, 16 Jan 2011 22:30:38 +0000 (14:30 -0800)]
altosui: Ensure serial device is closed after eeprom download finishes
As this code is all event-driven, track which events will trigger
further work and block closing the device in those specific cases,
ensuring that all other code paths end up closing the device.