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

759 Commits

Author SHA1 Message Date
zedamota
87dc0908ce OP-21/Flight Bootloader - Bug fix
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1695 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-20 16:29:34 +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
zedamota
128df749f0 OP-21/Flight Bootloader - small bug fix
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1683 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-18 23:38:45 +00:00
zedamota
c9752a6a3a OP-21/Flight Bootloader - some changes for the bootloader to work
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1682 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-18 23:11:42 +00:00
zedamota
1b9811aa0e OP-21/Flight Bootloader - AHRS programming fully working
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1681 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-18 23:10:26 +00:00
zedamota
97b44ffb04 OP-21/Flight Bootloader - Various fixes.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1678 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-18 00:46:34 +00:00
peabody124
11f2b1a8dc Flight/Stabilization: Dont cap error at maximum stabilization value - that is to scale control throws. Create another variable if we want this.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1676 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:15:02 +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
peabody124
8e0c5136c0 AHRS/Comms: Make the polling delay 1ms instead of 20ms to make sure if a message isn't ready we don't pause for a long time.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1673 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:12:25 +00:00
andrew
da1a762072 Added basic code for Yaw stabilisation in manual mode for Helis.
This is functionally the same as having a heading hold gyro in hardware.
Code is copied from the simple stabilisation routine and is a bit rough at the minute, but initial testing looks good.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1670 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 05:52:34 +00:00
peabody124
41b7a99883 Flight/Stabilization: Yaw rate stabilization error should be normalized by dt
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1669 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 02:00:55 +00:00
peabody124
a6ca5b82e7 OP-155 Flight/HID: Make the HID stall when buffer full. Not sure the consequences on ground (i.e. if it handles the stall correctly)
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1665 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 20:23:02 +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
3b015b41c5 Flight: Got a much nicer arming/disarming system going. Made it a separate flag in the end to allow testing the stabilization code with motors not running. Also changes maxRoll/maxPitch/maxYaw to uint8 to keep object size smaller - no reason for float precision for this.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1660 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 15:41:11 +00:00
peabody124
a6e71177e4 AHRS: Yaw stabilization now supports rate stabilization or heading hold. Also need to cleanly support rate stabilization on all the other axis. Les suggested this be in manual mode which will require changing the logic somewhat (essentially for vtol it will always be running through the Stabilization module) in an aircraft dependent manner. An alternative would be a stabilization flag indicating to do full attitude hold, attitude + yaw stabilization, or all axis gyro stabilization. This would be my preference.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1659 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 15:41:08 +00:00
peabody124
110c46216e OP-155 Flight: Increase the pios_com buffer size to support these larger objects. If this gets worse and we don't want to use as much OP memory we can make it stall the USB bus when the buffer is full.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1657 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 05:57:03 +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
0b8756d55c OP-148 AHRS/Comms: For now don't retransmit calibration after comms glitch as this re-zeros gyro bias and makes attitude stutter. Need to explicitly communicate when comms glitches and query if AHRS actually rebooted.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1654 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 05:26:12 +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
zedamota
4d0d865c31 OP-21/Flight Bootloader - fix to paths
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1647 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 18:03:52 +00:00
pip
82be9117d6 Added USART baudrate defines into pios_board.h & '#if defined's into pios_board.c
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1646 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:37:50 +00:00
pip
d2bc126e68 Added PIOS_COM_AUX_BAUDRATE to pios_board.h & '#if defined' to pios_board.c for easier baudrate setting.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1645 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:33:00 +00:00
pip
73c8194acc Added PIOS_COM_TELEM_BAUDRATE, PIOS_COM_GPS_BAUDRATE, PIOS_COM_AUX_BAUDRATE & PIOS_COM_SPEKTRUM_BAUDRATE defines in pios_board.h with '#if defines' in pios_board.c for easier baudrate changing.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1644 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:18:38 +00:00
zedamota
3e89e388fa OP-21/Flight Bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1643 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:09:27 +00:00
zedamota
c72a5b1cfe OP-21/Flight Bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1642 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:08:24 +00:00
zedamota
f972b78bfb OP-21/Flight Bootloader
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1641 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:07:43 +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
zedamota
50b7931a1c OP-21/Flight Bootloader - new bootloaders
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1639 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:06:51 +00:00
pip
89fb0b8582 Made pios_hmc5843_data_ready volatile (accessed by both interrupts and main exec loop).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1638 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:00:36 +00:00
zedamota
df88140f51 OP-21/Flight Bootloader - Remove deprecated bootloaders
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1637 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 16:58:00 +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
pip
22b9b2512e Added a 115200 baud telemetry option to the OP main board/UAVTalk.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1632 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:43:42 +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
4ac001553d hmc5843: convert line endings from CRLF to LF
No functional changes.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1627 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:00 +00:00
stac
ac6989fbeb bmp085: fix configuration of EOC interrupt
The EOC EXTI interrupt configuration was incorrectly
pointing at GPIOG pin 8 rather than GPIOC pin 15.
This was preventing the EOC interrupt from working
properly.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1626 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:59 +00:00
stac
88e73906d0 i2c: Add recovery code for i2c bus errors
I2C bus errors are now recoverable.  The bus is properly reset
and an error indication is now provided to the caller whenever
a bus error occurs during processing of the transaction list.

For now, the users of the I2C layer just retry infinitely on
failure.  The BMP085 and HMC5843 code should be changed to
report errors to its callers to allow a more sensible retry
strategy.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1625 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:57 +00:00
stac
0122394481 i2c: consolidate handling of AUTO transitions
AUTO transitions in the FSM are now handled immediately
after processing each newly injected event rather than only
at the end of the EV ISR.

This consolidation allows the upcoming addition of event
injection from both the EV and ER ISR contexts.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1624 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:56 +00:00
stac
7d5463e5e6 i2c: Move polling for bus stopped from ISR to task/mainloop
Occasionally, the I2C driver races with the STM32 I2C peripheral
at the end of a bus cycle.  This leaves the bus in an errored
state and the stop condition is not properly asserted on the bus.

The polling for the stopped condition was previously implemented
in ISR context since it was expected to be nearly instananeous.
In the error condition, however, the stop condition will never
happen.  The polling for this case is now done by the initiating
task (or mainloop on the AHRS) to prevent the timeout condition
from triggering the watchdog.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1623 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:55 +00:00
stac
65ad2caf8a i2c: Make transaction initiator available in txn list
The info field in the pios_i2c_txn list can now be used
to provide a const string which describes the context
for this transaction.

This is very helpful when diagnosing an error that occurs
somewhere in the middle of the I2C FSM since the FSM runs
primarily in the ISR where the original context for the
transactions is no longer available in the traceback.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1622 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:53 +00:00
stac
85c60479c1 i2c: rename FSM faulted state
Differentiate the _FSM_ faulted from the (soon to
exist _BUS_ faulted state.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1621 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:52 +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
pip
cc3860daaf Added 'uint32_t PIOS_SYS_getCPUFlashSize(void)' into pios_sys.c/h files.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1616 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 09:18:55 +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