1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00
Commit Graph

212 Commits

Author SHA1 Message Date
corvus
a59d08b7af AHRS: Support for Linear Temperature Compensation Factors for Gyroscope X,Y,Z
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2327 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-04 00:54:31 +00:00
pip
c8a1a6771c Added "AHRS_ADC_GetOverSampling" function
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2308 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-29 10:34:48 +00:00
peabody124
7ccdb296ac AHRS: Add interface to get old dump_raw function working for Pip
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2305 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-28 17:48:45 +00:00
peabody124
2b0c75e46d AHRS: Fix LED flashing light
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2300 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-28 02:10:52 +00:00
pip
26650724e4 Fixed coding error on line 317 .. changed while (xxx & xxxx) to while (xxx && xxxx)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2296 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-27 09:48:11 +00:00
peabody124
c364f45fb7 AHRS: If using mags then don't initialize until get a good mag update within
250 ms of init call (mag works at 10 Hz).

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2289 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-26 18:59:32 +00:00
peabody124
35bc1e7d9b Flight/AHRS: Make the mag raw data always update regardless of home location
settings but only be used when home location is valid.  Also discard any mag
data that is all zeros although we shouldn't see this.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2283 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-24 20:21:22 +00:00
peabody124
314a2fcf00 flight/AHRS: Make the 13 state INS default again, the accel bias drift can be a
little aggressive.  Also increased the drift rate of the gyro bias per Sambas'
testing (thanks) although not to the levels required for flying through 40 deg
C transitions.

Made the dump_ekf function handle both numbers of states

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2282 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-24 19:38:54 +00:00
peabody124
ac24d86f40 AHRS Makefile: PT accidentially turned on DEBUG=YES when checking in
FirmwareIAP to get me back for breaking Sys_Reset.  You got me! :)

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2246 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-18 08:56:12 +00:00
zedamota
c034a35d2c OP-21/Bootloader - Changes to the IAPObject. Implements MB and AHRS user mode IAPObject. Added user mode reset command to the CLI. To many changes to bootloading system to write here, a Wiki page will have to be writen.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2238 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-15 19:06:28 +00:00
peabody124
68c656a724 AHRS: Add back the old 13 state INS if wanted and also code for tracking accel
bias as gravity vector facing down (bad for planes) which is diabled by
default.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2232 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-13 15:15:50 +00:00
peabody124
f30aa1d719 AHRS Comms: Send FirmwareIAP object to AHRS so that it can be remotely
rebooted.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2214 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-10 21:03:29 +00:00
peabody124
4e8c6588b6 OP-156 AHRS: Run the accel data through a fifo so it can output raw data faster
than the ekf runs and also be more tolerant of timing jitter

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2191 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 17:34:29 +00:00
peabody124
45e3ed27a7 OP-156 AHRS_ADC: Make the ADC system use a callback to better separate ADC code
from the AHRS code (which will facilitate code integration with new INS) and
also will help set up a fifo queue for the downsampled data to allow gyro data
output from AHRS faster than EKF output.  Also decreased ADC interrupt priority
so the SPI comms don't drop out.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2190 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 17:34:27 +00:00
peabody124
6f1e7b4e41 AHRS: Add a configuration to export the sensor data either with or without INS
bias correction.  This is useful for stabilization to get rid of the gyro bias.
Making it an option is important for calibration.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2189 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 17:34:25 +00:00
peabody124
81b2f88e75 AHRS: Swap to new code which tracks accel_bias and export the accelerometer
bias

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2188 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 17:34:22 +00:00
peabody124
0679e8d472 AHRS: In indoor mode correct with a high variance 0 for position to keep it
bounded.  Velocity variance still comes from AHRSCalibration.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2186 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-04 17:34:18 +00:00
dschin
f99eb5b0c7 No changes to mainline code.
Three files added to  AHRS which add accelerometer biases (16 states) to the INS/GPS.  Added for evaluation (give it a try James).

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2182 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-12-02 02:39:01 +00:00
dschin
18809ce3dc AHRS - fixed time constant of baro altitude offset filter, added the offset to the EKF dump
Added new EKF data parser (m-file) to ground



git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2178 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-29 23:28:38 +00:00
peabody124
74249f8e41 OP-171 AHRS: I was flipping sign of baro when putting into INS but shouldn't
have been.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2175 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-29 08:44:43 +00:00
peabody124
f51a5a824e AHRS: Export the bias drift corrected gyro values to OP so stabilization see
more accurate roll rates

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2174 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-29 08:44:41 +00:00
peabody124
75363896fb AHRS: In outdoor mode when no GPS for a few seconds start updating with zero
velocity to help stabilize attitude.  In principle the mag should be fine but
in practice I need this.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2160 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:14 +00:00
peabody124
b3251e2cfb AHRS: Accidentally was using mags when in indoor_nomag mode
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2159 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:13 +00:00
peabody124
6a33043297 AHRS: Tweak setting when mag is used to allow greater error in vector length
and start using from power up

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2158 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:12 +00:00
peabody124
e3d2645dea AHRS: Small bug in the conditions for using the mag
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2157 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:10 +00:00
peabody124
ebcb272da6 AHRS: Add a separate parameter for velocity and position variance and remove
indoor from the name since it's used for both indoor and outdoor mode now.
Increased default value to 0.4 to better reflect the GPS accuracy.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2156 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:08 +00:00
peabody124
ac734d5f65 AHRS: Move structure definitions out of main code. Organized variable scopes
properly.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2155 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:06 +00:00
peabody124
44069e64bc AHRS: Separated out code for debugging output from the main code and cleaned up
how various sensors are used in the INS update.  Also added slow filter to
track offset between GPS and baro in outdoor mode.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2154 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:04 +00:00
peabody124
444dd5c311 AHRS: Split various update modes into individual functions
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2153 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-26 15:57:03 +00:00
dschin
b2a538375c Changes in files supporting AHRS for new initialization methods.
Changes in ahrs.c for new initialization and to fix issues with outdoor algorithm.  The changes in ahrs.c are pretty messy, but committed mostly to get the code to Peabody for more extensive restructuring of ahrs.c.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2150 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-24 01:27:43 +00:00
peabody124
88a0ede73b OP-203: Flight/AHRS: Add fifo_buffer dependency for pios_usart
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2146 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 18:19:58 +00:00
peabody124
8ea727d10c AHRS/Makefile: Remove trailing CR
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2145 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-11-23 18:19:56 +00:00
peabody124
800e6cbe2c AHRS/INSGPS: Fix a swapped index Corvus caught
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2042 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-30 18:15:57 +00:00
peabody124
33e6cbebdc AHRS debugging: Move dump to beginning of block to see the updated lines
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2015 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-27 17:16:25 +00:00
peabody124
4d7e053e06 AHRS Debugign code for dumping the EKF and importing into Matlab
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2013 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-27 14:31:34 +00:00
peabody124
2019edd612 AHRS: Store running time to make detect resets easier. Update OP and AHRS in
parallel for this update.  Also removed comment for rawhid

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2012 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-27 14:31:32 +00:00
les
2125e2479d Added AHRS boot loader SPI protocol
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1965 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-16 17:54:00 +00:00
peabody124
300195ff18 AHRS: A few small changes
1) Moved the criteria for using GPS to defines in anticipation of moving into
AHRSSettings
2) Only use the mags for updates if the vector length is within 20% of nominal
to avoid updating when it's nonsense
3) Reinitialize position when swapping between indoor and outdoor
4) Dont use mags for first 5 seconds after initialization, sometimes seems to
cause issues
5) Dont use mags until magnetic field at your location is set and a magnetic
field is loaded
6) Dont use GPS if home location hasnt been set

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1959 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-14 01:36:30 +00:00
peabody124
016bcad24a AHRS: Detect when more than 2 seconds since last GPS update and in that case
reinit INSGPS to new location

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1958 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-14 01:36:28 +00:00
peabody124
e72b6051b5 AHRS: Make mag variance account for the vector length of magnetic field. Also
moved around where the axis are swapped and made the negative sign come from
calibration.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1931 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-10 00:46:01 +00:00
peabody124
0a9ab6ca5f AHRS: Send PositionActual and VelocityActual out
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1919 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-08 15:38:19 +00:00
sambas
e32ddd5230 Flight/AHRS: gyrotemp raw actually shows now raw temp
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1903 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-06 18:14:12 +00:00
peabody124
dea5c91646 AHRSCalibration: Make default values correct now Les extended
uavobjectgenerator to support multiple fields (thanks Les!).  Also
changed default scale on mag to +/-6g

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1899 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-06 14:26:42 +00:00
peabody124
66bf9d53d4 AHRS: Paramaterize the variance used for the indoor algorithm.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1898 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-06 14:26:40 +00:00
peabody124
e743678d89 AHRS: This fixes the mags, I forgot to normalize the magnetic flux at your
home location.  If you use INSGPS_INDOORS make sure your HomeLocation.Be fields
are correct for your GPS coordinates
http://maps.alfiordalis.com/declination.html

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1862 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-03 20:35:22 +00:00
peabody124
1931c75a4c AHRS: Deal better with DMA errors
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1856 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-03 18:14:36 +00:00
peabody124
a9495e2cbb UAVObjects/AttitudeSettings: Remove unused object, moving data to AHRSettings.
Added attitude bias to AHRSSettings.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1855 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-03 18:14:34 +00:00
peabody124
840df39b78 AHRS: Export gyro data as deg/s instead of rad/s to match the object label
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1851 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-03 15:22:09 +00:00
peabody124
9165fb87b2 AHRS: Calibration values were sent but not locked into EKF
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1847 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-03 04:34:07 +00:00
peabody124
87a822e3f9 AHRS: Add back home location setting north axis
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1846 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-03 04:34:05 +00:00
peabody124
5c9b5f4a99 AHRS: Get calibration working again
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1842 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-02 03:10:04 +00:00
peabody124
0c30101f54 AHRS: Made an object setting to allow the downsampling rate to be changed on the
fly (EKF rate up to a limit).  Also, now the algorithm selects if you are
indoor or outdoor as well as if you use a mag indoor (if you do set the z
variance higher than it calibrates to).

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1841 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-02 03:10:01 +00:00
peabody124
104dc165a9 AHRS: Max downsample that doesn't cause huge amounts of drops right now is 20
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1840 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-02 02:17:34 +00:00
peabody124
ea3fb03c7f Flight/AHRS Communications: Switch to Les' very nice UAVObject communication
scheme

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1835 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-02 02:17:18 +00:00
les
683aa2b480 AHRS: Tidied up calibration sequence
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1831 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-01 19:41:00 +00:00
les
b2d56ca34c AHRS: Added UAVObject based SPI communication between AHRS and OP.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1830 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-10-01 17:31:13 +00:00
peabody124
e2d63cbf19 Flight & Ground/AHRS Calibration: Made variance estimation into a two pass
approach again because ran out of numerical precision for single pass.  Also
made ground force the gyro signs to be correct.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1806 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-30 04:30:29 +00:00
peabody124
6d811cc4db OP-140 AHRS: Don't run INSGPS until OP says board is initialized. This will
also block heart beat.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1767 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-26 03:06:57 +00:00
peabody124
a3ea9a5461 AHRS: Add a weak mag correction in indoor mode to remove gyro bias and try and
get a reliable heading

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1765 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-26 03:06:51 +00:00
peabody124
77b68e5169 Flight/Guidance: Initial template for guidance module
Flight: Create PositionDesired (the active waypoint) UAVObject and make the FlightSituationActual no update since it not used.
Flight: New velocity desired object that passes information between the look computing the desired velocity and the PID loop to get it (updated at different rates)
UAVObjects/PositionActual: Remove unused GPS fields
UAVObjects/PositionActual VelocityActual: Split the velocity into a separate object.  ALso make sure all the information telemetered around is in cm to avoid using floats.
UAVObject/GuidanceSettings: New guidance settings object for the guidance module
Flight/Posix: Add the new objects to the Posix sim
Flight/Guidance: Computes a desired velocity based on position error than runs a PID loop to control roll and pitch to achieve that velocity.  All distances are in cm, and updated the PositionActual fields to reflect this and use int32.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1760 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-26 03:06:27 +00:00
zedamota
0371808099 OP-21/Flight Bootloader - should make things cross platform.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1757 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-26 00:36:42 +00:00
peabody124
a01783b2a8 OP-140 AHRS: Explicilty deal with if it is initialized or not, use that to
determine retransmitting calibration, home location and such.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1755 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-25 21:05:38 +00:00
peabody124
9b28f2d72c OP-167 OP-157 AHRS/Calibration: Added mag scale and really cleaned up calibration.
Calibration should take less time now too (using second moments to estimate
variance in one pass).  Now need to change to multiple messages to get the
calibration in to keep the request message size minimal.  Also currently
running sensor calibrate doesn't store the gyro bias so if you want to use this
you'll have to tweak it manually.  I'll fix that step tomorrow.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1741 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-25 09:20:38 +00:00
peabody124
a1a3b0774f Flight/AHRS: Update code to coding conventions.
find ./flight/AHRS/ \! \( -name '*~' -a -prune \) -type f    | xargs -I{} bash -c 'echo {}; dos2unix {}; gnuindent -npro -kr -i8 -ts8 -sob -ss -ncs -cp1 -il0 {};'

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1707 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-21 19:29:39 +00:00
zedamota
5fb45f835e OP-21/Flight Bootloader - Bug fix, 1 more
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1696 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-20 17:09:06 +00:00
zedamota
3ba6372dc4 OP-21/Flight Bootloader - Clean up and linker files for the AHRS
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1691 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-19 18:27:53 +00:00
peabody124
0ea95fbad1 AHRS: Separate covariance prediction from state prediction to get updated state out of spi a few milliseconds sooner.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1675 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:15:00 +00:00
peabody124
92c36114f3 AHRS: No longer reinit after a comms glitch. Allow time for EKF to converge (2-3 seconds) after power up.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1674 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:14:20 +00:00
zedamota
e8d6e7c557 Flight - Centralized board specific files, BL and User FW uses the same board definitions, no need to have 2.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1663 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 19:19:38 +00:00
peabody124
832b61ab86 OP-117 AHRS: Binary streaming of the raw data within EKF. Doesn't keep up while running this but does give accurate data that went into algorithm. Once we can dynamically change sampling rate will be good.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1655 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 05:26:14 +00:00
peabody124
885c966e53 AHRS: Added a tracker for number of ADC updates the EKF misses. Also updated the Telemetry autogenerated files to accomodate the 11500 baud rate.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1652 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 02:59:00 +00:00
peabody124
ff1b303083 AHRS: Only do EKF correction with mag when new data available
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1651 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 02:58:56 +00:00
peabody124
19e80da928 AHRS: Update UAVObject with information about AHRS rate
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1650 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 01:54:21 +00:00
pip
cf864225fe Added easier to find USART baudrate setting PIOS_USART_BAUDRATE.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1640 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:07:37 +00:00
stac
1017d0294b ahrs: always enable -g for gdb debug symbols
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1635 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 15:45:41 +00:00
stac
7886a617dc Revert "ahrs: No longer support -O0 since it doesn't fit"
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1634 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 15:45:39 +00:00
stac
73787f7f15 ahrs: No longer support -O0 since it doesn't fit
Leaving debug on allows the -g option to be enabled
so that we can have symbols in gdb even though we're
forcing the optimization flags to -Os.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1631 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:06 +00:00
stac
cdb8aa37a0 ahrs: Only read mag data when it has been updated
The AHRS mainloop was reading the mag data on every
loop regardless of whether new data was actually
available.  Now that the MAG_DRDY signal is monitored,
we can read only at the rate (10Hz) new data is actually
produced by the sensor.

This also enables future improvements that will remove the
filtering work that is still being done on the mag data on
every iteration.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1630 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:05 +00:00
stac
55d90970ed hmc5843: hide internal #defines and functions
Way too much was being exposed in the API for the
HMC5843.  This commit properly hides internal
details of the driver.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1629 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:04 +00:00
stac
0e7a801e9e hmc5843: Add support for DRDY signal from magnetometer
The DRDY signal from the magnetometer is connected to PB8
on the STM32.  This pin is now configured as an external
interrupt and is now used to signal when new data is
available from the magnetometer.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1628 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:02 +00:00
stac
139da048f6 ahrs: remove unused debug code
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1620 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:51 +00:00
peabody124
c5fe985a45 AHRS: Gets timing working correctly to compute the EKF rate and idle time in real values
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1615 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 07:03:36 +00:00
peabody124
0875dc8442 AHRS: First pass refactoring the ADC code into another function. Still want to clean up a few constants make the downsampling go into a smaller circularbuffer nicely.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1614 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 07:03:34 +00:00
peabody124
1051d894b9 AHRS: Merged in some new code from Dschin that expliclity writes the prediction terms in the covariance matrix. Also made changes to compile with -Os. Now runs around 125 - 150 Hz depending on corrections used (this will become adjustable from GCS shortly).
Squashed commit of the following:

commit 897e3365ab6c762584c34238efd12dc144e72af0
Author: James Cotton <peabody124@gmail.com>
Date:   Mon Sep 13 22:15:21 2010 -0500

    AHRS: Getting it running nice and quickly.

commit 53d72fb849164730c89873cab81c9e09be0b112b
Author: James Cotton <peabody124@gmail.com>
Date:   Mon Sep 13 15:57:46 2010 -0500

    AHRS: Make more variables volatile for -Os.

commit 4fa90821b5d3d8c2ea5e67756313a8a63c0eeb8c
Author: James Cotton <peabody124@gmail.com>
Date:   Mon Sep 13 15:11:31 2010 -0500

    AHRS/Makefile: -O0 not added to allow me to try various space flags that don't break code.

commit 5bd17a304dc28dc271c2f3e8c6cb8ad4a830404f
Author: James Cotton <peabody124@gmail.com>
Date:   Mon Sep 13 14:44:05 2010 -0500

    AHRS: Make debuggign USART easy to disable

commit 5453f2a7939492769fe9e9cc822e69c107320670
Author: James Cotton <peabody124@gmail.com>
Date:   Mon Sep 13 14:38:37 2010 -0500

    AHRS: Explicitly expand covariance prediction.  Brings computations from 160 to 90.  Makes it not fit in AHRS though.

commit b6712da7eece2a464a2073d24b77be22bfa47094
Author: James Cotton <peabody124@gmail.com>
Date:   Sun Sep 12 22:59:42 2010 -0500

    AHRS: Make it easy to comment out the I2C/Magnetometers.

commit 8c84d0091f3d6f6bedc7a0224a4ed9cb099b022b
Author: James Cotton <peabody124@gmail.com>
Date:   Thu Sep 9 00:49:50 2010 -0500

    AHRS: Small change to INSGPS analysis tools

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1613 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 06:42:56 +00:00
pip
7da2fc2ba7 made ahrs_state 'volatile' in ahrs.c to prevent compiler optimization lockup
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1612 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-13 20:56:58 +00:00
peabody124
4a4932e5ff AHRS/FSM: Small initialization detail to make compile with -Os
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1610 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-13 19:04:37 +00:00
peabody124
76971a807c AHRS: Some more tweaking of the timings.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1603 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 22:18:18 +00:00
peabody124
ba34bb8c24 AHRS: Oops, didn't notice the message processing was removed from end of loop. Adding back.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1597 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 12:44:57 +00:00
peabody124
59758122e1 AHRS: Cannot process messages while idling as this makes the main loop execution time non-deterministic based on OP (i.e. could get three messages and push the time up). It would be a nice featuer since you can get a raw and EKF update in the same step, but if the AHRS_Comm loop is fast (which is should be to keep update latency low) then this will hammer the AHRS with redunant requests.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1594 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 02:54:51 +00:00
peabody124
56131476ef AHRS: Switch to sampling at 2khz, plenty of CPU usage. However need to make EKF rate different for outdoor mode with this patch because otherwise will drop samples :-(
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1592 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 02:54:47 +00:00
stac
d1dc300081 ahrscomms: remove unused sync and switch_proto messages
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1582 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:25 +00:00
stac
80c92ba54b ahrs: process SPI messages while idle
This makes the AHRS continually process SPI messages
while waiting for new samples to be ready.  This has
the side effect of making the CPU utilization on the
AHRS pin at 99-100% (ie. we make use of all of our
otherwise idle time).

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1581 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:23 +00:00
dschin
e6fea9bb76 Changed the feedback gain matrix K to a global variable in insgps so that it may be inspected.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1577 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-10 20:46:46 +00:00
peabody124
6cdb9b0b48 AHRS: Added Matlab code to analyze the INSGPS friendly data dump format and plot the important variables. This requires "DUMP_FRIENDLY" be enabled in the file.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1560 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-08 06:15:21 +00:00
peabody124
e499f33fd5 AHRS: Improved code to stream raw data from AHRS and added a matlab function to acquire and analyze the data. The QT program to analyze it should work but QextSerial seems to have a bug and drops or inserts data
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1559 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-08 06:15:18 +00:00
peabody124
9895b403c7 Ground/SerialLogging: Improved the serial dump from AHRS to have a big random frame header and to detect it on the logging program.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1556 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-07 16:33:10 +00:00
peabody124
e06162fa3a Flight/AHRS: Reorganized the code a little to make sure indoor used by default unless GPS updates come
in.  Also change the velocity variance in indoor mode to lower to make it get a better attitude estimate (primarily faster convergence - probably will tweak this in the future dynamically).  Finally decreased barometer variance - in scope it's actually quite reasonable, normally within +/- .5 m.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1546 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-06 07:54:19 +00:00
peabody124
404e0c2f44 OP-132 AHRS: Changes to the Indoor flight handling to only use the barometer indoors and update with a zero for velocity and high variance.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1517 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-04 02:19:04 +00:00
peabody124
a406034ed9 OP-132 Flight/AHRS: Changed the heuristics regarding GPS quality and INSGPS updates. Now if satellites < 7 or PDOP > 3.5 it does not perform GPS updates. Professor is working on some code to fix parts of the covariance matrix. If indoor updates high a 0 position and velocity and high variance.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1515 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-04 02:19:00 +00:00
peabody124
12657440c3 OP-132 AHRS: Added an indoor flight mode and also add an ad-hoc quality heuristic to the GPS signal to increase the measurement variance from GPS when fix quality is poor or when in indoor flight mode. In addition corrected the indentation to conform to the tab/space convention forum discussion.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1474 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-31 02:11:09 +00:00